]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Wrap GtkSpinButton
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 05:00:42 +0000 (16:00 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 05:00:42 +0000 (16:00 +1100)
contrib/gtkgensurf/gendlgs.cpp
contrib/gtkgensurf/view.cpp
contrib/sunplug/sunplug.cpp
libs/uilib/uilib.cpp
libs/uilib/uilib.h
radiant/dialog.cpp
radiant/patchdialog.cpp
radiant/select.cpp
radiant/surfacedialog.cpp

index 08791cc8535c707b34ece783fee0f27cbb45f07d..4ae4d58ccf92feebaf269c8b71e4c395e576fe1c 100644 (file)
@@ -1516,7 +1516,7 @@ GtkWidget* create_main_dialog(){
 
        adj = ui::Adjustment( 1, 1, 32767, 1, 10, 0 );
        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( general_random ), NULL );
-       spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
+       spin = ui::SpinButton( adj, 1, 0 );
        gtk_widget_show( spin );
        gtk_table_attach( GTK_TABLE( table2 ), spin, 1, 2, 3, 4,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -1650,7 +1650,7 @@ GtkWidget* create_main_dialog(){
 
        adj = ui::Adjustment( 8, 1, MAX_ROWS, 1, 10, 0 );
        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_nhnv_spin ), &NH );
-       spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
+       spin = ui::SpinButton( adj, 1, 0 );
        gtk_widget_show( spin );
        gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -1660,7 +1660,7 @@ GtkWidget* create_main_dialog(){
 
        adj = ui::Adjustment( 8, 1, MAX_ROWS, 1, 10, 0 );
        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_nhnv_spin ), &NV );
-       spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
+       spin = ui::SpinButton( adj, 1, 0 );
        gtk_widget_show( spin );
        gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -1682,7 +1682,7 @@ GtkWidget* create_main_dialog(){
 
        adj = ui::Adjustment( 8, 0, 256, 1, 10, 0 );
        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_snaptogrid_spin ), &SP );
-       spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
+       spin = ui::SpinButton( adj, 1, 0 );
        gtk_widget_show( spin );
        gtk_box_pack_start( GTK_BOX( vbox ), spin, FALSE, TRUE, 0 );
        gtk_widget_set_usize( spin, 60, -2 );
@@ -1942,7 +1942,7 @@ GtkWidget* create_main_dialog(){
 
        adj = ui::Adjustment( 0, -65536, 65536, 1, 16, 0 );
        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( fix_value_changed ), NULL );
-       spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
+       spin = ui::SpinButton( adj, 1, 0 );
        gtk_widget_show( spin );
        gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND ),
@@ -2058,7 +2058,7 @@ GtkWidget* create_main_dialog(){
        gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 );
 
        adj = ui::Adjustment( 60, 0, 90, 1, 10, 0 );
-       spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
+       spin = ui::SpinButton( adj, 1, 0 );
        gtk_widget_show( spin );
        gtk_box_pack_start( GTK_BOX( hbox2 ), spin, FALSE, TRUE, 0 );
        g_object_set_data( G_OBJECT( dlg ), "tex_slant", spin );
index fc88bedc0e7643f59880e0515af71110ffcd30b9..fd245a2f8d51e3b8cab83edcd2fe95a0989c6857 100644 (file)
@@ -395,14 +395,14 @@ void CreateViewWindow(){
 
        adj = ui::Adjustment( 30, -90, 90, 1, 10, 0 );
        gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( preview_spin ), &elevation );
-       spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
+       spin = ui::SpinButton( adj, 1, 0 );
        gtk_widget_show( spin );
        gtk_box_pack_start( GTK_BOX( hbox ), spin, FALSE, TRUE, 0 );
        g_signal_connect( G_OBJECT( spin ), "focus_out_event", G_CALLBACK( doublevariable_spinfocusout ), &elevation );
 
        adj = ui::Adjustment( 30, 0, 359, 1, 10, 0 );
        gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( preview_spin ), &azimuth );
-       spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
+       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 );
index 895ec17c27ff55a67d5e036ad8a7621e738a022d..7455d492906978d25a280d4d819738074b27fbfb 100644 (file)
@@ -316,7 +316,6 @@ void GetOptimalCoordinates( AABB *levelBoundingBox ){
 // MapCoordinator dialog window
 void MapCoordinator(){
        GtkWidget *window, *vbox, *table, *label, *spinnerMinX, *spinnerMinY, *spinnerMaxX, *spinnerMaxY, *button;
-       GtkAdjustment *spinner_adj_MinX, *spinner_adj_MinY, *spinner_adj_MaxX, *spinner_adj_MaxY;
        Entity *theWorldspawn = NULL;
        const char *buffer;
        char line[20];
@@ -367,10 +366,10 @@ void MapCoordinator(){
                globalOutputStream() << "SunPlug: adviced mapcoordsmins=" << minX << " " << maxY << "\n"; // console info about mapcoordsmins
                globalOutputStream() << "SunPlug: adviced mapcoordsmaxs=" << maxX << " " << minY << "\n"; // console info about mapcoordsmaxs
 
-               spinner_adj_MinX = ui::Adjustment( map_minX, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of minimum x value
-               spinner_adj_MinY = ui::Adjustment( map_minY, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of minimum y value
-               spinner_adj_MaxX = ui::Adjustment( map_maxX, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of maximum x value
-               spinner_adj_MaxY = ui::Adjustment( map_maxY, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of maximum y value
+               auto spinner_adj_MinX = ui::Adjustment( map_minX, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of minimum x value
+               auto spinner_adj_MinY = ui::Adjustment( map_minY, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of minimum y value
+               auto spinner_adj_MaxX = ui::Adjustment( map_maxX, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of maximum x value
+               auto spinner_adj_MaxY = ui::Adjustment( map_maxY, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of maximum y value
 
                button = ui::Button( "Get optimal mapcoords" ); // create button with text
                g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( input_optimal ), NULL ); // connect button with callback function
@@ -395,20 +394,20 @@ void MapCoordinator(){
                gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT ); // align text to the left side
                gtk_table_attach_defaults( GTK_TABLE( table ), label, 0, 1, 1, 2 ); // insert label into table
 
-               spinnerMinX = gtk_spin_button_new( spinner_adj_MinX, 1.0, 0 ); // create textbox wiht value spin, value and value range
+               spinnerMinX = ui::SpinButton( spinner_adj_MinX, 1.0, 0 ); // create textbox wiht value spin, value and value range
                gtk_table_attach_defaults( GTK_TABLE( table ), spinnerMinX, 1, 2, 1, 2 ); // insert spinbox into table
 
-               spinnerMinY = gtk_spin_button_new( spinner_adj_MinY, 1.0, 0 ); // create textbox wiht value spin, value and value range
+               spinnerMinY = ui::SpinButton( spinner_adj_MinY, 1.0, 0 ); // create textbox wiht value spin, value and value range
                gtk_table_attach_defaults( GTK_TABLE( table ), spinnerMinY, 2, 3, 1, 2 ); // insert spinbox into table
 
                label = ui::Label( "mapcoordsmaxs" ); // 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, 0, 1, 2, 3 ); // insert label into table
 
-               spinnerMaxX = gtk_spin_button_new( spinner_adj_MaxX, 1.0, 0 ); // create textbox wiht value spin, value and value range
+               spinnerMaxX = ui::SpinButton( spinner_adj_MaxX, 1.0, 0 ); // create textbox wiht value spin, value and value range
                gtk_table_attach_defaults( GTK_TABLE( table ), spinnerMaxX, 1, 2, 2, 3 ); // insert spinbox into table
 
-               spinnerMaxY = gtk_spin_button_new( spinner_adj_MaxY, 1.0, 0 ); // create textbox wiht value spin, value and value range
+               spinnerMaxY = ui::SpinButton( spinner_adj_MaxY, 1.0, 0 ); // create textbox wiht value spin, value and value range
                gtk_table_attach_defaults( GTK_TABLE( table ), spinnerMaxY, 2, 3, 2, 3 ); // insert spinbox into table
 
                // put the references to the spinboxes and the worldspawn into the global exchange
index 838832f8cd68c39ad15218f2772bcce2c63656dc..21a603d52aa0e009ba630b1aa3ea5be12a0d2e71 100644 (file)
@@ -128,6 +128,9 @@ namespace ui {
     ScrolledWindow::ScrolledWindow() : ScrolledWindow(GTK_SCROLLED_WINDOW(gtk_scrolled_window_new(nullptr, nullptr)))
     { }
 
+    SpinButton::SpinButton(Adjustment adjustment, double climb_rate, std::size_t digits) : SpinButton(GTK_SPIN_BUTTON(gtk_spin_button_new(adjustment, climb_rate, digits)))
+    { }
+
     Table::Table(std::size_t rows, std::size_t columns, bool homogenous) : Table(GTK_TABLE(gtk_table_new(rows, columns, homogenous)))
     { }
 
index fb4bbfe6d0ca79d2a547488604bb8e031b2c2b9f..d42428a00c1bf4da0886357a9a6be6577ed13759 100644 (file)
@@ -19,6 +19,7 @@ using ui_menuitem = struct _GtkMenuItem;
 using ui_modal = struct ModalDialog;
 using ui_object = struct _GtkObject;
 using ui_scrolledwindow = struct _GtkScrolledWindow;
+using ui_spinbutton = struct _GtkSpinButton;
 using ui_table = struct _GtkTable;
 using ui_treemodel = struct _GtkTreeModel;
 using ui_treeview = struct _GtkTreeView;
@@ -170,12 +171,14 @@ namespace ui {
          ScrolledWindow();
     );
 
+    WRAP(SpinButton, Widget, ui_spinbutton,
+         SpinButton(Adjustment adjustment, double climb_rate, std::size_t digits);
+    );
+
     WRAP(Table, Widget, ui_table,
          Table(std::size_t rows, std::size_t columns, bool homogenous);
     );
 
-    WRAP(SpinButton, Widget, ui_widget,);
-
     WRAP(TreeModel, Widget, ui_treemodel,);
 
     WRAP(TreeView, Widget, ui_treeview,
index 5540be31d9c222730acd2172959b449791e00d31..337f414f4e01a0ae567e2face27d268f8c3232ac 100644 (file)
@@ -92,7 +92,7 @@ GtkSpinButton* DialogSpinner_new( double value, double lower, double upper, int
        {
                ++digits;
        }
-       GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( ui::Adjustment( value, lower, upper, step, 10, 0 ), step, digits ) );
+       GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( value, lower, upper, step, 10, 0 ), step, digits );
        gtk_widget_show( GTK_WIDGET( spin ) );
        gtk_widget_set_size_request( GTK_WIDGET( spin ), 64, -1 );
        return spin;
@@ -635,7 +635,7 @@ ui::SpinButton Dialog::addSpinner( ui::Widget vbox, const char* name, double val
        DialogSpinnerRow row( DialogSpinnerRow_new( name, value, lower, upper, 1 ) );
        AddIntSpinnerData( *row.m_spin, importViewer, exportViewer );
        DialogVBox_packRow( GTK_VBOX( vbox ), row.m_row );
-       return ui::SpinButton(row.m_row);
+       return ui::SpinButton(row.m_spin);
 }
 
 ui::SpinButton Dialog::addSpinner( ui::Widget vbox, const char* name, int& data, double value, double lower, double upper ){
@@ -646,5 +646,5 @@ ui::SpinButton Dialog::addSpinner( ui::Widget vbox, const char* name, double val
        DialogSpinnerRow row( DialogSpinnerRow_new( name, value, lower, upper, 10 ) );
        AddFloatSpinnerData( *row.m_spin, importViewer, exportViewer );
        DialogVBox_packRow( GTK_VBOX( vbox ), row.m_row );
-       return ui::SpinButton(row.m_row);
+       return ui::SpinButton(row.m_spin);
 }
index 0f074114cf4d7239e9076cd0cf5b06285f290c9b..eff14bd647407745b0ce96cc79a4809febc28268 100644 (file)
@@ -902,11 +902,11 @@ ui::Window PatchInspector::BuildDialog(){
                                                        // so we need to have at least one initialisation somewhere
                                                        entry_set_float( entry, g_pi_globals.shift[0] );
 
-                                                       GtkAdjustment* adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 );
+                                                       auto adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 );
                                                        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
                                                        g_object_set_data( G_OBJECT( window ), "hshift_adj", adj );
 
-                                                       GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) );
+                                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
                                                        gtk_widget_show( GTK_WIDGET( spin ) );
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 0, 1,
                                                                                          (GtkAttachOptions)( 0 ),
@@ -923,11 +923,11 @@ ui::Window PatchInspector::BuildDialog(){
                                                        gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
                                                        entry_set_float( entry, g_pi_globals.shift[1] );
 
-                                                       GtkAdjustment* adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 );
+                                                       auto adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 );
                                                        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
                                                        g_object_set_data( G_OBJECT( window ), "vshift_adj", adj );
 
-                                                       GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) );
+                                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
                                                        gtk_widget_show( GTK_WIDGET( spin ) );
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 1, 2,
                                                                                          (GtkAttachOptions)( 0 ),
@@ -944,11 +944,11 @@ ui::Window PatchInspector::BuildDialog(){
                                                        gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
                                                        entry_set_float( entry, g_pi_globals.scale[0] );
 
-                                                       GtkAdjustment* adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
+                                                       auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
                                                        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
                                                        g_object_set_data( G_OBJECT( window ), "hscale_adj", adj );
 
-                                                       GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) );
+                                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
                                                        gtk_widget_show( GTK_WIDGET( spin ) );
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 2, 3,
                                                                                          (GtkAttachOptions)( 0 ),
@@ -965,11 +965,11 @@ ui::Window PatchInspector::BuildDialog(){
                                                        gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
                                                        entry_set_float( entry, g_pi_globals.scale[1] );
 
-                                                       GtkAdjustment* adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
+                                                       auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
                                                        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
                                                        g_object_set_data( G_OBJECT( window ), "vscale_adj", adj );
 
-                                                       GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) );
+                                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
                                                        gtk_widget_show( GTK_WIDGET( spin ) );
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 3, 4,
                                                                                          (GtkAttachOptions)( 0 ),
@@ -986,11 +986,11 @@ ui::Window PatchInspector::BuildDialog(){
                                                        gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
                                                        entry_set_float( entry, g_pi_globals.rotate );
 
-                                                       GtkAdjustment* adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 ); // NOTE: Arnout - this really should be 360 but can't change it anymore as it could break existing maps
+                                                       auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 ); // NOTE: Arnout - this really should be 360 but can't change it anymore as it could break existing maps
                                                        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
                                                        g_object_set_data( G_OBJECT( window ), "rotate_adj", adj );
 
-                                                       GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) );
+                                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
                                                        gtk_widget_show( GTK_WIDGET( spin ) );
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 4, 5,
                                                                                          (GtkAttachOptions)( 0 ),
index 37f88bfaf84e8076115e94e9b495728009b5fc68..e8f1db1dcffc0a00ee09a5ce1c1d45dc4decedb6 100644 (file)
@@ -945,8 +945,8 @@ void DoRotateDlg(){
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                }
                                {
-                                       GtkAdjustment* adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
-                                       GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) );
+                                       auto adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
+                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
                                        gtk_widget_show( GTK_WIDGET( spin ) );
                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -959,8 +959,8 @@ void DoRotateDlg(){
                                        g_rotate_dialog.x = spin;
                                }
                                {
-                                       GtkAdjustment* adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
-                                       GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) );
+                                       auto adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
+                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
                                        gtk_widget_show( GTK_WIDGET( spin ) );
                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -971,8 +971,8 @@ void DoRotateDlg(){
                                        g_rotate_dialog.y = spin;
                                }
                                {
-                                       GtkAdjustment* adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
-                                       GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) );
+                                       auto adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
+                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
                                        gtk_widget_show( GTK_WIDGET( spin ) );
                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 2, 3,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
index 07dd1e6136a348b51d4e24013c7ed829164c7057..f1597159bd779b686e500c849b5eb19e6d6aa281 100644 (file)
@@ -640,7 +640,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 ) );
+                               GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 );
                                m_hshiftIncrement.m_spin = spin;
                                m_hshiftSpinner.connect( spin );
                                gtk_widget_show( GTK_WIDGET( spin ) );
@@ -676,7 +676,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 ) );
+                               GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 );
                                m_vshiftIncrement.m_spin = spin;
                                m_vshiftSpinner.connect( spin );
                                gtk_widget_show( GTK_WIDGET( spin ) );
@@ -712,7 +712,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 5 ) );
+                               GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 5 );
                                m_hscaleIncrement.m_spin = spin;
                                m_hscaleSpinner.connect( spin );
                                gtk_widget_show( GTK_WIDGET( spin ) );
@@ -748,7 +748,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 5 ) );
+                               GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 5 );
                                m_vscaleIncrement.m_spin = spin;
                                m_vscaleSpinner.connect( spin );
                                gtk_widget_show( GTK_WIDGET( spin ) );
@@ -784,7 +784,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 ) );
+                               GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 );
                                m_rotateIncrement.m_spin = spin;
                                m_rotateSpinner.connect( spin );
                                gtk_widget_show( GTK_WIDGET( spin ) );
@@ -923,7 +923,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                        gtk_widget_set_usize( button, 60, -2 );
                                }
                                {
-                                       ui::Widget spin = ui::Widget(gtk_spin_button_new( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 ));
+                                       ui::Widget spin = ui::SpinButton( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 );
                                        gtk_widget_show( spin );
                                        gtk_table_attach( GTK_TABLE( table ), spin, 2, 3, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -932,7 +932,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                        AddDialogData( *GTK_SPIN_BUTTON( spin ), m_fitHorizontal );
                                }
                                {
-                                       ui::Widget spin = ui::Widget(gtk_spin_button_new( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 ));
+                                       ui::Widget spin = ui::SpinButton( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 );
                                        gtk_widget_show( spin );
                                        gtk_table_attach( GTK_TABLE( table ), spin, 3, 4, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),