From: TimePath Date: Wed, 17 Feb 2016 03:01:13 +0000 (+1100) Subject: Wrap GtkCheckButton X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=77a453495e98323b7d7b82c1cf68e67e438f9182;p=xonotic%2Fnetradiant.git Wrap GtkCheckButton --- diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp index 08f1205c..0901037f 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp @@ -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 ), diff --git a/contrib/camera/dialogs.cpp b/contrib/camera/dialogs.cpp index a314b974..6831c3af 100644 --- a/contrib/camera/dialogs.cpp +++ b/contrib/camera/dialogs.cpp @@ -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 ); diff --git a/contrib/gtkgensurf/gendlgs.cpp b/contrib/gtkgensurf/gendlgs.cpp index 9cd424bb..f3faae30 100644 --- a/contrib/gtkgensurf/gendlgs.cpp +++ b/contrib/gtkgensurf/gendlgs.cpp @@ -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 ); diff --git a/contrib/prtview/ConfigDialog.cpp b/contrib/prtview/ConfigDialog.cpp index 3bedca33..97d55d27 100644 --- a/contrib/prtview/ConfigDialog.cpp +++ b/contrib/prtview/ConfigDialog.cpp @@ -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 ); diff --git a/contrib/prtview/LoadPortalFileDialog.cpp b/contrib/prtview/LoadPortalFileDialog.cpp index f91404f0..47ebeaec 100644 --- a/contrib/prtview/LoadPortalFileDialog.cpp +++ b/contrib/prtview/LoadPortalFileDialog.cpp @@ -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 ); diff --git a/libs/uilib/uilib.cpp b/libs/uilib/uilib.cpp index acb2d65a..f6b4d222 100644 --- a/libs/uilib/uilib.cpp +++ b/libs/uilib/uilib.cpp @@ -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))) { } diff --git a/libs/uilib/uilib.h b/libs/uilib/uilib.h index 50115238..c201b4ad 100644 --- a/libs/uilib/uilib.h +++ b/libs/uilib/uilib.h @@ -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 } diff --git a/radiant/dialog.cpp b/radiant/dialog.cpp index 4d7d096c..e59174ea 100644 --- a/radiant/dialog.cpp +++ b/radiant/dialog.cpp @@ -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 ){ diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index 4d30f8fe..8fa0a439 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -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; diff --git a/radiant/findtexturedialog.cpp b/radiant/findtexturedialog.cpp index 104f1ee4..bf37a1f2 100644 --- a/radiant/findtexturedialog.cpp +++ b/radiant/findtexturedialog.cpp @@ -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 ); diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index acd1f650..eb35e56d 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -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 );