From f32ef4e35eb5f887d3ce00f4587eb4b095fa4d5f Mon Sep 17 00:00:00 2001 From: TimePath Date: Wed, 17 Feb 2016 14:46:03 +1100 Subject: [PATCH] Wrap GtkButton --- contrib/bkgrnd2d/dialog.cpp | 8 ++--- contrib/bobtoolz/dialogs/dialogs-gtk.cpp | 46 ++++++++++++------------ contrib/camera/dialogs.cpp | 24 ++++++------- contrib/gtkgensurf/gendlgs.cpp | 18 +++++----- contrib/hydratoolz/plugin.cpp | 16 ++++----- contrib/prtview/AboutDialog.cpp | 2 +- contrib/prtview/ConfigDialog.cpp | 8 ++--- contrib/prtview/LoadPortalFileDialog.cpp | 6 ++-- contrib/sunplug/sunplug.cpp | 10 +++--- libs/gtkutil/dialog.cpp | 4 +-- libs/gtkutil/toolbar.cpp | 3 +- libs/uilib/uilib.cpp | 3 ++ libs/uilib/uilib.h | 1 + plugins/textool/TexTool.cpp | 16 ++++----- radiant/entityinspector.cpp | 4 +-- radiant/patchdialog.cpp | 14 ++++---- radiant/texwindow.cpp | 6 ++-- 17 files changed, 97 insertions(+), 92 deletions(-) diff --git a/contrib/bkgrnd2d/dialog.cpp b/contrib/bkgrnd2d/dialog.cpp index ed3ccc15..a8f01769 100644 --- a/contrib/bkgrnd2d/dialog.cpp +++ b/contrib/bkgrnd2d/dialog.cpp @@ -214,14 +214,14 @@ CBackgroundDialogPage::CBackgroundDialogPage( VIEWTYPE vt ){ gtk_widget_show( m_pFileLabel ); - w = gtk_button_new_with_label( "Browse..." ); + w = ui::Button( "Browse..." ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( browse_callback ), ( gpointer ) this ); gtk_box_pack_start( GTK_BOX( hbox ),w, FALSE, FALSE, 5 ); gtk_tooltips_set_tip( pTooltips, w, "Select a file", NULL ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Reload" ); + w = ui::Button( "Reload" ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( reload_callback ), ( gpointer ) this ); // TODO disable until we have file @@ -265,7 +265,7 @@ CBackgroundDialogPage::CBackgroundDialogPage( VIEWTYPE vt ){ gtk_container_add( GTK_CONTAINER( frame ), hbox ); gtk_container_set_border_width( GTK_CONTAINER( hbox ),4 ); - w = gtk_button_new_with_label( "from selection" ); + w = ui::Button( "from selection" ); gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, FALSE, 5 ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( size_sel_callback ), ( gpointer ) this ); @@ -273,7 +273,7 @@ CBackgroundDialogPage::CBackgroundDialogPage( VIEWTYPE vt ){ gtk_widget_show( w ); if ( m_vt == XY ) { - w = gtk_button_new_with_label( "from map mins/maxs" ); + w = ui::Button( "from map mins/maxs" ); gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, FALSE, 2 ); g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( size_mm_callback ), ( gpointer ) this ); diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp index 0e79ae1a..334aa17d 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp @@ -376,7 +376,7 @@ EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){ // ---- hbox ---- ok/cancel buttons - w = gtk_button_new_with_label( "Ok" ); + w = ui::Button( "Ok" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); @@ -384,7 +384,7 @@ EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){ gtk_widget_grab_default( w ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); @@ -530,7 +530,7 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){ // ---- hbox ---- - w = gtk_button_new_with_label( "Ok" ); + w = ui::Button( "Ok" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); @@ -538,7 +538,7 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){ gtk_widget_grab_default( w ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); @@ -772,14 +772,14 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){ gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - w = gtk_button_new_with_label( "OK" ); + w = ui::Button( "OK" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_grab_default( w ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); @@ -959,7 +959,7 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ tw1.one = textFrontBackTex; tw1.two = comboMain; - buttonSetMain = gtk_button_new_with_label( "Set As Main Texture" ); + buttonSetMain = ui::Button( "Set As Main Texture" ); gtk_signal_connect( GTK_OBJECT( buttonSetMain ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback_settex ), &tw1 ); gtk_box_pack_start( GTK_BOX( hbox ), buttonSetMain, FALSE, FALSE, 0 ); gtk_widget_show( buttonSetMain ); @@ -979,7 +979,7 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ tw2.one = textTrimTex; tw2.two = comboTrim; - buttonSetTrim = gtk_button_new_with_label( "Set As Trim Texture" ); + buttonSetTrim = ui::Button( "Set As Trim Texture" ); gtk_signal_connect( GTK_OBJECT( buttonSetTrim ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback_settex ), &tw2 ); gtk_box_pack_start( GTK_BOX( hbox ), buttonSetTrim, FALSE, FALSE, 0 ); gtk_widget_show( buttonSetTrim ); @@ -1017,14 +1017,14 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - w = gtk_button_new_with_label( "OK" ); + w = ui::Button( "OK" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_grab_default( w ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); @@ -1178,7 +1178,7 @@ EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){ gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - w = gtk_button_new_with_label( "Enable" ); + w = ui::Button( "Enable" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) ); gtk_widget_show( w ); @@ -1186,12 +1186,12 @@ EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){ GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_grab_default( w ); - w = gtk_button_new_with_label( "Disable" ); + w = ui::Button( "Disable" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); @@ -1269,7 +1269,7 @@ EMessageBoxReturn DoCTFColourChangeBox(){ // ---- hbox ---- ok/cancel buttons - w = gtk_button_new_with_label( "Red->Blue" ); + w = ui::Button( "Red->Blue" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); @@ -1277,12 +1277,12 @@ EMessageBoxReturn DoCTFColourChangeBox(){ gtk_widget_grab_default( w ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Blue->Red" ); + w = ui::Button( "Blue->Red" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); @@ -1548,7 +1548,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ // ---- hbox ---- - w = gtk_button_new_with_label( "Use Selected Brushes" ); + w = ui::Button( "Use Selected Brushes" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); @@ -1556,12 +1556,12 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ gtk_widget_grab_default( w ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Use All Brushes" ); + w = ui::Button( "Use All Brushes" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); @@ -1835,7 +1835,7 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){ // ---- hbox ---- - w = gtk_button_new_with_label( "Ok" ); + w = ui::Button( "Ok" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); @@ -1843,7 +1843,7 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){ gtk_widget_grab_default( w ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); @@ -1974,14 +1974,14 @@ EMessageBoxReturn DoMakeChainBox( MakeChainRS* rs ){ gtk_widget_show( w ); - w = gtk_button_new_with_label( "OK" ); + w = ui::Button( "OK" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_grab_default( w ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); diff --git a/contrib/camera/dialogs.cpp b/contrib/camera/dialogs.cpp index bf9a952f..59ff069a 100644 --- a/contrib/camera/dialogs.cpp +++ b/contrib/camera/dialogs.cpp @@ -129,7 +129,7 @@ static gint ci_new( GtkWidget *widget, gpointer data ){ gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - w = gtk_button_new_with_label( "Ok" ); + w = ui::Button( "Ok" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_show( w ); @@ -137,7 +137,7 @@ static gint ci_new( GtkWidget *widget, gpointer data ){ GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_grab_default( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); @@ -411,7 +411,7 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){ gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - w = gtk_button_new_with_label( "Ok" ); + w = ui::Button( "Ok" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_show( w ); @@ -419,7 +419,7 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){ GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_grab_default( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); @@ -558,7 +558,7 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){ gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - w = gtk_button_new_with_label( "Ok" ); + w = ui::Button( "Ok" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_show( w ); @@ -566,7 +566,7 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){ GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_grab_default( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); @@ -898,7 +898,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ){ gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - w = gtk_button_new_with_label( "Ok" ); + w = ui::Button( "Ok" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_show( w ); @@ -906,7 +906,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ){ GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_grab_default( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); @@ -1141,12 +1141,12 @@ GtkWidget *CreateCameraInspectorDialog( void ){ gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - w = gtk_button_new_with_label( "Rename..." ); + w = ui::Button( "Rename..." ); gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_rename ), NULL ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Add Target..." ); + w = ui::Button( "Add Target..." ); gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_add_target ), NULL ); gtk_widget_show( w ); @@ -1272,12 +1272,12 @@ GtkWidget *CreateCameraInspectorDialog( void ){ gtk_box_pack_start( GTK_BOX( hbox ), vbox, FALSE, FALSE, 0 ); gtk_widget_show( vbox ); - w = gtk_button_new_with_label( "Add..." ); + w = ui::Button( "Add..." ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_add ), NULL ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Del" ); + w = ui::Button( "Del" ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_del ), NULL ); gtk_widget_show( w ); diff --git a/contrib/gtkgensurf/gendlgs.cpp b/contrib/gtkgensurf/gendlgs.cpp index 87d8e573..5bea5b28 100644 --- a/contrib/gtkgensurf/gendlgs.cpp +++ b/contrib/gtkgensurf/gendlgs.cpp @@ -1827,14 +1827,14 @@ GtkWidget* create_main_dialog(){ (GtkAttachOptions) ( 0 ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - button = gtk_button_new_with_label( "Browse..." ); + button = ui::Button( "Browse..." ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 ); gtk_widget_set_usize( button, 60, -2 ); g_object_set_data( G_OBJECT( dlg ), "bmp_file_browse", button ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( bitmap_browse ), NULL ); - button = gtk_button_new_with_label( "Reload" ); + button = ui::Button( "Reload" ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 ); gtk_widget_set_usize( button, 60, -2 ); @@ -1969,7 +1969,7 @@ GtkWidget* create_main_dialog(){ g_object_set_data( G_OBJECT( dlg ), "fix_rate", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( fix_rate_entryfocusout ), NULL ); - button = gtk_button_new_with_label( "Free" ); + button = ui::Button( "Free" ); gtk_widget_show( button ); gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 0, 1, (GtkAttachOptions) ( GTK_EXPAND ), @@ -1978,7 +1978,7 @@ GtkWidget* create_main_dialog(){ g_object_set_data( G_OBJECT( dlg ), "fix_free", button ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( fix_free ), NULL ); - button = gtk_button_new_with_label( "Free All" ); + button = ui::Button( "Free All" ); gtk_widget_show( button ); gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 1, 2, (GtkAttachOptions) ( GTK_EXPAND ), @@ -2138,7 +2138,7 @@ GtkWidget* create_main_dialog(){ gtk_widget_show( vbox ); gtk_box_pack_start( GTK_BOX( hbox ), vbox, FALSE, TRUE, 0 ); - button = gtk_button_new_with_label( "OK" ); + button = ui::Button( "OK" ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 ); gtk_widget_set_usize( button, 60, -2 ); @@ -2149,25 +2149,25 @@ GtkWidget* create_main_dialog(){ gtk_widget_show( label ); gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, TRUE, 0 ); - button = gtk_button_new_with_label( "Open..." ); + button = ui::Button( "Open..." ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 ); g_object_set_data( G_OBJECT( dlg ), "open", button ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_open ), NULL ); - button = gtk_button_new_with_label( "Save as..." ); + button = ui::Button( "Save as..." ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 ); g_object_set_data( G_OBJECT( dlg ), "save", button ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_save ), NULL ); - button = gtk_button_new_with_label( "Defaults" ); + button = ui::Button( "Defaults" ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 ); g_object_set_data( G_OBJECT( dlg ), "defaults", button ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_defaults ), NULL ); - button = gtk_button_new_with_label( "About..." ); + button = ui::Button( "About..." ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_about ), NULL ); diff --git a/contrib/hydratoolz/plugin.cpp b/contrib/hydratoolz/plugin.cpp index c08f7446..703b52ad 100644 --- a/contrib/hydratoolz/plugin.cpp +++ b/contrib/hydratoolz/plugin.cpp @@ -113,7 +113,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ gtk_widget_show( hbox ); if ( mode == MB_OK ) { - w = gtk_button_new_with_label( "Ok" ); + w = ui::Button( "Ok" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); @@ -123,7 +123,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ ret = IDOK; } else if ( mode == MB_OKCANCEL ) { - w = gtk_button_new_with_label( "Ok" ); + w = ui::Button( "Ok" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); @@ -131,7 +131,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ gtk_widget_grab_default( w ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); @@ -139,7 +139,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ ret = IDCANCEL; } else if ( mode == MB_YESNOCANCEL ) { - w = gtk_button_new_with_label( "Yes" ); + w = ui::Button( "Yes" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); @@ -147,13 +147,13 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ gtk_widget_grab_default( w ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "No" ); + w = ui::Button( "No" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); @@ -162,7 +162,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ } else /* if (mode == MB_YESNO) */ { - w = gtk_button_new_with_label( "Yes" ); + w = ui::Button( "Yes" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); @@ -170,7 +170,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ gtk_widget_grab_default( w ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "No" ); + w = ui::Button( "No" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); diff --git a/contrib/prtview/AboutDialog.cpp b/contrib/prtview/AboutDialog.cpp index 6376ec28..3d3fce12 100644 --- a/contrib/prtview/AboutDialog.cpp +++ b/contrib/prtview/AboutDialog.cpp @@ -81,7 +81,7 @@ void DoAboutDlg(){ gtk_widget_show( vbox ); gtk_box_pack_start( GTK_BOX( hbox ), vbox, FALSE, FALSE, 0 ); - button = gtk_button_new_with_label( "OK" ); + button = ui::Button( "OK" ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); gtk_signal_connect( GTK_OBJECT( button ), "clicked", diff --git a/contrib/prtview/ConfigDialog.cpp b/contrib/prtview/ConfigDialog.cpp index 31e53e8e..a9f2d724 100644 --- a/contrib/prtview/ConfigDialog.cpp +++ b/contrib/prtview/ConfigDialog.cpp @@ -291,14 +291,14 @@ void DoConfigDialog(){ gtk_table_set_row_spacings( GTK_TABLE( table ), 5 ); gtk_table_set_col_spacings( GTK_TABLE( table ), 5 ); - button = gtk_button_new_with_label( "Color" ); + button = ui::Button( "Color" ); gtk_widget_show( button ); gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 0, 1, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColor3d ), NULL ); - button = gtk_button_new_with_label( "Depth Color" ); + button = ui::Button( "Depth Color" ); gtk_widget_show( button ); gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2, (GtkAttachOptions) ( GTK_FILL ), @@ -439,7 +439,7 @@ void DoConfigDialog(){ gtk_widget_show( hbox ); gtk_box_pack_start( GTK_BOX( vbox2 ), hbox, TRUE, FALSE, 0 ); - button = gtk_button_new_with_label( "Color" ); + button = ui::Button( "Color" ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColor2d ), NULL ); @@ -463,7 +463,7 @@ void DoConfigDialog(){ gtk_widget_show( hbox ); gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); - button = gtk_button_new_with_label( "OK" ); + button = ui::Button( "OK" ); gtk_widget_show( button ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_signal_connect( GTK_OBJECT( button ), "clicked", diff --git a/contrib/prtview/LoadPortalFileDialog.cpp b/contrib/prtview/LoadPortalFileDialog.cpp index dbfcdc90..6993f74a 100644 --- a/contrib/prtview/LoadPortalFileDialog.cpp +++ b/contrib/prtview/LoadPortalFileDialog.cpp @@ -139,7 +139,7 @@ int DoLoadPortalFileDialog(){ gtk_widget_show( check2d ); gtk_box_pack_start( GTK_BOX( hbox ), check2d, FALSE, FALSE, 0 ); - button = gtk_button_new_with_label( "Change" ); + button = ui::Button( "Change" ); gtk_widget_show( button ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( change_clicked ), entry ); @@ -149,14 +149,14 @@ int DoLoadPortalFileDialog(){ gtk_widget_show( hbox ); gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); - button = gtk_button_new_with_label( "Cancel" ); + button = ui::Button( "Cancel" ); gtk_widget_show( button ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); gtk_widget_set_usize( button, 60, -2 ); - button = gtk_button_new_with_label( "OK" ); + button = ui::Button( "OK" ); gtk_widget_show( button ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); gtk_signal_connect( GTK_OBJECT( button ), "clicked", diff --git a/contrib/sunplug/sunplug.cpp b/contrib/sunplug/sunplug.cpp index 77ef3844..77ce83bd 100644 --- a/contrib/sunplug/sunplug.cpp +++ b/contrib/sunplug/sunplug.cpp @@ -272,7 +272,7 @@ void about_plugin_window(){ gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT ); // text align left gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, FALSE, 2 ); // insert the label in the box - button = gtk_button_new_with_label( "OK" ); // create a button with text + button = ui::Button( "OK" ); // create a button with text g_signal_connect_swapped( G_OBJECT( button ), "clicked", G_CALLBACK( gtk_widget_destroy ), window ); // connect the click event to close the window gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 2 ); // insert the button in the box @@ -372,7 +372,7 @@ void MapCoordinator(){ spinner_adj_MaxX = (GtkAdjustment *)gtk_adjustment_new( map_maxX, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of maximum x value spinner_adj_MaxY = (GtkAdjustment *)gtk_adjustment_new( map_maxY, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of maximum y value - button = gtk_button_new_with_label( "Get optimal mapcoords" ); // create button with text + button = ui::Button( "Get optimal mapcoords" ); // create button with text g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( input_optimal ), NULL ); // connect button with callback function gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 2 ); // insert button into vbox @@ -418,11 +418,11 @@ void MapCoordinator(){ msp.spinner4 = GTK_SPIN_BUTTON( spinnerMaxY ); msp.worldspawn = theWorldspawn; - button = gtk_button_new_with_label( "Set" ); // create button with text + button = ui::Button( "Set" ); // create button with text g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( set_coordinates ), NULL ); // connect button with callback function gtk_table_attach_defaults( GTK_TABLE( table ), button, 1, 2, 3, 4 ); // insert button into table - button = gtk_button_new_with_label( "Cancel" ); // create button with text + button = ui::Button( "Cancel" ); // create button with text g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( close_window ), NULL ); // connect button with callback function gtk_table_attach_defaults( GTK_TABLE( table ), button, 2, 3, 3, 4 ); // insert button into table } @@ -433,7 +433,7 @@ void MapCoordinator(){ gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT ); // text align left gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, FALSE, 2 ); // insert the label in the box - button = gtk_button_new_with_label( "OK" ); // create a button with text + button = ui::Button( "OK" ); // create a button with text g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( close_window ), NULL ); // connect the click event to close the window gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 2 ); // insert the button in the box } diff --git a/libs/gtkutil/dialog.cpp b/libs/gtkutil/dialog.cpp index af95003d..0da7c587 100644 --- a/libs/gtkutil/dialog.cpp +++ b/libs/gtkutil/dialog.cpp @@ -66,7 +66,7 @@ GtkTable* create_dialog_table( unsigned int rows, unsigned int columns, unsigned } GtkButton* create_dialog_button( const char* label, GCallback func, gpointer data ){ - GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( label ) ); + GtkButton* button = ui::Button( label ); gtk_widget_set_size_request( GTK_WIDGET( button ), 64, -1 ); gtk_widget_show( GTK_WIDGET( button ) ); g_signal_connect( G_OBJECT( button ), "clicked", func, data ); @@ -218,7 +218,7 @@ PathEntry PathEntry_new(){ gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( entry ), TRUE, TRUE, 0 ); // browse button - GtkButton* button = GTK_BUTTON( gtk_button_new() ); + GtkButton* button = ui::Button(); button_set_icon( button, "ellipsis.bmp" ); gtk_widget_show( GTK_WIDGET( button ) ); gtk_box_pack_end( GTK_BOX( hbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); diff --git a/libs/gtkutil/toolbar.cpp b/libs/gtkutil/toolbar.cpp index 3ac74f61..ef7c99a4 100644 --- a/libs/gtkutil/toolbar.cpp +++ b/libs/gtkutil/toolbar.cpp @@ -23,6 +23,7 @@ #include #include +#include #include "generic/callback.h" @@ -41,7 +42,7 @@ void toolbar_append( GtkToolbar* toolbar, GtkButton* button, const char* descrip } GtkButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ){ - GtkButton* button = GTK_BUTTON( gtk_button_new() ); + GtkButton* button = ui::Button(); button_set_icon( button, icon ); button_connect_callback( button, callback ); toolbar_append( toolbar, button, description ); diff --git a/libs/uilib/uilib.cpp b/libs/uilib/uilib.cpp index 3e636016..7e10501d 100644 --- a/libs/uilib/uilib.cpp +++ b/libs/uilib/uilib.cpp @@ -88,6 +88,9 @@ namespace ui { : Alignment(GTK_ALIGNMENT(gtk_alignment_new(xalign, yalign, xscale, yscale))) { } + Button::Button() : Button(GTK_BUTTON(gtk_button_new())) + { } + Button::Button(const char *label) : Button(GTK_BUTTON(gtk_button_new_with_label(label))) { } diff --git a/libs/uilib/uilib.h b/libs/uilib/uilib.h index d1b9962c..bd287b71 100644 --- a/libs/uilib/uilib.h +++ b/libs/uilib/uilib.h @@ -112,6 +112,7 @@ namespace ui { WRAP(Box, Widget, ui_box,); WRAP(Button, Widget, ui_button, + Button(); Button(const char *label); ); diff --git a/plugins/textool/TexTool.cpp b/plugins/textool/TexTool.cpp index eb776255..4de2ac5e 100644 --- a/plugins/textool/TexTool.cpp +++ b/plugins/textool/TexTool.cpp @@ -83,7 +83,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ gtk_widget_show( hbox ); if ( mode == MB_OK ) { - w = gtk_button_new_with_label( "Ok" ); + w = ui::Button( "Ok" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); @@ -93,7 +93,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ ret = IDOK; } else if ( mode == MB_OKCANCEL ) { - w = gtk_button_new_with_label( "Ok" ); + w = ui::Button( "Ok" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); @@ -101,7 +101,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ gtk_widget_grab_default( w ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); @@ -109,7 +109,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ ret = IDCANCEL; } else if ( mode == MB_YESNOCANCEL ) { - w = gtk_button_new_with_label( "Yes" ); + w = ui::Button( "Yes" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); @@ -117,13 +117,13 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ gtk_widget_grab_default( w ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "No" ); + w = ui::Button( "No" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "Cancel" ); + w = ui::Button( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); @@ -132,7 +132,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ } else /* if (mode == MB_YESNO) */ { - w = gtk_button_new_with_label( "Yes" ); + w = ui::Button( "Yes" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); @@ -140,7 +140,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ gtk_widget_grab_default( w ); gtk_widget_show( w ); - w = gtk_button_new_with_label( "No" ); + w = ui::Button( "No" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index 6aeedb32..c97407c7 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -1507,13 +1507,13 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){ gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( hbox ), FALSE, TRUE, 0 ); { - GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Clear All" ) ); + GtkButton* button = ui::Button( "Clear All" ); gtk_widget_show( GTK_WIDGET( button ) ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( EntityInspector_clearAllKeyValues ), 0 ); gtk_box_pack_start( hbox, GTK_WIDGET( button ), TRUE, TRUE, 0 ); } { - GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Delete Key" ) ); + GtkButton* button = ui::Button( "Delete Key" ); gtk_widget_show( GTK_WIDGET( button ) ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( EntityInspector_clearKeyValue ), 0 ); gtk_box_pack_start( hbox, GTK_WIDGET( button ), TRUE, TRUE, 0 ); diff --git a/radiant/patchdialog.cpp b/radiant/patchdialog.cpp index 81a936b2..69dda6d7 100644 --- a/radiant/patchdialog.cpp +++ b/radiant/patchdialog.cpp @@ -857,7 +857,7 @@ ui::Window PatchInspector::BuildDialog(){ gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 ); } { - GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Flip" ) ); + GtkButton* button = ui::Button( "Flip" ); gtk_widget_show( GTK_WIDGET( button ) ); gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 2, 3, (GtkAttachOptions)( GTK_FILL ), @@ -874,7 +874,7 @@ ui::Window PatchInspector::BuildDialog(){ gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 ); } { - GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Flip" ) ); + GtkButton* button = ui::Button( "Flip" ); gtk_widget_show( GTK_WIDGET( button ) ); gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 3, 4, (GtkAttachOptions)( GTK_FILL ), @@ -1003,35 +1003,35 @@ ui::Window PatchInspector::BuildDialog(){ gtk_widget_show( GTK_WIDGET( hbox2 ) ); gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( hbox2 ), TRUE, FALSE, 0 ); { - GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Auto Cap" ) ); + GtkButton* button = ui::Button( "Auto Cap" ); gtk_widget_show( GTK_WIDGET( button ) ); gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchAutoCap ), 0 ); gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 ); } { - GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "CAP" ) ); + GtkButton* button = ui::Button( "CAP" ); gtk_widget_show( GTK_WIDGET( button ) ); gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 ); gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 ); } { - GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Set..." ) ); + GtkButton* button = ui::Button( "Set..." ); gtk_widget_show( GTK_WIDGET( button ) ); gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchreset ), 0 ); gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 ); } { - GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Natural" ) ); + GtkButton* button = ui::Button( "Natural" ); gtk_widget_show( GTK_WIDGET( button ) ); gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 ); gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 ); } { - GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Fit" ) ); + GtkButton* button = ui::Button( "Fit" ); gtk_widget_show( GTK_WIDGET( button ) ); gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchfit ), 0 ); diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index b24f0422..b4b1180d 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -1882,7 +1882,7 @@ void TextureBrowser_constructSearchButton(){ GtkTooltips* tooltips = gtk_tooltips_new(); ui::Widget image = ui::Widget(gtk_image_new_from_stock( GTK_STOCK_FIND, GTK_ICON_SIZE_SMALL_TOOLBAR )); - g_TextureBrowser.m_search_button = ui::Widget(gtk_button_new()); + g_TextureBrowser.m_search_button = ui::Button(); g_signal_connect( G_OBJECT( g_TextureBrowser.m_search_button ), "clicked", G_CALLBACK( TextureBrowser_searchTags ), NULL ); gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ), g_TextureBrowser.m_search_button, "Search with selected tags", "Search with selected tags" ); gtk_container_add( GTK_CONTAINER( g_TextureBrowser.m_search_button ), image ); @@ -2126,8 +2126,8 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){ gtk_table_attach( GTK_TABLE( frame_table ), scrolled_win, 2, 3, 1, 3, GTK_FILL, GTK_FILL, 0, 0 ); } { // tag arrow buttons - ui::Widget m_btn_left = ui::Widget(gtk_button_new()); - ui::Widget m_btn_right = ui::Widget(gtk_button_new()); + ui::Widget m_btn_left = ui::Button(); + ui::Widget m_btn_right = ui::Button(); ui::Widget m_arrow_left = ui::Widget(gtk_arrow_new( GTK_ARROW_LEFT, GTK_SHADOW_OUT )); ui::Widget m_arrow_right = ui::Widget(gtk_arrow_new( GTK_ARROW_RIGHT, GTK_SHADOW_OUT )); gtk_container_add( GTK_CONTAINER( m_btn_left ), m_arrow_left ); -- 2.39.2