X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=radiant%2Fmap.cpp;h=8da8654457fd5c972f574dcd7fc39278a530df28;hp=33dcebe9a51a79301430ad559015486f421fe331;hb=69b4f74e6c95e22d6c6ce10d0e137c875fd83cc4;hpb=0110e3a8f3ab54c17a1785e17c7246adf8e13a46 diff --git a/radiant/map.cpp b/radiant/map.cpp index 33dcebe9..8da86544 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -776,17 +776,17 @@ void DoMapInfo(){ window.add(vbox); { - GtkHBox* hbox = create_dialog_hbox( 4 ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), FALSE, TRUE, 0 ); + auto hbox = create_dialog_hbox( 4 ); + vbox.pack_start( hbox, FALSE, TRUE, 0 ); { - GtkTable* table = create_dialog_table( 2, 2, 4, 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + auto table = create_dialog_table( 2, 2, 4, 4 ); + hbox.pack_start( table, TRUE, TRUE, 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 ); gtk_editable_set_editable( GTK_EDITABLE(entry), FALSE ); @@ -796,7 +796,7 @@ void DoMapInfo(){ { 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 ); @@ -821,24 +821,24 @@ void DoMapInfo(){ } } { - GtkVBox* vbox2 = create_dialog_vbox( 4 ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox2 ), FALSE, FALSE, 0 ); + auto vbox2 = create_dialog_vbox( 4 ); + hbox.pack_start( vbox2, FALSE, FALSE, 0 ); { - GtkButton* button = create_dialog_button( "Close", G_CALLBACK( dialog_button_ok ), &dialog ); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Close", G_CALLBACK( dialog_button_ok ), &dialog ); + vbox2.pack_start( button, FALSE, FALSE, 0 ); } } } { ui::Widget label = ui::Label( "Entity breakdown" ); label.show(); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, TRUE, 0 ); + vbox.pack_start( label, FALSE, TRUE, 0 ); gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 ); } { auto scr = create_scrolled_window( ui::Policy::NEVER, ui::Policy::AUTOMATIC, 4 ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( scr ), TRUE, TRUE, 0 ); + vbox.pack_start( scr, TRUE, TRUE, 0 ); { ui::ListStore store = ui::ListStore(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING )); @@ -879,9 +879,7 @@ void DoMapInfo(){ { char tmp[16]; sprintf( tmp, "%u", Unsigned( ( *i ).second ) ); - GtkTreeIter iter; - gtk_list_store_append( GTK_LIST_STORE( EntityBreakdownWalker ), &iter ); - gtk_list_store_set( GTK_LIST_STORE( EntityBreakdownWalker ), &iter, 0, ( *i ).first.c_str(), 1, tmp, -1 ); + EntityBreakdownWalker.append(0, (*i).first.c_str(), 1, tmp); } } @@ -898,7 +896,7 @@ void DoMapInfo(){ // save before exit window_get_position( window, g_posMapInfoWnd ); - gtk_widget_destroy( GTK_WIDGET( window ) ); + window.destroy(); } @@ -2048,8 +2046,8 @@ void DoFind(){ auto vbox = create_dialog_vbox( 4, 4 ); window.add(vbox); { - GtkTable* table = create_dialog_table( 2, 2, 4, 4 ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 ); + auto table = create_dialog_table( 2, 2, 4, 4 ); + vbox.pack_start( table, TRUE, TRUE, 0 ); { ui::Widget label = ui::Label( "Entity number" ); label.show(); @@ -2067,16 +2065,16 @@ void DoFind(){ { 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 ); @@ -2084,18 +2082,18 @@ void DoFind(){ } } { - GtkHBox* hbox = create_dialog_hbox( 4 ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), TRUE, TRUE, 0 ); + auto hbox = create_dialog_hbox( 4 ); + vbox.pack_start( hbox, TRUE, TRUE, 0 ); { auto button = create_dialog_button( "Find", G_CALLBACK( dialog_button_ok ), &dialog ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + 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 ); } { - GtkButton* button = create_dialog_button( "Close", G_CALLBACK( dialog_button_cancel ), &dialog ); - gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (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( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); } } } @@ -2116,7 +2114,7 @@ void DoFind(){ SelectBrush( atoi( entstr ), atoi( brushstr ) ); } - gtk_widget_destroy( GTK_WIDGET( window ) ); + window.destroy(); } void Map_constructPreferences( PreferencesPage& page ){