From: Thomas Debesse Date: Mon, 11 Feb 2019 07:23:51 +0000 (+0100) Subject: Merge commit '6e687efe8899278a955efd1e3ba4de5300f7949a' into garux-merge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a78b39f38a98bef33e988ff35d37d15c7e2819a8;p=xonotic%2Fnetradiant.git Merge commit '6e687efe8899278a955efd1e3ba4de5300f7949a' into garux-merge --- a78b39f38a98bef33e988ff35d37d15c7e2819a8 diff --cc radiant/gtkdlgs.cpp index a7e3fbce,7bdea67d..81b507b7 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@@ -344,8 -372,8 +344,8 @@@ void DoProjectSettings() ProjectSettingsDialog_ok( dialog ); } - gtk_widget_destroy( GTK_WIDGET( window ) ); + window.destroy(); - } + //} } // ============================================================================= @@@ -637,18 -674,18 +637,18 @@@ EMessageBoxReturn DoTextureLayout( floa } } } - + // Initialize with last used values char buf[16]; - + sprintf( buf, "%f", last_used_texture_layout_scale_x ); - gtk_entry_set_text( x, buf ); + x.text( buf ); - + sprintf( buf, "%f", last_used_texture_layout_scale_y ); - gtk_entry_set_text( y, buf ); + 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 ) { diff --cc radiant/mainframe.cpp index 5a9f9be6,53878054..30ca6286 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@@ -1962,12 -1819,12 +1962,12 @@@ ui::MenuItem create_file_menu() 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" ); + 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 ); + // 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" ); @@@ -2004,11 -1863,14 +2006,14 @@@ ui::MenuItem create_edit_menu() 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 ); + -// GtkMenu* convert_menu = create_sub_menu_with_mnemonic( menu, "E_xpand Selection" ); ++// 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( menu, "Select All Of Type", "SelectAllOfType" ); + create_menu_item_with_mnemonic( menu, "_Expand Selection To Entities", "ExpandSelectionToEntities" ); menu_separator( menu ); create_menu_item_with_mnemonic( menu, "Pre_ferences...", "Preferences" ); diff --cc radiant/mru.cpp index 37fd9a17,24efcf04..72660b91 --- a/radiant/mru.cpp +++ b/radiant/mru.cpp @@@ -191,11 -190,16 +191,16 @@@ LoadMRU g_load_mru1( 1 ) LoadMRU g_load_mru2( 2 ); LoadMRU g_load_mru3( 3 ); LoadMRU g_load_mru4( 4 ); + LoadMRU g_load_mru5( 5 ); + LoadMRU g_load_mru6( 6 ); + LoadMRU g_load_mru7( 7 ); + LoadMRU g_load_mru8( 8 ); + LoadMRU g_load_mru9( 9 ); -void MRU_constructMenu( GtkMenu* menu ){ +void MRU_constructMenu( ui::Menu menu ){ { - GtkMenuItem* item = create_menu_item_with_mnemonic( menu, "_1", LoadMRUCaller( g_load_mru1 ) ); - gtk_widget_set_sensitive( GTK_WIDGET( item ), FALSE ); + auto item = create_menu_item_with_mnemonic( menu, "_1", LoadMRUCaller( g_load_mru1 ) ); + gtk_widget_set_sensitive( item , FALSE ); MRU_AddWidget( item, 0 ); } { @@@ -209,10 -213,35 +214,35 @@@ MRU_AddWidget( item, 2 ); } { - GtkMenuItem* item = create_menu_item_with_mnemonic( menu, "_4", LoadMRUCaller( g_load_mru4 ) ); - gtk_widget_hide( GTK_WIDGET( item ) ); + auto item = create_menu_item_with_mnemonic( menu, "_4", LoadMRUCaller( g_load_mru4 ) ); + item.hide(); MRU_AddWidget( item, 3 ); } - { - GtkMenuItem* item = create_menu_item_with_mnemonic( menu, "_5", LoadMRUCaller( g_load_mru5 ) ); - gtk_widget_hide( GTK_WIDGET( item ) ); - MRU_AddWidget( item, 4 ); ++ { ++ auto item = create_menu_item_with_mnemonic( menu, "_5", LoadMRUCaller( g_load_mru5 ) ); ++ item.hide(); ++ MRU_AddWidget( item, 3 ); + } + { - GtkMenuItem* item = create_menu_item_with_mnemonic( menu, "_6", LoadMRUCaller( g_load_mru6 ) ); - gtk_widget_hide( GTK_WIDGET( item ) ); - MRU_AddWidget( item, 5 ); ++ auto item = create_menu_item_with_mnemonic( menu, "_6", LoadMRUCaller( g_load_mru6 ) ); ++ item.hide(); ++ MRU_AddWidget( item, 3 ); + } + { - GtkMenuItem* item = create_menu_item_with_mnemonic( menu, "_7", LoadMRUCaller( g_load_mru7 ) ); - gtk_widget_hide( GTK_WIDGET( item ) ); - MRU_AddWidget( item, 6 ); ++ auto item = create_menu_item_with_mnemonic( menu, "_7", LoadMRUCaller( g_load_mru7 ) ); ++ item.hide(); ++ MRU_AddWidget( item, 3 ); + } - { - GtkMenuItem* item = create_menu_item_with_mnemonic( menu, "_8", LoadMRUCaller( g_load_mru8 ) ); - gtk_widget_hide( GTK_WIDGET( item ) ); - MRU_AddWidget( item, 7 ); ++ { ++ auto item = create_menu_item_with_mnemonic( menu, "_8", LoadMRUCaller( g_load_mru8 ) ); ++ item.hide(); ++ MRU_AddWidget( item, 3 ); + } + { - GtkMenuItem* item = create_menu_item_with_mnemonic( menu, "_9", LoadMRUCaller( g_load_mru9 ) ); - gtk_widget_hide( GTK_WIDGET( item ) ); - MRU_AddWidget( item, 8 ); ++ auto item = create_menu_item_with_mnemonic( menu, "_9", LoadMRUCaller( g_load_mru9 ) ); ++ item.hide(); ++ MRU_AddWidget( item, 3 ); + } } #include "preferencesystem.h" diff --cc radiant/patchmanip.cpp index bd9d378b,fbb89e05..7ae19fb4 --- a/radiant/patchmanip.cpp +++ b/radiant/patchmanip.cpp @@@ -614,51 -659,55 +614,55 @@@ void PatchPreferences_construct() #include "generic/callback.h" void Patch_registerCommands(){ - GlobalCommands_insert( "InvertCurveTextureX", FreeCaller(), Accelerator( 'I', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "InvertCurveTextureY", FreeCaller(), Accelerator( 'I', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "IncPatchColumn", FreeCaller(), Accelerator( GDK_KP_Add, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "IncPatchRow", FreeCaller(), Accelerator( GDK_KP_Add, (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "DecPatchColumn", FreeCaller(), Accelerator( GDK_KP_Subtract, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "DecPatchRow", FreeCaller(), Accelerator( GDK_KP_Subtract, (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "NaturalizePatch", FreeCaller(), Accelerator( 'N', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "PatchCylinder", FreeCaller() ); - GlobalCommands_insert( "PatchDenseCylinder", FreeCaller() ); - GlobalCommands_insert( "PatchVeryDenseCylinder", FreeCaller() ); - GlobalCommands_insert( "PatchSquareCylinder", FreeCaller() ); - GlobalCommands_insert( "PatchXactCylinder", FreeCaller() ); - GlobalCommands_insert( "PatchXactSphere", FreeCaller() ); - GlobalCommands_insert( "PatchXactCone", FreeCaller() ); - GlobalCommands_insert( "PatchEndCap", FreeCaller() ); - GlobalCommands_insert( "PatchBevel", FreeCaller() ); - GlobalCommands_insert( "PatchSquareBevel", FreeCaller() ); - GlobalCommands_insert( "PatchSquareEndcap", FreeCaller() ); - GlobalCommands_insert( "PatchCone", FreeCaller() ); - GlobalCommands_insert( "PatchSphere", FreeCaller() ); - GlobalCommands_insert( "SimplePatchMesh", FreeCaller(), Accelerator( 'P', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "PatchInsertInsertColumn", FreeCaller() ); - GlobalCommands_insert( "PatchInsertAddColumn", FreeCaller() ); - GlobalCommands_insert( "PatchInsertInsertRow", FreeCaller() ); - GlobalCommands_insert( "PatchInsertAddRow", FreeCaller() ); - GlobalCommands_insert( "PatchDeleteFirstColumn", FreeCaller() ); - GlobalCommands_insert( "PatchDeleteLastColumn", FreeCaller() ); - GlobalCommands_insert( "PatchDeleteFirstRow", FreeCaller() ); - GlobalCommands_insert( "PatchDeleteLastRow", FreeCaller() ); - GlobalCommands_insert( "InvertCurve", FreeCaller(), Accelerator( 'I', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "RedisperseRows", FreeCaller(), Accelerator( 'E', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "RedisperseCols", FreeCaller(), Accelerator( 'E', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "SmoothRows", FreeCaller(), Accelerator( 'W', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "SmoothCols", FreeCaller(), Accelerator( 'W', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "MatrixTranspose", FreeCaller(), Accelerator( 'M', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "CapCurrentCurve", FreeCaller(), Accelerator( 'C', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "CycleCapTexturePatch", FreeCaller(), Accelerator( 'N', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "MakeOverlayPatch", FreeCaller(), Accelerator( 'Y' ) ); - GlobalCommands_insert( "ClearPatchOverlays", FreeCaller(), Accelerator( 'L', (GdkModifierType)GDK_CONTROL_MASK ) ); -} - -void Patch_constructToolbar( GtkToolbar* toolbar ){ - toolbar_append_button( toolbar, "Put caps on the current patch (SHIFT + C)", "curve_cap.bmp", "CapCurrentCurve" ); -} - -void Patch_constructMenu( GtkMenu* menu ){ + GlobalCommands_insert( "InvertCurveTextureX", makeCallbackF(Patch_FlipTextureX), Accelerator( 'I', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "InvertCurveTextureY", makeCallbackF(Patch_FlipTextureY), Accelerator( 'I', (GdkModifierType)GDK_SHIFT_MASK ) ); ++ GlobalCommands_insert( "IncPatchColumn", makeCallbackF(Patch_InsertInsertColumn), Accelerator( GDK_KP_Add, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); ++ GlobalCommands_insert( "IncPatchRow", makeCallbackF(Patch_InsertInsertRow), Accelerator( GDK_KP_Add, (GdkModifierType)GDK_CONTROL_MASK ) ); ++ GlobalCommands_insert( "DecPatchColumn", makeCallbackF(Patch_DeleteLastColumn), Accelerator( GDK_KP_Subtract, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); ++ GlobalCommands_insert( "DecPatchRow", makeCallbackF(Patch_DeleteLastRow), Accelerator( GDK_KP_Subtract, (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "NaturalizePatch", makeCallbackF(Patch_NaturalTexture), Accelerator( 'N', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "PatchCylinder", makeCallbackF(Patch_Cylinder) ); + GlobalCommands_insert( "PatchDenseCylinder", makeCallbackF(Patch_DenseCylinder) ); + GlobalCommands_insert( "PatchVeryDenseCylinder", makeCallbackF(Patch_VeryDenseCylinder) ); + GlobalCommands_insert( "PatchSquareCylinder", makeCallbackF(Patch_SquareCylinder) ); + GlobalCommands_insert( "PatchXactCylinder", makeCallbackF(Patch_XactCylinder) ); + GlobalCommands_insert( "PatchXactSphere", makeCallbackF(Patch_XactSphere) ); + GlobalCommands_insert( "PatchXactCone", makeCallbackF(Patch_XactCone) ); + GlobalCommands_insert( "PatchEndCap", makeCallbackF(Patch_Endcap) ); + GlobalCommands_insert( "PatchBevel", makeCallbackF(Patch_Bevel) ); + GlobalCommands_insert( "PatchSquareBevel", makeCallbackF(Patch_SquareBevel) ); + GlobalCommands_insert( "PatchSquareEndcap", makeCallbackF(Patch_SquareEndcap) ); + GlobalCommands_insert( "PatchCone", makeCallbackF(Patch_Cone) ); + GlobalCommands_insert( "PatchSphere", makeCallbackF(Patch_Sphere) ); + GlobalCommands_insert( "SimplePatchMesh", makeCallbackF(Patch_Plane), Accelerator( 'P', (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "PatchInsertInsertColumn", makeCallbackF(Patch_InsertInsertColumn), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "PatchInsertAddColumn", makeCallbackF(Patch_InsertAddColumn) ); + GlobalCommands_insert( "PatchInsertInsertRow", makeCallbackF(Patch_InsertInsertRow), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "PatchInsertAddRow", makeCallbackF(Patch_InsertAddRow) ); + GlobalCommands_insert( "PatchDeleteFirstColumn", makeCallbackF(Patch_DeleteFirstColumn) ); + GlobalCommands_insert( "PatchDeleteLastColumn", makeCallbackF(Patch_DeleteLastColumn), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "PatchDeleteFirstRow", makeCallbackF(Patch_DeleteFirstRow), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "PatchDeleteLastRow", makeCallbackF(Patch_DeleteLastRow) ); + GlobalCommands_insert( "InvertCurve", makeCallbackF(Patch_Invert), Accelerator( 'I', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "RedisperseRows", makeCallbackF(Patch_RedisperseRows), Accelerator( 'E', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "RedisperseCols", makeCallbackF(Patch_RedisperseCols), Accelerator( 'E', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "SmoothRows", makeCallbackF(Patch_SmoothRows), Accelerator( 'W', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "SmoothCols", makeCallbackF(Patch_SmoothCols), Accelerator( 'W', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "MatrixTranspose", makeCallbackF(Patch_Transpose), Accelerator( 'M', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "CapCurrentCurve", makeCallbackF(Patch_Cap), Accelerator( 'C', (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "CycleCapTexturePatch", makeCallbackF(Patch_CycleProjection), Accelerator( 'N', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "MakeOverlayPatch", makeCallbackF(Patch_OverlayOn), Accelerator( 'Y' ) ); + GlobalCommands_insert( "ClearPatchOverlays", makeCallbackF(Patch_OverlayOff), Accelerator( 'L', (GdkModifierType)GDK_CONTROL_MASK ) ); +} + +void Patch_constructToolbar( ui::Toolbar toolbar ){ + toolbar_append_button( toolbar, "Put caps on the current patch (SHIFT + C)", "cap_curve.png", "CapCurrentCurve" ); +} + +void Patch_constructMenu( ui::Menu menu ){ create_menu_item_with_mnemonic( menu, "Cylinder", "PatchCylinder" ); { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic( menu, "More Cylinders" ); + auto menu_in_menu = create_sub_menu_with_mnemonic( menu, "More Cylinders" ); if ( g_Layout_enableDetachableMenus.m_value ) { menu_tearoff( menu_in_menu ); } @@@ -671,12 -720,12 +675,12 @@@ create_menu_item_with_mnemonic( menu, "End cap", "PatchEndCap" ); create_menu_item_with_mnemonic( menu, "Bevel", "PatchBevel" ); { - auto menu_in_menu = create_sub_menu_with_mnemonic( menu, "More End caps, Bevels" ); - if ( g_Layout_enableDetachableMenus.m_value ) { - menu_tearoff( menu_in_menu ); - } - create_menu_item_with_mnemonic( menu_in_menu, "Square Endcap", "PatchSquareBevel" ); - create_menu_item_with_mnemonic( menu_in_menu, "Square Bevel", "PatchSquareEndcap" ); -// GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic( menu, "More End caps, Bevels" ); ++// auto menu_in_menu = create_sub_menu_with_mnemonic( menu, "More End caps, Bevels" ); + // if ( g_Layout_enableDetachableMenus.m_value ) { + // menu_tearoff( menu_in_menu ); + // } + create_menu_item_with_mnemonic( menu, "Square Endcap", "PatchSquareBevel" ); + create_menu_item_with_mnemonic( menu, "Square Bevel", "PatchSquareEndcap" ); } menu_separator( menu ); create_menu_item_with_mnemonic( menu, "Cone", "PatchCone" ); @@@ -716,26 -765,39 +720,40 @@@ menu_tearoff( menu_in_menu ); } create_menu_item_with_mnemonic( menu_in_menu, "Invert", "InvertCurve" ); - auto menu_3 = create_sub_menu_with_mnemonic( menu_in_menu, "Re-disperse" ); - if ( g_Layout_enableDetachableMenus.m_value ) { - menu_tearoff( menu_3 ); - } - create_menu_item_with_mnemonic( menu_3, "Rows", "RedisperseRows" ); - create_menu_item_with_mnemonic( menu_3, "Columns", "RedisperseCols" ); - auto menu_4 = create_sub_menu_with_mnemonic( menu_in_menu, "Smooth" ); - if ( g_Layout_enableDetachableMenus.m_value ) { - menu_tearoff( menu_4 ); - } - create_menu_item_with_mnemonic( menu_4, "Rows", "SmoothRows" ); - create_menu_item_with_mnemonic( menu_4, "Columns", "SmoothCols" ); - create_menu_item_with_mnemonic( menu_in_menu, "Transpose", "MatrixTranspose" ); -// GtkMenu* menu_3 = create_sub_menu_with_mnemonic( menu_in_menu, "Re-disperse" ); ++// auto menu_3 = create_sub_menu_with_mnemonic( menu_in_menu, "Re-disperse" ); + // if ( g_Layout_enableDetachableMenus.m_value ) { + // menu_tearoff( menu_3 ); + // } + menu_separator( menu_in_menu ); - create_menu_item_with_mnemonic( menu_in_menu, "Re-disperse Rows", "RedisperseRows" ); - create_menu_item_with_mnemonic( menu_in_menu, "Re-disperse Columns", "RedisperseCols" ); -// GtkMenu* menu_4 = create_sub_menu_with_mnemonic( menu_in_menu, "Smooth" ); ++ create_menu_item_with_mnemonic( menu, "Rows", "RedisperseRows" ); ++ create_menu_item_with_mnemonic( menu, "Columns", "RedisperseCols" ); ++// auto menu_4 = create_sub_menu_with_mnemonic( menu_in_menu, "Smooth" ); + // if ( g_Layout_enableDetachableMenus.m_value ) { + // menu_tearoff( menu_4 ); + // } - menu_separator( menu_in_menu ); - create_menu_item_with_mnemonic( menu_in_menu, "Smooth Rows", "SmoothRows" ); - create_menu_item_with_mnemonic( menu_in_menu, "Smooth Columns", "SmoothCols" ); ++ create_menu_item_with_mnemonic( menu, "Rows", "SmoothRows" ); ++ create_menu_item_with_mnemonic( menu, "Columns", "SmoothCols" ); + create_menu_item_with_mnemonic( menu_in_menu, "Transpose", "MatrixTranspose" ); ++ } menu_separator( menu ); create_menu_item_with_mnemonic( menu, "Cap Selection", "CapCurrentCurve" ); + create_menu_item_with_mnemonic( menu, "Cycle Cap Texture", "CycleCapTexturePatch" ); menu_separator( menu ); + { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic( menu, "Texture" ); ++ auto menu_in_menu = create_sub_menu_with_mnemonic( menu, "Texture" ); + if ( g_Layout_enableDetachableMenus.m_value ) { + menu_tearoff( menu_in_menu ); + } + create_menu_item_with_mnemonic( menu_in_menu, "Cycle Projection", "CycleCapTexturePatch" ); + create_menu_item_with_mnemonic( menu_in_menu, "Naturalize", "NaturalizePatch" ); + create_menu_item_with_mnemonic( menu_in_menu, "Invert X", "InvertCurveTextureX" ); + create_menu_item_with_mnemonic( menu_in_menu, "Invert Y", "InvertCurveTextureY" ); + + } + menu_separator( menu ); { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic( menu, "Overlay" ); + auto menu_in_menu = create_sub_menu_with_mnemonic( menu, "Overlay" ); if ( g_Layout_enableDetachableMenus.m_value ) { menu_tearoff( menu_in_menu ); } diff --cc radiant/surfacedialog.cpp index dbf3666e,e48f9b02..bb26225d --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@@ -1415,11 -1505,11 +1415,11 @@@ void SurfaceInspector_registerPreferenc } void SurfaceInspector_registerCommands(){ - GlobalCommands_insert( "FitTexture", makeCallbackF(SurfaceInspector_FitTexture), Accelerator( 'B', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "FitTexture", FreeCaller(), Accelerator( 'F', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "SurfaceInspector", FreeCaller(), Accelerator( 'S' ) ); ++ GlobalCommands_insert( "FitTexture", makeCallbackF(SurfaceInspector_FitTexture), Accelerator( 'F', (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "SurfaceInspector", makeCallbackF(SurfaceInspector_toggleShown), Accelerator( 'S' ) ); - GlobalCommands_insert( "FaceCopyTexture", FreeCaller() ); - GlobalCommands_insert( "FacePasteTexture", FreeCaller() ); + GlobalCommands_insert( "FaceCopyTexture", makeCallbackF(SelectedFaces_copyTexture) ); + GlobalCommands_insert( "FacePasteTexture", makeCallbackF(SelectedFaces_pasteTexture) ); } diff --cc radiant/watchbsp.cpp index bbae3fab,a598ff51..50e6456c --- a/radiant/watchbsp.cpp +++ b/radiant/watchbsp.cpp @@@ -774,11 -772,11 +774,11 @@@ void CWatchBSP::DoMonitoringLoop( GPtrA if ( m_eState != EIdle ) { globalOutputStream() << "WatchBSP got a monitoring request while not idling...\n"; // prompt the user, should we cancel the current process and go ahead? - if ( ui::alert( MainFrame_getWindow(), "I am already monitoring a Build process.\nDo you want me to override and start a new compilation?", - "Build process monitoring", ui::alert_type::YESNO ) == ui::alert_response::YES ) { -// if ( gtk_MessageBox( GTK_WIDGET( MainFrame_getWindow() ), "I am already monitoring a Build process.\nDo you want me to override and start a new compilation?", -// "Build process monitoring", eMB_YESNO ) == eIDYES ) { ++// if ( ui::alert( MainFrame_getWindow(), "I am already monitoring a Build process.\nDo you want me to override and start a new compilation?", ++// "Build process monitoring", ui::alert_type::YESNO ) == ui::alert_response::YES ) { // disconnect and set EIdle state Reset(); - } + // } } m_pCmd = str_ptr_array_clone( pCmd ); m_iCurrentStep = 0; diff --cc radiant/xywindow.cpp index 54d121f3,471a5572..baf3f621 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@@ -348,6 -346,6 +348,8 @@@ struct xywindow_globals_private_ bool m_bChaseMouse; bool m_bSizePaint; ++ bool g_bCrossHairs; ++ xywindow_globals_private_t() : d_showgrid( true ), @@@ -363,7 -361,7 +365,9 @@@ m_bCamXYUpdate( true ), m_bChaseMouse( true ), -- m_bSizePaint( true ){ ++ m_bSizePaint( true ), ++ ++ g_bCrossHairs( false ){ } }; @@@ -537,9 -534,9 +541,7 @@@ VIEWTYPE GlobalXYWnd_getCurrentViewType // ============================================================================= // variables --bool g_bCrossHairs = false; -- -GtkMenu* XYWnd::m_mnuDrop = 0; +ui::Menu XYWnd::m_mnuDrop(ui::null); // this is disabled, and broken // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=394 @@@ -1360,7 -1357,7 +1362,7 @@@ void XYWnd::XY_MouseMoved( int x, int y << " z:: " << FloatFormat( m_mousePosition[2], 6, 1 ); g_pParentWnd->SetStatusText( g_pParentWnd->m_position_status, status.c_str() ); -- if ( g_bCrossHairs ) { ++ if ( g_xywindow_globals_private.g_bCrossHairs ) { XYWnd_Update( *this ); } @@@ -2294,7 -2291,7 +2296,7 @@@ void XYWnd::XY_Draw() PaintSizeInfo( nDim1, nDim2, min, max ); } -- if ( g_bCrossHairs ) { ++ if ( g_xywindow_globals_private.g_bCrossHairs ) { glColor4f( 0.2f, 0.9f, 0.2f, 0.8f ); glBegin( GL_LINES ); if ( m_viewType == XY ) { @@@ -2524,7 -2521,7 +2526,7 @@@ void XY_ZoomOut() void ToggleShowCrosshair(){ -- g_bCrossHairs ^= 1; ++ g_xywindow_globals_private.g_bCrossHairs ^= 1; XY_UpdateAllWindows(); } @@@ -2746,41 -2744,42 +2748,42 @@@ void XYWindow_Construct() GlobalToggles_insert( "ToggleView", ToggleShown::ToggleCaller( g_xy_top_shown ), ToggleItem::AddCallbackCaller( g_xy_top_shown.m_item ), Accelerator( 'V', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); GlobalToggles_insert( "ToggleSideView", ToggleShown::ToggleCaller( g_yz_side_shown ), ToggleItem::AddCallbackCaller( g_yz_side_shown.m_item ) ); GlobalToggles_insert( "ToggleFrontView", ToggleShown::ToggleCaller( g_xz_front_shown ), ToggleItem::AddCallbackCaller( g_xz_front_shown.m_item ) ); - GlobalCommands_insert( "NextView", FreeCaller(), Accelerator( GDK_Tab, (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "ZoomIn", FreeCaller(), Accelerator( GDK_Delete ) ); - GlobalCommands_insert( "ZoomOut", FreeCaller(), Accelerator( GDK_Insert ) ); - GlobalCommands_insert( "ViewTop", FreeCaller(), Accelerator( GDK_KP_Home ) ); - GlobalCommands_insert( "ViewSide", FreeCaller(), Accelerator( GDK_KP_Page_Down ) ); - GlobalCommands_insert( "ViewFront", FreeCaller(), Accelerator( GDK_KP_End ) ); - GlobalCommands_insert( "Zoom100", FreeCaller() ); - GlobalCommands_insert( "CenterXYView", FreeCaller(), Accelerator( GDK_Tab, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - - GlobalPreferenceSystem().registerPreference( "ClipCaulk", BoolImportStringCaller( g_clip_useCaulk ), BoolExportStringCaller( g_clip_useCaulk ) ); - - GlobalPreferenceSystem().registerPreference( "NewRightClick", BoolImportStringCaller( g_xywindow_globals.m_bRightClick ), BoolExportStringCaller( g_xywindow_globals.m_bRightClick ) ); - GlobalPreferenceSystem().registerPreference( "ChaseMouse", BoolImportStringCaller( g_xywindow_globals_private.m_bChaseMouse ), BoolExportStringCaller( g_xywindow_globals_private.m_bChaseMouse ) ); - GlobalPreferenceSystem().registerPreference( "SizePainting", BoolImportStringCaller( g_xywindow_globals_private.m_bSizePaint ), BoolExportStringCaller( g_xywindow_globals_private.m_bSizePaint ) ); - GlobalPreferenceSystem().registerPreference( "ShowCrosshair", BoolImportStringCaller( g_bCrossHairs ), BoolExportStringCaller( g_bCrossHairs ) ); - GlobalPreferenceSystem().registerPreference( "NoStipple", BoolImportStringCaller( g_xywindow_globals.m_bNoStipple ), BoolExportStringCaller( g_xywindow_globals.m_bNoStipple ) ); - GlobalPreferenceSystem().registerPreference( "SI_ShowCoords", BoolImportStringCaller( g_xywindow_globals_private.show_coordinates ), BoolExportStringCaller( g_xywindow_globals_private.show_coordinates ) ); - GlobalPreferenceSystem().registerPreference( "SI_ShowOutlines", BoolImportStringCaller( g_xywindow_globals_private.show_outline ), BoolExportStringCaller( g_xywindow_globals_private.show_outline ) ); - GlobalPreferenceSystem().registerPreference( "SI_ShowAxis", BoolImportStringCaller( g_xywindow_globals_private.show_axis ), BoolExportStringCaller( g_xywindow_globals_private.show_axis ) ); - GlobalPreferenceSystem().registerPreference( "CamXYUpdate", BoolImportStringCaller( g_xywindow_globals_private.m_bCamXYUpdate ), BoolExportStringCaller( g_xywindow_globals_private.m_bCamXYUpdate ) ); - GlobalPreferenceSystem().registerPreference( "ShowWorkzone", BoolImportStringCaller( g_xywindow_globals_private.d_show_work ), BoolExportStringCaller( g_xywindow_globals_private.d_show_work ) ); - - GlobalPreferenceSystem().registerPreference( "SI_AxisColors0", Vector3ImportStringCaller( g_xywindow_globals.AxisColorX ), Vector3ExportStringCaller( g_xywindow_globals.AxisColorX ) ); - GlobalPreferenceSystem().registerPreference( "SI_AxisColors1", Vector3ImportStringCaller( g_xywindow_globals.AxisColorY ), Vector3ExportStringCaller( g_xywindow_globals.AxisColorY ) ); - GlobalPreferenceSystem().registerPreference( "SI_AxisColors2", Vector3ImportStringCaller( g_xywindow_globals.AxisColorZ ), Vector3ExportStringCaller( g_xywindow_globals.AxisColorZ ) ); - GlobalPreferenceSystem().registerPreference( "SI_Colors1", Vector3ImportStringCaller( g_xywindow_globals.color_gridback ), Vector3ExportStringCaller( g_xywindow_globals.color_gridback ) ); - GlobalPreferenceSystem().registerPreference( "SI_Colors2", Vector3ImportStringCaller( g_xywindow_globals.color_gridminor ), Vector3ExportStringCaller( g_xywindow_globals.color_gridminor ) ); - GlobalPreferenceSystem().registerPreference( "SI_Colors3", Vector3ImportStringCaller( g_xywindow_globals.color_gridmajor ), Vector3ExportStringCaller( g_xywindow_globals.color_gridmajor ) ); - GlobalPreferenceSystem().registerPreference( "SI_Colors6", Vector3ImportStringCaller( g_xywindow_globals.color_gridblock ), Vector3ExportStringCaller( g_xywindow_globals.color_gridblock ) ); - GlobalPreferenceSystem().registerPreference( "SI_Colors7", Vector3ImportStringCaller( g_xywindow_globals.color_gridtext ), Vector3ExportStringCaller( g_xywindow_globals.color_gridtext ) ); - GlobalPreferenceSystem().registerPreference( "SI_Colors8", Vector3ImportStringCaller( g_xywindow_globals.color_brushes ), Vector3ExportStringCaller( g_xywindow_globals.color_brushes ) ); - GlobalPreferenceSystem().registerPreference( "SI_Colors14", Vector3ImportStringCaller( g_xywindow_globals.color_gridmajor_alt ), Vector3ExportStringCaller( g_xywindow_globals.color_gridmajor_alt ) ); - - - GlobalPreferenceSystem().registerPreference( "XZVIS", makeBoolStringImportCallback( ToggleShownImportBoolCaller( g_xz_front_shown ) ), makeBoolStringExportCallback( ToggleShownExportBoolCaller( g_xz_front_shown ) ) ); - GlobalPreferenceSystem().registerPreference( "YZVIS", makeBoolStringImportCallback( ToggleShownImportBoolCaller( g_yz_side_shown ) ), makeBoolStringExportCallback( ToggleShownExportBoolCaller( g_yz_side_shown ) ) ); + GlobalCommands_insert( "NextView", makeCallbackF(XY_Next), Accelerator( GDK_KEY_Tab, (GdkModifierType)GDK_CONTROL_MASK ) ); // fixme: doesn't show its shortcut + GlobalCommands_insert( "ZoomIn", makeCallbackF(XY_ZoomIn), Accelerator( GDK_KEY_Delete ) ); + GlobalCommands_insert( "ZoomOut", makeCallbackF(XY_ZoomOut), Accelerator( GDK_KEY_Insert ) ); + GlobalCommands_insert( "ViewTop", makeCallbackF(XY_Top), Accelerator( GDK_KEY_KP_Home ) ); + GlobalCommands_insert( "ViewSide", makeCallbackF(XY_Side), Accelerator( GDK_KEY_KP_Page_Down ) ); + GlobalCommands_insert( "ViewFront", makeCallbackF(XY_Front), Accelerator( GDK_KEY_KP_End ) ); + GlobalCommands_insert( "Zoom100", makeCallbackF(XY_Zoom100) ); + GlobalCommands_insert( "CenterXYView", makeCallbackF(XY_Focus), Accelerator( GDK_KEY_Tab, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + + GlobalPreferenceSystem().registerPreference( "ClipCaulk", make_property_string( g_clip_useCaulk ) ); + + GlobalPreferenceSystem().registerPreference( "NewRightClick", make_property_string( g_xywindow_globals.m_bRightClick ) ); + GlobalPreferenceSystem().registerPreference( "ChaseMouse", make_property_string( g_xywindow_globals_private.m_bChaseMouse ) ); + GlobalPreferenceSystem().registerPreference( "SizePainting", make_property_string( g_xywindow_globals_private.m_bSizePaint ) ); ++ GlobalPreferenceSystem().registerPreference( "ShowCrosshair", make_property_string( g_xywindow_globals_private.g_bCrossHairs ) ); + GlobalPreferenceSystem().registerPreference( "NoStipple", make_property_string( g_xywindow_globals.m_bNoStipple ) ); + GlobalPreferenceSystem().registerPreference( "SI_ShowCoords", make_property_string( g_xywindow_globals_private.show_coordinates ) ); + GlobalPreferenceSystem().registerPreference( "SI_ShowOutlines", make_property_string( g_xywindow_globals_private.show_outline ) ); + GlobalPreferenceSystem().registerPreference( "SI_ShowAxis", make_property_string( g_xywindow_globals_private.show_axis ) ); + GlobalPreferenceSystem().registerPreference( "CamXYUpdate", make_property_string( g_xywindow_globals_private.m_bCamXYUpdate ) ); + GlobalPreferenceSystem().registerPreference( "ShowWorkzone", make_property_string( g_xywindow_globals_private.d_show_work ) ); + + GlobalPreferenceSystem().registerPreference( "SI_AxisColors0", make_property_string( g_xywindow_globals.AxisColorX ) ); + GlobalPreferenceSystem().registerPreference( "SI_AxisColors1", make_property_string( g_xywindow_globals.AxisColorY ) ); + GlobalPreferenceSystem().registerPreference( "SI_AxisColors2", make_property_string( g_xywindow_globals.AxisColorZ ) ); + GlobalPreferenceSystem().registerPreference( "SI_Colors1", make_property_string( g_xywindow_globals.color_gridback ) ); + GlobalPreferenceSystem().registerPreference( "SI_Colors2", make_property_string( g_xywindow_globals.color_gridminor ) ); + GlobalPreferenceSystem().registerPreference( "SI_Colors3", make_property_string( g_xywindow_globals.color_gridmajor ) ); + GlobalPreferenceSystem().registerPreference( "SI_Colors6", make_property_string( g_xywindow_globals.color_gridblock ) ); + GlobalPreferenceSystem().registerPreference( "SI_Colors7", make_property_string( g_xywindow_globals.color_gridtext ) ); + GlobalPreferenceSystem().registerPreference( "SI_Colors8", make_property_string( g_xywindow_globals.color_brushes ) ); + GlobalPreferenceSystem().registerPreference( "SI_Colors14", make_property_string( g_xywindow_globals.color_gridmajor_alt ) ); + + + GlobalPreferenceSystem().registerPreference( "XZVIS", make_property_string( g_xz_front_shown ) ); + GlobalPreferenceSystem().registerPreference( "YZVIS", make_property_string( g_yz_side_shown ) ); Orthographic_registerPreferencesPage(); Clipper_registerPreferencesPage();