Merge pull request #429 from Pan7/gtkimpro

gtk improvements
This commit is contained in:
Timothee "TTimo" Besset 2017-03-12 12:41:24 -05:00 committed by GitHub
commit cb1e21565b
16 changed files with 113 additions and 88 deletions

View file

@ -107,17 +107,17 @@ static gint ci_new( GtkWidget *widget, gpointer data ){
fixed = gtk_radio_button_new_with_label( targetTypeRadio, "Fixed" );
gtk_box_pack_start( GTK_BOX( vbox2 ), fixed, FALSE, FALSE, 3 );
gtk_widget_show( fixed );
targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( fixed ) );
targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( fixed ) );
interpolated = gtk_radio_button_new_with_label( targetTypeRadio, "Interpolated" );
gtk_box_pack_start( GTK_BOX( vbox2 ), interpolated, FALSE, FALSE, 3 );
gtk_widget_show( interpolated );
targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( interpolated ) );
targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( interpolated ) );
spline = gtk_radio_button_new_with_label( targetTypeRadio, "Spline" );
gtk_box_pack_start( GTK_BOX( vbox2 ), spline, FALSE, FALSE, 3 );
gtk_widget_show( spline );
targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( spline ) );
targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( spline ) );
// -------------------------- //
@ -228,7 +228,7 @@ static gint ci_apply( GtkWidget *widget, gpointer data ){
gtk_label_set_text( g_pTotalTime, buf );
gtk_adjustment_set_value( g_pTimeLine, 0.f );
g_pTimeLine->upper = GetCurrentCam()->GetCam()->getTotalTime() * 1000;
gtk_adjustment_set_upper( g_pTimeLine, GetCurrentCam()->GetCam()->getTotalTime() * 1000 );
GetCurrentCam()->HasBeenModified();
}
@ -348,7 +348,7 @@ static void RefreshEventList( void ){
gtk_label_set_text( g_pTotalTime, buf );
gtk_adjustment_set_value( g_pTimeLine, 0.f );
g_pTimeLine->upper = ( GetCurrentCam()->GetCam()->getTotalTime() * 1000 );
gtk_adjustment_set_upper( g_pTimeLine, ( GetCurrentCam()->GetCam()->getTotalTime() * 1000 ) );
}
gtk_clist_thaw( GTK_CLIST( g_pEventsList ) );
@ -534,17 +534,17 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){
fixed = gtk_radio_button_new_with_label( targetTypeRadio, _( "Fixed" ) );
gtk_box_pack_start( GTK_BOX( vbox2 ), fixed, FALSE, FALSE, 3 );
gtk_widget_show( fixed );
targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( fixed ) );
targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( fixed ) );
interpolated = gtk_radio_button_new_with_label( targetTypeRadio, _( "Interpolated" ) );
gtk_box_pack_start( GTK_BOX( vbox2 ), interpolated, FALSE, FALSE, 3 );
gtk_widget_show( interpolated );
targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( interpolated ) );
targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( interpolated ) );
spline = gtk_radio_button_new_with_label( targetTypeRadio, _( "Spline" ) );
gtk_box_pack_start( GTK_BOX( vbox2 ), spline, FALSE, FALSE, 3 );
gtk_widget_show( spline );
targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( spline ) );
targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( spline ) );
// -------------------------- //
@ -729,7 +729,7 @@ static gint ci_camlist_changed( GtkWidget *widget, gpointer data ){
gtk_label_set_text( g_pTotalTime, buf );
gtk_adjustment_set_value( g_pTimeLine, 0.f );
g_pTimeLine->upper = GetCurrentCam()->GetCam()->getTotalTime() * 1000;
gtk_adjustment_set_upper( g_pTimeLine, GetCurrentCam()->GetCam()->getTotalTime() * 1000 );
}
else {
// Set Name
@ -745,7 +745,7 @@ static gint ci_camlist_changed( GtkWidget *widget, gpointer data ){
gtk_label_set_text( g_pTotalTime, "30.00" );
gtk_adjustment_set_value( g_pTimeLine, 0.f );
g_pTimeLine->upper = 30000;
gtk_adjustment_set_upper( g_pTimeLine, 30000 );
}
// Refresh event list
@ -865,7 +865,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ){
eventWidget[i] = gtk_radio_button_new_with_label( eventTypeRadio, camEventStr[i] );
gtk_box_pack_start( GTK_BOX( vbox2 ), eventWidget[i], FALSE, FALSE, 3 );
gtk_widget_show( eventWidget[i] );
eventTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( eventWidget[i] ) );
eventTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( eventWidget[i] ) );
if ( camEventFlags[i][1] == false ) {
gtk_widget_set_sensitive( eventWidget[i], FALSE );
}
@ -939,7 +939,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ){
}
// Add the event
GetCurrentCam()->GetCam()->addEvent( static_cast<idCameraEvent::eventType>( type ), str, (long)( g_pTimeLine->value ) );
GetCurrentCam()->GetCam()->addEvent( static_cast<idCameraEvent::eventType>( type ), str, (long)( gtk_adjustment_get_value( g_pTimeLine ) ) );
// Refresh event list
RefreshEventList();
@ -970,7 +970,7 @@ static gint ci_del( GtkWidget *widget, gpointer data ){
static gint ci_timeline_changed( GtkAdjustment *adjustment ){
char buf[128];
sprintf( buf, "%.2f", adjustment->value / 1000.f );
sprintf( buf, "%.2f", gtk_adjustment_get_value( adjustment ) / 1000.f );
gtk_label_set_text( g_pCurrentTime, buf );
// FIXME: this will never work completely perfect. Startcamera calls buildcamera, which sets all events to 'nottriggered'.
@ -982,7 +982,7 @@ static gint ci_timeline_changed( GtkAdjustment *adjustment ){
GetCurrentCam()->GetCam()->startCamera( 0 );
GetCurrentCam()->GetCam()->getCameraInfo( (long)( adjustment->value ), &origin[0], &dir[0], &fov );
GetCurrentCam()->GetCam()->getCameraInfo( (long)( gtk_adjustment_get_value( adjustment ) ), &origin[0], &dir[0], &fov );
VectorSet( angles, asin( dir[2] ) * 180 / 3.14159, atan2( dir[1], dir[0] ) * 180 / 3.14159, 0 );
g_CameraTable.m_pfnSetCamera( origin, angles );
}
@ -1108,14 +1108,14 @@ GtkWidget *CreateCameraInspectorDialog( void ){
g_pEditModeEditRadioButton = gtk_radio_button_new_with_label( g_pEditTypeRadio, _( "Edit Points" ) );
gtk_box_pack_start( GTK_BOX( hbox ), g_pEditModeEditRadioButton, FALSE, FALSE, 3 );
gtk_widget_show( g_pEditModeEditRadioButton );
g_pEditTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( g_pEditModeEditRadioButton ) );
g_pEditTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( g_pEditModeEditRadioButton ) );
gtk_signal_connect( GTK_OBJECT( g_pEditModeEditRadioButton ), "clicked", GTK_SIGNAL_FUNC( ci_editmode_edit ), NULL );
g_pEditModeAddRadioButton = gtk_radio_button_new_with_label( g_pEditTypeRadio, _( "Add Points" ) );
gtk_box_pack_start( GTK_BOX( hbox ), g_pEditModeAddRadioButton, FALSE, FALSE, 3 );
gtk_widget_show( g_pEditModeAddRadioButton );
g_pEditTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( g_pEditModeAddRadioButton ) );
g_pEditTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( g_pEditModeAddRadioButton ) );
gtk_signal_connect( GTK_OBJECT( g_pEditModeAddRadioButton ), "clicked", GTK_SIGNAL_FUNC( ci_editmode_add ), NULL );
@ -1186,6 +1186,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_widget_show( g_pSecondsEntry );
// -------------------------- //

View file

@ -548,31 +548,31 @@ void SetTexMods(){
spin = GTK_SPIN_BUTTON( hshift_value_spinbutton );
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) );
adjust->step_increment = l_pIncrement->shift[0];
gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[0] );
spin = GTK_SPIN_BUTTON( hshift_step_spinbutton );
gtk_spin_button_set_value( spin, l_pIncrement->shift[0] );
spin = GTK_SPIN_BUTTON( vshift_value_spinbutton );
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) );
adjust->step_increment = l_pIncrement->shift[1];
gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[1] );
spin = GTK_SPIN_BUTTON( vshift_step_spinbutton );
gtk_spin_button_set_value( spin, l_pIncrement->shift[1] );
spin = GTK_SPIN_BUTTON( hscale_value_spinbutton );
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) );
adjust->step_increment = l_pIncrement->scale[0];
gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[0] );
spin = GTK_SPIN_BUTTON( hscale_step_spinbutton );
gtk_spin_button_set_value( spin, l_pIncrement->scale[0] );
spin = GTK_SPIN_BUTTON( vscale_value_spinbutton );
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) );
adjust->step_increment = l_pIncrement->scale[1];
gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[1] );
spin = GTK_SPIN_BUTTON( vscale_step_spinbutton );
gtk_spin_button_set_value( spin, l_pIncrement->scale[1] );
spin = GTK_SPIN_BUTTON( rotate_value_spinbutton );
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) );
adjust->step_increment = l_pIncrement->rotate;
gtk_adjustment_set_step_increment( adjust, l_pIncrement->rotate );
spin = GTK_SPIN_BUTTON( rotate_step_spinbutton );
gtk_spin_button_set_value( spin, l_pIncrement->rotate );
@ -936,6 +936,7 @@ GtkWidget* create_SurfaceInspector( void ){
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_sensitive( GTK_WIDGET( hshift_value_spinbutton ), TRUE );
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 );
@ -946,6 +947,7 @@ GtkWidget* create_SurfaceInspector( void ){
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_sensitive( GTK_WIDGET( vshift_value_spinbutton ), TRUE );
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 );
@ -956,6 +958,7 @@ GtkWidget* create_SurfaceInspector( void ){
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_sensitive( GTK_WIDGET( hscale_value_spinbutton ), TRUE );
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 );
@ -966,6 +969,7 @@ GtkWidget* create_SurfaceInspector( void ){
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_sensitive( GTK_WIDGET( vscale_value_spinbutton ), TRUE );
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 );
@ -976,6 +980,7 @@ GtkWidget* create_SurfaceInspector( void ){
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_sensitive( GTK_WIDGET( rotate_value_spinbutton ), TRUE );
g_object_set( rotate_value_spinbutton, "xalign", 1.0, NULL );
// Step Spins
hshift_step_spinbutton_adj = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 );
@ -985,6 +990,7 @@ 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 );
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 );
@ -993,6 +999,7 @@ 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 );
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 );
@ -1001,6 +1008,7 @@ 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 );
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 );
@ -1009,6 +1017,7 @@ 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 );
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 );
@ -1017,6 +1026,7 @@ 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 );
eventbox = gtk_event_box_new();
gtk_widget_show( eventbox );
@ -1084,6 +1094,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 );
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 );
@ -1093,6 +1104,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 );
eventbox = gtk_event_box_new();
gtk_widget_show( eventbox );
@ -1385,7 +1397,7 @@ static void on_hshift_step_spinbutton_value_changed( GtkSpinButton *spinbutton,
val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( hshift_step_spinbutton ) );
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( hshift_value_spinbutton ) );
adjust->step_increment = val;
gtk_adjustment_set_step_increment( adjust, val );
l_pIncrement->shift[0] = val;
}
@ -1405,7 +1417,7 @@ static void on_vshift_step_spinbutton_value_changed( GtkSpinButton *spinbutton,
val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( vshift_step_spinbutton ) );
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( vshift_value_spinbutton ) );
adjust->step_increment = val;
gtk_adjustment_set_step_increment( adjust, val );
l_pIncrement->shift[1] = val;
}
@ -1425,7 +1437,7 @@ static void on_hscale_step_spinbutton_value_changed( GtkSpinButton *spinbutton,
val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( hscale_step_spinbutton ) );
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( hscale_value_spinbutton ) );
adjust->step_increment = val;
gtk_adjustment_set_step_increment( adjust, val );
l_pIncrement->scale[0] = val;
}
@ -1445,7 +1457,7 @@ static void on_vscale_step_spinbutton_value_changed( GtkSpinButton *spinbutton,
val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( vscale_step_spinbutton ) );
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( vscale_value_spinbutton ) );
adjust->step_increment = val;
gtk_adjustment_set_step_increment( adjust, val );
l_pIncrement->scale[1] = val;
}
@ -1465,7 +1477,7 @@ static void on_rotate_step_spinbutton_value_changed( GtkSpinButton *spinbutton,
val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( rotate_step_spinbutton ) );
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( rotate_value_spinbutton ) );
adjust->step_increment = val;
gtk_adjustment_set_step_increment( adjust, val );
l_pIncrement->rotate = val;
}

View file

@ -643,6 +643,7 @@ GtkWidget* create_SurfaceInspector( void ){
(GtkAttachOptions) ( 0 ), 0, 0 );
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 );
g_object_set( hshift_value_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 );
vshift_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 );
@ -652,6 +653,7 @@ GtkWidget* create_SurfaceInspector( void ){
(GtkAttachOptions) ( 0 ), 0, 0 );
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 );
g_object_set( vshift_value_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 );
hscale_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 4 );
@ -661,6 +663,7 @@ GtkWidget* create_SurfaceInspector( void ){
(GtkAttachOptions) ( 0 ), 0, 0 );
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 );
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 );
@ -669,6 +672,7 @@ 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 );
adjustment = gtk_adjustment_new( 0.0, -360.0, 360.0, 1.0, 10.0, 0.0 );
rotate_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 );
@ -678,6 +682,7 @@ GtkWidget* create_SurfaceInspector( void ){
(GtkAttachOptions) ( 0 ), 0, 0 );
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 );
g_object_set( rotate_value_spinbutton, "xalign", 1.0, NULL );
// Step Spins
adjustment = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 );
@ -687,6 +692,7 @@ 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 );
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 );
@ -695,6 +701,7 @@ 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 );
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 );
@ -703,6 +710,7 @@ 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 );
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 );
@ -711,6 +719,7 @@ 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 );
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 );
@ -719,6 +728,7 @@ 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 );
match_grid_button = gtk_button_new_with_mnemonic( "Match Grid" );
gtk_widget_show( match_grid_button );
@ -763,6 +773,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 );
adjustment = gtk_adjustment_new( 1, 1, 32, 1, 10, 0 );
fit_width_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 0 );
@ -772,6 +783,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 );
fit_button = gtk_button_new_with_mnemonic( "Fit" );
gtk_widget_show( fit_button );
@ -1035,7 +1047,7 @@ static void on_hshift_step_spinbutton_value_changed( GtkSpinButton *spinbutton,
val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( hshift_step_spinbutton ) ) ;
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( hshift_value_spinbutton ) );
adjust->step_increment = val;
gtk_adjustment_set_step_increment( adjust, val );
l_pIncrement->shift[0] = val;
}
@ -1055,7 +1067,7 @@ static void on_vshift_step_spinbutton_value_changed( GtkSpinButton *spinbutton,
val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( vshift_step_spinbutton ) ) ;
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( vshift_value_spinbutton ) );
adjust->step_increment = val;
gtk_adjustment_set_step_increment( adjust, val );
l_pIncrement->shift[1] = val;
}
@ -1075,7 +1087,7 @@ static void on_hscale_step_spinbutton_value_changed( GtkSpinButton *spinbutton,
val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( hscale_step_spinbutton ) ) ;
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( hscale_value_spinbutton ) );
adjust->step_increment = val;
gtk_adjustment_set_step_increment( adjust, val );
l_pIncrement->scale[0] = val;
}
@ -1095,7 +1107,7 @@ static void on_vscale_step_spinbutton_value_changed( GtkSpinButton *spinbutton,
val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( vscale_step_spinbutton ) ) ;
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( vscale_value_spinbutton ) );
adjust->step_increment = val;
gtk_adjustment_set_step_increment( adjust, val );
l_pIncrement->scale[1] = val;
}
@ -1115,7 +1127,7 @@ static void on_rotate_step_spinbutton_value_changed( GtkSpinButton *spinbutton,
val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( rotate_step_spinbutton ) ) ;
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( rotate_value_spinbutton ) );
adjust->step_increment = val;
gtk_adjustment_set_step_increment( adjust, val );
l_pIncrement->rotate = val;
}

View file

@ -231,13 +231,13 @@ inline void change_contentflag( GtkWidget *togglebutton, int content_flag, gbool
// Surface Flags Callbacks
void on_surface_button_toggled( GtkToggleButton *togglebutton, gpointer user_data ){
int flag = GPOINTER_TO_INT( user_data );
change_surfaceflag( GTK_WIDGET( togglebutton ), flag, ( GTK_TOGGLE_BUTTON( togglebutton )->active ) );
change_surfaceflag( GTK_WIDGET( togglebutton ), flag, gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( togglebutton ) ) );
}
// Content Flags Callbacks
void on_content_button_toggled( GtkToggleButton *togglebutton, gpointer user_data ){
int flag = GPOINTER_TO_INT( user_data );
change_contentflag( GTK_WIDGET( togglebutton ), flag, ( GTK_TOGGLE_BUTTON( togglebutton )->active ) );
change_contentflag( GTK_WIDGET( togglebutton ), flag, gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( togglebutton ) ) );
}
// Value Entry Callback
@ -278,11 +278,11 @@ void on_value_entry_insert_text( GtkEditable *editable, gchar *new_text, gint ne
}
void on_surfacebutton_clicked( GtkButton *button, gpointer user_data ){
gtk_notebook_set_page( GTK_NOTEBOOK( notebook1 ), 0 );
gtk_notebook_set_current_page( GTK_NOTEBOOK( notebook1 ), 0 );
}
void on_contentbutton_clicked( GtkButton *button, gpointer user_data ){
gtk_notebook_set_page( GTK_NOTEBOOK( notebook1 ), 1 );
gtk_notebook_set_current_page( GTK_NOTEBOOK( notebook1 ), 1 );
}
#define IDTECH2_FLAG_BUTTON_BORDER 3

View file

@ -57,7 +57,7 @@ CamWnd::~CamWnd (){
void CamWnd::OnCreate(){
if ( !MakeCurrent() ) {
Error( "glMakeCurrent failed" );
Error( "camwindow: glMakeCurrent failed" );
}
// report OpenGL information

View file

@ -133,7 +133,7 @@ void Dialog::UpdateData( bool retrieve ){
break;
case DLG_RADIO_INT:
{
GSList *radio = gtk_radio_button_group( GTK_RADIO_BUTTON( data->object ) );
GSList *radio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( data->object ) );
*(int*)data->buffer = g_slist_length( radio ) - 1;
for (; radio; radio = g_slist_next( radio ) )
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio->data ) ) ) {
@ -158,13 +158,13 @@ void Dialog::UpdateData( bool retrieve ){
*(int*)data->buffer = atoi( gtk_entry_get_text( GTK_ENTRY( data->object ) ) );
break;
case DLG_SPIN_FLOAT:
*(float*)data->buffer = gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( data->object ) );
*(float*)data->buffer = gtk_spin_button_get_value( GTK_SPIN_BUTTON( data->object ) );
break;
case DLG_SPIN_INT:
*(int*)data->buffer = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( data->object ) );
break;
case DLG_ADJ_INT:
*(int*)data->buffer = (int) GTK_ADJUSTMENT( data->object )->value;
*(int*)data->buffer = (int) gtk_adjustment_get_value( GTK_ADJUSTMENT( data->object ) );
break;
case DLG_COMBO_INT:
{
@ -178,7 +178,7 @@ void Dialog::UpdateData( bool retrieve ){
for ( i = 0; lst != NULL; lst = g_list_next( lst ) )
{
gtk_label_get( GTK_LABEL( GTK_BIN( lst->data )->child ), &label );
label = gtk_label_get_text( GTK_LABEL( lst->data ) );
if ( strcmp( label, entry ) == 0 ) {
*(int*)data->buffer = i;
@ -209,7 +209,7 @@ void Dialog::UpdateData( bool retrieve ){
break;
case DLG_RADIO_INT:
{
GSList *radio = gtk_radio_button_group( GTK_RADIO_BUTTON( data->object ) );
GSList *radio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( data->object ) );
gpointer btn = g_slist_nth_data( radio, g_slist_length( radio ) - ( *(int*)data->buffer ) - 1 );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( btn ), TRUE );
} break;
@ -244,7 +244,7 @@ void Dialog::UpdateData( bool retrieve ){
if ( *(int*)data->buffer != -1 ) {
lst = g_list_nth( lst, *(int*)data->buffer );
if ( lst != NULL ) {
gtk_label_get( GTK_LABEL( GTK_BIN( lst->data )->child ), &entry );
entry = gtk_label_get_text( GTK_LABEL( lst->data ) );
}
}
if ( entry ) {

View file

@ -57,9 +57,9 @@ static void OnClose( GtkWidget *widget, gpointer data ){
}
static void popup_selected( GtkWidget *widget, gpointer data ){
gchar *str;
const gchar *str;
gtk_label_get( GTK_LABEL( GTK_BIN( widget )->child ), &str );
str = gtk_label_get_text( GTK_LABEL( widget ) );
gtk_entry_set_text( GTK_ENTRY( data ), str );
}

View file

@ -195,7 +195,7 @@ GLWindow::GLWindow( bool zbuffer ) {
m_pParent = NULL;
m_pWidget = gtk_glwidget_new( zbuffer, g_qeglobals_gui.d_glBase );
GTK_WIDGET_SET_FLAGS( m_pWidget, GTK_CAN_FOCUS );
gtk_widget_set_can_focus( m_pWidget, TRUE );
#ifdef DBG_GLWINDOW
Sys_Printf( "GLWindow::GLWindow m_pWidget = %p\n", m_pWidget );

View file

@ -1116,8 +1116,8 @@ static gint entityentry_keypress( GtkWidget* widget, GdkEventKey* event, gpointe
}
static void switch_page( GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer data ){
char *text;
gtk_label_get( GTK_LABEL( gtk_notebook_get_tab_label( notebook, gtk_notebook_get_nth_page( notebook, page_num ) ) ), &text );
const gchar *text;
text = gtk_label_get_text( GTK_LABEL( gtk_notebook_get_tab_label( notebook, gtk_notebook_get_nth_page( notebook, page_num ) ) ) );
gtk_window_set_title( GTK_WINDOW( data ), text );
gpointer item = g_object_get_data( G_OBJECT( g_pParentWnd->m_pWidget ), "menu_misc_selectentitycolor" );

View file

@ -801,10 +801,10 @@ GtkWidget* create_radio_menu_item_with_mnemonic( GtkWidget *menu, GtkWidget *las
GSList *group = (GSList*)NULL;
if ( last != NULL ) {
group = gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( last ) );
group = gtk_radio_menu_item_get_group( GTK_RADIO_MENU_ITEM( last ) );
}
item = gtk_radio_menu_item_new_with_mnemonic( group, mnemonic );
gtk_check_menu_item_set_state( GTK_CHECK_MENU_ITEM( item ), state );
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), state );
gtk_widget_show( item );
gtk_container_add( GTK_CONTAINER( menu ), item );
@ -865,7 +865,7 @@ static GtkWidget * gtk_AddDlgButton( GtkWidget *container, const char *label,
gtk_box_pack_start( GTK_BOX( container ), btn, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( btn ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( clickSignal ) );
GTK_WIDGET_SET_FLAGS( btn, GTK_CAN_DEFAULT );
gtk_widget_set_can_default( btn, TRUE );
if( setGrabDefault )
gtk_widget_grab_default( btn );

View file

@ -3268,7 +3268,7 @@ void MainFrame::OnDelete(){
save_window_pos( m_pZWnd->m_pParent, g_PrefsDlg.mWindowInfo.posZWnd );
}
else{
g_PrefsDlg.mWindowInfo.nZFloatWidth = GTK_PANED( m_pSplits[0] )->child1_size;
g_PrefsDlg.mWindowInfo.nZFloatWidth = gtk_paned_get_position( GTK_PANED( m_pSplits[0] ) );
}
if ( CurrentStyle() == eFloating ) {
@ -3305,9 +3305,9 @@ void MainFrame::OnDestroy(){
gpointer w;
w = g_object_get_data( G_OBJECT( g_pGroupDlg->m_pWidget ), "split1" );
g_PrefsDlg.mWindowInfo.nEntitySplit1 = GTK_PANED( w )->child1_size;
g_PrefsDlg.mWindowInfo.nEntitySplit1 = gtk_paned_get_position( GTK_PANED( w ) );
w = g_object_get_data( G_OBJECT( g_pGroupDlg->m_pWidget ), "split2" );
g_PrefsDlg.mWindowInfo.nEntitySplit2 = GTK_PANED( w )->child1_size;
g_PrefsDlg.mWindowInfo.nEntitySplit2 = gtk_paned_get_position( GTK_PANED( w ) );
if ( !FloatingGroupDialog() ) {
GtkWidget *vsplit, *hsplit, *vsplit2, *hsplit2;
@ -3317,17 +3317,17 @@ void MainFrame::OnDestroy(){
hsplit = m_pSplits[2];
hsplit2 = m_pSplits[3];
g_PrefsDlg.mWindowInfo.nXYHeight = GTK_PANED( vsplit )->child1_size;
g_PrefsDlg.mWindowInfo.nXYWidth = GTK_PANED( hsplit2 )->child1_size;
g_PrefsDlg.mWindowInfo.nXYHeight = gtk_paned_get_position( GTK_PANED( vsplit ) );
g_PrefsDlg.mWindowInfo.nXYWidth = gtk_paned_get_position( GTK_PANED( hsplit2 ) );
if ( CurrentStyle() == eRegular ) {
g_PrefsDlg.mWindowInfo.nZWidth = GTK_PANED( hsplit )->child1_size;
g_PrefsDlg.mWindowInfo.nZWidth = gtk_paned_get_position( GTK_PANED( hsplit ) );
}
else{
g_PrefsDlg.mWindowInfo.nCamWidth = GTK_PANED( hsplit )->child1_size;
g_PrefsDlg.mWindowInfo.nCamWidth = gtk_paned_get_position( GTK_PANED( hsplit ) );
}
g_PrefsDlg.mWindowInfo.nCamHeight = GTK_PANED( vsplit2 )->child1_size;
g_PrefsDlg.mWindowInfo.nCamHeight = gtk_paned_get_position( GTK_PANED( vsplit2 ) );
}
else
{

View file

@ -33,7 +33,7 @@
#endif
//#include "qe3.h"
int QERApp_EClassScanDir( char *path, void* hPlug ){
int QERApp_EClassScanDir( const char *path, void* hPlug ){
char temp[NAME_MAX];
char filebase[NAME_MAX];
char filename[NAME_MAX];

View file

@ -2762,7 +2762,7 @@ void PrefsDlg::BuildDialog(){
// Add the page to the notebook
gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel );
gtk_notebook_set_page( GTK_NOTEBOOK( notebook ), PTAB_FRONT );
gtk_notebook_set_current_page( GTK_NOTEBOOK( notebook ), PTAB_FRONT );
}
// end new prefs dialog

View file

@ -313,27 +313,27 @@ static void OnIncrementChanged( GtkWidget *widget, gpointer data ){
if ( widget == g_dlgSurface.GetDlgWidget( "hshift_inc" ) ) {
l_pIncrement->shift[0] = val;
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( g_dlgSurface.GetDlgWidget( "hshift" ) ) );
adjust->step_increment = l_pIncrement->shift[0];
gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[0] );
}
else if ( widget == g_dlgSurface.GetDlgWidget( "vshift_inc" ) ) {
l_pIncrement->shift[1] = val;
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( g_dlgSurface.GetDlgWidget( "vshift" ) ) );
adjust->step_increment = l_pIncrement->shift[1];
gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[1] );
}
else if ( widget == g_dlgSurface.GetDlgWidget( "hscale_inc" ) ) {
l_pIncrement->scale[0] = val;
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( g_dlgSurface.GetDlgWidget( "hscale" ) ) );
adjust->step_increment = l_pIncrement->scale[0];
gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[0] );
}
else if ( widget == g_dlgSurface.GetDlgWidget( "vscale_inc" ) ) {
l_pIncrement->scale[1] = val;
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( g_dlgSurface.GetDlgWidget( "vscale" ) ) );
adjust->step_increment = l_pIncrement->scale[1];
gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[1] );
}
else if ( widget == g_dlgSurface.GetDlgWidget( "rotate_inc" ) ) {
l_pIncrement->rotate = val;
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( g_dlgSurface.GetDlgWidget( "rotate" ) ) );
adjust->step_increment = l_pIncrement->rotate;
gtk_adjustment_set_step_increment( adjust, l_pIncrement->rotate );
}
}
@ -928,13 +928,13 @@ void SurfaceDlg::SetTexMods(){
gtk_spin_button_set_value( spin, pt->shift[0] );
}
GtkAdjustment *adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) );
adjust->step_increment = l_pIncrement->shift[0];
gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[0] );
char buf[10]; // got into snprintf paranoia after BoundChecker detected a stack overrun
#ifdef _WIN32
// TTimo: THIS IS UGLY
#define snprintf _snprintf
#endif
snprintf( buf, 10, "%g", l_pIncrement->shift[0] );
snprintf( buf, sizeof( buf ), "%g", l_pIncrement->shift[0] );
gtk_entry_set_text( GTK_ENTRY( GetDlgWidget( "hshift_inc" ) ), buf );
spin = GTK_SPIN_BUTTON( GetDlgWidget( "vshift" ) );
@ -946,8 +946,8 @@ void SurfaceDlg::SetTexMods(){
gtk_spin_button_set_value( spin, pt->shift[1] );
}
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) );
adjust->step_increment = l_pIncrement->shift[1];
snprintf( buf, 10, "%g", l_pIncrement->shift[1] );
gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[1] );
snprintf( buf, sizeof( buf ), "%g", l_pIncrement->shift[1] );
gtk_entry_set_text( GTK_ENTRY( GetDlgWidget( "vshift_inc" ) ), buf );
spin = GTK_SPIN_BUTTON( GetDlgWidget( "hscale" ) );
@ -955,8 +955,8 @@ void SurfaceDlg::SetTexMods(){
gtk_spin_button_set_value( spin, g_qeglobals.m_bBrushPrimitMode ? m_scale[0] : pt->scale[0] );
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) );
adjust->step_increment = l_pIncrement->scale[0];
snprintf( buf, 10, "%g", l_pIncrement->scale[0] );
gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[0] );
snprintf( buf, sizeof( buf ), "%g", l_pIncrement->scale[0] );
gtk_entry_set_text( GTK_ENTRY( GetDlgWidget( "hscale_inc" ) ), buf );
spin = GTK_SPIN_BUTTON( GetDlgWidget( "vscale" ) );
@ -964,8 +964,8 @@ void SurfaceDlg::SetTexMods(){
gtk_spin_button_set_value( spin, g_qeglobals.m_bBrushPrimitMode ? m_scale[1] : pt->scale[1] );
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) );
adjust->step_increment = l_pIncrement->scale[1];
snprintf( buf, 10, "%g", l_pIncrement->scale[1] );
gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[1] );
snprintf( buf, sizeof( buf ), "%g", l_pIncrement->scale[1] );
gtk_entry_set_text( GTK_ENTRY( GetDlgWidget( "vscale_inc" ) ), buf );
//++timo compute BProtate as int ..
@ -974,8 +974,8 @@ void SurfaceDlg::SetTexMods(){
gtk_spin_button_set_value( spin, g_qeglobals.m_bBrushPrimitMode ? m_rotate : pt->rotate );
adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) );
adjust->step_increment = l_pIncrement->rotate;
snprintf( buf, 10, "%g", l_pIncrement->rotate );
gtk_adjustment_set_step_increment( adjust, l_pIncrement->rotate );
snprintf( buf, sizeof( buf ), "%g", l_pIncrement->rotate );
gtk_entry_set_text( GTK_ENTRY( GetDlgWidget( "rotate_inc" ) ), buf );
g_bListenChanged = true;
@ -1042,15 +1042,15 @@ void SurfaceDlg::GetTexMods(){
( g_qeglobals.m_bBrushPrimitMode ? m_shift[0] : pt->shift[0] ) =
gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( GetDlgWidget( "hshift" ) ) );
gtk_spin_button_get_value( GTK_SPIN_BUTTON( GetDlgWidget( "hshift" ) ) );
( g_qeglobals.m_bBrushPrimitMode ? m_shift[1] : pt->shift[1] ) =
gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( GetDlgWidget( "vshift" ) ) );
gtk_spin_button_get_value( GTK_SPIN_BUTTON( GetDlgWidget( "vshift" ) ) );
( g_qeglobals.m_bBrushPrimitMode ? m_scale[0] : pt->scale[0] ) =
gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( GetDlgWidget( "hscale" ) ) );
gtk_spin_button_get_value( GTK_SPIN_BUTTON( GetDlgWidget( "hscale" ) ) );
( g_qeglobals.m_bBrushPrimitMode ? m_scale[1] : pt->scale[1] ) =
gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( GetDlgWidget( "vscale" ) ) );
gtk_spin_button_get_value( GTK_SPIN_BUTTON( GetDlgWidget( "vscale" ) ) );
( g_qeglobals.m_bBrushPrimitMode ? m_rotate : pt->rotate ) =
gtk_spin_button_get_value_as_float( GTK_SPIN_BUTTON( GetDlgWidget( "rotate" ) ) );
gtk_spin_button_get_value( GTK_SPIN_BUTTON( GetDlgWidget( "rotate" ) ) );
// a local copy of the texture matrix, given for a qtexture_t with width=2 height=2
brushprimit_texdef_t local_bp;

View file

@ -1709,12 +1709,12 @@ void TexWnd::OnExpose() {
if ( g_PrefsDlg.m_bTextureScrollbar && ( m_bNeedRange || g_qeglobals.d_texturewin.m_nTotalHeight != nOld ) ) {
GtkAdjustment *vadjustment = gtk_range_get_adjustment( GTK_RANGE( g_qeglobals_gui.d_texture_scroll ) );
vadjustment->value = -g_qeglobals.d_texturewin.originy;
vadjustment->page_size = m_pWidget->allocation.height;
vadjustment->page_increment = m_pWidget->allocation.height / 2;
vadjustment->step_increment = 20;
vadjustment->lower = 0;
vadjustment->upper = g_qeglobals.d_texturewin.m_nTotalHeight;
gtk_adjustment_set_value( vadjustment, -g_qeglobals.d_texturewin.originy );
gtk_adjustment_set_page_size( vadjustment, m_pWidget->allocation.height );
gtk_adjustment_set_page_increment( vadjustment, m_pWidget->allocation.height / 2 );
gtk_adjustment_set_step_increment( vadjustment, 20 );
gtk_adjustment_set_lower( vadjustment, 0 );
gtk_adjustment_set_upper( vadjustment, g_qeglobals.d_texturewin.m_nTotalHeight );
gtk_signal_emit_by_name( GTK_OBJECT( vadjustment ), "changed" );
@ -1761,7 +1761,7 @@ void TexWnd::OnMouseMove( guint32 flags, int pointx, int pointy ){
void TexWnd::OnVScroll(){
GtkAdjustment *vadjustment = gtk_range_get_adjustment( GTK_RANGE( g_qeglobals_gui.d_texture_scroll ) );
g_qeglobals.d_texturewin.originy = -(int)vadjustment->value;
g_qeglobals.d_texturewin.originy = -(int)gtk_adjustment_get_value( vadjustment );
RedrawWindow();
}

View file

@ -3185,7 +3185,7 @@ bool XYWnd::AreaSelectOK(){
void XYWnd::OnCreate(){
if ( !MakeCurrent() ) {
Error( "glXMakeCurrent failed" );
Error( "xywindow: glXMakeCurrent failed" );
}
qglPolygonStipple( (unsigned char *)s_stipple );