namespace callbacks {
-void OnDestroy( GtkWidget* w, gpointer data ){
+void OnDestroy( ui::Widget w, gpointer data ){
DestroyWindow();
}
-void OnExportClicked( GtkButton* button, gpointer user_data ){
- ui::Widget window = lookup_widget( GTK_WIDGET( button ), "w_plugplug2" );
+void OnExportClicked( ui::Button button, gpointer user_data ){
+ ui::Widget window = lookup_widget( button , "w_plugplug2" );
ASSERT_TRUE( window );
const char* cpath = GlobalRadiant().m_pfnFileDialog( window, false, "Save as Obj", 0, 0, false, false, true );
if ( !cpath ) {
// get ignore list from ui
std::set<std::string> ignore;
- GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) );
+ GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( button , "t_materialist" ) );
ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( view ) ));
GtkTreeIter iter;
// collapse mode
collapsemode mode = COLLAPSE_NONE;
- GtkWidget* radio = lookup_widget( GTK_WIDGET( button ), "r_collapse" );
+ GtkWidget* radio = lookup_widget( button , "r_collapse" );
ASSERT_NOTNULL( radio );
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio ) ) ) {
}
else
{
- radio = lookup_widget( GTK_WIDGET( button ), "r_collapsebymaterial" );
+ radio = lookup_widget( button , "r_collapsebymaterial" );
ASSERT_NOTNULL( radio );
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio ) ) ) {
mode = COLLAPSE_BY_MATERIAL;
}
else
{
- radio = lookup_widget( GTK_WIDGET( button ), "r_nocollapse" );
+ radio = lookup_widget( button , "r_nocollapse" );
ASSERT_NOTNULL( radio );
ASSERT_TRUE( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio ) ) );
mode = COLLAPSE_NONE;
}
// export materials?
- GtkWidget* toggle = lookup_widget( GTK_WIDGET( button ), "t_exportmaterials" );
+ GtkWidget* toggle = lookup_widget( button , "t_exportmaterials" );
ASSERT_NOTNULL( toggle );
bool exportmat = FALSE;
}
// limit material names?
- toggle = lookup_widget( GTK_WIDGET( button ), "t_limitmatnames" );
+ toggle = lookup_widget( button , "t_limitmatnames" );
ASSERT_NOTNULL( toggle );
bool limitMatNames = FALSE;
}
// create objects instead of groups?
- toggle = lookup_widget( GTK_WIDGET( button ), "t_objects" );
+ toggle = lookup_widget( button , "t_objects" );
ASSERT_NOTNULL( toggle );
bool objects = FALSE;
ExportSelection( ignore, mode, exportmat, path, limitMatNames, objects );
}
-void OnAddMaterial( GtkButton* button, gpointer user_data ){
- GtkEntry* edit = GTK_ENTRY( lookup_widget( GTK_WIDGET( button ), "ed_materialname" ) );
+void OnAddMaterial( ui::Button button, gpointer user_data ){
+ GtkEntry* edit = GTK_ENTRY( lookup_widget( button , "ed_materialname" ) );
ASSERT_NOTNULL( edit );
const gchar* name = gtk_entry_get_text( edit );
if ( g_utf8_strlen( name, -1 ) > 0 ) {
- ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) ) ) ));
+ ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( GTK_TREE_VIEW( lookup_widget( button , "t_materialist" ) ) ) ));
list.append(0, name);
gtk_entry_set_text( edit, "" );
}
}
-void OnRemoveMaterial( GtkButton* button, gpointer user_data ){
- GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) );
+void OnRemoveMaterial( ui::Button button, gpointer user_data ){
+ GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( button , "t_materialist" ) );
ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( view ) ));
GtkTreeSelection* sel = gtk_tree_view_get_selection( view );
}
}
-void OnExportMatClicked( GtkButton* button, gpointer user_data ){
- GtkWidget* toggleLimit = lookup_widget( GTK_WIDGET( button ), "t_limitmatnames" );
- GtkWidget* toggleObject = lookup_widget( GTK_WIDGET( button ), "t_objects" );
+void OnExportMatClicked( ui::Button button, gpointer user_data ){
+ GtkWidget* toggleLimit = lookup_widget( button , "t_limitmatnames" );
+ GtkWidget* toggleObject = lookup_widget( button , "t_objects" );
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( button ) ) ) {
- gtk_widget_set_sensitive( GTK_WIDGET( toggleLimit ), TRUE );
- gtk_widget_set_sensitive( GTK_WIDGET( toggleObject ), TRUE );
+ gtk_widget_set_sensitive( toggleLimit , TRUE );
+ gtk_widget_set_sensitive( toggleObject , TRUE );
}
else {
- gtk_widget_set_sensitive( GTK_WIDGET( toggleLimit ), FALSE );
- gtk_widget_set_sensitive( GTK_WIDGET( toggleObject ), FALSE );
+ gtk_widget_set_sensitive( toggleLimit , FALSE );
+ gtk_widget_set_sensitive( toggleObject , FALSE );
}
}
+#include <uilib/uilib.h>
+
namespace callbacks {
-void OnDestroy( GtkWidget *, gpointer );
-void OnExportClicked( GtkButton *, gpointer );
-void OnAddMaterial( GtkButton *, gpointer );
-void OnRemoveMaterial( GtkButton *, gpointer );
-void OnExportMatClicked( GtkButton * button, gpointer );
+void OnDestroy( ui::Widget, gpointer );
+void OnExportClicked( ui::Button, gpointer );
+void OnAddMaterial( ui::Button, gpointer );
+void OnRemoveMaterial( ui::Button, gpointer );
+void OnExportMatClicked( ui::Button button, gpointer );
} // callbacks
// Select the last item in the listbox
li = g_list_last( GTK_LIST( GTK_COMBO( g_pPathListCombo )->list )->children );
- gtk_list_select_child( GTK_LIST( GTK_COMBO( g_pPathListCombo )->list ), GTK_WIDGET( li->data ) );
+ gtk_list_select_child( GTK_LIST( GTK_COMBO( g_pPathListCombo )->list ), li->data );
// If this was the first one, refresh the event list
if ( GetCurrentCam()->GetCam()->numTargets() == 1 ) {
combo_cam = firstCam;
while ( li && combo_cam ) {
if ( combo_cam == GetCurrentCam() ) {
- gtk_list_select_child( GTK_LIST( GTK_COMBO( g_pCamListCombo )->list ), GTK_WIDGET( li->data ) );
+ gtk_list_select_child( GTK_LIST( GTK_COMBO( g_pCamListCombo )->list ), li->data );
break;
}
li = li->next;
if ( g_pWnd ) {
gtk_entry_set_text( GTK_ENTRY( g_object_get_data( G_OBJECT( g_pWnd ), "bmp_file" ) ), gbmp.name );
- gtk_widget_set_sensitive( GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "bmp_reload" ) ),
+ gtk_widget_set_sensitive( g_object_get_data( G_OBJECT( g_pWnd , "bmp_reload" ) ),
strlen( gbmp.name ) ? TRUE : FALSE );
UpdatePreview( true );
//#define BUFF_SIZE 32768
#define ENABLE_WIDGET( name,enable ) \
- gtk_widget_set_sensitive( GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), ( name ) ) ), ( enable ) )
+ gtk_widget_set_sensitive( g_object_get_data( G_OBJECT( g_pWnd , ( name ) ) ), ( enable ) )
#define CHECK_WIDGET( name,check ) \
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( g_object_get_data( G_OBJECT( g_pWnd ), name ) ), check )
case EXTENTS_TAB:
if ( Game != QUAKE3 ) {
- gtk_widget_hide( GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "use_patches" ) ) );
+ gtk_widget_hide( g_object_get_data( G_OBJECT( g_pWnd , "use_patches" ) ) );
ENABLE_WIDGET( "use_patches", FALSE );
}
else
{
- gtk_widget_show( GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "use_patches" ) ) );
+ gtk_widget_show( g_object_get_data( G_OBJECT( g_pWnd , "use_patches" ) ) );
ENABLE_WIDGET( "use_patches", TRUE );
}
Decimate );
if ( Game == QUAKE3 && UsePatches ) {
- gtk_widget_set_sensitive( GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "decimate" ) ), FALSE );
+ gtk_widget_set_sensitive( g_object_get_data( G_OBJECT( g_pWnd , "decimate" ) ), FALSE );
if ( NH % 2 ) {
NH++;
}
else
{
- gtk_widget_set_sensitive( GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "decimate" ) ), TRUE );
+ gtk_widget_set_sensitive( g_object_get_data( G_OBJECT( g_pWnd , "decimate" ) ), TRUE );
gpointer spin = g_object_get_data( G_OBJECT( g_pWnd ), "nh" );
GtkAdjustment *adj = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) );
}
static void main_go( GtkWidget *widget, gpointer data ){
- GtkWidget *notebook = GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "notebook" ) );
+ GtkWidget *notebook = g_object_get_data( G_OBJECT( g_pWnd , "notebook" ) );
char Text[256];
ReadDlgValues( current_tab );
// Main
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "go" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "go" ) ),
"Accept all input and generate a surface in Q3Radiant",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "open" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "open" ) ),
"Open a previously saved GenSurf settings file.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "save" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "save" ) ),
"Save all settings to a file.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "defaults" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "defaults" ) ),
"Restore default values from DEFAULTS.SRF. If this file does not exist, GenSurf "
"initializes all input parameters to reasonable values. You can create your own "
"default surface by setting all parameters to your liking, then saving a settings "
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "main_preview" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "main_preview" ) ),
"View a wire-frame representation of the surface",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "main_antialiasing" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "main_antialiasing" ) ),
"The lines in the preview window are antialiased for better quality",
"" );
// General tab
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( wave_radios[0] ),
+ wave_radios[0] ,
"Builds a surface with alternating hills and valleys. Uses the general form Z=cos(X) "
"x sin(Y)",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( wave_radios[1] ),
+ wave_radios[1] ,
"Builds a surface with ridges parallel to the vertical axis.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( wave_radios[2] ),
+ wave_radios[2] ,
"Builds a surface with ridges parallel to the horizontal axis.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( wave_radios[3] ),
+ wave_radios[3] ,
"Builds a map from a bitmap image representing a contour plot. Click the \"Bitmap\" "
"tab to select the image. GenSurf only supports 256-color (8 bit) "
"bitmaps. GenSurf will work with any 256-color bitmap, but gray scale bitmaps are a bit "
"more intuitive.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( wave_radios[4] ),
+ wave_radios[4] ,
"Builds a random surface using the Plasma Cloud technique. Variance is controlled "
"by the Roughness input. To build a surface with completely random values not "
"dependent on neighboring vertices, use one of the other waveforms with 0 amplitude.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "wavelength" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "wavelength" ) ),
"Enter the wavelength (distance between crests). NOTE: Wavelengths equal to the grid "
"size or 2 times the grid size will result in 0 amplitudes. For best results, the "
"wavelength value should be at least 4 times the grid size (extents divided by the "
"number of divisions",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "amplitude" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "amplitude" ) ),
"Enter the height of hills/ridges.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "roughness" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "roughness" ) ),
"Enter the roughness value (noise) for the surface. For fractal surfaces, this value "
"is used as a variance in the fractal calculations.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "random" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "random" ) ),
"Seed value for the pseudo-random number generator.",
"" );
// Extents tab
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "hmin" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "hmin" ) ),
"Minimum horizontal coordinate of the surface, i.e. X for a surface parallel to "
"the XY or XZ planes, Y for a surface parallel to the YZ plane. For best results, "
"the extents (maximum-minimum values) in a given direction should be evenly "
"divisible by the number of divisions in that direction.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "hmax" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "hmax" ) ),
"Maximum horizontal coordinate of the surface, i.e. X for a surface parallel to "
"the XY or XZ planes, Y for a surface parallel to the YZ plane. For best results, "
"the extents (maximum-minimum values) in a given direction should be evenly "
"divisible by the number of divisions in that direction.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "vmin" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "vmin" ) ),
"Minimum vertical coordinate of the surface, i.e. Y for a surface parallel to "
"the XY plane, Z for a surface parallel to the XZ or YZ planes. For best results, "
"the extents (maximum-minimum values) in a given direction should be evenly "
"divisible by the number of divisions in that direction.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "vmax" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "vmax" ) ),
"Maximum vertical coordinate of the surface, i.e. Y for a surface parallel to "
"the XY plane, Z for a surface parallel to the XZ or YZ planes. For best results, "
"the extents (maximum-minimum values) in a given direction should be evenly "
"divisible by the number of divisions in that direction.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "nh" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "nh" ) ),
"Number of divisions in the horizontal direction. For best results, the extents "
"in a given direction should be evenly divisible by the number of divisions in "
"that direction.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "nv" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "nv" ) ),
"Number of divisions in the vertical direction. For best results, the extents "
"in a given direction should be evenly divisible by the number of divisions in "
"that direction.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "use_patches" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "use_patches" ) ),
"Produce one or more curved patches in the shape of your selected surface rather "
"than producing solid brushes. Depending on the size of your surface (and the "
"user's graphic detail settings, which you cannot control), curved surfaces will "
"concerning curved surfaces on the GenSurf web page before using this feature.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "decimate" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "decimate" ) ),
"Use the slider to control the number of vertices discarded by GenSurf. For many "
"surfaces, you can produce roughly the same shape surface with a high decimation "
"value. This will generally result in a map with lower polygon counts (and better "
"surfaces in Q3",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "z00" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "z00" ) ),
"Enter the height of the surface at the lower left corner. This value will likely "
"be modified unless \"Linear Borders\" is checked.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "z01" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "z01" ) ),
"Enter the height of the surface at the upper left corner. This value will likely "
"be modified unless \"Linear Borders\" is checked.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "z10" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "z10" ) ),
"Enter the height of the surface at the lower right corner. This value will likely "
"be modified unless \"Linear Borders\" is checked.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "z11" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "z11" ) ),
"Enter the height of the surface at the upper right corner. This value will likely "
"be modified unless \"Linear Borders\" is checked.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "linearborder" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "linearborder" ) ),
"Restrict the edges of the surface to a straight line. This will help match up "
"brush edges if you drop this surface into another map.",
"" );
// Bitmap tab
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "bmp_file" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "bmp_file" ) ),
"Type the name of an 8-bit bitmap image file, or click Browse to select an image "
"from a list of those available on your system.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "bmp_file_browse" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "bmp_file_browse" ) ),
"Select a bitmap image file from a list of those available on your system.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "bmp_reload" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "bmp_reload" ) ),
"Reload the selected bitmap file after making changes in an external image editor.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "bmp_black" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "bmp_black" ) ),
"Enter the value corresponding to color index 0 in the bitmap file. For gray scale "
"images, color 0 is normally black.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "bmp_white" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "bmp_white" ) ),
"Enter the value corresponding to color index 255 in the bitmap file. For gray scale "
"images, color 255 is normally white.",
"" );
// Fixpoints tab
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "fix_value" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "fix_value" ) ),
"Enter a value for the selected vertex. This value will not be adjusted when applying "
"a waveform or roughness to the surface. Unlock this vertex (so that it will be "
"adjusted normally) by clicking \"Free\". This vertex will influence vertices within "
"the \"Range affected\" of this vertex.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "fix_range" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "fix_range" ) ),
"Enter the range away from the selected vertex that other vertices will be affected. "
"Use 0 if you don't want other vertices to be influenced by the currently selected "
"one. Note: this box is disabled if you've chosen the fractal generator, as it uses "
"a completely different method for determining values.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "fix_rate" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "fix_rate" ) ),
"Enter a rate of change for the surface affected by the fixed value. 0 gives a smooth "
"sinusoidal curve, values less than 0 give progressively sharper spikes, and values "
"greater than 0 take on a square shape. Values less than -30 or greater than 30 are "
"you also specify a \"range affected\".",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "fix_free" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "fix_free" ) ),
"Click this to free (unlock the value of) the currently selected vertex.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "fix_freeall" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "fix_freeall" ) ),
"Click this to free (unlock the values of) all vertices.",
"" );
// Texture tab
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "texture1" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "texture1" ) ),
"Enter the name of the texture or shader used for the surface faces.",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "texture2" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "texture2" ) ),
"Enter the name of the texture or shader used for faces other than the surface. Under "
"normal circumstances this should be \"common/caulk\"",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "texture3" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "texture3" ) ),
"Enter the name of the texture or shader used for \"steep\" surface faces, where \"steep\" "
"is the angle specified below. If this entry is left blank or if the \"steep\" angle is 0, "
"all surface faces will use the texture specified by \"Surface\".",
"" );
gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
- GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "detail" ) ),
+ g_object_get_data( G_OBJECT( g_pWnd , "detail" ) ),
"Check this box to use the detail content property on the generated brushes. Compile "
"times will be considerably shorter if the detail property is used, though the surface "
"will not block visibility at all. If you use the detail property, you should make sure "
static void OnScroll2d( GtkAdjustment *adj, gpointer data ){
portals.width_2d = static_cast<float>( gtk_adjustment_get_value(adj) );
- Set2DText( GTK_WIDGET( data ) );
+ Set2DText( ui::Widget::from(data) );
Portals_shadersChanged();
SceneChangeNotify();
static void OnScroll3d( GtkAdjustment *adj, gpointer data ){
portals.width_3d = static_cast<float>( gtk_adjustment_get_value(adj) );
- Set3DText( GTK_WIDGET( data ) );
+ Set3DText( ui::Widget::from( data ) );
SceneChangeNotify();
}
static void OnScrollTrans( GtkAdjustment *adj, gpointer data ){
portals.trans_3d = static_cast<float>( gtk_adjustment_get_value(adj) );
- Set3DTransText( GTK_WIDGET( data ) );
+ Set3DTransText( ui::Widget::from( data ) );
SceneChangeNotify();
}
static void OnScrollClip( GtkAdjustment *adj, gpointer data ){
portals.clip_range = static_cast<float>( gtk_adjustment_get_value(adj) );
- SetClipText( GTK_WIDGET( data ) );
+ SetClipText( ui::Widget::from( data ) );
SceneChangeNotify();
}
gtk_combo_box_text_append_text(zlist, "Z-Buffer Test Only (recommended for transparent polygons)");
gtk_combo_box_text_append_text(zlist, "Z-Buffer Off");
- zlist.connect("changed", G_CALLBACK(+[](GtkComboBox *self, void *) {
- OnSelchangeZbuffer(GTK_WIDGET(self), GINT_TO_POINTER(gtk_combo_box_get_active(self)));
+ zlist.connect("changed", G_CALLBACK(+[](ui::ComboBox self, void *) {
+ OnSelchangeZbuffer(self, GINT_TO_POINTER(gtk_combo_box_get_active(self)));
}), nullptr);
table = ui::Table( 2, 2, FALSE );
{
ui::Window toplevel = *i;
ASSERT_MESSAGE( window_has_accel( toplevel ), "ERROR" );
- ASSERT_MESSAGE( gtk_widget_is_toplevel( GTK_WIDGET(toplevel) ), "disabling accel for non-toplevel window" );
+ ASSERT_MESSAGE( gtk_widget_is_toplevel( toplevel ), "disabling accel for non-toplevel window" );
gtk_window_remove_accel_group( toplevel, global_accel );
#if 0
globalOutputStream() << reinterpret_cast<unsigned int>( toplevel ) << ": disabled global accelerators\n";
{
ui::Window toplevel = *i;
ASSERT_MESSAGE( !window_has_accel( toplevel ), "ERROR" );
- ASSERT_MESSAGE( gtk_widget_is_toplevel( GTK_WIDGET(toplevel) ), "enabling accel for non-toplevel window" );
+ ASSERT_MESSAGE( gtk_widget_is_toplevel( toplevel ), "enabling accel for non-toplevel window" );
toplevel.add_accel_group( global_accel );
#if 0
globalOutputStream() << reinterpret_cast<unsigned int>( toplevel ) << ": enabled global accelerators\n";
GdkCursor* cursor = create_blank_cursor();
//GdkGrabStatus status =
- gdk_pointer_grab( gtk_widget_get_window(GTK_WIDGET(window)), TRUE, mask, 0, cursor, GDK_CURRENT_TIME );
+ gdk_pointer_grab( gtk_widget_get_window(window), TRUE, mask, 0, cursor, GDK_CURRENT_TIME );
gdk_cursor_unref( cursor );
Sys_GetCursorPos( window, &recorded_x, &recorded_y );
ui::Button create_dialog_button( const char* label, GCallback func, gpointer data ){
auto button = ui::Button( label );
- gtk_widget_set_size_request( GTK_WIDGET( button ), 64, -1 );
+ gtk_widget_set_size_request( button , 64, -1 );
button.show();
button.connect( "clicked", func, data );
return button;
}
EMessageBoxReturn modal_dialog_show( ui::Window window, ModalDialog& dialog ){
- gtk_grab_add( GTK_WIDGET( window ) );
+ gtk_grab_add( window );
window.show();
dialog.loop = true;
}
window.hide();
- gtk_grab_remove( GTK_WIDGET( window ) );
+ gtk_grab_remove( window );
return dialog.ret;
}
window_remove_minmax( window );
- //gtk_widget_set_size_request(GTK_WIDGET(window), width, height);
+ //gtk_widget_set_size_request(window, width, height);
//gtk_window_set_default_size(window, width, height);
//gtk_window_resize(window, width, height);
//GdkGeometry geometry = { width, height, -1, -1, width, height, -1, -1, -1, -1, GDK_GRAVITY_STATIC, };
- //gtk_window_set_geometry_hints(window, GTK_WIDGET(window), &geometry, (GdkWindowHints)(GDK_HINT_POS|GDK_HINT_MIN_SIZE|GDK_HINT_BASE_SIZE));
+ //gtk_window_set_geometry_hints(window, window, &geometry, (GdkWindowHints)(GDK_HINT_POS|GDK_HINT_MIN_SIZE|GDK_HINT_BASE_SIZE));
return window;
}
gtk_table_set_col_spacings( table, 4 );
gtk_table_set_row_spacings( table, 0 );
- gtk_table_attach( table, GTK_WIDGET( DialogLabel_new( name ) ), 0, 1, 0, 1,
+ gtk_table_attach( table, DialogLabel_new( name ), 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
ui::MenuItem menu_separator( ui::Menu menu ){
auto menu_item = ui::MenuItem(GTK_MENU_ITEM( gtk_menu_item_new() ));
menu.add(menu_item);
- gtk_widget_set_sensitive( GTK_WIDGET( menu_item ), FALSE );
+ gtk_widget_set_sensitive( menu_item , FALSE );
menu_item.show();
return menu_item;
}
ui::TearoffMenuItem menu_tearoff( ui::Menu menu ){
auto menu_item = ui::TearoffMenuItem(GTK_TEAROFF_MENU_ITEM( gtk_tearoff_menu_item_new() ));
menu.add(menu_item);
-// gtk_widget_set_sensitive(GTK_WIDGET(menu_item), FALSE); -- controls whether menu is detachable
+// gtk_widget_set_sensitive(menu_item, FALSE); -- controls whether menu is detachable
menu_item.show();
return menu_item;
}
if ( type == eMB_OK ) {
auto button = create_modal_dialog_button( "OK", ok_button );
hbox.pack_start( button, TRUE, FALSE, 0 );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
widget_make_default( button );
button.show();
{
auto button = create_modal_dialog_button( "OK", ok_button );
hbox.pack_start( button, TRUE, FALSE, 0 );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
widget_make_default( button );
button.show();
}
{
auto button = create_modal_dialog_button( "OK", cancel_button );
hbox.pack_start( button, TRUE, FALSE, 0 );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
button.show();
}
gboolean escape_clear_focus_widget(ui::Widget widget, GdkEventKey *event, gpointer data)
{
if (event->keyval == GDK_KEY_Escape) {
- gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(widget))), NULL);
+ gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(widget)), NULL);
return TRUE;
}
return FALSE;
gboolean NonModalEntry::focus_out(ui::Entry entry, GdkEventFocus *event, NonModalEntry *self)
{
- if (self->m_editing && gtk_widget_get_visible(GTK_WIDGET(entry))) {
+ if (self->m_editing && gtk_widget_get_visible(entry)) {
self->m_apply();
}
self->m_editing = false;
if (event->keyval == GDK_KEY_Return) {
self->m_apply();
self->m_editing = false;
- gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(entry))), NULL);
+ gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(entry)), NULL);
return TRUE;
}
return FALSE;
if (event->keyval == GDK_KEY_Escape) {
self->m_cancel();
self->m_editing = false;
- gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(entry))), NULL);
+ gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(entry)), NULL);
return TRUE;
}
return FALSE;
gboolean NonModalSpinner::enter(ui::SpinButton spin, GdkEventKey *event, NonModalSpinner *self)
{
if (event->keyval == GDK_KEY_Return) {
- gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(spin))), NULL);
+ gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(spin)), NULL);
return TRUE;
}
return FALSE;
{
if (event->keyval == GDK_KEY_Escape) {
self->m_cancel();
- gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(spin))), NULL);
+ gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(spin)), NULL);
return TRUE;
}
return FALSE;
{
auto vsplit = ui::VPaned(ui::New);
- gtk_paned_add1( GTK_PANED( hsplit ), GTK_WIDGET( vsplit ) );
+ gtk_paned_add1( GTK_PANED( hsplit ), vsplit );
vsplit.show();
vsplit.connect( "size_allocate", G_CALLBACK( vpaned_allocate ), &g_vpaned1 );
vsplit.connect( "notify::position", G_CALLBACK( paned_position ), &g_vpaned1 );
- gtk_paned_add1( GTK_PANED( vsplit ), GTK_WIDGET( create_framed_widget( topleft ) ) );
- gtk_paned_add2( GTK_PANED( vsplit ), GTK_WIDGET( create_framed_widget( topright ) ) );
+ gtk_paned_add1( GTK_PANED( vsplit ), create_framed_widget( topleft ) );
+ gtk_paned_add2( GTK_PANED( vsplit ), create_framed_widget( topright ) );
}
{
auto vsplit = ui::VPaned(ui::New);
- gtk_paned_add2( GTK_PANED( hsplit ), GTK_WIDGET( vsplit ) );
+ gtk_paned_add2( GTK_PANED( hsplit ), vsplit );
vsplit.show();
vsplit.connect( "size_allocate", G_CALLBACK( vpaned_allocate ), &g_vpaned2 );
vsplit.connect( "notify::position", G_CALLBACK( paned_position ), &g_vpaned2 );
- gtk_paned_add1( GTK_PANED( vsplit ), GTK_WIDGET( create_framed_widget( botleft ) ) );
- gtk_paned_add2( GTK_PANED( vsplit ), GTK_WIDGET( create_framed_widget( botright ) ) );
+ gtk_paned_add1( GTK_PANED( vsplit ), create_framed_widget( botleft ) );
+ gtk_paned_add2( GTK_PANED( vsplit ), create_framed_widget( botright ) );
}
return hsplit;
}
void toolbar_append( ui::Toolbar toolbar, ui::ToolItem button, const char* description ){
- gtk_widget_show_all(GTK_WIDGET(button));
- gtk_widget_set_tooltip_text(GTK_WIDGET(button), description);
+ gtk_widget_show_all(button);
+ gtk_widget_set_tooltip_text(button, description);
toolbar.add(button);
}
ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback& callback ){
- auto button = ui::ToolButton(GTK_TOOL_BUTTON(gtk_tool_button_new(GTK_WIDGET(new_local_image(icon)), nullptr)));
+ auto button = ui::ToolButton(GTK_TOOL_BUTTON(gtk_tool_button_new(new_local_image(icon), nullptr)));
button_connect_callback(button, callback);
toolbar_append(toolbar, button, description);
return button;
ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback& callback ){
auto button = ui::ToggleToolButton(GTK_TOGGLE_TOOL_BUTTON(gtk_toggle_tool_button_new()));
toggle_button_connect_callback(button, callback);
- gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(button), GTK_WIDGET(new_local_image(icon)));
+ gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(button), new_local_image(icon));
gtk_tool_button_set_label(GTK_TOOL_BUTTON(button), description);
toolbar_append(toolbar, button, description);
return button;
static gboolean main_window_iconified( ui::Widget widget, GdkEventWindowState* event, gpointer data ){
if ( ( event->changed_mask & ( GDK_WINDOW_STATE_ICONIFIED | GDK_WINDOW_STATE_WITHDRAWN ) ) != 0 ) {
if ( ( event->new_window_state & ( GDK_WINDOW_STATE_ICONIFIED | GDK_WINDOW_STATE_WITHDRAWN ) ) != 0 ) {
- CHECK_MINIMIZE( ui::Widget(GTK_WIDGET( data )) );
+ CHECK_MINIMIZE( ui::Widget::from( data ) );
}
else
{
- CHECK_RESTORE( ui::Widget(GTK_WIDGET( data )) );
+ CHECK_RESTORE( ui::Widget::from( data ) );
}
}
return FALSE;
ui::Window create_persistent_floating_window( const char* title, ui::Window main_window ){
ui::Window window = ui::Window(GTK_WINDOW( create_floating_window( title, main_window ) ));
- gtk_widget_set_events( GTK_WIDGET( window ), GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK );
+ gtk_widget_set_events( window , GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK );
connect_floating_window_delete_present( window, main_window );
window.connect( "delete_event", G_CALLBACK( persistent_floating_window_delete ), 0 );
void unref()
{ g_object_unref(_handle); }
+ void ref()
+ { g_object_ref(_handle); }
+
template<class Lambda>
gulong connect(char const *detailed_signal, Lambda &&c_handler, void *data);
window.add(table1);
{
auto vbox = create_dialog_vbox( 4 );
- gtk_table_attach( table1, GTK_WIDGET( vbox ), 1, 2, 0, 1,
+ gtk_table_attach( table1, vbox , 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
{
}
{
auto frame = create_dialog_frame( "Build menu" );
- gtk_table_attach( table1, GTK_WIDGET( frame ), 0, 1, 0, 1,
+ gtk_table_attach( table1, frame , 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
{
}
{
auto frame = create_dialog_frame( "Commandline" );
- gtk_table_attach( table1, GTK_WIDGET( frame ), 0, 1, 1, 2,
+ gtk_table_attach( table1, frame , 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
{
void Build_refreshMenu( ui::Menu menu ){
- for ( BuildMenuItems::iterator i = g_BuildMenuItems.begin(); i != g_BuildMenuItems.end(); ++i )
+ for (auto i = g_BuildMenuItems.begin(); i != g_BuildMenuItems.end(); ++i )
{
- menu.remove(ui::Widget(GTK_WIDGET((*i).m_item)));
+ menu.remove(ui::MenuItem(i->m_item));
}
g_BuildMenuItems.clear();
}
ModalDialogButton m_close_button;
- GtkTreeView *m_list;
+ ui::TreeView m_list;
GtkTreeIter m_command_iter;
GtkTreeModel *m_model;
bool m_waiting_for_key;
// just unhighlight, user wanted to cancel
dialog.m_waiting_for_key = false;
gtk_list_store_set( GTK_LIST_STORE( dialog.m_model ), &dialog.m_command_iter, 2, false, -1 );
- gtk_widget_set_sensitive( GTK_WIDGET( dialog.m_list ), true );
+ gtk_widget_set_sensitive( dialog.m_list , true );
dialog.m_model = NULL;
return;
}
dialog.m_model = model;
// 2. disallow changing the row
- //gtk_widget_set_sensitive(GTK_WIDGET(dialog.m_list), false);
+ //gtk_widget_set_sensitive(dialog.m_list, false);
// 3. highlight the row
gtk_list_store_set( GTK_LIST_STORE( model ), &iter, 2, true, -1 );
Shortcuts::iterator thisShortcutIterator = g_shortcuts.find( commandName );
if ( thisShortcutIterator == g_shortcuts.end() ) {
gtk_list_store_set( GTK_LIST_STORE( dialog.m_model ), &dialog.m_command_iter, 2, false, -1 );
- gtk_widget_set_sensitive( GTK_WIDGET( dialog.m_list ), true );
+ gtk_widget_set_sensitive( dialog.m_list , true );
return true;
}
GlobalShortcuts_foreach( verify_visitor );
gtk_list_store_set( GTK_LIST_STORE( dialog.m_model ), &dialog.m_command_iter, 2, false, -1 );
- gtk_widget_set_sensitive( GTK_WIDGET( dialog.m_list ), true );
+ gtk_widget_set_sensitive( dialog.m_list , true );
if ( verify_visitor.allow ) {
// clear the ACTUAL accelerator first
{
ui::ListStore store = ui::ListStore(gtk_list_store_new( 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INT ));
- ui::Widget view = ui::TreeView(ui::TreeModel(GTK_TREE_MODEL(store)));
- dialog.m_list = GTK_TREE_VIEW( view );
+ auto view = ui::TreeView(ui::TreeModel(GTK_TREE_MODEL(store)));
+ dialog.m_list = view;
gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), false ); // annoying
auto button = create_modal_dialog_button( "Close", dialog.m_close_button );
vbox.pack_start( button, FALSE, FALSE, 0 );
widget_make_default( button );
- gtk_widget_grab_default( GTK_WIDGET( button ) );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_grab_default( button );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
}
modal_dialog_show( window, dialog );
ui::Entry DialogEntry_new(){
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 64, -1 );
+ gtk_widget_set_size_request( entry , 64, -1 );
return entry;
}
auto entry = DialogEntry_new();
alignment.add(entry);
- return DialogEntryRow( ui::Widget(GTK_WIDGET( DialogRow_new( name, alignment ) )), entry );
+ return DialogEntryRow( ui::Widget(DialogRow_new( name, alignment )), entry );
}
}
auto spin = ui::SpinButton( ui::Adjustment( value, lower, upper, step, 10, 0 ), step, digits );
spin.show();
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 64, -1 );
+ gtk_widget_set_size_request( spin , 64, -1 );
return spin;
}
auto spin = DialogSpinner_new( value, lower, upper, fraction );
alignment.add(spin);
- return DialogSpinnerRow( ui::Widget(GTK_WIDGET( DialogRow_new( name, alignment ) )), spin );
+ return DialogSpinnerRow( ui::Widget(DialogRow_new( name, alignment )), spin );
}
check.show();
AddBoolToggleData( *GTK_TOGGLE_BUTTON( check ), importViewer, exportViewer );
- DialogVBox_packRow( ui::VBox(GTK_VBOX( vbox )), ui::Widget(GTK_WIDGET( DialogRow_new( name, check ) ) ));
+ DialogVBox_packRow( ui::VBox(GTK_VBOX( vbox )), ui::Widget(DialogRow_new( name, check ) ));
return check;
}
if ( draw_value == FALSE ) {
auto hbox2 = ui::HBox( FALSE, 0 );
hbox2.show();
- vbox.pack_start( GTK_WIDGET( hbox2 ), FALSE, FALSE, 0 );
+ vbox.pack_start( hbox2 , FALSE, FALSE, 0 );
{
ui::Widget label = ui::Label( low );
label.show();
guint pos = static_cast<guint>( icon - icons.first );
auto image = new_local_image( *icon );
image.show();
- gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( image ), pos, pos + 1, 0, 1,
+ gtk_table_attach( GTK_TABLE( table ), image , pos, pos + 1, 0, 1,
(GtkAttachOptions) ( 0 ),
(GtkAttachOptions) ( 0 ), 0, 0 );
AddTextEntryData( *GTK_ENTRY(pathEntry.m_entry), importViewer, exportViewer );
- auto row = DialogRow_new( name, ui::Widget(GTK_WIDGET( pathEntry.m_frame )) );
+ auto row = DialogRow_new( name, ui::Widget(pathEntry.m_frame ) );
DialogVBox_packRow( ui::VBox(GTK_VBOX( vbox )), row );
- return ui::Widget(GTK_WIDGET( row ));
+ return ui::Widget(row );
}
ui::Widget Dialog::addPathEntry( ui::Widget vbox, const char* name, CopiedString& data, bool browse_directory ){
void Entity_createFromSelection( const char* name, const Vector3& origin ){
#if 0
if ( string_equal_nocase( name, "worldspawn" ) ) {
- ui::alert( GTK_WIDGET( MainFrame_getWindow() ), "Can't create an entity with worldspawn.", "info" );
+ ui::alert( MainFrame_getWindow( ), "Can't create an entity with worldspawn.", "info" );
return;
}
#endif
#if 0
bool DoNormalisedColor( Vector3& color ){
- if ( !color_dialog( GTK_WIDGET( MainFrame_getWindow() ), color ) ) {
+ if ( !color_dialog( MainFrame_getWindow( ), color ) ) {
return false;
}
/*
}
typedef MemberCaller<ModelAttribute, &ModelAttribute::update> UpdateCaller;
void browse( const BrowsedPathEntry::SetPathCallback& setPath ){
- const char *filename = misc_model_dialog( ui::Widget(gtk_widget_get_toplevel( GTK_WIDGET( m_entry.m_entry.m_frame ) ) ));
+ const char *filename = misc_model_dialog( ui::Widget(gtk_widget_get_toplevel( m_entry.m_entry.m_frame ) ));
if ( filename != 0 ) {
setPath( filename );
delete this;
}
ui::Widget getWidget() const {
- return ui::Widget(GTK_WIDGET( m_entry.m_entry.m_frame ));
+ return ui::Widget(m_entry.m_entry.m_frame );
}
void apply(){
StringOutputStream value( 64 );
}
typedef MemberCaller<SoundAttribute, &SoundAttribute::update> UpdateCaller;
void browse( const BrowsedPathEntry::SetPathCallback& setPath ){
- const char *filename = browse_sound( ui::Widget(gtk_widget_get_toplevel( GTK_WIDGET( m_entry.m_entry.m_frame ) )) );
+ const char *filename = browse_sound( ui::Widget(gtk_widget_get_toplevel( m_entry.m_entry.m_frame )) );
if ( filename != 0 ) {
setPath( filename );
delete this;
}
ui::Widget getWidget() const {
- return ui::Widget(GTK_WIDGET( m_entry ));
+ return ui::Widget(m_entry );
}
void apply(){
StringOutputStream angle( 32 );
delete this;
}
ui::Widget getWidget() const {
- return ui::Widget(GTK_WIDGET( m_hbox ));
+ return ui::Widget(m_hbox );
}
void apply(){
StringOutputStream angle( 32 );
if ( !string_empty( value ) ) {
float f = float(atof( value ) );
if ( f == -1 ) {
- gtk_widget_set_sensitive( GTK_WIDGET( m_entry ), FALSE );
+ gtk_widget_set_sensitive( m_entry , FALSE );
radio_button_set_active_no_signal( m_radio.m_radio, 0 );
m_entry.text("");
}
else if ( f == -2 ) {
- gtk_widget_set_sensitive( GTK_WIDGET( m_entry ), FALSE );
+ gtk_widget_set_sensitive( m_entry , FALSE );
radio_button_set_active_no_signal( m_radio.m_radio, 1 );
m_entry.text("");
}
else
{
- gtk_widget_set_sensitive( GTK_WIDGET( m_entry ), TRUE );
+ gtk_widget_set_sensitive( m_entry , TRUE );
radio_button_set_active_no_signal( m_radio.m_radio, 2 );
StringOutputStream angle( 32 );
angle << angle_normalised( f );
delete this;
}
ui::Widget getWidget() const {
- return ui::Widget(GTK_WIDGET( m_hbox ));
+ return ui::Widget(m_hbox );
}
void apply(){
StringOutputStream angles( 64 );
delete this;
}
ui::Widget getWidget() const {
- return ui::Widget(GTK_WIDGET( m_hbox ));
+ return ui::Widget(m_hbox );
}
void apply(){
StringOutputStream vector3( 64 );
delete this;
}
ui::Widget getWidget() const {
- return ui::Widget(GTK_WIDGET( m_combo ));
+ return ui::Widget(m_combo );
}
void apply(){
Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), m_type[gtk_combo_box_get_active( m_combo )].second.c_str() );
{
for ( int i = 0; i < g_spawnflag_count; ++i )
{
- auto widget = ui::Widget(GTK_WIDGET(g_entitySpawnflagsCheck[i]));
+ auto widget = ui::CheckButton(g_entitySpawnflagsCheck[i]);
auto label = ui::Label(GTK_LABEL(gtk_bin_get_child(GTK_BIN(widget))));
label.text(" ");
widget.hide();
- g_object_ref( widget );
+ widget.ref();
ui::Container(GTK_CONTAINER(g_spawnflagsTable)).remove(widget);
}
}
{
for ( int i = 0; i < g_spawnflag_count; ++i )
{
- ui::Widget widget = ui::Widget(GTK_WIDGET( g_entitySpawnflagsCheck[i] ));
+ auto widget = ui::CheckButton(g_entitySpawnflagsCheck[i] );
widget.show();
StringOutputStream str( 16 );
char* text;
gtk_tree_model_get( model, &iter, 0, &text, -1 );
if ( strcmp( text, eclass->name() ) == 0 ) {
- GtkTreeView* view = g_entityClassList;
+ auto view = ui::TreeView(g_entityClassList);
GtkTreePath* path = gtk_tree_model_get_path( model, &iter );
gtk_tree_selection_select_path( gtk_tree_view_get_selection( view ), path );
- if ( gtk_widget_get_realized( GTK_WIDGET(view) ) ) {
+ if ( gtk_widget_get_realized( view ) ) {
gtk_tree_view_scroll_to_cell( view, path, 0, FALSE, 0, 0 );
}
gtk_tree_path_free( path );
GtkTreeModel* model;
GtkTreeIter iter;
if ( gtk_tree_selection_get_selected( gtk_tree_view_get_selection( view ), &model, &iter ) == FALSE ) {
- ui::Widget(gtk_widget_get_toplevel( GTK_WIDGET( g_entityClassList ) )).alert( "You must have a selected class to create an entity", "info" );
+ ui::Widget(gtk_widget_get_toplevel( ui::TreeView(g_entityClassList) )).alert( "You must have a selected class to create an entity", "info" );
return;
}
// TTimo: if you change the classname to worldspawn you won't merge back in the structural brushes but create a parasite entity
if ( !strcmp( key.c_str(), "classname" ) && !strcmp( value.c_str(), "worldspawn" ) ) {
- ui::Widget(gtk_widget_get_toplevel( GTK_WIDGET( g_entityKeyEntry )) ).alert( "Cannot change \"classname\" key back to worldspawn.", 0, ui::alert_type::OK );
+ ui::Widget(gtk_widget_get_toplevel( g_entityKeyEntry ) ).alert( "Cannot change \"classname\" key back to worldspawn.", 0, ui::alert_type::OK );
return;
}
// RR2DO2: we don't want spaces in entity keys
if ( strstr( key.c_str(), " " ) ) {
- ui::Widget(gtk_widget_get_toplevel( GTK_WIDGET( g_entityKeyEntry )) ).alert( "No spaces are allowed in entity keys.", 0, ui::alert_type::OK );
+ ui::Widget(gtk_widget_get_toplevel( g_entityKeyEntry ) ).alert( "No spaces are allowed in entity keys.", 0, ui::alert_type::OK );
return;
}
// select the entity that starts with the key pressed
if ( code <= 'Z' && code >= 'A' ) {
- GtkTreeView* view = g_entityClassList;
+ auto view = ui::TreeView(g_entityClassList);
GtkTreeModel* model;
GtkTreeIter iter;
if ( gtk_tree_selection_get_selected( gtk_tree_view_get_selection( view ), &model, &iter ) == FALSE
if ( toupper( text[0] ) == (int)code ) {
GtkTreePath* path = gtk_tree_model_get_path( model, &iter );
gtk_tree_selection_select_path( gtk_tree_view_get_selection( view ), path );
- if ( gtk_widget_get_realized( GTK_WIDGET(view) ) ) {
+ if ( gtk_widget_get_realized( view ) ) {
gtk_tree_view_scroll_to_cell( view, path, 0, FALSE, 0, 0 );
}
gtk_tree_path_free( path );
EntityInspector_applySpawnflags();
}
-static gint EntityEntry_keypress( GtkEntry* widget, GdkEventKey* event, gpointer data ){
+static gint EntityEntry_keypress( ui::Entry widget, GdkEventKey* event, gpointer data ){
if ( event->keyval == GDK_KEY_Return ) {
- if ( widget == g_entityKeyEntry ) {
+ if ( widget._handle == g_entityKeyEntry._handle ) {
g_entityValueEntry.text( "" );
- gtk_window_set_focus( GTK_WINDOW( gtk_widget_get_toplevel( GTK_WIDGET( widget ) ) ), GTK_WIDGET( g_entityValueEntry ) );
+ gtk_window_set_focus( GTK_WINDOW( gtk_widget_get_toplevel( widget ) ), g_entityValueEntry );
}
else
{
return TRUE;
}
if ( event->keyval == GDK_KEY_Escape ) {
- gtk_window_set_focus( GTK_WINDOW( gtk_widget_get_toplevel( GTK_WIDGET( widget ) ) ), NULL );
+ gtk_window_set_focus( GTK_WINDOW( gtk_widget_get_toplevel( widget ) ), NULL );
return TRUE;
}
{
auto text = ui::TextView(ui::New);
- gtk_widget_set_size_request( GTK_WIDGET( text ), 0, -1 ); // allow shrinking
+ gtk_widget_set_size_request( text , 0, -1 ); // allow shrinking
gtk_text_view_set_wrap_mode( text, GTK_WRAP_WORD );
gtk_text_view_set_editable( text, FALSE );
text.show();
for ( int i = 0; i < MAX_FLAGS; i++ )
{
auto check = ui::CheckButton( "" );
- g_object_ref( GTK_WIDGET( check ) );
+ check.ref();
g_object_set_data( G_OBJECT( check ), "handler", gint_to_pointer( check.connect( "toggled", G_CALLBACK( SpawnflagCheck_toggled ), 0 ) ) );
g_entitySpawnflagsCheck[i] = check;
}
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
+ gtk_table_attach( table, entry , 1, 2, 0, 1,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_events( GTK_WIDGET( entry ), GDK_KEY_PRESS_MASK );
+ gtk_widget_set_events( entry , GDK_KEY_PRESS_MASK );
entry.connect( "key_press_event", G_CALLBACK( EntityEntry_keypress ), 0 );
g_entityKeyEntry = entry;
}
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
+ gtk_table_attach( table, entry , 1, 2, 1, 2,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_events( GTK_WIDGET( entry ), GDK_KEY_PRESS_MASK );
+ gtk_widget_set_events( entry , GDK_KEY_PRESS_MASK );
entry.connect( "key_press_event", G_CALLBACK( EntityEntry_keypress ), 0 );
g_entityValueEntry = entry;
}
{
auto label = ui::Label( "Value" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
+ gtk_table_attach( table, label , 0, 1, 1, 2,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
{
auto label = ui::Label( "Key" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
+ gtk_table_attach( table, label , 0, 1, 0, 1,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
g_object_set( G_OBJECT( renderer ), "text", name, "visible", TRUE, NULL );
//globalOutputStream() << "rendering cell " << makeQuoted(name) << "\n";
- GtkStyle* style = gtk_widget_get_style( GTK_WIDGET( getEntityList().m_tree_view ) );
+ GtkStyle* style = gtk_widget_get_style( ui::TreeView( getEntityList().m_tree_view ) );
if ( instance->childSelected() ) {
g_object_set( G_OBJECT( renderer ), "cell-background-gdk", &style->base[GTK_STATE_ACTIVE], NULL );
}
gamecombo_t gamecombo = gamecombo_for_gamename( gamename );
combo->fsgame_entry.text( gamecombo.fs_game );
- gtk_widget_set_sensitive( GTK_WIDGET( combo->fsgame_entry ), gamecombo.sensitive );
+ gtk_widget_set_sensitive( combo->fsgame_entry , gamecombo.sensitive );
return FALSE;
}
window.add(table1);
{
auto vbox = create_dialog_vbox( 4 );
- gtk_table_attach( table1, GTK_WIDGET( vbox ), 1, 2, 0, 1,
+ gtk_table_attach( table1, vbox , 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
{
}
{
auto frame = create_dialog_frame( "Project settings" );
- gtk_table_attach( table1, GTK_WIDGET( frame ), 0, 1, 0, 1,
+ gtk_table_attach( table1, frame , 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
{
{
auto label = ui::Label( "Select mod" );
label.show();
- gtk_table_attach( table2, GTK_WIDGET( label ), 0, 1, 0, 1,
+ gtk_table_attach( table2, label , 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
gtk_combo_box_text_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().custom );
dialog.game_combo.game_select.show();
- gtk_table_attach( table2, GTK_WIDGET( dialog.game_combo.game_select ), 1, 2, 0, 1,
+ gtk_table_attach( table2, dialog.game_combo.game_select , 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
{
auto label = ui::Label( "fs_game" );
label.show();
- gtk_table_attach( table2, GTK_WIDGET( label ), 0, 1, 1, 2,
+ gtk_table_attach( table2, label , 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table2, GTK_WIDGET( entry ), 1, 2, 1, 2,
+ gtk_table_attach( table2, entry , 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
if ( globalMappingMode().do_mapping_mode ) {
auto label = ui::Label( "Mapping mode" );
label.show();
- gtk_table_attach( table2, GTK_WIDGET( label ), 0, 1, 3, 4,
+ gtk_table_attach( table2, label , 0, 1, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
gtk_combo_box_text_append_text( combo, globalMappingMode().mp_mapping_mode );
combo.show();
- gtk_table_attach( table2, GTK_WIDGET( combo ), 1, 2, 3, 4,
+ gtk_table_attach( table2, combo , 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_combo_box_set_active( dialog.game_combo.game_select, gamecombo.game );
dialog.game_combo.fsgame_entry.text( gamecombo.fs_game );
- gtk_widget_set_sensitive( GTK_WIDGET( dialog.game_combo.fsgame_entry ), gamecombo.sensitive );
+ gtk_widget_set_sensitive( dialog.game_combo.fsgame_entry , gamecombo.sensitive );
if ( globalMappingMode().do_mapping_mode ) {
const char *gamemode = gamemode_get();
entry.show();
hbox.pack_start( entry, FALSE, FALSE, 0 );
sides_entry = entry;
- gtk_widget_grab_focus( GTK_WIDGET( entry ) );
+ gtk_widget_grab_focus( entry );
}
{
auto vbox = create_dialog_vbox( 4 );
auto button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &dialog );
vbox.pack_start( button, FALSE, FALSE, 0 );
widget_make_default( button );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
}
{
auto button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &dialog );
vbox.pack_start( button, FALSE, FALSE, 0 );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
}
}
}
{
auto label = ui::Label( "Vendor:" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
+ gtk_table_attach( table, label , 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
{
auto label = ui::Label( "Version:" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
+ gtk_table_attach( table, label , 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
{
auto label = ui::Label( "Renderer:" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 2, 3,
+ gtk_table_attach( table, label , 0, 1, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
{
auto label = ui::Label( reinterpret_cast<const char*>( glGetString( GL_VENDOR ) ) );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 0, 1,
+ gtk_table_attach( table, label , 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
{
auto label = ui::Label( reinterpret_cast<const char*>( glGetString( GL_VERSION ) ) );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 1, 2,
+ gtk_table_attach( table, label , 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
{
auto label = ui::Label( reinterpret_cast<const char*>( glGetString( GL_RENDERER ) ) );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 2, 3,
+ gtk_table_attach( table, label , 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
{
auto label = ui::Label( "Texture x:" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
+ gtk_table_attach( table, label , 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
{
auto label = ui::Label( "Texture y:" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
+ gtk_table_attach( table, label , 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
+ gtk_table_attach( table, entry , 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
+ gtk_table_attach( table, entry , 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
auto button = create_modal_dialog_button( "OK", ok_button );
vbox.pack_start( button, FALSE, FALSE, 0 );
widget_make_default( button );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
}
{
auto button = create_modal_dialog_button( "Cancel", cancel_button );
vbox.pack_start( button, FALSE, FALSE, 0 );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
}
}
}
y.text( buf );
// Set focus after intializing the values
- gtk_widget_grab_focus( GTK_WIDGET( x ) );
+ gtk_widget_grab_focus( x );
EMessageBoxReturn ret = modal_dialog_show( window, dialog );
if ( ret == eIDOK ) {
gpointer text = g_object_get_data( G_OBJECT( data ), "text" );
if ( f == 0 ) {
- ui::Widget(GTK_WIDGET( data )).alert( "Error saving file !" );
+ ui::Widget::from(data).alert( "Error saving file !" );
return;
}
entry.show();
vbox.pack_start( entry, TRUE, TRUE, 0 );
- gtk_widget_grab_focus( GTK_WIDGET( entry ) );
+ gtk_widget_grab_focus( entry );
intensity_entry = entry;
}
auto button = create_modal_dialog_button( "OK", ok_button );
vbox.pack_start( button, FALSE, FALSE, 0 );
widget_make_default( button );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
+ gtk_widget_add_accelerator( button , "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
}
{
auto button = create_modal_dialog_button( "Cancel", cancel_button );
vbox.pack_start( button, FALSE, FALSE, 0 );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
+ gtk_widget_add_accelerator( button , "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
}
}
}
entry.show();
vbox.pack_start( entry, TRUE, TRUE, 0 );
- gtk_widget_grab_focus( GTK_WIDGET( entry ) );
+ gtk_widget_grab_focus( entry );
textentry = entry;
}
auto button = create_modal_dialog_button( "OK", ok_button );
vbox.pack_start( button, FALSE, FALSE, 0 );
widget_make_default( button );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
+ gtk_widget_add_accelerator( button , "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
}
{
auto button = create_modal_dialog_button( "Cancel", cancel_button );
vbox.pack_start( button, FALSE, FALSE, 0 );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
+ gtk_widget_add_accelerator( button , "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
}
}
}
auto button = create_modal_dialog_button( "OK", ok_button );
vbox.pack_start( button, FALSE, FALSE, 0 );
widget_make_default( button );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
+ gtk_widget_add_accelerator( button , "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
}
}
}
gtk_misc_set_alignment( GTK_MISC( dialog.m_label ), 0.0, 0.5 );
gtk_label_set_justify( dialog.m_label, GTK_JUSTIFY_LEFT );
dialog.m_label.show();
- gtk_widget_set_size_request( GTK_WIDGET( dialog.m_label ), 200, -1 );
+ gtk_widget_set_size_request( dialog.m_label , 200, -1 );
dialog.m_window.add(dialog.m_label);
}
bool isActiveApp = MainFrame_isActiveApp();
g_wait = create_wait_dialog( title, message );
- gtk_grab_add( GTK_WIDGET( g_wait.m_window ) );
+ gtk_grab_add( g_wait.m_window );
if ( isActiveApp ) {
g_wait.m_window.show();
g_wait_stack.pop_back();
if ( g_wait_stack.empty() ) {
EverySecondTimer_enable();
- //gtk_widget_set_sensitive(GTK_WIDGET(MainFrame_getWindow()), TRUE);
+ //gtk_widget_set_sensitive(MainFrame_getWindow(), TRUE);
- gtk_grab_remove( GTK_WIDGET( g_wait.m_window ) );
+ gtk_grab_remove( g_wait.m_window );
destroy_floating_window( g_wait.m_window );
g_wait.m_window = ui::Window{ui::null};
toolbar.show();
auto space = [&]() {
- auto btn = ui::Widget(GTK_WIDGET(gtk_separator_tool_item_new()));
+ auto btn = ui::ToolItem(gtk_separator_tool_item_new());
btn.show();
toolbar.add(btn);
};
// disable the console and texture button in the regular layouts
if ( style == MainFrame::eRegular || style == MainFrame::eRegularLeft ) {
- gtk_widget_set_sensitive( GTK_WIDGET( g_view_console_button ), FALSE );
- gtk_widget_set_sensitive( GTK_WIDGET( g_view_textures_button ), FALSE );
+ gtk_widget_set_sensitive( g_view_console_button , FALSE );
+ gtk_widget_set_sensitive( g_view_textures_button , FALSE );
}
return toolbar;
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
gtk_misc_set_padding( GTK_MISC( label ), 4, 2 );
label.show();
- gtk_table_attach_defaults( table, GTK_WIDGET( label ), 0, 1, 0, 1 );
- pStatusLabel[c_command_status] = ui::Widget(GTK_WIDGET( label ));
+ gtk_table_attach_defaults( table, label , 0, 1, 0, 1 );
+ pStatusLabel[c_command_status] = ui::Widget(label );
}
for ( int i = 1; i < c_count_status; ++i )
{
auto frame = ui::Frame();
frame.show();
- gtk_table_attach_defaults( table, GTK_WIDGET( frame ), i, i + 1, 0, 1 );
+ gtk_table_attach_defaults( table, frame , i, i + 1, 0, 1 );
gtk_frame_set_shadow_type( frame, GTK_SHADOW_IN );
auto label = ui::Label( "Label" );
gtk_misc_set_padding( GTK_MISC( label ), 4, 2 );
label.show();
frame.add(label);
- pStatusLabel[i] = ui::Widget(GTK_WIDGET( label ));
+ pStatusLabel[i] = ui::Widget(label );
}
- return ui::Widget(GTK_WIDGET( table ));
+ return ui::Widget(table );
}
#if 0
image.show();
window.add(image);
- gtk_widget_set_size_request( GTK_WIDGET( window ), -1, -1 );
+ gtk_widget_set_size_request( window , -1, -1 );
window.show();
return window;
}
#endif
- gtk_widget_add_events( GTK_WIDGET( window ), GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK );
+ gtk_widget_add_events( window , GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK );
window.connect( "delete_event", G_CALLBACK( mainframe_delete ), this );
m_position_tracker.connect( window );
// xy
m_pXYWnd = new XYWnd();
m_pXYWnd->SetViewType( XY );
- ui::Widget xy_window = ui::Widget(GTK_WIDGET( create_framed_widget( m_pXYWnd->GetWidget() ) ));
+ ui::Widget xy_window = ui::Widget(create_framed_widget( m_pXYWnd->GetWidget( ) ));
{
ui::Widget vsplit2 = ui::VPaned(ui::New);
m_pCamWnd = NewCamWnd();
GlobalCamera_setCamWnd( *m_pCamWnd );
CamWnd_setParent( *m_pCamWnd, window );
- GtkFrame* camera_window = create_framed_widget( CamWnd_getWidget( *m_pCamWnd ) );
+ auto camera_window = create_framed_widget( CamWnd_getWidget( *m_pCamWnd ) );
- gtk_paned_add1( GTK_PANED( vsplit2 ), GTK_WIDGET( camera_window ) );
+ gtk_paned_add1( GTK_PANED( vsplit2 ), camera_window );
// textures
- GtkFrame* texture_window = create_framed_widget( TextureBrowser_constructWindow( window ) );
+ auto texture_window = create_framed_widget( TextureBrowser_constructWindow( window ) );
- gtk_paned_add2( GTK_PANED( vsplit2 ), GTK_WIDGET( texture_window ) );
+ gtk_paned_add2( GTK_PANED( vsplit2 ), texture_window );
}
}
}
}
{
- GtkFrame* frame = create_framed_widget( TextureBrowser_constructWindow( GroupDialog_getWindow() ) );
- g_page_textures = GroupDialog_addPage( "Textures", ui::Widget(GTK_WIDGET( frame )), TextureBrowserExportTitleCaller() );
+ auto frame = create_framed_widget( TextureBrowser_constructWindow( GroupDialog_getWindow() ) );
+ g_page_textures = GroupDialog_addPage( "Textures", frame, TextureBrowserExportTitleCaller() );
}
GroupDialog_show();
vbox.pack_start( split, TRUE, TRUE, 0 );
{
- GtkFrame* frame = create_framed_widget( TextureBrowser_constructWindow( window ) );
- g_page_textures = GroupDialog_addPage( "Textures", ui::Widget(GTK_WIDGET( frame )), TextureBrowserExportTitleCaller() );
+ auto frame = create_framed_widget( TextureBrowser_constructWindow( window ) );
+ g_page_textures = GroupDialog_addPage( "Textures", frame, TextureBrowserExportTitleCaller() );
}
}
g_layout_globals.m_position = m_position_tracker.getPosition();
- g_layout_globals.nState = gdk_window_get_state( gtk_widget_get_window(GTK_WIDGET( m_window )) );
+ g_layout_globals.nState = gdk_window_get_state( gtk_widget_get_window(m_window ) );
}
void MainFrame::Shutdown(){
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
+ gtk_table_attach( table, entry , 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_editable_set_editable( GTK_EDITABLE(entry), FALSE );
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
+ gtk_table_attach( table, entry , 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_editable_set_editable( GTK_EDITABLE(entry), FALSE );
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
+ gtk_table_attach( table, entry , 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_grab_focus( GTK_WIDGET( entry ) );
+ gtk_widget_grab_focus( entry );
entity = entry;
}
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
+ gtk_table_attach( table, entry , 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
auto button = create_dialog_button( "Find", G_CALLBACK( dialog_button_ok ), &dialog );
hbox.pack_start( button, FALSE, FALSE, 0 );
widget_make_default( button );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
}
{
auto button = create_dialog_button( "Close", G_CALLBACK( dialog_button_cancel ), &dialog );
hbox.pack_start( button, FALSE, FALSE, 0 );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
}
}
}
MRU_SetText( i, MRU_GetText( i - 1 ) );
MRU_SetText( 0, str );
- gtk_widget_set_sensitive( GTK_WIDGET( MRU_items[0] ), TRUE );
- ui::Widget(GTK_WIDGET( MRU_items[MRU_used - 1] )).show();
+ gtk_widget_set_sensitive( ui::MenuItem(MRU_items[0]) , TRUE );
+ ui::MenuItem(MRU_items[MRU_used - 1] ).show();
}
void MRU_Init(){
MRU_items[pos] = widget;
if ( pos < MRU_used ) {
MRU_updateWidget( pos, MRU_GetText( pos ) );
- gtk_widget_set_sensitive( GTK_WIDGET( MRU_items[0] ), TRUE );
- ui::Widget(GTK_WIDGET( MRU_items[pos] )).show();
+ gtk_widget_set_sensitive( ui::MenuItem(MRU_items[0]) , TRUE );
+ ui::MenuItem(MRU_items[pos]).show();
}
}
}
if ( MRU_used == 0 ) {
auto label = ui::Label(GTK_LABEL(gtk_bin_get_child(GTK_BIN(MRU_items[0] )) ));
label.text("Recent Files");
- gtk_widget_set_sensitive( GTK_WIDGET( MRU_items[0] ), FALSE );
+ gtk_widget_set_sensitive( ui::MenuItem(MRU_items[0]), FALSE );
}
else
{
void MRU_constructMenu( ui::Menu menu ){
{
auto item = create_menu_item_with_mnemonic( menu, "_1", LoadMRUCaller( g_load_mru1 ) );
- gtk_widget_set_sensitive( GTK_WIDGET( item ), FALSE );
+ gtk_widget_set_sensitive( item , FALSE );
MRU_AddWidget( item, 0 );
}
{
if ( subdivisions.m_enabled ) {
entry_set_int( m_horizontal, static_cast<int>( subdivisions.m_x ) );
entry_set_int( m_vertical, static_cast<int>( subdivisions.m_y ) );
- gtk_widget_set_sensitive( GTK_WIDGET( m_horizontal ), TRUE );
- gtk_widget_set_sensitive( GTK_WIDGET( m_vertical ), TRUE );
+ gtk_widget_set_sensitive( m_horizontal , TRUE );
+ gtk_widget_set_sensitive( m_vertical , TRUE );
}
else
{
m_horizontal.text("");
m_vertical.text("");
- gtk_widget_set_sensitive( GTK_WIDGET( m_horizontal ), FALSE );
- gtk_widget_set_sensitive( GTK_WIDGET( m_vertical ), FALSE );
+ gtk_widget_set_sensitive( m_horizontal , FALSE );
+ gtk_widget_set_sensitive( m_vertical , FALSE );
}
}
void cancel(){
{
auto label = ui::Label( "Row:" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
+ gtk_table_attach( table, label , 0, 1, 0, 1,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
}
{
auto label = ui::Label( "Column:" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 0, 1,
+ gtk_table_attach( table, label , 1, 2, 0, 1,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
}
AddDialogData( *GTK_COMBO_BOX(combo), m_nRow );
combo.show();
- gtk_table_attach( table, GTK_WIDGET( combo ), 0, 1, 1, 2,
+ gtk_table_attach( table, combo , 0, 1, 1, 2,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( combo ), 60, -1 );
+ gtk_widget_set_size_request( combo , 60, -1 );
m_pRowCombo = combo;
}
AddDialogData( *GTK_COMBO_BOX(combo), m_nCol );
combo.show();
- gtk_table_attach( table, GTK_WIDGET( combo ), 1, 2, 1, 2,
+ gtk_table_attach( table, combo , 1, 2, 1, 2,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( combo ), 60, -1 );
+ gtk_widget_set_size_request( combo , 60, -1 );
m_pColCombo = combo;
}
}
{
auto label = ui::Label( "X:" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
+ gtk_table_attach( table, label , 0, 1, 0, 1,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
}
{
auto label = ui::Label( "Y:" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
+ gtk_table_attach( table, label , 0, 1, 1, 2,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
}
{
auto label = ui::Label( "Z:" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 2, 3,
+ gtk_table_attach( table, label , 0, 1, 2, 3,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
}
{
auto label = ui::Label( "S:" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 3, 4,
+ gtk_table_attach( table, label , 0, 1, 3, 4,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
}
{
auto label = ui::Label( "T:" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 4, 5,
+ gtk_table_attach( table, label , 0, 1, 4, 5,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
}
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
+ gtk_table_attach( table, entry , 1, 2, 0, 1,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
AddDialogData( *GTK_ENTRY(entry), m_fX );
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
+ gtk_table_attach( table, entry , 1, 2, 1, 2,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
AddDialogData( *GTK_ENTRY(entry), m_fY );
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 2, 3,
+ gtk_table_attach( table, entry , 1, 2, 2, 3,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
AddDialogData( *GTK_ENTRY(entry), m_fZ );
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 3, 4,
+ gtk_table_attach( table, entry , 1, 2, 3, 4,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
AddDialogData( *GTK_ENTRY(entry), m_fS );
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 4, 5,
+ gtk_table_attach( table, entry , 1, 2, 4, 5,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
AddDialogData( *GTK_ENTRY(entry), m_fT );
{
auto label = ui::Label( "Fixed" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
+ gtk_table_attach( table, label , 0, 1, 0, 1,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
}
{
auto check = ui::CheckButton(GTK_CHECK_BUTTON( gtk_check_button_new() ));
check.show();
- gtk_table_attach( table, GTK_WIDGET( check ), 1, 2, 0, 1,
+ gtk_table_attach( table, check , 1, 2, 0, 1,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
m_subdivisions.m_enabled = check;
{
auto label = ui::Label( "Horizontal" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
+ gtk_table_attach( table, label , 0, 1, 1, 2,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
}
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
+ gtk_table_attach( table, entry , 1, 2, 1, 2,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
m_subdivisions.m_horizontal = entry;
{
auto label = ui::Label( "Vertical" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 2, 3,
+ gtk_table_attach( table, label , 0, 1, 2, 3,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
}
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 2, 3,
+ gtk_table_attach( table, entry , 1, 2, 2, 3,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
m_subdivisions.m_vertical = entry;
{
auto label = ui::Label( "Horizontal Shift Step" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 2, 4, 0, 1,
+ gtk_table_attach( table, label , 2, 4, 0, 1,
(GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
(GtkAttachOptions)( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
{
auto label = ui::Label( "Vertical Shift Step" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 2, 4, 1, 2,
+ gtk_table_attach( table, label , 2, 4, 1, 2,
(GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
(GtkAttachOptions)( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
{
auto label = ui::Label( "Horizontal Stretch Step" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 2, 3, 2, 3,
+ gtk_table_attach( table, label , 2, 3, 2, 3,
(GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
(GtkAttachOptions)( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
{
auto button = ui::Button( "Flip" );
button.show();
- gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 2, 3,
+ gtk_table_attach( table, button , 3, 4, 2, 3,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
button.connect( "clicked", G_CALLBACK( OnBtnPatchFlipX ), 0 );
- gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+ gtk_widget_set_size_request( button , 60, -1 );
}
{
auto label = ui::Label( "Vertical Stretch Step" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 2, 3, 3, 4,
+ gtk_table_attach( table, label , 2, 3, 3, 4,
(GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
(GtkAttachOptions)( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
{
auto button = ui::Button( "Flip" );
button.show();
- gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 3, 4,
+ gtk_table_attach( table, button , 3, 4, 3, 4,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
button.connect( "clicked", G_CALLBACK( OnBtnPatchFlipY ), 0 );
- gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+ gtk_widget_set_size_request( button , 60, -1 );
}
{
auto label = ui::Label( "Rotate Step" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 2, 4, 4, 5,
+ gtk_table_attach( table, label , 2, 4, 4, 5,
(GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
(GtkAttachOptions)( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 0, 1,
+ gtk_table_attach( table, entry , 0, 1, 0, 1,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
+ gtk_widget_set_size_request( entry , 50, -1 );
g_object_set_data( G_OBJECT( window ), "hshift_entry", (void *) entry );
// we fill in this data, if no patch is selected the widgets are unmodified when the inspector is raised
// so we need to have at least one initialisation somewhere
auto spin = ui::SpinButton( adj, 1, 0 );
spin.show();
- gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 0, 1,
+ gtk_table_attach( table, spin , 1, 2, 0, 1,
(GtkAttachOptions)( 0 ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
+ gtk_widget_set_size_request( spin , 10, -1 );
gtk_widget_set_can_focus( spin, false );
}
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 1, 2,
+ gtk_table_attach( table, entry , 0, 1, 1, 2,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
+ gtk_widget_set_size_request( entry , 50, -1 );
entry_set_float( entry, g_pi_globals.shift[1] );
auto adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 );
auto spin = ui::SpinButton( adj, 1, 0 );
spin.show();
- gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 1, 2,
+ gtk_table_attach( table, spin , 1, 2, 1, 2,
(GtkAttachOptions)( 0 ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
+ gtk_widget_set_size_request( spin , 10, -1 );
gtk_widget_set_can_focus( spin, false );
}
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 2, 3,
+ gtk_table_attach( table, entry , 0, 1, 2, 3,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
+ gtk_widget_set_size_request( entry , 50, -1 );
entry_set_float( entry, g_pi_globals.scale[0] );
auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
auto spin = ui::SpinButton( adj, 1, 0 );
spin.show();
- gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 2, 3,
+ gtk_table_attach( table, spin , 1, 2, 2, 3,
(GtkAttachOptions)( 0 ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
+ gtk_widget_set_size_request( spin , 10, -1 );
gtk_widget_set_can_focus( spin, false );
}
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 3, 4,
+ gtk_table_attach( table, entry , 0, 1, 3, 4,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
+ gtk_widget_set_size_request( entry , 50, -1 );
entry_set_float( entry, g_pi_globals.scale[1] );
auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
auto spin = ui::SpinButton( adj, 1, 0 );
spin.show();
- gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 3, 4,
+ gtk_table_attach( table, spin , 1, 2, 3, 4,
(GtkAttachOptions)( 0 ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
+ gtk_widget_set_size_request( spin , 10, -1 );
gtk_widget_set_can_focus( spin, false );
}
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 4, 5,
+ gtk_table_attach( table, entry , 0, 1, 4, 5,
(GtkAttachOptions)( GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
+ gtk_widget_set_size_request( entry , 50, -1 );
entry_set_float( entry, g_pi_globals.rotate );
auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 ); // NOTE: Arnout - this really should be 360 but can't change it anymore as it could break existing maps
auto spin = ui::SpinButton( adj, 1, 0 );
spin.show();
- gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 4, 5,
+ gtk_table_attach( table, spin , 1, 2, 4, 5,
(GtkAttachOptions)( 0 ),
(GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
+ gtk_widget_set_size_request( spin , 10, -1 );
gtk_widget_set_can_focus( spin, false );
}
}
button.show();
hbox2.pack_end(button, TRUE, FALSE, 0);
button.connect( "clicked", G_CALLBACK( OnBtnPatchAutoCap ), 0 );
- gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+ gtk_widget_set_size_request( button , 60, -1 );
}
{
auto button = ui::Button( "CAP" );
button.show();
hbox2.pack_end(button, TRUE, FALSE, 0);
button.connect( "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 );
- gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+ gtk_widget_set_size_request( button , 60, -1 );
}
{
auto button = ui::Button( "Set..." );
button.show();
hbox2.pack_end(button, TRUE, FALSE, 0);
button.connect( "clicked", G_CALLBACK( OnBtnPatchreset ), 0 );
- gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+ gtk_widget_set_size_request( button , 60, -1 );
}
{
auto button = ui::Button( "Natural" );
button.show();
hbox2.pack_end(button, TRUE, FALSE, 0);
button.connect( "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 );
- gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+ gtk_widget_set_size_request( button , 60, -1 );
}
{
auto button = ui::Button( "Fit" );
button.show();
hbox2.pack_end(button, TRUE, FALSE, 0);
button.connect( "clicked", G_CALLBACK( OnBtnPatchfit ), 0 );
- gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+ gtk_widget_set_size_request( button , 60, -1 );
}
}
}
{
auto label = ui::Label( "Width:" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
+ gtk_table_attach( table, label , 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
{
auto label = ui::Label( "Height:" );
label.show();
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
+ gtk_table_attach( table, label , 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
D_ITEM( 31 ); // MAX_PATCH_SIZE is 32, so we should be able to do 31...
#undef D_ITEM
combo.show();
- gtk_table_attach( table, GTK_WIDGET( combo ), 1, 2, 0, 1,
+ gtk_table_attach( table, combo , 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
D_ITEM( 31 ); // MAX_PATCH_SIZE is 32, so we should be able to do 31...
#undef D_ITEM
combo.show();
- gtk_table_attach( table, GTK_WIDGET( combo ), 1, 2, 1, 2,
+ gtk_table_attach( table, combo , 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
auto button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &dialog );
vbox.pack_start( button, FALSE, FALSE, 0 );
widget_make_default( button );
- gtk_widget_grab_focus( GTK_WIDGET( button ) );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_grab_focus( button );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
}
{
auto button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &dialog );
vbox.pack_start( button, FALSE, FALSE, 0 );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
}
}
}
{
auto image = new_local_image( "cap_bevel.png" );
image.show();
- gtk_table_attach( table, GTK_WIDGET( image ), 0, 1, 0, 1,
+ gtk_table_attach( table, image , 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
}
{
auto image = new_local_image( "cap_endcap.png" );
image.show();
- gtk_table_attach( table, GTK_WIDGET( image ), 0, 1, 1, 2,
+ gtk_table_attach( table, image , 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
}
{
auto image = new_local_image( "cap_ibevel.png" );
image.show();
- gtk_table_attach( table, GTK_WIDGET( image ), 0, 1, 2, 3,
+ gtk_table_attach( table, image , 0, 1, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
}
{
auto image = new_local_image( "cap_iendcap.png" );
image.show();
- gtk_table_attach( table, GTK_WIDGET( image ), 0, 1, 3, 4,
+ gtk_table_attach( table, image , 0, 1, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
}
{
auto image = new_local_image( "cap_cylinder.png" );
image.show();
- gtk_table_attach( table, GTK_WIDGET( image ), 0, 1, 4, 5,
+ gtk_table_attach( table, image , 0, 1, 4, 5,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
}
auto button = create_modal_dialog_button( "OK", ok_button );
vbox.pack_start( button, FALSE, FALSE, 0 );
widget_make_default( button );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
+ gtk_widget_add_accelerator( button , "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
}
{
auto button = create_modal_dialog_button( "Cancel", cancel_button );
vbox.pack_start( button, FALSE, FALSE, 0 );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
+ gtk_widget_add_accelerator( button , "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
}
}
}
void PluginsMenu_clear(){
m_nNextPlugInID = 0;
- GList* lst = g_list_find( gtk_container_get_children( GTK_CONTAINER( g_plugins_menu ) ), GTK_WIDGET( g_plugins_menu_separator ) );
+ GList* lst = g_list_find( gtk_container_get_children( GTK_CONTAINER( g_plugins_menu ) ), g_plugins_menu_separator );
while ( lst->next )
{
- g_plugins_menu.remove(ui::Widget(GTK_WIDGET(lst->next->data)));
- lst = g_list_find( gtk_container_get_children( GTK_CONTAINER( g_plugins_menu ) ), GTK_WIDGET( g_plugins_menu_separator ) );
+ g_plugins_menu.remove(ui::Widget::from(lst->next->data));
+ lst = g_list_find( gtk_container_get_children( GTK_CONTAINER( g_plugins_menu ) ), g_plugins_menu_separator );
}
}
void toolbar_insert( ui::Toolbar toolbar, const char* icon, const char* text, const char* tooltip, IToolbarButton::EType type, GCallback handler, gpointer data ){
if (type == IToolbarButton::eSpace) {
- auto it = ui::Widget(GTK_WIDGET(gtk_separator_tool_item_new()));
+ auto it = ui::ToolItem(gtk_separator_tool_item_new());
it.show();
toolbar.add(it);
return;
}
if (type == IToolbarButton::eButton) {
- auto button = ui::ToolButton(GTK_TOOL_BUTTON(gtk_tool_button_new(GTK_WIDGET(new_plugin_image(icon)), text)));
+ auto button = ui::ToolButton(GTK_TOOL_BUTTON(gtk_tool_button_new(new_plugin_image(icon), text)));
gtk_widget_set_tooltip_text(button, tooltip);
gtk_widget_show_all(button);
button.connect("clicked", G_CALLBACK(handler), data);
}
if (type == IToolbarButton::eToggleButton) {
auto button = ui::ToolButton(GTK_TOOL_BUTTON(gtk_toggle_tool_button_new()));
- gtk_tool_button_set_icon_widget(button, GTK_WIDGET(new_plugin_image(icon)));
+ gtk_tool_button_set_icon_widget(button, new_plugin_image(icon));
gtk_tool_button_set_label(button, text);
gtk_widget_set_tooltip_text(button, tooltip);
gtk_widget_show_all(button);
frame.add(vbox2);
{
- PreferencesPage preferencesPage( *this, ui::Widget(GTK_WIDGET( vbox2 )) );
+ PreferencesPage preferencesPage( *this, ui::Widget(vbox2 ) );
Global_constructPreferences( preferencesPage );
CreateGlobalFrame( preferencesPage );
}
static void OnButtonClean( ui::Widget widget, gpointer data ){
// make sure this is what the user wants
- if ( ui::Widget(GTK_WIDGET( g_Preferences.GetWidget() )).alert( "This will close Radiant and clean the corresponding registry entries.\n"
+ if ( ui::Widget(g_Preferences.GetWidget( )).alert( "This will close Radiant and clean the corresponding registry entries.\n"
"Next time you start Radiant it will be good as new. Do you wish to continue?",
"Reset Registry", ui::alert_type::YESNO, ui::alert_icon::Asterisk ) == ui::alert_response::YES ) {
PrefsDlg *dlg = (PrefsDlg*)data;
auto adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
auto spin = ui::SpinButton( adj, 1, 0 );
spin.show();
- gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 0, 1,
+ gtk_table_attach( table, spin , 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 64, -1 );
+ gtk_widget_set_size_request( spin , 64, -1 );
gtk_spin_button_set_wrap( spin, TRUE );
- gtk_widget_grab_focus( GTK_WIDGET( spin ) );
+ gtk_widget_grab_focus( spin );
g_rotate_dialog.x = spin;
}
auto adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
auto spin = ui::SpinButton( adj, 1, 0 );
spin.show();
- gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 1, 2,
+ gtk_table_attach( table, spin , 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 64, -1 );
+ gtk_widget_set_size_request( spin , 64, -1 );
gtk_spin_button_set_wrap( spin, TRUE );
g_rotate_dialog.y = spin;
auto adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
auto spin = ui::SpinButton( adj, 1, 0 );
spin.show();
- gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 2, 3,
+ gtk_table_attach( table, spin , 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 64, -1 );
+ gtk_widget_set_size_request( spin , 64, -1 );
gtk_spin_button_set_wrap( spin, TRUE );
g_rotate_dialog.z = spin;
auto button = create_dialog_button( "OK", G_CALLBACK( rotatedlg_ok ), &g_rotate_dialog );
vbox.pack_start( button, FALSE, FALSE, 0 );
widget_make_default( button );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
}
{
auto button = create_dialog_button( "Cancel", G_CALLBACK( rotatedlg_cancel ), &g_rotate_dialog );
vbox.pack_start( button, FALSE, FALSE, 0 );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
}
{
auto button = create_dialog_button( "Apply", G_CALLBACK( rotatedlg_apply ), &g_rotate_dialog );
auto button = create_dialog_button( "OK", G_CALLBACK( scaledlg_ok ), &g_scale_dialog );
vbox.pack_start( button, FALSE, FALSE, 0 );
widget_make_default( button );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
}
{
auto button = create_dialog_button( "Cancel", G_CALLBACK( scaledlg_cancel ), &g_scale_dialog );
vbox.pack_start( button, FALSE, FALSE, 0 );
- gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
+ gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
}
{
auto button = create_dialog_button( "Apply", G_CALLBACK( scaledlg_apply ), &g_scale_dialog );
m_hshiftIncrement.m_spin = spin;
m_hshiftSpinner.connect( spin );
spin.show();
- gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 0, 1,
+ gtk_table_attach( GTK_TABLE( table ), spin , 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 60, -1 );
+ gtk_widget_set_size_request( spin , 60, -1 );
}
{
ui::Widget label = ui::Label( "Step" );
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 0, 1,
+ gtk_table_attach( GTK_TABLE( table ), entry , 3, 4, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
+ gtk_widget_set_size_request( entry , 50, -1 );
m_hshiftIncrement.m_entry = entry;
m_hshiftEntry.connect( entry );
}
m_vshiftIncrement.m_spin = spin;
m_vshiftSpinner.connect( spin );
spin.show();
- gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 1, 2,
+ gtk_table_attach( GTK_TABLE( table ), spin , 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 60, -1 );
+ gtk_widget_set_size_request( spin , 60, -1 );
}
{
ui::Widget label = ui::Label( "Step" );
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 1, 2,
+ gtk_table_attach( GTK_TABLE( table ), entry , 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
+ gtk_widget_set_size_request( entry , 50, -1 );
m_vshiftIncrement.m_entry = entry;
m_vshiftEntry.connect( entry );
}
m_hscaleIncrement.m_spin = spin;
m_hscaleSpinner.connect( spin );
spin.show();
- gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 2, 3,
+ gtk_table_attach( GTK_TABLE( table ), spin , 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 60, -1 );
+ gtk_widget_set_size_request( spin , 60, -1 );
}
{
ui::Widget label = ui::Label( "Step" );
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 2, 3,
+ gtk_table_attach( GTK_TABLE( table ), entry , 3, 4, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 2, 3 );
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
+ gtk_widget_set_size_request( entry , 50, -1 );
m_hscaleIncrement.m_entry = entry;
m_hscaleEntry.connect( entry );
}
m_vscaleIncrement.m_spin = spin;
m_vscaleSpinner.connect( spin );
spin.show();
- gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 3, 4,
+ gtk_table_attach( GTK_TABLE( table ), spin , 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 60, -1 );
+ gtk_widget_set_size_request( spin , 60, -1 );
}
{
ui::Widget label = ui::Label( "Step" );
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 3, 4,
+ gtk_table_attach( GTK_TABLE( table ), entry , 3, 4, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
+ gtk_widget_set_size_request( entry , 50, -1 );
m_vscaleIncrement.m_entry = entry;
m_vscaleEntry.connect( entry );
}
m_rotateIncrement.m_spin = spin;
m_rotateSpinner.connect( spin );
spin.show();
- gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 4, 5,
+ gtk_table_attach( GTK_TABLE( table ), spin , 1, 2, 4, 5,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 60, -1 );
+ gtk_widget_set_size_request( spin , 60, -1 );
gtk_spin_button_set_wrap( spin, TRUE );
}
{
{
auto entry = ui::Entry(ui::New);
entry.show();
- gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 4, 5,
+ gtk_table_attach( GTK_TABLE( table ), entry , 3, 4, 4, 5,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
+ gtk_widget_set_size_request( entry , 50, -1 );
m_rotateIncrement.m_entry = entry;
m_rotateEntry.connect( entry );
}
{
auto check = ui::CheckButton( getSurfaceFlagName( c * 8 + r ) );
check.show();
- gtk_table_attach( table, GTK_WIDGET( check ), c, c + 1, r, r + 1,
+ gtk_table_attach( table, check , c, c + 1, r, r + 1,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
*p++ = check;
{
auto check = ui::CheckButton( getContentFlagName( c * 8 + r ) );
check.show();
- gtk_table_attach( table, GTK_WIDGET( check ), c, c + 1, r, r + 1,
+ gtk_table_attach( table, check , c, c + 1, r, r + 1,
(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions)( 0 ), 0, 0 );
*p++ = check;
}
// not allowed to modify detail flag using Surface Inspector
- gtk_widget_set_sensitive( GTK_WIDGET( m_contentFlags[BRUSH_DETAIL_FLAG] ), FALSE );
+ gtk_widget_set_sensitive( ui::CheckButton(m_contentFlags[BRUSH_DETAIL_FLAG]), FALSE );
}
}
}
// Shamus: Textool goodies...
ui::Widget frame = ui::Frame( "Textool" );
frame.show();
- vbox.pack_start( GTK_WIDGET( frame ), FALSE, FALSE, 0 );
+ vbox.pack_start( frame , FALSE, FALSE, 0 );
{
//Prolly should make this a member or global var, so the SI can draw on it...
TexTool::g_textoolWin = glwidget_new( FALSE );
{
ui::Widget hbox = ui::HBox( FALSE, 5 );
hbox.show();
- vbox.pack_start( GTK_WIDGET( hbox ), FALSE, FALSE, 0 );
+ vbox.pack_start( hbox , FALSE, FALSE, 0 );
// Checkboxes go here... (Flip X/Y)
ui::Widget flipX = ui::CheckButton( "Flip X axis" );
ui::Widget flipY = ui::CheckButton( "Flip Y axis" );
if ( string_empty( g_pGameDescription->getKeyValue( "show_wads" ) ) ) {
menu_separator( menu );
- g_TextureBrowser.m_shader_info_item = ui::Widget(GTK_WIDGET( create_menu_item_with_mnemonic( menu, "Shader Info", "ShaderInfo" ) ));
+ g_TextureBrowser.m_shader_info_item = ui::Widget(create_menu_item_with_mnemonic( menu, "Shader Info", "ShaderInfo" ));
gtk_widget_set_sensitive( g_TextureBrowser.m_shader_info_item, FALSE );
}
TextureBrowser_createTreeViewTree();
- gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW( g_TextureBrowser.m_scr_win_tree ), GTK_WIDGET( g_TextureBrowser.m_treeViewTree ) );
+ gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW( g_TextureBrowser.m_scr_win_tree ), g_TextureBrowser.m_treeViewTree );
g_TextureBrowser.m_treeViewTree.show();
}
{ // gl_widget scrollbar
GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ) );
gtk_tree_selection_set_mode( selection, GTK_SELECTION_MULTIPLE );
- gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW( g_TextureBrowser.m_scr_win_tags ), GTK_WIDGET( g_TextureBrowser.m_treeViewTags ) );
+ gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW( g_TextureBrowser.m_scr_win_tags ), g_TextureBrowser.m_treeViewTags );
g_TextureBrowser.m_treeViewTags.show();
}
{ // Texture/Tag notebook
g_TextureBrowser.m_assigned_tree.show();
scrolled_win.show();
- gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW( scrolled_win ), GTK_WIDGET( g_TextureBrowser.m_assigned_tree ) );
+ gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW( scrolled_win ), g_TextureBrowser.m_assigned_tree );
gtk_table_attach( GTK_TABLE( frame_table ), scrolled_win, 0, 1, 1, 3, GTK_FILL, GTK_FILL, 0, 0 );
}
g_TextureBrowser.m_available_tree.show();
scrolled_win.show();
- gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW( scrolled_win ), GTK_WIDGET( g_TextureBrowser.m_available_tree ) );
+ gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW( scrolled_win ), g_TextureBrowser.m_available_tree );
gtk_table_attach( GTK_TABLE( frame_table ), scrolled_win, 2, 3, 1, 3, GTK_FILL, GTK_FILL, 0, 0 );
}
}
else
{
- ui::Widget(GTK_WIDGET( g_TextureBrowser.m_parent )).alert( "Select a single tag for renaming." );
+ ui::Widget(g_TextureBrowser.m_parent ).alert( "Select a single tag for renaming." );
}
}
gtk_tree_selection_selected_foreach( selection, GtkTreeSelectionForeachFunc( TextureBrowser_selectionHelper ), &selected );
if ( g_slist_length( selected ) == 1 ) { // we only delete a single tag
- auto result = ui::Widget(GTK_WIDGET( g_TextureBrowser.m_parent )).alert( "Are you sure you want to delete the selected tag?", "Delete Tag", ui::alert_type::YESNO, ui::alert_icon::Question );
+ auto result = ui::Widget(g_TextureBrowser.m_parent ).alert( "Are you sure you want to delete the selected tag?", "Delete Tag", ui::alert_type::YESNO, ui::alert_icon::Question );
if ( result == ui::alert_response::YES ) {
GtkTreeIter iterSelected;
}
}
else {
- ui::Widget(GTK_WIDGET( g_TextureBrowser.m_parent )).alert( "Select a single tag for deletion." );
+ ui::Widget(g_TextureBrowser.m_parent ).alert( "Select a single tag for deletion." );
}
}
}
void TextureBrowser_showUntagged(){
- auto result = ui::Widget(GTK_WIDGET( g_TextureBrowser.m_parent )).alert( "WARNING! This function might need a lot of memory and time. Are you sure you want to use it?", "Show Untagged", ui::alert_type::YESNO, ui::alert_icon::Warning );
+ auto result = ui::Widget(g_TextureBrowser.m_parent ).alert( "WARNING! This function might need a lot of memory and time. Are you sure you want to use it?", "Show Untagged", ui::alert_type::YESNO, ui::alert_icon::Warning );
if ( result == ui::alert_response::YES ) {
g_TextureBrowser.m_found_shaders.clear();
unsigned char* img;
const char* filename;
- filename = ui::file_dialog( GTK_WIDGET( MainFrame_getWindow() ), FALSE, "Save Image", 0, FILTER_BMP );
+ filename = ui::file_dialog( MainFrame_getWindow( ), FALSE, "Save Image", 0, FILTER_BMP );
if ( !filename ) {
return;
}
m_stack.back().first.add(item);
auto submenu = ui::Menu(ui::New);
- gtk_menu_item_set_submenu( item, GTK_WIDGET( submenu ) );
+ gtk_menu_item_set_submenu( item, submenu );
m_stack.push_back( MenuPair( submenu, name ) );
}