Dialog updates, replacing deprecated tables

This commit is contained in:
Pan7 2015-10-06 09:56:01 +02:00
parent e1bfb50c24
commit da3a9e6097
4 changed files with 189 additions and 253 deletions

View file

@ -629,15 +629,15 @@ GtkWidget* create_SurfaceInspector( void ){
GtkWidget *viewport;
GtkWidget *table1;
GtkWidget *table1, *table3;
GtkWidget *table4;
GtkWidget *table5;
GtkWidget *content_area;
GtkWidget *hbox1, *hbox2;
GtkWidget *hbox1, *hbox2, *hbox3;
GtkSizeGroup *button_group;
GtkSizeGroup *size_group;
SurfaceInspector = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_container_set_border_width( GTK_CONTAINER( SurfaceInspector ), 4 );
@ -689,6 +689,7 @@ GtkWidget* create_SurfaceInspector( void ){
gtk_grid_set_column_spacing( GTK_GRID( table1 ), 5 );
gtk_container_add( GTK_CONTAINER( viewport ), table1 );
gtk_container_set_border_width( GTK_CONTAINER( table1 ), 5 );
gtk_widget_set_hexpand( GTK_WIDGET( table1 ), TRUE );
gtk_widget_show( table1 );
label = gtk_label_new( _( "Value" ) );
@ -734,50 +735,50 @@ GtkWidget* create_SurfaceInspector( void ){
// Value Spins
hshift_value_spinbutton_adj = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 );
hshift_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( hshift_value_spinbutton_adj ), 1, 2 );
gtk_widget_set_hexpand( hshift_value_spinbutton, TRUE );
gtk_grid_attach( GTK_GRID( table1 ), hshift_value_spinbutton, 1, 1, 1, 1 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hshift_value_spinbutton ), TRUE );
gtk_widget_set_hexpand( hshift_value_spinbutton, TRUE );
gtk_widget_set_sensitive( GTK_WIDGET( hshift_value_spinbutton ), TRUE );
gtk_widget_show( hshift_value_spinbutton );
g_object_set( hshift_value_spinbutton, "xalign", 1.0, NULL );
vshift_value_spinbutton_adj = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 );
vshift_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( vshift_value_spinbutton_adj ), 1, 2 );
gtk_widget_set_hexpand( vshift_value_spinbutton, TRUE );
gtk_grid_attach( GTK_GRID( table1 ), vshift_value_spinbutton, 1, 2, 1, 1 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( vshift_value_spinbutton ), TRUE );
gtk_widget_set_hexpand( vshift_value_spinbutton, TRUE );
gtk_widget_set_sensitive( GTK_WIDGET( vshift_value_spinbutton ), TRUE );
gtk_widget_show( vshift_value_spinbutton );
g_object_set( vshift_value_spinbutton, "xalign", 1.0, NULL );
hscale_value_spinbutton_adj = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 );
hscale_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( hscale_value_spinbutton_adj ), 1, 4 );
gtk_widget_set_hexpand( hscale_value_spinbutton, TRUE );
gtk_grid_attach( GTK_GRID( table1 ), hscale_value_spinbutton, 1, 3, 1, 1 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hscale_value_spinbutton ), TRUE );
gtk_widget_set_hexpand( hscale_value_spinbutton, TRUE );
gtk_widget_set_sensitive( GTK_WIDGET( hscale_value_spinbutton ), TRUE );
gtk_widget_show( hscale_value_spinbutton );
g_object_set( hscale_value_spinbutton, "xalign", 1.0, NULL );
vscale_value_spinbutton_adj = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 );
vscale_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( vscale_value_spinbutton_adj ), 1, 4 );
gtk_widget_set_hexpand( vscale_value_spinbutton, TRUE );
gtk_grid_attach( GTK_GRID( table1 ), vscale_value_spinbutton, 1, 4, 1, 1 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( vscale_value_spinbutton ), TRUE );
gtk_widget_set_hexpand( vscale_value_spinbutton, TRUE );
gtk_widget_set_sensitive( GTK_WIDGET( vscale_value_spinbutton ), TRUE );
gtk_widget_show( vscale_value_spinbutton );
g_object_set( vscale_value_spinbutton, "xalign", 1.0, NULL );
rotate_value_spinbutton_adj = gtk_adjustment_new( 0.0, -360.0, 360.0, 1.0, 10.0, 0.0 );
rotate_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( rotate_value_spinbutton_adj ), 1, 4 );
gtk_widget_set_hexpand( rotate_value_spinbutton, TRUE );
gtk_grid_attach( GTK_GRID( table1 ), rotate_value_spinbutton, 1, 5, 1, 1 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( rotate_value_spinbutton ), TRUE );
gtk_widget_set_hexpand( rotate_value_spinbutton, TRUE );
gtk_widget_set_sensitive( GTK_WIDGET( rotate_value_spinbutton ), TRUE );
gtk_widget_show( rotate_value_spinbutton );
g_object_set( rotate_value_spinbutton, "xalign", 1.0, NULL );
@ -785,41 +786,41 @@ GtkWidget* create_SurfaceInspector( void ){
// Step Spins
hshift_step_spinbutton_adj = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 );
hshift_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( hshift_step_spinbutton_adj ), 1, 2 );
gtk_widget_set_hexpand( hshift_step_spinbutton, TRUE );
gtk_grid_attach( GTK_GRID( table1 ), hshift_step_spinbutton, 2, 1, 1, 1 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_widget_set_hexpand( hshift_step_spinbutton, TRUE );
gtk_widget_show( hshift_step_spinbutton );
g_object_set( hshift_step_spinbutton, "xalign", 1.0, NULL );
vshift_step_spinbutton_adj = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 );
vshift_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( vshift_step_spinbutton_adj ), 1, 2 );
gtk_widget_set_hexpand( vshift_step_spinbutton, TRUE );
gtk_grid_attach( GTK_GRID( table1 ), vshift_step_spinbutton, 2, 2, 1, 1 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_widget_set_hexpand( vshift_step_spinbutton, TRUE );
gtk_widget_show( vshift_step_spinbutton );
g_object_set( vshift_step_spinbutton, "xalign", 1.0, NULL );
hscale_step_spinbutton_adj = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 );
hscale_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( hscale_step_spinbutton_adj ), 1, 4 );
gtk_widget_set_hexpand( hscale_step_spinbutton, TRUE );
gtk_grid_attach( GTK_GRID( table1 ), hscale_step_spinbutton, 2, 3, 1, 1 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_widget_set_hexpand( hscale_step_spinbutton, TRUE );
gtk_widget_show( hscale_step_spinbutton );
g_object_set( hscale_step_spinbutton, "xalign", 1.0, NULL );
vscale_step_spinbutton_adj = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 );
vscale_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( vscale_step_spinbutton_adj ), 1, 4 );
gtk_widget_set_hexpand( vscale_step_spinbutton, TRUE );
gtk_grid_attach( GTK_GRID( table1 ), vscale_step_spinbutton, 2, 4, 1, 1 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_widget_set_hexpand( vscale_step_spinbutton, TRUE );
gtk_widget_show( vscale_step_spinbutton );
g_object_set( vscale_step_spinbutton, "xalign", 1.0, NULL );
rotate_step_spinbutton_adj = gtk_adjustment_new( 0.0, -360.0, 360.0, 1.0, 10.0, 0.0 );
rotate_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( rotate_step_spinbutton_adj ), 1, 4 );
gtk_widget_set_hexpand( rotate_step_spinbutton, TRUE );
gtk_grid_attach( GTK_GRID( table1 ), rotate_step_spinbutton, 2, 5, 1, 1 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_widget_set_hexpand( rotate_step_spinbutton, TRUE );
gtk_widget_show( rotate_step_spinbutton );
g_object_set( rotate_step_spinbutton, "xalign", 1.0, NULL );
@ -835,7 +836,7 @@ GtkWidget* create_SurfaceInspector( void ){
hbox2 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 0 );
gtk_container_add( GTK_CONTAINER( viewport ), hbox2 );
gtk_container_set_border_width( GTK_CONTAINER( hbox2 ), 4 );
gtk_widget_set_hexpand( hbox2, FALSE );
gtk_widget_set_hexpand( hbox2, TRUE );
gtk_widget_set_vexpand( hbox2, FALSE );
gtk_widget_show( hbox2 );
@ -843,14 +844,16 @@ GtkWidget* create_SurfaceInspector( void ){
gtk_frame_set_shadow_type( GTK_FRAME( viewport ), GTK_SHADOW_NONE );
gtk_container_add( GTK_CONTAINER( hbox2 ), viewport );
gtk_container_set_border_width( GTK_CONTAINER( viewport ), 6 );
gtk_widget_set_hexpand( viewport, FALSE );
gtk_widget_set_hexpand( viewport, TRUE );
gtk_widget_set_vexpand( viewport, FALSE );
gtk_widget_show( viewport );
table4 = gtk_grid_new(); //only need this for layout
gtk_grid_set_row_homogeneous( GTK_GRID( table4 ), TRUE );
gtk_grid_set_column_spacing( GTK_GRID( table4 ), 2 );
gtk_container_add( GTK_CONTAINER( viewport ), table4 );
gtk_container_set_border_width( GTK_CONTAINER( table4 ), 5 );
gtk_grid_set_column_spacing( GTK_GRID( table4 ), 2 );
gtk_widget_set_hexpand( table4, TRUE );
gtk_widget_show( table4 );
label = gtk_label_new( "" ); //only need this for layout
@ -860,58 +863,89 @@ GtkWidget* create_SurfaceInspector( void ){
axial_button = gtk_button_new_with_mnemonic( _( "Axial" ) );
gtk_grid_attach( GTK_GRID( table4 ), axial_button, 0, 1, 1, 1 );
gtk_widget_set_hexpand( axial_button, TRUE );
gtk_widget_show( axial_button );
viewport = gtk_frame_new( NULL );
gtk_frame_set_shadow_type( GTK_FRAME( viewport ), GTK_SHADOW_ETCHED_OUT );
gtk_box_pack_start( GTK_BOX( hbox2 ), viewport, FALSE, FALSE, 0 );
gtk_box_pack_start( GTK_BOX( hbox2 ), viewport, FALSE, TRUE, 0 );
gtk_container_set_border_width( GTK_CONTAINER( viewport ), 6 );
gtk_widget_set_hexpand( viewport, FALSE );
gtk_widget_set_hexpand( viewport, TRUE );
gtk_widget_set_vexpand( viewport, FALSE );
gtk_widget_show( viewport );
table5 = gtk_grid_new();
gtk_container_add( GTK_CONTAINER( viewport ), table5 );
gtk_container_set_border_width( GTK_CONTAINER( table5 ), 5 );
gtk_grid_set_column_spacing( GTK_GRID( table5 ), 2 );
gtk_widget_show( table5 );
hbox3 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 0 );
gtk_container_add( GTK_CONTAINER( viewport ), hbox3 );
gtk_widget_set_hexpand( hbox3, TRUE );
gtk_widget_set_vexpand( hbox3, FALSE );
gtk_widget_show( hbox3 );
label = gtk_label_new( _( "Height" ) );
gtk_grid_attach( GTK_GRID( table5 ), label, 1, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
table3 = gtk_grid_new(); //only need this for layout
gtk_grid_set_row_homogeneous( GTK_GRID( table3 ), TRUE );
gtk_grid_set_column_spacing( GTK_GRID( table3 ), 2 );
gtk_container_add( GTK_CONTAINER( hbox3 ), table3 );
gtk_container_set_border_width( GTK_CONTAINER( table3 ), 5 );
gtk_widget_set_hexpand( table3, TRUE );
gtk_widget_show( table3 );
label = gtk_label_new( _( "Width" ) );
gtk_grid_attach( GTK_GRID( table5 ), label, 2, 0, 1, 1 );
label = gtk_label_new( "" ); //only need this for layout
gtk_grid_attach( GTK_GRID( table3 ), label, 0, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
fit_button = gtk_button_new_with_mnemonic( _( "Fit" ) );
gtk_grid_attach( GTK_GRID( table5 ), fit_button, 0, 1, 1, 1 );
gtk_grid_attach( GTK_GRID( table3 ), fit_button, 0, 1, 2, 1 );
gtk_widget_set_hexpand( fit_button, TRUE );
gtk_widget_show( fit_button );
table5 = gtk_grid_new();
gtk_grid_set_column_spacing( GTK_GRID( table5 ), 2 );
gtk_grid_set_row_homogeneous( GTK_GRID( table5 ), TRUE );
gtk_box_pack_start( GTK_BOX( hbox3 ), table5, FALSE, TRUE, 0 );
gtk_container_set_border_width( GTK_CONTAINER( table5 ), 5 );
gtk_widget_set_hexpand( table5, TRUE );
gtk_widget_show( table5 );
label = gtk_label_new( _( "Height" ) );
gtk_grid_attach( GTK_GRID( table5 ), label, 1, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( _( "Width" ) );
gtk_grid_attach( GTK_GRID( table5 ), label, 0, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
fit_width_spinbutton_adj = gtk_adjustment_new( 1, 1, 32, 1, 10, 0 );
fit_width_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( fit_width_spinbutton_adj ), 1, 0 );
gtk_grid_attach( GTK_GRID( table5 ), fit_width_spinbutton, 1, 1, 1, 1 );
gtk_grid_attach( GTK_GRID( table5 ), fit_width_spinbutton, 0, 1, 1, 1 );
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 );
gtk_widget_set_hexpand( fit_width_spinbutton, TRUE );
gtk_widget_show( fit_width_spinbutton );
g_object_set( fit_width_spinbutton, "xalign", 1.0, NULL );
fit_height_spinbutton_adj = gtk_adjustment_new( 1, 1, 32, 1, 10, 0 );
fit_height_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( fit_height_spinbutton_adj ), 1, 0 );
gtk_grid_attach( GTK_GRID( table5 ), fit_height_spinbutton, 2, 1, 1, 1 );
gtk_grid_attach( GTK_GRID( table5 ), fit_height_spinbutton, 1, 1, 1, 1 );
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 );
gtk_widget_set_hexpand( fit_height_spinbutton, TRUE );
gtk_widget_show( fit_height_spinbutton );
g_object_set( fit_height_spinbutton, "xalign", 1.0, NULL );
button_group = gtk_size_group_new( GTK_SIZE_GROUP_BOTH );
gtk_size_group_add_widget( button_group, axial_button );
gtk_size_group_add_widget( button_group, fit_button );
g_object_unref( button_group );
size_group = gtk_size_group_new( GTK_SIZE_GROUP_BOTH );
gtk_size_group_add_widget( size_group, axial_button );
gtk_size_group_add_widget( size_group, fit_button );
g_object_unref( size_group );
size_group = gtk_size_group_new( GTK_SIZE_GROUP_BOTH );
gtk_size_group_add_widget( size_group, table3 );
gtk_size_group_add_widget( size_group, table4 );
g_object_unref( size_group );
// closing the window (upper right window manager click)
g_signal_connect( (gpointer) SurfaceInspector,

View file

@ -588,59 +588,46 @@ GtkWidget* create_SurfaceInspector( void ){
gtk_container_add( GTK_CONTAINER( vbox1 ), frame1 );
gtk_widget_show( frame1 );
table1 = gtk_table_new( 7, 3, FALSE );
gtk_table_set_col_spacings( GTK_TABLE( table1 ), 5 );
gtk_table_set_row_spacings( GTK_TABLE( table1 ), 5 );
table1 = gtk_grid_new();
gtk_grid_set_row_spacing( GTK_GRID( table1 ), 5 );
gtk_grid_set_column_spacing( GTK_GRID( table1 ), 5 );
gtk_container_set_border_width( GTK_CONTAINER( table1 ), 5 );
gtk_container_add( GTK_CONTAINER( frame1 ), table1 );
gtk_widget_set_hexpand( GTK_WIDGET( table1 ), TRUE );
gtk_widget_show( table1 );
label = gtk_label_new( "Step" );
gtk_table_attach( GTK_TABLE( table1 ), label, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
label = gtk_label_new( "Value" );
gtk_grid_attach( GTK_GRID( table1 ), label, 1, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Value" );
gtk_table_attach( GTK_TABLE( table1 ), label, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
label = gtk_label_new( "Step" );
gtk_grid_attach( GTK_GRID( table1 ), label, 2, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Horizontal shift: " );
gtk_table_attach( GTK_TABLE( table1 ), label, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), label, 0, 1, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Vertical shift: " );
gtk_table_attach( GTK_TABLE( table1 ), label, 0, 1, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), label, 0, 2, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Horizontal scale: " );
gtk_table_attach( GTK_TABLE( table1 ), label, 0, 1, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), label, 0, 3, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Vertical scale: " );
gtk_table_attach( GTK_TABLE( table1 ), label, 0, 1, 4, 5,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), label, 0, 4, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Rotate: " );
gtk_table_attach( GTK_TABLE( table1 ), label, 0, 1, 5, 6,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), label, 0, 5, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
@ -649,9 +636,8 @@ GtkWidget* create_SurfaceInspector( void ){
hshift_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hshift_value_spinbutton ), TRUE );
gtk_table_attach( GTK_TABLE( table1 ), hshift_value_spinbutton, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), hshift_value_spinbutton, 1, 1, 1, 1 );
gtk_widget_set_hexpand( GTK_WIDGET( hshift_value_spinbutton ), TRUE );
gtk_widget_show( hshift_value_spinbutton );
g_object_set( hshift_value_spinbutton, "xalign", 1.0, NULL );
@ -660,9 +646,8 @@ GtkWidget* create_SurfaceInspector( void ){
vshift_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( vshift_value_spinbutton ), TRUE );
gtk_table_attach( GTK_TABLE( table1 ), vshift_value_spinbutton, 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), vshift_value_spinbutton, 1, 2, 1, 1 );
gtk_widget_set_hexpand( GTK_WIDGET( vshift_value_spinbutton ), TRUE );
gtk_widget_show( vshift_value_spinbutton );
g_object_set( vshift_value_spinbutton, "xalign", 1.0, NULL );
@ -670,18 +655,16 @@ GtkWidget* create_SurfaceInspector( void ){
hscale_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 4 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hscale_value_spinbutton ), TRUE );
gtk_table_attach( GTK_TABLE( table1 ), hscale_value_spinbutton, 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), hscale_value_spinbutton, 1, 3, 1, 1 );
gtk_widget_set_hexpand( GTK_WIDGET( hscale_value_spinbutton ), TRUE );
gtk_widget_show( hscale_value_spinbutton );
g_object_set( hscale_value_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 );
vscale_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 4 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_table_attach( GTK_TABLE( table1 ), vscale_value_spinbutton, 1, 2, 4, 5,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), vscale_value_spinbutton, 1, 4, 1, 1 );
gtk_widget_set_hexpand( GTK_WIDGET( vscale_value_spinbutton ), TRUE );
gtk_widget_show( vscale_value_spinbutton );
g_object_set( vscale_value_spinbutton, "xalign", 1.0, NULL );
@ -689,9 +672,8 @@ GtkWidget* create_SurfaceInspector( void ){
rotate_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( rotate_value_spinbutton ), TRUE );
gtk_table_attach( GTK_TABLE( table1 ), rotate_value_spinbutton, 1, 2, 5, 6,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), rotate_value_spinbutton, 1, 5, 1, 1 );
gtk_widget_set_hexpand( GTK_WIDGET( rotate_value_spinbutton ), TRUE );
gtk_widget_show( rotate_value_spinbutton );
g_object_set( rotate_value_spinbutton, "xalign", 1.0, NULL );
@ -699,117 +681,101 @@ GtkWidget* create_SurfaceInspector( void ){
adjustment = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 );
hshift_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_table_attach( GTK_TABLE( table1 ), hshift_step_spinbutton, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), hshift_step_spinbutton, 2, 1, 1, 1 );
gtk_widget_set_hexpand( GTK_WIDGET( hshift_step_spinbutton ), TRUE );
gtk_widget_show( hshift_step_spinbutton );
g_object_set( hshift_step_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 );
vshift_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_table_attach( GTK_TABLE( table1 ), vshift_step_spinbutton, 2, 3, 2, 3,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), vshift_step_spinbutton, 2, 2, 1, 1 );
gtk_widget_set_hexpand( GTK_WIDGET( vshift_step_spinbutton ), TRUE );
gtk_widget_show( vshift_step_spinbutton );
g_object_set( vshift_step_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 );
hscale_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 4 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_table_attach( GTK_TABLE( table1 ), hscale_step_spinbutton, 2, 3, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), hscale_step_spinbutton, 2, 3, 1, 1 );
gtk_widget_set_hexpand( GTK_WIDGET( hscale_step_spinbutton ), TRUE );
gtk_widget_show( hscale_step_spinbutton );
g_object_set( hscale_step_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 );
vscale_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 4 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_table_attach( GTK_TABLE( table1 ), vscale_step_spinbutton, 2, 3, 4, 5,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), vscale_step_spinbutton, 2, 4, 1, 1 );
gtk_widget_set_hexpand( GTK_WIDGET( vscale_step_spinbutton ), TRUE );
gtk_widget_show( vscale_step_spinbutton );
g_object_set( vscale_step_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 0.0, -360.0, 360.0, 1.0, 10.0, 0.0 );
rotate_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_table_attach( GTK_TABLE( table1 ), rotate_step_spinbutton, 2, 3, 5, 6,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), rotate_step_spinbutton, 2, 5, 1, 1 );
gtk_widget_set_hexpand( GTK_WIDGET( rotate_step_spinbutton ), TRUE );
gtk_widget_show( rotate_step_spinbutton );
g_object_set( rotate_step_spinbutton, "xalign", 1.0, NULL );
match_grid_button = gtk_button_new_with_mnemonic( "Match Grid" );
gtk_table_attach( GTK_TABLE( table1 ), match_grid_button, 2, 3, 6, 7,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table1 ), match_grid_button, 2, 6, 1, 1 );
gtk_widget_show( match_grid_button );
frame2 = gtk_frame_new( "Tools" );
gtk_container_add( GTK_CONTAINER( vbox1 ), frame2 );
gtk_widget_show( frame2 );
table2 = gtk_table_new( 2, 4, TRUE );
gtk_table_set_col_spacings( GTK_TABLE( table2), 5 );
gtk_table_set_row_spacings( GTK_TABLE( table2 ), 0 );
gtk_container_set_border_width( GTK_CONTAINER( table2 ), 5 );
table2 = gtk_grid_new();
gtk_grid_set_row_spacing( GTK_GRID( table2 ), 5 );
gtk_grid_set_column_spacing( GTK_GRID( table2 ), 5 );
gtk_container_add( GTK_CONTAINER( frame2 ), table2 );
gtk_container_set_border_width( GTK_CONTAINER( table2 ), 5 );
gtk_widget_set_hexpand( GTK_WIDGET( table2 ), TRUE );
gtk_widget_show( table2 );
label = gtk_label_new( "Height" );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table2 ), label, 3, 4, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
label = gtk_label_new( "Brush" );
gtk_grid_attach( GTK_GRID( table2 ), label, 0, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_set_hexpand( GTK_WIDGET( label ), TRUE );
gtk_widget_show( label );
label = gtk_label_new( "Height" );
gtk_grid_attach( GTK_GRID( table2 ), label, 2, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_set_hexpand( GTK_WIDGET( label ), TRUE );
gtk_widget_show( label );
label = gtk_label_new( "Width" );
gtk_table_attach( GTK_TABLE( table2 ), label, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table2 ), label, 3, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_set_hexpand( GTK_WIDGET( label ), TRUE );
gtk_widget_show( label );
label = gtk_label_new( "Brush" );
gtk_table_attach( GTK_TABLE( table2 ), label, 0, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
adjustment = gtk_adjustment_new( 1, 1, 32, 1, 10, 0 );
fit_height_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 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 );
gtk_table_attach( GTK_TABLE( table2 ), fit_height_spinbutton, 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( fit_height_spinbutton );
g_object_set( fit_height_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 1, 1, 32, 1, 10, 0 );
fit_width_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 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 );
gtk_table_attach( GTK_TABLE( table2 ), fit_width_spinbutton, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table2 ), fit_width_spinbutton, 2, 1, 1, 1 );
gtk_widget_show( fit_width_spinbutton );
g_object_set( fit_width_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 1, 1, 32, 1, 10, 0 );
fit_height_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 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 );
gtk_grid_attach( GTK_GRID( table2 ), fit_height_spinbutton, 3, 1, 1, 1 );
gtk_widget_show( fit_height_spinbutton );
g_object_set( fit_height_spinbutton, "xalign", 1.0, NULL );
fit_button = gtk_button_new_with_mnemonic( "Fit" );
gtk_table_attach( GTK_TABLE( table2 ), fit_button, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table2 ), fit_button, 0, 1, 1, 1 );
gtk_widget_set_hexpand( GTK_WIDGET( fit_button ), TRUE );
gtk_widget_show( fit_button );
axial_button = gtk_button_new_with_mnemonic( "Axial" );
gtk_table_attach( GTK_TABLE( table2 ), axial_button, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table2 ), axial_button, 1, 1, 1, 1 );
gtk_widget_set_hexpand( GTK_WIDGET( axial_button ), TRUE );
gtk_widget_show( axial_button );
size_group = gtk_size_group_new( GTK_SIZE_GROUP_BOTH );

View file

@ -321,10 +321,12 @@ GtkWidget* create_SurfaceFlagsFrame( GtkWidget* surfacedialog_widget ){
gtk_container_add( GTK_CONTAINER( notebook1 ), vbox2 );
gtk_widget_show( vbox2 );
table4 = gtk_table_new( 8, 4, TRUE );
gtk_table_set_col_spacings( GTK_TABLE( table4 ), 5 );
gtk_table_set_row_spacings( GTK_TABLE( table4 ), 5 );
table4 = gtk_grid_new();
gtk_grid_set_column_spacing( GTK_GRID( table4 ), 5 );
gtk_grid_set_row_spacing( GTK_GRID( table4 ), 5 );
gtk_box_pack_start( GTK_BOX( vbox2 ), table4, TRUE, TRUE, 0 );
gtk_container_set_border_width( GTK_CONTAINER( table4 ), 5 );
gtk_widget_set_hexpand( table4, TRUE );
gtk_widget_show( table4 );
y = -1;
@ -338,14 +340,14 @@ GtkWidget* create_SurfaceFlagsFrame( GtkWidget* surfacedialog_widget ){
//Sys_Printf( "%s: %s\n", buffer, buttonLabel );
surface_buttons[i] = gtk_toggle_button_new_with_label( buttonLabel );
g_signal_connect( surface_buttons[i], "toggled", G_CALLBACK( on_surface_button_toggled ), GINT_TO_POINTER( 1 << i ) );
gtk_grid_attach( GTK_GRID( table4 ), surface_buttons[i], x, y, 1, 1 );
gtk_widget_set_hexpand( surface_buttons[i], TRUE );
gtk_widget_show( surface_buttons[i] );
gtk_table_attach( GTK_TABLE( table4 ), surface_buttons[i], 0 + x, 1 + x, ( 0 + y ), ( 1 + y ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
}
hbox2 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 0 );
gtk_box_pack_start( GTK_BOX( vbox2 ), hbox2, FALSE, FALSE, 0 );
gtk_container_set_border_width( GTK_CONTAINER( hbox2 ), 4 );
gtk_widget_show( hbox2 );
hbox3 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 0 );
@ -353,10 +355,10 @@ GtkWidget* create_SurfaceFlagsFrame( GtkWidget* surfacedialog_widget ){
gtk_widget_show( hbox3 );
vbox4 = gtk_box_new( GTK_ORIENTATION_VERTICAL, 0 );
gtk_box_pack_start( GTK_BOX( hbox3 ), vbox4, TRUE, TRUE, 0 );
gtk_box_pack_start( GTK_BOX( hbox3 ), vbox4, TRUE, TRUE, 0 );
gtk_widget_show( vbox4 );
value_label = gtk_label_new( "Value: " );
value_label = gtk_label_new( "Value:" );
gtk_box_pack_start( GTK_BOX( hbox3 ), value_label, FALSE, FALSE, 0 );
gtk_widget_set_halign( value_label, GTK_ALIGN_START );
gtk_widget_show( value_label );
@ -381,10 +383,12 @@ GtkWidget* create_SurfaceFlagsFrame( GtkWidget* surfacedialog_widget ){
gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ), gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ), 0 ), label5 );
gtk_widget_show( label5 );
table3 = gtk_table_new( 8, 4, TRUE );
gtk_table_set_col_spacings( GTK_TABLE( table3 ), 5 );
gtk_table_set_row_spacings( GTK_TABLE( table3 ), 5 );
table3 = gtk_grid_new();
gtk_grid_set_column_spacing( GTK_GRID( table3 ), 5 );
gtk_grid_set_row_spacing( GTK_GRID( table3 ), 5 );
gtk_container_add( GTK_CONTAINER( notebook1 ), table3 );
gtk_container_set_border_width( GTK_CONTAINER( table3 ), 5 );
gtk_widget_set_hexpand( table3, TRUE );
gtk_widget_show( table3 );
y = -1;
@ -397,9 +401,8 @@ GtkWidget* create_SurfaceFlagsFrame( GtkWidget* surfacedialog_widget ){
buttonLabel = g_FuncTable.m_pfnReadProjectKey( buffer );
content_buttons[i] = gtk_toggle_button_new_with_label( buttonLabel );
g_signal_connect( content_buttons[i], "toggled", G_CALLBACK( on_content_button_toggled ), GINT_TO_POINTER( 1 << i ) );
gtk_table_attach( GTK_TABLE( table3 ), content_buttons[i], 0 + x, 1 + x, ( 0 + y ), ( 1 + y ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
gtk_grid_attach( GTK_GRID( table3 ), content_buttons[i], x, y, 1, 1 );
gtk_widget_set_hexpand( content_buttons[i], TRUE );
gtk_widget_show( content_buttons[i] );
}

View file

@ -537,169 +537,128 @@ void SurfaceDlg::BuildDialog() {
g_signal_connect( entry, "key_press_event", G_CALLBACK( OnTextureKey ), NULL );
g_object_set_data( G_OBJECT( m_pWidget ), "texture", entry );
// table = gtk_table_new (5, 4, FALSE);
table = gtk_table_new( 6, 4, FALSE );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
table = gtk_grid_new();
gtk_grid_set_row_spacing( GTK_GRID( table ), 5 );
gtk_grid_set_column_spacing( GTK_GRID( table ), 5 );
gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
gtk_widget_show( table );
label = gtk_label_new( _( "Horizontal shift" ) );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), label, 0, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 0 );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), spin, 1, 0, 1, 1 );
gtk_widget_show( spin );
g_object_set_data( G_OBJECT( dlg ), "hshift", spin );
g_signal_connect( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ), "value_changed",
G_CALLBACK( OnUpdate ), NULL );
label = gtk_label_new( _( "Step" ) );
gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), label, 2, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
entry = gtk_entry_new();
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), entry, 3, 0, 1, 1 );
gtk_widget_show( entry );
g_object_set_data( G_OBJECT( dlg ), "hshift_inc", entry );
g_signal_connect( entry, "changed",
G_CALLBACK( OnIncrementChanged ), NULL );
label = gtk_label_new( _( "Vertical shift" ) );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), label, 0, 1, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 0 );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), spin, 1, 1, 1, 1 );
gtk_widget_show( spin );
g_object_set_data( G_OBJECT( dlg ), "vshift", spin );
g_signal_connect( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ), "value_changed",
G_CALLBACK( OnUpdate ), NULL );
label = gtk_label_new( _( "Step" ) );
gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), label, 2, 1, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
entry = gtk_entry_new();
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), entry, 3, 1, 1, 1 );
gtk_widget_show( entry );
g_object_set_data( G_OBJECT( dlg ), "vshift_inc", entry );
g_signal_connect( entry, "changed",
G_CALLBACK( OnIncrementChanged ), NULL );
label = gtk_label_new( _( "Horizontal stretch" ) );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), label, 0, 2, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 10, 0 ) ), 0, 0 );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), spin, 1, 2, 1, 1 );
gtk_widget_show( spin );
g_object_set_data( G_OBJECT( dlg ), "hscale", spin );
g_signal_connect( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ), "value_changed",
G_CALLBACK( OnUpdate ), NULL );
label = gtk_label_new( _( "Step" ) );
gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 2, 3 );
gtk_grid_attach( GTK_GRID( table ), label, 2, 2, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
entry = gtk_entry_new();
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 2, 3 );
gtk_grid_attach( GTK_GRID( table ), entry, 3, 2, 1, 1 );
gtk_widget_show( entry );
g_object_set_data( G_OBJECT( dlg ), "hscale_inc", entry );
g_signal_connect( entry, "changed",
G_CALLBACK( OnIncrementChanged ), NULL );
label = gtk_label_new( _( "Vertical stretch" ) );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), label, 0, 3, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 10, 0 ) ), 0, 0 );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), spin, 1, 3, 1, 1 );
gtk_widget_show( spin );
g_object_set_data( G_OBJECT( dlg ), "vscale", spin );
g_signal_connect( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ), "value_changed",
G_CALLBACK( OnUpdate ), NULL );
label = gtk_label_new( _( "Step" ) );
gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), label, 2, 3, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
entry = gtk_entry_new();
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), entry, 3, 3, 1, 1 );
gtk_widget_show( entry );
g_object_set_data( G_OBJECT( dlg ), "vscale_inc", entry );
g_signal_connect( entry, "changed",
G_CALLBACK( OnIncrementChanged ), NULL );
label = gtk_label_new( _( "Rotate" ) );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 4, 5,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), label, 0, 4, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -360, 360, 1, 10, 0 ) ), 1, 0 );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 4, 5,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), spin, 1, 4, 1, 1 );
gtk_widget_show( spin );
g_object_set_data( G_OBJECT( dlg ), "rotate", spin );
g_signal_connect( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ), "value_changed",
G_CALLBACK( OnUpdate ), NULL );
label = gtk_label_new( _( "Step" ) );
gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 4, 5,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), label, 2, 4, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
entry = gtk_entry_new();
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 4, 5,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), entry, 3, 4, 1, 1 );
gtk_widget_show( entry );
g_object_set_data( G_OBJECT( dlg ), "rotate_inc", entry );
g_signal_connect( entry, "changed",
@ -707,9 +666,7 @@ void SurfaceDlg::BuildDialog() {
// match grid button
button = gtk_button_new_with_label( _( "Match Grid" ) );
gtk_table_attach( GTK_TABLE( table ), button, 2, 4, 5, 6,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), button, 3, 5, 1, 1 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnBtnMatchGrid ), NULL );
@ -718,53 +675,41 @@ void SurfaceDlg::BuildDialog() {
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
gtk_widget_show( frame );
table = gtk_table_new( 4, 4, FALSE );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
table = gtk_grid_new();
gtk_grid_set_row_spacing( GTK_GRID( table ), 5 );
gtk_grid_set_column_spacing( GTK_GRID( table ), 5 );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
gtk_widget_show( table );
label = gtk_label_new( "Brush" );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), label, 0, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Patch" );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), label, 0, 2, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Width" );
gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), label, 2, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( _( "Height" ) );
gtk_table_attach( GTK_TABLE( table ), label, 3, 4, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), label, 3, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
axial_button = button = gtk_button_new_with_label( _( "Axial" ) );
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), button, 0, 1, 1, 1 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnBtnAxial ), NULL );
fit_button = button = gtk_button_new_with_label( _( "Fit" ) );
gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), button, 1, 1, 1, 1 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnBtnFaceFit ), NULL );
@ -775,33 +720,25 @@ void SurfaceDlg::BuildDialog() {
g_object_unref( button_group );
cap_button = button = gtk_button_new_with_label( _( "CAP" ) );
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), button, 0, 3, 1, 1 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnBtnPatchdetails ), NULL );
set_button = button = gtk_button_new_with_label( _( "Set..." ) );
gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), button, 1, 3, 1, 1 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnBtnPatchreset ), NULL );
nat_button = button = gtk_button_new_with_label( _( "Natural" ) );
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), button, 2, 3, 1, 1 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnBtnPatchnatural ), NULL );
fit_button = button = gtk_button_new_with_label( _( "Fit" ) );
gtk_table_attach( GTK_TABLE( table ), button, 3, 4, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), button, 3, 3, 1, 1 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnBtnPatchFit ), NULL );
@ -814,16 +751,12 @@ void SurfaceDlg::BuildDialog() {
g_object_unref( button_group );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 1, 32, 1, 10, 0 ) ), 1, 0 );
gtk_table_attach( GTK_TABLE( table ), spin, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), spin, 2, 1, 1, 1 );
gtk_widget_show( spin );
AddDialogData( spin, &m_nWidth, DLG_SPIN_INT );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 1, 32, 1, 10, 0 ) ), 1, 0 );
gtk_table_attach( GTK_TABLE( table ), spin, 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_grid_attach( GTK_GRID( table ), spin, 3, 1, 1, 1 );
gtk_widget_show( spin );
AddDialogData( spin, &m_nHeight, DLG_SPIN_INT );