]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Wrap GtkCheckButton
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 03:01:13 +0000 (14:01 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 03:01:13 +0000 (14:01 +1100)
contrib/bobtoolz/dialogs/dialogs-gtk.cpp
contrib/camera/dialogs.cpp
contrib/gtkgensurf/gendlgs.cpp
contrib/prtview/ConfigDialog.cpp
contrib/prtview/LoadPortalFileDialog.cpp
libs/uilib/uilib.cpp
libs/uilib/uilib.h
radiant/dialog.cpp
radiant/entityinspector.cpp
radiant/findtexturedialog.cpp
radiant/surfacedialog.cpp

index 08f1205c6c2abd7d8f3c74d27d32a09c509c76be..0901037f405ddc5ad8a9b375c8c1bcfe1563c09e 100644 (file)
@@ -362,11 +362,11 @@ EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 2 );
        gtk_widget_show( w );
 
-       check1 = gtk_check_button_new_with_label( "Include Detail Brushes" );
+       check1 = ui::CheckButton( "Include Detail Brushes" );
        gtk_box_pack_start( GTK_BOX( vbox ), check1, FALSE, FALSE, 0 );
        gtk_widget_show( check1 );
 
-       check2 = gtk_check_button_new_with_label( "Select Duplicate Brushes Only" );
+       check2 = ui::CheckButton( "Select Duplicate Brushes Only" );
        gtk_box_pack_start( GTK_BOX( vbox ), check2, FALSE, FALSE, 0 );
        gtk_widget_show( check2 );
 
@@ -506,17 +506,17 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){
 
        // ---- vbox2 ----
 
-       check1 = gtk_check_button_new_with_label( "Use Border" );
+       check1 = ui::CheckButton( "Use Border" );
        gtk_box_pack_start( GTK_BOX( vbox2 ), check1, FALSE, FALSE, 0 );
        gtk_widget_show( check1 );
 
 
-       check2 = gtk_check_button_new_with_label( "Inverse Polygon" );
+       check2 = ui::CheckButton( "Inverse Polygon" );
        gtk_box_pack_start( GTK_BOX( vbox2 ), check2, FALSE, FALSE, 0 );
        gtk_widget_show( check2 );
 
 
-       check3 = gtk_check_button_new_with_label( "Align Top Edge" );
+       check3 = ui::CheckButton( "Align Top Edge" );
        gtk_box_pack_start( GTK_BOX( vbox2 ), check3, FALSE, FALSE, 0 );
        gtk_widget_show( check3 );
 
@@ -730,7 +730,7 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){
        // djbob: think we need some button callback functions or smuffin
        // FIXME: actually get around to doing what i suggested!!!!
 
-       checkUseDetail = gtk_check_button_new_with_label( "Use Detail Brushes" );
+       checkUseDetail = ui::CheckButton( "Use Detail Brushes" );
        gtk_box_pack_start( GTK_BOX( hbox ), checkUseDetail, FALSE, FALSE, 0 );
        gtk_widget_show( checkUseDetail );
 
@@ -917,12 +917,12 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){
 
        // sp: horizontally ????
        // djbob: yes mars, u can spell :]
-       checkScaleMainH = gtk_check_button_new_with_label( "Scale Main Texture Horizontally" );
+       checkScaleMainH = ui::CheckButton( "Scale Main Texture Horizontally" );
        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( checkScaleMainH ), TRUE );
        gtk_box_pack_start( GTK_BOX( hbox ), checkScaleMainH, FALSE, FALSE, 0 );
        gtk_widget_show( checkScaleMainH );
 
-       checkScaleTrimH = gtk_check_button_new_with_label( "Scale Trim Texture Horizontally" );
+       checkScaleTrimH = ui::CheckButton( "Scale Trim Texture Horizontally" );
        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( checkScaleTrimH ), TRUE );
        gtk_box_pack_start( GTK_BOX( hbox ), checkScaleTrimH, FALSE, FALSE, 0 );
        gtk_widget_show( checkScaleTrimH );
@@ -933,12 +933,12 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       checkScaleMainV = gtk_check_button_new_with_label( "Scale Main Texture Vertically" );
+       checkScaleMainV = ui::CheckButton( "Scale Main Texture Vertically" );
        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( checkScaleMainV ), TRUE );
        gtk_box_pack_start( GTK_BOX( hbox ), checkScaleMainV, FALSE, FALSE, 0 );
        gtk_widget_show( checkScaleMainV );
 
-       checkScaleTrimV = gtk_check_button_new_with_label( "Scale Trim Texture Vertically" );
+       checkScaleTrimV = ui::CheckButton( "Scale Trim Texture Vertically" );
        gtk_box_pack_start( GTK_BOX( hbox ), checkScaleTrimV, FALSE, FALSE, 0 );
        gtk_widget_show( checkScaleTrimV );
 
@@ -1155,11 +1155,11 @@ EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
-       check1 = gtk_check_button_new_with_label( "No Dynamic Update" );
+       check1 = ui::CheckButton( "No Dynamic Update" );
        gtk_box_pack_start( GTK_BOX( vbox ), check1, FALSE, FALSE, 0 );
        gtk_widget_show( check1 );
 
-       check2 = gtk_check_button_new_with_label( "Show Bounding Lines" );
+       check2 = ui::CheckButton( "Show Bounding Lines" );
        gtk_box_pack_start( GTK_BOX( vbox ), check2, FALSE, FALSE, 0 );
        gtk_widget_show( check2 );
 
@@ -1361,7 +1361,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
 
        // ---- frame ----
 
-       dlgTexReset.cbTexChange = gtk_check_button_new_with_label( "Enabled" );
+       dlgTexReset.cbTexChange = ui::CheckButton( "Enabled" );
        gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbTexChange ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL );
        gtk_widget_show( dlgTexReset.cbTexChange );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbTexChange, 0, 1, 0, 1,
@@ -1409,7 +1409,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
 
        // ---- frame ----
 
-       dlgTexReset.cbScaleHor = gtk_check_button_new_with_label( "Enabled" );
+       dlgTexReset.cbScaleHor = ui::CheckButton( "Enabled" );
        gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleHor ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL );
        gtk_widget_show( dlgTexReset.cbScaleHor );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbScaleHor, 0, 1, 0, 1,
@@ -1430,7 +1430,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
        gtk_widget_show( dlgTexReset.editScaleHor );
 
 
-       dlgTexReset.cbScaleVert = gtk_check_button_new_with_label( "Enabled" );
+       dlgTexReset.cbScaleVert = ui::CheckButton( "Enabled" );
        gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleVert ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL );
        gtk_widget_show( dlgTexReset.cbScaleVert );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbScaleVert, 0, 1, 1, 2,
@@ -1465,7 +1465,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
 
        // ---- frame ----
 
-       dlgTexReset.cbShiftHor = gtk_check_button_new_with_label( "Enabled" );
+       dlgTexReset.cbShiftHor = ui::CheckButton( "Enabled" );
        gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftHor ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL );
        gtk_widget_show( dlgTexReset.cbShiftHor );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbShiftHor, 0, 1, 0, 1,
@@ -1486,7 +1486,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
        gtk_widget_show( dlgTexReset.editShiftHor );
 
 
-       dlgTexReset.cbShiftVert = gtk_check_button_new_with_label( "Enabled" );
+       dlgTexReset.cbShiftVert = ui::CheckButton( "Enabled" );
        gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftVert ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL );
        gtk_widget_show( dlgTexReset.cbShiftVert );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbShiftVert, 0, 1, 1, 2,
@@ -1521,7 +1521,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
 
        // ---- frame ----
 
-       dlgTexReset.cbRotation = gtk_check_button_new_with_label( "Enabled" );
+       dlgTexReset.cbRotation = ui::CheckButton( "Enabled" );
        gtk_widget_show( dlgTexReset.cbRotation );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbRotation, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
index a314b974f8050b120f3b10d6b0130925f5e61ca0..6831c3af74b885a862dcff44c6d84bd1e2920794 100644 (file)
@@ -1232,7 +1232,7 @@ GtkWidget *CreateCameraInspectorDialog( void ){
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       g_pTrackCamera = gtk_check_button_new_with_label( "Track Camera" );
+       g_pTrackCamera = ui::CheckButton( "Track Camera" );
        gtk_box_pack_start( GTK_BOX( hbox ), g_pTrackCamera, FALSE, FALSE, 0 );
        gtk_widget_show( g_pTrackCamera );
 
index 9cd424bb218d748c03b0599e101b115f43a73e30..f3faae300cba027df8c1a9c9d410675045387292 100644 (file)
@@ -1668,7 +1668,7 @@ GtkWidget* create_main_dialog(){
        gtk_widget_set_usize( spin, 60, -2 );
        g_object_set_data( G_OBJECT( dlg ), "nv", spin );
 
-       check = gtk_check_button_new_with_label( "Use Bezier patches" );
+       check = ui::CheckButton( "Use Bezier patches" );
        gtk_widget_show( check );
        gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
        g_object_set_data( G_OBJECT( dlg ), "use_patches", check );
@@ -1778,7 +1778,7 @@ GtkWidget* create_main_dialog(){
        g_object_set_data( G_OBJECT( dlg ), "z10", entry );
        g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z10 );
 
-       check = gtk_check_button_new_with_label( "Linear borders" );
+       check = ui::CheckButton( "Linear borders" );
        gtk_widget_show( check );
        gtk_table_attach( GTK_TABLE( table ), check, 0, 4, 2, 3,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -2115,20 +2115,20 @@ GtkWidget* create_main_dialog(){
 
 
 
-       check = gtk_check_button_new_with_label( "Use detail brushes" );
+       check = ui::CheckButton( "Use detail brushes" );
        gtk_widget_show( check );
        gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
        g_object_set_data( G_OBJECT( dlg ), "detail", check );
        g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( texture_detail ), NULL );
 
-       check = gtk_check_button_new_with_label( "Detail hint brushes" );
+       check = ui::CheckButton( "Detail hint brushes" );
        gtk_widget_show( check );
        gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
        g_object_set_data( G_OBJECT( dlg ), "hint", check );
        g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( texture_hint ), NULL );
 
        // ^Fishman - Add terrain key to func_group.
-       check = gtk_check_button_new_with_label( "Add terrain key" );
+       check = ui::CheckButton( "Add terrain key" );
        gtk_widget_show( check );
        gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
        g_object_set_data( G_OBJECT( dlg ), "terrain_ent", check );
@@ -2172,14 +2172,14 @@ GtkWidget* create_main_dialog(){
        gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
        g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_about ), NULL );
 
-       check = gtk_check_button_new_with_label( "Preview" );
+       check = ui::CheckButton( "Preview" );
        gtk_widget_show( check );
        gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
        g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( main_preview ), NULL );
        g_object_set_data( G_OBJECT( dlg ), "main_preview", check );
 
        // ^Fishman - Antializing for the preview window.
-       check = gtk_check_button_new_with_label( "Antialised lines" );
+       check = ui::CheckButton( "Antialised lines" );
        gtk_widget_show( check );
        gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
        g_object_set_data( G_OBJECT( dlg ), "main_antialiasing", check );
index 3bedca33e2d9ca7955f2f6f309e051be37335e9e..97d55d27f4225e922a3d353c331c4929b5c4c271 100644 (file)
@@ -305,28 +305,28 @@ void DoConfigDialog(){
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColorFog ), NULL );
 
-       aa3check = gtk_check_button_new_with_label( "Anti-Alias (May not work on some video cards)" );
+       aa3check = ui::CheckButton( "Anti-Alias (May not work on some video cards)" );
        gtk_widget_show( aa3check );
        gtk_table_attach( GTK_TABLE( table ), aa3check, 1, 4, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_signal_connect( GTK_OBJECT( aa3check ), "toggled", GTK_SIGNAL_FUNC( OnAntiAlias3d ), NULL );
 
-       depthcheck = gtk_check_button_new_with_label( "Depth Cue" );
+       depthcheck = ui::CheckButton( "Depth Cue" );
        gtk_widget_show( depthcheck );
        gtk_table_attach( GTK_TABLE( table ), depthcheck, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_signal_connect( GTK_OBJECT( depthcheck ), "toggled", GTK_SIGNAL_FUNC( OnFog ), NULL );
 
-       linescheck = gtk_check_button_new_with_label( "Lines" );
+       linescheck = ui::CheckButton( "Lines" );
        gtk_widget_show( linescheck );
        gtk_table_attach( GTK_TABLE( table ), linescheck, 2, 3, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_signal_connect( GTK_OBJECT( linescheck ), "toggled", GTK_SIGNAL_FUNC( OnLines ), NULL );
 
-       polyscheck = gtk_check_button_new_with_label( "Polygons" );
+       polyscheck = ui::CheckButton( "Polygons" );
        gtk_widget_show( polyscheck );
        gtk_table_attach( GTK_TABLE( table ), polyscheck, 3, 4, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -401,12 +401,12 @@ void DoConfigDialog(){
        gtk_widget_show( hbox );
        gtk_box_pack_start( GTK_BOX( vbox2 ), hbox, TRUE, FALSE, 0 );
 
-       show3check = gtk_check_button_new_with_label( "Show" );
+       show3check = ui::CheckButton( "Show" );
        gtk_widget_show( show3check );
        gtk_box_pack_start( GTK_BOX( hbox ), show3check, TRUE, TRUE, 0 );
        gtk_signal_connect( GTK_OBJECT( show3check ), "toggled", GTK_SIGNAL_FUNC( OnConfig3d ), NULL );
 
-       portalcheck = gtk_check_button_new_with_label( "Portal cubic clipper" );
+       portalcheck = ui::CheckButton( "Portal cubic clipper" );
        gtk_widget_show( portalcheck );
        gtk_box_pack_start( GTK_BOX( hbox ), portalcheck, TRUE, TRUE, 0 );
        gtk_signal_connect( GTK_OBJECT( portalcheck ), "toggled", GTK_SIGNAL_FUNC( OnClip ), NULL );
@@ -445,7 +445,7 @@ void DoConfigDialog(){
        gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColor2d ), NULL );
        gtk_widget_set_usize( button, 60, -2 );
 
-       aa2check = gtk_check_button_new_with_label( "Anti-Alias (May not work on some video cards)" );
+       aa2check = ui::CheckButton( "Anti-Alias (May not work on some video cards)" );
        gtk_widget_show( aa2check );
        gtk_box_pack_start( GTK_BOX( hbox ), aa2check, TRUE, TRUE, 0 );
        gtk_signal_connect( GTK_OBJECT( aa2check ), "toggled", GTK_SIGNAL_FUNC( OnAntiAlias2d ), NULL );
@@ -454,7 +454,7 @@ void DoConfigDialog(){
        gtk_widget_show( hbox );
        gtk_box_pack_start( GTK_BOX( vbox2 ), hbox, TRUE, FALSE, 0 );
 
-       show2check = gtk_check_button_new_with_label( "Show" );
+       show2check = ui::CheckButton( "Show" );
        gtk_widget_show( show2check );
        gtk_box_pack_start( GTK_BOX( hbox ), show2check, FALSE, FALSE, 0 );
        gtk_signal_connect( GTK_OBJECT( show2check ), "toggled", GTK_SIGNAL_FUNC( OnConfig2d ), NULL );
index f91404f0ae8a4110699a678c291286e23bfc994d..47ebeaec3ea60094df749e03ecfc639c2de45c66 100644 (file)
@@ -131,11 +131,11 @@ int DoLoadPortalFileDialog(){
        gtk_widget_show( hbox );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
 
-       check3d = gtk_check_button_new_with_label( "Show 3D" );
+       check3d = ui::CheckButton( "Show 3D" );
        gtk_widget_show( check3d );
        gtk_box_pack_start( GTK_BOX( hbox ), check3d, FALSE, FALSE, 0 );
 
-       check2d = gtk_check_button_new_with_label( "Show 2D" );
+       check2d = ui::CheckButton( "Show 2D" );
        gtk_widget_show( check2d );
        gtk_box_pack_start( GTK_BOX( hbox ), check2d, FALSE, FALSE, 0 );
 
index acb2d65aac214ad5ad0f0e94ca4231ddaea12b57..f6b4d22254247d09900bab88e97c4390b7dd415a 100644 (file)
@@ -91,6 +91,9 @@ namespace ui {
     Button::Button(const char *label) : Button(GTK_BUTTON(gtk_button_new_with_label(label)))
     { }
 
+    CheckButton::CheckButton(const char *label) : CheckButton(GTK_CHECK_BUTTON(gtk_check_button_new_with_label(label)))
+    { }
+
     Label::Label(const char *label) : Label(GTK_LABEL(gtk_label_new(label)))
     { }
 
index 50115238acab27c7411b752c1652e1c8156758be..c201b4addbf163a9ce6952ea705b6d4d879f095d 100644 (file)
@@ -5,6 +5,7 @@
 
 using ui_alignment = struct _GtkAlignment;
 using ui_button = struct _GtkButton;
+using ui_checkbutton = struct _GtkCheckButton;
 using ui_evkey = struct _GdkEventKey;
 using ui_label = struct _GtkLabel;
 using ui_menuitem = struct _GtkMenuItem;
@@ -99,38 +100,27 @@ namespace ui {
     }; \
     static_assert(sizeof(name) == sizeof(Widget), "object slicing")
 
-    WRAP(Window, ui_window,
-           Window create_dialog_window(const char *title, void func(), void *data, int default_w = -1,
-                                       int default_h = -1);
-
-                   Window create_modal_dialog_window(const char *title, ui_modal &dialog, int default_w = -1,
-                                                     int default_h = -1);
-
-                   Window create_floating_window(const char *title);
-
-                   std::uint64_t on_key_press(bool (*f)(Widget widget, ui_evkey *event, void *extra),
-                                              void *extra = nullptr);
+    WRAP(Alignment, ui_alignment,
+         Alignment(float xalign, float yalign, float xscale, float yscale);
     );
 
     WRAP(Button, ui_button,
-           Button(const char *label);
+         Button(const char *label);
     );
 
-    WRAP(CheckButton, ui_widget,);
-
-    WRAP(SpinButton, ui_widget,);
-
-    WRAP(MenuItem, ui_menuitem,);
+    WRAP(CheckButton, ui_checkbutton,
+         CheckButton(const char *label);
+    );
 
     WRAP(Label, ui_label,
-           Label(const char *label);
+         Label(const char *label);
     );
 
-    WRAP(Alignment, ui_alignment,
-           Alignment(float xalign, float yalign, float xscale, float yscale);
-    );
+    WRAP(MenuItem, ui_menuitem,);
 
-    WRAP(TreeModel, ui_treemodel, );
+    WRAP(SpinButton, ui_widget,);
+
+    WRAP(TreeModel, ui_treemodel,);
 
     WRAP(TreeView, ui_treeview,
          TreeView(TreeModel model);
@@ -140,6 +130,19 @@ namespace ui {
          VBox(bool homogenous, int spacing);
     );
 
+    WRAP(Window, ui_window,
+         Window create_dialog_window(const char *title, void func(), void *data, int default_w = -1,
+                                     int default_h = -1);
+
+         Window create_modal_dialog_window(const char *title, ui_modal &dialog, int default_w = -1,
+                                           int default_h = -1);
+
+         Window create_floating_window(const char *title);
+
+         std::uint64_t on_key_press(bool (*f)(Widget widget, ui_evkey *event, void *extra),
+                                    void *extra = nullptr);
+    );
+
 #undef WRAP
 
 }
index 4d7d096ca912d9e55f38544ab12bed2ca4edbb42..e59174ea8c0db898bbe7007118cacdf28a6f00fb 100644 (file)
@@ -465,12 +465,12 @@ EMessageBoxReturn Dialog::DoModal(){
 
 
 ui::CheckButton Dialog::addCheckBox( ui::Widget vbox, const char* name, const char* flag, const BoolImportCallback& importViewer, const BoolExportCallback& exportViewer ){
-       ui::Widget check = ui::Widget(gtk_check_button_new_with_label( flag ));
+       auto check = ui::CheckButton( flag );
        gtk_widget_show( check );
        AddBoolToggleData( *GTK_TOGGLE_BUTTON( check ), importViewer, exportViewer );
 
        DialogVBox_packRow( GTK_VBOX( vbox ), GTK_WIDGET( DialogRow_new( name, check ) ) );
-       return ui::CheckButton(check);
+       return check;
 }
 
 ui::CheckButton Dialog::addCheckBox( ui::Widget vbox, const char* name, const char* flag, bool& data ){
index 4d30f8fe03b8eb740880bdf507bd1270a4e1aa11..8fa0a439138d1822e9abac66dd1f85113bb333e0 100644 (file)
@@ -1401,7 +1401,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
 
                                        for ( int i = 0; i < MAX_FLAGS; i++ )
                                        {
-                                               GtkCheckButton* check = GTK_CHECK_BUTTON( gtk_check_button_new_with_label( "" ) );
+                                               GtkCheckButton* check = ui::CheckButton( "" );
                                                gtk_widget_ref( GTK_WIDGET( check ) );
                                                g_object_set_data( G_OBJECT( check ), "handler", gint_to_pointer( g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( SpawnflagCheck_toggled ), 0 ) ) );
                                                g_entitySpawnflagsCheck[i] = check;
index 104f1ee4146e0e1215d2a5db41929918978c8adb..bf37a1f2bba7afb3fcff8f8fcf62e834ba86c654 100644 (file)
@@ -192,7 +192,7 @@ ui::Window FindTextureDialog::BuildDialog(){
        AddDialogData( *GTK_ENTRY( entry ), m_strReplace );
        GlobalTextureEntryCompletion::instance().connect( GTK_ENTRY( entry ) );
 
-       check = ui::Widget(gtk_check_button_new_with_label( "Within selected brushes only" ));
+       check = ui::CheckButton( "Within selected brushes only" );
        gtk_widget_show( check );
        gtk_box_pack_start( GTK_BOX( vbox ), check, TRUE, TRUE, 0 );
        AddDialogData( *GTK_TOGGLE_BUTTON( check ), m_bSelectedOnly );
index acd1f650132b3181e73d81aeaa409b106c292b83..eb35e56ddbc063c4964373531a5726d210db911c 100644 (file)
@@ -965,7 +965,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                {
                                                        for ( int r = 0; r != 8; ++r )
                                                        {
-                                                               GtkCheckButton* check = GTK_CHECK_BUTTON( gtk_check_button_new_with_label( getSurfaceFlagName( c * 8 + r ) ) );
+                                                               GtkCheckButton* check = ui::CheckButton( getSurfaceFlagName( c * 8 + r ) );
                                                                gtk_widget_show( GTK_WIDGET( check ) );
                                                                gtk_table_attach( table, GTK_WIDGET( check ), c, c + 1, r, r + 1,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
@@ -1001,7 +1001,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                {
                                                        for ( int r = 0; r != 8; ++r )
                                                        {
-                                                               GtkCheckButton* check = GTK_CHECK_BUTTON( gtk_check_button_new_with_label( getContentFlagName( c * 8 + r ) ) );
+                                                               GtkCheckButton* check = ui::CheckButton( getContentFlagName( c * 8 + r ) );
                                                                gtk_widget_show( GTK_WIDGET( check ) );
                                                                gtk_table_attach( table, GTK_WIDGET( check ), c, c + 1, r, r + 1,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
@@ -1067,8 +1067,8 @@ ui::Window SurfaceInspector::BuildDialog(){
                                gtk_widget_show( hbox );
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), FALSE, FALSE, 0 );
                                // Checkboxes go here... (Flip X/Y)
-                               ui::Widget flipX = gtk_check_button_new_with_label( "Flip X axis" );
-                               ui::Widget flipY = gtk_check_button_new_with_label( "Flip Y axis" );
+                               ui::Widget flipX = ui::CheckButton( "Flip X axis" );
+                               ui::Widget flipY = ui::CheckButton( "Flip Y axis" );
                                gtk_widget_show( flipX );
                                gtk_widget_show( flipY );
                                gtk_box_pack_start( GTK_BOX( hbox ), flipX, FALSE, FALSE, 0 );