- create_menu_item_with_mnemonic(menu, "_Open...", "OpenMap");
-
- create_menu_item_with_mnemonic(menu, "_Import...", "ImportMap");
- create_menu_item_with_mnemonic(menu, "_Save", "SaveMap");
- create_menu_item_with_mnemonic(menu, "Save _as...", "SaveMapAs");
- create_menu_item_with_mnemonic(menu, "Save s_elected...", "SaveSelected");
- menu_separator(menu);
- create_menu_item_with_mnemonic(menu, "Save re_gion...", "SaveRegion");
- menu_separator(menu);
- create_menu_item_with_mnemonic(menu, "_Refresh models", "RefreshReferences");
- menu_separator(menu);
- create_menu_item_with_mnemonic(menu, "Pro_ject settings...", "ProjectSettings");
- menu_separator(menu);
- create_menu_item_with_mnemonic(menu, "_Pointfile...", "TogglePointfile");
- menu_separator(menu);
- MRU_constructMenu(menu);
- menu_separator(menu);
- create_menu_item_with_mnemonic(menu, "Check for NetRadiant update (web)", "CheckForUpdate"); // FIXME
- create_menu_item_with_mnemonic(menu, "E_xit", "Exit");
-
- return file_menu_item;
-}
-
-GtkMenuItem* create_edit_menu()
-{
- // Edit menu
- GtkMenuItem* edit_menu_item = new_sub_menu_item_with_mnemonic("_Edit");
- GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(edit_menu_item));
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu);
- create_menu_item_with_mnemonic(menu, "_Undo", "Undo");
- create_menu_item_with_mnemonic(menu, "_Redo", "Redo");
- menu_separator(menu);
- create_menu_item_with_mnemonic(menu, "_Copy", "Copy");
- create_menu_item_with_mnemonic(menu, "_Paste", "Paste");
- create_menu_item_with_mnemonic(menu, "P_aste To Camera", "PasteToCamera");
- menu_separator(menu);
- create_menu_item_with_mnemonic(menu, "_Duplicate", "CloneSelection");
- create_menu_item_with_mnemonic(menu, "Duplicate, make uni_que", "CloneSelectionAndMakeUnique");
- create_menu_item_with_mnemonic(menu, "D_elete", "DeleteSelection");
- menu_separator(menu);
- create_menu_item_with_mnemonic(menu, "Pa_rent", "ParentSelection");
- menu_separator(menu);
- create_menu_item_with_mnemonic(menu, "C_lear Selection", "UnSelectSelection");
- create_menu_item_with_mnemonic(menu, "_Invert Selection", "InvertSelection");
- create_menu_item_with_mnemonic(menu, "Select i_nside", "SelectInside");
- create_menu_item_with_mnemonic(menu, "Select _touching", "SelectTouching");
-
- GtkMenu* convert_menu = create_sub_menu_with_mnemonic(menu, "E_xpand Selection");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (convert_menu);
- create_menu_item_with_mnemonic(convert_menu, "To Whole _Entities", "ExpandSelectionToEntities");
-
- menu_separator(menu);
- create_menu_item_with_mnemonic(menu, "Pre_ferences...", "Preferences");
-
- return edit_menu_item;
-}
-
-void fill_view_xy_top_menu(GtkMenu* menu)
-{
- create_check_menu_item_with_mnemonic(menu, "XY (Top) View", "ToggleView");
-}
-
-
-void fill_view_yz_side_menu(GtkMenu* menu)
-{
- create_check_menu_item_with_mnemonic(menu, "YZ (Side) View", "ToggleSideView");
-}
-
-
-void fill_view_xz_front_menu(GtkMenu* menu)
-{
- create_check_menu_item_with_mnemonic(menu, "XZ (Front) View", "ToggleFrontView");
-}
-
-
-GtkWidget* g_toggle_z_item = 0;
-GtkWidget* g_toggle_console_item = 0;
-GtkWidget* g_toggle_entity_item = 0;
-GtkWidget* g_toggle_entitylist_item = 0;
-
-GtkMenuItem* create_view_menu(MainFrame::EViewStyle style)
-{
- // View menu
- GtkMenuItem* view_menu_item = new_sub_menu_item_with_mnemonic("Vie_w");
- GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(view_menu_item));
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu);
-
- if(style == MainFrame::eFloating)
- {
- fill_view_camera_menu(menu);
- fill_view_xy_top_menu(menu);
- fill_view_yz_side_menu(menu);
- fill_view_xz_front_menu(menu);
- }
- if(style == MainFrame::eFloating || style == MainFrame::eSplit)
- {
- create_menu_item_with_mnemonic(menu, "Console View", "ToggleConsole");
- create_menu_item_with_mnemonic(menu, "Texture Browser", "ToggleTextures");
- create_menu_item_with_mnemonic(menu, "Entity Inspector", "ToggleEntityInspector");
- }
- else
- {
- create_menu_item_with_mnemonic(menu, "Entity Inspector", "ViewEntityInfo");
- }
- create_menu_item_with_mnemonic(menu, "_Surface Inspector", "SurfaceInspector");
- create_menu_item_with_mnemonic(menu, "Entity List", "EntityList");
-
- menu_separator(menu);
- {
- GtkMenu* camera_menu = create_sub_menu_with_mnemonic (menu, "Camera");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (camera_menu);
- create_menu_item_with_mnemonic(camera_menu, "_Center", "CenterView");
- create_menu_item_with_mnemonic(camera_menu, "_Up Floor", "UpFloor");
- create_menu_item_with_mnemonic(camera_menu, "_Down Floor", "DownFloor");
- menu_separator(camera_menu);
- create_menu_item_with_mnemonic(camera_menu, "Far Clip Plane In", "CubicClipZoomIn");
- create_menu_item_with_mnemonic(camera_menu, "Far Clip Plane Out", "CubicClipZoomOut");
- menu_separator(camera_menu);
- create_menu_item_with_mnemonic(camera_menu, "Next leak spot", "NextLeakSpot");
- create_menu_item_with_mnemonic(camera_menu, "Previous leak spot", "PrevLeakSpot");
- menu_separator(camera_menu);
- create_menu_item_with_mnemonic(camera_menu, "Look Through Selected", "LookThroughSelected");
- create_menu_item_with_mnemonic(camera_menu, "Look Through Camera", "LookThroughCamera");
- }
- menu_separator(menu);
- {
- GtkMenu* orthographic_menu = create_sub_menu_with_mnemonic(menu, "Orthographic");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (orthographic_menu);
- if(style == MainFrame::eRegular || style == MainFrame::eRegularLeft || style == MainFrame::eFloating)
- {
- create_menu_item_with_mnemonic(orthographic_menu, "_Next (XY, YZ, XY)", "NextView");
- create_menu_item_with_mnemonic(orthographic_menu, "XY (Top)", "ViewTop");
- create_menu_item_with_mnemonic(orthographic_menu, "YZ", "ViewSide");
- create_menu_item_with_mnemonic(orthographic_menu, "XZ", "ViewFront");
- menu_separator(orthographic_menu);
- }
-
- create_menu_item_with_mnemonic(orthographic_menu, "_XY 100%", "Zoom100");
- create_menu_item_with_mnemonic(orthographic_menu, "XY Zoom _In", "ZoomIn");
- create_menu_item_with_mnemonic(orthographic_menu, "XY Zoom _Out", "ZoomOut");
- }
-
- menu_separator(menu);
-
- {
- GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Show");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_in_menu);
- create_check_menu_item_with_mnemonic(menu_in_menu, "Show _Angles", "ShowAngles");
- create_check_menu_item_with_mnemonic(menu_in_menu, "Show _Names", "ShowNames");
- create_check_menu_item_with_mnemonic(menu_in_menu, "Show Blocks", "ShowBlocks");
- create_check_menu_item_with_mnemonic(menu_in_menu, "Show C_oordinates", "ShowCoordinates");
- create_check_menu_item_with_mnemonic(menu_in_menu, "Show Window Outline", "ShowWindowOutline");
- create_check_menu_item_with_mnemonic(menu_in_menu, "Show Axes", "ShowAxes");
- create_check_menu_item_with_mnemonic(menu_in_menu, "Show Workzone", "ShowWorkzone");
- create_check_menu_item_with_mnemonic(menu_in_menu, "Show Stats", "ShowStats");
- }
-
- {
- GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Filter");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_in_menu);
- Filters_constructMenu(menu_in_menu);
- }
- menu_separator(menu);
- {
- GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Hide/Show");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_in_menu);
- create_menu_item_with_mnemonic(menu_in_menu, "Hide Selected", "HideSelected");
- create_menu_item_with_mnemonic(menu_in_menu, "Show Hidden", "ShowHidden");
- }
- menu_separator(menu);
- {
- GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Region");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_in_menu);
- create_menu_item_with_mnemonic(menu_in_menu, "_Off", "RegionOff");
- create_menu_item_with_mnemonic(menu_in_menu, "_Set XY", "RegionSetXY");
- create_menu_item_with_mnemonic(menu_in_menu, "Set _Brush", "RegionSetBrush");
- create_menu_item_with_mnemonic(menu_in_menu, "Set Se_lected Brushes", "RegionSetSelection");
- }
-
- command_connect_accelerator("CenterXYView");
-
- return view_menu_item;
-}
-
-GtkMenuItem* create_selection_menu()
-{
- // Selection menu
- GtkMenuItem* selection_menu_item = new_sub_menu_item_with_mnemonic("M_odify");
- GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(selection_menu_item));
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu);
-
- {
- GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Components");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_in_menu);
- create_check_menu_item_with_mnemonic(menu_in_menu, "_Edges", "DragEdges");
- create_check_menu_item_with_mnemonic(menu_in_menu, "_Vertices", "DragVertices");
- create_check_menu_item_with_mnemonic(menu_in_menu, "_Faces", "DragFaces");
- }
-
- menu_separator(menu);
-
- {
- GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic(menu, "Nudge");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_in_menu);
- create_menu_item_with_mnemonic(menu_in_menu, "Nudge Left", "SelectNudgeLeft");
- create_menu_item_with_mnemonic(menu_in_menu, "Nudge Right", "SelectNudgeRight");
- create_menu_item_with_mnemonic(menu_in_menu, "Nudge Up", "SelectNudgeUp");
- create_menu_item_with_mnemonic(menu_in_menu, "Nudge Down", "SelectNudgeDown");
- }
- {
- GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Rotate");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_in_menu);
- create_menu_item_with_mnemonic(menu_in_menu, "Rotate X", "RotateSelectionX");
- create_menu_item_with_mnemonic(menu_in_menu, "Rotate Y", "RotateSelectionY");
- create_menu_item_with_mnemonic(menu_in_menu, "Rotate Z", "RotateSelectionZ");
- }
- {
- GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Flip");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_in_menu);
- create_menu_item_with_mnemonic(menu_in_menu, "Flip _X", "MirrorSelectionX");
- create_menu_item_with_mnemonic(menu_in_menu, "Flip _Y", "MirrorSelectionY");
- create_menu_item_with_mnemonic(menu_in_menu, "Flip _Z", "MirrorSelectionZ");
- }
- menu_separator(menu);
- create_menu_item_with_mnemonic(menu, "Arbitrary rotation...", "ArbitraryRotation");
- create_menu_item_with_mnemonic(menu, "Arbitrary scale...", "ArbitraryScale");
-
- return selection_menu_item;
-}
-
-GtkMenuItem* create_bsp_menu()
-{
- // BSP menu
- GtkMenuItem* bsp_menu_item = new_sub_menu_item_with_mnemonic("_Build");
- GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(bsp_menu_item));
-
- if (g_Layout_enableDetachableMenus.m_value)
- {
- menu_tearoff(menu);
- }
-
- create_menu_item_with_mnemonic(menu, "Customize...", "BuildMenuCustomize");
-
- menu_separator(menu);
-
- Build_constructMenu(menu);
-
- g_bsp_menu = menu;
-
- return bsp_menu_item;
-}
-
-GtkMenuItem* create_grid_menu()
-{
- // Grid menu
- GtkMenuItem* grid_menu_item = new_sub_menu_item_with_mnemonic("_Grid");
- GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(grid_menu_item));
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu);
-
- Grid_constructMenu(menu);
-
- return grid_menu_item;
-}
-
-GtkMenuItem* create_misc_menu()
-{
- // Misc menu
- GtkMenuItem* misc_menu_item = new_sub_menu_item_with_mnemonic("M_isc");
- GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(misc_menu_item));
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu);
+ create_menu_item_with_mnemonic( menu, "_Open...", "OpenMap" );
+
+ create_menu_item_with_mnemonic( menu, "_Import...", "ImportMap" );
+ create_menu_item_with_mnemonic( menu, "_Save", "SaveMap" );
+ create_menu_item_with_mnemonic( menu, "Save _as...", "SaveMapAs" );
+ create_menu_item_with_mnemonic( menu, "_Export selected...", "ExportSelected" );
+ menu_separator( menu );
+ create_menu_item_with_mnemonic( menu, "Save re_gion...", "SaveRegion" );
+ menu_separator( menu );
+ create_menu_item_with_mnemonic( menu, "_Refresh models", "RefreshReferences" );
+ menu_separator( menu );
+ create_menu_item_with_mnemonic( menu, "Pro_ject settings...", "ProjectSettings" );
+ menu_separator( menu );
+ create_menu_item_with_mnemonic( menu, "_Pointfile...", "TogglePointfile" );
+ menu_separator( menu );
+ MRU_constructMenu( menu );
+ menu_separator( menu );
+ create_menu_item_with_mnemonic( menu, "E_xit", "Exit" );
+
+ return file_menu_item;
+}
+
+ui::MenuItem create_edit_menu(){
+ // Edit menu
+ auto edit_menu_item = new_sub_menu_item_with_mnemonic( "_Edit" );
+ auto menu = ui::Menu(GTK_MENU( gtk_menu_item_get_submenu( edit_menu_item ) ));
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( menu );
+ }
+ create_menu_item_with_mnemonic( menu, "_Undo", "Undo" );
+ create_menu_item_with_mnemonic( menu, "_Redo", "Redo" );
+ menu_separator( menu );
+ create_menu_item_with_mnemonic( menu, "_Copy", "Copy" );
+ create_menu_item_with_mnemonic( menu, "_Paste", "Paste" );
+ create_menu_item_with_mnemonic( menu, "P_aste To Camera", "PasteToCamera" );
+ menu_separator( menu );
+ create_menu_item_with_mnemonic( menu, "_Duplicate", "CloneSelection" );
+ create_menu_item_with_mnemonic( menu, "Duplicate, make uni_que", "CloneSelectionAndMakeUnique" );
+ create_menu_item_with_mnemonic( menu, "D_elete", "DeleteSelection" );
+ menu_separator( menu );
+ create_menu_item_with_mnemonic( menu, "Pa_rent", "ParentSelection" );
+ menu_separator( menu );
+ create_menu_item_with_mnemonic( menu, "C_lear Selection", "UnSelectSelection" );
+ create_menu_item_with_mnemonic( menu, "_Invert Selection", "InvertSelection" );
+ create_menu_item_with_mnemonic( menu, "Select i_nside", "SelectInside" );
+ create_menu_item_with_mnemonic( menu, "Select _touching", "SelectTouching" );
+
+ auto convert_menu = create_sub_menu_with_mnemonic( menu, "E_xpand Selection" );
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( convert_menu );
+ }
+ create_menu_item_with_mnemonic( convert_menu, "To Whole _Entities", "ExpandSelectionToEntities" );
+
+ menu_separator( menu );
+ create_menu_item_with_mnemonic( menu, "Pre_ferences...", "Preferences" );
+
+ return edit_menu_item;
+}
+
+void fill_view_xy_top_menu( ui::Menu menu ){
+ create_check_menu_item_with_mnemonic( menu, "XY (Top) View", "ToggleView" );
+}
+
+
+void fill_view_yz_side_menu( ui::Menu menu ){
+ create_check_menu_item_with_mnemonic( menu, "YZ (Side) View", "ToggleSideView" );
+}
+
+
+void fill_view_xz_front_menu( ui::Menu menu ){
+ create_check_menu_item_with_mnemonic( menu, "XZ (Front) View", "ToggleFrontView" );
+}
+
+
+ui::Widget g_toggle_z_item;
+ui::Widget g_toggle_console_item;
+ui::Widget g_toggle_entity_item;
+ui::Widget g_toggle_entitylist_item;
+
+ui::MenuItem create_view_menu( MainFrame::EViewStyle style ){
+ // View menu
+ auto view_menu_item = new_sub_menu_item_with_mnemonic( "Vie_w" );
+ auto menu = ui::Menu(GTK_MENU( gtk_menu_item_get_submenu( view_menu_item ) ));
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( menu );
+ }
+
+ if ( style == MainFrame::eFloating ) {
+ fill_view_camera_menu( menu );
+ fill_view_xy_top_menu( menu );
+ fill_view_yz_side_menu( menu );
+ fill_view_xz_front_menu( menu );
+ }
+ if ( style == MainFrame::eFloating || style == MainFrame::eSplit ) {
+ create_menu_item_with_mnemonic( menu, "Console View", "ToggleConsole" );
+ create_menu_item_with_mnemonic( menu, "Texture Browser", "ToggleTextures" );
+ create_menu_item_with_mnemonic( menu, "Entity Inspector", "ToggleEntityInspector" );
+ }
+ else
+ {
+ create_menu_item_with_mnemonic( menu, "Entity Inspector", "ViewEntityInfo" );
+ }
+ create_menu_item_with_mnemonic( menu, "_Surface Inspector", "SurfaceInspector" );
+ create_menu_item_with_mnemonic( menu, "Entity List", "EntityList" );
+
+ menu_separator( menu );
+ {
+ auto camera_menu = create_sub_menu_with_mnemonic( menu, "Camera" );
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( camera_menu );
+ }
+ create_menu_item_with_mnemonic( camera_menu, "_Center", "CenterView" );
+ create_menu_item_with_mnemonic( camera_menu, "_Up Floor", "UpFloor" );
+ create_menu_item_with_mnemonic( camera_menu, "_Down Floor", "DownFloor" );
+ menu_separator( camera_menu );
+ create_menu_item_with_mnemonic( camera_menu, "Far Clip Plane In", "CubicClipZoomIn" );
+ create_menu_item_with_mnemonic( camera_menu, "Far Clip Plane Out", "CubicClipZoomOut" );
+ menu_separator( camera_menu );
+ create_menu_item_with_mnemonic( camera_menu, "Next leak spot", "NextLeakSpot" );
+ create_menu_item_with_mnemonic( camera_menu, "Previous leak spot", "PrevLeakSpot" );
+ menu_separator( camera_menu );
+ create_menu_item_with_mnemonic( camera_menu, "Look Through Selected", "LookThroughSelected" );
+ create_menu_item_with_mnemonic( camera_menu, "Look Through Camera", "LookThroughCamera" );
+ }
+ menu_separator( menu );
+ {
+ auto orthographic_menu = create_sub_menu_with_mnemonic( menu, "Orthographic" );
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( orthographic_menu );
+ }
+ if ( style == MainFrame::eRegular || style == MainFrame::eRegularLeft || style == MainFrame::eFloating ) {
+ create_menu_item_with_mnemonic( orthographic_menu, "_Next (XY, YZ, XY)", "NextView" );
+ create_menu_item_with_mnemonic( orthographic_menu, "XY (Top)", "ViewTop" );
+ create_menu_item_with_mnemonic( orthographic_menu, "YZ", "ViewSide" );
+ create_menu_item_with_mnemonic( orthographic_menu, "XZ", "ViewFront" );
+ menu_separator( orthographic_menu );
+ }
+
+ create_menu_item_with_mnemonic( orthographic_menu, "_XY 100%", "Zoom100" );
+ create_menu_item_with_mnemonic( orthographic_menu, "XY Zoom _In", "ZoomIn" );
+ create_menu_item_with_mnemonic( orthographic_menu, "XY Zoom _Out", "ZoomOut" );
+ }
+
+ menu_separator( menu );
+
+ {
+ auto menu_in_menu = create_sub_menu_with_mnemonic( menu, "Show" );
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( menu_in_menu );
+ }
+ create_check_menu_item_with_mnemonic( menu_in_menu, "Show _Angles", "ShowAngles" );
+ create_check_menu_item_with_mnemonic( menu_in_menu, "Show _Names", "ShowNames" );
+ create_check_menu_item_with_mnemonic( menu_in_menu, "Show Blocks", "ShowBlocks" );
+ create_check_menu_item_with_mnemonic( menu_in_menu, "Show C_oordinates", "ShowCoordinates" );
+ create_check_menu_item_with_mnemonic( menu_in_menu, "Show Window Outline", "ShowWindowOutline" );
+ create_check_menu_item_with_mnemonic( menu_in_menu, "Show Axes", "ShowAxes" );
+ create_check_menu_item_with_mnemonic( menu_in_menu, "Show Workzone", "ShowWorkzone" );
+ create_check_menu_item_with_mnemonic( menu_in_menu, "Show Stats", "ShowStats" );
+ }
+
+ {
+ auto menu_in_menu = create_sub_menu_with_mnemonic( menu, "Filter" );
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( menu_in_menu );
+ }
+ Filters_constructMenu( menu_in_menu );
+ }
+ menu_separator( menu );
+ {
+ auto menu_in_menu = create_sub_menu_with_mnemonic( menu, "Hide/Show" );
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( menu_in_menu );
+ }
+ create_menu_item_with_mnemonic( menu_in_menu, "Hide Selected", "HideSelected" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Show Hidden", "ShowHidden" );
+ }
+ menu_separator( menu );
+ {
+ auto menu_in_menu = create_sub_menu_with_mnemonic( menu, "Region" );
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( menu_in_menu );
+ }
+ create_menu_item_with_mnemonic( menu_in_menu, "_Off", "RegionOff" );
+ create_menu_item_with_mnemonic( menu_in_menu, "_Set XY", "RegionSetXY" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Set _Brush", "RegionSetBrush" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Set Se_lected Brushes", "RegionSetSelection" );
+ }
+
+ command_connect_accelerator( "CenterXYView" );
+
+ return view_menu_item;
+}
+
+ui::MenuItem create_selection_menu(){
+ // Selection menu
+ auto selection_menu_item = new_sub_menu_item_with_mnemonic( "M_odify" );
+ auto menu = ui::Menu(GTK_MENU( gtk_menu_item_get_submenu( selection_menu_item ) ));
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( menu );
+ }
+
+ {
+ auto menu_in_menu = create_sub_menu_with_mnemonic( menu, "Components" );
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( menu_in_menu );
+ }
+ create_check_menu_item_with_mnemonic( menu_in_menu, "_Edges", "DragEdges" );
+ create_check_menu_item_with_mnemonic( menu_in_menu, "_Vertices", "DragVertices" );
+ create_check_menu_item_with_mnemonic( menu_in_menu, "_Faces", "DragFaces" );
+ }
+
+ menu_separator( menu );
+
+ {
+ auto menu_in_menu = create_sub_menu_with_mnemonic( menu, "Nudge" );
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( menu_in_menu );
+ }
+ create_menu_item_with_mnemonic( menu_in_menu, "Nudge Left", "SelectNudgeLeft" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Nudge Right", "SelectNudgeRight" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Nudge Up", "SelectNudgeUp" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Nudge Down", "SelectNudgeDown" );
+ }
+ {
+ auto menu_in_menu = create_sub_menu_with_mnemonic( menu, "Rotate" );
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( menu_in_menu );
+ }
+ create_menu_item_with_mnemonic( menu_in_menu, "Rotate X", "RotateSelectionX" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Rotate Y", "RotateSelectionY" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Rotate Z", "RotateSelectionZ" );
+ }
+ {
+ auto menu_in_menu = create_sub_menu_with_mnemonic( menu, "Flip" );
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( menu_in_menu );
+ }
+ create_menu_item_with_mnemonic( menu_in_menu, "Flip _X", "MirrorSelectionX" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Flip _Y", "MirrorSelectionY" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Flip _Z", "MirrorSelectionZ" );
+ }
+ menu_separator( menu );
+ create_menu_item_with_mnemonic( menu, "Arbitrary rotation...", "ArbitraryRotation" );
+ create_menu_item_with_mnemonic( menu, "Arbitrary scale...", "ArbitraryScale" );
+
+ return selection_menu_item;
+}
+
+ui::MenuItem create_bsp_menu(){
+ // BSP menu
+ auto bsp_menu_item = new_sub_menu_item_with_mnemonic( "_Build" );
+ auto menu = ui::Menu(GTK_MENU( gtk_menu_item_get_submenu( bsp_menu_item ) ));
+
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( menu );
+ }
+
+ create_menu_item_with_mnemonic( menu, "Customize...", "BuildMenuCustomize" );
+
+ menu_separator( menu );
+
+ Build_constructMenu( menu );
+
+ g_bsp_menu = menu;
+
+ return bsp_menu_item;
+}
+
+ui::MenuItem create_grid_menu(){
+ // Grid menu
+ auto grid_menu_item = new_sub_menu_item_with_mnemonic( "_Grid" );
+ auto menu = ui::Menu(GTK_MENU( gtk_menu_item_get_submenu( grid_menu_item ) ));
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( menu );
+ }
+
+ Grid_constructMenu( menu );
+
+ return grid_menu_item;
+}
+
+ui::MenuItem create_misc_menu(){
+ // Misc menu
+ auto misc_menu_item = new_sub_menu_item_with_mnemonic( "M_isc" );
+ auto menu = ui::Menu(GTK_MENU( gtk_menu_item_get_submenu( misc_menu_item ) ));
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( menu );
+ }