From 2951e448a7f008f2438be4bd5feba2e4f4400eef Mon Sep 17 00:00:00 2001 From: TimePath Date: Fri, 29 Dec 2017 21:44:23 +1100 Subject: [PATCH] GTK: wrap gtk_box_pack_start --- contrib/bkgrnd2d/dialog.cpp | 20 +- contrib/bobtoolz/dialogs/dialogs-gtk.cpp | 384 +++++++++++------------ contrib/brushexport/interface.cpp | 72 ++--- contrib/camera/dialogs.cpp | 174 +++++----- contrib/gtkgensurf/gendlgs.cpp | 80 ++--- contrib/gtkgensurf/view.cpp | 16 +- contrib/hydratoolz/plugin.cpp | 22 +- contrib/prtview/AboutDialog.cpp | 6 +- contrib/prtview/ConfigDialog.cpp | 65 ++-- contrib/prtview/LoadPortalFileDialog.cpp | 25 +- contrib/sunplug/sunplug.cpp | 28 +- libs/gtkutil/dialog.cpp | 10 +- libs/gtkutil/messagebox.cpp | 58 ++-- libs/uilib/uilib.cpp | 12 + libs/uilib/uilib.h | 2 + plugins/textool/TexTool.cpp | 22 +- radiant/build.cpp | 10 +- radiant/commands.cpp | 18 +- radiant/dialog.cpp | 8 +- radiant/entityinspector.cpp | 36 +-- radiant/findtexturedialog.cpp | 18 +- radiant/gtkdlgs.cpp | 136 ++++---- radiant/mainframe.cpp | 22 +- radiant/map.cpp | 34 +- radiant/patchdialog.cpp | 34 +- radiant/patchmanip.cpp | 26 +- radiant/preferences.cpp | 26 +- radiant/select.cpp | 36 +-- radiant/surfacedialog.cpp | 34 +- radiant/texwindow.cpp | 8 +- 30 files changed, 712 insertions(+), 730 deletions(-) diff --git a/contrib/bkgrnd2d/dialog.cpp b/contrib/bkgrnd2d/dialog.cpp index 9db81330..e2e58760 100644 --- a/contrib/bkgrnd2d/dialog.cpp +++ b/contrib/bkgrnd2d/dialog.cpp @@ -197,7 +197,7 @@ CBackgroundDialogPage::CBackgroundDialogPage( VIEWTYPE vt ){ m_pWidget = ui::VBox( FALSE,0 ); // Frame for file row auto frame = ui::Frame( "File" ); - gtk_box_pack_start( GTK_BOX( m_pWidget ),frame, FALSE, FALSE, 2 ); + m_pWidget.pack_start(frame, FALSE, FALSE, 2 ); // hbox for first row auto hbox = ui::HBox( FALSE,5 ); @@ -208,13 +208,13 @@ CBackgroundDialogPage::CBackgroundDialogPage( VIEWTYPE vt ){ m_pFileLabel = ui::Label( NO_FILE_MSG ); gtk_label_set_selectable( GTK_LABEL( m_pFileLabel ),TRUE ); //TODO set min size ? done with spaces right now - gtk_box_pack_start( GTK_BOX( hbox ),m_pFileLabel, TRUE, TRUE, 5 ); + hbox.pack_start(m_pFileLabel, TRUE, TRUE, 5 ); gtk_widget_show( m_pFileLabel ); w = ui::Button( "Browse..." ); w.connect( "clicked", G_CALLBACK( browse_callback ), ( gpointer ) this ); - gtk_box_pack_start( GTK_BOX( hbox ),w, FALSE, FALSE, 5 ); + hbox.pack_start(w, FALSE, FALSE, 5 ); gtk_tooltips_set_tip( pTooltips, w, "Select a file", NULL ); gtk_widget_show( w ); @@ -223,7 +223,7 @@ CBackgroundDialogPage::CBackgroundDialogPage( VIEWTYPE vt ){ // TODO disable until we have file // gtk_widget_set_sensitive(w,FALSE); gtk_tooltips_set_tip( pTooltips, w, "Reload current file", NULL ); - gtk_box_pack_start( GTK_BOX( hbox ),w, FALSE, FALSE, 5 ); + hbox.pack_start(w, FALSE, FALSE, 5 ); gtk_widget_show( w ); gtk_widget_show( hbox ); @@ -231,21 +231,21 @@ CBackgroundDialogPage::CBackgroundDialogPage( VIEWTYPE vt ){ // second row (rendering options) frame = ui::Frame( "Rendering" ); - gtk_box_pack_start( GTK_BOX( m_pWidget ),frame, FALSE, FALSE, 2 ); + m_pWidget.pack_start(frame, FALSE, FALSE, 2 ); hbox = ui::HBox( FALSE,5 ); gtk_container_set_border_width( GTK_CONTAINER( hbox ),4 ); frame.add(hbox); w = ui::Label( "Vertex alpha:" ); - gtk_box_pack_start( GTK_BOX( hbox ),w, FALSE, FALSE, 5 ); + hbox.pack_start(w, FALSE, FALSE, 5 ); gtk_widget_show( w ); w = ui::HScale( 0.0, 1.0, 0.01 ); gtk_range_set_value( GTK_RANGE( w ),0.5 ); gtk_scale_set_value_pos( GTK_SCALE( w ),GTK_POS_LEFT ); w.connect( "value-changed", G_CALLBACK( alpha_adjust_callback ), ( gpointer ) this ); - gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, TRUE, 5 ); + hbox.pack_start(w, TRUE, TRUE, 5 ); gtk_tooltips_set_tip( pTooltips, w, "Set image transparancy", NULL ); gtk_widget_show( w ); @@ -254,21 +254,21 @@ CBackgroundDialogPage::CBackgroundDialogPage( VIEWTYPE vt ){ // Third row (size and position) 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 ); + m_pWidget.pack_start( frame, FALSE, FALSE, 2 ); hbox = ui::HBox( FALSE,5 ); frame.add(hbox); gtk_container_set_border_width( GTK_CONTAINER( hbox ),4 ); w = ui::Button( "from selection" ); - gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, FALSE, 5 ); + hbox.pack_start(w, TRUE, FALSE, 5 ); w.connect( "clicked", G_CALLBACK( size_sel_callback ), ( gpointer ) this ); gtk_tooltips_set_tip( pTooltips, w, "Set the size of the image to the bounding rectangle of all selected brushes and entities", NULL ); gtk_widget_show( w ); if ( m_vt == XY ) { w = ui::Button( "from map mins/maxs" ); - gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, FALSE, 2 ); + hbox.pack_start(w, TRUE, FALSE, 2 ); w.connect( "clicked", G_CALLBACK( size_mm_callback ), ( gpointer ) this ); gtk_tooltips_set_tip( pTooltips, w, "Set the size of the image using the mapcoordsmins and mapcoordsmaxs keys of the worldspawn entity", NULL ); gtk_widget_show( w ); diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp index dd08de2b..817a4e1e 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp @@ -224,21 +224,21 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess gtk_widget_show( vbox ); w = ui::Label( lpText ); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 2 ); + vbox.pack_start( w, FALSE, FALSE, 2 ); gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT ); gtk_widget_show( w ); w = ui::Widget(gtk_hseparator_new()); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 2 ); + vbox.pack_start( w, FALSE, FALSE, 2 ); gtk_widget_show( w ); auto hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 ); + vbox.pack_start( hbox, FALSE, FALSE, 2 ); gtk_widget_show( hbox ); if ( type == eMB_OK ) { w = ui::Button( "Ok" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default(w, true); gtk_widget_grab_default( w ); @@ -247,33 +247,33 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess } else if ( type == eMB_OKCANCEL ) { w = ui::Button( "Ok" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; } else if ( type == eMB_YESNOCANCEL ) { w = ui::Button( "Yes" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "No" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -281,14 +281,14 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess else /* if (mode == MB_YESNO) */ { w = ui::Button( "Yes" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "No" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) ); gtk_widget_show( w ); ret = eIDNO; @@ -308,8 +308,6 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess } EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){ - GtkWidget *hbox; - GtkWidget *check1, *check2; EMessageBoxReturn ret; int loop = 1; @@ -335,34 +333,34 @@ EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){ // ---- vbox ---- - auto radio1 = gtk_radio_button_new_with_label( NULL, "Use Whole Map" ); - gtk_box_pack_start( GTK_BOX( vbox ), radio1, FALSE, FALSE, 2 ); + auto radio1 = ui::Widget(gtk_radio_button_new_with_label( NULL, "Use Whole Map" )); + vbox.pack_start( radio1, FALSE, FALSE, 2 ); gtk_widget_show( radio1 ); - auto radio2 = gtk_radio_button_new_with_label( gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio1)), "Use Selected Brushes" ); - gtk_box_pack_start( GTK_BOX( vbox ), radio2, FALSE, FALSE, 2 ); + auto radio2 = ui::Widget(gtk_radio_button_new_with_label( gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio1)), "Use Selected Brushes" )); + vbox.pack_start( radio2, FALSE, FALSE, 2 ); gtk_widget_show( radio2 ); auto hsep = ui::Widget(gtk_hseparator_new()); - gtk_box_pack_start( GTK_BOX( vbox ), hsep, FALSE, FALSE, 2 ); + vbox.pack_start( hsep, FALSE, FALSE, 2 ); hsep.show(); - check1 = ui::CheckButton( "Include Detail Brushes" ); - gtk_box_pack_start( GTK_BOX( vbox ), check1, FALSE, FALSE, 0 ); + auto check1 = ui::CheckButton( "Include Detail Brushes" ); + vbox.pack_start( check1, FALSE, FALSE, 0 ); gtk_widget_show( check1 ); - check2 = ui::CheckButton( "Select Duplicate Brushes Only" ); - gtk_box_pack_start( GTK_BOX( vbox ), check2, FALSE, FALSE, 0 ); + auto check2 = ui::CheckButton( "Select Duplicate Brushes Only" ); + vbox.pack_start( check2, FALSE, FALSE, 0 ); gtk_widget_show( check2 ); - hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 ); + auto hbox = ui::HBox( FALSE, 10 ); + vbox.pack_start( hbox, FALSE, FALSE, 2 ); gtk_widget_show( hbox ); // ---- hbox ---- ok/cancel buttons auto w = ui::Button( "Ok" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); @@ -370,7 +368,7 @@ EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){ gtk_widget_show( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -386,15 +384,15 @@ EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){ while ( loop ) gtk_main_iteration(); - if ( gtk_toggle_button_get_active( (GtkToggleButton*)radio1 ) ) { + if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(radio1) ) ) { rs->nBrushOptions = BRUSH_OPT_WHOLE_MAP; } - else if ( gtk_toggle_button_get_active( (GtkToggleButton*)radio2 ) ) { + else if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(radio2) ) ) { rs->nBrushOptions = BRUSH_OPT_SELECTED; } - rs->bUseDetail = gtk_toggle_button_get_active( (GtkToggleButton*)check1 ) ? true : false; - rs->bDuplicateOnly = gtk_toggle_button_get_active( (GtkToggleButton*)check2 ) ? true : false; + rs->bUseDetail = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(check1) ) ? true : false; + rs->bDuplicateOnly = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(check2) ) ? true : false; gtk_grab_remove( window ); window.destroy(); @@ -403,11 +401,6 @@ EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){ } EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){ - GtkWidget *hbox, *vbox2, *hbox2; - - GtkWidget *check1, *check2, *check3; - GtkWidget *text1, *text2; - EMessageBoxReturn ret; int loop = 1; @@ -432,50 +425,50 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){ // ---- vbox ---- - hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 ); + auto hbox = ui::HBox( FALSE, 10 ); + vbox.pack_start( hbox, FALSE, FALSE, 2 ); gtk_widget_show( hbox ); // ---- hbox ---- - vbox2 = ui::VBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( hbox ), vbox2, FALSE, FALSE, 2 ); + auto vbox2 = ui::VBox( FALSE, 10 ); + hbox.pack_start( vbox2, FALSE, FALSE, 2 ); gtk_widget_show( vbox2 ); // ---- vbox2 ---- - hbox2 = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox2 ), hbox2, FALSE, FALSE, 2 ); + auto hbox2 = ui::HBox( FALSE, 10 ); + vbox2.pack_start( hbox2, FALSE, FALSE, 2 ); gtk_widget_show( hbox2 ); // ---- hbox2 ---- - text1 = ui::Entry( 256 ); + auto text1 = ui::Entry( 256 ); gtk_entry_set_text( (GtkEntry*)text1, "3" ); - gtk_box_pack_start( GTK_BOX( hbox2 ), text1, FALSE, FALSE, 2 ); + hbox2.pack_start( text1, FALSE, FALSE, 2 ); gtk_widget_show( text1 ); auto l = ui::Label( "Number Of Sides" ); - gtk_box_pack_start( GTK_BOX( hbox2 ), l, FALSE, FALSE, 2 ); + hbox2.pack_start( l, FALSE, FALSE, 2 ); gtk_label_set_justify( GTK_LABEL( l ), GTK_JUSTIFY_LEFT ); gtk_widget_show( l ); // ---- /hbox2 ---- hbox2 = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox2 ), hbox2, FALSE, FALSE, 2 ); + vbox2.pack_start( hbox2, FALSE, FALSE, 2 ); gtk_widget_show( hbox2 ); // ---- hbox2 ---- - text2 = ui::Entry( 256 ); + auto text2 = ui::Entry( 256 ); gtk_entry_set_text( (GtkEntry*)text2, "8" ); - gtk_box_pack_start( GTK_BOX( hbox2 ), text2, FALSE, FALSE, 2 ); + hbox2.pack_start( text2, FALSE, FALSE, 2 ); gtk_widget_show( text2 ); l = ui::Label( "Border Width" ); - gtk_box_pack_start( GTK_BOX( hbox2 ), l, FALSE, FALSE, 2 ); + hbox2.pack_start( l, FALSE, FALSE, 2 ); gtk_label_set_justify( GTK_LABEL( l ), GTK_JUSTIFY_LEFT ); gtk_widget_show( l ); @@ -486,23 +479,23 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){ vbox2 = ui::VBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( hbox ), vbox2, FALSE, FALSE, 2 ); + hbox.pack_start( vbox2, FALSE, FALSE, 2 ); gtk_widget_show( vbox2 ); // ---- vbox2 ---- - check1 = ui::CheckButton( "Use Border" ); - gtk_box_pack_start( GTK_BOX( vbox2 ), check1, FALSE, FALSE, 0 ); + auto check1 = ui::CheckButton( "Use Border" ); + vbox2.pack_start( check1, FALSE, FALSE, 0 ); gtk_widget_show( check1 ); - check2 = ui::CheckButton( "Inverse Polygon" ); - gtk_box_pack_start( GTK_BOX( vbox2 ), check2, FALSE, FALSE, 0 ); + auto check2 = ui::CheckButton( "Inverse Polygon" ); + vbox2.pack_start( check2, FALSE, FALSE, 0 ); gtk_widget_show( check2 ); - check3 = ui::CheckButton( "Align Top Edge" ); - gtk_box_pack_start( GTK_BOX( vbox2 ), check3, FALSE, FALSE, 0 ); + auto check3 = ui::CheckButton( "Align Top Edge" ); + vbox2.pack_start( check3, FALSE, FALSE, 0 ); gtk_widget_show( check3 ); // ---- /vbox2 ---- @@ -510,13 +503,13 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){ // ---- /hbox ---- hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 ); + vbox.pack_start( hbox, FALSE, FALSE, 2 ); gtk_widget_show( hbox ); // ---- hbox ---- auto w = ui::Button( "Ok" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); @@ -524,7 +517,7 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){ gtk_widget_show( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -547,9 +540,9 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){ dialogError = FALSE; if ( ret == eIDOK ) { - rs->bUseBorder = gtk_toggle_button_get_active( (GtkToggleButton*)check1 ) ? true : false; - rs->bInverse = gtk_toggle_button_get_active( (GtkToggleButton*)check2 ) ? true : false; - rs->bAlignTop = gtk_toggle_button_get_active( (GtkToggleButton*)check3 ) ? true : false; + rs->bUseBorder = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(check1) ) ? true : false; + rs->bInverse = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(check2) ) ? true : false; + rs->bAlignTop = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(check3) ) ? true : false; if ( !ValidateTextIntRange( gtk_entry_get_text( (GtkEntry*)text1 ), 3, 32, "Number Of Sides", &rs->nSides ) ) { dialogError = TRUE; @@ -573,10 +566,6 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){ // for stair builder stuck as close as i could to the MFC version // obviously feel free to change it at will :) EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){ - GtkWidget *textStairHeight, *textRiserTex, *textMainTex; - GtkWidget *radioNorth, *radioSouth, *radioEast, *radioWest; // i'm guessing we can't just abuse 'w' for these if we're getting a value - GtkWidget *radioOldStyle, *radioBobStyle, *radioCornerStyle; - GtkWidget *checkUseDetail; GSList *radioDirection, *radioStyle; EMessageBoxReturn ret; int loop = 1; @@ -608,42 +597,42 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){ // dunno if you want this text or not ... ui::Widget w = ui::Label( text ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); // not entirely sure on all the parameters / what they do ... + hbox.pack_start( w, FALSE, FALSE, 0 ); // not entirely sure on all the parameters / what they do ... gtk_widget_show( w ); w = ui::Widget(gtk_hseparator_new()); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); // ------------------------- // indenting == good way of keeping track of lines :) // new hbox hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - textStairHeight = ui::Entry( 256 ); - gtk_box_pack_start( GTK_BOX( hbox ), textStairHeight, FALSE, FALSE, 1 ); + auto textStairHeight = ui::Entry( 256 ); + hbox.pack_start( textStairHeight, FALSE, FALSE, 1 ); gtk_widget_show( textStairHeight ); w = ui::Label( "Stair Height" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 1 ); + hbox.pack_start( w, FALSE, FALSE, 1 ); gtk_widget_show( w ); // ------------------------- // hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Label( "Direction:" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 5 ); + hbox.pack_start( w, FALSE, FALSE, 5 ); gtk_widget_show( w ); // -------------------------- // hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); // radio buttons confuse me ... @@ -652,58 +641,58 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){ // djbob: actually it looks very nice :), slightly better than the way i did it // edit: actually it doesn't work :P, you must pass the last radio item each time, ugh - radioNorth = gtk_radio_button_new_with_label( NULL, "North" ); - gtk_box_pack_start( GTK_BOX( hbox ), radioNorth, FALSE, FALSE, 3 ); + auto radioNorth = ui::Widget(gtk_radio_button_new_with_label( NULL, "North" )); + hbox.pack_start( radioNorth, FALSE, FALSE, 3 ); gtk_widget_show( radioNorth ); radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioNorth ) ); - radioSouth = gtk_radio_button_new_with_label( radioDirection, "South" ); - gtk_box_pack_start( GTK_BOX( hbox ), radioSouth, FALSE, FALSE, 2 ); + auto radioSouth = ui::Widget(gtk_radio_button_new_with_label( radioDirection, "South" )); + hbox.pack_start( radioSouth, FALSE, FALSE, 2 ); gtk_widget_show( radioSouth ); radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioSouth ) ); - radioEast = gtk_radio_button_new_with_label( radioDirection, "East" ); - gtk_box_pack_start( GTK_BOX( hbox ), radioEast, FALSE, FALSE, 1 ); + auto radioEast = ui::Widget(gtk_radio_button_new_with_label( radioDirection, "East" )); + hbox.pack_start( radioEast, FALSE, FALSE, 1 ); gtk_widget_show( radioEast ); radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioEast ) ); - radioWest = gtk_radio_button_new_with_label( radioDirection, "West" ); - gtk_box_pack_start( GTK_BOX( hbox ), radioWest, FALSE, FALSE, 0 ); + auto radioWest = ui::Widget(gtk_radio_button_new_with_label( radioDirection, "West" )); + hbox.pack_start( radioWest, FALSE, FALSE, 0 ); gtk_widget_show( radioWest ); // --------------------------- // hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Label( "Style:" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 5 ); + hbox.pack_start( w, FALSE, FALSE, 5 ); gtk_widget_show( w ); // --------------------------- // hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - radioOldStyle = gtk_radio_button_new_with_label( NULL, "Original" ); - gtk_box_pack_start( GTK_BOX( hbox ), radioOldStyle, FALSE, FALSE, 0 ); + auto radioOldStyle = ui::Widget(gtk_radio_button_new_with_label( NULL, "Original" )); + hbox.pack_start( radioOldStyle, FALSE, FALSE, 0 ); gtk_widget_show( radioOldStyle ); radioStyle = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioOldStyle ) ); - radioBobStyle = gtk_radio_button_new_with_label( radioStyle, "Bob's Style" ); - gtk_box_pack_start( GTK_BOX( hbox ), radioBobStyle, FALSE, FALSE, 0 ); + auto radioBobStyle = ui::Widget(gtk_radio_button_new_with_label( radioStyle, "Bob's Style" )); + hbox.pack_start( radioBobStyle, FALSE, FALSE, 0 ); gtk_widget_show( radioBobStyle ); radioStyle = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioBobStyle ) ); - radioCornerStyle = gtk_radio_button_new_with_label( radioStyle, "Corner Style" ); - gtk_box_pack_start( GTK_BOX( hbox ), radioCornerStyle, FALSE, FALSE, 0 ); + auto radioCornerStyle = ui::Widget(gtk_radio_button_new_with_label( radioStyle, "Corner Style" )); + hbox.pack_start( radioCornerStyle, FALSE, FALSE, 0 ); gtk_widget_show( radioCornerStyle ); // err, the q3r has an if or something so you need bob style checked before this @@ -713,57 +702,57 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){ // djbob: think we need some button callback functions or smuffin // FIXME: actually get around to doing what i suggested!!!! - checkUseDetail = ui::CheckButton( "Use Detail Brushes" ); - gtk_box_pack_start( GTK_BOX( hbox ), checkUseDetail, FALSE, FALSE, 0 ); + auto checkUseDetail = ui::CheckButton( "Use Detail Brushes" ); + hbox.pack_start( checkUseDetail, FALSE, FALSE, 0 ); gtk_widget_show( checkUseDetail ); // --------------------------- // hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - textMainTex = ui::Entry( 512 ); + auto textMainTex = ui::Entry( 512 ); gtk_entry_set_text( GTK_ENTRY( textMainTex ), rs->mainTexture ); - gtk_box_pack_start( GTK_BOX( hbox ), textMainTex, FALSE, FALSE, 0 ); + hbox.pack_start( textMainTex, FALSE, FALSE, 0 ); gtk_widget_show( textMainTex ); w = ui::Label( "Main Texture" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 1 ); + hbox.pack_start( w, FALSE, FALSE, 1 ); gtk_widget_show( w ); // -------------------------- // hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - textRiserTex = ui::Entry( 512 ); - gtk_box_pack_start( GTK_BOX( hbox ), textRiserTex, FALSE, FALSE, 0 ); + auto textRiserTex = ui::Entry( 512 ); + hbox.pack_start( textRiserTex, FALSE, FALSE, 0 ); gtk_widget_show( textRiserTex ); w = ui::Label( "Riser Texture" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 1 ); + hbox.pack_start( w, FALSE, FALSE, 1 ); gtk_widget_show( w ); // -------------------------- // w = ui::Widget(gtk_hseparator_new()); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Button( "OK" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); @@ -784,21 +773,21 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){ dialogError = FALSE; if ( ret == eIDOK ) { - rs->bUseDetail = gtk_toggle_button_get_active( (GtkToggleButton*)checkUseDetail ) ? true : false; + rs->bUseDetail = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(checkUseDetail) ) ? true : false; strcpy( rs->riserTexture, gtk_entry_get_text( (GtkEntry*)textRiserTex ) ); strcpy( rs->mainTexture, gtk_entry_get_text( (GtkEntry*)textMainTex ) ); - if ( gtk_toggle_button_get_active( (GtkToggleButton*)radioNorth ) ) { + if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(radioNorth) ) ) { rs->direction = MOVE_NORTH; } - else if ( gtk_toggle_button_get_active( (GtkToggleButton*)radioSouth ) ) { + else if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(radioSouth) ) ) { rs->direction = MOVE_SOUTH; } - else if ( gtk_toggle_button_get_active( (GtkToggleButton*)radioEast ) ) { + else if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(radioEast) ) ) { rs->direction = MOVE_EAST; } - else if ( gtk_toggle_button_get_active( (GtkToggleButton*)radioWest ) ) { + else if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(radioWest) ) ) { rs->direction = MOVE_WEST; } @@ -806,13 +795,13 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){ dialogError = TRUE; } - if ( gtk_toggle_button_get_active( (GtkToggleButton*)radioOldStyle ) ) { + if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(radioOldStyle) ) ) { rs->style = STYLE_ORIGINAL; } - else if ( gtk_toggle_button_get_active( (GtkToggleButton*)radioBobStyle ) ) { + else if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(radioBobStyle) ) ) { rs->style = STYLE_BOB; } - else if ( gtk_toggle_button_get_active( (GtkToggleButton*)radioCornerStyle ) ) { + else if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(radioCornerStyle) ) ) { rs->style = STYLE_CORNER; } } @@ -828,9 +817,6 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){ } EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ - GtkWidget *hbox; - GtkWidget *checkScaleMainH, *checkScaleMainV, *checkScaleTrimH, *checkScaleTrimV; - GtkWidget *radioNS, *radioEW; GSList *radioOrientation; TwinWidget tw1, tw2; EMessageBoxReturn ret; @@ -862,77 +848,77 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ // -------------------------- // - hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + auto hbox = ui::HBox( FALSE, 10 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); auto textFrontBackTex = ui::Entry( 512 ); gtk_entry_set_text( GTK_ENTRY( textFrontBackTex ), rs->mainTexture ); - gtk_box_pack_start( GTK_BOX( hbox ), textFrontBackTex, FALSE, FALSE, 0 ); + hbox.pack_start( textFrontBackTex, FALSE, FALSE, 0 ); gtk_widget_show( textFrontBackTex ); ui::Widget w = ui::Label( "Door Front/Back Texture" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); // ------------------------ // hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); auto textTrimTex = ui::Entry( 512 ); - gtk_box_pack_start( GTK_BOX( hbox ), textTrimTex, FALSE, FALSE, 0 ); + hbox.pack_start( textTrimTex, FALSE, FALSE, 0 ); gtk_widget_show( textTrimTex ); w = ui::Label( "Door Trim Texture" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); // ----------------------- // hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); // sp: horizontally ???? // djbob: yes mars, u can spell :] - checkScaleMainH = ui::CheckButton( "Scale Main Texture Horizontally" ); + auto 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 ); + hbox.pack_start( checkScaleMainH, FALSE, FALSE, 0 ); gtk_widget_show( checkScaleMainH ); - checkScaleTrimH = ui::CheckButton( "Scale Trim Texture Horizontally" ); + auto 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 ); + hbox.pack_start( checkScaleTrimH, FALSE, FALSE, 0 ); gtk_widget_show( checkScaleTrimH ); // ---------------------- // hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - checkScaleMainV = ui::CheckButton( "Scale Main Texture Vertically" ); + auto 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 ); + hbox.pack_start( checkScaleMainV, FALSE, FALSE, 0 ); gtk_widget_show( checkScaleMainV ); - checkScaleTrimV = ui::CheckButton( "Scale Trim Texture Vertically" ); - gtk_box_pack_start( GTK_BOX( hbox ), checkScaleTrimV, FALSE, FALSE, 0 ); + auto checkScaleTrimV = ui::CheckButton( "Scale Trim Texture Vertically" ); + hbox.pack_start( checkScaleTrimV, FALSE, FALSE, 0 ); gtk_widget_show( checkScaleTrimV ); // --------------------- // hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); // djbob: lists added auto comboMain = ui::ComboBox(GTK_COMBO_BOX(gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(listMainTextures)))); gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(comboMain), 0); - gtk_box_pack_start( GTK_BOX( hbox ), comboMain, FALSE, FALSE, 0 ); + hbox.pack_start( comboMain, FALSE, FALSE, 0 ); gtk_widget_show( comboMain ); tw1.one = textFrontBackTex; @@ -940,18 +926,18 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ auto buttonSetMain = ui::Button( "Set As Main Texture" ); buttonSetMain.connect( "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw1 ); - gtk_box_pack_start( GTK_BOX( hbox ), buttonSetMain, FALSE, FALSE, 0 ); + hbox.pack_start( buttonSetMain, FALSE, FALSE, 0 ); gtk_widget_show( buttonSetMain ); // ------------------- // hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); auto comboTrim = ui::ComboBox(GTK_COMBO_BOX(gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(listTrimTextures)))); gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(comboMain), 0); - gtk_box_pack_start( GTK_BOX( hbox ), comboTrim, FALSE, FALSE, 0 ); + hbox.pack_start( comboTrim, FALSE, FALSE, 0 ); gtk_widget_show( comboTrim ); tw2.one = textTrimTex; @@ -959,51 +945,51 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ auto buttonSetTrim = ui::Button( "Set As Trim Texture" ); buttonSetTrim.connect( "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw2 ); - gtk_box_pack_start( GTK_BOX( hbox ), buttonSetTrim, FALSE, FALSE, 0 ); + hbox.pack_start( buttonSetTrim, FALSE, FALSE, 0 ); gtk_widget_show( buttonSetTrim ); // ------------------ // hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Label( "Orientation" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); // argh more radio buttons! - radioNS = gtk_radio_button_new_with_label( NULL, "North - South" ); - gtk_box_pack_start( GTK_BOX( hbox ), radioNS, FALSE, FALSE, 0 ); + auto radioNS = ui::Widget(gtk_radio_button_new_with_label( NULL, "North - South" )); + hbox.pack_start( radioNS, FALSE, FALSE, 0 ); gtk_widget_show( radioNS ); radioOrientation = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioNS ) ); - radioEW = gtk_radio_button_new_with_label( radioOrientation, "East - West" ); - gtk_box_pack_start( GTK_BOX( hbox ), radioEW, FALSE, FALSE, 0 ); + auto radioEW = ui::Widget(gtk_radio_button_new_with_label( radioOrientation, "East - West" )); + hbox.pack_start( radioEW, FALSE, FALSE, 0 ); gtk_widget_show( radioEW ); // ----------------- // w = ui::Widget(gtk_hseparator_new()); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); // ----------------- // hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Button( "OK" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -1068,74 +1054,74 @@ EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){ // ---- vbox ---- auto hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 ); + vbox.pack_start( hbox, FALSE, FALSE, 2 ); gtk_widget_show( hbox ); // ---- hbox ---- auto text1 = ui::Entry( 256 ); gtk_entry_set_text( text1, "25" ); - gtk_box_pack_start( GTK_BOX( hbox ), text1, FALSE, FALSE, 2 ); + hbox.pack_start( text1, FALSE, FALSE, 2 ); gtk_widget_show( text1 ); w = ui::Label( "Number Of Points" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 2 ); + hbox.pack_start( w, FALSE, FALSE, 2 ); gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT ); gtk_widget_show( w ); // ---- /hbox ---- hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 ); + vbox.pack_start( hbox, FALSE, FALSE, 2 ); gtk_widget_show( hbox ); // ---- hbox ---- auto text2 = ui::Entry( 256 ); gtk_entry_set_text( text2, "3" ); - gtk_box_pack_start( GTK_BOX( hbox ), text2, FALSE, FALSE, 2 ); + hbox.pack_start( text2, FALSE, FALSE, 2 ); gtk_widget_show( text2 ); w = ui::Label( "Multipler" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 2 ); + hbox.pack_start( w, FALSE, FALSE, 2 ); gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT ); gtk_widget_show( w ); // ---- /hbox ---- w = ui::Label( "Path Distance = dist(start -> apex) * multiplier" ); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT ); gtk_widget_show( w ); hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 ); + vbox.pack_start( hbox, FALSE, FALSE, 2 ); gtk_widget_show( hbox ); // ---- hbox ---- auto text3 = ui::Entry( 256 ); gtk_entry_set_text( text3, "-800" ); - gtk_box_pack_start( GTK_BOX( hbox ), text3, FALSE, FALSE, 2 ); + hbox.pack_start( text3, FALSE, FALSE, 2 ); gtk_widget_show( text3 ); w = ui::Label( "Gravity" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 2 ); + hbox.pack_start( w, FALSE, FALSE, 2 ); gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT ); gtk_widget_show( w ); // ---- /hbox ---- w = ui::Widget(gtk_hseparator_new()); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); auto check1 = ui::CheckButton( "No Dynamic Update" ); - gtk_box_pack_start( GTK_BOX( vbox ), check1, FALSE, FALSE, 0 ); + vbox.pack_start( check1, FALSE, FALSE, 0 ); gtk_widget_show( check1 ); auto check2 = ui::CheckButton( "Show Bounding Lines" ); - gtk_box_pack_start( GTK_BOX( vbox ), check2, FALSE, FALSE, 0 ); + vbox.pack_start( check2, FALSE, FALSE, 0 ); gtk_widget_show( check2 ); // ---- /vbox ---- @@ -1144,17 +1130,17 @@ EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){ // ----------------- // w = ui::Widget(gtk_hseparator_new()); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); // ----------------- // hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Button( "Enable" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) ); gtk_widget_show( w ); @@ -1162,12 +1148,12 @@ EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){ gtk_widget_grab_default( w ); w = ui::Button( "Disable" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); @@ -1239,13 +1225,13 @@ EMessageBoxReturn DoCTFColourChangeBox(){ // ---- vbox ---- auto hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, TRUE, TRUE, 0 ); + vbox.pack_start( hbox, TRUE, TRUE, 0 ); gtk_widget_show( hbox ); // ---- hbox ---- ok/cancel buttons w = ui::Button( "Red->Blue" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); @@ -1253,12 +1239,12 @@ EMessageBoxReturn DoCTFColourChangeBox(){ gtk_widget_show( w ); w = ui::Button( "Blue->Red" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -1308,7 +1294,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ // ---- vbox ---- auto hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 ); + vbox.pack_start( hbox, FALSE, FALSE, 2 ); gtk_widget_show( hbox ); // ---- hbox ---- @@ -1317,7 +1303,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ texSelected += GetCurrentTexture(); w = ui::Label( texSelected ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 2 ); + hbox.pack_start( w, FALSE, FALSE, 2 ); gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT ); gtk_widget_show( w ); @@ -1325,7 +1311,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ auto frame = ui::Frame( "Reset Texture Names" ); gtk_widget_show( frame ); - gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 ); + vbox.pack_start( frame, FALSE, TRUE, 0 ); auto table = ui::Table( 2, 3, TRUE ); table.show(); @@ -1373,7 +1359,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ frame = ui::Frame( "Reset Scales" ); gtk_widget_show( frame ); - gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 ); + vbox.pack_start( frame, FALSE, TRUE, 0 ); table = ui::Table( 2, 3, TRUE ); table.show(); @@ -1429,7 +1415,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ frame = ui::Frame( "Reset Shift" ); gtk_widget_show( frame ); - gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 ); + vbox.pack_start( frame, FALSE, TRUE, 0 ); table = ui::Table( 2, 3, TRUE ); table.show(); @@ -1485,7 +1471,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ frame = ui::Frame( "Reset Rotation" ); gtk_widget_show( frame ); - gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 ); + vbox.pack_start( frame, FALSE, TRUE, 0 ); table = ui::Table( 1, 3, TRUE ); table.show(); @@ -1518,13 +1504,13 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ // ---- /frame ---- hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 ); + vbox.pack_start( hbox, FALSE, FALSE, 2 ); gtk_widget_show( hbox ); // ---- hbox ---- w = ui::Button( "Use Selected Brushes" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); @@ -1532,12 +1518,12 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ gtk_widget_show( w ); w = ui::Button( "Use All Brushes" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -1644,14 +1630,14 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){ // ---- vbox ---- auto hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 ); + vbox.pack_start( hbox, FALSE, FALSE, 2 ); gtk_widget_show( hbox ); // ---- /hbox ---- auto frame = ui::Frame( "Radii" ); gtk_widget_show( frame ); - gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 ); + vbox.pack_start( frame, FALSE, TRUE, 0 ); auto table = ui::Table( 2, 3, TRUE ); table.show(); @@ -1694,7 +1680,7 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){ frame = ui::Frame( "Angles" ); gtk_widget_show( frame ); - gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 ); + vbox.pack_start( frame, FALSE, TRUE, 0 ); table = ui::Table( 2, 3, TRUE ); table.show(); @@ -1736,7 +1722,7 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){ frame = ui::Frame( "Height" ); gtk_widget_show( frame ); - gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 ); + vbox.pack_start( frame, FALSE, TRUE, 0 ); table = ui::Table( 2, 3, TRUE ); table.show(); @@ -1779,7 +1765,7 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){ frame = ui::Frame( "Points" ); gtk_widget_show( frame ); - gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 ); + vbox.pack_start( frame, FALSE, TRUE, 0 ); table = ui::Table( 2, 3, TRUE ); table.show(); @@ -1805,13 +1791,13 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){ hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 ); + vbox.pack_start( hbox, FALSE, FALSE, 2 ); gtk_widget_show( hbox ); // ---- hbox ---- w = ui::Button( "Ok" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); @@ -1819,7 +1805,7 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){ gtk_widget_show( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -1912,52 +1898,52 @@ EMessageBoxReturn DoMakeChainBox( MakeChainRS* rs ){ // dunno if you want this text or not ... w = ui::Label( text ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); w = ui::Widget(gtk_hseparator_new()); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); // ------------------------- // // new hbox hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); textlinkNum = ui::Entry( 256 ); - gtk_box_pack_start( GTK_BOX( hbox ), textlinkNum, FALSE, FALSE, 1 ); + hbox.pack_start( textlinkNum, FALSE, FALSE, 1 ); gtk_widget_show( textlinkNum ); w = ui::Label( "Number of elements in chain" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 1 ); + hbox.pack_start( w, FALSE, FALSE, 1 ); gtk_widget_show( w ); // -------------------------- // hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); textlinkName = ui::Entry( 256 ); - gtk_box_pack_start( GTK_BOX( hbox ), textlinkName, FALSE, FALSE, 0 ); + hbox.pack_start( textlinkName, FALSE, FALSE, 0 ); gtk_widget_show( textlinkName ); w = ui::Label( "Basename for chain's targetnames." ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 1 ); + hbox.pack_start( w, FALSE, FALSE, 1 ); gtk_widget_show( w ); w = ui::Button( "OK" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); diff --git a/contrib/brushexport/interface.cpp b/contrib/brushexport/interface.cpp index 580b8dec..c8d95298 100644 --- a/contrib/brushexport/interface.cpp +++ b/contrib/brushexport/interface.cpp @@ -15,19 +15,7 @@ // created by glade GtkWidget* create_w_plugplug2( void ){ - GtkWidget *hbox2; - GtkWidget *vbox4; - GtkWidget *r_collapse; GSList *r_collapse_group = NULL; - GtkWidget *r_collapsebymaterial; - GtkWidget *r_nocollapse; - GtkWidget *vbox3; - GtkWidget *vbox2; - GtkWidget *label1; - GtkWidget *ed_materialname; - GtkWidget *hbox1; - GtkWidget *t_limitmatnames; - GtkWidget *t_objects; auto w_plugplug2 = ui::Window( ui::window_type::TOP ); gtk_widget_set_name( w_plugplug2, "w_plugplug2" ); @@ -41,73 +29,73 @@ create_w_plugplug2( void ){ w_plugplug2.add(vbox1); gtk_container_set_border_width( GTK_CONTAINER( vbox1 ), 5 ); - hbox2 = ui::HBox( TRUE, 5 ); + auto hbox2 = ui::HBox( TRUE, 5 ); gtk_widget_set_name( hbox2, "hbox2" ); gtk_widget_show( hbox2 ); - gtk_box_pack_start( GTK_BOX( vbox1 ), hbox2, FALSE, FALSE, 0 ); + vbox1.pack_start( hbox2, FALSE, FALSE, 0 ); gtk_container_set_border_width( GTK_CONTAINER( hbox2 ), 5 ); - vbox4 = ui::VBox( TRUE, 0 ); + auto vbox4 = ui::VBox( TRUE, 0 ); gtk_widget_set_name( vbox4, "vbox4" ); gtk_widget_show( vbox4 ); - gtk_box_pack_start( GTK_BOX( hbox2 ), vbox4, TRUE, FALSE, 0 ); + hbox2.pack_start( vbox4, TRUE, FALSE, 0 ); - r_collapse = gtk_radio_button_new_with_mnemonic( NULL, "Collapse mesh" ); + auto r_collapse = ui::Widget(gtk_radio_button_new_with_mnemonic( NULL, "Collapse mesh" )); gtk_widget_set_name( r_collapse, "r_collapse" ); gtk_widget_set_tooltip_text(r_collapse, "Collapse all brushes into a single group"); gtk_widget_show( r_collapse ); - gtk_box_pack_start( GTK_BOX( vbox4 ), r_collapse, FALSE, FALSE, 0 ); + vbox4.pack_start( r_collapse, FALSE, FALSE, 0 ); gtk_radio_button_set_group( GTK_RADIO_BUTTON( r_collapse ), r_collapse_group ); r_collapse_group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( r_collapse ) ); - r_collapsebymaterial = gtk_radio_button_new_with_mnemonic( NULL, "Collapse by material" ); + auto r_collapsebymaterial = ui::Widget(gtk_radio_button_new_with_mnemonic( NULL, "Collapse by material" )); gtk_widget_set_name( r_collapsebymaterial, "r_collapsebymaterial" ); gtk_widget_set_tooltip_text(r_collapsebymaterial, "Collapse into groups by material"); gtk_widget_show( r_collapsebymaterial ); - gtk_box_pack_start( GTK_BOX( vbox4 ), r_collapsebymaterial, FALSE, FALSE, 0 ); + vbox4.pack_start( r_collapsebymaterial, FALSE, FALSE, 0 ); gtk_radio_button_set_group( GTK_RADIO_BUTTON( r_collapsebymaterial ), r_collapse_group ); r_collapse_group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( r_collapsebymaterial ) ); - r_nocollapse = gtk_radio_button_new_with_mnemonic( NULL, "Don't collapse" ); + auto r_nocollapse = ui::Widget(gtk_radio_button_new_with_mnemonic( NULL, "Don't collapse" )); gtk_widget_set_name( r_nocollapse, "r_nocollapse" ); gtk_widget_set_tooltip_text(r_nocollapse, "Every brush is stored in its own group"); gtk_widget_show( r_nocollapse ); - gtk_box_pack_start( GTK_BOX( vbox4 ), r_nocollapse, FALSE, FALSE, 0 ); + vbox4.pack_start( r_nocollapse, FALSE, FALSE, 0 ); gtk_radio_button_set_group( GTK_RADIO_BUTTON( r_nocollapse ), r_collapse_group ); r_collapse_group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( r_nocollapse ) ); - vbox3 = ui::VBox( FALSE, 0 ); + auto vbox3 = ui::VBox( FALSE, 0 ); gtk_widget_set_name( vbox3, "vbox3" ); gtk_widget_show( vbox3 ); - gtk_box_pack_start( GTK_BOX( hbox2 ), vbox3, FALSE, FALSE, 0 ); + hbox2.pack_start( vbox3, FALSE, FALSE, 0 ); auto b_export = ui::Button(GTK_BUTTON(gtk_button_new_from_stock( "gtk-save" ))); gtk_widget_set_name( b_export, "b_export" ); gtk_widget_show( b_export ); - gtk_box_pack_start( GTK_BOX( vbox3 ), b_export, TRUE, FALSE, 0 ); + vbox3.pack_start( b_export, TRUE, FALSE, 0 ); gtk_container_set_border_width( GTK_CONTAINER( b_export ), 5 ); auto b_close = ui::Button(GTK_BUTTON(gtk_button_new_from_stock( "gtk-cancel" ))); gtk_widget_set_name( b_close, "b_close" ); gtk_widget_show( b_close ); - gtk_box_pack_start( GTK_BOX( vbox3 ), b_close, TRUE, FALSE, 0 ); + vbox3.pack_start( b_close, TRUE, FALSE, 0 ); gtk_container_set_border_width( GTK_CONTAINER( b_close ), 5 ); - vbox2 = ui::VBox( FALSE, 5 ); + auto vbox2 = ui::VBox( FALSE, 5 ); gtk_widget_set_name( vbox2, "vbox2" ); gtk_widget_show( vbox2 ); - gtk_box_pack_start( GTK_BOX( vbox1 ), vbox2, TRUE, TRUE, 0 ); + vbox1.pack_start( vbox2, TRUE, TRUE, 0 ); gtk_container_set_border_width( GTK_CONTAINER( vbox2 ), 2 ); - label1 = ui::Label( "Ignored materials:" ); + auto label1 = ui::Label( "Ignored materials:" ); gtk_widget_set_name( label1, "label1" ); gtk_widget_show( label1 ); - gtk_box_pack_start( GTK_BOX( vbox2 ), label1, FALSE, FALSE, 0 ); + vbox2.pack_start( label1, FALSE, FALSE, 0 ); auto scrolledwindow1 = ui::ScrolledWindow(ui::New); gtk_widget_set_name( scrolledwindow1, "scrolledwindow1" ); scrolledwindow1.show(); - gtk_box_pack_start( GTK_BOX( vbox2 ), scrolledwindow1, TRUE, TRUE, 0 ); + vbox2.pack_start( scrolledwindow1, TRUE, TRUE, 0 ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC ); gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scrolledwindow1 ), GTK_SHADOW_IN ); @@ -118,41 +106,41 @@ create_w_plugplug2( void ){ gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( t_materialist ), FALSE ); gtk_tree_view_set_enable_search( GTK_TREE_VIEW( t_materialist ), FALSE ); - ed_materialname = ui::Entry(ui::New); + auto ed_materialname = ui::Entry(ui::New); gtk_widget_set_name( ed_materialname, "ed_materialname" ); gtk_widget_show( ed_materialname ); - gtk_box_pack_start( GTK_BOX( vbox2 ), ed_materialname, FALSE, FALSE, 0 ); + vbox2.pack_start( ed_materialname, FALSE, FALSE, 0 ); - hbox1 = ui::HBox( TRUE, 0 ); + auto hbox1 = ui::HBox( TRUE, 0 ); gtk_widget_set_name( hbox1, "hbox1" ); gtk_widget_show( hbox1 ); - gtk_box_pack_start( GTK_BOX( vbox2 ), hbox1, FALSE, FALSE, 0 ); + vbox2.pack_start( hbox1, FALSE, FALSE, 0 ); auto b_addmaterial = ui::Button(GTK_BUTTON(gtk_button_new_from_stock( "gtk-add" ))); gtk_widget_set_name( b_addmaterial, "b_addmaterial" ); gtk_widget_show( b_addmaterial ); - gtk_box_pack_start( GTK_BOX( hbox1 ), b_addmaterial, FALSE, FALSE, 0 ); + hbox1.pack_start( b_addmaterial, FALSE, FALSE, 0 ); auto b_removematerial = ui::Button(GTK_BUTTON(gtk_button_new_from_stock( "gtk-remove" ))); gtk_widget_set_name( b_removematerial, "b_removematerial" ); gtk_widget_show( b_removematerial ); - gtk_box_pack_start( GTK_BOX( hbox1 ), b_removematerial, FALSE, FALSE, 0 ); + hbox1.pack_start( b_removematerial, FALSE, FALSE, 0 ); - t_limitmatnames = gtk_check_button_new_with_mnemonic( "Use short material names (max. 20 chars)" ); + auto t_limitmatnames = ui::Widget(gtk_check_button_new_with_mnemonic( "Use short material names (max. 20 chars)" )); gtk_widget_set_name( t_limitmatnames, "t_limitmatnames" ); gtk_widget_show( t_limitmatnames ); - gtk_box_pack_end( GTK_BOX( vbox2 ), t_limitmatnames, FALSE, FALSE, 0 ); + vbox2.pack_end( t_limitmatnames, FALSE, FALSE, 0 ); - t_objects = gtk_check_button_new_with_mnemonic( "Create (o)bjects instead of (g)roups" ); + auto t_objects = ui::Widget(gtk_check_button_new_with_mnemonic( "Create (o)bjects instead of (g)roups" )); gtk_widget_set_name( t_objects, "t_objects" ); gtk_widget_show( t_objects ); - gtk_box_pack_end( GTK_BOX( vbox2 ), t_objects, FALSE, FALSE, 0 ); + vbox2.pack_end(t_objects, FALSE, FALSE, 0); auto t_exportmaterials = ui::CheckButton(GTK_CHECK_BUTTON(gtk_check_button_new_with_mnemonic( "Create material information (.mtl file)" ))); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( t_exportmaterials ), true ); gtk_widget_set_name( t_exportmaterials, "t_exportmaterials" ); gtk_widget_show( t_exportmaterials ); - gtk_box_pack_end( GTK_BOX( vbox2 ), t_exportmaterials, FALSE, FALSE, 10 ); + vbox2.pack_end(t_exportmaterials, FALSE, FALSE, 10); using namespace callbacks; w_plugplug2.connect( "destroy", G_CALLBACK( OnDestroy ), NULL ); diff --git a/contrib/camera/dialogs.cpp b/contrib/camera/dialogs.cpp index 4504655c..71ba5c1a 100644 --- a/contrib/camera/dialogs.cpp +++ b/contrib/camera/dialogs.cpp @@ -88,11 +88,11 @@ static gint ci_new( GtkWidget *widget, gpointer data ){ // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); auto frame = ui::Frame( "Type" ); - gtk_box_pack_start( GTK_BOX( hbox ), frame, TRUE, TRUE, 0 ); + hbox.pack_start( frame, TRUE, TRUE, 0 ); gtk_widget_show( frame ); auto vbox2 = ui::VBox( FALSE, 5 ); @@ -103,34 +103,34 @@ static gint ci_new( GtkWidget *widget, gpointer data ){ // -------------------------- // fixed = gtk_radio_button_new_with_label( targetTypeRadio, "Fixed" ); - gtk_box_pack_start( GTK_BOX( vbox2 ), fixed, FALSE, FALSE, 3 ); + vbox2.pack_start( fixed, FALSE, FALSE, 3 ); gtk_widget_show( fixed ); targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( fixed ) ); interpolated = gtk_radio_button_new_with_label( targetTypeRadio, "Interpolated" ); - gtk_box_pack_start( GTK_BOX( vbox2 ), interpolated, FALSE, FALSE, 3 ); + vbox2.pack_start( interpolated, FALSE, FALSE, 3 ); gtk_widget_show( interpolated ); targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( interpolated ) ); spline = gtk_radio_button_new_with_label( targetTypeRadio, "Spline" ); - gtk_box_pack_start( GTK_BOX( vbox2 ), spline, FALSE, FALSE, 3 ); + vbox2.pack_start( spline, FALSE, FALSE, 3 ); gtk_widget_show( spline ); targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( spline ) ); // -------------------------- // w = gtk_hseparator_new(); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 2 ); + vbox.pack_start( w, FALSE, FALSE, 2 ); gtk_widget_show( w ); // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Button( "Ok" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_show( w ); @@ -138,7 +138,7 @@ static gint ci_new( GtkWidget *widget, gpointer data ){ gtk_widget_grab_default( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -381,15 +381,15 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){ // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Label( "Name:" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); name = ui::Entry(); - gtk_box_pack_start( GTK_BOX( hbox ), name, FALSE, FALSE, 0 ); + hbox.pack_start( name, FALSE, FALSE, 0 ); gtk_widget_show( name ); if ( g_iActiveTarget < 0 ) { @@ -402,17 +402,17 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){ // -------------------------- // w = gtk_hseparator_new(); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 2 ); + vbox.pack_start( w, FALSE, FALSE, 2 ); gtk_widget_show( w ); // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Button( "Ok" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_show( w ); @@ -420,7 +420,7 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){ gtk_widget_grab_default( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -500,15 +500,15 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){ // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Label( "Name:" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); name = ui::Entry(); - gtk_box_pack_start( GTK_BOX( hbox ), name, TRUE, TRUE, 0 ); + hbox.pack_start( name, TRUE, TRUE, 0 ); gtk_widget_show( name ); sprintf( buf, "target%i", GetCurrentCam()->GetCam()->numTargets() + 1 ); @@ -517,11 +517,11 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){ // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); auto frame = ui::Frame( "Type" ); - gtk_box_pack_start( GTK_BOX( hbox ), frame, TRUE, TRUE, 0 ); + hbox.pack_start( frame, TRUE, TRUE, 0 ); gtk_widget_show( frame ); auto vbox2 = ui::VBox( FALSE, 5 ); @@ -532,34 +532,34 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){ // -------------------------- // fixed = gtk_radio_button_new_with_label( targetTypeRadio, "Fixed" ); - gtk_box_pack_start( GTK_BOX( vbox2 ), fixed, FALSE, FALSE, 3 ); + vbox2.pack_start( fixed, FALSE, FALSE, 3 ); gtk_widget_show( fixed ); targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( fixed ) ); interpolated = gtk_radio_button_new_with_label( targetTypeRadio, "Interpolated" ); - gtk_box_pack_start( GTK_BOX( vbox2 ), interpolated, FALSE, FALSE, 3 ); + vbox2.pack_start( interpolated, FALSE, FALSE, 3 ); gtk_widget_show( interpolated ); targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( interpolated ) ); spline = gtk_radio_button_new_with_label( targetTypeRadio, "Spline" ); - gtk_box_pack_start( GTK_BOX( vbox2 ), spline, FALSE, FALSE, 3 ); + vbox2.pack_start( spline, FALSE, FALSE, 3 ); gtk_widget_show( spline ); targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( spline ) ); // -------------------------- // w = gtk_hseparator_new(); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 2 ); + vbox.pack_start( w, FALSE, FALSE, 2 ); gtk_widget_show( w ); // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Button( "Ok" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_show( w ); @@ -567,7 +567,7 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){ gtk_widget_grab_default( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -848,11 +848,11 @@ static gint ci_add( GtkWidget *widget, gpointer data ){ // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); auto frame = ui::Frame( "Type" ); - gtk_box_pack_start( GTK_BOX( hbox ), frame, TRUE, TRUE, 0 ); + hbox.pack_start( frame, TRUE, TRUE, 0 ); gtk_widget_show( frame ); auto vbox2 = ui::VBox( FALSE, 5 ); @@ -864,7 +864,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ){ for ( i = 1; i < EVENT_COUNT; i++ ) { eventWidget[i] = gtk_radio_button_new_with_label( eventTypeRadio, camEventStr[i] ); - gtk_box_pack_start( GTK_BOX( vbox2 ), eventWidget[i], FALSE, FALSE, 3 ); + vbox2.pack_start( eventWidget[i], FALSE, FALSE, 3 ); gtk_widget_show( eventWidget[i] ); eventTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( eventWidget[i] ) ); if ( camEventFlags[i][1] == false ) { @@ -875,31 +875,31 @@ static gint ci_add( GtkWidget *widget, gpointer data ){ // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Label( "Parameters:" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); parameters = ui::Entry(); - gtk_box_pack_start( GTK_BOX( hbox ), parameters, TRUE, TRUE, 0 ); + hbox.pack_start( parameters, TRUE, TRUE, 0 ); gtk_widget_show( parameters ); // -------------------------- // w = gtk_hseparator_new(); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 2 ); + vbox.pack_start( w, FALSE, FALSE, 2 ); gtk_widget_show( w ); // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Button( "Ok" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_show( w ); @@ -907,7 +907,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ){ gtk_widget_grab_default( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -1029,37 +1029,37 @@ GtkWidget *CreateCameraInspectorDialog( void ){ // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Label( "File:" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); g_pCamListCombo = gtk_combo_new(); - gtk_box_pack_start( GTK_BOX( hbox ), g_pCamListCombo, TRUE, TRUE, 0 ); + hbox.pack_start( g_pCamListCombo, TRUE, TRUE, 0 ); gtk_widget_show( g_pCamListCombo ); // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Label( "Name:" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); g_pCamName = ui::Entry(); - gtk_box_pack_start( GTK_BOX( hbox ), g_pCamName, FALSE, FALSE, 0 ); + hbox.pack_start( g_pCamName, FALSE, FALSE, 0 ); gtk_widget_show( g_pCamName ); w = ui::Label( "Type: " ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); w = ui::Label( "" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); g_pCamType = GTK_LABEL( w ); @@ -1084,15 +1084,15 @@ GtkWidget *CreateCameraInspectorDialog( void ){ // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Label( "Edit:" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); g_pPathListCombo = gtk_combo_new(); - gtk_box_pack_start( GTK_BOX( hbox ), g_pPathListCombo, TRUE, TRUE, 0 ); + hbox.pack_start( g_pPathListCombo, TRUE, TRUE, 0 ); gtk_widget_show( g_pPathListCombo ); RefreshPathListCombo(); @@ -1103,18 +1103,18 @@ GtkWidget *CreateCameraInspectorDialog( void ){ // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); g_pEditModeEditRadioButton = gtk_radio_button_new_with_label( g_pEditTypeRadio, "Edit Points" ); - gtk_box_pack_start( GTK_BOX( hbox ), g_pEditModeEditRadioButton, FALSE, FALSE, 3 ); + hbox.pack_start( g_pEditModeEditRadioButton, FALSE, FALSE, 3 ); gtk_widget_show( g_pEditModeEditRadioButton ); g_pEditTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( g_pEditModeEditRadioButton ) ); g_pEditModeEditRadioButton.connect( "clicked", G_CALLBACK( ci_editmode_edit ), NULL ); g_pEditModeAddRadioButton = gtk_radio_button_new_with_label( g_pEditTypeRadio, "Add Points" ); - gtk_box_pack_start( GTK_BOX( hbox ), g_pEditModeAddRadioButton, FALSE, FALSE, 3 ); + hbox.pack_start( g_pEditModeAddRadioButton, FALSE, FALSE, 3 ); gtk_widget_show( g_pEditModeAddRadioButton ); g_pEditTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( g_pEditModeAddRadioButton ) ); @@ -1127,38 +1127,38 @@ GtkWidget *CreateCameraInspectorDialog( void ){ } w = ui::Label( "Type: " ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); w = ui::Label( "" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); g_pPathType = GTK_LABEL( w ); // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Button( "Rename..." ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 ); + hbox.pack_start( w, FALSE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( ci_rename ), NULL ); gtk_widget_show( w ); w = ui::Button( "Add Target..." ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 ); + hbox.pack_start( w, FALSE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( ci_add_target ), NULL ); gtk_widget_show( w ); // not available in splines library /*w = gtk_button_new_with_label( "Delete Selected" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0); + hbox.pack_start( w, FALSE, TRUE, 0); w.connect( "clicked", G_CALLBACK( ci_delete_selected ), NULL ); gtk_widget_show( w ); w = gtk_button_new_with_label( "Select All" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0); + hbox.pack_start( w, FALSE, TRUE, 0); w.connect( "clicked", G_CALLBACK( ci_select_all ), NULL ); gtk_widget_show( w );*/ @@ -1178,84 +1178,84 @@ GtkWidget *CreateCameraInspectorDialog( void ){ // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Label( "Length (seconds):" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); g_pSecondsEntry = ui::Entry(); - gtk_box_pack_start( GTK_BOX( hbox ), g_pSecondsEntry, FALSE, FALSE, 0 ); + hbox.pack_start( g_pSecondsEntry, FALSE, FALSE, 0 ); gtk_widget_show( g_pSecondsEntry ); // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Label( "Current Time: " ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); w = ui::Label( "0.00" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); g_pCurrentTime = GTK_LABEL( w ); w = ui::Label( " of " ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); w = ui::Label( "0.00" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); g_pTotalTime = GTK_LABEL( w ); // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); g_pTimeLine = ui::Adjustment( 0, 0, 30000, 100, 250, 0 ); g_pTimeLine.connect( "value_changed", G_CALLBACK( ci_timeline_changed ), NULL ); w = ui::HScale( g_pTimeLine ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); gtk_widget_show( w ); gtk_scale_set_draw_value( GTK_SCALE( w ), FALSE ); // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); g_pTrackCamera = ui::CheckButton( "Track Camera" ); - gtk_box_pack_start( GTK_BOX( hbox ), g_pTrackCamera, FALSE, FALSE, 0 ); + hbox.pack_start( g_pTrackCamera, FALSE, FALSE, 0 ); gtk_widget_show( g_pTrackCamera ); // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); w = ui::Label( "Events:" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); + hbox.pack_start( w, FALSE, FALSE, 0 ); gtk_widget_show( w ); // -------------------------- // hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); auto scr = w = ui::ScrolledWindow(); gtk_widget_set_size_request( w, 0, 150 ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( w ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); gtk_widget_show( w ); g_pEventsList = gtk_clist_new( 3 ); @@ -1269,16 +1269,16 @@ GtkWidget *CreateCameraInspectorDialog( void ){ gtk_widget_show( g_pEventsList ); vbox = ui::VBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( hbox ), vbox, FALSE, FALSE, 0 ); + hbox.pack_start( vbox, FALSE, FALSE, 0 ); gtk_widget_show( vbox ); w = ui::Button( "Add..." ); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); w.connect( "clicked", G_CALLBACK( ci_add ), NULL ); gtk_widget_show( w ); w = ui::Button( "Del" ); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); w.connect( "clicked", G_CALLBACK( ci_del ), NULL ); gtk_widget_show( w ); @@ -1300,12 +1300,12 @@ GtkWidget *CreateCameraInspectorDialog( void ){ (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); w = gtk_button_new_with_label( "New..." ); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); w.connect( "clicked", G_CALLBACK( ci_new ), NULL ); gtk_widget_show( w ); w = gtk_button_new_with_label( "Load..." ); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); w.connect( "clicked", G_CALLBACK( ci_load ), NULL ); gtk_widget_show( w ); @@ -1318,26 +1318,26 @@ GtkWidget *CreateCameraInspectorDialog( void ){ (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); w = gtk_button_new_with_label( "Save..." ); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); w.connect( "clicked", G_CALLBACK( ci_save ), NULL ); gtk_widget_show( w ); w = gtk_button_new_with_label( "Unload" ); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); w.connect( "clicked", G_CALLBACK( ci_unload ), NULL ); gtk_widget_show( w ); hbox = gtk_hbox_new( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, TRUE, TRUE, 0 ); + vbox.pack_start( hbox, TRUE, TRUE, 0 ); gtk_widget_show( hbox ); w = gtk_button_new_with_label( "Apply" ); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); w.connect( "clicked", G_CALLBACK( ci_apply ), NULL ); gtk_widget_show( w ); w = gtk_button_new_with_label( "Preview" ); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); w.connect( "clicked", G_CALLBACK( ci_preview ), NULL ); gtk_widget_show( w ); @@ -1350,11 +1350,11 @@ GtkWidget *CreateCameraInspectorDialog( void ){ (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); hbox = gtk_hbox_new( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, TRUE, TRUE, 0 ); + vbox.pack_start( hbox, TRUE, TRUE, 0 ); gtk_widget_show( hbox ); w = gtk_button_new_with_label( "Close" ); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); + vbox.pack_start( w, FALSE, FALSE, 0 ); w.connect( "clicked", G_CALLBACK( ci_close ), NULL ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); diff --git a/contrib/gtkgensurf/gendlgs.cpp b/contrib/gtkgensurf/gendlgs.cpp index 881de8af..14ccf40b 100644 --- a/contrib/gtkgensurf/gendlgs.cpp +++ b/contrib/gtkgensurf/gendlgs.cpp @@ -1368,7 +1368,7 @@ GtkWidget* create_main_dialog(){ notebook = gtk_notebook_new(); gtk_widget_show( notebook ); - gtk_box_pack_start( GTK_BOX( hbox ), notebook, TRUE, TRUE, 0 ); + hbox.pack_start( notebook, TRUE, TRUE, 0 ); notebook.connect( "switch_page", G_CALLBACK( switch_page ), NULL ); gtk_notebook_set_tab_pos( GTK_NOTEBOOK( notebook ), GTK_POS_TOP ); @@ -1399,7 +1399,7 @@ GtkWidget* create_main_dialog(){ { radio = gtk_radio_button_new_with_label( group, games[i] ); gtk_widget_show( radio ); - gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 ); + vbox.pack_start( radio, TRUE, TRUE, 0 ); group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) ); game_radios[i] = radio; radio.connect( "toggled", G_CALLBACK( general_game ), GINT_TO_POINTER( i ) ); @@ -1420,7 +1420,7 @@ GtkWidget* create_main_dialog(){ { radio = gtk_radio_button_new_with_label( group, waveforms[i] ); gtk_widget_show( radio ); - gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 ); + vbox.pack_start( radio, TRUE, TRUE, 0 ); group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) ); wave_radios[i] = radio; radio.connect( "toggled", G_CALLBACK( general_wave ), GINT_TO_POINTER( i ) ); @@ -1441,7 +1441,7 @@ GtkWidget* create_main_dialog(){ { radio = gtk_radio_button_new_with_label( group, orientations[i] ); gtk_widget_show( radio ); - gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 ); + vbox.pack_start( radio, TRUE, TRUE, 0 ); group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) ); plane_radios[i] = radio; radio.connect( "toggled", G_CALLBACK( general_plane ), GINT_TO_POINTER( i ) ); @@ -1534,11 +1534,11 @@ GtkWidget* create_main_dialog(){ hbox2 = ui::HBox( FALSE, 5 ); gtk_widget_show( hbox2 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, TRUE, 0 ); + vbox.pack_start( hbox2, FALSE, TRUE, 0 ); frame = ui::Frame( "Extents" ); gtk_widget_show( frame ); - gtk_box_pack_start( GTK_BOX( hbox2 ), frame, TRUE, TRUE, 0 ); + hbox2.pack_start( frame, TRUE, TRUE, 0 ); auto table = ui::Table( 3, 4, FALSE ); table.show(); @@ -1625,7 +1625,7 @@ GtkWidget* create_main_dialog(){ frame = ui::Frame( "Divisions" ); gtk_widget_show( frame ); - gtk_box_pack_start( GTK_BOX( hbox2 ), frame, TRUE, TRUE, 0 ); + hbox2.pack_start( frame, TRUE, TRUE, 0 ); table = ui::Table( 2, 2, FALSE ); table.show(); @@ -1670,46 +1670,46 @@ GtkWidget* create_main_dialog(){ check = ui::CheckButton( "Use Bezier patches" ); gtk_widget_show( check ); - gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 ); + vbox.pack_start( check, FALSE, TRUE, 0 ); g_object_set_data( G_OBJECT( dlg ), "use_patches", check ); check.connect( "toggled", G_CALLBACK( extents_use_patches ), NULL ); // ^Fishman - Snap to grid, replaced scroll bar with a texbox. label = ui::Label( "Snap to grid:" ); gtk_widget_show( label ); - gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, TRUE, 0 ); + vbox.pack_start( label, FALSE, TRUE, 0 ); gtk_object_set_data( GTK_OBJECT( dlg ), "snap_text", label ); adj = ui::Adjustment( 8, 0, 256, 1, 10, 0 ); adj.connect( "value_changed", G_CALLBACK( extents_snaptogrid_spin ), &SP ); spin = ui::SpinButton( adj, 1, 0 ); gtk_widget_show( spin ); - gtk_box_pack_start( GTK_BOX( vbox ), spin, FALSE, TRUE, 0 ); + vbox.pack_start( spin, FALSE, TRUE, 0 ); gtk_widget_set_size_request( spin, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "sp", spin ); // ^Fishman - End of Snap to grid code. hbox2 = ui::HBox( FALSE, 5 ); gtk_widget_show( hbox2 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, TRUE, 10 ); + vbox.pack_start( hbox2, FALSE, TRUE, 10 ); label = ui::Label( "Decimate:" ); gtk_widget_show( label ); - gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 ); + hbox2.pack_start( label, FALSE, TRUE, 0 ); adj = ui::Adjustment( 0, 0, 110, 1, 10, 0 ); adj.connect( "value_changed", G_CALLBACK( extents_decimate ), NULL ); g_object_set_data( G_OBJECT( dlg ), "decimate_adj", adj ); scale = ui::HScale( adj ); gtk_widget_show( scale ); - gtk_box_pack_start( GTK_BOX( hbox2 ), scale, TRUE, TRUE, 0 ); + hbox2.pack_start( scale, TRUE, TRUE, 0 ); gtk_scale_set_value_pos( GTK_SCALE( scale ), GTK_POS_RIGHT ); gtk_scale_set_digits( GTK_SCALE( scale ), 0 ); g_object_set_data( G_OBJECT( dlg ), "decimate", scale ); frame = ui::Frame( "Corner values" ); gtk_widget_show( frame ); - gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 ); + vbox.pack_start( frame, FALSE, TRUE, 0 ); table = ui::Table( 3, 4, FALSE ); table.show(); @@ -1796,13 +1796,13 @@ GtkWidget* create_main_dialog(){ label = ui::Label( "" ); gtk_widget_show( label ); - gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, TRUE, 0 ); + vbox.pack_start( label, FALSE, TRUE, 0 ); g_object_set_data( G_OBJECT( dlg ), "bmp_note", label ); table = ui::Table( 2, 2, FALSE ); gtk_widget_show( table ); gtk_container_set_border_width( GTK_CONTAINER( table ), 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 ); + vbox.pack_start( table, FALSE, TRUE, 0 ); gtk_table_set_row_spacings( GTK_TABLE( table ), 5 ); gtk_table_set_col_spacings( GTK_TABLE( table ), 5 ); @@ -1829,14 +1829,14 @@ GtkWidget* create_main_dialog(){ button = ui::Button( "Browse..." ); gtk_widget_show( button ); - gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 ); + hbox2.pack_start( button, FALSE, FALSE, 0 ); gtk_widget_set_size_request( button, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "bmp_file_browse", button ); button.connect( "clicked", G_CALLBACK( bitmap_browse ), NULL ); button = ui::Button( "Reload" ); gtk_widget_show( button ); - gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 ); + hbox2.pack_start( button, FALSE, FALSE, 0 ); gtk_widget_set_size_request( button, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "bmp_reload", button ); button.connect( "clicked", G_CALLBACK( bitmap_reload ), NULL ); @@ -1844,7 +1844,7 @@ GtkWidget* create_main_dialog(){ table = ui::Table( 2, 2, TRUE ); gtk_widget_show( table ); gtk_container_set_border_width( GTK_CONTAINER( table ), 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 ); + vbox.pack_start( table, FALSE, TRUE, 0 ); gtk_table_set_row_spacings( GTK_TABLE( table ), 5 ); gtk_table_set_col_spacings( GTK_TABLE( table ), 5 ); @@ -1874,7 +1874,7 @@ GtkWidget* create_main_dialog(){ entry = ui::Entry(); gtk_widget_show( entry ); - gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 ); + hbox2.pack_start( entry, FALSE, FALSE, 0 ); gtk_widget_set_size_request( entry, 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "bmp_black", entry ); entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.black_value ); @@ -1887,7 +1887,7 @@ GtkWidget* create_main_dialog(){ entry = ui::Entry(); gtk_widget_show( entry ); - gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 ); + hbox2.pack_start( entry, FALSE, FALSE, 0 ); gtk_widget_set_size_request( entry, 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "bmp_white", entry ); entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.white_value ); @@ -1907,12 +1907,12 @@ GtkWidget* create_main_dialog(){ "Click \"Free\" to unlock a vertex. Vertices within \"Range\n" "affected\" will be influenced by this vertex." ); gtk_widget_show( label ); - gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, TRUE, 0 ); + vbox.pack_start( label, FALSE, TRUE, 0 ); table = ui::Table( 3, 3, FALSE ); gtk_widget_show( table ); gtk_container_set_border_width( GTK_CONTAINER( table ), 5 ); - gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 ); + vbox.pack_start( table, FALSE, TRUE, 0 ); gtk_table_set_row_spacings( GTK_TABLE( table ), 5 ); gtk_table_set_col_spacings( GTK_TABLE( table ), 5 ); @@ -1998,7 +1998,7 @@ GtkWidget* create_main_dialog(){ // ^Fishman - Modified to add more labels and textboxes. table = ui::Table( 5, 2, FALSE ); gtk_widget_show( table ); - gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 ); + vbox.pack_start( table, FALSE, TRUE, 0 ); gtk_table_set_row_spacings( GTK_TABLE( table ), 5 ); gtk_table_set_col_spacings( GTK_TABLE( table ), 5 ); @@ -2051,21 +2051,21 @@ GtkWidget* create_main_dialog(){ hbox2 = ui::HBox( FALSE, 5 ); gtk_widget_show( hbox2 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, TRUE, 0 ); + vbox.pack_start( hbox2, FALSE, TRUE, 0 ); label = ui::Label( "\"Steep\" angle:" ); gtk_widget_show( label ); - gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 ); + hbox2.pack_start( label, FALSE, TRUE, 0 ); adj = ui::Adjustment( 60, 0, 90, 1, 10, 0 ); spin = ui::SpinButton( adj, 1, 0 ); gtk_widget_show( spin ); - gtk_box_pack_start( GTK_BOX( hbox2 ), spin, FALSE, TRUE, 0 ); + hbox2.pack_start( spin, FALSE, TRUE, 0 ); g_object_set_data( G_OBJECT( dlg ), "tex_slant", spin ); table = ui::Table( 2, 4, TRUE ); gtk_widget_show( table ); - gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 ); + vbox.pack_start( table, FALSE, TRUE, 0 ); gtk_table_set_row_spacings( GTK_TABLE( table ), 5 ); gtk_table_set_col_spacings( GTK_TABLE( table ), 5 ); @@ -2117,71 +2117,71 @@ GtkWidget* create_main_dialog(){ check = ui::CheckButton( "Use detail brushes" ); gtk_widget_show( check ); - gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 ); + vbox.pack_start( check, FALSE, TRUE, 0 ); g_object_set_data( G_OBJECT( dlg ), "detail", check ); check.connect( "toggled", G_CALLBACK( texture_detail ), NULL ); check = ui::CheckButton( "Detail hint brushes" ); gtk_widget_show( check ); - gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 ); + vbox.pack_start( check, FALSE, TRUE, 0 ); g_object_set_data( G_OBJECT( dlg ), "hint", check ); check.connect( "toggled", G_CALLBACK( texture_hint ), NULL ); // ^Fishman - Add terrain key to func_group. check = ui::CheckButton( "Add terrain key" ); gtk_widget_show( check ); - gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 ); + vbox.pack_start( check, FALSE, TRUE, 0 ); g_object_set_data( G_OBJECT( dlg ), "terrain_ent", check ); check.connect( "toggled", G_CALLBACK( texture_terrainent ), NULL ); vbox = ui::VBox( FALSE, 5 ); gtk_widget_show( vbox ); - gtk_box_pack_start( GTK_BOX( hbox ), vbox, FALSE, TRUE, 0 ); + hbox.pack_start( vbox, FALSE, TRUE, 0 ); button = ui::Button( "OK" ); gtk_widget_show( button ); - gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 ); + vbox.pack_start( button, FALSE, TRUE, 0 ); gtk_widget_set_size_request( button, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "go", button ); button.connect( "clicked", G_CALLBACK( main_go ), NULL ); label = ui::Label( "Settings:" ); gtk_widget_show( label ); - gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, TRUE, 0 ); + vbox.pack_start( label, FALSE, TRUE, 0 ); button = ui::Button( "Open..." ); gtk_widget_show( button ); - gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 ); + vbox.pack_start( button, FALSE, TRUE, 0 ); g_object_set_data( G_OBJECT( dlg ), "open", button ); button.connect( "clicked", G_CALLBACK( main_open ), NULL ); button = ui::Button( "Save as..." ); gtk_widget_show( button ); - gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 ); + vbox.pack_start( button, FALSE, TRUE, 0 ); g_object_set_data( G_OBJECT( dlg ), "save", button ); button.connect( "clicked", G_CALLBACK( main_save ), NULL ); button = ui::Button( "Defaults" ); gtk_widget_show( button ); - gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 ); + vbox.pack_start( button, FALSE, TRUE, 0 ); g_object_set_data( G_OBJECT( dlg ), "defaults", button ); button.connect( "clicked", G_CALLBACK( main_defaults ), NULL ); button = ui::Button( "About..." ); gtk_widget_show( button ); - gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 ); + vbox.pack_start( button, FALSE, TRUE, 0 ); button.connect( "clicked", G_CALLBACK( main_about ), NULL ); check = ui::CheckButton( "Preview" ); gtk_widget_show( check ); - gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 ); + vbox.pack_start( check, FALSE, TRUE, 0 ); check.connect( "toggled", G_CALLBACK( main_preview ), NULL ); g_object_set_data( G_OBJECT( dlg ), "main_preview", check ); // ^Fishman - Antializing for the preview window. check = ui::CheckButton( "Antialised lines" ); gtk_widget_show( check ); - gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 ); + vbox.pack_start( check, FALSE, TRUE, 0 ); g_object_set_data( G_OBJECT( dlg ), "main_antialiasing", check ); check.connect( "toggled", G_CALLBACK( main_antialiasing ), NULL ); diff --git a/contrib/gtkgensurf/view.cpp b/contrib/gtkgensurf/view.cpp index 307ccdc4..12ac4d94 100644 --- a/contrib/gtkgensurf/view.cpp +++ b/contrib/gtkgensurf/view.cpp @@ -363,7 +363,7 @@ static void preview_spin( GtkAdjustment *adj, double *data ){ } void CreateViewWindow(){ - GtkWidget *hbox, *label, *spin; + GtkWidget *label, *spin; #ifndef ISOMETRIC elevation = PI / 6.; @@ -382,21 +382,21 @@ void CreateViewWindow(){ dlg.add(vbox); #ifndef ISOMETRIC - hbox = ui::HBox( TRUE, 5 ); + auto hbox = ui::HBox( TRUE, 5 ); gtk_widget_show( hbox ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, TRUE, 0 ); + vbox.pack_start( hbox, FALSE, TRUE, 0 ); gtk_container_set_border_width( GTK_CONTAINER( hbox ), 3 ); label = ui::Label( "Elevation" ); gtk_widget_show( label ); gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 ); - gtk_box_pack_start( GTK_BOX( hbox ), label, FALSE, TRUE, 0 ); + hbox.pack_start( label, FALSE, TRUE, 0 ); auto adj = ui::Adjustment( 30, -90, 90, 1, 10, 0 ); adj.connect( "value_changed", G_CALLBACK( preview_spin ), &elevation ); spin = ui::SpinButton( adj, 1, 0 ); gtk_widget_show( spin ); - gtk_box_pack_start( GTK_BOX( hbox ), spin, FALSE, TRUE, 0 ); + hbox.pack_start( spin, FALSE, TRUE, 0 ); spin.connect( "focus_out_event", G_CALLBACK( doublevariable_spinfocusout ), &elevation ); adj = ui::Adjustment( 30, 0, 359, 1, 10, 0 ); @@ -404,19 +404,19 @@ void CreateViewWindow(){ spin = ui::SpinButton( adj, 1, 0 ); gtk_widget_show( spin ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE ); - gtk_box_pack_end( GTK_BOX( hbox ), spin, FALSE, TRUE, 0 ); + hbox.pack_end(spin, FALSE, TRUE, 0); label = ui::Label( "Azimuth" ); gtk_widget_show( label ); gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 ); - gtk_box_pack_end( GTK_BOX( hbox ), label, FALSE, TRUE, 0 ); + hbox.pack_end(label, FALSE, TRUE, 0); spin.connect( "focus_out_event", G_CALLBACK( doublevariable_spinfocusout ), &azimuth ); #endif auto frame = ui::Frame(ui::null); frame.show(); gtk_frame_set_shadow_type( GTK_FRAME( frame ), GTK_SHADOW_IN ); - gtk_box_pack_start( GTK_BOX( vbox ), frame, TRUE, TRUE, 0 ); + vbox.pack_start( frame, TRUE, TRUE, 0 ); g_pPreviewWidget = g_UIGtkTable.m_pfn_glwidget_new( FALSE, NULL ); diff --git a/contrib/hydratoolz/plugin.cpp b/contrib/hydratoolz/plugin.cpp index 52e79091..43403d08 100644 --- a/contrib/hydratoolz/plugin.cpp +++ b/contrib/hydratoolz/plugin.cpp @@ -100,21 +100,21 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ vbox.show(); w = ui::Label( lpText ); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 2 ); + vbox.pack_start( w, FALSE, FALSE, 2 ); gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT ); gtk_widget_show( w ); w = gtk_hseparator_new(); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 2 ); + vbox.pack_start( w, FALSE, FALSE, 2 ); gtk_widget_show( w ); hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 ); + vbox.pack_start( hbox, FALSE, FALSE, 2 ); gtk_widget_show( hbox ); if ( mode == MB_OK ) { w = ui::Button( "Ok" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); gtk_widget_set_can_default( w, true ); @@ -124,7 +124,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ } else if ( mode == MB_OKCANCEL ) { w = ui::Button( "Ok" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); gtk_widget_set_can_default( w, true ); @@ -132,7 +132,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ gtk_widget_show( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); gtk_widget_show( w ); @@ -140,7 +140,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ } else if ( mode == MB_YESNOCANCEL ) { w = ui::Button( "Yes" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); gtk_widget_set_can_default( w, true ); @@ -148,13 +148,13 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ gtk_widget_show( w ); w = ui::Button( "No" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); gtk_widget_show( w ); @@ -163,7 +163,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ else /* if (mode == MB_YESNO) */ { w = ui::Button( "Yes" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); gtk_widget_set_can_default( w, true ); @@ -171,7 +171,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ gtk_widget_show( w ); w = ui::Button( "No" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); gtk_widget_show( w ); diff --git a/contrib/prtview/AboutDialog.cpp b/contrib/prtview/AboutDialog.cpp index 0e342f40..c517e6c1 100644 --- a/contrib/prtview/AboutDialog.cpp +++ b/contrib/prtview/AboutDialog.cpp @@ -68,16 +68,16 @@ void DoAboutDlg(){ __DATE__; auto label = ui::Label(label_text); label.show(); - gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); + hbox.pack_start( label, TRUE, TRUE, 0); gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); auto vbox = ui::VBox(FALSE, 0); vbox.show(); - gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); + hbox.pack_start( vbox, FALSE, FALSE, 0); auto button = ui::Button("OK"); button.show(); - gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); + vbox.pack_start( button, FALSE, FALSE, 0); button.connect("clicked", G_CALLBACK(dialog_button_callback), GINT_TO_POINTER(IDOK)); button.dimensions(60, -1); diff --git a/contrib/prtview/ConfigDialog.cpp b/contrib/prtview/ConfigDialog.cpp index 86828d09..f97ad3f2 100644 --- a/contrib/prtview/ConfigDialog.cpp +++ b/contrib/prtview/ConfigDialog.cpp @@ -235,9 +235,6 @@ static void OnClip( GtkWidget *widget, gpointer data ){ } void DoConfigDialog(){ - GtkWidget *hbox, *table; - GtkWidget *lw3slider, *lw3label, *lw2slider, *lw2label, *item; - GtkWidget *transslider, *translabel, *clipslider, *cliplabel; int loop = 1, ret = IDCANCEL; auto dlg = ui::Window( ui::window_type::TOP ); @@ -256,31 +253,31 @@ void DoConfigDialog(){ auto frame = ui::Frame( "3D View" ); frame.show(); - gtk_box_pack_start( GTK_BOX( vbox ), frame, TRUE, TRUE, 0 ); + vbox.pack_start( frame, TRUE, TRUE, 0 ); auto vbox2 = ui::VBox( FALSE, 5 ); vbox2.show(); frame.add(vbox2); gtk_container_set_border_width( GTK_CONTAINER( vbox2 ), 5 ); - hbox = ui::HBox( FALSE, 5 ); + auto hbox = ui::HBox( FALSE, 5 ); gtk_widget_show( hbox ); - gtk_box_pack_start( GTK_BOX( vbox2 ), hbox, TRUE, TRUE, 0 ); + vbox2.pack_start( hbox, TRUE, TRUE, 0 ); auto adj = ui::Adjustment( portals.width_3d, 2, 40, 1, 1, 0 ); - lw3slider = ui::HScale( adj ); + auto lw3slider = ui::HScale( adj ); gtk_widget_show( lw3slider ); - gtk_box_pack_start( GTK_BOX( hbox ), lw3slider, TRUE, TRUE, 0 ); + hbox.pack_start( lw3slider, TRUE, TRUE, 0 ); gtk_scale_set_draw_value( GTK_SCALE( lw3slider ), FALSE ); - lw3label = ui::Label( "" ); + auto lw3label = ui::Label( "" ); gtk_widget_show( lw3label ); - gtk_box_pack_start( GTK_BOX( hbox ), lw3label, FALSE, TRUE, 0 ); + hbox.pack_start( lw3label, FALSE, TRUE, 0 ); adj.connect( "value_changed", G_CALLBACK( OnScroll3d ), lw3label ); - table = ui::Table( 2, 4, FALSE ); + auto table = ui::Table( 2, 4, FALSE ); gtk_widget_show( table ); - gtk_box_pack_start( GTK_BOX( vbox2 ), table, TRUE, TRUE, 0 ); + vbox2.pack_start( table, TRUE, TRUE, 0 ); gtk_table_set_row_spacings( GTK_TABLE( table ), 5 ); gtk_table_set_col_spacings( GTK_TABLE( table ), 5 ); @@ -328,7 +325,7 @@ void DoConfigDialog(){ auto zlist = ui::ComboBoxText(ui::New); gtk_widget_show( zlist ); - gtk_box_pack_start( GTK_BOX( vbox2 ), zlist, TRUE, FALSE, 0 ); + vbox2.pack_start( zlist, TRUE, FALSE, 0 ); gtk_combo_box_text_append_text(zlist, "Z-Buffer Test and Write (recommended for solid or no polygons)"); gtk_combo_box_text_append_text(zlist, "Z-Buffer Test Only (recommended for transparent polygons)"); @@ -340,19 +337,19 @@ void DoConfigDialog(){ table = ui::Table( 2, 2, FALSE ); gtk_widget_show( table ); - gtk_box_pack_start( GTK_BOX( vbox2 ), table, TRUE, TRUE, 0 ); + vbox2.pack_start( table, TRUE, TRUE, 0 ); gtk_table_set_row_spacings( GTK_TABLE( table ), 5 ); gtk_table_set_col_spacings( GTK_TABLE( table ), 5 ); adj = ui::Adjustment( portals.trans_3d, 0, 100, 1, 1, 0 ); - transslider = ui::HScale( adj ); + auto transslider = ui::HScale( adj ); gtk_widget_show( transslider ); gtk_table_attach( GTK_TABLE( table ), transslider, 0, 1, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_scale_set_draw_value( GTK_SCALE( transslider ), FALSE ); - translabel = ui::Label( "" ); + auto translabel = ui::Label( "" ); gtk_widget_show( translabel ); gtk_table_attach( GTK_TABLE( table ), translabel, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_FILL ), @@ -361,14 +358,14 @@ void DoConfigDialog(){ adj.connect( "value_changed", G_CALLBACK( OnScrollTrans ), translabel ); adj = ui::Adjustment( portals.clip_range, 1, 128, 1, 1, 0 ); - clipslider = ui::HScale( adj ); + auto clipslider = ui::HScale( adj ); gtk_widget_show( clipslider ); gtk_table_attach( GTK_TABLE( table ), clipslider, 0, 1, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_scale_set_draw_value( GTK_SCALE( clipslider ), FALSE ); - cliplabel = ui::Label( "" ); + auto cliplabel = ui::Label( "" ); gtk_widget_show( cliplabel ); gtk_table_attach( GTK_TABLE( table ), cliplabel, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_FILL ), @@ -378,21 +375,21 @@ void DoConfigDialog(){ hbox = ui::HBox( TRUE, 5 ); gtk_widget_show( hbox ); - gtk_box_pack_start( GTK_BOX( vbox2 ), hbox, TRUE, FALSE, 0 ); + vbox2.pack_start( hbox, TRUE, FALSE, 0 ); auto show3check = ui::CheckButton( "Show" ); gtk_widget_show( show3check ); - gtk_box_pack_start( GTK_BOX( hbox ), show3check, TRUE, TRUE, 0 ); + hbox.pack_start( show3check, TRUE, TRUE, 0 ); show3check.connect( "toggled", G_CALLBACK( OnConfig3d ), NULL ); auto portalcheck = ui::CheckButton( "Portal cubic clipper" ); gtk_widget_show( portalcheck ); - gtk_box_pack_start( GTK_BOX( hbox ), portalcheck, TRUE, TRUE, 0 ); + hbox.pack_start( portalcheck, TRUE, TRUE, 0 ); portalcheck.connect( "toggled", G_CALLBACK( OnClip ), NULL ); frame = ui::Frame( "2D View" ); gtk_widget_show( frame ); - gtk_box_pack_start( GTK_BOX( vbox ), frame, TRUE, TRUE, 0 ); + vbox.pack_start( frame, TRUE, TRUE, 0 ); vbox2 = ui::VBox( FALSE, 5 ); vbox2.show(); @@ -401,50 +398,50 @@ void DoConfigDialog(){ hbox = ui::HBox( FALSE, 5 ); gtk_widget_show( hbox ); - gtk_box_pack_start( GTK_BOX( vbox2 ), hbox, TRUE, FALSE, 0 ); + vbox2.pack_start( hbox, TRUE, FALSE, 0 ); adj = ui::Adjustment( portals.width_2d, 2, 40, 1, 1, 0 ); - lw2slider = ui::HScale( adj ); + auto lw2slider = ui::HScale( adj ); gtk_widget_show( lw2slider ); - gtk_box_pack_start( GTK_BOX( hbox ), lw2slider, TRUE, TRUE, 0 ); + hbox.pack_start( lw2slider, TRUE, TRUE, 0 ); gtk_scale_set_draw_value( GTK_SCALE( lw2slider ), FALSE ); - lw2label = ui::Label( "" ); + auto lw2label = ui::Label( "" ); gtk_widget_show( lw2label ); - gtk_box_pack_start( GTK_BOX( hbox ), lw2label, FALSE, TRUE, 0 ); + hbox.pack_start( lw2label, FALSE, TRUE, 0 ); adj.connect( "value_changed", G_CALLBACK( OnScroll2d ), lw2label ); hbox = ui::HBox( FALSE, 5 ); gtk_widget_show( hbox ); - gtk_box_pack_start( GTK_BOX( vbox2 ), hbox, TRUE, FALSE, 0 ); + vbox2.pack_start( hbox, TRUE, FALSE, 0 ); button = ui::Button( "Color" ); gtk_widget_show( button ); - gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); + hbox.pack_start( button, FALSE, FALSE, 0 ); button.connect( "clicked", G_CALLBACK( OnColor2d ), NULL ); gtk_widget_set_size_request( button, 60, -1 ); auto 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 ); + hbox.pack_start( aa2check, TRUE, TRUE, 0 ); aa2check.connect( "toggled", G_CALLBACK( OnAntiAlias2d ), NULL ); hbox = ui::HBox( FALSE, 5 ); gtk_widget_show( hbox ); - gtk_box_pack_start( GTK_BOX( vbox2 ), hbox, TRUE, FALSE, 0 ); + vbox2.pack_start( hbox, TRUE, FALSE, 0 ); auto show2check = ui::CheckButton( "Show" ); gtk_widget_show( show2check ); - gtk_box_pack_start( GTK_BOX( hbox ), show2check, FALSE, FALSE, 0 ); + hbox.pack_start( show2check, FALSE, FALSE, 0 ); show2check.connect( "toggled", G_CALLBACK( OnConfig2d ), NULL ); hbox = ui::HBox( FALSE, 5 ); gtk_widget_show( hbox ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); button = ui::Button( "OK" ); gtk_widget_show( button ); - gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); + hbox.pack_end(button, FALSE, FALSE, 0); button.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); gtk_widget_set_size_request( button, 60, -1 ); diff --git a/contrib/prtview/LoadPortalFileDialog.cpp b/contrib/prtview/LoadPortalFileDialog.cpp index b924e7fd..aef0e3f5 100644 --- a/contrib/prtview/LoadPortalFileDialog.cpp +++ b/contrib/prtview/LoadPortalFileDialog.cpp @@ -77,7 +77,6 @@ static void change_clicked( GtkWidget *widget, gpointer data ){ } int DoLoadPortalFileDialog(){ - GtkWidget *hbox, *entry, *check2d, *check3d; int loop = 1, ret = IDCANCEL; auto dlg = ui::Window( ui::window_type::TOP ); @@ -94,43 +93,43 @@ int DoLoadPortalFileDialog(){ dlg.add(vbox); gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 ); - entry = ui::Entry(ui::New); + auto entry = ui::Entry(ui::New); gtk_widget_show( entry ); gtk_editable_set_editable( GTK_EDITABLE( entry ), FALSE ); - gtk_box_pack_start( GTK_BOX( vbox ), entry, FALSE, FALSE, 0 ); + vbox.pack_start( entry, FALSE, FALSE, 0 ); - hbox = ui::HBox( FALSE, 5 ); + auto hbox = ui::HBox( FALSE, 5 ); gtk_widget_show( hbox ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); - check3d = ui::CheckButton( "Show 3D" ); + auto check3d = ui::CheckButton( "Show 3D" ); gtk_widget_show( check3d ); - gtk_box_pack_start( GTK_BOX( hbox ), check3d, FALSE, FALSE, 0 ); + hbox.pack_start( check3d, FALSE, FALSE, 0 ); - check2d = ui::CheckButton( "Show 2D" ); + auto check2d = ui::CheckButton( "Show 2D" ); gtk_widget_show( check2d ); - gtk_box_pack_start( GTK_BOX( hbox ), check2d, FALSE, FALSE, 0 ); + hbox.pack_start( check2d, FALSE, FALSE, 0 ); auto button = ui::Button( "Change" ); gtk_widget_show( button ); - gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); + hbox.pack_end(button, FALSE, FALSE, 0); button.connect( "clicked", G_CALLBACK( change_clicked ), entry ); gtk_widget_set_size_request( button, 60, -1 ); hbox = ui::HBox( FALSE, 5 ); gtk_widget_show( hbox ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); + vbox.pack_start( hbox, FALSE, FALSE, 0 ); button = ui::Button( "Cancel" ); gtk_widget_show( button ); - gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); + hbox.pack_end(button, FALSE, FALSE, 0); button.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); gtk_widget_set_size_request( button, 60, -1 ); button = ui::Button( "OK" ); gtk_widget_show( button ); - gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); + hbox.pack_end(button, FALSE, FALSE, 0); button.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); gtk_widget_set_size_request( button, 60, -1 ); diff --git a/contrib/sunplug/sunplug.cpp b/contrib/sunplug/sunplug.cpp index ad9e11f2..91408c2b 100644 --- a/contrib/sunplug/sunplug.cpp +++ b/contrib/sunplug/sunplug.cpp @@ -254,8 +254,6 @@ extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules( ModuleServer& server // About dialog void about_plugin_window(){ - GtkWidget *label, *button; - auto window = ui::Window( ui::window_type::TOP ); // create a window gtk_window_set_transient_for( GTK_WINDOW( window ), SunPlug::main_window ); // make the window to stay in front of the main window window.connect( "delete_event", G_CALLBACK( delete_event ), NULL ); // connect the delete event @@ -268,13 +266,13 @@ void about_plugin_window(){ auto vbox = ui::VBox( FALSE, 10 ); // create a box to arrange new objects vertically window.add(vbox); - label = ui::Label( "SunPlug v1.0 for NetRadiant 1.5\nby Topsun" ); // create a label + auto label = ui::Label( "SunPlug v1.0 for NetRadiant 1.5\nby Topsun" ); // create a label 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 + vbox.pack_start( label, FALSE, FALSE, 2 ); // insert the label in the box - button = ui::Button( "OK" ); // create a button with text + auto button = ui::Button( "OK" ); // create a button with text g_signal_connect_swapped( G_OBJECT( button ), "clicked", G_CALLBACK( gtk_widget_destroy ), (void *) 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 + vbox.pack_start( button, FALSE, FALSE, 2 ); // insert the button in the box gtk_window_set_position( GTK_WINDOW( window ), GTK_WIN_POS_CENTER ); // center the window on screen @@ -315,7 +313,7 @@ void GetOptimalCoordinates( AABB *levelBoundingBox ){ // MapCoordinator dialog window void MapCoordinator(){ - GtkWidget *table, *label, *spinnerMinX, *spinnerMinY, *spinnerMaxX, *spinnerMaxY; + GtkWidget *spinnerMinX, *spinnerMinY, *spinnerMaxX, *spinnerMaxY; Entity *theWorldspawn = NULL; const char *buffer; char line[20]; @@ -373,16 +371,16 @@ void MapCoordinator(){ auto button = ui::Button( "Get optimal mapcoords" ); // create button with text button.connect( "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 + vbox.pack_start( button, FALSE, FALSE, 2 ); // insert button into vbox - gtk_box_pack_start( GTK_BOX( vbox ), gtk_hseparator_new(), FALSE, FALSE, 2 ); // insert separator into vbox + vbox.pack_start( ui::Widget(gtk_hseparator_new()), FALSE, FALSE, 2 ); // insert separator into vbox - table = ui::Table( 4, 3, TRUE ); // create table + auto table = ui::Table( 4, 3, TRUE ); // create table gtk_table_set_row_spacings( GTK_TABLE( table ), 8 ); // set row spacings gtk_table_set_col_spacings( GTK_TABLE( table ), 8 ); // set column spacings - gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, FALSE, 2 ); // insert table into vbox + vbox.pack_start( table, FALSE, FALSE, 2 ); // insert table into vbox - label = ui::Label( "x" ); // create label + auto label = ui::Label( "x" ); // create label gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT ); // align text to the left side gtk_table_attach_defaults( GTK_TABLE( table ), label, 1, 2, 0, 1 ); // insert label into table @@ -428,13 +426,13 @@ void MapCoordinator(){ else { globalOutputStream() << "SunPlug: no worldspawn found!\n"; // output error to console - label = ui::Label( "ERROR: No worldspawn was found in the map!\nIn order to use this tool the map must have at least one brush in the worldspawn. " ); // create a label + auto label = ui::Label( "ERROR: No worldspawn was found in the map!\nIn order to use this tool the map must have at least one brush in the worldspawn. " ); // create a label 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 + vbox.pack_start( label, FALSE, FALSE, 2 ); // insert the label in the box auto button = ui::Button( "OK" ); // create a button with text button.connect( "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 + vbox.pack_start( button, FALSE, FALSE, 2 ); // insert the button in the box } gtk_window_set_position( GTK_WINDOW( window ), GTK_WIN_POS_CENTER ); // center the window diff --git a/libs/gtkutil/dialog.cpp b/libs/gtkutil/dialog.cpp index 20bd9cba..c5eb96d3 100644 --- a/libs/gtkutil/dialog.cpp +++ b/libs/gtkutil/dialog.cpp @@ -167,7 +167,7 @@ ui::Window create_simple_modal_dialog_window( const char* title, ModalDialog& di ui::Alignment alignment = ui::Alignment( 0.5, 0.0, 0.0, 0.0 ); gtk_widget_show( GTK_WIDGET( alignment ) ); - gtk_box_pack_start( GTK_BOX( vbox1 ), GTK_WIDGET( alignment ), FALSE, FALSE, 0 ); + vbox1.pack_start( alignment, FALSE, FALSE, 0 ); auto button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &dialog ); alignment.add(button); @@ -185,7 +185,7 @@ RadioHBox RadioHBox_new( StringArrayRange names ){ { radio = ui::RadioButton(GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( group, *i ) )); gtk_widget_show( GTK_WIDGET( radio ) ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( radio ), FALSE, FALSE, 0 ); + hbox.pack_start( radio, FALSE, FALSE, 0 ); group = gtk_radio_button_get_group( radio ); } @@ -206,13 +206,13 @@ PathEntry PathEntry_new(){ auto entry = ui::Entry(ui::New); gtk_entry_set_has_frame( entry, FALSE ); gtk_widget_show( GTK_WIDGET( entry ) ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( entry ), TRUE, TRUE, 0 ); + hbox.pack_start( entry, TRUE, TRUE, 0 ); // browse button auto button = ui::Button(ui::New); 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 ); + hbox.pack_end(button, FALSE, FALSE, 0); frame.add(hbox); @@ -263,5 +263,5 @@ ui::Table DialogRow_new( const char* name, ui::Widget widget ){ } void DialogVBox_packRow( ui::VBox vbox, ui::Widget row ){ - gtk_box_pack_start( GTK_BOX( vbox ), row, FALSE, FALSE, 0 ); + vbox.pack_start( row, FALSE, FALSE, 0 ); } diff --git a/libs/gtkutil/messagebox.cpp b/libs/gtkutil/messagebox.cpp index 1441b00d..50544aeb 100644 --- a/libs/gtkutil/messagebox.cpp +++ b/libs/gtkutil/messagebox.cpp @@ -27,7 +27,7 @@ #include "dialog.h" #include "widget.h" -GtkWidget* create_padding( int width, int height ){ +ui::Widget create_padding( int width, int height ){ ui::Alignment widget = ui::Alignment( 0.0, 0.0, 0.0, 0.0 ); gtk_widget_show( widget ); gtk_widget_set_size_request( widget, width, height ); @@ -74,42 +74,42 @@ EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const cha window.add(vbox); - GtkHBox* hboxDummy = create_dialog_hbox( 0, 0 ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hboxDummy ), FALSE, FALSE, 0 ); + auto hboxDummy = create_dialog_hbox( 0, 0 ); + vbox.pack_start( hboxDummy, FALSE, FALSE, 0 ); - gtk_box_pack_start( GTK_BOX( hboxDummy ), create_padding( 0, 50 ), FALSE, FALSE, 0 ); // HACK to force minimum height + hboxDummy.pack_start( create_padding( 0, 50 ), FALSE, FALSE, 0 ); // HACK to force minimum height - GtkHBox* iconBox = create_dialog_hbox( 16, 0 ); - gtk_box_pack_start( GTK_BOX( hboxDummy ), GTK_WIDGET( iconBox ), FALSE, FALSE, 0 ); + auto iconBox = create_dialog_hbox( 16, 0 ); + hboxDummy.pack_start( iconBox, FALSE, FALSE, 0 ); - GtkImage* image = GTK_IMAGE( gtk_image_new_from_stock( messagebox_stock_icon( icon ), GTK_ICON_SIZE_DIALOG ) ); + auto image = ui::Image(GTK_IMAGE( gtk_image_new_from_stock( messagebox_stock_icon( icon ), GTK_ICON_SIZE_DIALOG ) )); gtk_widget_show( GTK_WIDGET( image ) ); - gtk_box_pack_start( GTK_BOX( iconBox ), GTK_WIDGET( image ), FALSE, FALSE, 0 ); + iconBox.pack_start( image, FALSE, FALSE, 0 ); - GtkLabel* label = GTK_LABEL( ui::Label( text ) ); + auto label = ui::Label( text ); gtk_widget_show( GTK_WIDGET( label ) ); gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 ); gtk_label_set_justify( label, GTK_JUSTIFY_LEFT ); gtk_label_set_line_wrap( label, TRUE ); - gtk_box_pack_start( GTK_BOX( iconBox ), GTK_WIDGET( label ), TRUE, TRUE, 0 ); + iconBox.pack_start( label, TRUE, TRUE, 0 ); - GtkVBox* vboxDummy = create_dialog_vbox( 0, 0 ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( vboxDummy ), FALSE, FALSE, 0 ); + auto vboxDummy = create_dialog_vbox( 0, 0 ); + vbox.pack_start( vboxDummy, FALSE, FALSE, 0 ); auto alignment = ui::Alignment( 0.5, 0.0, 0.0, 0.0 ); gtk_widget_show( GTK_WIDGET( alignment ) ); - gtk_box_pack_start( GTK_BOX( vboxDummy ), GTK_WIDGET( alignment ), FALSE, FALSE, 0 ); + vboxDummy.pack_start( alignment, FALSE, FALSE, 0 ); auto hbox = create_dialog_hbox( 8, 0 ); alignment.add(hbox); - gtk_box_pack_start( GTK_BOX( vboxDummy ), create_padding( 400, 0 ), FALSE, FALSE, 0 ); // HACK to force minimum width + vboxDummy.pack_start( create_padding( 400, 0 ), FALSE, FALSE, 0 ); // HACK to force minimum width if ( type == eMB_OK ) { auto button = create_modal_dialog_button( "OK", ok_button ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); + hbox.pack_start( button, TRUE, FALSE, 0 ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); widget_make_default( button ); @@ -120,15 +120,15 @@ EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const cha else if ( type == eMB_OKCANCEL ) { { auto button = create_modal_dialog_button( "OK", ok_button ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); + hbox.pack_start( button, TRUE, FALSE, 0 ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); widget_make_default( button ); button.show(); } { - GtkButton* button = create_modal_dialog_button( "OK", cancel_button ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); + auto button = create_modal_dialog_button( "OK", cancel_button ); + hbox.pack_start( button, TRUE, FALSE, 0 ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); gtk_widget_show( GTK_WIDGET( button ) ); } @@ -138,19 +138,19 @@ EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const cha else if ( type == eMB_YESNOCANCEL ) { { auto button = create_modal_dialog_button( "Yes", yes_button ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); + hbox.pack_start( button, TRUE, FALSE, 0 ); widget_make_default( button ); button.show(); } { - GtkButton* button = create_modal_dialog_button( "No", no_button ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); + auto button = create_modal_dialog_button( "No", no_button ); + hbox.pack_start( button, TRUE, FALSE, 0 ); gtk_widget_show( GTK_WIDGET( button ) ); } { - GtkButton* button = create_modal_dialog_button( "Cancel", cancel_button ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); + auto button = create_modal_dialog_button( "Cancel", cancel_button ); + hbox.pack_start( button, TRUE, FALSE, 0 ); gtk_widget_show( GTK_WIDGET( button ) ); } @@ -159,13 +159,13 @@ EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const cha else if ( type == eMB_NOYES ) { { auto button = create_modal_dialog_button( "No", no_button ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); + hbox.pack_start( button, TRUE, FALSE, 0 ); widget_make_default( button ); button.show(); } { - GtkButton* button = create_modal_dialog_button( "Yes", yes_button ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); + auto button = create_modal_dialog_button( "Yes", yes_button ); + hbox.pack_start( button, TRUE, FALSE, 0 ); gtk_widget_show( GTK_WIDGET( button ) ); } @@ -175,14 +175,14 @@ EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const cha { { auto button = create_modal_dialog_button( "Yes", yes_button ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); + hbox.pack_start( button, TRUE, FALSE, 0 ); widget_make_default( button ); gtk_widget_show( GTK_WIDGET( button ) ); } { - GtkButton* button = create_modal_dialog_button( "No", no_button ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); + auto button = create_modal_dialog_button( "No", no_button ); + hbox.pack_start( button, TRUE, FALSE, 0 ); gtk_widget_show( GTK_WIDGET( button ) ); } dialog.ret = eIDNO; diff --git a/libs/uilib/uilib.cpp b/libs/uilib/uilib.cpp index d3cd1972..c2c24c50 100644 --- a/libs/uilib/uilib.cpp +++ b/libs/uilib/uilib.cpp @@ -256,6 +256,18 @@ namespace ui { gtk_scrolled_window_set_policy(this, static_cast(x), static_cast(y)); } + IMPL(Box, GTK_BOX); + + void IBox::pack_start(ui::Widget child, bool expand, bool fill, unsigned int padding) + { + gtk_box_pack_start(this, child, expand, fill, padding); + } + + void IBox::pack_end(ui::Widget child, bool expand, bool fill, unsigned int padding) + { + gtk_box_pack_end(this, child, expand, fill, padding); + } + IMPL(VBox, GTK_VBOX); VBox::VBox(bool homogenous, int spacing) : VBox(GTK_VBOX(gtk_vbox_new(homogenous, spacing))) diff --git a/libs/uilib/uilib.h b/libs/uilib/uilib.h index 5d8a48fb..4a6eff47 100644 --- a/libs/uilib/uilib.h +++ b/libs/uilib/uilib.h @@ -395,6 +395,8 @@ namespace ui { WRAP(Box, Container, _GtkBox, (), , + void pack_start(ui::Widget child, bool expand, bool fill, unsigned int padding); + void pack_end(ui::Widget child, bool expand, bool fill, unsigned int padding); ); WRAP(VBox, Box, _GtkVBox, (), diff --git a/plugins/textool/TexTool.cpp b/plugins/textool/TexTool.cpp index 1a251b05..96851a48 100644 --- a/plugins/textool/TexTool.cpp +++ b/plugins/textool/TexTool.cpp @@ -70,21 +70,21 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ gtk_widget_show( vbox ); w = ui::Label( lpText ); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 2 ); + vbox.pack_start( w, FALSE, FALSE, 2 ); gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT ); gtk_widget_show( w ); w = gtk_hseparator_new(); - gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 2 ); + vbox.pack_start( w, FALSE, FALSE, 2 ); gtk_widget_show( w ); hbox = ui::HBox( FALSE, 10 ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 ); + vbox.pack_start( hbox, FALSE, FALSE, 2 ); gtk_widget_show( hbox ); if ( mode == MB_OK ) { w = ui::Button( "Ok" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); gtk_widget_set_can_default( w, true ); @@ -94,7 +94,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ } else if ( mode == MB_OKCANCEL ) { w = ui::Button( "Ok" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); gtk_widget_set_can_default( w, true ); @@ -102,7 +102,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ gtk_widget_show( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); gtk_widget_show( w ); @@ -110,7 +110,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ } else if ( mode == MB_YESNOCANCEL ) { w = ui::Button( "Yes" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); gtk_widget_set_can_default( w, true ); @@ -118,13 +118,13 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ gtk_widget_show( w ); w = ui::Button( "No" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); gtk_widget_show( w ); @@ -133,7 +133,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ else /* if (mode == MB_YESNO) */ { w = ui::Button( "Yes" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); gtk_widget_set_can_default( w, true ); @@ -141,7 +141,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ gtk_widget_show( w ); w = ui::Button( "No" ); - gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); + hbox.pack_start( w, TRUE, TRUE, 0 ); w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); gtk_widget_show( w ); diff --git a/radiant/build.cpp b/radiant/build.cpp index 83767446..b76b5ec4 100644 --- a/radiant/build.cpp +++ b/radiant/build.cpp @@ -838,17 +838,17 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi auto table1 = create_dialog_table( 2, 2, 4, 4, 4 ); window.add(table1); { - GtkVBox* vbox = create_dialog_vbox( 4 ); + auto vbox = create_dialog_vbox( 4 ); gtk_table_attach( table1, GTK_WIDGET( vbox ), 1, 2, 0, 1, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); { - GtkButton* button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &modal ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &modal ); + vbox.pack_start( button, FALSE, FALSE, 0 ); } { - GtkButton* button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &modal ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &modal ); + vbox.pack_start( button, FALSE, FALSE, 0 ); } } { diff --git a/radiant/commands.cpp b/radiant/commands.cpp index 6b42e65a..b8a67ddf 100644 --- a/radiant/commands.cpp +++ b/radiant/commands.cpp @@ -400,7 +400,7 @@ void DoCommandListDlg(){ { auto scr = create_scrolled_window( ui::Policy::NEVER, ui::Policy::AUTOMATIC ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( scr ), TRUE, TRUE, 0 ); + hbox.pack_start( scr, TRUE, TRUE, 0 ); { ui::ListStore store = ui::ListStore(gtk_list_store_new( 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INT )); @@ -460,21 +460,21 @@ public: } } - GtkVBox* vbox = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 ); + auto vbox = create_dialog_vbox( 4 ); + hbox.pack_start( vbox, TRUE, TRUE, 0 ); { - GtkButton* editbutton = create_dialog_button( "Edit", (GCallback) accelerator_edit_button_clicked, &dialog ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( editbutton ), FALSE, FALSE, 0 ); + auto editbutton = create_dialog_button( "Edit", (GCallback) accelerator_edit_button_clicked, &dialog ); + vbox.pack_start( editbutton, FALSE, FALSE, 0 ); - GtkButton* clearbutton = create_dialog_button( "Clear", (GCallback) accelerator_clear_button_clicked, &dialog ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( clearbutton ), FALSE, FALSE, 0 ); + auto clearbutton = create_dialog_button( "Clear", (GCallback) accelerator_clear_button_clicked, &dialog ); + vbox.pack_start( clearbutton, FALSE, FALSE, 0 ); ui::Widget spacer = ui::Image(ui::New); spacer.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( spacer ), TRUE, TRUE, 0 ); + vbox.pack_start( spacer, TRUE, TRUE, 0 ); auto button = create_modal_dialog_button( "Close", dialog.m_close_button ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + vbox.pack_start( button, FALSE, FALSE, 0 ); widget_make_default( button ); gtk_widget_grab_default( GTK_WIDGET( button ) ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); diff --git a/radiant/dialog.cpp b/radiant/dialog.cpp index 701a8f1e..a5a39ecf 100644 --- a/radiant/dialog.cpp +++ b/radiant/dialog.cpp @@ -494,18 +494,18 @@ void Dialog::addCombo( ui::Widget vbox, const char* name, int& data, StringArray void Dialog::addSlider( ui::Widget vbox, const char* name, int& data, gboolean draw_value, const char* low, const char* high, double value, double lower, double upper, double step_increment, double page_increment ){ #if 0 if ( draw_value == FALSE ) { - ui::Widget hbox2 = ui::HBox( FALSE, 0 ); + auto hbox2 = ui::HBox( FALSE, 0 ); hbox2.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox2 ), FALSE, FALSE, 0 ); + vbox.pack_start( GTK_WIDGET( hbox2 ), FALSE, FALSE, 0 ); { ui::Widget label = ui::Label( low ); label.show(); - gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 ); + hbox2.pack_start( label, FALSE, FALSE, 0 ); } { ui::Widget label = ui::Label( high ); label.show(); - gtk_box_pack_end( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 ); + hbox2.pack_end(label, FALSE, FALSE, 0); } } #endif diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index 8c67825e..23dd957d 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -389,8 +389,8 @@ DirectionAttribute( const char* key ) : m_hbox = ui::HBox( FALSE, 4 ); m_hbox.show(); - gtk_box_pack_start( GTK_BOX( m_hbox ), GTK_WIDGET( m_radio.m_hbox ), TRUE, TRUE, 0 ); - gtk_box_pack_start( GTK_BOX( m_hbox ), GTK_WIDGET( m_entry ), TRUE, TRUE, 0 ); + m_hbox.pack_start( m_radio.m_hbox, TRUE, TRUE, 0 ); + m_hbox.pack_start( m_entry, TRUE, TRUE, 0 ); } void release(){ delete this; @@ -478,19 +478,19 @@ AnglesAttribute( const char* key ) : m_hbox.show(); { auto entry = numeric_entry_new(); - gtk_box_pack_start( m_hbox, GTK_WIDGET( entry ), TRUE, TRUE, 0 ); + m_hbox.pack_start( entry, TRUE, TRUE, 0 ); m_angles.m_pitch = entry; m_nonModal.connect( m_angles.m_pitch ); } { auto entry = numeric_entry_new(); - gtk_box_pack_start( m_hbox, GTK_WIDGET( entry ), TRUE, TRUE, 0 ); + m_hbox.pack_start( entry, TRUE, TRUE, 0 ); m_angles.m_yaw = entry; m_nonModal.connect( m_angles.m_yaw ); } { auto entry = numeric_entry_new(); - gtk_box_pack_start( m_hbox, GTK_WIDGET( entry ), TRUE, TRUE, 0 ); + m_hbox.pack_start( entry, TRUE, TRUE, 0 ); m_angles.m_roll = entry; m_nonModal.connect( m_angles.m_roll ); } @@ -565,19 +565,19 @@ Vector3Attribute( const char* key ) : m_hbox.show(); { auto entry = numeric_entry_new(); - gtk_box_pack_start( m_hbox, GTK_WIDGET( entry ), TRUE, TRUE, 0 ); + m_hbox.pack_start( entry, TRUE, TRUE, 0 ); m_vector3.m_x = entry; m_nonModal.connect( m_vector3.m_x ); } { auto entry = numeric_entry_new(); - gtk_box_pack_start( m_hbox, GTK_WIDGET( entry ), TRUE, TRUE, 0 ); + m_hbox.pack_start( entry, TRUE, TRUE, 0 ); m_vector3.m_y = entry; m_nonModal.connect( m_vector3.m_y ); } { auto entry = numeric_entry_new(); - gtk_box_pack_start( m_hbox, GTK_WIDGET( entry ), TRUE, TRUE, 0 ); + m_hbox.pack_start( entry, TRUE, TRUE, 0 ); m_vector3.m_z = entry; m_nonModal.connect( m_vector3.m_z ); } @@ -1287,15 +1287,15 @@ void EntityInspector_destroyWindow( ui::Widget widget, gpointer data ){ } ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){ - ui::Widget vbox = ui::VBox( FALSE, 2 ); + auto vbox = ui::VBox( FALSE, 2 ); vbox.show(); gtk_container_set_border_width( GTK_CONTAINER( vbox ), 2 ); vbox.connect( "destroy", G_CALLBACK( EntityInspector_destroyWindow ), 0 ); { - ui::Widget split1 = ui::VPaned(ui::New); - gtk_box_pack_start( GTK_BOX( vbox ), split1, TRUE, TRUE, 0 ); + auto split1 = ui::VPaned(ui::New); + vbox.pack_start( split1, TRUE, TRUE, 0 ); split1.show(); g_entity_split1 = split1; @@ -1370,14 +1370,14 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){ split2.show(); { - ui::Widget vbox2 = ui::VBox( FALSE, 2 ); + auto vbox2 = ui::VBox( FALSE, 2 ); vbox2.show(); gtk_paned_pack1( GTK_PANED( split2 ), vbox2, FALSE, FALSE ); { // Spawnflags (4 colums wide max, or window gets too wide.) auto table = ui::Table( 4, 4, FALSE ); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( table ), FALSE, TRUE, 0 ); + vbox2.pack_start( table, FALSE, TRUE, 0 ); table.show(); g_spawnflagsTable = table; @@ -1395,7 +1395,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){ // key/value list auto scr = ui::ScrolledWindow(ui::New); scr.show(); - gtk_box_pack_start( GTK_BOX( vbox2 ), scr, TRUE, TRUE, 0 ); + vbox2.pack_start( scr, TRUE, TRUE, 0 ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC ); gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN ); @@ -1437,7 +1437,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){ // key/value entry auto table = ui::Table( 2, 2, FALSE ); table.show(); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( table ), FALSE, TRUE, 0 ); + vbox2.pack_start( table, FALSE, TRUE, 0 ); gtk_table_set_row_spacings( table, 3 ); gtk_table_set_col_spacings( table, 5 ); @@ -1485,19 +1485,19 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){ { auto hbox = ui::HBox( TRUE, 4 ); hbox.show(); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( hbox ), FALSE, TRUE, 0 ); + vbox2.pack_start( hbox, FALSE, TRUE, 0 ); { auto button = ui::Button( "Clear All" ); button.show(); button.connect( "clicked", G_CALLBACK( EntityInspector_clearAllKeyValues ), 0 ); - gtk_box_pack_start( hbox, GTK_WIDGET( button ), TRUE, TRUE, 0 ); + hbox.pack_start( button, TRUE, TRUE, 0 ); } { auto button = ui::Button( "Delete Key" ); button.show(); button.connect( "clicked", G_CALLBACK( EntityInspector_clearKeyValue ), 0 ); - gtk_box_pack_start( hbox, GTK_WIDGET( button ), TRUE, TRUE, 0 ); + hbox.pack_start( button, TRUE, TRUE, 0 ); } } } diff --git a/radiant/findtexturedialog.cpp b/radiant/findtexturedialog.cpp index c7e2aca6..3be09fdb 100644 --- a/radiant/findtexturedialog.cpp +++ b/radiant/findtexturedialog.cpp @@ -128,24 +128,24 @@ FindTextureDialog::~FindTextureDialog(){ } ui::Window FindTextureDialog::BuildDialog(){ - ui::Widget vbox{ui::null}, hbox{ui::null}, table{ui::null}, label{ui::null}; + ui::Widget table{ui::null}, label{ui::null}; ui::Widget button{ui::null}; ui::Entry entry{ui::null}; auto dlg = ui::Window(create_floating_window( "Find / Replace Texture(s)", m_parent )); - hbox = ui::HBox( FALSE, 5 ); + auto hbox = ui::HBox( FALSE, 5 ); hbox.show(); dlg.add(hbox); gtk_container_set_border_width( GTK_CONTAINER( hbox ), 5 ); - vbox = ui::VBox( FALSE, 5 ); + auto vbox = ui::VBox( FALSE, 5 ); vbox.show(); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 ); + hbox.pack_start( vbox, TRUE, TRUE, 0 ); table = ui::Table( 2, 2, FALSE ); table.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + vbox.pack_start( table, TRUE, TRUE, 0 ); gtk_table_set_row_spacings( GTK_TABLE( table ), 5 ); gtk_table_set_col_spacings( GTK_TABLE( table ), 5 ); @@ -185,23 +185,23 @@ ui::Window FindTextureDialog::BuildDialog(){ auto check = ui::CheckButton( "Within selected brushes only" ); check.show(); - gtk_box_pack_start( GTK_BOX( vbox ), check, TRUE, TRUE, 0 ); + vbox.pack_start( check, TRUE, TRUE, 0 ); AddDialogData( *GTK_TOGGLE_BUTTON(check), m_bSelectedOnly ); vbox = ui::VBox( FALSE, 5 ); vbox.show(); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), FALSE, FALSE, 0 ); + hbox.pack_start( vbox, FALSE, FALSE, 0 ); button = ui::Button( "Apply" ); button.show(); - gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); + vbox.pack_start( button, FALSE, FALSE, 0 ); button.connect( "clicked", G_CALLBACK( OnApply ), 0 ); gtk_widget_set_size_request( button, 60, -1 ); button = ui::Button( "Close" ); button.show(); - gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); + vbox.pack_start( button, FALSE, FALSE, 0 ); button.connect( "clicked", G_CALLBACK( OnClose ), 0 ); gtk_widget_set_size_request( button, 60, -1 ); diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index 6c70e557..32c025f6 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -209,17 +209,17 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal auto table1 = create_dialog_table( 1, 2, 4, 4, 4 ); window.add(table1); { - GtkVBox* vbox = create_dialog_vbox( 4 ); + auto vbox = create_dialog_vbox( 4 ); gtk_table_attach( table1, GTK_WIDGET( vbox ), 1, 2, 0, 1, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); { - GtkButton* button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &modal ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &modal ); + vbox.pack_start( button, FALSE, FALSE, 0 ); } { - GtkButton* button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &modal ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &modal ); + vbox.pack_start( button, FALSE, FALSE, 0 ); } } { @@ -382,27 +382,27 @@ void DoSides( int type, int axis ){ { auto label = ui::Label( "Sides:" ); label.show(); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 ); + hbox.pack_start( label, FALSE, FALSE, 0 ); } { auto entry = ui::Entry(ui::New); entry.show(); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( entry ), FALSE, FALSE, 0 ); + hbox.pack_start( entry, FALSE, FALSE, 0 ); sides_entry = entry; gtk_widget_grab_focus( GTK_WIDGET( entry ) ); } { - GtkVBox* vbox = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 ); + auto vbox = create_dialog_vbox( 4 ); + hbox.pack_start( vbox, TRUE, TRUE, 0 ); { auto button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &dialog ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + vbox.pack_start( button, FALSE, FALSE, 0 ); widget_make_default( button ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); } { - GtkButton* button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &dialog ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &dialog ); + vbox.pack_start( button, FALSE, FALSE, 0 ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); } } @@ -449,15 +449,15 @@ void DoAbout(){ window.add(vbox); { - GtkHBox* hbox = create_dialog_hbox( 4 ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), FALSE, TRUE, 0 ); + auto hbox = create_dialog_hbox( 4 ); + vbox.pack_start( hbox, FALSE, TRUE, 0 ); { - GtkVBox* vbox2 = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox2 ), TRUE, FALSE, 0 ); + auto vbox2 = create_dialog_vbox( 4 ); + hbox.pack_start( vbox2, TRUE, FALSE, 0 ); { auto frame = create_dialog_frame( 0, ui::Shadow::IN ); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( frame ), FALSE, FALSE, 0 ); + vbox2.pack_start( frame, FALSE, FALSE, 0 ); { auto image = new_local_image( "logo.png" ); image.show(); @@ -479,35 +479,35 @@ void DoAbout(){ auto label = ui::Label( label_text ); label.show(); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 ); + hbox.pack_start( label, FALSE, FALSE, 0 ); gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 ); gtk_label_set_justify( label, GTK_JUSTIFY_LEFT ); } { - GtkVBox* vbox2 = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox2 ), FALSE, TRUE, 0 ); + auto vbox2 = create_dialog_vbox( 4 ); + hbox.pack_start( vbox2, FALSE, TRUE, 0 ); { - GtkButton* button = create_modal_dialog_button( "OK", ok_button ); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_modal_dialog_button( "OK", ok_button ); + vbox2.pack_start( button, FALSE, FALSE, 0 ); } { - GtkButton* button = create_dialog_button( "Credits", G_CALLBACK( about_button_credits ), 0 ); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Credits", G_CALLBACK( about_button_credits ), 0 ); + vbox2.pack_start( button, FALSE, FALSE, 0 ); } { - GtkButton* button = create_dialog_button( "Changes", G_CALLBACK( about_button_changelog ), 0 ); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Changes", G_CALLBACK( about_button_changelog ), 0 ); + vbox2.pack_start( button, FALSE, FALSE, 0 ); } { - GtkButton* button = create_dialog_button( "Issues", G_CALLBACK( about_button_issues ), 0 ); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Issues", G_CALLBACK( about_button_issues ), 0 ); + vbox2.pack_start( button, FALSE, FALSE, 0 ); } } } { auto frame = create_dialog_frame( "OpenGL Properties" ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), FALSE, FALSE, 0 ); + vbox.pack_start( frame, FALSE, FALSE, 0 ); { auto table = create_dialog_table( 3, 2, 4, 4, 4 ); frame.add(table); @@ -562,7 +562,7 @@ void DoAbout(){ } { auto frame = create_dialog_frame( "OpenGL Extensions" ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 ); + vbox.pack_start( frame, TRUE, TRUE, 0 ); { auto sc_extensions = create_scrolled_window( ui::Policy::AUTOMATIC, ui::Policy::ALWAYS, 4 ); frame.add(sc_extensions); @@ -607,21 +607,21 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){ auto hbox = create_dialog_hbox( 4, 4 ); window.add(hbox); { - GtkVBox* vbox = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 ); + auto vbox = create_dialog_vbox( 4 ); + hbox.pack_start( vbox, TRUE, TRUE, 0 ); { auto label = ui::Label( "Texture will be fit across the patch based\n" "on the x and y values given. Values of 1x1\n" "will \"fit\" the texture. 2x2 will repeat\n" "it twice, etc." ); label.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), TRUE, TRUE, 0 ); + vbox.pack_start( label, TRUE, TRUE, 0 ); gtk_label_set_justify( label, GTK_JUSTIFY_LEFT ); } { auto table = create_dialog_table( 2, 2, 4, 4 ); table.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + vbox.pack_start( table, TRUE, TRUE, 0 ); { auto label = ui::Label( "Texture x:" ); label.show(); @@ -659,17 +659,17 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){ } } { - GtkVBox* vbox = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), FALSE, FALSE, 0 ); + auto vbox = create_dialog_vbox( 4 ); + hbox.pack_start( vbox, FALSE, FALSE, 0 ); { auto button = create_modal_dialog_button( "OK", ok_button ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + vbox.pack_start( button, FALSE, FALSE, 0 ); widget_make_default( button ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); } { - GtkButton* button = create_modal_dialog_button( "Cancel", cancel_button ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_modal_dialog_button( "Cancel", cancel_button ); + vbox.pack_start( button, FALSE, FALSE, 0 ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); } } @@ -755,7 +755,7 @@ static void CreateGtkTextEditor(){ auto scr = ui::ScrolledWindow(ui::New); scr.show(); - gtk_box_pack_start( GTK_BOX( vbox ), scr, TRUE, TRUE, 0 ); + vbox.pack_start( scr, TRUE, TRUE, 0 ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC ); gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN ); @@ -767,18 +767,18 @@ static void CreateGtkTextEditor(){ auto hbox = ui::HBox( FALSE, 5 ); hbox.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), FALSE, TRUE, 0 ); + vbox.pack_start( hbox, FALSE, TRUE, 0 ); auto button = ui::Button( "Close" ); button.show(); - gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); + hbox.pack_end(button, FALSE, FALSE, 0); button.connect( "clicked", G_CALLBACK( editor_close ), dlg ); gtk_widget_set_size_request( button, 60, -1 ); button = ui::Button( "Save" ); button.show(); - gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); + hbox.pack_end(button, FALSE, FALSE, 0); button.connect( "clicked", G_CALLBACK( editor_save ), dlg ); gtk_widget_set_size_request( button, 60, -1 ); @@ -865,17 +865,17 @@ EMessageBoxReturn DoLightIntensityDlg( int *intensity ){ auto hbox = create_dialog_hbox( 4, 4 ); window.add(hbox); { - GtkVBox* vbox = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 ); + auto vbox = create_dialog_vbox( 4 ); + hbox.pack_start( vbox, TRUE, TRUE, 0 ); { auto label = ui::Label( "ESC for default, ENTER to validate" ); label.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 ); + vbox.pack_start( label, FALSE, FALSE, 0 ); } { auto entry = ui::Entry(ui::New); entry.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( entry ), TRUE, TRUE, 0 ); + vbox.pack_start( entry, TRUE, TRUE, 0 ); gtk_widget_grab_focus( GTK_WIDGET( entry ) ); @@ -883,18 +883,18 @@ EMessageBoxReturn DoLightIntensityDlg( int *intensity ){ } } { - GtkVBox* vbox = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), FALSE, FALSE, 0 ); + auto vbox = create_dialog_vbox( 4 ); + hbox.pack_start( vbox, FALSE, FALSE, 0 ); { auto button = create_modal_dialog_button( "OK", ok_button ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + vbox.pack_start( button, FALSE, FALSE, 0 ); widget_make_default( button ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); } { - GtkButton* button = create_modal_dialog_button( "Cancel", cancel_button ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_modal_dialog_button( "Cancel", cancel_button ); + vbox.pack_start( button, FALSE, FALSE, 0 ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); } } @@ -932,18 +932,18 @@ EMessageBoxReturn DoShaderTagDlg( CopiedString* tag, const char* title ){ auto hbox = create_dialog_hbox( 4, 4 ); window.add(hbox); { - GtkVBox* vbox = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 ); + auto vbox = create_dialog_vbox( 4 ); + hbox.pack_start( vbox, TRUE, TRUE, 0 ); { //GtkLabel* label = GTK_LABEL(gtk_label_new("Enter one ore more tags separated by spaces")); auto label = ui::Label( "ESC to cancel, ENTER to validate" ); label.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 ); + vbox.pack_start( label, FALSE, FALSE, 0 ); } { auto entry = ui::Entry(ui::New); entry.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( entry ), TRUE, TRUE, 0 ); + vbox.pack_start( entry, TRUE, TRUE, 0 ); gtk_widget_grab_focus( GTK_WIDGET( entry ) ); @@ -951,18 +951,18 @@ EMessageBoxReturn DoShaderTagDlg( CopiedString* tag, const char* title ){ } } { - GtkVBox* vbox = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), FALSE, FALSE, 0 ); + auto vbox = create_dialog_vbox( 4 ); + hbox.pack_start( vbox, FALSE, FALSE, 0 ); { auto button = create_modal_dialog_button( "OK", ok_button ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + vbox.pack_start( button, FALSE, FALSE, 0 ); widget_make_default( button ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); } { - GtkButton* button = create_modal_dialog_button( "Cancel", cancel_button ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_modal_dialog_button( "Cancel", cancel_button ); + vbox.pack_start( button, FALSE, FALSE, 0 ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); } } @@ -991,31 +991,31 @@ EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, const auto hbox = create_dialog_hbox( 4, 4 ); window.add(hbox); { - GtkVBox* vbox = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), FALSE, FALSE, 0 ); + auto vbox = create_dialog_vbox( 4 ); + hbox.pack_start( vbox, FALSE, FALSE, 0 ); { auto label = ui::Label( "The selected shader" ); label.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 ); + vbox.pack_start( label, FALSE, FALSE, 0 ); } { auto label = ui::Label( name ); label.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 ); + vbox.pack_start( label, FALSE, FALSE, 0 ); } { auto label = ui::Label( "is located in file" ); label.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 ); + vbox.pack_start( label, FALSE, FALSE, 0 ); } { auto label = ui::Label( filename ); label.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 ); + vbox.pack_start( label, FALSE, FALSE, 0 ); } { auto button = create_modal_dialog_button( "OK", ok_button ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + vbox.pack_start( button, FALSE, FALSE, 0 ); widget_make_default( button ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); } diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 26d6b1b2..ecafc384 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -2166,7 +2166,7 @@ ui::MenuItem create_help_menu(){ return help_menu_item; } -GtkMenuBar* create_main_menu( MainFrame::EViewStyle style ){ +ui::MenuBar create_main_menu( MainFrame::EViewStyle style ){ auto menu_bar = ui::MenuBar(GTK_MENU_BAR( gtk_menu_bar_new() )); menu_bar.show(); @@ -2736,7 +2736,7 @@ void MainFrame::Create(){ GetPlugInMgr().Init( window ); - ui::Widget vbox = ui::VBox( FALSE, 0 ); + auto vbox = ui::VBox( FALSE, 0 ); window.add(vbox); vbox.show(); @@ -2746,20 +2746,20 @@ void MainFrame::Create(){ register_shortcuts(); - GtkMenuBar* main_menu = create_main_menu( CurrentStyle() ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( main_menu ), FALSE, FALSE, 0 ); + auto main_menu = create_main_menu( CurrentStyle() ); + vbox.pack_start( main_menu, FALSE, FALSE, 0 ); - GtkToolbar* main_toolbar = create_main_toolbar( CurrentStyle() ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( main_toolbar ), FALSE, FALSE, 0 ); + auto main_toolbar = create_main_toolbar( CurrentStyle() ); + vbox.pack_start( main_toolbar, FALSE, FALSE, 0 ); auto plugin_toolbar = create_plugin_toolbar(); if ( !g_Layout_enablePluginToolbar.m_value ) { plugin_toolbar.hide(); } - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( plugin_toolbar ), FALSE, FALSE, 0 ); + vbox.pack_start( plugin_toolbar, FALSE, FALSE, 0 ); ui::Widget main_statusbar = create_main_statusbar(reinterpret_cast(m_pStatusLabel)); - gtk_box_pack_end( GTK_BOX( vbox ), main_statusbar, FALSE, TRUE, 2 ); + vbox.pack_end(main_statusbar, FALSE, TRUE, 2); GroupDialog_constructWindow( window ); g_page_entity = GroupDialog_addPage( "Entities", EntityInspector_constructWindow( GroupDialog_getWindow() ), RawStringExportCaller( "Entities" ) ); @@ -2793,7 +2793,7 @@ void MainFrame::Create(){ { ui::Widget vsplit = ui::VPaned(ui::New); m_vSplit = vsplit; - gtk_box_pack_start( GTK_BOX( vbox ), vsplit, TRUE, TRUE, 0 ); + vbox.pack_start( vsplit, TRUE, TRUE, 0 ); vsplit.show(); // console @@ -2962,8 +2962,8 @@ void MainFrame::Create(){ ui::Widget xz = m_pXZWnd->GetWidget(); - GtkHPaned* split = create_split_views( camera, yz, xy, xz ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( split ), TRUE, TRUE, 0 ); + auto split = create_split_views( camera, yz, xy, xz ); + vbox.pack_start( split, TRUE, TRUE, 0 ); { GtkFrame* frame = create_framed_widget( TextureBrowser_constructWindow( window ) ); diff --git a/radiant/map.cpp b/radiant/map.cpp index fff85c1f..dbfb6c7d 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -776,12 +776,12 @@ void DoMapInfo(){ window.add(vbox); { - GtkHBox* hbox = create_dialog_hbox( 4 ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), FALSE, TRUE, 0 ); + auto hbox = create_dialog_hbox( 4 ); + vbox.pack_start( hbox, FALSE, TRUE, 0 ); { - GtkTable* table = create_dialog_table( 2, 2, 4, 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + auto table = create_dialog_table( 2, 2, 4, 4 ); + hbox.pack_start( table, TRUE, TRUE, 0 ); { auto entry = ui::Entry(ui::New); @@ -821,24 +821,24 @@ void DoMapInfo(){ } } { - GtkVBox* vbox2 = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox2 ), FALSE, FALSE, 0 ); + auto vbox2 = create_dialog_vbox( 4 ); + hbox.pack_start( vbox2, FALSE, FALSE, 0 ); { - GtkButton* button = create_dialog_button( "Close", G_CALLBACK( dialog_button_ok ), &dialog ); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Close", G_CALLBACK( dialog_button_ok ), &dialog ); + vbox2.pack_start( button, FALSE, FALSE, 0 ); } } } { ui::Widget label = ui::Label( "Entity breakdown" ); label.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, TRUE, 0 ); + vbox.pack_start( label, FALSE, TRUE, 0 ); gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 ); } { auto scr = create_scrolled_window( ui::Policy::NEVER, ui::Policy::AUTOMATIC, 4 ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( scr ), TRUE, TRUE, 0 ); + vbox.pack_start( scr, TRUE, TRUE, 0 ); { ui::ListStore store = ui::ListStore(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING )); @@ -2046,8 +2046,8 @@ void DoFind(){ auto vbox = create_dialog_vbox( 4, 4 ); window.add(vbox); { - GtkTable* table = create_dialog_table( 2, 2, 4, 4 ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + auto table = create_dialog_table( 2, 2, 4, 4 ); + vbox.pack_start( table, TRUE, TRUE, 0 ); { ui::Widget label = ui::Label( "Entity number" ); label.show(); @@ -2082,17 +2082,17 @@ void DoFind(){ } } { - GtkHBox* hbox = create_dialog_hbox( 4 ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), TRUE, TRUE, 0 ); + auto hbox = create_dialog_hbox( 4 ); + vbox.pack_start( hbox, TRUE, TRUE, 0 ); { auto button = create_dialog_button( "Find", G_CALLBACK( dialog_button_ok ), &dialog ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + hbox.pack_start( button, FALSE, FALSE, 0 ); widget_make_default( button ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); } { - GtkButton* button = create_dialog_button( "Close", G_CALLBACK( dialog_button_cancel ), &dialog ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Close", G_CALLBACK( dialog_button_cancel ), &dialog ); + hbox.pack_start( button, FALSE, FALSE, 0 ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); } } diff --git a/radiant/patchdialog.cpp b/radiant/patchdialog.cpp index da5e2283..464bc06f 100644 --- a/radiant/patchdialog.cpp +++ b/radiant/patchdialog.cpp @@ -571,16 +571,16 @@ ui::Window PatchInspector::BuildDialog(){ { auto hbox = ui::HBox( FALSE, 5 ); hbox.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), TRUE, TRUE, 0 ); + vbox.pack_start( hbox, TRUE, TRUE, 0 ); { auto vbox2 = ui::VBox( FALSE, 0 ); gtk_container_set_border_width( GTK_CONTAINER( vbox2 ), 0 ); vbox2.show(); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox2 ), TRUE, TRUE, 0 ); + hbox.pack_start( vbox2, TRUE, TRUE, 0 ); { auto frame = ui::Frame( "Details" ); frame.show(); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( frame ), TRUE, TRUE, 0 ); + vbox2.pack_start( frame, TRUE, TRUE, 0 ); { auto vbox3 = ui::VBox( FALSE, 5 ); gtk_container_set_border_width( GTK_CONTAINER( vbox3 ), 5 ); @@ -589,7 +589,7 @@ ui::Window PatchInspector::BuildDialog(){ { auto table = ui::Table( 2, 2, FALSE ); table.show(); - gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + vbox3.pack_start( table, TRUE, TRUE, 0 ); gtk_table_set_row_spacings( table, 5 ); gtk_table_set_col_spacings( table, 5 ); { @@ -634,7 +634,7 @@ ui::Window PatchInspector::BuildDialog(){ } auto table = ui::Table( 5, 2, FALSE ); table.show(); - gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + vbox3.pack_start( table, TRUE, TRUE, 0 ); gtk_table_set_row_spacings( table, 5 ); gtk_table_set_col_spacings( table, 5 ); { @@ -727,7 +727,7 @@ ui::Window PatchInspector::BuildDialog(){ if ( g_pGameDescription->mGameType == "doom3" ) { auto frame = ui::Frame( "Tesselation" ); frame.show(); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( frame ), TRUE, TRUE, 0 ); + vbox2.pack_start( frame, TRUE, TRUE, 0 ); { auto vbox3 = ui::VBox( FALSE, 5 ); gtk_container_set_border_width( GTK_CONTAINER( vbox3 ), 5 ); @@ -736,7 +736,7 @@ ui::Window PatchInspector::BuildDialog(){ { auto table = ui::Table( 3, 2, FALSE ); table.show(); - gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + vbox3.pack_start( table, TRUE, TRUE, 0 ); gtk_table_set_row_spacings( table, 5 ); gtk_table_set_col_spacings( table, 5 ); { @@ -795,7 +795,7 @@ ui::Window PatchInspector::BuildDialog(){ { auto frame = ui::Frame( "Texturing" ); frame.show(); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 ); + hbox.pack_start( frame, TRUE, TRUE, 0 ); { auto vbox2 = ui::VBox( FALSE, 5 ); vbox2.show(); @@ -804,7 +804,7 @@ ui::Window PatchInspector::BuildDialog(){ { auto label = ui::Label( "Name:" ); label.show(); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( label ), TRUE, TRUE, 0 ); + vbox2.pack_start( label, TRUE, TRUE, 0 ); gtk_label_set_justify( label, GTK_JUSTIFY_LEFT ); gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 ); } @@ -812,7 +812,7 @@ ui::Window PatchInspector::BuildDialog(){ auto entry = ui::Entry(ui::New); // gtk_editable_set_editable (GTK_ENTRY (entry), false); entry.show(); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( entry ), TRUE, TRUE, 0 ); + vbox2.pack_start( entry, TRUE, TRUE, 0 ); AddDialogData( *GTK_ENTRY(entry), m_strName ); entry.connect( "key_press_event", G_CALLBACK( OnDialogKey ), 0 ); @@ -820,7 +820,7 @@ ui::Window PatchInspector::BuildDialog(){ { auto table = ui::Table( 5, 4, FALSE ); table.show(); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + vbox2.pack_start( table, TRUE, TRUE, 0 ); gtk_table_set_row_spacings( table, 5 ); gtk_table_set_col_spacings( table, 5 ); { @@ -992,39 +992,39 @@ ui::Window PatchInspector::BuildDialog(){ } auto hbox2 = ui::HBox( TRUE, 5 ); hbox2.show(); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( hbox2 ), TRUE, FALSE, 0 ); + vbox2.pack_start( hbox2, TRUE, FALSE, 0 ); { auto button = ui::Button( "Auto Cap" ); button.show(); - gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); + hbox2.pack_end(button, TRUE, FALSE, 0); button.connect( "clicked", G_CALLBACK( OnBtnPatchAutoCap ), 0 ); gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 ); } { auto button = ui::Button( "CAP" ); button.show(); - gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); + hbox2.pack_end(button, TRUE, FALSE, 0); button.connect( "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 ); gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 ); } { auto button = ui::Button( "Set..." ); button.show(); - gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); + hbox2.pack_end(button, TRUE, FALSE, 0); button.connect( "clicked", G_CALLBACK( OnBtnPatchreset ), 0 ); gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 ); } { auto button = ui::Button( "Natural" ); button.show(); - gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); + hbox2.pack_end(button, TRUE, FALSE, 0); button.connect( "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 ); gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 ); } { auto button = ui::Button( "Fit" ); button.show(); - gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); + hbox2.pack_end(button, TRUE, FALSE, 0); button.connect( "clicked", G_CALLBACK( OnBtnPatchfit ), 0 ); gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 ); } diff --git a/radiant/patchmanip.cpp b/radiant/patchmanip.cpp index 2bb141a1..8f7c26a7 100644 --- a/radiant/patchmanip.cpp +++ b/radiant/patchmanip.cpp @@ -857,8 +857,8 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows, auto hbox = create_dialog_hbox( 4, 4 ); window.add(hbox); { - GtkTable* table = create_dialog_table( 2, 2, 4, 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + auto table = create_dialog_table( 2, 2, 4, 4 ); + hbox.pack_start( table, TRUE, TRUE, 0 ); { auto label = ui::Label( "Width:" ); label.show(); @@ -931,18 +931,18 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows, } { - GtkVBox* vbox = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 ); + auto vbox = create_dialog_vbox( 4 ); + hbox.pack_start( vbox, TRUE, TRUE, 0 ); { auto button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &dialog ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + vbox.pack_start( button, FALSE, FALSE, 0 ); widget_make_default( button ); gtk_widget_grab_focus( GTK_WIDGET( button ) ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); } { - GtkButton* button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &dialog ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &dialog ); + vbox.pack_start( button, FALSE, FALSE, 0 ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); } } @@ -992,7 +992,7 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){ { auto table = ui::Table( 5, 2, FALSE ); table.show(); - gtk_box_pack_start( GTK_BOX( radio_vbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + radio_vbox.pack_start( table, TRUE, TRUE, 0 ); gtk_table_set_row_spacings( table, 5 ); gtk_table_set_col_spacings( table, 5 ); @@ -1087,17 +1087,17 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){ } { - GtkVBox* vbox = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), FALSE, FALSE, 0 ); + auto vbox = create_dialog_vbox( 4 ); + hbox.pack_start( vbox, FALSE, FALSE, 0 ); { auto button = create_modal_dialog_button( "OK", ok_button ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + vbox.pack_start( button, FALSE, FALSE, 0 ); widget_make_default( button ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); } { - GtkButton* button = create_modal_dialog_button( "Cancel", cancel_button ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_modal_dialog_button( "Cancel", cancel_button ); + vbox.pack_start( button, FALSE, FALSE, 0 ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); } } diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index d67bd40c..9a3e826c 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -686,39 +686,39 @@ ui::Window PrefsDlg::BuildDialog(){ ui::Window dialog = ui::Window(create_floating_window( "NetRadiant Preferences", m_parent )); { - ui::Widget mainvbox = ui::VBox( FALSE, 5 ); + auto mainvbox = ui::VBox( FALSE, 5 ); dialog.add(mainvbox); gtk_container_set_border_width( GTK_CONTAINER( mainvbox ), 5 ); mainvbox.show(); { - ui::Widget hbox = ui::HBox( FALSE, 5 ); + auto hbox = ui::HBox( FALSE, 5 ); hbox.show(); - gtk_box_pack_end( GTK_BOX( mainvbox ), hbox, FALSE, TRUE, 0 ); + mainvbox.pack_end(hbox, FALSE, TRUE, 0); { - GtkButton* button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &m_modal ); - gtk_box_pack_end( GTK_BOX( hbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &m_modal ); + hbox.pack_end(button, FALSE, FALSE, 0); } { - GtkButton* button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &m_modal ); - gtk_box_pack_end( GTK_BOX( hbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &m_modal ); + hbox.pack_end(button, FALSE, FALSE, 0); } { - GtkButton* button = create_dialog_button( "Clean", G_CALLBACK( OnButtonClean ), this ); - gtk_box_pack_end( GTK_BOX( hbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Clean", G_CALLBACK( OnButtonClean ), this ); + hbox.pack_end(button, FALSE, FALSE, 0); } } { - ui::Widget hbox = ui::HBox( FALSE, 5 ); - gtk_box_pack_start( GTK_BOX( mainvbox ), hbox, TRUE, TRUE, 0 ); + auto hbox = ui::HBox( FALSE, 5 ); + mainvbox.pack_start( hbox, TRUE, TRUE, 0 ); hbox.show(); { auto sc_win = ui::ScrolledWindow(ui::New); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( sc_win ), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC ); - gtk_box_pack_start( GTK_BOX( hbox ), sc_win, FALSE, FALSE, 0 ); + hbox.pack_start( sc_win, FALSE, FALSE, 0 ); sc_win.show(); gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( sc_win ), GTK_SHADOW_IN ); @@ -726,7 +726,7 @@ ui::Window PrefsDlg::BuildDialog(){ m_notebook = ui::Widget(gtk_notebook_new()); // hide the notebook tabs since its not supposed to look like a notebook gtk_notebook_set_show_tabs( GTK_NOTEBOOK( m_notebook ), FALSE ); - gtk_box_pack_start( GTK_BOX( hbox ), m_notebook, TRUE, TRUE, 0 ); + hbox.pack_start( m_notebook, TRUE, TRUE, 0 ); m_notebook.show(); diff --git a/radiant/select.cpp b/radiant/select.cpp index 3c3b2060..33813fdb 100644 --- a/radiant/select.cpp +++ b/radiant/select.cpp @@ -919,8 +919,8 @@ void DoRotateDlg(){ auto hbox = create_dialog_hbox( 4, 4 ); g_rotate_dialog.window.add(hbox); { - GtkTable* table = create_dialog_table( 3, 2, 4, 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + auto table = create_dialog_table( 3, 2, 4, 4 ); + hbox.pack_start( table, TRUE, TRUE, 0 ); { ui::Widget label = ui::Label( " X " ); label.show(); @@ -982,22 +982,22 @@ void DoRotateDlg(){ } } { - GtkVBox* vbox = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 ); + auto vbox = create_dialog_vbox( 4 ); + hbox.pack_start( vbox, TRUE, TRUE, 0 ); { auto button = create_dialog_button( "OK", G_CALLBACK( rotatedlg_ok ), &g_rotate_dialog ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + vbox.pack_start( button, FALSE, FALSE, 0 ); widget_make_default( button ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); } { - GtkButton* button = create_dialog_button( "Cancel", G_CALLBACK( rotatedlg_cancel ), &g_rotate_dialog ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Cancel", G_CALLBACK( rotatedlg_cancel ), &g_rotate_dialog ); + vbox.pack_start( button, FALSE, FALSE, 0 ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); } { - GtkButton* button = create_dialog_button( "Apply", G_CALLBACK( rotatedlg_apply ), &g_rotate_dialog ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Apply", G_CALLBACK( rotatedlg_apply ), &g_rotate_dialog ); + vbox.pack_start( button, FALSE, FALSE, 0 ); } } } @@ -1072,8 +1072,8 @@ void DoScaleDlg(){ auto hbox = create_dialog_hbox( 4, 4 ); g_scale_dialog.window.add(hbox); { - GtkTable* table = create_dialog_table( 3, 2, 4, 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + auto table = create_dialog_table( 3, 2, 4, 4 ); + hbox.pack_start( table, TRUE, TRUE, 0 ); { ui::Widget label = ui::Label( " X " ); label.show(); @@ -1127,22 +1127,22 @@ void DoScaleDlg(){ } } { - GtkVBox* vbox = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 ); + auto vbox = create_dialog_vbox( 4 ); + hbox.pack_start( vbox, TRUE, TRUE, 0 ); { auto button = create_dialog_button( "OK", G_CALLBACK( scaledlg_ok ), &g_scale_dialog ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + vbox.pack_start( button, FALSE, FALSE, 0 ); widget_make_default( button ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); } { - GtkButton* button = create_dialog_button( "Cancel", G_CALLBACK( scaledlg_cancel ), &g_scale_dialog ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Cancel", G_CALLBACK( scaledlg_cancel ), &g_scale_dialog ); + vbox.pack_start( button, FALSE, FALSE, 0 ); gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); } { - GtkButton* button = create_dialog_button( "Apply", G_CALLBACK( scaledlg_apply ), &g_scale_dialog ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Apply", G_CALLBACK( scaledlg_apply ), &g_scale_dialog ); + vbox.pack_start( button, FALSE, FALSE, 0 ); } } } diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index b6437186..ad0f7359 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -593,25 +593,25 @@ ui::Window SurfaceInspector::BuildDialog(){ { // replaced by only the vbox: - ui::Widget vbox = ui::VBox( FALSE, 5 ); + auto vbox = ui::VBox( FALSE, 5 ); vbox.show(); window.add(vbox); gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 ); { - ui::Widget hbox2 = ui::HBox( FALSE, 5 ); + auto hbox2 = ui::HBox( FALSE, 5 ); hbox2.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox2 ), FALSE, FALSE, 0 ); + vbox.pack_start( hbox2, FALSE, FALSE, 0 ); { ui::Widget label = ui::Label( "Texture" ); label.show(); - gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 ); + hbox2.pack_start( label, FALSE, TRUE, 0 ); } { auto entry = ui::Entry(ui::New); entry.show(); - gtk_box_pack_start( GTK_BOX( hbox2 ), GTK_WIDGET( entry ), TRUE, TRUE, 0 ); + hbox2.pack_start( entry, TRUE, TRUE, 0 ); m_texture = entry; m_textureEntry.connect( entry ); GlobalTextureEntryCompletion::instance().connect( entry ); @@ -622,7 +622,7 @@ ui::Window SurfaceInspector::BuildDialog(){ { ui::Widget table = ui::Table( 6, 4, FALSE ); table.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( table ), FALSE, FALSE, 0 ); + vbox.pack_start( table, FALSE, FALSE, 0 ); gtk_table_set_row_spacings( GTK_TABLE( table ), 5 ); gtk_table_set_col_spacings( GTK_TABLE( table ), 5 ); { @@ -820,7 +820,7 @@ ui::Window SurfaceInspector::BuildDialog(){ { auto frame = ui::Frame( "Texturing" ); frame.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), FALSE, FALSE, 0 ); + vbox.pack_start( frame, FALSE, FALSE, 0 ); { ui::Widget table = ui::Table( 4, 4, FALSE ); table.show(); @@ -940,7 +940,7 @@ ui::Window SurfaceInspector::BuildDialog(){ { auto frame = ui::Frame( "Surface Flags" ); frame.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 ); + vbox.pack_start( frame, TRUE, TRUE, 0 ); { auto vbox3 = ui::VBox( FALSE, 4 ); //gtk_container_set_border_width(GTK_CONTAINER(vbox3), 4); @@ -949,7 +949,7 @@ ui::Window SurfaceInspector::BuildDialog(){ { auto table = ui::Table( 8, 4, FALSE ); table.show(); - gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + vbox3.pack_start( table, TRUE, TRUE, 0 ); gtk_table_set_row_spacings( table, 0 ); gtk_table_set_col_spacings( table, 0 ); @@ -975,7 +975,7 @@ ui::Window SurfaceInspector::BuildDialog(){ { auto frame = ui::Frame( "Content Flags" ); frame.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 ); + vbox.pack_start( frame, TRUE, TRUE, 0 ); { auto vbox3 = ui::VBox( FALSE, 4 ); //gtk_container_set_border_width(GTK_CONTAINER(vbox3), 4); @@ -985,7 +985,7 @@ ui::Window SurfaceInspector::BuildDialog(){ auto table = ui::Table( 8, 4, FALSE ); table.show(); - gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + vbox3.pack_start( table, TRUE, TRUE, 0 ); gtk_table_set_row_spacings( table, 0 ); gtk_table_set_col_spacings( table, 0 ); @@ -1014,7 +1014,7 @@ ui::Window SurfaceInspector::BuildDialog(){ { auto frame = ui::Frame( "Value" ); frame.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 ); + vbox.pack_start( frame, TRUE, TRUE, 0 ); { auto vbox3 = ui::VBox( FALSE, 4 ); gtk_container_set_border_width( GTK_CONTAINER( vbox3 ), 4 ); @@ -1024,7 +1024,7 @@ ui::Window SurfaceInspector::BuildDialog(){ { auto entry = ui::Entry(ui::New); entry.show(); - gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( entry ), TRUE, TRUE, 0 ); + vbox3.pack_start( entry, TRUE, TRUE, 0 ); m_valueEntryWidget = entry; m_valueEntry.connect( entry ); } @@ -1037,7 +1037,7 @@ ui::Window SurfaceInspector::BuildDialog(){ // Shamus: Textool goodies... ui::Widget frame = ui::Frame( "Textool" ); frame.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), FALSE, FALSE, 0 ); + vbox.pack_start( GTK_WIDGET( frame ), FALSE, FALSE, 0 ); { //Prolly should make this a member or global var, so the SI can draw on it... TexTool::g_textoolWin = glwidget_new( FALSE ); @@ -1059,14 +1059,14 @@ ui::Window SurfaceInspector::BuildDialog(){ { ui::Widget hbox = ui::HBox( FALSE, 5 ); hbox.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), FALSE, FALSE, 0 ); + vbox.pack_start( GTK_WIDGET( hbox ), FALSE, FALSE, 0 ); // Checkboxes go here... (Flip X/Y) ui::Widget flipX = ui::CheckButton( "Flip X axis" ); ui::Widget flipY = ui::CheckButton( "Flip Y axis" ); flipX.show(); flipY.show(); - gtk_box_pack_start( GTK_BOX( hbox ), flipX, FALSE, FALSE, 0 ); - gtk_box_pack_start( GTK_BOX( hbox ), flipY, FALSE, FALSE, 0 ); + hbox.pack_start( flipX, FALSE, FALSE, 0 ); + hbox.pack_start( flipY, FALSE, FALSE, 0 ); //Instead of this, we probably need to create a vbox to put into the frame, then the //window, then the hbox. !!! FIX !!! diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index b743fddd..d37d68d9 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -2003,7 +2003,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){ ui::Widget table = ui::Table( 3, 3, FALSE ); ui::Widget frame_table{ui::null}; - ui::Widget vbox = ui::VBox( FALSE, 0 ); + auto vbox = ui::VBox(FALSE, 0); gtk_table_attach( GTK_TABLE( table ), vbox, 0, 1, 1, 3, GTK_FILL, GTK_FILL, 0, 0 ); vbox.show(); @@ -2101,11 +2101,11 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){ } { // Texture/Tag notebook TextureBrowser_constructTagNotebook(); - gtk_box_pack_start( GTK_BOX( vbox ), g_TextureBrowser.m_tag_notebook, TRUE, TRUE, 0 ); + vbox.pack_start( g_TextureBrowser.m_tag_notebook, TRUE, TRUE, 0 ); } { // Tag search button TextureBrowser_constructSearchButton(); - gtk_box_pack_end( GTK_BOX( vbox ), g_TextureBrowser.m_search_button, FALSE, FALSE, 0 ); + vbox.pack_end(g_TextureBrowser.m_search_button, FALSE, FALSE, 0); } { // Tag frame frame_table = ui::Table( 3, 3, FALSE ); @@ -2212,7 +2212,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){ } } else { // no tag support, show the texture tree only - gtk_box_pack_start( GTK_BOX( vbox ), g_TextureBrowser.m_scr_win_tree, TRUE, TRUE, 0 ); + vbox.pack_start( g_TextureBrowser.m_scr_win_tree, TRUE, TRUE, 0 ); } // TODO do we need this? -- 2.39.2