delete this;
}
void apply(){
- Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), m_check.active() ? "1" : "0" );
- Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( m_check ) ) ? "1" : "" );
++ Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), m_check.active() ? "1" : "" );
}
-typedef MemberCaller<BooleanAttribute, &BooleanAttribute::apply> ApplyCaller;
+typedef MemberCaller<BooleanAttribute, void(), &BooleanAttribute::apply> ApplyCaller;
void update(){
const char* value = SelectedEntity_getValueForKey( m_key.c_str() );
return FALSE;
}
-static gint EntityClassList_keypress( GtkWidget* widget, GdkEventKey* event, gpointer data ){
- if ( event->keyval == GDK_Return ) {
+static gint EntityClassList_keypress( ui::Widget widget, GdkEventKey* event, gpointer data ){
- unsigned int code = gdk_keyval_to_upper( event->keyval );
-
+ if ( event->keyval == GDK_KEY_Return ) {
EntityClassList_createEntity();
return TRUE;
}
// select the entity that starts with the key pressed
+ /*
+ unsigned int code = gdk_keyval_to_upper( event->keyval );
if ( code <= 'Z' && code >= 'A' && event->state == 0 ) {
- 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
EntityInspector_applySpawnflags();
}
-static gint EntityEntry_keypress( GtkEntry* widget, GdkEventKey* event, gpointer data ){
- if ( event->keyval == GDK_Return ) {
- if ( widget == g_entityKeyEntry ) {
- //gtk_entry_set_text( g_entityValueEntry, "" );
- gtk_window_set_focus( GTK_WINDOW( gtk_widget_get_toplevel( GTK_WIDGET( widget ) ) ), GTK_WIDGET( g_entityValueEntry ) );
+static gint EntityEntry_keypress( ui::Entry widget, GdkEventKey* event, gpointer data ){
+ if ( event->keyval == GDK_KEY_Return ) {
+ if ( widget._handle == g_entityKeyEntry._handle ) {
- g_entityValueEntry.text( "" );
++ // g_entityValueEntry.text( "" );
+ gtk_window_set_focus( widget.window(), g_entityValueEntry );
}
else
{
gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
{
- GtkListStore* store = 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 ));
- GtkTreeView* view = GTK_TREE_VIEW( gtk_tree_view_new_with_model( GTK_TREE_MODEL( store ) ) );
- //gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), FALSE );
+ auto view = ui::TreeView( ui::TreeModel::from( store._handle ));
- gtk_tree_view_set_enable_search(view, FALSE );
++ // gtk_tree_view_set_enable_search(view, FALSE );
gtk_tree_view_set_headers_visible( view, FALSE );
- g_signal_connect( G_OBJECT( view ), "button_press_event", G_CALLBACK( EntityClassList_button_press ), 0 );
- g_signal_connect( G_OBJECT( view ), "key_press_event", G_CALLBACK( EntityClassList_keypress ), 0 );
+ view.connect( "button_press_event", G_CALLBACK( EntityClassList_button_press ), 0 );
+ view.connect( "key_press_event", G_CALLBACK( EntityClassList_keypress ), 0 );
{
- GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
- GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "Key", renderer, "text", 0, 0 );
+ auto renderer = ui::CellRendererText(ui::New);
+ auto column = ui::TreeViewColumn( "Key", renderer, {{"text", 0}} );
gtk_tree_view_append_column( view, column );
}