From e9aa6a836fd50de132fb5e9cf0921fecbd811617 Mon Sep 17 00:00:00 2001 From: Pan7 Date: Sun, 26 Mar 2017 17:09:18 +0200 Subject: [PATCH] More Dialog improvements --- contrib/bobtoolz/dialogs/dialogs-gtk.cpp | 4 +- contrib/camera/dialogs.cpp | 2 +- contrib/gtkgensurf/gendlgs.cpp | 50 +++++++++++------------ contrib/gtkgensurf/view.cpp | 4 +- plugins/surface/surfacedialog.cpp | 34 +++++++++------ plugins/surface_idtech2/surfacedialog.cpp | 34 +++++++++------ plugins/surface_idtech2/surfaceflags.cpp | 2 +- radiant/gtkdlgs.cpp | 24 +++++------ radiant/patchdialog.cpp | 34 +++++++-------- radiant/preferences.cpp | 12 +++--- radiant/surfacedialog.cpp | 7 ++++ 11 files changed, 117 insertions(+), 90 deletions(-) diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp index 6a6e6b65..a274adf3 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp @@ -423,7 +423,7 @@ int DoPolygonBox( PolygonRS* rs ){ // ---- hbox2 ---- text1 = gtk_entry_new(); - g_object_set( text1, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( text1 ), 1.0 ); //right gtk_entry_set_max_length( GTK_ENTRY( text1 ), 256 ); gtk_entry_set_text( GTK_ENTRY( text1 ), "3" ); gtk_box_pack_start( GTK_BOX( hbox2 ), text1, FALSE, FALSE, 2 ); @@ -444,7 +444,7 @@ int DoPolygonBox( PolygonRS* rs ){ // ---- hbox2 ---- text2 = gtk_entry_new(); - g_object_set( text2, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( text2 ), 1.0 ); //right gtk_entry_set_max_length( GTK_ENTRY( text2 ), 256 ); gtk_entry_set_text( GTK_ENTRY( text2 ), "8" ); gtk_box_pack_start( GTK_BOX( hbox2 ), text2, FALSE, FALSE, 2 ); diff --git a/contrib/camera/dialogs.cpp b/contrib/camera/dialogs.cpp index 89257df2..1c8e4d2d 100644 --- a/contrib/camera/dialogs.cpp +++ b/contrib/camera/dialogs.cpp @@ -1072,7 +1072,7 @@ GtkWidget *CreateCameraInspectorDialog( void ){ g_pSecondsEntry = gtk_entry_new(); gtk_box_pack_start( GTK_BOX( hbox ), g_pSecondsEntry, FALSE, FALSE, 0 ); - g_object_set( g_pSecondsEntry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( g_pSecondsEntry ), 1.0 ); //right gtk_widget_show( g_pSecondsEntry ); // -------------------------- // diff --git a/contrib/gtkgensurf/gendlgs.cpp b/contrib/gtkgensurf/gendlgs.cpp index 65acc860..d5dc3003 100644 --- a/contrib/gtkgensurf/gendlgs.cpp +++ b/contrib/gtkgensurf/gendlgs.cpp @@ -1493,7 +1493,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table2 ), entry, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "wavelength", entry ); g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &WaveLength ); @@ -1502,7 +1502,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table2 ), entry, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "amplitude", entry ); g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Amplitude ); @@ -1511,7 +1511,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table2 ), entry, 1, 2, 2, 3, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "roughness", entry ); g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Roughness ); @@ -1522,7 +1522,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table2 ), spin, 1, 2, 3, 4, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); g_object_set_data( G_OBJECT( dlg ), "random", spin ); @@ -1593,7 +1593,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "hmin", entry ); g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Hll ); @@ -1602,7 +1602,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "hmax", entry ); g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Hur ); @@ -1611,7 +1611,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 2, 3, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "vmin", entry ); g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Vll ); @@ -1620,7 +1620,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 2, 3, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "vmax", entry ); g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Vur ); @@ -1657,7 +1657,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); g_object_set_data( G_OBJECT( dlg ), "nh", spin ); @@ -1668,7 +1668,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); g_object_set_data( G_OBJECT( dlg ), "nv", spin ); @@ -1689,7 +1689,7 @@ GtkWidget* create_main_dialog(){ spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_box_pack_start( GTK_BOX( vbox ), spin, FALSE, TRUE, 0 ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); g_object_set_data( G_OBJECT( dlg ), "sp", spin ); // ^Fishman - End of Snap to grid code. @@ -1752,7 +1752,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "z01", entry ); g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Z01 ); @@ -1761,7 +1761,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "z00", entry ); g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Z00 ); @@ -1770,7 +1770,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "z11", entry ); g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Z11 ); @@ -1779,7 +1779,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "z10", entry ); g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &Z10 ); @@ -1878,7 +1878,7 @@ GtkWidget* create_main_dialog(){ entry = gtk_entry_new(); gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "bmp_black", entry ); g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.black_value ); @@ -1891,7 +1891,7 @@ GtkWidget* create_main_dialog(){ entry = gtk_entry_new(); gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "bmp_white", entry ); g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.white_value ); @@ -1950,7 +1950,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND ), (GtkAttachOptions) ( GTK_EXPAND ), 0, 0 ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); g_object_set_data( G_OBJECT( dlg ), "fix_value", spin ); g_signal_connect( G_OBJECT( spin ), "focus-out-event", G_CALLBACK( fix_value_entryfocusout ), NULL ); @@ -1959,7 +1959,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "fix_range", entry ); g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( fix_range_entryfocusout ), NULL ); @@ -1968,7 +1968,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 2, 3, (GtkAttachOptions) ( GTK_EXPAND ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "fix_rate", entry ); g_signal_connect( G_OBJECT( entry ), "focus-out-event", G_CALLBACK( fix_rate_entryfocusout ), NULL ); @@ -2060,7 +2060,7 @@ GtkWidget* create_main_dialog(){ spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_box_pack_start( GTK_BOX( hbox2 ), spin, FALSE, TRUE, 0 ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); g_object_set_data( G_OBJECT( dlg ), "tex_slant", spin ); @@ -2086,7 +2086,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 0, 1, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "texoffsetx", entry ); @@ -2094,7 +2094,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "texoffsety", entry ); @@ -2102,7 +2102,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 2, 3, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "texscalex", entry ); @@ -2110,7 +2110,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_widget_show( entry ); g_object_set_data( G_OBJECT( dlg ), "texscaley", entry ); diff --git a/contrib/gtkgensurf/view.cpp b/contrib/gtkgensurf/view.cpp index eb99f95d..9eaaba00 100644 --- a/contrib/gtkgensurf/view.cpp +++ b/contrib/gtkgensurf/view.cpp @@ -397,7 +397,7 @@ void CreateViewWindow(){ adj = GTK_ADJUSTMENT( gtk_adjustment_new( 30, -90, 90, 1, 10, 0 ) ); g_signal_connect( adj, "value-changed", G_CALLBACK( preview_spin ), &elevation ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_box_pack_start( GTK_BOX( hbox ), spin, FALSE, TRUE, 0 ); gtk_widget_show( spin ); @@ -406,7 +406,7 @@ void CreateViewWindow(){ adj = GTK_ADJUSTMENT( gtk_adjustment_new( 30, 0, 359, 1, 10, 0 ) ); g_signal_connect( adj, "value-changed", G_CALLBACK( preview_spin ), &azimuth ); spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_box_pack_end( GTK_BOX( hbox ), spin, FALSE, TRUE, 0 ); diff --git a/plugins/surface/surfacedialog.cpp b/plugins/surface/surfacedialog.cpp index 8ee4eb9d..bd55b465 100644 --- a/plugins/surface/surfacedialog.cpp +++ b/plugins/surface/surfacedialog.cpp @@ -935,9 +935,10 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_value_spinbutton ), GTK_UPDATE_IF_VALID ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( hshift_value_spinbutton ), TRUE ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hshift_value_spinbutton ), TRUE ); gtk_widget_set_sensitive( GTK_WIDGET( hshift_value_spinbutton ), TRUE ); - g_object_set( hshift_value_spinbutton, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( hshift_value_spinbutton ), 1.0 ); //right gtk_widget_show( hshift_value_spinbutton ); vshift_value_spinbutton_adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 ) ); @@ -946,9 +947,10 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_value_spinbutton ), GTK_UPDATE_IF_VALID ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( vshift_value_spinbutton ), TRUE ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( vshift_value_spinbutton ), TRUE ); gtk_widget_set_sensitive( GTK_WIDGET( vshift_value_spinbutton ), TRUE ); - g_object_set( vshift_value_spinbutton, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( vshift_value_spinbutton ), 1.0 ); //right gtk_widget_show( vshift_value_spinbutton ); hscale_value_spinbutton_adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 ) ); @@ -957,9 +959,10 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_value_spinbutton ), GTK_UPDATE_IF_VALID ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( hscale_value_spinbutton ), TRUE ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hscale_value_spinbutton ), TRUE ); gtk_widget_set_sensitive( GTK_WIDGET( hscale_value_spinbutton ), TRUE ); - g_object_set( hscale_value_spinbutton, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( hscale_value_spinbutton ), 1.0 ); //right gtk_widget_show( hscale_value_spinbutton ); vscale_value_spinbutton_adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 ) ); @@ -968,9 +971,10 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_value_spinbutton ), GTK_UPDATE_IF_VALID ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( vscale_value_spinbutton ), TRUE ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( vscale_value_spinbutton ), TRUE ); gtk_widget_set_sensitive( GTK_WIDGET( vscale_value_spinbutton ), TRUE ); - g_object_set( vscale_value_spinbutton, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( vscale_value_spinbutton ), 1.0 ); //right gtk_widget_show( vscale_value_spinbutton ); rotate_value_spinbutton_adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0.0, -360.0, 360.0, 1.0, 10.0, 0.0 ) ); @@ -979,9 +983,10 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_value_spinbutton ), GTK_UPDATE_IF_VALID ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( rotate_value_spinbutton ), TRUE ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( rotate_value_spinbutton ), TRUE ); gtk_widget_set_sensitive( GTK_WIDGET( rotate_value_spinbutton ), TRUE ); - g_object_set( rotate_value_spinbutton, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( rotate_value_spinbutton ), 1.0 ); //right gtk_widget_show( rotate_value_spinbutton ); // Step Spins @@ -991,7 +996,8 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_step_spinbutton ), GTK_UPDATE_IF_VALID ); - g_object_set( hshift_step_spinbutton, "xalign", 1.0, NULL ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( hshift_step_spinbutton ), TRUE ); + gtk_entry_set_alignment( GTK_ENTRY( hshift_step_spinbutton ), 1.0 ); //right gtk_widget_show( hshift_step_spinbutton ); vshift_step_spinbutton_adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 ) ); @@ -1000,7 +1006,8 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_step_spinbutton ), GTK_UPDATE_IF_VALID ); - g_object_set( vshift_step_spinbutton, "xalign", 1.0, NULL ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( vshift_step_spinbutton ), TRUE ); + gtk_entry_set_alignment( GTK_ENTRY( vshift_step_spinbutton ), 1.0 ); //right gtk_widget_show( vshift_step_spinbutton ); hscale_step_spinbutton_adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 ) ); @@ -1009,7 +1016,8 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_step_spinbutton ), GTK_UPDATE_IF_VALID ); - g_object_set( hscale_step_spinbutton, "xalign", 1.0, NULL ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( hscale_step_spinbutton ), TRUE ); + gtk_entry_set_alignment( GTK_ENTRY( hscale_step_spinbutton ), 1.0 ); //right gtk_widget_show( hscale_step_spinbutton ); vscale_step_spinbutton_adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 ) ); @@ -1018,7 +1026,8 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_step_spinbutton ), GTK_UPDATE_IF_VALID ); - g_object_set( vscale_step_spinbutton, "xalign", 1.0, NULL ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( vscale_step_spinbutton ), TRUE ); + gtk_entry_set_alignment( GTK_ENTRY( vscale_step_spinbutton ), 1.0 ); //right gtk_widget_show( vscale_step_spinbutton ); rotate_step_spinbutton_adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0.0, -360.0, 360.0, 1.0, 10.0, 0.0 ) ); @@ -1027,7 +1036,8 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_step_spinbutton ), GTK_UPDATE_IF_VALID ); - g_object_set( rotate_step_spinbutton, "xalign", 1.0, NULL ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( rotate_step_spinbutton ), TRUE ); + gtk_entry_set_alignment( GTK_ENTRY( rotate_step_spinbutton ), 1.0 ); //right gtk_widget_show( rotate_step_spinbutton ); eventbox = gtk_event_box_new(); @@ -1095,7 +1105,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( fit_width_spinbutton ), TRUE ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( fit_width_spinbutton ), GTK_UPDATE_IF_VALID ); - g_object_set( fit_width_spinbutton, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( fit_width_spinbutton ), 1.0 ); //right gtk_widget_show( fit_width_spinbutton ); fit_height_spinbutton_adj = GTK_ADJUSTMENT( gtk_adjustment_new( 1, 1, 32, 1, 10, 0 ) ); @@ -1105,7 +1115,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_FILL ), 3, 0 ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( fit_height_spinbutton ), TRUE ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( fit_height_spinbutton ), GTK_UPDATE_IF_VALID ); - g_object_set( fit_height_spinbutton, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( fit_height_spinbutton ), 1.0 ); //right gtk_widget_show( fit_height_spinbutton ); eventbox = gtk_event_box_new(); diff --git a/plugins/surface_idtech2/surfacedialog.cpp b/plugins/surface_idtech2/surfacedialog.cpp index 9afacbf6..e82e95aa 100644 --- a/plugins/surface_idtech2/surfacedialog.cpp +++ b/plugins/surface_idtech2/surfacedialog.cpp @@ -642,8 +642,9 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_value_spinbutton ), GTK_UPDATE_IF_VALID ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( hshift_value_spinbutton ), TRUE ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hshift_value_spinbutton ), TRUE ); - g_object_set( hshift_value_spinbutton, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( hshift_value_spinbutton ), 1.0 ); //right gtk_widget_show( hshift_value_spinbutton ); @@ -653,8 +654,9 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_value_spinbutton ), GTK_UPDATE_IF_VALID ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( vshift_value_spinbutton ), TRUE ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( vshift_value_spinbutton ), TRUE ); - g_object_set( vshift_value_spinbutton, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( vshift_value_spinbutton ), 1.0 ); //right gtk_widget_show( vshift_value_spinbutton ); adjustment = GTK_ADJUSTMENT( gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 ) ); @@ -663,8 +665,9 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_value_spinbutton ), GTK_UPDATE_IF_VALID ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( hscale_value_spinbutton ), TRUE ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hscale_value_spinbutton ), TRUE ); - g_object_set( hscale_value_spinbutton, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( hscale_value_spinbutton ), 1.0 ); //right gtk_widget_show( hscale_value_spinbutton ); adjustment = GTK_ADJUSTMENT( gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 ) ); @@ -673,7 +676,8 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_value_spinbutton ), GTK_UPDATE_IF_VALID ); - g_object_set( vscale_value_spinbutton, "xalign", 1.0, NULL ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( vscale_value_spinbutton ), TRUE ); + gtk_entry_set_alignment( GTK_ENTRY( vscale_value_spinbutton ), 1.0 ); //right gtk_widget_show( vscale_value_spinbutton ); @@ -683,8 +687,9 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_value_spinbutton ), GTK_UPDATE_IF_VALID ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( rotate_value_spinbutton ), TRUE ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( rotate_value_spinbutton ), TRUE ); - g_object_set( rotate_value_spinbutton, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( rotate_value_spinbutton ), 1.0 ); //right gtk_widget_show( rotate_value_spinbutton ); // Step Spins @@ -694,7 +699,8 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_step_spinbutton ), GTK_UPDATE_IF_VALID ); - g_object_set( hshift_step_spinbutton, "xalign", 1.0, NULL ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( hshift_step_spinbutton ), TRUE ); + gtk_entry_set_alignment( GTK_ENTRY( hshift_step_spinbutton ), 1.0 ); //right gtk_widget_show( hshift_step_spinbutton ); @@ -704,7 +710,8 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_step_spinbutton ), GTK_UPDATE_IF_VALID ); - g_object_set( vshift_step_spinbutton, "xalign", 1.0, NULL ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( vshift_step_spinbutton ), TRUE ); + gtk_entry_set_alignment( GTK_ENTRY( vshift_step_spinbutton ), 1.0 ); //right gtk_widget_show( vshift_step_spinbutton ); @@ -714,7 +721,8 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_step_spinbutton ), GTK_UPDATE_IF_VALID ); - g_object_set( hscale_step_spinbutton, "xalign", 1.0, NULL ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( hscale_step_spinbutton ), TRUE ); + gtk_entry_set_alignment( GTK_ENTRY( hscale_step_spinbutton ), 1.0 ); //right gtk_widget_show( hscale_step_spinbutton ); @@ -724,7 +732,8 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_step_spinbutton ), GTK_UPDATE_IF_VALID ); - g_object_set( vscale_step_spinbutton, "xalign", 1.0, NULL ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( vscale_step_spinbutton ), TRUE ); + gtk_entry_set_alignment( GTK_ENTRY( vscale_step_spinbutton ), 1.0 ); //right gtk_widget_show( vscale_step_spinbutton ); @@ -734,7 +743,8 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_step_spinbutton ), GTK_UPDATE_IF_VALID ); - g_object_set( rotate_step_spinbutton, "xalign", 1.0, NULL ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( rotate_step_spinbutton ), TRUE ); + gtk_entry_set_alignment( GTK_ENTRY( rotate_step_spinbutton ), 1.0 ); //right gtk_widget_show( rotate_step_spinbutton ); @@ -780,7 +790,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( fit_height_spinbutton ), TRUE ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( fit_height_spinbutton ), GTK_UPDATE_IF_VALID ); - g_object_set( fit_height_spinbutton, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( fit_height_spinbutton ), 1.0 ); //right gtk_widget_show( fit_height_spinbutton ); adjustment = GTK_ADJUSTMENT( gtk_adjustment_new( 1, 1, 32, 1, 10, 0 ) ); @@ -790,7 +800,7 @@ GtkWidget* create_SurfaceInspector( void ){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( fit_width_spinbutton ), TRUE ); gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( fit_width_spinbutton ), GTK_UPDATE_IF_VALID ); - g_object_set( fit_width_spinbutton, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( fit_width_spinbutton ), 1.0 ); //right gtk_widget_show( fit_width_spinbutton ); fit_button = gtk_button_new_with_mnemonic( _( "Fit" ) ); diff --git a/plugins/surface_idtech2/surfaceflags.cpp b/plugins/surface_idtech2/surfaceflags.cpp index 64a1469a..07f8e2d4 100644 --- a/plugins/surface_idtech2/surfaceflags.cpp +++ b/plugins/surface_idtech2/surfaceflags.cpp @@ -372,7 +372,7 @@ GtkWidget* create_SurfaceFlagsFrame( GtkWidget* surfacedialog_widget ){ NULL ); gtk_entry_set_max_length( (GtkEntry *)value_entry, 11 ); gtk_box_pack_start( GTK_BOX( hbox3 ), value_entry, TRUE, TRUE, 0 ); - g_object_set( value_entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( value_entry ), 1.0 ); //right gtk_widget_show( value_entry ); vbox3 = gtk_vbox_new( FALSE, 0 ); diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index 0019ed07..f312eafa 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -1355,7 +1355,7 @@ void DoRotateDlg(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( x ), TRUE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( x ), TRUE ); - g_object_set( x, "xalign", 1.0, NULL ); //right align numbers + gtk_entry_set_alignment( GTK_ENTRY( x ), 1.0 ); //right align numbers gtk_widget_show( x ); g_object_set_data( G_OBJECT( dialog ), "x", x ); g_signal_connect_after( x, "activate", G_CALLBACK( rotatedialog_activate ), dialog ); @@ -1367,7 +1367,7 @@ void DoRotateDlg(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( y ), TRUE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( y ), TRUE ); - g_object_set( y, "xalign", 1.0, NULL ); //right align numbers + gtk_entry_set_alignment( GTK_ENTRY( y ), 1.0 ); //right align numbers gtk_widget_show( y ); g_signal_connect_after( y, "activate", G_CALLBACK( rotatedialog_activate ), dialog ); g_object_set_data( G_OBJECT( dialog ), "y", y ); @@ -1380,7 +1380,7 @@ void DoRotateDlg(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( z ), TRUE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( z ), TRUE ); - g_object_set( z, "xalign", 1.0, NULL ); //right align numbers + gtk_entry_set_alignment( GTK_ENTRY( z ), 1.0 ); //right align numbers gtk_widget_show( z ); g_signal_connect_after( z, "activate", G_CALLBACK( rotatedialog_activate ), dialog ); g_object_set_data( G_OBJECT( dialog ), "z", z ); @@ -1429,7 +1429,7 @@ void DoGamma(){ gtk_box_pack_start( GTK_BOX( vbox ), spin, TRUE, TRUE, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), FALSE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); // Initialize dialog @@ -1652,7 +1652,7 @@ void DoFind(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), FALSE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); //right align numbers + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right align numbers gtk_widget_show( spin ); g_object_set_data( G_OBJECT( dialog ), "entity-spin", spin ); @@ -1663,7 +1663,7 @@ void DoFind(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), FALSE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); //right align numbers + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right align numbers gtk_widget_show( spin ); g_object_set_data( G_OBJECT( dialog ), "brush-spin", spin ); @@ -1709,7 +1709,7 @@ void DoSides( bool bCone, bool bSphere, bool bTorus ){ gtk_box_pack_start( GTK_BOX( hbox ), spin, TRUE, TRUE, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); response_id = gtk_dialog_run( GTK_DIALOG( dialog ) ); @@ -1933,7 +1933,7 @@ void DoScaleDlg(){ gtk_table_attach( GTK_TABLE( table ), x, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_object_set( x, "xalign", 1.0, NULL ); //right align numbers + gtk_entry_set_alignment( GTK_ENTRY( x ), 1.0 ); //right align numbers gtk_widget_show( x ); g_object_set_data( G_OBJECT( dialog ), "x", x ); g_signal_connect_after( x, "activate", G_CALLBACK( scaledlg_activate ), dialog ); @@ -1945,7 +1945,7 @@ void DoScaleDlg(){ gtk_table_attach( GTK_TABLE( table ), y, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_object_set( y, "xalign", 1.0, NULL ); //right align numbers + gtk_entry_set_alignment( GTK_ENTRY( y ), 1.0 ); //right align numbers gtk_widget_show( y ); g_object_set_data( G_OBJECT( dialog ), "y", y ); g_signal_connect_after( y, "activate", G_CALLBACK( scaledlg_activate ), dialog ); @@ -1958,7 +1958,7 @@ void DoScaleDlg(){ gtk_table_attach( GTK_TABLE( table ), z, 1, 2, 2, 3, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_object_set( z, "xalign", 1.0, NULL ); //right align numbers + gtk_entry_set_alignment( GTK_ENTRY( z ), 1.0 ); //right align numbers gtk_widget_show( z ); g_object_set_data( G_OBJECT( dialog ), "z", z ); g_signal_connect_after( z, "activate", G_CALLBACK( scaledlg_activate ), dialog ); @@ -2015,7 +2015,7 @@ void DoThickenDlg(){ gtk_box_pack_start( GTK_BOX( hbox ), amount, FALSE, FALSE, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), FALSE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); seams = gtk_check_button_new_with_label( _( "Seams" ) ); @@ -3388,8 +3388,8 @@ int DoLightIntensityDlg( int *intensity ){ gtk_box_pack_start( GTK_BOX( hbox ), spinbutton, TRUE, TRUE, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spinbutton ), FALSE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spinbutton ), TRUE ); + gtk_entry_set_alignment( GTK_ENTRY( spinbutton ), 1.0 ); //right gtk_widget_show( spinbutton ); - g_object_set( spinbutton, "xalign", 1.0, NULL ); gtk_spin_button_set_value( GTK_SPIN_BUTTON( spinbutton ), *intensity ); diff --git a/radiant/patchdialog.cpp b/radiant/patchdialog.cpp index 42f1fa89..03946757 100644 --- a/radiant/patchdialog.cpp +++ b/radiant/patchdialog.cpp @@ -352,7 +352,7 @@ void PatchDialog::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_widget_set_usize( combo, 60, -1 ); gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( combo )->entry ), FALSE ); - g_object_set( GTK_COMBO( combo )->entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( GTK_COMBO( combo )->entry ), 1.0 ); //right gtk_widget_show( combo ); g_signal_connect( G_OBJECT( GTK_COMBO( combo )->entry ), "changed", G_CALLBACK( OnSelchangeComboColRow ), this ); @@ -365,7 +365,7 @@ void PatchDialog::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_widget_set_usize( combo, 60, -1 ); gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( combo )->entry ), FALSE ); - g_object_set( GTK_COMBO( combo )->entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( GTK_COMBO( combo )->entry ), 1.0 ); //right gtk_widget_show( combo ); g_signal_connect( G_OBJECT( GTK_COMBO( combo )->entry ), "changed", G_CALLBACK( OnSelchangeComboColRow ), this ); @@ -420,7 +420,7 @@ void PatchDialog::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); AddDialogData( spin, &m_fX, DLG_SPIN_FLOAT ); @@ -431,7 +431,7 @@ void PatchDialog::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); AddDialogData( spin, &m_fY, DLG_SPIN_FLOAT ); @@ -442,7 +442,7 @@ void PatchDialog::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); AddDialogData( spin, &m_fZ, DLG_SPIN_FLOAT ); @@ -453,7 +453,7 @@ void PatchDialog::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); AddDialogData( spin, &m_fS, DLG_SPIN_FLOAT ); @@ -464,7 +464,7 @@ void PatchDialog::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); AddDialogData( spin, &m_fT, DLG_SPIN_FLOAT ); @@ -537,7 +537,7 @@ void PatchDialog::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), FALSE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); // we fill in this data, if no patch is selected the widgets are unmodified when the inspector is raised @@ -553,7 +553,7 @@ void PatchDialog::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1, (GtkAttachOptions) ( 0 ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -INT_MAX, INT_MAX, 1, 10, 0 ) ); @@ -562,7 +562,7 @@ void PatchDialog::BuildDialog(){ (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), FALSE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); gtk_spin_button_set_value( GTK_SPIN_BUTTON( spin ), l_pPIIncrement->shift[1] ); @@ -575,7 +575,7 @@ void PatchDialog::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2, (GtkAttachOptions) ( 0 ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -INT_MAX, INT_MAX, 1, 10, 0 ) ); @@ -585,7 +585,7 @@ void PatchDialog::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), FALSE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); gtk_spin_button_set_value( GTK_SPIN_BUTTON( spin ), l_pPIIncrement->scale[0] ); @@ -598,7 +598,7 @@ void PatchDialog::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 2, 3, (GtkAttachOptions) ( 0 ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -INT_MAX, INT_MAX, 1, 10, 0 ) ); @@ -607,7 +607,7 @@ void PatchDialog::BuildDialog(){ (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), FALSE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); gtk_spin_button_set_value( GTK_SPIN_BUTTON( spin ), l_pPIIncrement->scale[1] ); @@ -620,7 +620,7 @@ void PatchDialog::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 3, 4, (GtkAttachOptions) ( 0 ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -360, 360, 1, 10, 0 ) ); @@ -630,7 +630,7 @@ void PatchDialog::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); gtk_spin_button_set_value( GTK_SPIN_BUTTON( spin ), l_pPIIncrement->rotate ); @@ -643,7 +643,7 @@ void PatchDialog::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 4, 5, (GtkAttachOptions) ( 0 ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_widget_show( spin ); hbox2 = gtk_hbox_new( TRUE, 5 ); diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 89266ee2..a88b7bd3 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -2300,7 +2300,7 @@ void PrefsDlg::BuildDialog(){ // entry entry = gtk_entry_new(); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 ); gtk_widget_show( entry ); AddDialogData( entry, &m_nWheelInc, DLG_ENTRY_INT ); @@ -2372,7 +2372,7 @@ void PrefsDlg::BuildDialog(){ // entry entry = gtk_entry_new(); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); @@ -2391,7 +2391,7 @@ void PrefsDlg::BuildDialog(){ // spinner (allows undo levels to be set to zero) spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 0, 64, 1, 10, 0 ) ), 1, 0 ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); @@ -2409,7 +2409,7 @@ void PrefsDlg::BuildDialog(){ // entry (spinner perhaps? [2-16]) entry = gtk_entry_new(); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 2, 3, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); @@ -2464,7 +2464,7 @@ void PrefsDlg::BuildDialog(){ // spinner spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 1, 60, 1, 10, 0 ) ), 1, 0 ); gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); - g_object_set( spin, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( spin ), 1.0 ); //right gtk_box_pack_start( GTK_BOX( hbox2 ), spin, FALSE, FALSE, 0 ); gtk_widget_show( spin ); AddDialogData( spin, &m_nAutoSave, DLG_SPIN_INT ); @@ -2589,7 +2589,7 @@ void PrefsDlg::BuildDialog(){ // scale entry entry = gtk_entry_new(); - g_object_set( entry, "xalign", 1.0, NULL ); + gtk_entry_set_alignment( GTK_ENTRY( entry ), 1.0 ); //right gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index 1f50c347..b71dcb90 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -557,6 +557,7 @@ void SurfaceDlg::BuildDialog() { gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_widget_show( spin ); label = gtk_label_new( _( "Step" ) ); @@ -589,6 +590,7 @@ void SurfaceDlg::BuildDialog() { gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_widget_show( spin ); label = gtk_label_new( _( "Step" ) ); @@ -621,6 +623,7 @@ void SurfaceDlg::BuildDialog() { gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 2, 3, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_widget_show( spin ); label = gtk_label_new( _( "Step" ) ); @@ -653,6 +656,7 @@ void SurfaceDlg::BuildDialog() { gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 3, 4, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_widget_show( spin ); label = gtk_label_new( _( "Step" ) ); @@ -686,6 +690,7 @@ void SurfaceDlg::BuildDialog() { gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 4, 5, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_widget_show( spin ); label = gtk_label_new( _( "Step" ) ); @@ -812,6 +817,7 @@ void SurfaceDlg::BuildDialog() { gtk_table_attach( GTK_TABLE( table ), spin, 2, 3, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_widget_show( spin ); AddDialogData( spin, &m_nWidth, DLG_SPIN_INT ); @@ -819,6 +825,7 @@ void SurfaceDlg::BuildDialog() { gtk_table_attach( GTK_TABLE( table ), spin, 3, 4, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); + gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE ); gtk_widget_show( spin ); AddDialogData( spin, &m_nHeight, DLG_SPIN_INT );