public:
ListAttribute( const char* key, const ListAttributeType& type ) :
m_key( key ),
- m_combo( 0 ),
+ m_combo( ui::null ),
m_nonModal( ApplyCaller( *this ) ),
m_type( type ){
auto combo = ui::ComboBoxText(ui::New);
{
for ( int i = 0; i < g_spawnflag_count; ++i )
{
- auto widget = ui::CheckButton(g_entitySpawnflagsCheck[i]);
- auto label = ui::Label(GTK_LABEL(gtk_bin_get_child(GTK_BIN(widget))));
+ auto widget = ui::CheckButton::from(g_entitySpawnflagsCheck[i]);
+ auto label = ui::Label::from(gtk_bin_get_child(GTK_BIN(widget)));
label.text(" ");
widget.hide();
widget.ref();
- ui::Container(GTK_CONTAINER(g_spawnflagsTable)).remove(widget);
+ g_spawnflagsTable.remove(widget);
}
}
{
for (unsigned int i = 0; (int) i < g_spawnflag_count; ++i)
{
- auto widget = ui::CheckButton(g_entitySpawnflagsCheck[i] );
+ auto widget = ui::CheckButton::from(g_entitySpawnflagsCheck[i] );
widget.show();
StringOutputStream str( 16 );
g_spawnflagsTable.attach(widget, {i % 4, i % 4 + 1, i / 4, i / 4 + 1}, {GTK_FILL, GTK_FILL});
widget.unref();
- auto label = ui::Label(GTK_LABEL(gtk_bin_get_child(GTK_BIN(widget)) ));
+ auto label = ui::Label::from(gtk_bin_get_child(GTK_BIN(widget)) );
label.text(str.c_str());
}
}
{
int v = !!( f & ( 1 << spawn_table[i] ) );
- toggle_button_set_active_no_signal( ui::ToggleButton(GTK_TOGGLE_BUTTON( g_entitySpawnflagsCheck[i] )), v );
+ toggle_button_set_active_no_signal( ui::ToggleButton::from( g_entitySpawnflagsCheck[i] ), v );
}
}
{
// take care of the remaining ones
for ( int i = g_spawnflag_count; i < MAX_FLAGS; ++i )
{
- toggle_button_set_active_no_signal( ui::ToggleButton(GTK_TOGGLE_BUTTON( g_entitySpawnflagsCheck[i] )), FALSE );
+ toggle_button_set_active_no_signal( ui::ToggleButton::from( g_entitySpawnflagsCheck[i] ), FALSE );
}
}
}
{
IdleDraw m_idleDraw;
public:
-EntityInspectorDraw() : m_idleDraw( FreeCaller<void(), EntityInspector_updateKeyValues>( ) ){
+EntityInspectorDraw() : m_idleDraw( makeCallbackF(EntityInspector_updateKeyValues) ){
}
void queueDraw(){
m_idleDraw.queueDraw();
GtkTreeModel* model;
GtkTreeIter iter;
if ( gtk_tree_selection_get_selected( gtk_tree_view_get_selection( g_entityClassList ), &model, &iter ) == FALSE ) {
- view.window().alert( "You must have a selected class to create an entity", "info" );
+ ui::alert( view.window(), "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" ) ) {
- g_entityKeyEntry.window().alert( "Cannot change \"classname\" key back to worldspawn.", 0, ui::alert_type::OK );
+ ui::alert( g_entityKeyEntry.window(), "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(), " " ) ) {
- g_entityKeyEntry.window().alert( "No spaces are allowed in entity keys.", 0, ui::alert_type::OK );
+ ui::alert( g_entityKeyEntry.window(), "No spaces are allowed in entity keys.", 0, ui::alert_type::OK );
return;
}
gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
{
- ui::ListStore store = ui::ListStore(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_POINTER ));
+ ui::ListStore store = ui::ListStore::from(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_POINTER ));
- auto view = ui::TreeView( ui::TreeModel(store ));
+ auto view = ui::TreeView( ui::TreeModel::from( store._handle ));
gtk_tree_view_set_enable_search(view, FALSE );
gtk_tree_view_set_headers_visible( view, FALSE );
view.connect( "button_press_event", G_CALLBACK( EntityClassList_button_press ), 0 );
}
{
- auto selection = ui::TreeSelection(gtk_tree_view_get_selection( view ));
+ auto selection = ui::TreeSelection::from(gtk_tree_view_get_selection( view ));
selection.connect( "changed", G_CALLBACK( EntityClassList_selection_changed ), 0 );
}
gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
{
- ui::ListStore store = ui::ListStore(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING ));
+ ui::ListStore store = ui::ListStore::from(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING ));
- auto view = ui::TreeView(ui::TreeModel(store ));
+ auto view = ui::TreeView(ui::TreeModel::from(store._handle));
gtk_tree_view_set_enable_search(view, FALSE );
gtk_tree_view_set_headers_visible(view, FALSE );
}
{
- auto selection = ui::TreeSelection(gtk_tree_view_get_selection(view ));
+ auto selection = ui::TreeSelection::from(gtk_tree_view_get_selection(view));
selection.connect( "changed", G_CALLBACK( EntityProperties_selection_changed ), 0 );
}
scr.show();
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC );
- auto viewport = ui::Container(GTK_CONTAINER(gtk_viewport_new( 0, 0 )));
+ auto viewport = ui::Container::from(gtk_viewport_new( 0, 0 ));
viewport.show();
gtk_viewport_set_shadow_type( GTK_VIEWPORT( viewport ), GTK_SHADOW_NONE );
void EntityInspector_construct(){
GlobalEntityClassManager().attach( g_EntityInspector );
- GlobalPreferenceSystem().registerPreference( "EntitySplit1", IntImportStringCaller( g_entitysplit1_position ), IntExportStringCaller( g_entitysplit1_position ) );
- GlobalPreferenceSystem().registerPreference( "EntitySplit2", IntImportStringCaller( g_entitysplit2_position ), IntExportStringCaller( g_entitysplit2_position ) );
+ GlobalPreferenceSystem().registerPreference( "EntitySplit1", make_property_string( g_entitysplit1_position ) );
+ GlobalPreferenceSystem().registerPreference( "EntitySplit2", make_property_string( g_entitysplit2_position ) );
}