gtk_widget_show( m_pFileLabel );
- w = gtk_button_new_with_label( "Browse..." );
+ w = ui::Button( "Browse..." );
g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( browse_callback ),
( gpointer ) this );
gtk_box_pack_start( GTK_BOX( hbox ),w, FALSE, FALSE, 5 );
gtk_tooltips_set_tip( pTooltips, w, "Select a file", NULL );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Reload" );
+ w = ui::Button( "Reload" );
g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( reload_callback ),
( gpointer ) this );
// TODO disable until we have file
gtk_container_add( GTK_CONTAINER( frame ), hbox );
gtk_container_set_border_width( GTK_CONTAINER( hbox ),4 );
- w = gtk_button_new_with_label( "from selection" );
+ w = ui::Button( "from selection" );
gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, FALSE, 5 );
g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( size_sel_callback ),
( gpointer ) this );
gtk_widget_show( w );
if ( m_vt == XY ) {
- w = gtk_button_new_with_label( "from map mins/maxs" );
+ w = ui::Button( "from map mins/maxs" );
gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, FALSE, 2 );
g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( size_mm_callback ),
( gpointer ) this );
// ---- hbox ---- ok/cancel buttons
- w = gtk_button_new_with_label( "Ok" );
+ w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_grab_default( w );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
// ---- hbox ----
- w = gtk_button_new_with_label( "Ok" );
+ w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_grab_default( w );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox );
- w = gtk_button_new_with_label( "OK" );
+ w = ui::Button( "OK" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
gtk_widget_grab_default( w );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
tw1.one = textFrontBackTex;
tw1.two = comboMain;
- buttonSetMain = gtk_button_new_with_label( "Set As Main Texture" );
+ buttonSetMain = ui::Button( "Set As Main Texture" );
gtk_signal_connect( GTK_OBJECT( buttonSetMain ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback_settex ), &tw1 );
gtk_box_pack_start( GTK_BOX( hbox ), buttonSetMain, FALSE, FALSE, 0 );
gtk_widget_show( buttonSetMain );
tw2.one = textTrimTex;
tw2.two = comboTrim;
- buttonSetTrim = gtk_button_new_with_label( "Set As Trim Texture" );
+ buttonSetTrim = ui::Button( "Set As Trim Texture" );
gtk_signal_connect( GTK_OBJECT( buttonSetTrim ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback_settex ), &tw2 );
gtk_box_pack_start( GTK_BOX( hbox ), buttonSetTrim, FALSE, FALSE, 0 );
gtk_widget_show( buttonSetTrim );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox );
- w = gtk_button_new_with_label( "OK" );
+ w = ui::Button( "OK" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
gtk_widget_grab_default( w );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox );
- w = gtk_button_new_with_label( "Enable" );
+ w = ui::Button( "Enable" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
gtk_widget_show( w );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
gtk_widget_grab_default( w );
- w = gtk_button_new_with_label( "Disable" );
+ w = ui::Button( "Disable" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
// ---- hbox ---- ok/cancel buttons
- w = gtk_button_new_with_label( "Red->Blue" );
+ w = ui::Button( "Red->Blue" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_grab_default( w );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Blue->Red" );
+ w = ui::Button( "Blue->Red" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
// ---- hbox ----
- w = gtk_button_new_with_label( "Use Selected Brushes" );
+ w = ui::Button( "Use Selected Brushes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_grab_default( w );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Use All Brushes" );
+ w = ui::Button( "Use All Brushes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
// ---- hbox ----
- w = gtk_button_new_with_label( "Ok" );
+ w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_grab_default( w );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "OK" );
+ w = ui::Button( "OK" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
gtk_widget_grab_default( w );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox );
- w = gtk_button_new_with_label( "Ok" );
+ w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_show( w );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
gtk_widget_grab_default( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox );
- w = gtk_button_new_with_label( "Ok" );
+ w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_show( w );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
gtk_widget_grab_default( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox );
- w = gtk_button_new_with_label( "Ok" );
+ w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_show( w );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
gtk_widget_grab_default( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox );
- w = gtk_button_new_with_label( "Ok" );
+ w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
gtk_widget_show( w );
GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
gtk_widget_grab_default( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
gtk_widget_show( w );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox );
- w = gtk_button_new_with_label( "Rename..." );
+ w = ui::Button( "Rename..." );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_rename ), NULL );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Add Target..." );
+ w = ui::Button( "Add Target..." );
gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_add_target ), NULL );
gtk_widget_show( w );
gtk_box_pack_start( GTK_BOX( hbox ), vbox, FALSE, FALSE, 0 );
gtk_widget_show( vbox );
- w = gtk_button_new_with_label( "Add..." );
+ w = ui::Button( "Add..." );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_add ), NULL );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Del" );
+ w = ui::Button( "Del" );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_del ), NULL );
gtk_widget_show( w );
(GtkAttachOptions) ( 0 ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
- button = gtk_button_new_with_label( "Browse..." );
+ button = ui::Button( "Browse..." );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
gtk_widget_set_usize( button, 60, -2 );
g_object_set_data( G_OBJECT( dlg ), "bmp_file_browse", button );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( bitmap_browse ), NULL );
- button = gtk_button_new_with_label( "Reload" );
+ button = ui::Button( "Reload" );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
gtk_widget_set_usize( button, 60, -2 );
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 );
- button = gtk_button_new_with_label( "Free" );
+ button = ui::Button( "Free" );
gtk_widget_show( button );
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND ),
g_object_set_data( G_OBJECT( dlg ), "fix_free", button );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( fix_free ), NULL );
- button = gtk_button_new_with_label( "Free All" );
+ button = ui::Button( "Free All" );
gtk_widget_show( button );
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND ),
gtk_widget_show( vbox );
gtk_box_pack_start( GTK_BOX( hbox ), vbox, FALSE, TRUE, 0 );
- button = gtk_button_new_with_label( "OK" );
+ button = ui::Button( "OK" );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
gtk_widget_set_usize( button, 60, -2 );
gtk_widget_show( label );
gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, TRUE, 0 );
- button = gtk_button_new_with_label( "Open..." );
+ button = ui::Button( "Open..." );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "open", button );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_open ), NULL );
- button = gtk_button_new_with_label( "Save as..." );
+ button = ui::Button( "Save as..." );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "save", button );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_save ), NULL );
- button = gtk_button_new_with_label( "Defaults" );
+ button = ui::Button( "Defaults" );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "defaults", button );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_defaults ), NULL );
- button = gtk_button_new_with_label( "About..." );
+ button = ui::Button( "About..." );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_about ), NULL );
gtk_widget_show( hbox );
if ( mode == MB_OK ) {
- w = gtk_button_new_with_label( "Ok" );
+ w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
ret = IDOK;
}
else if ( mode == MB_OKCANCEL ) {
- w = gtk_button_new_with_label( "Ok" );
+ w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_grab_default( w );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
ret = IDCANCEL;
}
else if ( mode == MB_YESNOCANCEL ) {
- w = gtk_button_new_with_label( "Yes" );
+ w = ui::Button( "Yes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
gtk_widget_grab_default( w );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "No" );
+ w = ui::Button( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
}
else /* if (mode == MB_YESNO) */
{
- w = gtk_button_new_with_label( "Yes" );
+ w = ui::Button( "Yes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
gtk_widget_grab_default( w );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "No" );
+ w = ui::Button( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_widget_show( vbox );
gtk_box_pack_start( GTK_BOX( hbox ), vbox, FALSE, FALSE, 0 );
- button = gtk_button_new_with_label( "OK" );
+ button = ui::Button( "OK" );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked",
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
- button = gtk_button_new_with_label( "Color" );
+ button = ui::Button( "Color" );
gtk_widget_show( button );
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColor3d ), NULL );
- button = gtk_button_new_with_label( "Depth Color" );
+ button = ui::Button( "Depth Color" );
gtk_widget_show( button );
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
gtk_widget_show( hbox );
gtk_box_pack_start( GTK_BOX( vbox2 ), hbox, TRUE, FALSE, 0 );
- button = gtk_button_new_with_label( "Color" );
+ button = ui::Button( "Color" );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColor2d ), NULL );
gtk_widget_show( hbox );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
- button = gtk_button_new_with_label( "OK" );
+ button = ui::Button( "OK" );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked",
gtk_widget_show( check2d );
gtk_box_pack_start( GTK_BOX( hbox ), check2d, FALSE, FALSE, 0 );
- button = gtk_button_new_with_label( "Change" );
+ button = ui::Button( "Change" );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( change_clicked ), entry );
gtk_widget_show( hbox );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
- button = gtk_button_new_with_label( "Cancel" );
+ button = ui::Button( "Cancel" );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
gtk_widget_set_usize( button, 60, -2 );
- button = gtk_button_new_with_label( "OK" );
+ button = ui::Button( "OK" );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked",
gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT ); // text align left
gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, FALSE, 2 ); // insert the label in the box
- button = gtk_button_new_with_label( "OK" ); // create a button with text
+ button = ui::Button( "OK" ); // create a button with text
g_signal_connect_swapped( G_OBJECT( button ), "clicked", G_CALLBACK( gtk_widget_destroy ), window ); // connect the click event to close the window
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 2 ); // insert the button in the box
spinner_adj_MaxX = (GtkAdjustment *)gtk_adjustment_new( map_maxX, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of maximum x value
spinner_adj_MaxY = (GtkAdjustment *)gtk_adjustment_new( map_maxY, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of maximum y value
- button = gtk_button_new_with_label( "Get optimal mapcoords" ); // create button with text
+ button = ui::Button( "Get optimal mapcoords" ); // create button with text
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( input_optimal ), NULL ); // connect button with callback function
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 2 ); // insert button into vbox
msp.spinner4 = GTK_SPIN_BUTTON( spinnerMaxY );
msp.worldspawn = theWorldspawn;
- button = gtk_button_new_with_label( "Set" ); // create button with text
+ button = ui::Button( "Set" ); // create button with text
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( set_coordinates ), NULL ); // connect button with callback function
gtk_table_attach_defaults( GTK_TABLE( table ), button, 1, 2, 3, 4 ); // insert button into table
- button = gtk_button_new_with_label( "Cancel" ); // create button with text
+ button = ui::Button( "Cancel" ); // create button with text
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( close_window ), NULL ); // connect button with callback function
gtk_table_attach_defaults( GTK_TABLE( table ), button, 2, 3, 3, 4 ); // insert button into table
}
gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT ); // text align left
gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, FALSE, 2 ); // insert the label in the box
- button = gtk_button_new_with_label( "OK" ); // create a button with text
+ button = ui::Button( "OK" ); // create a button with text
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( close_window ), NULL ); // connect the click event to close the window
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 2 ); // insert the button in the box
}
}
GtkButton* create_dialog_button( const char* label, GCallback func, gpointer data ){
- GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( label ) );
+ GtkButton* button = ui::Button( label );
gtk_widget_set_size_request( GTK_WIDGET( button ), 64, -1 );
gtk_widget_show( GTK_WIDGET( button ) );
g_signal_connect( G_OBJECT( button ), "clicked", func, data );
gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( entry ), TRUE, TRUE, 0 );
// browse button
- GtkButton* button = GTK_BUTTON( gtk_button_new() );
+ GtkButton* button = ui::Button();
button_set_icon( button, "ellipsis.bmp" );
gtk_widget_show( GTK_WIDGET( button ) );
gtk_box_pack_end( GTK_BOX( hbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
#include <gtk/gtktoolbar.h>
#include <gtk/gtktogglebutton.h>
+#include <uilib/uilib.h>
#include "generic/callback.h"
}
GtkButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ){
- GtkButton* button = GTK_BUTTON( gtk_button_new() );
+ GtkButton* button = ui::Button();
button_set_icon( button, icon );
button_connect_callback( button, callback );
toolbar_append( toolbar, button, description );
: Alignment(GTK_ALIGNMENT(gtk_alignment_new(xalign, yalign, xscale, yscale)))
{ }
+ Button::Button() : Button(GTK_BUTTON(gtk_button_new()))
+ { }
+
Button::Button(const char *label) : Button(GTK_BUTTON(gtk_button_new_with_label(label)))
{ }
WRAP(Box, Widget, ui_box,);
WRAP(Button, Widget, ui_button,
+ Button();
Button(const char *label);
);
gtk_widget_show( hbox );
if ( mode == MB_OK ) {
- w = gtk_button_new_with_label( "Ok" );
+ w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
ret = IDOK;
}
else if ( mode == MB_OKCANCEL ) {
- w = gtk_button_new_with_label( "Ok" );
+ w = ui::Button( "Ok" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_grab_default( w );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
ret = IDCANCEL;
}
else if ( mode == MB_YESNOCANCEL ) {
- w = gtk_button_new_with_label( "Yes" );
+ w = ui::Button( "Yes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
gtk_widget_grab_default( w );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "No" );
+ w = ui::Button( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "Cancel" );
+ w = ui::Button( "Cancel" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
}
else /* if (mode == MB_YESNO) */
{
- w = gtk_button_new_with_label( "Yes" );
+ w = ui::Button( "Yes" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
gtk_widget_grab_default( w );
gtk_widget_show( w );
- w = gtk_button_new_with_label( "No" );
+ w = ui::Button( "No" );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
gtk_signal_connect( GTK_OBJECT( w ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) );
gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( hbox ), FALSE, TRUE, 0 );
{
- GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Clear All" ) );
+ GtkButton* button = ui::Button( "Clear All" );
gtk_widget_show( GTK_WIDGET( button ) );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( EntityInspector_clearAllKeyValues ), 0 );
gtk_box_pack_start( hbox, GTK_WIDGET( button ), TRUE, TRUE, 0 );
}
{
- GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Delete Key" ) );
+ GtkButton* button = ui::Button( "Delete Key" );
gtk_widget_show( GTK_WIDGET( button ) );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( EntityInspector_clearKeyValue ), 0 );
gtk_box_pack_start( hbox, GTK_WIDGET( button ), TRUE, TRUE, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
}
{
- GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Flip" ) );
+ GtkButton* button = ui::Button( "Flip" );
gtk_widget_show( GTK_WIDGET( button ) );
gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 2, 3,
(GtkAttachOptions)( GTK_FILL ),
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
}
{
- GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Flip" ) );
+ GtkButton* button = ui::Button( "Flip" );
gtk_widget_show( GTK_WIDGET( button ) );
gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 3, 4,
(GtkAttachOptions)( GTK_FILL ),
gtk_widget_show( GTK_WIDGET( hbox2 ) );
gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( hbox2 ), TRUE, FALSE, 0 );
{
- GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Auto Cap" ) );
+ GtkButton* button = ui::Button( "Auto Cap" );
gtk_widget_show( GTK_WIDGET( button ) );
gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchAutoCap ), 0 );
gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 );
}
{
- GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "CAP" ) );
+ GtkButton* button = ui::Button( "CAP" );
gtk_widget_show( GTK_WIDGET( button ) );
gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 );
gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 );
}
{
- GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Set..." ) );
+ GtkButton* button = ui::Button( "Set..." );
gtk_widget_show( GTK_WIDGET( button ) );
gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchreset ), 0 );
gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 );
}
{
- GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Natural" ) );
+ GtkButton* button = ui::Button( "Natural" );
gtk_widget_show( GTK_WIDGET( button ) );
gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 );
gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 );
}
{
- GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Fit" ) );
+ GtkButton* button = ui::Button( "Fit" );
gtk_widget_show( GTK_WIDGET( button ) );
gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchfit ), 0 );
GtkTooltips* tooltips = gtk_tooltips_new();
ui::Widget image = ui::Widget(gtk_image_new_from_stock( GTK_STOCK_FIND, GTK_ICON_SIZE_SMALL_TOOLBAR ));
- g_TextureBrowser.m_search_button = ui::Widget(gtk_button_new());
+ g_TextureBrowser.m_search_button = ui::Button();
g_signal_connect( G_OBJECT( g_TextureBrowser.m_search_button ), "clicked", G_CALLBACK( TextureBrowser_searchTags ), NULL );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ), g_TextureBrowser.m_search_button, "Search with selected tags", "Search with selected tags" );
gtk_container_add( GTK_CONTAINER( g_TextureBrowser.m_search_button ), image );
gtk_table_attach( GTK_TABLE( frame_table ), scrolled_win, 2, 3, 1, 3, GTK_FILL, GTK_FILL, 0, 0 );
}
{ // tag arrow buttons
- ui::Widget m_btn_left = ui::Widget(gtk_button_new());
- ui::Widget m_btn_right = ui::Widget(gtk_button_new());
+ ui::Widget m_btn_left = ui::Button();
+ ui::Widget m_btn_right = ui::Button();
ui::Widget m_arrow_left = ui::Widget(gtk_arrow_new( GTK_ARROW_LEFT, GTK_SHADOW_OUT ));
ui::Widget m_arrow_right = ui::Widget(gtk_arrow_new( GTK_ARROW_RIGHT, GTK_SHADOW_OUT ));
gtk_container_add( GTK_CONTAINER( m_btn_left ), m_arrow_left );