// A vbox to hold everything
m_pWidget = ui::VBox( FALSE,0 );
// Frame for file row
- frame = gtk_frame_new( "File" );
+ frame = ui::Frame( "File" );
gtk_box_pack_start( GTK_BOX( m_pWidget ),frame, FALSE, FALSE, 2 );
// hbox for first row
gtk_widget_show( frame );
// second row (rendering options)
- frame = gtk_frame_new( "Rendering" );
+ frame = ui::Frame( "Rendering" );
gtk_box_pack_start( GTK_BOX( m_pWidget ),frame, FALSE, FALSE, 2 );
hbox = ui::HBox( FALSE,5 );
gtk_widget_show( hbox );
gtk_widget_show( frame );
// Third row (size and position)
- frame = gtk_frame_new( "Size/Position (undefined)" );
+ frame = ui::Frame( "Size/Position (undefined)" );
m_pPosLabel = gtk_frame_get_label_widget( GTK_FRAME( frame ) );
gtk_box_pack_start( GTK_BOX( m_pWidget ), frame, FALSE, FALSE, 2 );
// ---- /hbox ----
- frame = gtk_frame_new( "Reset Texture Names" );
+ frame = ui::Frame( "Reset Texture Names" );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
// ---- /frame ----
- frame = gtk_frame_new( "Reset Scales" );
+ frame = ui::Frame( "Reset Scales" );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
// ---- /frame ----
- frame = gtk_frame_new( "Reset Shift" );
+ frame = ui::Frame( "Reset Shift" );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
// ---- /frame ----
- frame = gtk_frame_new( "Reset Rotation" );
+ frame = ui::Frame( "Reset Rotation" );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
// ---- /hbox ----
- frame = gtk_frame_new( "Radii" );
+ frame = ui::Frame( "Radii" );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
- frame = gtk_frame_new( "Angles" );
+ frame = ui::Frame( "Angles" );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
gtk_widget_show( angleEnd );
- frame = gtk_frame_new( "Height" );
+ frame = ui::Frame( "Height" );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
- frame = gtk_frame_new( "Points" );
+ frame = ui::Frame( "Points" );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox );
- frame = gtk_frame_new( "Type" );
+ frame = ui::Frame( "Type" );
gtk_box_pack_start( GTK_BOX( hbox ), frame, TRUE, TRUE, 0 );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox );
- frame = gtk_frame_new( "Type" );
+ frame = ui::Frame( "Type" );
gtk_box_pack_start( GTK_BOX( hbox ), frame, TRUE, TRUE, 0 );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox );
- frame = gtk_frame_new( "Type" );
+ frame = ui::Frame( "Type" );
gtk_box_pack_start( GTK_BOX( hbox ), frame, TRUE, TRUE, 0 );
gtk_widget_show( frame );
// -------------------------- //
- frame = gtk_frame_new( "Path and Target editing" );
+ frame = ui::Frame( "Path and Target editing" );
gtk_widget_show( frame );
gtk_table_attach( GTK_TABLE( table ), frame, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
// -------------------------- //
- frame = gtk_frame_new( "Time" );
+ frame = ui::Frame( "Time" );
gtk_widget_show( frame );
gtk_table_attach( GTK_TABLE( table ), frame, 0, 1, 2, 3,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
gtk_widget_show( label );
gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), table, label );
- frame = gtk_frame_new( "Game" );
+ frame = ui::Frame( "Game" );
gtk_widget_show( frame );
gtk_table_attach( GTK_TABLE( table ), frame, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_game ), GINT_TO_POINTER( i ) );
}
- frame = gtk_frame_new( "Waveform" );
+ frame = ui::Frame( "Waveform" );
gtk_widget_show( frame );
gtk_table_attach( GTK_TABLE( table ), frame, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_wave ), GINT_TO_POINTER( i ) );
}
- frame = gtk_frame_new( "Orientation" );
+ frame = ui::Frame( "Orientation" );
gtk_widget_show( frame );
gtk_table_attach( GTK_TABLE( table ), frame, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
gtk_widget_show( hbox2 );
gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, TRUE, 0 );
- frame = gtk_frame_new( "Extents" );
+ frame = ui::Frame( "Extents" );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( hbox2 ), frame, TRUE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "vmax", entry );
g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Vur );
- frame = gtk_frame_new( "Divisions" );
+ frame = ui::Frame( "Divisions" );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( hbox2 ), frame, TRUE, TRUE, 0 );
gtk_scale_set_digits( GTK_SCALE( scale ), 0 );
g_object_set_data( G_OBJECT( dlg ), "decimate", scale );
- frame = gtk_frame_new( "Corner values" );
+ frame = ui::Frame( "Corner values" );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
g_signal_connect( G_OBJECT( spin ), "focus_out_event", G_CALLBACK( doublevariable_spinfocusout ), &azimuth );
#endif
- frame = gtk_frame_new( NULL );
+ frame = ui::Frame( nullptr );
gtk_widget_show( frame );
gtk_frame_set_shadow_type( GTK_FRAME( frame ), GTK_SHADOW_IN );
gtk_box_pack_start( GTK_BOX( vbox ), frame, TRUE, TRUE, 0 );
gtk_container_add( GTK_CONTAINER( dlg ), vbox );
gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
- frame = gtk_frame_new( "3D View" );
+ frame = ui::Frame( "3D View" );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, TRUE, TRUE, 0 );
gtk_box_pack_start( GTK_BOX( hbox ), portalcheck, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( portalcheck ), "toggled", GTK_SIGNAL_FUNC( OnClip ), NULL );
- frame = gtk_frame_new( "2D View" );
+ frame = ui::Frame( "2D View" );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, TRUE, TRUE, 0 );
}
GtkFrame* create_dialog_frame( const char* label, GtkShadowType shadow ){
- GtkFrame* frame = GTK_FRAME( gtk_frame_new( label ) );
+ GtkFrame* frame = ui::Frame( label );
gtk_widget_show( GTK_WIDGET( frame ) );
gtk_frame_set_shadow_type( frame, shadow );
return frame;
PathEntry PathEntry_new(){
- GtkFrame* frame = GTK_FRAME( gtk_frame_new( NULL ) );
+ GtkFrame* frame = ui::Frame();
gtk_widget_show( GTK_WIDGET( frame ) );
gtk_frame_set_shadow_type( frame, GTK_SHADOW_IN );
#include "frame.h"
#include <gtk/gtkframe.h>
+#include <uilib/uilib.h>
GtkFrame* create_framed_widget( GtkWidget* widget ){
- GtkFrame* frame = GTK_FRAME( gtk_frame_new( 0 ) );
+ GtkFrame* frame = ui::Frame();
gtk_widget_show( GTK_WIDGET( frame ) );
gtk_frame_set_shadow_type( frame, GTK_SHADOW_IN );
gtk_container_add( GTK_CONTAINER( frame ), widget );
Entry::Entry(std::size_t max_length) : Entry(GTK_ENTRY(gtk_entry_new_with_max_length(max_length)))
{ }
+ Frame::Frame(const char *label) : Frame(GTK_FRAME(gtk_frame_new(label)))
+ { }
+
HBox::HBox(bool homogenous, int spacing) : HBox(GTK_HBOX(gtk_hbox_new(homogenous, spacing)))
{ }
using ui_cellrenderertext = struct _GtkCellRendererText;
using ui_entry = struct _GtkEntry;
using ui_evkey = struct _GdkEventKey;
+using ui_frame = struct _GtkFrame;
using ui_hbox = struct _GtkHBox;
using ui_label = struct _GtkLabel;
using ui_menu = struct _GtkMenu;
Entry(std::size_t max_length);
);
+ WRAP(Frame, Widget, ui_frame,
+ Frame(const char *label = nullptr);
+ );
+
WRAP(HBox, Box, ui_hbox,
HBox(bool homogenous, int spacing);
);
for ( int i = 1; i < c_count_status; ++i )
{
- GtkFrame* frame = GTK_FRAME( gtk_frame_new( 0 ) );
+ GtkFrame* frame = ui::Frame();
gtk_widget_show( GTK_WIDGET( frame ) );
gtk_table_attach_defaults( table, GTK_WIDGET( frame ), i, i + 1, 0, 1 );
gtk_frame_set_shadow_type( frame, GTK_SHADOW_IN );
gtk_widget_show( GTK_WIDGET( vbox2 ) );
gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox2 ), TRUE, TRUE, 0 );
{
- GtkFrame* frame = GTK_FRAME( gtk_frame_new( "Details" ) );
+ GtkFrame* frame = ui::Frame( "Details" );
gtk_widget_show( GTK_WIDGET( frame ) );
gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
{
}
}
if ( g_pGameDescription->mGameType == "doom3" ) {
- GtkFrame* frame = GTK_FRAME( gtk_frame_new( "Tesselation" ) );
+ GtkFrame* frame = ui::Frame( "Tesselation" );
gtk_widget_show( GTK_WIDGET( frame ) );
gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
{
}
}
{
- GtkFrame* frame = GTK_FRAME( gtk_frame_new( "Texturing" ) );
+ GtkFrame* frame = ui::Frame( "Texturing" );
gtk_widget_show( GTK_WIDGET( frame ) );
gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
{
ui::Widget preflabel = ui::Label( name );
gtk_widget_show( preflabel );
- ui::Widget pageframe = ui::Widget(gtk_frame_new( name ));
+ ui::Widget pageframe = ui::Frame( name );
gtk_container_set_border_width( GTK_CONTAINER( pageframe ), 4 );
gtk_widget_show( pageframe );
}
{
- ui::Widget frame = ui::Widget(gtk_frame_new( "Texturing" ));
+ ui::Widget frame = ui::Frame( "Texturing" );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), FALSE, FALSE, 0 );
{
}
if ( !string_empty( g_pGameDescription->getKeyValue( "si_flags" ) ) ) {
{
- GtkFrame* frame = GTK_FRAME( gtk_frame_new( "Surface Flags" ) );
+ GtkFrame* frame = ui::Frame( "Surface Flags" );
gtk_widget_show( GTK_WIDGET( frame ) );
gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
{
}
}
{
- GtkFrame* frame = GTK_FRAME( gtk_frame_new( "Content Flags" ) );
+ GtkFrame* frame = ui::Frame( "Content Flags" );
gtk_widget_show( GTK_WIDGET( frame ) );
gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
{
}
}
{
- GtkFrame* frame = GTK_FRAME( gtk_frame_new( "Value" ) );
+ GtkFrame* frame = ui::Frame( "Value" );
gtk_widget_show( GTK_WIDGET( frame ) );
gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
{
#if TEXTOOL_ENABLED
if ( g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES ) {
// Shamus: Textool goodies...
- ui::Widget frame = gtk_frame_new( "Textool" );
+ ui::Widget frame = ui::Frame( "Textool" );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), FALSE, FALSE, 0 );
{
{ // Tag frame
frame_table = ui::Table( 3, 3, FALSE );
- g_TextureBrowser.m_tag_frame = ui::Widget(gtk_frame_new( "Tag assignment" ));
+ g_TextureBrowser.m_tag_frame = ui::Frame( "Tag assignment" );
gtk_frame_set_label_align( GTK_FRAME( g_TextureBrowser.m_tag_frame ), 0.5, 0.5 );
gtk_frame_set_shadow_type( GTK_FRAME( g_TextureBrowser.m_tag_frame ), GTK_SHADOW_NONE );