gtk_box_pack_start( GTK_BOX( hbox ),w, FALSE, FALSE, 5 );
gtk_widget_show( w );
- w = gtk_hscale_new_with_range( 0.0,1.0,0.01 );
+ w = ui::HScale( 0.0, 1.0, 0.01 );
gtk_range_set_value( GTK_RANGE( w ),0.5 );
gtk_scale_set_value_pos( GTK_SCALE( w ),GTK_POS_LEFT );
g_signal_connect( G_OBJECT( w ), "value-changed",
g_pTimeLine = ui::Adjustment( 0, 0, 30000, 100, 250, 0 );
gtk_signal_connect( GTK_OBJECT( g_pTimeLine ), "value_changed", GTK_SIGNAL_FUNC( ci_timeline_changed ), NULL );
- w = gtk_hscale_new( g_pTimeLine );
+ w = ui::HScale( g_pTimeLine );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_widget_show( w );
gtk_scale_set_draw_value( GTK_SCALE( w ), FALSE );
GtkWidget* create_main_dialog(){
GtkWidget *dlg, *vbox, *hbox, *hbox2, *button, *notebook, *frame, *table, *table2;
GtkWidget *check, *spin, *radio, *label, *entry, *scale;
- GtkObject *adj;
+ ui::Adjustment adj;
GSList *group;
int i;
const char *games[] = { "Quake 2", "Half-Life", "SiN", "Heretic 2", "Kingpin", "Genesis3D", "Quake 3 Arena" };
adj = ui::Adjustment( 0, 0, 110, 1, 10, 0 );
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_decimate ), NULL );
g_object_set_data( G_OBJECT( dlg ), "decimate_adj", adj );
- scale = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
+ scale = ui::HScale( adj );
gtk_widget_show( scale );
gtk_box_pack_start( GTK_BOX( hbox2 ), scale, TRUE, TRUE, 0 );
gtk_scale_set_value_pos( GTK_SCALE( scale ), GTK_POS_RIGHT );
gtk_box_pack_start( GTK_BOX( vbox2 ), hbox, TRUE, TRUE, 0 );
auto adj = ui::Adjustment( portals.width_3d, 2, 40, 1, 1, 0 );
- lw3slider = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
+ lw3slider = ui::HScale( adj );
gtk_widget_show( lw3slider );
gtk_box_pack_start( GTK_BOX( hbox ), lw3slider, TRUE, TRUE, 0 );
gtk_scale_set_draw_value( GTK_SCALE( lw3slider ), FALSE );
gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
adj = ui::Adjustment( portals.trans_3d, 0, 100, 1, 1, 0 );
- transslider = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
+ transslider = ui::HScale( adj );
gtk_widget_show( transslider );
gtk_table_attach( GTK_TABLE( table ), transslider, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
gtk_signal_connect( GTK_OBJECT(adj), "value_changed", GTK_SIGNAL_FUNC( OnScrollTrans ), translabel );
adj = ui::Adjustment( portals.clip_range, 1, 128, 1, 1, 0 );
- clipslider = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
+ clipslider = ui::HScale( adj );
gtk_widget_show( clipslider );
gtk_table_attach( GTK_TABLE( table ), clipslider, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
gtk_box_pack_start( GTK_BOX( vbox2 ), hbox, TRUE, FALSE, 0 );
adj = ui::Adjustment( portals.width_2d, 2, 40, 1, 1, 0 );
- lw2slider = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
+ lw2slider = ui::HScale( adj );
gtk_widget_show( lw2slider );
gtk_box_pack_start( GTK_BOX( hbox ), lw2slider, TRUE, TRUE, 0 );
gtk_scale_set_draw_value( GTK_SCALE( lw2slider ), FALSE );
HBox::HBox(bool homogenous, int spacing) : HBox(GTK_HBOX(gtk_hbox_new(homogenous, spacing)))
{ }
+ HScale::HScale(Adjustment adjustment) : HScale(GTK_HSCALE(gtk_hscale_new(adjustment)))
+ { }
+
+ HScale::HScale(double min, double max, double step) : HScale(GTK_HSCALE(gtk_hscale_new_with_range(min, max, step)))
+ { }
+
Image::Image() : Image(GTK_IMAGE(gtk_image_new()))
{ }
using ui_evkey = struct _GdkEventKey;
using ui_frame = struct _GtkFrame;
using ui_hbox = struct _GtkHBox;
+using ui_hscale = struct _GtkHScale;
using ui_hpaned = struct _GtkHPaned;
using ui_image = struct _GtkImage;
using ui_label = struct _GtkLabel;
HBox(bool homogenous, int spacing);
);
+ WRAP(HScale, Widget, ui_hscale,
+ HScale(Adjustment adjustment);
+ HScale(double min, double max, double step);
+ );
+
WRAP(Image, Widget, ui_image,
Image();
);
ui::Widget alignment = ui::Alignment( 0.0, 0.5, 1.0, 0.0 );
gtk_widget_show( alignment );
- ui::Widget scale = ui::Widget(gtk_hscale_new( GTK_ADJUSTMENT( adj ) ));
+ ui::Widget scale = ui::HScale( adj );
gtk_scale_set_value_pos( GTK_SCALE( scale ), GTK_POS_LEFT );
gtk_widget_show( scale );
gtk_container_add( GTK_CONTAINER( alignment ), scale );