diff --git a/CMakeLists.txt b/CMakeLists.txt index d326a0b83f..fa516f1740 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.12) # Project name and version -project(darkradiant VERSION 3.9.1) +project(darkradiant VERSION 3.9.2) # C++ standard set(CMAKE_CXX_STANDARD 17) diff --git a/debian/changelog b/debian/changelog index 6a36fd10c5..f025e852e8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +darkradiant (3.9.2~jammy1) jammy; urgency=medium + + * Fix incorrect preview rendering of vertex blends between pairs of diffuse + and bump maps. + * Fix inability to choose source and replacement materials using the Skin + Editor GUI. + * Several additional layout and usability improvements to Skin Editor. + * Improvements to layout and organisation of Preferences dialog; consolidate a + few pages and remove obsolete items. + * Add a new preference to control the font size of text in the various source + code editors. + * Fix wxGTK assertion failure on opening Stim/Response editor. + + -- Matthew Mott Mon, 19 Aug 2024 19:24:12 +0100 + darkradiant (3.9.1~jammy1) jammy; urgency=medium * Textures with RGTC normal maps no longer show as black in lighting preview @@ -315,4 +330,3 @@ darkradiant (1.7.0~raring1) raring; urgency=low * 1.7.0 release. -- Matthew Mott Mon, 14 Nov 2011 11:13:41 +0000 - diff --git a/debian/control b/debian/control index 6f87aaf292..2f8b2dc0c5 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: darkradiant Section: editors Priority: optional Maintainer: Matthew Mott -Build-Depends: debhelper (>= 10), cmake (>= 3.12), pkg-config, asciidoctor, libxml2-dev, libglew-dev, python3-dev, libvorbis-dev, libopenal-dev, libalut-dev, libjpeg-dev, libftgl-dev, libwxbase3.0-dev, libwxgtk3.0-gtk3-dev, libsigc++-2.0-dev, libglib2.0-dev, libeigen3-dev, libgit2-dev +Build-Depends: debhelper (>= 10), cmake (>= 3.12), pkg-config, asciidoctor, libxml2-dev, libglew-dev, python3-dev, libvorbis-dev, libopenal-dev, libalut-dev, libjpeg-dev, libftgl-dev, libwxgtk3.2-dev, libsigc++-2.0-dev, libglib2.0-dev, libeigen3-dev, libgit2-dev Homepage: https://www.darkradiant.net/ Vcs-Git: https://gitlab.com/orbweaver/DarkRadiant.git Standards-Version: 4.5.1 diff --git a/doc/manual.adoc b/doc/manual.adoc index 7a8f111a95..f98f026708 100644 --- a/doc/manual.adoc +++ b/doc/manual.adoc @@ -1965,7 +1965,7 @@ primitive. See <>. second selected entity. *Bind selected entities*:: Set a `bind` spawnarg on the first selected entity pointing to the -*second selected entity. +second selected entity. *Entity class tree...*:: Show a tree of all available entity types in the current game, along with all of their properties. Unlike the tree shown in the *Create Entity* dialog, this entity class @@ -2083,18 +2083,6 @@ the 2D views. *Show grid*:: Control the visibility of grid lines in the 2D views. This does not affect the snapping behaviour, just the visual rendering of the grid. -*Show size info*:: Control the visibility of the text overlays which show the - dimensions of a selected object on the X, Y or Z axes. This option is also - available in the `View -> Show` menu. - -*Show entity angle arrow*:: Hide or show the small arrow which indicates the - direction of an entity with an `angle` spawnarg, such as `info_player_start`. - This affects both the 2D and 3D views. - -*Show entity names*:: Enable this to show permanently-visible text names next to - each entity in the map. This option is also available as `View -> Show -> Show - names`. - *Show blocks*:: If enabled, the world space is divided into a horizontal grid of 1024x1024 unit blocks (of infinite height) which are outlined in blue in the 2D views. Each block is assigned a pair of numbers representing its position from @@ -2102,24 +2090,6 @@ the 2D views. "blocking out" a map at the beginning of the design phase. This option is also available in the `View -> Show` menu. -*Show coordinates*:: Toggle the visibility of the coordinate rulers along the - edges of the 2D window. Also available in the `View -> Show` menu. - -*Show axes*:: Control the visibility of the axis widget displayed at the - top-left of each 2D window and at the world origin. Also available in the `View - -> Show` menu. - -*Show window outline*:: Enable this to draw a rectangular outline around the - edge of the 2D window. Depending on the platform and GUI theme this may be - almost invisible, but might be useful to improve visibility in certain - environments. - -*Show workzone*:: The 'workzone' is an imaginary axis-aligned cuboid which - encloses the set of currently-selected items (this is what defines the volume - of a new light, when a <> from one or more - existing brushes). Enabling this option causes the workzone to be outlined in - red in the 2D views. Also available in the `View -> Show` menu. - *Translate manipulator always constrained to axis*:: This option affects the behaviour of the <>. When the option is disabled, dragging a selected object in translation mode will behave as if the @@ -2135,11 +2105,17 @@ the 2D views. controls whether DarkRadiant will prefer to select the entity (enabled) or the brush (disabled). -==== Multi Monitor settings +==== User Interface settings + +*Start on Monitor*:: If you have more than one monitor, you can choose which +monitor DarkRadiant will start on using this combo box. + +*Source view font size*:: This controls the point size of the monospace font +used in source code view widgets, such as those which show material or skin +source declarations. -The Multi Monitor page contains a single setting, *Start DarkRadiant on -monitor*, which allows you to choose which monitor DarkRadiant will start on if -you have several available. +*Language*:: This combo box lists all of the installed language packs, allowing +you to choose which language is used for the DarkRadiant interface. ==== Autosave settings diff --git a/include/ishaderlayer.h b/include/ishaderlayer.h index 5b699d5e3c..9a209094cf 100644 --- a/include/ishaderlayer.h +++ b/include/ishaderlayer.h @@ -482,6 +482,7 @@ inline std::ostream& operator<< (std::ostream& os, IShaderLayer::VertexColourMod default: return os; } + return os; } inline std::ostream& operator<< (std::ostream& os, IShaderLayer::Type type) @@ -498,6 +499,7 @@ inline std::ostream& operator<< (std::ostream& os, IShaderLayer::Type type) default: return os; } + return os; } inline std::ostream& operator<< (std::ostream& os, IShaderLayer& layer) diff --git a/install/bitmaps/add.png b/install/bitmaps/add.png new file mode 100644 index 0000000000..df79ba40fa Binary files /dev/null and b/install/bitmaps/add.png differ diff --git a/install/bitmaps/delete.png b/install/bitmaps/delete.png index 44641d0308..3a108ef298 100644 Binary files a/install/bitmaps/delete.png and b/install/bitmaps/delete.png differ diff --git a/install/scripts/commands/ase_export.py b/install/scripts/commands/ase_export.py index 9bc953ece4..09b81769fe 100644 --- a/install/scripts/commands/ase_export.py +++ b/install/scripts/commands/ase_export.py @@ -272,7 +272,7 @@ def visit(self, scenenode): \t\t\t*MAP_CLASS "Bitmap" \t\t\t*MAP_SUBNO 1 \t\t\t*MAP_AMOUNT 1.0000 -\t\t\t*BITMAP "\\\\purgatory\\purgatory\\doom\\base\{2}" +\t\t\t*BITMAP "//base/{2}" \t\t\t*MAP_TYPE Screen \t\t\t*UVW_U_OFFSET 0.0000 \t\t\t*UVW_V_OFFSET 0.0000 @@ -288,7 +288,7 @@ def visit(self, scenenode): \t\t\t*BITMAP_FILTER Pyramidal \t\t}} \t}} -'''.format(shaderlist.index(x), x, x.replace('/','\\')) +'''.format(shaderlist.index(x), x, x) geomobjects = str() diff --git a/install/scripts/commands/ase_export_blend.py b/install/scripts/commands/ase_export_blend.py index 773cc2ebaa..be8e39e7e7 100644 --- a/install/scripts/commands/ase_export_blend.py +++ b/install/scripts/commands/ase_export_blend.py @@ -350,7 +350,7 @@ def visit(self, scenenode): \t\t\t*MAP_CLASS "Bitmap" \t\t\t*MAP_SUBNO 1 \t\t\t*MAP_AMOUNT 1.0000 -\t\t\t*BITMAP "\\\\purgatory\\purgatory\\doom\\base\{2}" +\t\t\t*BITMAP "//base/{2}" \t\t\t*MAP_TYPE Screen \t\t\t*UVW_U_OFFSET 0.0000 \t\t\t*UVW_V_OFFSET 0.0000 diff --git a/install/ui/aboutdialog.fbp b/install/ui/aboutdialog.fbp index 66cb96393e..4a49070f5f 100644 --- a/install/ui/aboutdialog.fbp +++ b/install/ui/aboutdialog.fbp @@ -14,9 +14,10 @@ aboutdialog 1000 none + 0 - MyProject1 + AboutDialog . @@ -25,6 +26,7 @@ 1 1 UI + 0 0 0 @@ -46,6 +48,7 @@ -1,-1 + 0 wxTAB_TRAVERSAL @@ -58,16 +61,16 @@ 12 wxALL|wxEXPAND 0 - + bSizer2 wxHORIZONTAL none - + 6 wxALL 0 - + 1 1 1 @@ -121,20 +124,20 @@ - + 6 wxLEFT 1 - + bSizer3 wxVERTICAL none - + 6 wxBOTTOM 0 - + 1 1 1 @@ -191,11 +194,11 @@ -1 - + 6 wxBOTTOM 0 - + 1 1 1 @@ -252,11 +255,11 @@ -1 - + 6 wxTOP 0 - + 1 1 1 @@ -320,17 +323,17 @@ 12 wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - + 1 + bSizer4 wxVERTICAL none - + 6 wxBOTTOM 0 - + 1 1 1 @@ -387,11 +390,11 @@ -1 - + 12 wxLEFT 0 - + 1 1 1 @@ -448,11 +451,11 @@ -1 - + 6 wxBOTTOM|wxTOP 0 - + 1 1 1 @@ -509,20 +512,20 @@ -1 - + 12 wxEXPAND|wxLEFT - 1 - + 0 + bSizer5 wxVERTICAL none - + 6 0 - + 1 1 1 @@ -579,11 +582,11 @@ -1 - + 6 wxTOP 0 - + 1 1 1 @@ -640,11 +643,11 @@ -1 - + 6 wxTOP 0 - + 1 1 1 @@ -703,11 +706,11 @@ - + 6 wxBOTTOM|wxTOP 0 - + 1 1 1 @@ -764,11 +767,11 @@ -1 - + 12 wxEXPAND|wxLEFT - 0 - + 1 + 1 1 1 @@ -843,6 +846,7 @@ + 0 diff --git a/install/ui/aboutdialog.xrc b/install/ui/aboutdialog.xrc index c607b22e31..e510cd3ada 100644 --- a/install/ui/aboutdialog.xrc +++ b/install/ui/aboutdialog.xrc @@ -56,7 +56,7 @@ - + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT 12 @@ -89,7 +89,7 @@ - + wxEXPAND|wxLEFT 12 @@ -133,7 +133,7 @@ - + wxEXPAND|wxLEFT 12 @@ -151,6 +151,7 @@ 0 + 0 0 diff --git a/install/ui/conversationdialog.fbp b/install/ui/conversationdialog.fbp index 14482583c8..b26e8aa126 100644 --- a/install/ui/conversationdialog.fbp +++ b/install/ui/conversationdialog.fbp @@ -1,1083 +1,1113 @@ - + - - - - XRC - 1 - source_name - 0 - 0 - res - UTF-8 - connect - conversationdialog - 1000 - none - - 0 - MyProject2 - - . - - 1 - 1 - 1 - 1 - UI - 0 - 0 - - 0 - wxAUI_MGR_DEFAULT + + + XRC + + 1 + connect + none + + + 0 + 0 + res + UTF-8 + conversationdialog + 1000 + 0 + 1 + UI + MyProject2 + . + 0 + source_name + 1 + 0 + source_name + + + 1 + 1 + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 0 + 1 + impl_virtual + + + 0 + wxID_ANY + + + ConvDialogMainPanel + + -1,-1 + + + 0 + + + wxTAB_TRAVERSAL + + + bSizer5 + wxVERTICAL + none + + 12 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left + 0 1 - impl_virtual + 1 + 0 0 wxID_ANY + Conversation Entities + 0 + + 0 + + 0 - ConvDialogMainPanel + 1 + ConvDialogEntityLabel + 1 + + + protected + 1 - 500,500 + Resizable + 1 + + + 0 - wxTAB_TRAVERSAL - + + -1 + + + + 12 + wxEXPAND|wxLEFT|wxRIGHT|wxTOP + 1 + + + bSizer61 + wxHORIZONTAL + none + + 6 + wxEXPAND|wxRIGHT + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + ConvDialogEntityPanel + 1 + + + protected + 1 + + Resizable + 1 + -1,120 + + 0 + + + + wxTAB_TRAVERSAL + + + bSizer7 + wxVERTICAL + none + + + + + 5 + wxEXPAND + 0 + - bSizer5 + ButtonSizer1 wxVERTICAL none - - 12 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Conversation Entities - 0 - - 0 - - - 0 - - 1 - ConvDialogEntityLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - + + 6 + wxBOTTOM|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + Load From File; ../bitmaps/add.png + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + ConvDialogAddEntityButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + Add a new conversation entity + + wxFILTER_NONE + wxDefaultValidator + + + + + - - 12 - wxEXPAND|wxLEFT|wxRIGHT|wxTOP - 1 - - - bSizer61 - wxHORIZONTAL - none - - 6 - wxEXPAND|wxRIGHT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - ConvDialogEntityPanel - 1 - - - protected - 1 - - Resizable - 1 - -1,120 - - 0 - - - - wxTAB_TRAVERSAL - - - bSizer7 - wxVERTICAL - none - - - - - 5 - wxEXPAND - 0 - - - ButtonSizer1 - wxVERTICAL - none - - 6 - wxBOTTOM|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Add - - 0 - - 0 - - - 0 - - 1 - ConvDialogAddEntityButton - 1 - - - protected - 1 - - - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 6 - wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Delete - - 0 - - 0 - - - 0 - - 1 - ConvDialogDeleteEntityButton - 1 - - - protected - 1 - - - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - + + 6 + wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + Load From File; ../bitmaps/delete.png + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + ConvDialogDeleteEntityButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + Delete the selected conversation entity + + wxFILTER_NONE + wxDefaultValidator + + + + + - - 12 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Conversations - 0 - - 0 - - - 0 - - 1 - ConvDialogConvLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - + + + + + + 12 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Conversations + 0 + + 0 + + + 0 + + 1 + ConvDialogConvLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 12 + wxEXPAND|wxLEFT|wxRIGHT|wxTOP + 1 + + + bSizer6 + wxHORIZONTAL + none + + 6 + wxEXPAND|wxRIGHT + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + ConvDialogConversationPanel + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + wxTAB_TRAVERSAL + + + bSizer9 + wxVERTICAL + none + + + + + 12 + + 0 + + + ButtonSizer + wxVERTICAL + none + + 6 + wxBOTTOM|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + Load From File; ../bitmaps/add.png + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + ConvDialogAddConvButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + Add a conversation + + wxFILTER_NONE + wxDefaultValidator + + + + + - - 12 - wxEXPAND|wxLEFT|wxRIGHT|wxTOP - 1 - - - bSizer6 - wxHORIZONTAL - none - - 6 - wxEXPAND|wxRIGHT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - ConvDialogConversationPanel - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - bSizer9 - wxVERTICAL - none - - - - - 12 - - 0 - - - ButtonSizer - wxVERTICAL - none - - 6 - wxBOTTOM|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Add - - 0 - - 0 - - - 0 - - 1 - ConvDialogAddConvButton - 1 - - - protected - 1 - - - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 6 - wxBOTTOM|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Edit - - 0 - - 0 - - - 0 - - 1 - ConvDialogEditConvButton - 1 - - - protected - 1 - - - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 6 - wxBOTTOM|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Move Up - - 0 - - 0 - - - 0 - - 1 - ConvDialogMoveUpConvButton - 1 - - - protected - 1 - - - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 6 - wxBOTTOM|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Move Down - - 0 - - 0 - - - 0 - - 1 - ConvDialogMoveDownConvButton - 1 - - - protected - 1 - - - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 6 - wxBOTTOM|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Delete - - 0 - - 0 - - - 0 - - 1 - ConvDialogDeleteConvButton - 1 - - - protected - 1 - - - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 6 - wxBOTTOM|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Clear - - 0 - - 0 - - - 0 - - 1 - ConvDialogClearConvButton - 1 - - - protected - 1 - - - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - + + 6 + wxBOTTOM|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + Load From File; ../bitmaps/edit.png + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + ConvDialogEditConvButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + Edit the selected conversation + + wxFILTER_NONE + wxDefaultValidator + + + + + - - 12 - wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP - 0 - - - bSizer8 - wxHORIZONTAL - none - - 6 - wxEXPAND|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Cancel - - 0 - - 0 - - - 0 - - 1 - ConvDialogCancelButton - 1 - - - protected - 1 - - - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 6 - wxEXPAND|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - OK - - 0 - - 0 - - - 0 - - 1 - ConvDialogOkButton - 1 - - - protected - 1 - - - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - + + 6 + wxBOTTOM|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + Load From File; ../bitmaps/arrow_up_blue.png + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + ConvDialogMoveUpConvButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + Move the selected conversation up + + wxFILTER_NONE + wxDefaultValidator + + + + + + + 6 + wxBOTTOM|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + Load From File; ../bitmaps/arrow_down_blue.png + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + ConvDialogMoveDownConvButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + Move the selected conversation down + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 6 + wxBOTTOM|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + Load From File; ../bitmaps/delete.png + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + ConvDialogDeleteConvButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + Delete the selected conversation + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 6 + wxBOTTOM|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Clear + + 0 + + 0 + + + 0 + + 1 + ConvDialogClearConvButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + Clear all conversations + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + 12 + wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP + 0 + + + bSizer8 + wxHORIZONTAL + none + + 6 + wxEXPAND|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Cancel + + 0 + + 0 + + + 0 + + 1 + ConvDialogCancelButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 6 + wxEXPAND|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + OK + + 0 + + 0 + + + 0 + + 1 + ConvDialogOkButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + diff --git a/install/ui/conversationdialog.xrc b/install/ui/conversationdialog.xrc index 6d0a52eb12..ef9cb57087 100644 --- a/install/ui/conversationdialog.xrc +++ b/install/ui/conversationdialog.xrc @@ -1,209 +1,218 @@ - - - - - 500,500 - - wxVERTICAL - - - wxLEFT|wxRIGHT|wxTOP - 12 - - - -1 - - - - - wxEXPAND|wxLEFT|wxRIGHT|wxTOP - 12 - - wxHORIZONTAL - - - wxEXPAND|wxRIGHT - 6 - - - -1,120 - - wxVERTICAL - - - - - - wxEXPAND - 5 - - wxVERTICAL - - - wxBOTTOM|wxEXPAND - 6 - - 80,-1 - - 0 - 0 - - - - - - wxEXPAND - 6 - - 80,-1 - - 0 - 0 - - - - - - - - - - wxLEFT|wxRIGHT|wxTOP - 12 - - - -1 - - - - - wxEXPAND|wxLEFT|wxRIGHT|wxTOP - 12 - - wxHORIZONTAL - - - wxEXPAND|wxRIGHT - 6 - - - - wxVERTICAL - - - - - - - 12 - - wxVERTICAL - - - wxBOTTOM|wxEXPAND - 6 - - 80,-1 - - 0 - 0 - - - - - - wxBOTTOM|wxEXPAND - 6 - - 80,-1 - - 0 - 0 - - - - - - wxBOTTOM|wxEXPAND - 6 - - 80,-1 - - 0 - 0 - - - - - - wxBOTTOM|wxEXPAND - 6 - - 80,-1 - - 0 - 0 - - - - - - wxBOTTOM|wxEXPAND - 6 - - 80,-1 - - 0 - 0 - - - - - - wxBOTTOM|wxEXPAND - 6 - - 80,-1 - - 0 - 0 - - - - - - - - - - wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP - 12 - - wxHORIZONTAL - - - wxEXPAND|wxLEFT - 6 - - - 0 - 0 - - - - - - wxEXPAND|wxLEFT - 6 - - - 0 - 0 - - - - - - - + + + + + + wxVERTICAL + + wxLEFT|wxRIGHT|wxTOP + 12 + + + + -1 + + + + wxEXPAND|wxLEFT|wxRIGHT|wxTOP + 12 + + + wxHORIZONTAL + + wxEXPAND|wxRIGHT + 6 + + + -1,120 + + + wxVERTICAL + + + + + wxEXPAND + 5 + + + wxVERTICAL + + wxBOTTOM|wxEXPAND + 6 + + + Add a new conversation entity + + 0 + 0 + 0 + ../bitmaps/add.png + + + + wxEXPAND + 6 + + + Delete the selected conversation entity + + 0 + 0 + 0 + ../bitmaps/delete.png + + + + + + + + wxLEFT|wxRIGHT|wxTOP + 12 + + + + -1 + + + + wxEXPAND|wxLEFT|wxRIGHT|wxTOP + 12 + + + wxHORIZONTAL + + wxEXPAND|wxRIGHT + 6 + + + + + wxVERTICAL + + + + + + 12 + + + wxVERTICAL + + wxBOTTOM|wxEXPAND + 6 + + + Add a conversation + + 0 + 0 + 0 + ../bitmaps/add.png + + + + wxBOTTOM|wxEXPAND + 6 + + + Edit the selected conversation + + 0 + 0 + 0 + ../bitmaps/edit.png + + + + wxBOTTOM|wxEXPAND + 6 + + + Move the selected conversation up + + 0 + 0 + 0 + ../bitmaps/arrow_up_blue.png + + + + wxBOTTOM|wxEXPAND + 6 + + + Move the selected conversation down + + 0 + 0 + 0 + ../bitmaps/arrow_down_blue.png + + + + wxBOTTOM|wxEXPAND + 6 + + + Delete the selected conversation + + 0 + 0 + 0 + ../bitmaps/delete.png + + + + wxBOTTOM|wxEXPAND + 6 + + + Clear all conversations + + 0 + 0 + 0 + + + + + + + + + wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP + 12 + + + wxHORIZONTAL + + wxEXPAND|wxLEFT + 6 + + + + 0 + 0 + 0 + + + + + wxEXPAND|wxLEFT + 6 + + + + 0 + 0 + 0 + + + + + + + diff --git a/install/ui/conversationeditor.fbp b/install/ui/conversationeditor.fbp index 1215a80b2b..550f41c4f0 100644 --- a/install/ui/conversationeditor.fbp +++ b/install/ui/conversationeditor.fbp @@ -1,2087 +1,1655 @@ - + - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - - 1000 - none - 0 - MyProject2 - - . - - 1 - 1 - 1 - 1 - UI - 0 - 0 - - 0 - wxAUI_MGR_DEFAULT + + + XRC + + 1 + connect + none + + + 0 + 0 + res + UTF-8 + conversationeditor + 1000 + 0 + 1 + UI + MyProject2 + . + 0 + source_name + 1 + 0 + source_name + + 1 + 1 + 1 + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 0 + 1 + impl_virtual + + + 0 + wxID_ANY + + + ConvEditorMainPanel + + -1,-1 + + + 0 + + + wxTAB_TRAVERSAL + + + bSizer5 + wxVERTICAL + none + + 12 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left + 0 1 - impl_virtual + 1 + 0 0 wxID_ANY + Properties + 0 + + 0 + + 0 - ConvEditorMainPanel + 1 + ConvEditorPropertyLabel + 1 + + + protected + 1 - 500,650 + Resizable + 1 + + + 0 - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + -1 + + + + 18 + wxEXPAND|wxLEFT|wxRIGHT + 0 + + + bSizer11 + wxVERTICAL + none + + 6 + wxBOTTOM|wxEXPAND|wxTOP + 1 + + + bSizer12 + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Name: + 0 + + 0 + + + 0 + + 1 + m_staticText4 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 0 + wxALIGN_CENTER_VERTICAL + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + ConvEditorNameEntry + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + 6 + wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Actors must be within talk distance + + 0 + + + 0 + + 1 + ConvEditorActorsWithinTalkDistance + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 6 + wxBOTTOM|wxLEFT|wxTOP + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Actors always face each other while talking + + 0 + + + 0 - bSizer5 + 1 + ConvEditorActorsMustFace + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 2 + wxBOTTOM|wxEXPAND|wxTOP + 0 + + + bSizer13 + wxHORIZONTAL + none + + 6 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Let this conversation play + + 0 + + + 0 + + 1 + ConvEditorRepeatCheckbox + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 6 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 9999 + + 0 + + -1 + + 0 + + 1 + ConvEditorRepeatTimes + 1 + + + protected + 1 + + Resizable + 1 + 60,-1 + wxSP_ARROW_KEYS + + 0 + + -1 + + + + + + + 6 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + times at maximum + 0 + + 0 + + + 0 + + 1 + ConvEditorRepeatAdditionalText + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + 12 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Actors + 0 + + 0 + + + 0 + -1,-1 + 1 + ConvEditorActorLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 12 + wxEXPAND|wxLEFT|wxRIGHT|wxTOP + 1 + + + bSizer61 + wxHORIZONTAL + none + + 6 + wxEXPAND|wxLEFT|wxRIGHT + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + -1,160 + 1 + ConvEditorActorPanel + 1 + + + protected + 1 + + Resizable + 1 + -1,160 + + 0 + + + + wxTAB_TRAVERSAL + + + bSizer7 + wxVERTICAL + none + + + + + 5 + wxEXPAND + 0 + + + ButtonSizer1 wxVERTICAL none - - 12 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Properties - - 0 - - - 0 - - 1 - ConvEditorPropertyLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - + + 6 + wxBOTTOM|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + Load From File; ../bitmaps/add.png + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + ConvEditorAddActorButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + - - 18 - wxEXPAND|wxLEFT|wxRIGHT - 0 - - - bSizer11 - wxVERTICAL - none - - 6 - wxBOTTOM|wxEXPAND|wxTOP - 1 - - - bSizer12 - wxHORIZONTAL - none - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Name: - - 0 - - - 0 - - 1 - m_staticText4 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - wxALIGN_CENTER_VERTICAL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - ConvEditorNameEntry - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 - wxBOTTOM|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Actors must be within talk distance - - 0 - - - 0 - - 1 - ConvEditorActorsWithinTalkDistance - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 - wxBOTTOM|wxLEFT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Actors always face each other while talking - - 0 - - - 0 - - 1 - ConvEditorActorsMustFace - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 - wxBOTTOM|wxEXPAND|wxTOP - 0 - - - bSizer13 - wxHORIZONTAL - none - - 6 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Let this conversation play - - 0 - - - 0 - - 1 - ConvEditorRepeatCheckbox - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 0 - 9999 - - 0 - - -1 - - 0 - - 1 - ConvEditorRepeatTimes - 1 - - - protected - 1 - - Resizable - 1 - 60,-1 - wxSP_ARROW_KEYS - - 0 - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - times at maximum - - 0 - - - 0 - - 1 - ConvEditorRepeatAdditionalText - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + 6 + wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + Load From File; ../bitmaps/delete.png + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + ConvEditorDeleteActorButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + - - 12 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Actors - - 0 - - - 0 - -1,-1 - 1 - ConvEditorActorLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - + + 6 + wxEXPAND|wxTOP + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Validate all + + 0 + + 0 + + + 0 + + 1 + ConvEditorValidateActorsButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + - - 12 - wxEXPAND|wxLEFT|wxRIGHT|wxTOP - 1 - - - bSizer61 - wxHORIZONTAL - none - - 6 - wxEXPAND|wxLEFT|wxRIGHT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - -1,160 - 1 - ConvEditorActorPanel - 1 - - - protected - 1 - - Resizable - 1 - -1,160 - - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - bSizer7 - wxVERTICAL - none - - - - - 5 - wxEXPAND - 0 - - - ButtonSizer1 - wxVERTICAL - none - - 6 - wxBOTTOM|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Add - - 0 - - - 0 - - 1 - ConvEditorAddActorButton - 1 - - - protected - 1 - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 - wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Delete - - 0 - - - 0 - - 1 - ConvEditorDeleteActorButton - 1 - - - protected - 1 - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 - wxEXPAND|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Validate all - - 0 - - - 0 - - 1 - ConvEditorValidateActorsButton - 1 - - - protected - 1 - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + 12 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Commands + 0 + + 0 + + + 0 + + 1 + ConvEditorCommandLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 12 + wxEXPAND|wxLEFT|wxRIGHT|wxTOP + 1 + + + bSizer6 + wxHORIZONTAL + none + + 6 + wxEXPAND|wxLEFT|wxRIGHT + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + -1,200 + 1 + ConvEditorCommandPanel + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + + 0 + + + + wxTAB_TRAVERSAL + + + bSizer9 + wxVERTICAL + none + + + + + 12 + + 0 + + + ButtonSizer + wxVERTICAL + none + + 6 + wxBOTTOM|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + Load From File; ../bitmaps/add.png + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + ConvEditorAddCommandButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 6 + wxBOTTOM|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + Load From File; ../bitmaps/edit.png + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + ConvEditorEditCommandButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + - - 12 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Commands - - 0 - - - 0 - - 1 - ConvEditorCommandLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - + + 6 + wxBOTTOM|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + Load From File; ../bitmaps/arrow_up_blue.png + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + ConvEditorMoveUpCommandButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + - - 12 - wxEXPAND|wxLEFT|wxRIGHT|wxTOP - 1 - - - bSizer6 - wxHORIZONTAL - none - - 6 - wxEXPAND|wxLEFT|wxRIGHT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - -1,200 - 1 - ConvEditorCommandPanel - 1 - - - protected - 1 - - Resizable - 1 - -1,-1 - - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - bSizer9 - wxVERTICAL - none - - - - - 12 - - 0 - - - ButtonSizer - wxVERTICAL - none - - 6 - wxBOTTOM|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Add - - 0 - - - 0 - - 1 - ConvEditorAddCommandButton - 1 - - - protected - 1 - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 - wxBOTTOM|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Edit - - 0 - - - 0 - - 1 - ConvEditorEditCommandButton - 1 - - - protected - 1 - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 - wxBOTTOM|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Move up - - 0 - - - 0 - - 1 - ConvEditorMoveUpCommandButton - 1 - - - protected - 1 - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 - wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Move down - - 0 - - - 0 - - 1 - ConvEditorMoveDownCommandButton - 1 - - - protected - 1 - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 - wxBOTTOM|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Delete - - 0 - - - 0 - - 1 - ConvEditorDeleteCommandButton - 1 - - - protected - 1 - - Resizable - 1 - 80,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + 6 + wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + Load From File; ../bitmaps/arrow_down_blue.png + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + ConvEditorMoveDownCommandButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + - - 12 - wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP - 0 - - - bSizer8 - wxHORIZONTAL - none - - 6 - wxEXPAND|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Cancel - - 0 - - - 0 - - 1 - ConvEditorCancelButton - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 - wxEXPAND|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - OK - - 0 - - - 0 - - 1 - ConvEditorOkButton - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + 6 + wxBOTTOM|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + Load From File; ../bitmaps/delete.png + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + ConvEditorDeleteCommandButton + 1 + + + protected + 1 + + + + Resizable + 1 + -1,-1 + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + 12 + wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP + 0 + + + bSizer8 + wxHORIZONTAL + none + + 6 + wxEXPAND|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Cancel + + 0 + + 0 + + + 0 + + 1 + ConvEditorCancelButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 6 + wxEXPAND|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + OK + + 0 + + 0 + + + 0 + + 1 + ConvEditorOkButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + diff --git a/install/ui/conversationeditor.xrc b/install/ui/conversationeditor.xrc index 945118a704..836c3687e9 100644 --- a/install/ui/conversationeditor.xrc +++ b/install/ui/conversationeditor.xrc @@ -1,287 +1,309 @@ - - - - - 500,650 - - wxVERTICAL - - - wxLEFT|wxRIGHT|wxTOP - 12 - - - -1 - - - - - wxEXPAND|wxLEFT|wxRIGHT - 18 - - wxVERTICAL - - - wxBOTTOM|wxEXPAND|wxTOP - 6 - - wxHORIZONTAL - - - wxALIGN_CENTER_VERTICAL|wxALL - 5 - - - -1 - - - - - wxALIGN_CENTER_VERTICAL - 0 - - - - - - - - - wxBOTTOM|wxLEFT - 6 - - - 0 - - - - - wxBOTTOM|wxLEFT|wxTOP - 6 - - - 0 - - - - - wxBOTTOM|wxEXPAND|wxTOP - 2 - - wxHORIZONTAL - - - wxALIGN_CENTER_VERTICAL|wxLEFT - 6 - - - 0 - - - - - wxALIGN_CENTER_VERTICAL|wxLEFT - 6 - - - 60,-1 - 0 - -1 - 9999 - - - - - wxALIGN_CENTER_VERTICAL|wxLEFT - 6 - - - -1 - - - - - - - - - wxLEFT|wxRIGHT|wxTOP - 12 - - - -1 - - - - - wxEXPAND|wxLEFT|wxRIGHT|wxTOP - 12 - - wxHORIZONTAL - - - wxEXPAND|wxLEFT|wxRIGHT - 6 - - - -1,160 - - wxVERTICAL - - - - - - wxEXPAND - 5 - - wxVERTICAL - - - wxBOTTOM|wxEXPAND - 6 - - 80,-1 - - 0 - - - - - wxEXPAND - 6 - - 80,-1 - - 0 - - - - - wxEXPAND|wxTOP - 6 - - 80,-1 - - 0 - - - - - - - - - wxLEFT|wxRIGHT|wxTOP - 12 - - - -1 - - - - - wxEXPAND|wxLEFT|wxRIGHT|wxTOP - 12 - - wxHORIZONTAL - - - wxEXPAND|wxLEFT|wxRIGHT - 6 - - - - wxVERTICAL - - - - - - - 12 - - wxVERTICAL - - - wxBOTTOM|wxEXPAND - 6 - - 80,-1 - - 0 - - - - - wxBOTTOM|wxEXPAND - 6 - - 80,-1 - - 0 - - - - - wxBOTTOM|wxEXPAND - 6 - - 80,-1 - - 0 - - - - - wxBOTTOM - 6 - - 80,-1 - - 0 - - - - - wxBOTTOM|wxEXPAND - 6 - - 80,-1 - - 0 - - - - - - - - - wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP - 12 - - wxHORIZONTAL - - - wxEXPAND|wxLEFT - 6 - - - 0 - - - - - wxEXPAND|wxLEFT - 6 - - - 0 - - - - - - + + + + + + wxVERTICAL + + wxLEFT|wxRIGHT|wxTOP + 12 + + + + -1 + + + + wxEXPAND|wxLEFT|wxRIGHT + 18 + + + wxVERTICAL + + wxBOTTOM|wxEXPAND|wxTOP + 6 + + + wxHORIZONTAL + + wxALIGN_CENTER_VERTICAL|wxALL + 5 + + + + -1 + + + + wxALIGN_CENTER_VERTICAL + 0 + + + + 0 + + + + + + wxBOTTOM|wxLEFT + 6 + + + + 0 + + + + wxBOTTOM|wxLEFT|wxTOP + 6 + + + + 0 + + + + wxBOTTOM|wxEXPAND|wxTOP + 2 + + + wxHORIZONTAL + + wxALIGN_CENTER_VERTICAL|wxLEFT + 6 + + + + 0 + + + + wxALIGN_CENTER_VERTICAL|wxLEFT + 6 + + + 60,-1 + + 0 + -1 + 9999 + + + + wxALIGN_CENTER_VERTICAL|wxLEFT + 6 + + + + -1 + + + + + + + + wxLEFT|wxRIGHT|wxTOP + 12 + + + + -1 + + + + wxEXPAND|wxLEFT|wxRIGHT|wxTOP + 12 + + + wxHORIZONTAL + + wxEXPAND|wxLEFT|wxRIGHT + 6 + + + -1,160 + + + wxVERTICAL + + + + + wxEXPAND + 5 + + + wxVERTICAL + + wxBOTTOM|wxEXPAND + 6 + + + + 0 + 0 + 0 + ../bitmaps/add.png + + + + wxEXPAND + 6 + + + + 0 + 0 + 0 + ../bitmaps/delete.png + + + + wxEXPAND|wxTOP + 6 + + + + 0 + 0 + 0 + + + + + + + + + wxLEFT|wxRIGHT|wxTOP + 12 + + + + -1 + + + + wxEXPAND|wxLEFT|wxRIGHT|wxTOP + 12 + + + wxHORIZONTAL + + wxEXPAND|wxLEFT|wxRIGHT + 6 + + + + + wxVERTICAL + + + + + + 12 + + + wxVERTICAL + + wxBOTTOM|wxEXPAND + 6 + + + + 0 + 0 + 0 + ../bitmaps/add.png + + + + wxBOTTOM|wxEXPAND + 6 + + + + 0 + 0 + 0 + ../bitmaps/edit.png + + + + wxBOTTOM|wxEXPAND + 6 + + + + 0 + 0 + 0 + ../bitmaps/arrow_up_blue.png + + + + wxBOTTOM + 6 + + + + 0 + 0 + 0 + ../bitmaps/arrow_down_blue.png + + + + wxBOTTOM|wxEXPAND + 6 + + + + 0 + 0 + 0 + ../bitmaps/delete.png + + + + + + + + wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP + 12 + + + wxHORIZONTAL + + wxEXPAND|wxLEFT + 6 + + + + 0 + 0 + 0 + + + + + wxEXPAND|wxLEFT + 6 + + + + 0 + 0 + 0 + + + + + + + diff --git a/install/ui/objectivecomponentsdialog.fbp b/install/ui/objectivecomponentsdialog.fbp index 8a2a0a1b01..b5346f20a6 100644 --- a/install/ui/objectivecomponentsdialog.fbp +++ b/install/ui/objectivecomponentsdialog.fbp @@ -3,7 +3,7 @@ - C++ + XRC 1 source_name 0 @@ -11,12 +11,13 @@ res UTF-8 connect - + objectivecomponentsdialog 1000 none + 0 - MyProject2 + objectivecomponentsdialog . @@ -25,6 +26,7 @@ 1 1 UI + 0 0 0 @@ -46,105 +48,231 @@ 670,600 + 0 wxTAB_TRAVERSAL - bSizer10 + bSizer11 wxVERTICAL none - 12 - wxALL|wxEXPAND - 1 - + 0 + wxEXPAND + 0 + + 2 + wxBOTH + 1 + + 12 - bSizer11 - wxVERTICAL + fgSizer1 + wxFLEX_GROWMODE_SPECIFIED none - - 0 + 8 + 10 + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Description + 0 + + 0 + + + 0 + + 1 + m_staticText4 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 wxEXPAND 0 - - 2 - wxBOTH - 1 - - 12 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + ObjCompDescription + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Difficulty + 0 + + 0 + + + 0 + + 1 + Diff + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 0 + wxEXPAND + 1 + - fgSizer1 - wxFLEX_GROWMODE_SPECIFIED + bSizer12 + wxHORIZONTAL none - 8 - 10 - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Description - 0 - - 0 - - - 0 - - 1 - m_staticText4 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - 5 + 0 wxEXPAND - 0 - + 1 + 1 1 1 @@ -175,12 +303,11 @@ 0 - 0 1 - ObjCompDescription + ObjCompDiffPanel 1 @@ -190,38 +317,236 @@ Resizable 1 - 0 - - wxFILTER_NONE - wxDefaultValidator - - - + wxTAB_TRAVERSAL + + + bSizer13 + wxHORIZONTAL + none + - - 5 - - 0 - - 1 - 1 - 1 - 1 - - - - - - + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Initial State + 0 + + 0 + + + 0 + + 1 + m_staticText6 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + ObjCompInitialState + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 0 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Flags + 0 + + 0 + + + 0 + + 1 + m_staticText26 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxEXPAND + 1 + + + bSizer34 + wxHORIZONTAL + none + + 0 + wxALIGN_CENTER_VERTICAL|wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + 1 0 + 0 1 1 @@ -236,8 +561,7 @@ 0 0 wxID_ANY - Difficulty - 0 + Mandatory 0 @@ -245,7 +569,7 @@ 0 1 - Diff + ObjCompObjMandatory 1 @@ -259,91 +583,84 @@ 0 + + wxFILTER_NONE + wxDefaultValidator + - -1 - - 0 - wxEXPAND + + 6 + wxALIGN_CENTER_VERTICAL|wxLEFT 1 - + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Ongoing + + 0 + + + 0 - bSizer12 - wxHORIZONTAL - none - - 0 - wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - ObjCompDiffPanel - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - bSizer13 - wxHORIZONTAL - none - - - + 1 + ObjCompObjOngoing + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + - 5 - wxALIGN_CENTER_VERTICAL - 0 - + 6 + wxALIGN_CENTER_VERTICAL|wxLEFT + 1 + 1 1 1 @@ -357,6 +674,7 @@ 1 0 + 0 1 1 @@ -371,8 +689,7 @@ 0 0 wxID_ANY - Initial State - 0 + Irreversible 0 @@ -380,7 +697,7 @@ 0 1 - m_staticText6 + ObjCompObjIrreversible 1 @@ -394,17 +711,20 @@ 0 + + wxFILTER_NONE + wxDefaultValidator + - -1 - 5 - wxEXPAND - 0 - + 6 + wxALIGN_CENTER_VERTICAL|wxLEFT + 1 + 1 1 1 @@ -418,7 +738,7 @@ 1 0 - + 0 1 1 @@ -433,6 +753,7 @@ 0 0 wxID_ANY + Visible 0 @@ -440,7 +761,7 @@ 0 1 - ObjCompInitialState + ObjCompObjVisible 1 @@ -448,7 +769,6 @@ 1 Resizable - 0 1 @@ -464,11 +784,208 @@ - - 0 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Enabling Objectives + 0 + + 0 + + + 0 + + 1 + m_staticText7 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + ObjCompEnablingObjectives + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Success Logic + 0 + + 0 + + + 0 + + 1 + m_staticText8 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 0 + wxEXPAND + 1 + + + bSizer14 + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL + 1 + 1 1 1 @@ -496,16 +1013,15 @@ 0 0 wxID_ANY - Flags - 0 0 + 0 1 - m_staticText26 + ObjCompSuccessLogic 1 @@ -519,282 +1035,19 @@ 0 + + wxFILTER_NONE + wxDefaultValidator + + - -1 - - - - 5 - wxEXPAND - 1 - - - bSizer34 - wxHORIZONTAL - none - - 0 - wxALIGN_CENTER_VERTICAL|wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Mandatory - - 0 - - - 0 - - 1 - ObjCompObjMandatory - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 6 - wxALIGN_CENTER_VERTICAL|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Ongoing - - 0 - - - 0 - - 1 - ObjCompObjOngoing - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 6 - wxALIGN_CENTER_VERTICAL|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Irreversible - - 0 - - - 0 - - 1 - ObjCompObjIrreversible - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 6 - wxALIGN_CENTER_VERTICAL|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Visible - - 0 - - - 0 - - 1 - ObjCompObjVisible - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - 5 - wxALIGN_CENTER_VERTICAL + 6 + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT 0 1 @@ -824,7 +1077,7 @@ 0 0 wxID_ANY - Enabling Objectives + Failure Logic 0 0 @@ -833,7 +1086,7 @@ 0 1 - m_staticText7 + m_staticText9 1 @@ -855,8 +1108,8 @@ 5 - wxEXPAND - 0 + wxALIGN_CENTER_VERTICAL + 1 1 1 @@ -893,7 +1146,7 @@ 0 1 - ObjCompEnablingObjectives + ObjCompFailureLogic 1 @@ -917,272 +1170,83 @@ + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Completion Script + 0 + + 0 + + + 0 + + 1 + m_staticText81 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxEXPAND + 1 + + + bSizer141 + wxHORIZONTAL + none 5 wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Success Logic - 0 - - 0 - - - 0 - - 1 - m_staticText8 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 0 - wxEXPAND - 1 - - - bSizer14 - wxHORIZONTAL - none - - 5 - wxALIGN_CENTER_VERTICAL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - ObjCompSuccessLogic - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 6 - wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Failure Logic - 0 - - 0 - - - 0 - - 1 - m_staticText9 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - ObjCompFailureLogic - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - + 1 + 1 1 1 @@ -1210,16 +1274,15 @@ 0 0 wxID_ANY - Completion Script - 0 0 + 0 1 - m_staticText81 + ObjCompCompletionScript 1 @@ -1233,215 +1296,19 @@ 0 - + + wxFILTER_NONE + wxDefaultValidator + + + - -1 - - - - 5 - wxEXPAND - 1 - - - bSizer141 - wxHORIZONTAL - none - - 5 - wxALIGN_CENTER_VERTICAL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - ObjCompCompletionScript - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 6 - wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Failure Script - 0 - - 0 - - - 0 - - 1 - m_staticText91 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - ObjCompFailureScript - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL + 6 + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT 0 1 @@ -1471,7 +1338,7 @@ 0 0 wxID_ANY - Completion Target + Failure Script 0 0 @@ -1480,7 +1347,7 @@ 0 1 - m_staticText811 + m_staticText91 1 @@ -1500,213 +1367,77 @@ -1 - + 5 - wxEXPAND + wxALIGN_CENTER_VERTICAL 1 - + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 - bSizer1411 - wxHORIZONTAL - none - - 5 - wxALIGN_CENTER_VERTICAL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - ObjCompCompletionTarget - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 6 - wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Failure Target - 0 - - 0 - - - 0 - - 1 - m_staticText911 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - ObjCompFailureTarget - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - + 1 + ObjCompFailureScript + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + - - 12 - wxBOTTOM|wxTOP + + 5 + wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -1734,7 +1465,7 @@ 0 0 wxID_ANY - Components + Completion Target 0 0 @@ -1743,7 +1474,7 @@ 0 1 - ObjCompListLabel + m_staticText811 1 @@ -1763,345 +1494,805 @@ -1 - - 12 - wxEXPAND|wxLEFT + + 5 + wxEXPAND 1 - + - bSizer25 - wxVERTICAL + bSizer1411 + wxHORIZONTAL none - + 5 - wxEXPAND + wxALIGN_CENTER_VERTICAL 1 - + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 - bSizer26 - wxVERTICAL - none - - 12 - wxBOTTOM|wxEXPAND - 0 - - - bSizer27 - wxHORIZONTAL - none - - 5 - wxEXPAND | wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - -1,80 - 1 - ObjCompListViewPanel - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - + 1 + ObjCompCompletionTarget + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 6 + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Failure Target + 0 + + 0 + + + 0 + + 1 + m_staticText911 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + ObjCompFailureTarget + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + 12 + wxBOTTOM|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Components + 0 + + 0 + + + 0 + + 1 + ObjCompListLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 12 + wxEXPAND|wxLEFT + 1 + + + bSizer25 + wxVERTICAL + none + + 5 + wxEXPAND + 1 + + + bSizer26 + wxVERTICAL + none + + 12 + wxBOTTOM|wxEXPAND + 0 + + + bSizer27 + wxHORIZONTAL + none + + 5 + wxEXPAND | wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + -1,80 + 1 + ObjCompListViewPanel + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + wxTAB_TRAVERSAL + + + bSizer17 + wxVERTICAL + none + + + + + 5 + wxEXPAND + 0 + + + bSizer28 + wxVERTICAL + none + + 6 + wxEXPAND|wxLEFT + 0 + + + bSizer29 + wxVERTICAL + none + + 6 + wxBOTTOM|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ADD + Add + + 0 + + 0 + + + 0 + + 1 + ObjCompAddComponentButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Delete + + 0 + + 0 + + + 0 + + 1 + ObjCompDeleteComponentButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + 0 + wxEXPAND | wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + ObjCompComponentEditPanel + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + wxTAB_TRAVERSAL + + + bSizer35 + wxVERTICAL + none + + 6 + wxBOTTOM|wxEXPAND + 0 + + 2 + wxBOTH + 1 + + 12 + + fgSizer2 + wxFLEX_GROWMODE_SPECIFIED + none + 2 + 12 + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Type + 0 + + 0 + + + 0 + + 1 + m_staticText24 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + ObjCompComponentType + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 0 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Flags + 0 + + 0 + + + 0 - bSizer17 - wxVERTICAL - none - - - - - 5 - wxEXPAND - 0 - - - bSizer28 - wxVERTICAL - none - - 6 - wxEXPAND|wxLEFT - 0 - - - bSizer29 - wxVERTICAL - none - - 6 - wxBOTTOM|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ADD - Add - - 0 - - 0 - - - 0 - - 1 - ObjCompAddComponentButton - 1 - - - protected - 1 - - - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Delete - - 0 - - 0 - - - 0 - - 1 - ObjCompDeleteComponentButton - 1 - - - protected - 1 - - - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - + 1 + m_staticText25 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 - - - - - 0 - wxEXPAND | wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - ObjCompComponentEditPanel - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - bSizer35 - wxVERTICAL - none - - 6 - wxBOTTOM|wxEXPAND + + 0 + wxEXPAND 0 - - 2 - wxBOTH - 1 - - 12 + - fgSizer2 - wxFLEX_GROWMODE_SPECIFIED + bSizer31 + wxHORIZONTAL none - 2 - 12 - 5 - wxALIGN_CENTER_VERTICAL - 0 - + 0 + wxALIGN_CENTER_VERTICAL|wxALL + 1 + 1 1 1 @@ -2115,6 +2306,7 @@ 1 0 + 0 1 1 @@ -2129,8 +2321,7 @@ 0 0 wxID_ANY - Type - 0 + Satisfied at start 0 @@ -2138,7 +2329,7 @@ 0 1 - m_staticText24 + ObjCompSatisfiedAtStart 1 @@ -2152,17 +2343,20 @@ 0 + + wxFILTER_NONE + wxDefaultValidator + - -1 - 5 - wxEXPAND - 0 - + 0 + wxALIGN_CENTER_VERTICAL + 1 + 1 1 1 @@ -2176,7 +2370,7 @@ 1 0 - + 0 1 1 @@ -2191,6 +2385,7 @@ 0 0 wxID_ANY + Irreversible 0 @@ -2198,7 +2393,7 @@ 0 1 - ObjCompComponentType + ObjCompIrreversible 1 @@ -2206,7 +2401,6 @@ 1 Resizable - 0 1 @@ -2225,8 +2419,8 @@ 0 wxALIGN_CENTER_VERTICAL|wxALL - 0 - + 1 + 1 1 1 @@ -2240,6 +2434,7 @@ 1 0 + 0 1 1 @@ -2254,8 +2449,7 @@ 0 0 wxID_ANY - Flags - 0 + Boolean NOT 0 @@ -2263,7 +2457,7 @@ 0 1 - m_staticText25 + ObjCompBooleanNOT 1 @@ -2277,343 +2471,143 @@ 0 + + wxFILTER_NONE + wxDefaultValidator + - -1 0 - wxEXPAND - 0 - + wxALIGN_CENTER_VERTICAL|wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Player responsible + + 0 + + + 0 - bSizer31 - wxHORIZONTAL - none - - 0 - wxALIGN_CENTER_VERTICAL|wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Satisfied at start - - 0 - - - 0 - - 1 - ObjCompSatisfiedAtStart - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 0 - wxALIGN_CENTER_VERTICAL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Irreversible - - 0 - - - 0 - - 1 - ObjCompIrreversible - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 0 - wxALIGN_CENTER_VERTICAL|wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Boolean NOT - - 0 - - - 0 - - 1 - ObjCompBooleanNOT - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 0 - wxALIGN_CENTER_VERTICAL|wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Player responsible - - 0 - - - 0 - - 1 - ObjCompPlayerResponsible - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - + 1 + ObjCompPlayerResponsible + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + - - 0 - wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - ObjCompEditorContainer - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL|wxBORDER_STATIC - - - bSizer32 - wxVERTICAL - none - - + + + + 0 + wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + ObjCompEditorContainer + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + wxTAB_TRAVERSAL|wxBORDER_STATIC + + + bSizer32 + wxVERTICAL + none @@ -2622,24 +2616,24 @@ - - 12 - wxEXPAND|wxTOP - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer1 - protected - - + + + + 12 + wxEXPAND|wxTOP + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + protected diff --git a/install/ui/objectivecomponentsdialog.xrc b/install/ui/objectivecomponentsdialog.xrc index 5284d7169b..3b8462e316 100644 --- a/install/ui/objectivecomponentsdialog.xrc +++ b/install/ui/objectivecomponentsdialog.xrc @@ -6,463 +6,457 @@ wxVERTICAL - - wxALL|wxEXPAND - 12 - - wxVERTICAL + + wxEXPAND + 0 + + 8 + 2 + 10 + 12 + 1 + + + + wxALIGN_CENTER_VERTICAL + 5 + + + -1 + + wxEXPAND + 5 + + + + + + + + 5 + + + -1 + + + + + wxEXPAND 0 - - 8 - 2 - 10 - 12 - 1 - + + wxHORIZONTAL - - wxALIGN_CENTER_VERTICAL - 5 - - - -1 + + wxEXPAND + 0 + + + + wxHORIZONTAL + + + + + + wxALIGN_CENTER_VERTICAL + 5 + + + -1 + + + + + wxEXPAND + 5 + + 0 + + + + + + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + -1 + + + + + wxEXPAND + 5 + + wxHORIZONTAL - - wxEXPAND - 5 - - + + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + 0 - - - 5 - - - -1 + + wxALIGN_CENTER_VERTICAL|wxLEFT + 6 + + + 0 - wxEXPAND - 0 - - wxHORIZONTAL - - - wxEXPAND - 0 - - - - wxHORIZONTAL - - - + wxALIGN_CENTER_VERTICAL|wxLEFT + 6 + + + 0 - - wxALIGN_CENTER_VERTICAL - 5 - - - -1 + + wxALIGN_CENTER_VERTICAL|wxLEFT + 6 + + + 0 + + + + + wxALIGN_CENTER_VERTICAL + 5 + + + -1 + + + + + wxEXPAND + 5 + + + + + + + wxALIGN_CENTER_VERTICAL + 5 + + + -1 + + + + + wxEXPAND + 0 + + wxHORIZONTAL - - wxEXPAND + + wxALIGN_CENTER_VERTICAL 5 - - 0 - + + - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT + 6 + + -1 - wxEXPAND - 5 - - wxHORIZONTAL - - - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - - 0 - - - - - wxALIGN_CENTER_VERTICAL|wxLEFT - 6 - - - 0 - - - - - wxALIGN_CENTER_VERTICAL|wxLEFT - 6 - - - 0 - - - - - wxALIGN_CENTER_VERTICAL|wxLEFT - 6 - - - 0 - - - - - - wxALIGN_CENTER_VERTICAL 5 - - - -1 + + + + + + + wxALIGN_CENTER_VERTICAL + 5 + + + -1 + + + + + wxEXPAND + 5 + + wxHORIZONTAL - - wxEXPAND + + wxALIGN_CENTER_VERTICAL 5 - + - wxALIGN_CENTER_VERTICAL - 5 - - + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT + 6 + + -1 - wxEXPAND - 0 - - wxHORIZONTAL - - - wxALIGN_CENTER_VERTICAL - 5 - - - - - - - wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT - 6 - - - -1 - - - - - wxALIGN_CENTER_VERTICAL - 5 - - - - - - - - wxALIGN_CENTER_VERTICAL 5 - - - -1 + + + + + + + wxALIGN_CENTER_VERTICAL + 5 + + + -1 + + + + + wxEXPAND + 5 + + wxHORIZONTAL - wxEXPAND + wxALIGN_CENTER_VERTICAL 5 - - wxHORIZONTAL - - - wxALIGN_CENTER_VERTICAL - 5 - - - - - - - wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT - 6 - - - -1 - - - - - wxALIGN_CENTER_VERTICAL - 5 - - - - + + - wxALIGN_CENTER_VERTICAL - 5 - - + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT + 6 + + -1 - wxEXPAND + wxALIGN_CENTER_VERTICAL 5 - - wxHORIZONTAL - - - wxALIGN_CENTER_VERTICAL - 5 - - - - - - - wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT - 6 - - - -1 - - - - - wxALIGN_CENTER_VERTICAL - 5 - - - - + + - - - wxBOTTOM|wxTOP - 12 - - - -1 - - + + + + + wxBOTTOM|wxTOP + 12 + + + -1 + + + + + wxEXPAND|wxLEFT + 12 + + wxVERTICAL - wxEXPAND|wxLEFT - 12 + wxEXPAND + 5 wxVERTICAL - - wxEXPAND - 5 + + wxBOTTOM|wxEXPAND + 12 - wxVERTICAL + wxHORIZONTAL + + + wxEXPAND | wxALL + 5 + + + + wxVERTICAL + + + - wxBOTTOM|wxEXPAND - 12 + wxEXPAND + 5 - wxHORIZONTAL - - - wxEXPAND | wxALL - 5 - - - - wxVERTICAL - - - + wxVERTICAL - wxEXPAND - 5 + wxEXPAND|wxLEFT + 6 wxVERTICAL - wxEXPAND|wxLEFT + wxBOTTOM|wxEXPAND 6 - - wxVERTICAL - - - wxBOTTOM|wxEXPAND - 6 - - - 0 - 0 - - - - - - wxEXPAND - 5 - - - 0 - 0 - - - + + + 0 + 0 + 0 + + + + + + wxEXPAND + 5 + + + 0 + 0 + 0 + - - - wxEXPAND | wxALL - 0 - - - - wxVERTICAL + + + + + wxEXPAND | wxALL + 0 + + + + wxVERTICAL + + + wxBOTTOM|wxEXPAND + 6 + + 2 + 2 + 12 + 12 + 1 + + + + wxALIGN_CENTER_VERTICAL + 5 + + + -1 + + - wxBOTTOM|wxEXPAND - 6 - - 2 - 2 - 12 - 12 - 1 - + wxEXPAND + 5 + + 0 + + + + + + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + -1 + + + + + wxEXPAND + 0 + + wxHORIZONTAL - - wxALIGN_CENTER_VERTICAL - 5 - - - -1 + + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + 0 - - wxEXPAND - 5 - - 0 - + + wxALIGN_CENTER_VERTICAL + 0 + + + 0 - + wxALIGN_CENTER_VERTICAL|wxALL 0 - - - -1 + + + 0 - - wxEXPAND + + wxALIGN_CENTER_VERTICAL|wxALL 0 - - wxHORIZONTAL - - - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - - 0 - - - - - wxALIGN_CENTER_VERTICAL - 0 - - - 0 - - - - - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - - 0 - - - - - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - - 0 - - + + + 0 - - - wxEXPAND - 0 - - - - wxVERTICAL - - + + + + + wxEXPAND + 0 + + + + wxVERTICAL @@ -471,25 +465,25 @@ - - - wxEXPAND|wxTOP - 12 - - - wxALIGN_CENTER_HORIZONTAL|wxALL - 5 - - - - - - wxALIGN_CENTER_HORIZONTAL|wxALL - 5 - - - - + + + + + wxEXPAND|wxTOP + 12 + + + wxALIGN_CENTER_HORIZONTAL|wxALL + 5 + + + + + + wxALIGN_CENTER_HORIZONTAL|wxALL + 5 + + @@ -497,4 +491,3 @@ - diff --git a/install/ui/objectiveseditor.fbp b/install/ui/objectiveseditor.fbp index 3539469f82..4b79a8d4ad 100644 --- a/install/ui/objectiveseditor.fbp +++ b/install/ui/objectiveseditor.fbp @@ -1,9 +1,9 @@ - + - C++ + XRC 1 source_name 0 @@ -11,11 +11,13 @@ res UTF-8 connect - + objectiveseditor 1000 none + + 0 - MyProject2 + objectiveseditor . @@ -24,6 +26,7 @@ 1 1 UI + 0 0 0 @@ -42,42 +45,13 @@ ObjDialogMainPanel - 500,600 + 712,692 + 0 wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bSizer5 @@ -85,7 +59,7 @@ none 12 - wxLEFT|wxRIGHT|wxTOP + wxEXPAND 0 1 @@ -111,11 +85,12 @@ 1 1 - + ,90,92,-1,70,0 0 0 wxID_ANY Objective Entities + 0 0 @@ -141,34 +116,11 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - 12 - wxEXPAND|wxLEFT|wxRIGHT|wxTOP + wxEXPAND|wxTOP 1 @@ -179,7 +131,7 @@ 6 wxEXPAND|wxRIGHT 1 - + 1 1 1 @@ -230,30 +182,7 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - + bSizer7 wxVERTICAL @@ -262,19 +191,19 @@ - 5 + 6 wxEXPAND 0 - + ButtonSizer1 wxVERTICAL none - + 6 wxBOTTOM|wxEXPAND 0 - + 1 1 1 @@ -283,27 +212,34 @@ + 0 + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Add + + 0 0 @@ -318,9 +254,11 @@ protected 1 + + Resizable 1 - 80,-1 + -1,-1 0 @@ -332,37 +270,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + 6 wxEXPAND 0 - + 1 1 1 @@ -371,27 +285,34 @@ + 0 + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Delete + + 0 0 @@ -406,9 +327,11 @@ protected 1 + + Resizable 1 - 80,-1 + -1,-1 0 @@ -420,30 +343,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -452,7 +351,7 @@ 12 - wxLEFT|wxRIGHT|wxTOP + wxEXPAND|wxRIGHT|wxTOP 0 1 @@ -478,11 +377,12 @@ 1 1 - + ,90,92,-1,70,0 0 0 wxID_ANY Objectives + 0 0 @@ -508,45 +408,22 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - 12 - wxEXPAND|wxLEFT|wxRIGHT|wxTOP + wxEXPAND|wxTOP 4 - + bSizer6 wxHORIZONTAL none - + 6 wxEXPAND|wxRIGHT 1 - + 1 1 1 @@ -597,30 +474,7 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - + bSizer9 wxVERTICAL @@ -628,11 +482,11 @@ - - 5 - wxEXPAND | wxALL + + 6 + wxEXPAND 0 - + 1 1 1 @@ -683,39 +537,16 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - + ButtonSizer wxVERTICAL none - + 6 wxBOTTOM|wxEXPAND 0 - + 1 1 1 @@ -724,27 +555,34 @@ + 0 + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Add + + 0 0 @@ -759,9 +597,11 @@ protected 1 + + Resizable 1 - 80,-1 + -1,-1 0 @@ -773,37 +613,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + 6 wxBOTTOM|wxEXPAND 0 - + 1 1 1 @@ -812,27 +628,34 @@ + 0 + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Delete + + 0 0 @@ -847,9 +670,11 @@ protected 1 + + Resizable 1 - 80,-1 + -1,-1 0 @@ -861,37 +686,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + 6 wxBOTTOM|wxEXPAND 0 - + 1 1 1 @@ -900,27 +701,34 @@ + 0 + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Clear + + 0 0 @@ -935,9 +743,11 @@ protected 1 + + Resizable 1 - 80,-1 + -1,-1 0 @@ -949,37 +759,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + 6 wxBOTTOM|wxEXPAND 0 - + 1 1 1 @@ -988,27 +774,34 @@ + 0 + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Edit + + 0 0 @@ -1023,9 +816,11 @@ protected 1 + + Resizable 1 - 80,-1 + -1,-1 0 @@ -1037,118 +832,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND | wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline1 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 6 wxBOTTOM|wxEXPAND 0 - + 1 1 1 @@ -1157,27 +847,34 @@ + 0 + Load From File; ../bitmaps/arrow_up_blue.png 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY - Move up + + + 0 0 @@ -1192,9 +889,11 @@ protected 1 + + Resizable 1 - 80,-1 + -1,-1 0 @@ -1206,37 +905,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + 6 wxBOTTOM|wxEXPAND 0 - + 1 1 1 @@ -1245,27 +920,34 @@ + 0 + Load From File; ../bitmaps/arrow_down_blue.png 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY - Move down + + + 0 0 @@ -1280,9 +962,11 @@ protected 1 + + Resizable 1 - 80,-1 + -1,-1 0 @@ -1294,30 +978,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1326,102 +986,19 @@ - 12 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Success Logic - - 0 - - - 0 - - 1 - ObjDialogLogicLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 12 - wxEXPAND|wxLEFT|wxRIGHT|wxTOP + 6 + wxBOTTOM|wxEXPAND|wxTOP 0 - + bSizer91 wxHORIZONTAL none - + 12 - wxLEFT + 1 - + 1 1 1 @@ -1430,27 +1007,34 @@ + 0 + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Edit Mission Success Logic + + 0 0 @@ -1465,6 +1049,8 @@ protected 1 + + Resizable 1 @@ -1479,37 +1065,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + 6 wxLEFT 1 - + 1 1 1 @@ -1518,27 +1080,34 @@ + 0 + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Edit Objective Conditions + + 0 0 @@ -1553,6 +1122,8 @@ protected 1 + + Resizable 1 @@ -1567,37 +1138,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - 12 - wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP + wxALIGN_RIGHT|wxLEFT|wxTOP 0 @@ -1617,27 +1164,34 @@ + 0 + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Cancel + + 0 0 @@ -1652,6 +1206,8 @@ protected 1 + + Resizable 1 @@ -1666,30 +1222,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1705,27 +1237,34 @@ + 0 + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY OK + + 0 0 @@ -1740,6 +1279,8 @@ protected 1 + + Resizable 1 @@ -1754,30 +1295,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/install/ui/objectiveseditor.xrc b/install/ui/objectiveseditor.xrc index d6a546fab4..30af58f7fb 100644 --- a/install/ui/objectiveseditor.xrc +++ b/install/ui/objectiveseditor.xrc @@ -2,21 +2,26 @@ - 500,600 + 712,692 wxVERTICAL - wxLEFT|wxRIGHT|wxTOP + wxEXPAND 12 + + + bold + 0 + -1 - wxEXPAND|wxLEFT|wxRIGHT|wxTOP + wxEXPAND|wxTOP 12 wxHORIZONTAL @@ -35,7 +40,7 @@ wxEXPAND - 5 + 6 wxVERTICAL @@ -43,9 +48,11 @@ wxBOTTOM|wxEXPAND 6 - 80,-1 0 + 0 + 0 + @@ -53,9 +60,11 @@ wxEXPAND 6 - 80,-1 0 + 0 + 0 + @@ -64,16 +73,21 @@ - wxLEFT|wxRIGHT|wxTOP + wxEXPAND|wxRIGHT|wxTOP 12 + + + bold + 0 + -1 - wxEXPAND|wxLEFT|wxRIGHT|wxTOP + wxEXPAND|wxTOP 12 wxHORIZONTAL @@ -90,8 +104,8 @@ - wxEXPAND | wxALL - 5 + wxEXPAND + 6 @@ -101,9 +115,11 @@ wxBOTTOM|wxEXPAND 6 - 80,-1 0 + 0 + 0 + @@ -111,9 +127,11 @@ wxBOTTOM|wxEXPAND 6 - 80,-1 0 + 0 + 0 + @@ -121,9 +139,11 @@ wxBOTTOM|wxEXPAND 6 - 80,-1 0 + 0 + 0 + @@ -131,17 +151,11 @@ wxBOTTOM|wxEXPAND 6 - 80,-1 0 - - - - - wxEXPAND | wxALL - 5 - - + 0 + 0 + @@ -149,9 +163,11 @@ wxBOTTOM|wxEXPAND 6 - 80,-1 - + 0 + 0 + 0 + ../bitmaps/arrow_up_blue.png @@ -159,9 +175,11 @@ wxBOTTOM|wxEXPAND 6 - 80,-1 - + 0 + 0 + 0 + ../bitmaps/arrow_down_blue.png @@ -171,26 +189,20 @@ - wxLEFT|wxRIGHT|wxTOP - 12 - - - -1 - - - - - wxEXPAND|wxLEFT|wxRIGHT|wxTOP - 12 + wxBOTTOM|wxEXPAND|wxTOP + 6 wxHORIZONTAL - wxLEFT + 12 0 + 0 + 0 + @@ -200,13 +212,16 @@ 0 + 0 + 0 + - wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP + wxALIGN_RIGHT|wxLEFT|wxTOP 12 wxHORIZONTAL @@ -217,6 +232,9 @@ 0 + 0 + 0 + @@ -226,6 +244,9 @@ 0 + 0 + 0 + diff --git a/libs/registry/registry.h b/libs/registry/registry.h index 9c6bcb6041..c18960a7e9 100644 --- a/libs/registry/registry.h +++ b/libs/registry/registry.h @@ -10,16 +10,21 @@ namespace registry { -/** - * \brief - * Set a value in the registry of any type that can be converted to a string - * with string::to_string. - */ +/// Set a value in the registry of any type that can be converted to a string with +/// string::to_string. template void setValue(const std::string& key, const T& value) { GlobalRegistry().set(key, string::to_string(value)); } +/// Set a registry value only if there is no current value +template void setDefault(const std::string& key, const T& value) +{ + if (GlobalRegistry().get(key).empty()) { + setValue(key, value); + } +} + /** * \brief Get the value of the given registry and convert it to type T. If the key cannot be found * or is not convertible to the required type, a default-constructed T will be returned. diff --git a/libs/wxutil/WindowPosition.cpp b/libs/wxutil/WindowPosition.cpp index 78e98c1859..527fa25d27 100644 --- a/libs/wxutil/WindowPosition.cpp +++ b/libs/wxutil/WindowPosition.cpp @@ -1,16 +1,17 @@ #include "WindowPosition.h" #include "iregistry.h" +#include "registry/registry.h" #include "string/convert.h" #include #include namespace { - constexpr int DEFAULT_POSITION_X = 50; - constexpr int DEFAULT_POSITION_Y = 25; - constexpr int DEFAULT_SIZE_X = 400; - constexpr int DEFAULT_SIZE_Y = 300; + constexpr int DEFAULT_POSITION_X = 50; + constexpr int DEFAULT_POSITION_Y = 25; + constexpr int DEFAULT_SIZE_X = 400; + constexpr int DEFAULT_SIZE_Y = 300; } namespace wxutil @@ -19,7 +20,7 @@ namespace wxutil WindowPosition::WindowPosition() : _position({ DEFAULT_POSITION_X, DEFAULT_POSITION_Y }), _size({ DEFAULT_SIZE_X, DEFAULT_SIZE_Y }), - _window(nullptr) + _window(nullptr) {} void WindowPosition::initialise(wxTopLevelWindow* window, const std::string& windowStateKey) @@ -27,9 +28,9 @@ void WindowPosition::initialise(wxTopLevelWindow* window, const std::string& win initialise(window, windowStateKey, 0.6f, 0.8f); } -void WindowPosition::initialise(wxTopLevelWindow* window, +void WindowPosition::initialise(wxTopLevelWindow* window, const std::string& windowStateKey, - float defaultXFraction, + float defaultXFraction, float defaultYFraction) { // Set up events and such @@ -51,67 +52,55 @@ void WindowPosition::initialise(wxTopLevelWindow* window, // Connect the passed window to this object void WindowPosition::connect(wxTopLevelWindow* window) { - if (_window != nullptr) - { - disconnect(_window); - } + if (_window != nullptr) + { + disconnect(_window); + } - _window = window; - applyPosition(); + _window = window; + applyPosition(); - window->Bind(wxEVT_SIZE, &WindowPosition::onResize, this); - window->Bind(wxEVT_MOVE, &WindowPosition::onMove, this); + window->Bind(wxEVT_SIZE, &WindowPosition::onResize, this); + window->Bind(wxEVT_MOVE, &WindowPosition::onMove, this); } void WindowPosition::disconnect(wxTopLevelWindow* window) { - _window = nullptr; + _window = nullptr; - window->Unbind(wxEVT_SIZE, &WindowPosition::onResize, this); - window->Unbind(wxEVT_MOVE, &WindowPosition::onMove, this); -} - -const std::array& WindowPosition::getPosition() const -{ - return _position; + window->Unbind(wxEVT_SIZE, &WindowPosition::onResize, this); + window->Unbind(wxEVT_MOVE, &WindowPosition::onMove, this); } const std::array& WindowPosition::getSize() const { - return _size; -} - -void WindowPosition::setPosition(int x, int y) -{ - _position.at(0) = x; - _position.at(1) = y; + return _size; } void WindowPosition::setSize(int width, int height) { - _size.at(0) = width; - _size.at(1) = height; + _size.at(0) = width; + _size.at(1) = height; } void WindowPosition::saveToPath(const std::string& path) { if (path.empty()) return; - GlobalRegistry().setAttribute(path, "xPosition", string::to_string(_position.at(0))); - GlobalRegistry().setAttribute(path, "yPosition", string::to_string(_position.at(1))); - GlobalRegistry().setAttribute(path, "width", string::to_string(_size.at(0))); - GlobalRegistry().setAttribute(path, "height", string::to_string(_size.at(1))); + registry::setValue(path + "/xPosition", _position.at(0)); + registry::setValue(path + "/yPosition", _position.at(1)); + registry::setValue(path + "/width", _size.at(0)); + registry::setValue(path + "/height", _size.at(1)); } void WindowPosition::loadFromPath(const std::string& path) { if (path.empty()) return; - _position.at(0) = string::convert(GlobalRegistry().getAttribute(path, "xPosition")); - _position.at(1) = string::convert(GlobalRegistry().getAttribute(path, "yPosition")); - - _size.at(0) = string::convert(GlobalRegistry().getAttribute(path, "width")); - _size.at(1) = string::convert(GlobalRegistry().getAttribute(path, "height")); + _position.at(0) = registry::getValue(path + "/xPosition"); + _position.at(1) = registry::getValue(path + "/yPosition"); + _size.at(0) = registry::getValue(path + "/width"); + _size.at(1) = registry::getValue(path + "/height"); if (_size.at(0) == 0 || _size.at(1) == 0) { @@ -126,7 +115,7 @@ void WindowPosition::loadFromPath(const std::string& path) void WindowPosition::applyPosition() { - if (_window == nullptr) return; + if (_window == nullptr) return; if (_size.at(0) == 0 || _size.at(1) == 0) { @@ -134,26 +123,26 @@ void WindowPosition::applyPosition() return; } - // On multi-monitor setups, wxWidgets offers a virtual big screen with - // coordinates going from 0,0 to whatever lower-rightmost point there is + // On multi-monitor setups, wxWidgets offers a virtual big screen with + // coordinates going from 0,0 to whatever lower-rightmost point there is - // Sanity check the window position + // Sanity check the window position wxRect targetPos(_position.at(0), _position.at(1), _size.at(0), _size.at(1)); - - constexpr int TOL = 8; - - // Employ a few pixels tolerance to allow for placement very near the borders - if (wxDisplay::GetFromPoint(targetPos.GetTopLeft() + wxPoint(TOL, TOL)) == wxNOT_FOUND) - { - // Window probably ends up invisible, refuse these coords - _window->CenterOnParent(); - } - else - { - _window->SetPosition(wxPoint(_position.at(0), _position.at(1))); - } - - _window->SetSize(_size.at(0), _size.at(1)); + + constexpr int TOL = 8; + + // Employ a few pixels tolerance to allow for placement very near the borders + if (wxDisplay::GetFromPoint(targetPos.GetTopLeft() + wxPoint(TOL, TOL)) == wxNOT_FOUND) + { + // Window probably ends up invisible, refuse these coords + _window->CenterOnParent(); + } + else + { + _window->SetPosition(wxPoint(_position.at(0), _position.at(1))); + } + + _window->SetSize(_size.at(0), _size.at(1)); } // Reads the position from the window @@ -168,18 +157,18 @@ void WindowPosition::readPosition() void WindowPosition::fitToScreen(float xfraction, float yfraction) { - if (_window == nullptr) return; + if (_window == nullptr) return; - wxDisplay display(wxDisplay::GetFromWindow(_window)); + wxDisplay display(wxDisplay::GetFromWindow(_window)); - // Pass the call - fitToScreen(display.GetGeometry(), xfraction, yfraction); + // Pass the call + fitToScreen(display.GetGeometry(), xfraction, yfraction); } void WindowPosition::fitToScreen(const wxRect& screen, float xfraction, float yfraction) { - _size.at(0) = static_cast(screen.GetWidth() * xfraction) - 12; - _size.at(1) = static_cast(screen.GetHeight() * yfraction) - 48; + _size.at(0) = static_cast(screen.GetWidth() * xfraction) - 12; + _size.at(1) = static_cast(screen.GetHeight() * yfraction) - 48; _position.at(0) = screen.GetX() + (screen.GetWidth() - _size.at(0) - 12) / 2; _position.at(1) = screen.GetY() + (screen.GetHeight() - _size.at(1) - 48) / 2; @@ -187,21 +176,21 @@ void WindowPosition::fitToScreen(const wxRect& screen, float xfraction, float yf void WindowPosition::onResize(wxSizeEvent& ev) { - setSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight()); - ev.Skip(); + setSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight()); + ev.Skip(); } void WindowPosition::onMove(wxMoveEvent& ev) { if (_window == nullptr) return; - // The position passed in the wxMoveEvent seems (on my Win10 system) + // The position passed in the wxMoveEvent seems (on my Win10 system) // to be off by about x=8,y=51 // Call GetScreenPosition to get the real coordinates - //setPosition(ev.GetPosition().x, ev.GetPosition().y); + //setPosition(ev.GetPosition().x, ev.GetPosition().y); _window->GetScreenPosition(&_position.at(0), &_position.at(1)); - ev.Skip(); + ev.Skip(); } } // namespace diff --git a/libs/wxutil/WindowPosition.h b/libs/wxutil/WindowPosition.h index 791c95ab3a..9180a69d8a 100644 --- a/libs/wxutil/WindowPosition.h +++ b/libs/wxutil/WindowPosition.h @@ -20,20 +20,17 @@ namespace wxutil * * Use the connect() method to connect a wxTopLevelWindow to this object. */ -class WindowPosition : - public wxEvtHandler, - public ui::IPersistableObject +class WindowPosition: public wxEvtHandler, public ui::IPersistableObject { -private: - // The size and position of this object + // The size and position of this object std::array _position; std::array _size; - // The connected window - wxTopLevelWindow* _window; + // The connected window + wxTopLevelWindow* _window; public: - WindowPosition(); + WindowPosition(); // All-in-one method to connect a window and load its state from the given path // or (if the key is not existent) set up a reasonable default position/size. @@ -44,47 +41,44 @@ class WindowPosition : // Default X/Y fractions will be read from the given key, otherwise a default size will be set. void initialise(wxTopLevelWindow* window, const std::string& windowStateKey); - // Connect the passed window to this object - void connect(wxTopLevelWindow* window); - void disconnect(wxTopLevelWindow* window); + // Connect the passed window to this object + void connect(wxTopLevelWindow* window); + void disconnect(wxTopLevelWindow* window); - const std::array& getPosition() const; const std::array& getSize() const; - void setPosition(int x, int y); - void setSize(int width, int height); - - // Loads/saves the window position to the given Registry path - void saveToPath(const std::string& registryKey) override; - void loadFromPath(const std::string& registryKey) override; - - // Applies the internally stored size/position info to the GtkWindow - // The algorithm was adapted from original GtkRadiant code (window.h) - void applyPosition(); - - // Reads the position from the GtkWindow - void readPosition(); - - /** - * Fits the current position/dimension to the screen of the connected - * window. This object has to be connected to a GtkWindow before - * the method can function properly. - * - * @xfraction,yfraction: the fraction of the screen which the window - * should occupy. (e.g. Pass 0.5/0.66 to let the window half of the - * monitor width and two thirds of the monitor height. - * - * Note: applyPosition() has to be called for the changes to take effect. - */ - void fitToScreen(float xfraction = 1, float yfraction = 1); - - // Adjusts the position/dimensions to fit on the given screen (wxRect) - void fitToScreen(const wxRect& screen, float xfraction = 1, float yfraction = 1); + // Loads/saves the window position to the given Registry path + void saveToPath(const std::string& registryKey) override; + void loadFromPath(const std::string& registryKey) override; + + // Applies the internally stored size/position info to the GtkWindow + // The algorithm was adapted from original GtkRadiant code (window.h) + void applyPosition(); + + // Reads the position from the GtkWindow + void readPosition(); + + /** + * Fits the current position/dimension to the screen of the connected + * window. This object has to be connected to a GtkWindow before + * the method can function properly. + * + * @xfraction,yfraction: the fraction of the screen which the window + * should occupy. (e.g. Pass 0.5/0.66 to let the window half of the + * monitor width and two thirds of the monitor height. + * + * Note: applyPosition() has to be called for the changes to take effect. + */ + void fitToScreen(float xfraction = 1, float yfraction = 1); + + // Adjusts the position/dimensions to fit on the given screen (wxRect) + void fitToScreen(const wxRect& screen, float xfraction = 1, float yfraction = 1); private: - // The callback that gets invoked on window size/position changes - void onResize(wxSizeEvent& ev); - void onMove(wxMoveEvent& ev); + // The callback that gets invoked on window size/position changes + void onResize(wxSizeEvent& ev); + void onMove(wxMoveEvent& ev); + void setSize(int width, int height); }; } // namespace diff --git a/libs/wxutil/dataview/TreeModel.cpp b/libs/wxutil/dataview/TreeModel.cpp index a058fb06cd..d9974da983 100644 --- a/libs/wxutil/dataview/TreeModel.cpp +++ b/libs/wxutil/dataview/TreeModel.cpp @@ -91,7 +91,7 @@ class TreeModel::Node : wxDEFINE_EVENT(EV_TREEMODEL_POPULATION_FINISHED, TreeModel::PopulationFinishedEvent); wxDEFINE_EVENT(EV_TREEMODEL_POPULATION_PROGRESS, TreeModel::PopulationProgressEvent); -TreeModel::PopulationFinishedEvent::PopulationFinishedEvent(int id) : +TreeModel::PopulationFinishedEvent::PopulationFinishedEvent(int id) : wxEvent(id, EV_TREEMODEL_POPULATION_FINISHED), _treeModel(NULL) {} @@ -100,26 +100,26 @@ TreeModel::PopulationFinishedEvent::PopulationFinishedEvent(TreeModel::Ptr store wxEvent(id, EV_TREEMODEL_POPULATION_FINISHED), _treeModel(store) {} - + // You *must* copy here the data to be transported -TreeModel::PopulationFinishedEvent::PopulationFinishedEvent(const TreeModel::PopulationFinishedEvent& event) : +TreeModel::PopulationFinishedEvent::PopulationFinishedEvent(const TreeModel::PopulationFinishedEvent& event) : wxEvent(event), _treeModel(event._treeModel) {} - + // Required for sending with wxPostEvent() wxEvent* TreeModel::PopulationFinishedEvent::Clone() const -{ +{ return new PopulationFinishedEvent(*this); } - + TreeModel::Ptr TreeModel::PopulationFinishedEvent::GetTreeModel() const -{ +{ return _treeModel; } void TreeModel::PopulationFinishedEvent::SetTreeModel(TreeModel::Ptr store) -{ +{ _treeModel = store; } @@ -274,27 +274,14 @@ TreeModel::Row TreeModel::GetRootItem() void TreeModel::Clear() { - // This workaround seems to cause crashes in wxGTK 3.2.0, take it out (#6105) -#if wxCHECK_VERSION(3, 0, 5) && !wxCHECK_VERSION(3, 2, 0) - // To work around a problem in wxGTK 3.0.5+, trigger - // an ItemRemoved call for all top-level children before - // actually deleting them. - // The Cleared() call below might query GetParent() calls - // for nodes that are still present in the internal tree - wxDataViewItemArray children; - GetChildren(_rootNode->item, children); - - if (!children.empty()) - { - ItemsDeleted(_rootNode->item, children); - } -#endif - - // Now it should be safe to free all the nodes - _rootNode->values.clear(); - _rootNode->children.clear(); - - Cleared(); + // Rather than delete the root node outright, swap it with an empty + // replacement then keep it alive until the end of this function. This + // avoids crashes if the backend (mainly GTK) tries to dereference + // wxDataViewItem pointers during the subsequent Cleared() call. + NodePtr newRoot = Node::createRoot(); + std::swap(_rootNode, newRoot); + + Cleared(); } void TreeModel::SetDefaultStringSortColumn(int index) @@ -379,17 +366,17 @@ void TreeModel::SortModelByColumn(const TreeModel::Column& column) { int intA = rowA[column].getInteger(); int intB = rowA[column].getInteger(); - + return intA < intB; } else if (column.type == Column::Double) { double dblA = rowA[column].getDouble(); double dblB = rowA[column].getDouble(); - + return dblA < dblB; } - + return false; }); } @@ -468,7 +455,7 @@ wxDataViewItem TreeModel::FindString(const std::string& needle, const Column& co } else if (column.type == Column::String) { - return static_cast(node.values.size()) > colIndex && + return static_cast(node.values.size()) > colIndex && static_cast(node.values[colIndex]) == needle; } @@ -488,7 +475,7 @@ wxDataViewItem TreeModel::FindInteger(long needle, const Column& column, const w return FindRecursive(*startNode, [&] (const Node& node)->bool { int colIndex = column.getColumnIndex(); - return static_cast(node.values.size()) > colIndex && + return static_cast(node.values.size()) > colIndex && static_cast(node.values[colIndex]) == needle; }); } @@ -694,7 +681,7 @@ wxDataViewItem TreeModel::GetParent(const wxDataViewItem& item) const // It's ok to ask for invisible root node's parent if (!item.IsOk()) { - return wxDataViewItem(NULL); + return wxDataViewItem(NULL); } Node* owningNode = static_cast(item.GetID()); @@ -703,13 +690,13 @@ wxDataViewItem TreeModel::GetParent(const wxDataViewItem& item) const { return owningNode->parent->item; } - + return wxDataViewItem(NULL); } bool TreeModel::IsContainer(const wxDataViewItem& item) const { - // greebo: it appears that invalid items are treated as containers, they can have children. + // greebo: it appears that invalid items are treated as containers, they can have children. // The wxDataViewCtrl has such a root node with invalid items if (!item.IsOk()) { @@ -783,7 +770,7 @@ int TreeModel::Compare(const wxDataViewItem& item1, const wxDataViewItem& item2, if (_defaultStringSortColumn >= 0) { - return ascending ? + return ascending ? node1->values[_defaultStringSortColumn].GetString().CmpNoCase( node2->values[_defaultStringSortColumn].GetString()) : node2->values[_defaultStringSortColumn].GetString().CmpNoCase( @@ -791,13 +778,13 @@ int TreeModel::Compare(const wxDataViewItem& item1, const wxDataViewItem& item2, } // When clicking on the dataviewctrl headers, we need to support some default algorithm - + // implement a few comparison types switch (_columns[column].type) { case Column::String: { - return ascending ? + return ascending ? node1->values[column].GetString().CmpNoCase(node2->values[column].GetString()) : node2->values[column].GetString().CmpNoCase(node1->values[column].GetString()); } @@ -861,7 +848,7 @@ int TreeModel::Compare(const wxDataViewItem& item1, const wxDataViewItem& item2, { return 0; // no sense in comparing icons } - + default: break; // break to return 0 }; @@ -885,9 +872,9 @@ int TreeModel::CompareIconTextVariants(const wxVariant& a, const wxVariant& b) return aValue.GetText().CmpNoCase(bValue.GetText()); } -bool TreeModel::CompareFoldersFirst(const wxDataViewItem& a, const wxDataViewItem& b, +bool TreeModel::CompareFoldersFirst(const wxDataViewItem& a, const wxDataViewItem& b, const TreeModel::Column& stringColumn, - const std::function& stringCompareFunc, + const std::function& stringCompareFunc, const TreeModel::Column& isFolderCol, const std::function& folderCompareFunc) { @@ -914,7 +901,7 @@ bool TreeModel::CompareFoldersFirst(const wxDataViewItem& a, const wxDataViewIte return customResult < 0; } } - + // Compare folder names // greebo: We're not checking for equality here, shader names are unique wxVariant aName, bName; @@ -948,7 +935,7 @@ bool TreeModel::CompareFoldersFirst(const wxDataViewItem& a, const wxDataViewIte return stringCompareFunc(aName, bName) < 0; } } -} +} // Search functor which tries to find the next match for the given search string // is agnostic of the search direction, it just gets invoked for each row. @@ -973,7 +960,7 @@ class TreeModel::SearchFunctor public: SearchFunctor(const wxString& searchString, - const std::vector& columns, + const std::vector& columns, const wxDataViewItem& previousMatch) : _columns(columns), _previousMatch(previousMatch), @@ -1028,7 +1015,7 @@ wxDataViewItem TreeModel::FindNextString(const wxString& needle, return functor.getMatch(); } -// Search for an item in the given columns (backwards), using previousMatch as reference point +// Search for an item in the given columns (backwards), using previousMatch as reference point wxDataViewItem TreeModel::FindPrevString(const wxString& needle, const std::vector& columns, const wxDataViewItem& previousMatch) { @@ -1050,7 +1037,7 @@ bool TreeModel::IsEnabled(const wxDataViewItem& item, unsigned int col) const { return owningNode->enabledFlags[col]; } - + // Column values without flags render as enabled by default return true; } diff --git a/libs/wxutil/sourceview/SourceView.cpp b/libs/wxutil/sourceview/SourceView.cpp index ed3910a033..daba3186fb 100644 --- a/libs/wxutil/sourceview/SourceView.cpp +++ b/libs/wxutil/sourceview/SourceView.cpp @@ -1,4 +1,5 @@ #include "SourceView.h" +#include "registry/registry.h" namespace wxutil { @@ -50,7 +51,7 @@ void SourceViewCtrl::SetStyleMapping(int elementIndex, Element elementType) StyleSetForeground(elementIndex, wxColour(style.foreground)); wxFont font( - 11, wxFONTFAMILY_MODERN, + registry::getValue(RKEY_SOURCE_FONT_SIZE, 11), wxFONTFAMILY_MODERN, (style.fontstyle & Italic) > 0 ? wxFONTSTYLE_ITALIC : wxFONTSTYLE_NORMAL, (style.fontstyle & Bold) > 0 ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL, (style.fontstyle & Underline) > 0, style.fontname diff --git a/libs/wxutil/sourceview/SourceView.h b/libs/wxutil/sourceview/SourceView.h index 08e1ed5e50..b29b898236 100644 --- a/libs/wxutil/sourceview/SourceView.h +++ b/libs/wxutil/sourceview/SourceView.h @@ -6,14 +6,15 @@ namespace wxutil { +const std::string RKEY_SOURCE_FONT_SIZE = "user/ui/fonts/sourceEditor/size"; + /** * greebo: This is a custom extension of the wxWidgets styles text control, * providing a few methods to make the actual code style mapping easier. * It's advisable to subclass this control and map the various lexer-recognised * elements to a specific appearance. */ -class SourceViewCtrl : - public wxStyledTextCtrl +class SourceViewCtrl: public wxStyledTextCtrl { public: enum FontStyle diff --git a/plugins/dm.conversation/CommandEditor.h b/plugins/dm.conversation/CommandEditor.h index 72c23d28bb..d529db2607 100644 --- a/plugins/dm.conversation/CommandEditor.h +++ b/plugins/dm.conversation/CommandEditor.h @@ -1,12 +1,10 @@ #pragma once -#include "wxutil/dataview/TreeModel.h" #include "wxutil/dialog/DialogBase.h" #include "wxutil/XmlResourceBasedWidget.h" #include "Conversation.h" #include "ConversationCommand.h" -#include "ConversationCommandLibrary.h" #include "CommandArgumentItem.h" namespace ui diff --git a/plugins/dm.conversation/ConversationEditor.cpp b/plugins/dm.conversation/ConversationEditor.cpp index 9e4d188d49..2da9bc3001 100644 --- a/plugins/dm.conversation/ConversationEditor.cpp +++ b/plugins/dm.conversation/ConversationEditor.cpp @@ -12,6 +12,7 @@ #include "wxutil/dialog/MessageBox.h" #include +#include #include #include #include @@ -43,13 +44,11 @@ ConversationEditor::ConversationEditor(wxWindow* parent, conversation::Conversat // Clear the button sensitivity in the command actions panel updateCmdActionSensitivity(false); - - SetSize(500, 680); } void ConversationEditor::populateWindow() { - loadNamedPanel(this, "ConvEditorMainPanel"); + wxPanel* mainPanel = loadNamedPanel(this, "ConvEditorMainPanel"); makeLabelBold(this, "ConvEditorPropertyLabel"); makeLabelBold(this, "ConvEditorActorLabel"); @@ -153,6 +152,10 @@ void ConversationEditor::populateWindow() wxEVT_BUTTON, wxCommandEventHandler(ConversationEditor::onCancel), NULL, this); findNamedObject(this, "ConvEditorOkButton")->Connect( wxEVT_BUTTON, wxCommandEventHandler(ConversationEditor::onSave), NULL, this); + + wxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); + mainSizer->Add(mainPanel, 1, wxEXPAND); + SetSizerAndFit(mainSizer); } void ConversationEditor::updateWidgets() diff --git a/plugins/dm.conversation/ConversationEditor.h b/plugins/dm.conversation/ConversationEditor.h index d4accfdcdc..03fcb9171a 100644 --- a/plugins/dm.conversation/ConversationEditor.h +++ b/plugins/dm.conversation/ConversationEditor.h @@ -3,7 +3,6 @@ #include "wxutil/dialog/DialogBase.h" #include "wxutil/XmlResourceBasedWidget.h" #include "wxutil/dataview/TreeView.h" -#include #include "Conversation.h" diff --git a/plugins/dm.objectives/ComponentsDialog.cpp b/plugins/dm.objectives/ComponentsDialog.cpp index 649b351d09..e5ac5cbb99 100644 --- a/plugins/dm.objectives/ComponentsDialog.cpp +++ b/plugins/dm.objectives/ComponentsDialog.cpp @@ -31,31 +31,31 @@ const char* const DIALOG_TITLE = N_("Edit Objective"); // Main constructor ComponentsDialog::ComponentsDialog(wxWindow* parent, Objective& objective) : - DialogBase(_(DIALOG_TITLE), parent), - _objective(objective), - _componentList(new wxutil::TreeModel(_columns, true)), - _components(objective.components), // copy the components to our local working set - _updateMutex(false), - _updateNeeded(false) + DialogBase(_(DIALOG_TITLE), parent), + _objective(objective), + _componentList(new wxutil::TreeModel(_columns, true)), + _components(objective.components), // copy the components to our local working set + _updateMutex(false), + _updateNeeded(false) { - wxPanel* mainPanel = loadNamedPanel(this, "ObjCompMainPanel"); + wxPanel* mainPanel = loadNamedPanel(this, "ObjCompMainPanel"); - // Dialog contains list view, edit panel and buttons - setupObjectiveEditPanel(); + // Dialog contains list view, edit panel and buttons + setupObjectiveEditPanel(); - makeLabelBold(this, "ObjCompListLabel"); + makeLabelBold(this, "ObjCompListLabel"); - createListView(); - setupEditPanel(); + createListView(); + setupEditPanel(); - // Populate the list of components - populateObjectiveEditPanel(); - populateComponents(); - - mainPanel->Layout(); - mainPanel->Fit(); - Fit(); - CenterOnParent(); + // Populate the list of components + populateObjectiveEditPanel(); + populateComponents(); + + wxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); + mainSizer->Add(mainPanel, 1, wxEXPAND | wxALL, 12); + SetSizerAndFit(mainSizer); + CenterOnParent(); } ComponentsDialog::~ComponentsDialog() @@ -65,168 +65,168 @@ ComponentsDialog::~ComponentsDialog() // Create the panel for editing the currently-selected objective void ComponentsDialog::setupObjectiveEditPanel() { - _objDescriptionEntry = findNamedObject(this, "ObjCompDescription"); - _objStateCombo = findNamedObject(this, "ObjCompInitialState"); - - _diffPanel.reset(new DifficultyPanel(findNamedObject(this, "ObjCompDiffPanel"))); - - // Populate the list of states. This must be done in order to match the - // values in the enum, since the index will be used when writing to entity - _objStateCombo->Append(Objective::getStateText(Objective::INCOMPLETE), - new wxStringClientData(string::to_string(Objective::INCOMPLETE))); - _objStateCombo->Append(Objective::getStateText(Objective::COMPLETE), - new wxStringClientData(string::to_string(Objective::COMPLETE))); - _objStateCombo->Append(Objective::getStateText(Objective::INVALID), - new wxStringClientData(string::to_string(Objective::INVALID))); - _objStateCombo->Append(Objective::getStateText(Objective::FAILED), - new wxStringClientData(string::to_string(Objective::FAILED))); - - _objMandatoryFlag = findNamedObject(this, "ObjCompObjMandatory"); - _objIrreversibleFlag = findNamedObject(this, "ObjCompObjIrreversible"); - _objOngoingFlag = findNamedObject(this, "ObjCompObjOngoing"); - _objVisibleFlag = findNamedObject(this, "ObjCompObjVisible"); - - // Enabling objectives - _enablingObjs = findNamedObject(this, "ObjCompEnablingObjectives"); - - // Logic - _successLogic = findNamedObject(this, "ObjCompSuccessLogic"); - _failureLogic = findNamedObject(this, "ObjCompFailureLogic"); - - // Completion/failure scripts - _completionScript = findNamedObject(this, "ObjCompCompletionScript"); - _failureScript = findNamedObject(this, "ObjCompFailureScript"); - - // Completion/failure targets - _completionTarget = findNamedObject(this, "ObjCompCompletionTarget"); - _failureTarget = findNamedObject(this, "ObjCompFailureTarget"); + _objDescriptionEntry = findNamedObject(this, "ObjCompDescription"); + _objStateCombo = findNamedObject(this, "ObjCompInitialState"); + + _diffPanel.reset(new DifficultyPanel(findNamedObject(this, "ObjCompDiffPanel"))); + + // Populate the list of states. This must be done in order to match the + // values in the enum, since the index will be used when writing to entity + _objStateCombo->Append(Objective::getStateText(Objective::INCOMPLETE), + new wxStringClientData(string::to_string(Objective::INCOMPLETE))); + _objStateCombo->Append(Objective::getStateText(Objective::COMPLETE), + new wxStringClientData(string::to_string(Objective::COMPLETE))); + _objStateCombo->Append(Objective::getStateText(Objective::INVALID), + new wxStringClientData(string::to_string(Objective::INVALID))); + _objStateCombo->Append(Objective::getStateText(Objective::FAILED), + new wxStringClientData(string::to_string(Objective::FAILED))); + + _objMandatoryFlag = findNamedObject(this, "ObjCompObjMandatory"); + _objIrreversibleFlag = findNamedObject(this, "ObjCompObjIrreversible"); + _objOngoingFlag = findNamedObject(this, "ObjCompObjOngoing"); + _objVisibleFlag = findNamedObject(this, "ObjCompObjVisible"); + + // Enabling objectives + _enablingObjs = findNamedObject(this, "ObjCompEnablingObjectives"); + + // Logic + _successLogic = findNamedObject(this, "ObjCompSuccessLogic"); + _failureLogic = findNamedObject(this, "ObjCompFailureLogic"); + + // Completion/failure scripts + _completionScript = findNamedObject(this, "ObjCompCompletionScript"); + _failureScript = findNamedObject(this, "ObjCompFailureScript"); + + // Completion/failure targets + _completionTarget = findNamedObject(this, "ObjCompCompletionTarget"); + _failureTarget = findNamedObject(this, "ObjCompFailureTarget"); } // Create list view void ComponentsDialog::createListView() { - // Create tree view and connect selection changed callback - wxPanel* treeViewPanel = findNamedObject(this, "ObjCompListViewPanel"); - _componentView = wxutil::TreeView::CreateWithModel(treeViewPanel, _componentList.get()); - treeViewPanel->GetSizer()->Add(_componentView, 1, wxEXPAND); - treeViewPanel->SetMinClientSize(wxSize(-1, 90)); - - _componentView->Connect(wxEVT_DATAVIEW_SELECTION_CHANGED, - wxDataViewEventHandler(ComponentsDialog::_onSelectionChanged), NULL, this); - - _componentView->AppendTextColumn("#", _columns.index.getColumnIndex(), - wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE, wxALIGN_NOT, wxDATAVIEW_COL_SORTABLE); - _componentView->AppendTextColumn(_("Type"), _columns.description.getColumnIndex(), - wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE, wxALIGN_NOT, wxDATAVIEW_COL_SORTABLE); - - // Create Add and Delete buttons for components - wxButton* addButton = findNamedObject(this, "ObjCompAddComponentButton"); - wxButton* delButton = findNamedObject(this, "ObjCompDeleteComponentButton"); - - addButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ComponentsDialog::_onAddComponent), NULL, this); - delButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ComponentsDialog::_onDeleteComponent), NULL, this); + // Create tree view and connect selection changed callback + wxPanel* treeViewPanel = findNamedObject(this, "ObjCompListViewPanel"); + _componentView = wxutil::TreeView::CreateWithModel(treeViewPanel, _componentList.get()); + treeViewPanel->GetSizer()->Add(_componentView, 1, wxEXPAND); + treeViewPanel->SetMinClientSize(wxSize(-1, 90)); + + _componentView->Connect(wxEVT_DATAVIEW_SELECTION_CHANGED, + wxDataViewEventHandler(ComponentsDialog::_onSelectionChanged), NULL, this); + + _componentView->AppendTextColumn("#", _columns.index.getColumnIndex(), + wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE, wxALIGN_NOT, wxDATAVIEW_COL_SORTABLE); + _componentView->AppendTextColumn(_("Type"), _columns.description.getColumnIndex(), + wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE, wxALIGN_NOT, wxDATAVIEW_COL_SORTABLE); + + // Create Add and Delete buttons for components + wxButton* addButton = findNamedObject(this, "ObjCompAddComponentButton"); + wxButton* delButton = findNamedObject(this, "ObjCompDeleteComponentButton"); + + addButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ComponentsDialog::_onAddComponent), NULL, this); + delButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ComponentsDialog::_onDeleteComponent), NULL, this); } // Create edit panel void ComponentsDialog::setupEditPanel() { - // Table - _editPanel = findNamedObject(this, "ObjCompComponentEditPanel"); - _editPanel->Enable(false); // disabled at start - - // Component type dropdown - _typeCombo = findNamedObject(this, "ObjCompComponentType"); - _typeCombo->Connect(wxEVT_CHOICE, wxCommandEventHandler(ComponentsDialog::_onTypeChanged), NULL, this); - - // Populate the combo box. The set is in ID order. - for (ComponentTypeSet::const_iterator i = ComponentType::SET_ALL().begin(); - i != ComponentType::SET_ALL().end(); - ++i) - { - _typeCombo->Append(i->getDisplayName(), new wxStringClientData(string::to_string(i->getId()))); - } - - // Flags hbox - _stateFlag = findNamedObject(this, "ObjCompSatisfiedAtStart"); - _irreversibleFlag = findNamedObject(this, "ObjCompIrreversible"); - _invertedFlag = findNamedObject(this, "ObjCompBooleanNOT"); - _playerResponsibleFlag = findNamedObject(this, "ObjCompPlayerResponsible"); - - _stateFlag->Connect(wxEVT_CHECKBOX, wxCommandEventHandler(ComponentsDialog::_onCompToggleChanged), NULL, this); - _irreversibleFlag->Connect(wxEVT_CHECKBOX, wxCommandEventHandler(ComponentsDialog::_onCompToggleChanged), NULL, this); - _invertedFlag->Connect(wxEVT_CHECKBOX, wxCommandEventHandler(ComponentsDialog::_onCompToggleChanged), NULL, this); - _playerResponsibleFlag->Connect(wxEVT_CHECKBOX, wxCommandEventHandler(ComponentsDialog::_onCompToggleChanged), NULL, this); - - _compEditorPanel = findNamedObject(this, "ObjCompEditorContainer"); + // Table + _editPanel = findNamedObject(this, "ObjCompComponentEditPanel"); + _editPanel->Enable(false); // disabled at start + + // Component type dropdown + _typeCombo = findNamedObject(this, "ObjCompComponentType"); + _typeCombo->Connect(wxEVT_CHOICE, wxCommandEventHandler(ComponentsDialog::_onTypeChanged), NULL, this); + + // Populate the combo box. The set is in ID order. + for (ComponentTypeSet::const_iterator i = ComponentType::SET_ALL().begin(); + i != ComponentType::SET_ALL().end(); + ++i) + { + _typeCombo->Append(i->getDisplayName(), new wxStringClientData(string::to_string(i->getId()))); + } + + // Flags hbox + _stateFlag = findNamedObject(this, "ObjCompSatisfiedAtStart"); + _irreversibleFlag = findNamedObject(this, "ObjCompIrreversible"); + _invertedFlag = findNamedObject(this, "ObjCompBooleanNOT"); + _playerResponsibleFlag = findNamedObject(this, "ObjCompPlayerResponsible"); + + _stateFlag->Connect(wxEVT_CHECKBOX, wxCommandEventHandler(ComponentsDialog::_onCompToggleChanged), NULL, this); + _irreversibleFlag->Connect(wxEVT_CHECKBOX, wxCommandEventHandler(ComponentsDialog::_onCompToggleChanged), NULL, this); + _invertedFlag->Connect(wxEVT_CHECKBOX, wxCommandEventHandler(ComponentsDialog::_onCompToggleChanged), NULL, this); + _playerResponsibleFlag->Connect(wxEVT_CHECKBOX, wxCommandEventHandler(ComponentsDialog::_onCompToggleChanged), NULL, this); + + _compEditorPanel = findNamedObject(this, "ObjCompEditorContainer"); } // Populate the component list void ComponentsDialog::populateComponents() { - // Clear the list store - _componentList->Clear(); + // Clear the list store + _componentList->Clear(); - // Add components from the Objective to the list store - for (Objective::ComponentMap::iterator i = _components.begin(); - i != _components.end(); - ++i) - { - wxutil::TreeModel::Row row = _componentList->AddItem(); + // Add components from the Objective to the list store + for (Objective::ComponentMap::iterator i = _components.begin(); + i != _components.end(); + ++i) + { + wxutil::TreeModel::Row row = _componentList->AddItem(); - row[_columns.index] = i->first; - row[_columns.description] = i->second.getString(); + row[_columns.index] = i->first; + row[_columns.description] = i->second.getString(); - row.SendItemAdded(); - } + row.SendItemAdded(); + } - _updateNeeded = true; + _updateNeeded = true; } void ComponentsDialog::updateComponents() { - // Traverse all components and update the items in the list - for (Objective::ComponentMap::iterator i = _components.begin(); - i != _components.end(); - ++i) - { - // Find the item in the list store (0th column carries the ID) - wxDataViewItem item = _componentList->FindInteger(i->first, _columns.index); - - // Check if we found the item - if (item.IsOk()) - { - wxutil::TreeModel::Row row(item, *_componentList); - - row[_columns.index] = i->first; - row[_columns.description] = i->second.getString(); - - row.SendItemChanged(); - } - } + // Traverse all components and update the items in the list + for (Objective::ComponentMap::iterator i = _components.begin(); + i != _components.end(); + ++i) + { + // Find the item in the list store (0th column carries the ID) + wxDataViewItem item = _componentList->FindInteger(i->first, _columns.index); + + // Check if we found the item + if (item.IsOk()) + { + wxutil::TreeModel::Row row(item, *_componentList); + + row[_columns.index] = i->first; + row[_columns.description] = i->second.getString(); + + row.SendItemChanged(); + } + } } // Populate the edit panel void ComponentsDialog::populateEditPanel(int index) { - // Get the component - Component& comp = _components[index]; - - // Set the flags - _stateFlag->SetValue(comp.isSatisfied()); - _irreversibleFlag->SetValue(comp.isIrreversible()); - _invertedFlag->SetValue(comp.isInverted()); - _playerResponsibleFlag->SetValue(comp.isPlayerResponsible()); - - // Change the type combo if necessary. - // Since the combo box was populated in - // ID order, we can simply use our ComponentType's ID as an index. - if (_typeCombo->GetSelection() != comp.getType().getId()) + // Get the component + Component& comp = _components[index]; + + // Set the flags + _stateFlag->SetValue(comp.isSatisfied()); + _irreversibleFlag->SetValue(comp.isIrreversible()); + _invertedFlag->SetValue(comp.isInverted()); + _playerResponsibleFlag->SetValue(comp.isPlayerResponsible()); + + // Change the type combo if necessary. + // Since the combo box was populated in + // ID order, we can simply use our ComponentType's ID as an index. + if (_typeCombo->GetSelection() != comp.getType().getId()) { - // Change the combo selection - _typeCombo->Select(comp.getType().getId()); + // Change the combo selection + _typeCombo->Select(comp.getType().getId()); - // Trigger component change, to update editor panel - handleTypeChange(); + // Trigger component change, to update editor panel + handleTypeChange(); } else { @@ -240,224 +240,224 @@ void ComponentsDialog::populateEditPanel(int index) // Populate the edit panel widgets using the given objective number void ComponentsDialog::populateObjectiveEditPanel() { - // Disable callbacks while we're at it - _updateMutex = true; + // Disable callbacks while we're at it + _updateMutex = true; - // Get the objective - const Objective& obj = _objective; + // Get the objective + const Objective& obj = _objective; - // Set description text - _objDescriptionEntry->SetValue(obj.description); + // Set description text + _objDescriptionEntry->SetValue(obj.description); - // Update the difficulty panel - _diffPanel->populateFromObjective(obj); + // Update the difficulty panel + _diffPanel->populateFromObjective(obj); - // Set initial state enum - wxutil::ChoiceHelper::SelectItemByStoredId(_objStateCombo, static_cast(obj.state)); + // Set initial state enum + wxutil::ChoiceHelper::SelectItemByStoredId(_objStateCombo, static_cast(obj.state)); - // Set flags - _objIrreversibleFlag->SetValue(obj.irreversible); - _objOngoingFlag->SetValue(obj.ongoing); - _objMandatoryFlag->SetValue(obj.mandatory); - _objVisibleFlag->SetValue(obj.visible); + // Set flags + _objIrreversibleFlag->SetValue(obj.irreversible); + _objOngoingFlag->SetValue(obj.ongoing); + _objMandatoryFlag->SetValue(obj.mandatory); + _objVisibleFlag->SetValue(obj.visible); - _enablingObjs->SetValue(obj.enablingObjs); + _enablingObjs->SetValue(obj.enablingObjs); - _successLogic->SetValue(obj.logic.successLogic); - _failureLogic->SetValue(obj.logic.failureLogic); + _successLogic->SetValue(obj.logic.successLogic); + _failureLogic->SetValue(obj.logic.failureLogic); - _completionScript->SetValue(obj.completionScript); - _failureScript->SetValue(obj.failureScript); + _completionScript->SetValue(obj.completionScript); + _failureScript->SetValue(obj.failureScript); - _completionTarget->SetValue(obj.completionTarget); - _failureTarget->SetValue(obj.failureTarget); + _completionTarget->SetValue(obj.completionTarget); + _failureTarget->SetValue(obj.failureTarget); - _updateMutex = false; + _updateMutex = false; } // Get selected component index int ComponentsDialog::getSelectedIndex() { - // Get the selection if valid - wxDataViewItem item = _componentView->GetSelection(); - - if (item.IsOk()) - { - // Valid selection, return the contents of the index column - wxutil::TreeModel::Row row(item, *_componentList); - return row[_columns.index].getInteger(); - } - else - { - return -1; - } + // Get the selection if valid + wxDataViewItem item = _componentView->GetSelection(); + + if (item.IsOk()) + { + // Valid selection, return the contents of the index column + wxutil::TreeModel::Row row(item, *_componentList); + return row[_columns.index].getInteger(); + } + else + { + return -1; + } } // Change component editor void ComponentsDialog::changeComponentEditor(Component& compToEdit) { - // greebo: Get a new component editor, any previous one will auto-destroy and - // remove its widget from the container. - _componentEditor = ce::ComponentEditorFactory::create( + // greebo: Get a new component editor, any previous one will auto-destroy and + // remove its widget from the container. + _componentEditor = ce::ComponentEditorFactory::create( _compEditorPanel, compToEdit.getType().getName(), compToEdit - ); + ); - if (_componentEditor) - { - // The widgets are constructed and filled with correct values, + if (_componentEditor) + { + // The widgets are constructed and filled with correct values, // from this point on we can write updates to the component automatically _componentEditor->setActive(true); - // Get the widget from the ComponentEditor and show it - // Pack the widget into the containing frame - _compEditorPanel->GetSizer()->Add(_componentEditor->getWidget(), 1, wxEXPAND | wxALL, 12); + // Get the widget from the ComponentEditor and show it + // Pack the widget into the containing frame + _compEditorPanel->GetSizer()->Add(_componentEditor->getWidget(), 1, wxEXPAND | wxALL, 12); _compEditorPanel->Layout(); - _compEditorPanel->Fit(); - findNamedObject(this, "ObjCompMainPanel")->Fit(); - Fit(); - } + _compEditorPanel->Fit(); + findNamedObject(this, "ObjCompMainPanel")->Fit(); + Fit(); + } } // Safely write the ComponentEditor contents to the Component void ComponentsDialog::checkWriteComponent() { - if (_componentEditor) - { + if (_componentEditor) + { _componentEditor->writeToComponent(); - } + } } void ComponentsDialog::save() { - // Write the objective properties - _objective.description = _objDescriptionEntry->GetValue().ToStdString(); + // Write the objective properties + _objective.description = _objDescriptionEntry->GetValue().ToStdString(); - // Save the difficulty settings - _diffPanel->writeToObjective(_objective); + // Save the difficulty settings + _diffPanel->writeToObjective(_objective); - // Set the initial state enum value from the combo box index - _objective.state = static_cast( - wxutil::ChoiceHelper::GetSelectionId(_objStateCombo)); + // Set the initial state enum value from the combo box index + _objective.state = static_cast( + wxutil::ChoiceHelper::GetSelectionId(_objStateCombo)); - // Determine which checkbox is toggled, then update the appropriate flag - _objective.mandatory = _objMandatoryFlag->GetValue(); - _objective.visible = _objVisibleFlag->GetValue(); - _objective.ongoing = _objOngoingFlag->GetValue(); - _objective.irreversible = _objIrreversibleFlag->GetValue(); + // Determine which checkbox is toggled, then update the appropriate flag + _objective.mandatory = _objMandatoryFlag->GetValue(); + _objective.visible = _objVisibleFlag->GetValue(); + _objective.ongoing = _objOngoingFlag->GetValue(); + _objective.irreversible = _objIrreversibleFlag->GetValue(); - // Enabling objectives - _objective.enablingObjs = _enablingObjs->GetValue(); + // Enabling objectives + _objective.enablingObjs = _enablingObjs->GetValue(); - // Success/failure logic - _objective.logic.successLogic = _successLogic->GetValue(); - _objective.logic.failureLogic = _failureLogic->GetValue(); + // Success/failure logic + _objective.logic.successLogic = _successLogic->GetValue(); + _objective.logic.failureLogic = _failureLogic->GetValue(); - // Completion/Failure script - _objective.completionScript = _completionScript->GetValue(); - _objective.failureScript = _failureScript->GetValue(); + // Completion/Failure script + _objective.completionScript = _completionScript->GetValue(); + _objective.failureScript = _failureScript->GetValue(); - // Completion/Failure targets - _objective.completionTarget = _completionTarget->GetValue(); - _objective.failureTarget = _failureTarget->GetValue(); + // Completion/Failure targets + _objective.completionTarget = _completionTarget->GetValue(); + _objective.failureTarget = _failureTarget->GetValue(); - // Write the components - checkWriteComponent(); + // Write the components + checkWriteComponent(); - // Copy the working set over the ones in the objective - _objective.components.swap(_components); + // Copy the working set over the ones in the objective + _objective.components.swap(_components); } int ComponentsDialog::ShowModal() { - int returnCode = DialogBase::ShowModal(); + int returnCode = DialogBase::ShowModal(); - if (returnCode == wxID_OK) - { - save(); - } + if (returnCode == wxID_OK) + { + save(); + } - return returnCode; + return returnCode; } void ComponentsDialog::_onCompToggleChanged(wxCommandEvent& ev) { - if (_updateMutex) return; - - // Update the Component working copy. The selected index must be valid, since the - // edit panel is only sensitive if a component is selected - int idx = getSelectedIndex(); - assert(idx >= 0); - - Component& comp = _components[idx]; - - wxCheckBox* checkbox = dynamic_cast(ev.GetEventObject()); - - if (checkbox == _stateFlag) - { - comp.setSatisfied(checkbox->GetValue()); - } - else if (checkbox == _irreversibleFlag) - { - comp.setIrreversible(checkbox->GetValue()); - } - else if (checkbox == _invertedFlag) - { - comp.setInverted(checkbox->GetValue()); - } - else if (checkbox == _playerResponsibleFlag) - { - comp.setPlayerResponsible(checkbox->GetValue()); - } - - // Update the list store - updateComponents(); + if (_updateMutex) return; + + // Update the Component working copy. The selected index must be valid, since the + // edit panel is only sensitive if a component is selected + int idx = getSelectedIndex(); + assert(idx >= 0); + + Component& comp = _components[idx]; + + wxCheckBox* checkbox = dynamic_cast(ev.GetEventObject()); + + if (checkbox == _stateFlag) + { + comp.setSatisfied(checkbox->GetValue()); + } + else if (checkbox == _irreversibleFlag) + { + comp.setIrreversible(checkbox->GetValue()); + } + else if (checkbox == _invertedFlag) + { + comp.setInverted(checkbox->GetValue()); + } + else if (checkbox == _playerResponsibleFlag) + { + comp.setPlayerResponsible(checkbox->GetValue()); + } + + // Update the list store + updateComponents(); } void ComponentsDialog::handleSelectionChange() { - // Save the existing ComponentEditor contents if req'd + // Save the existing ComponentEditor contents if req'd checkWriteComponent(); - // Disconnect notification callback - _componentChanged.disconnect(); + // Disconnect notification callback + _componentChanged.disconnect(); - // Get the selection if valid - wxDataViewItem item = _componentView->GetSelection(); + // Get the selection if valid + wxDataViewItem item = _componentView->GetSelection(); - if (!item.IsOk()) + if (!item.IsOk()) { - // Disable the edit panel and remove the ComponentEditor - _compEditorPanel->Enable(false); - _editPanel->Enable(false); - _componentEditor = objectives::ce::ComponentEditorPtr(); - } - else - { - // Otherwise populate edit panel with the current component index - wxutil::TreeModel::Row row(item, *_componentList); - int index = row[_columns.index].getInteger(); - - populateEditPanel(index); - - // Enable the edit panel - _compEditorPanel->Enable(true); - _editPanel->Enable(true); - - // Subscribe to the component - Component& comp = _components[index]; - _componentChanged = comp.signal_Changed().connect( - sigc::mem_fun(*this, &ComponentsDialog::_onComponentChanged)); - } + // Disable the edit panel and remove the ComponentEditor + _compEditorPanel->Enable(false); + _editPanel->Enable(false); + _componentEditor = objectives::ce::ComponentEditorPtr(); + } + else + { + // Otherwise populate edit panel with the current component index + wxutil::TreeModel::Row row(item, *_componentList); + int index = row[_columns.index].getInteger(); + + populateEditPanel(index); + + // Enable the edit panel + _compEditorPanel->Enable(true); + _editPanel->Enable(true); + + // Subscribe to the component + Component& comp = _components[index]; + _componentChanged = comp.signal_Changed().connect( + sigc::mem_fun(*this, &ComponentsDialog::_onComponentChanged)); + } } void ComponentsDialog::_onComponentChanged() { - wxDataViewItem item = _componentView->GetSelection(); + wxDataViewItem item = _componentView->GetSelection(); - if (!item.IsOk()) return; + if (!item.IsOk()) return; - updateComponents(); + updateComponents(); } // Selection changed @@ -469,40 +469,40 @@ void ComponentsDialog::_onSelectionChanged(wxDataViewEvent& ev) // Add a new component void ComponentsDialog::_onAddComponent(wxCommandEvent& ev) { - Objective::ComponentMap& components = _components; - - // Find an unused component number (starting from 1) - for (int idx = 1; idx < INT_MAX; ++idx) - { - if (components.find(idx) == components.end()) { - // Unused, add a new component here - Component comp; - components.insert(std::make_pair(idx, comp)); - break; - } - } - - // Refresh the component list - populateComponents(); + Objective::ComponentMap& components = _components; + + // Find an unused component number (starting from 1) + for (int idx = 1; idx < INT_MAX; ++idx) + { + if (components.find(idx) == components.end()) { + // Unused, add a new component here + Component comp; + components.insert(std::make_pair(idx, comp)); + break; + } + } + + // Refresh the component list + populateComponents(); } // Remove a component void ComponentsDialog::_onDeleteComponent(wxCommandEvent& ev) { - // Delete the selected component - int idx = getSelectedIndex(); + // Delete the selected component + int idx = getSelectedIndex(); - if (idx != -1) + if (idx != -1) { // Remove the selection first, so our selection-changed callback does not // attempt to writeToComponent() after the Component has already been deleted - _componentView->UnselectAll(); + _componentView->UnselectAll(); - // UnselectAll doesn't seem to trigger a selection change - handleSelectionChange(); + // UnselectAll doesn't seem to trigger a selection change + handleSelectionChange(); // Erase the actual component - _components.erase(idx); + _components.erase(idx); // #5810: Re-index the remaining components (shift all higher ones by -1) auto highestKey = _components.rbegin(); @@ -522,43 +522,43 @@ void ComponentsDialog::_onDeleteComponent(wxCommandEvent& ev) } } } - } + } - // Refresh the list - populateComponents(); + // Refresh the list + populateComponents(); } void ComponentsDialog::handleTypeChange() { - // Get the current selection - int typeId = wxutil::ChoiceHelper::GetSelectionId(_typeCombo); + // Get the current selection + int typeId = wxutil::ChoiceHelper::GetSelectionId(_typeCombo); - // Update the Objective object. The selected index must be valid, since the - // edit panel is only sensitive if a component is selected - int idx = getSelectedIndex(); - assert(idx >= 0); + // Update the Objective object. The selected index must be valid, since the + // edit panel is only sensitive if a component is selected + int idx = getSelectedIndex(); + assert(idx >= 0); - Component& comp = _components[idx]; + Component& comp = _components[idx]; // Store the newly-selected type in the Component - comp.setType(ComponentType::getComponentType(typeId)); + comp.setType(ComponentType::getComponentType(typeId)); // Change the ComponentEditor changeComponentEditor(comp); - // Update the components list with the new display string - wxutil::TreeModel::Row row(_componentView->GetSelection(), *_componentList); + // Update the components list with the new display string + wxutil::TreeModel::Row row(_componentView->GetSelection(), *_componentList); - row[_columns.description] = comp.getString(); - row.SendItemChanged(); + row[_columns.description] = comp.getString(); + row.SendItemChanged(); - _updateNeeded = true; + _updateNeeded = true; } // Type combo changed void ComponentsDialog::_onTypeChanged(wxCommandEvent& ev) { - handleTypeChange(); + handleTypeChange(); } } // namespace objectives diff --git a/plugins/dm.objectives/ComponentsDialog.h b/plugins/dm.objectives/ComponentsDialog.h index 6c97e6bf41..d9d3375d91 100644 --- a/plugins/dm.objectives/ComponentsDialog.h +++ b/plugins/dm.objectives/ComponentsDialog.h @@ -29,7 +29,6 @@ class ComponentsDialog : public wxutil::DialogBase, private wxutil::XmlResourceBasedWidget { -private: // The objective we are editing Objective& _objective; diff --git a/plugins/dm.objectives/ObjectivesEditor.cpp b/plugins/dm.objectives/ObjectivesEditor.cpp index e1724f8260..4988617de8 100644 --- a/plugins/dm.objectives/ObjectivesEditor.cpp +++ b/plugins/dm.objectives/ObjectivesEditor.cpp @@ -29,39 +29,39 @@ namespace objectives // CONSTANTS namespace { - const char* const DIALOG_TITLE = N_("Mission Objectives"); + const char* const DIALOG_TITLE = N_("Mission Objectives"); - const std::string RKEY_ROOT = "user/ui/objectivesEditor/"; - const std::string RKEY_WINDOW_STATE = RKEY_ROOT + "window"; - const std::string GKEY_OBJECTIVE_ENTS = "/objectivesEditor//objectivesEClass"; + const std::string RKEY_ROOT = "user/ui/objectivesEditor/"; + const std::string RKEY_WINDOW_STATE = RKEY_ROOT + "window"; + const std::string GKEY_OBJECTIVE_ENTS = "/objectivesEditor//objectivesEClass"; } // Constructor creates widgets ObjectivesEditor::ObjectivesEditor() : - DialogBase(_(DIALOG_TITLE)), - _objectiveEntityList(new wxutil::TreeModel(_objEntityColumns, true)), - _objectiveList(new wxutil::TreeModel(_objectiveColumns, true)) + DialogBase(_(DIALOG_TITLE)), + _objectiveEntityList(new wxutil::TreeModel(_objEntityColumns, true)), + _objectiveList(new wxutil::TreeModel(_objectiveColumns, true)) { - wxPanel* mainPanel = loadNamedPanel(this, "ObjDialogMainPanel"); + wxPanel* mainPanel = loadNamedPanel(this, "ObjDialogMainPanel"); // Setup signals and tree views setupEntitiesPanel(); setupObjectivesPanel(); // Buttons not associated with a treeview panel - wxButton* successLogicButton = findNamedObject(this, "ObjDialogSuccessLogicButton"); - successLogicButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onEditLogic), NULL, this); - successLogicButton->Enable(false); + wxButton* successLogicButton = findNamedObject(this, "ObjDialogSuccessLogicButton"); + successLogicButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onEditLogic), NULL, this); + successLogicButton->Enable(false); - wxButton* objCondButton = findNamedObject(this, "ObjDialogObjConditionsButton"); - objCondButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onEditObjConditions), NULL, this); - objCondButton->Enable(false); + wxButton* objCondButton = findNamedObject(this, "ObjDialogObjConditionsButton"); + objCondButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onEditObjConditions), NULL, this); + objCondButton->Enable(false); - findNamedObject(this, "ObjDialogCancelButton")->Connect( - wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onCancel), NULL, this); + findNamedObject(this, "ObjDialogCancelButton")->Connect( + wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onCancel), NULL, this); - findNamedObject(this, "ObjDialogOkButton")->Connect( - wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onOK), NULL, this); + findNamedObject(this, "ObjDialogOkButton")->Connect( + wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onOK), NULL, this); _objectiveEClasses.clear(); @@ -72,9 +72,9 @@ ObjectivesEditor::ObjectivesEditor() : _objectiveEClasses.push_back(node.getAttributeValue("name")); } - mainPanel->Layout(); - mainPanel->Fit(); - Fit(); + wxSizer* sizer = new wxBoxSizer(wxVERTICAL); + sizer->Add(mainPanel, 1, wxEXPAND | wxALL, 12); + SetSizerAndFit(sizer); CenterOnParent(); // Remember the previous position or set up defaults @@ -84,112 +84,107 @@ ObjectivesEditor::ObjectivesEditor() : // Create the objects panel (for manipulating the target_addobjectives objects) void ObjectivesEditor::setupEntitiesPanel() { - makeLabelBold(this, "ObjDialogEntityLabel"); + // Tree view listing the target_addobjectives entities + wxPanel* entityPanel = findNamedObject(this, "ObjDialogEntityPanel"); - // Tree view listing the target_addobjectives entities - wxPanel* entityPanel = findNamedObject(this, "ObjDialogEntityPanel"); + // Entity Tree View + _objectiveEntityView = wxutil::TreeView::CreateWithModel(entityPanel, _objectiveEntityList.get(), wxDV_NO_HEADER); + entityPanel->GetSizer()->Add(_objectiveEntityView, 1, wxEXPAND); - // Entity Tree View - _objectiveEntityView = wxutil::TreeView::CreateWithModel(entityPanel, _objectiveEntityList.get(), wxDV_NO_HEADER); - entityPanel->GetSizer()->Add(_objectiveEntityView, 1, wxEXPAND); + _objectiveEntityView->AppendToggleColumn(_("Start"), _objEntityColumns.startActive.getColumnIndex(), + wxDATAVIEW_CELL_ACTIVATABLE, wxCOL_WIDTH_AUTOSIZE, wxALIGN_NOT); + _objectiveEntityView->AppendTextColumn("", _objEntityColumns.displayName.getColumnIndex(), + wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE, wxALIGN_NOT, wxDATAVIEW_COL_SORTABLE); - _objectiveEntityView->AppendToggleColumn(_("Start"), _objEntityColumns.startActive.getColumnIndex(), - wxDATAVIEW_CELL_ACTIVATABLE, wxCOL_WIDTH_AUTOSIZE, wxALIGN_NOT); - _objectiveEntityView->AppendTextColumn("", _objEntityColumns.displayName.getColumnIndex(), - wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE, wxALIGN_NOT, wxDATAVIEW_COL_SORTABLE); + _objectiveEntityView->Connect(wxEVT_DATAVIEW_SELECTION_CHANGED, + wxDataViewEventHandler(ObjectivesEditor::_onEntitySelectionChanged), NULL, this); - _objectiveEntityView->Connect(wxEVT_DATAVIEW_SELECTION_CHANGED, - wxDataViewEventHandler(ObjectivesEditor::_onEntitySelectionChanged), NULL, this); - - // Active-at-start column (checkbox) - _objectiveEntityView->Connect(wxEVT_DATAVIEW_ITEM_EDITING_DONE, - wxDataViewEventHandler(ObjectivesEditor::_onStartActiveCellToggled), NULL, this); + // Active-at-start column (checkbox) + _objectiveEntityView->Connect(wxEVT_DATAVIEW_ITEM_EDITING_DONE, + wxDataViewEventHandler(ObjectivesEditor::_onStartActiveCellToggled), NULL, this); // Connect button signals - findNamedObject(this, "ObjDialogAddEntityButton")->Connect( - wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onAddEntity), NULL, this); + findNamedObject(this, "ObjDialogAddEntityButton")->Connect( + wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onAddEntity), NULL, this); - wxButton* deleteButton = findNamedObject(this, "ObjDialogDeleteEntityButton"); - deleteButton->Enable(false); // disabled at start - deleteButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onDeleteEntity), NULL, this); + wxButton* deleteButton = findNamedObject(this, "ObjDialogDeleteEntityButton"); + deleteButton->Enable(false); // disabled at start + deleteButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onDeleteEntity), NULL, this); } // Create the main objective editing widgets void ObjectivesEditor::setupObjectivesPanel() { - makeLabelBold(this, "ObjDialogObjectivesLabel"); - makeLabelBold(this, "ObjDialogLogicLabel"); - - wxPanel* panel = findNamedObject(this, "ObjDialogObjectivesPanel"); + wxPanel* panel = findNamedObject(this, "ObjDialogObjectivesPanel"); - // Entity Tree View - _objectiveView = wxutil::TreeView::CreateWithModel(panel, _objectiveList.get()); - panel->GetSizer()->Add(_objectiveView, 1, wxEXPAND); + // Entity Tree View + _objectiveView = wxutil::TreeView::CreateWithModel(panel, _objectiveList.get()); + panel->GetSizer()->Add(_objectiveView, 1, wxEXPAND); - // Key and value text columns - _objectiveView->AppendTextColumn("#", _objectiveColumns.objNumber.getColumnIndex(), - wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE, wxALIGN_NOT); - _objectiveView->AppendTextColumn(_("Description"), _objectiveColumns.description.getColumnIndex(), - wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE, wxALIGN_NOT); - _objectiveView->AppendTextColumn(_("Diff."), _objectiveColumns.difficultyLevel.getColumnIndex(), - wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE, wxALIGN_NOT); + // Key and value text columns + _objectiveView->AppendTextColumn("#", _objectiveColumns.objNumber.getColumnIndex(), + wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE, wxALIGN_NOT); + _objectiveView->AppendTextColumn(_("Description"), _objectiveColumns.description.getColumnIndex(), + wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE, wxALIGN_NOT); + _objectiveView->AppendTextColumn(_("Diff."), _objectiveColumns.difficultyLevel.getColumnIndex(), + wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE, wxALIGN_NOT); - _objectiveView->Bind(wxEVT_DATAVIEW_SELECTION_CHANGED, &ObjectivesEditor::_onObjectiveSelectionChanged, this); - _objectiveView->Bind(wxEVT_DATAVIEW_ITEM_ACTIVATED, &ObjectivesEditor::_onObjectiveActivated, this); + _objectiveView->Bind(wxEVT_DATAVIEW_SELECTION_CHANGED, &ObjectivesEditor::_onObjectiveSelectionChanged, this); + _objectiveView->Bind(wxEVT_DATAVIEW_ITEM_ACTIVATED, &ObjectivesEditor::_onObjectiveActivated, this); - wxButton* addButton = findNamedObject(this, "ObjDialogAddObjectiveButton"); - addButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onAddObjective), NULL, this); + wxButton* addButton = findNamedObject(this, "ObjDialogAddObjectiveButton"); + addButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onAddObjective), NULL, this); - wxButton* editObjButton = findNamedObject(this, "ObjDialogEditObjectiveButton"); - editObjButton->Enable(false); // not enabled without selection - editObjButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onEditObjective), NULL, this); + wxButton* editObjButton = findNamedObject(this, "ObjDialogEditObjectiveButton"); + editObjButton->Enable(false); // not enabled without selection + editObjButton->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { doEditObjective(); }); - wxButton* moveUpObjButton = findNamedObject(this, "ObjDialogMoveObjUpButton"); - moveUpObjButton->Enable(false); // not enabled without selection - moveUpObjButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onMoveUpObjective), NULL, this); + wxButton* moveUpObjButton = findNamedObject(this, "ObjDialogMoveObjUpButton"); + moveUpObjButton->Enable(false); // not enabled without selection + moveUpObjButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onMoveUpObjective), NULL, this); - wxButton* moveDownObjButton = findNamedObject(this, "ObjDialogMoveObjDownButton"); - moveDownObjButton->Enable(false); // not enabled without selection - moveDownObjButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onMoveDownObjective), NULL, this); + wxButton* moveDownObjButton = findNamedObject(this, "ObjDialogMoveObjDownButton"); + moveDownObjButton->Enable(false); // not enabled without selection + moveDownObjButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onMoveDownObjective), NULL, this); - wxButton* delObjButton = findNamedObject(this, "ObjDialogDeleteObjectiveButton"); - delObjButton->Enable(false); // not enabled without selection - delObjButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onDeleteObjective), NULL, this); + wxButton* delObjButton = findNamedObject(this, "ObjDialogDeleteObjectiveButton"); + delObjButton->Enable(false); // not enabled without selection + delObjButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onDeleteObjective), NULL, this); - wxButton* clearObjButton = findNamedObject(this, "ObjDialogClearObjectiveButton"); - clearObjButton->Enable(false); // requires >0 objectives - clearObjButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onClearObjectives), NULL, this); + wxButton* clearObjButton = findNamedObject(this, "ObjDialogClearObjectiveButton"); + clearObjButton->Enable(false); // requires >0 objectives + clearObjButton->Connect(wxEVT_BUTTON, wxCommandEventHandler(ObjectivesEditor::_onClearObjectives), NULL, this); - findNamedObject(this, "ObjDialogObjectiveButtonPanel")->Enable(false); + findNamedObject(this, "ObjDialogObjectiveButtonPanel")->Enable(false); } void ObjectivesEditor::clear() { - // Clear internal data - _worldSpawn = NULL; - _entities.clear(); - _curEntity = _entities.end(); + // Clear internal data + _worldSpawn = NULL; + _entities.clear(); + _curEntity = _entities.end(); - // Clear the list boxes - _objectiveEntityList->Clear(); - _objectiveList->Clear(); + // Clear the list boxes + _objectiveEntityList->Clear(); + _objectiveList->Clear(); - _curObjective = wxDataViewItem(); - updateObjectiveButtonPanel(); + _curObjective = wxDataViewItem(); + updateObjectiveButtonPanel(); } // Populate widgets with map data void ObjectivesEditor::populateWidgets() { - // Clear internal data first - clear(); + // Clear internal data first + clear(); - // Use an ObjectiveEntityFinder to walk the map and add any objective - // entities to the liststore and entity map - ObjectiveEntityFinder finder( + // Use an ObjectiveEntityFinder to walk the map and add any objective + // entities to the liststore and entity map + ObjectiveEntityFinder finder( _objectiveEntityList, _objEntityColumns, _entities, _objectiveEClasses ); - GlobalSceneGraph().root()->traverse(finder); + GlobalSceneGraph().root()->traverse(finder); // Select the first entity in the list for convenience wxDataViewItemArray children; @@ -201,136 +196,136 @@ void ObjectivesEditor::populateWidgets() handleEntitySelectionChange(); } - // Set the worldspawn entity and populate the active-at-start column - _worldSpawn = finder.getWorldSpawn(); - if (_worldSpawn != NULL) - { - populateActiveAtStart(); - } + // Set the worldspawn entity and populate the active-at-start column + _worldSpawn = finder.getWorldSpawn(); + if (_worldSpawn != NULL) + { + populateActiveAtStart(); + } } // Populate the active-at-start column. void ObjectivesEditor::populateActiveAtStart() { - // Construct the list of entities targeted by the worldspawn - TargetList targets(_worldSpawn); - - // Iterate through each row in the entity list. For each Entity*, get its - // name and check if the worldspawn entity has a "target" key for this - // entity name. This indicates that the objective entity will be active at - // game start. - _objectiveEntityList->ForeachNode([&] (wxutil::TreeModel::Row& row) - { - std::string name = row[_objEntityColumns.entityName]; - - ObjectiveEntityPtr obj = _entities[name]; - - // Test if the worldspawn is targeting this entity by passing the - // target list to the objective entity. - if (obj->isOnTargetList(targets)) - { - row[_objEntityColumns.startActive] = true; - } - }); + // Construct the list of entities targeted by the worldspawn + TargetList targets(_worldSpawn); + + // Iterate through each row in the entity list. For each Entity*, get its + // name and check if the worldspawn entity has a "target" key for this + // entity name. This indicates that the objective entity will be active at + // game start. + _objectiveEntityList->ForeachNode([&] (wxutil::TreeModel::Row& row) + { + std::string name = row[_objEntityColumns.entityName]; + + ObjectiveEntityPtr obj = _entities[name]; + + // Test if the worldspawn is targeting this entity by passing the + // target list to the objective entity. + if (obj->isOnTargetList(targets)) + { + row[_objEntityColumns.startActive] = true; + } + }); } int ObjectivesEditor::ShowModal() { - // Restore the position - _windowPosition.applyPosition(); + // Restore the position + _windowPosition.applyPosition(); - populateWidgets(); + populateWidgets(); - int returnValue = DialogBase::ShowModal(); + int returnValue = DialogBase::ShowModal(); - // Tell the position tracker to save the information - _windowPosition.saveToPath(RKEY_WINDOW_STATE); + // Tell the position tracker to save the information + _windowPosition.saveToPath(RKEY_WINDOW_STATE); - // Clear all data before hiding - clear(); + // Clear all data before hiding + clear(); - return returnValue; + return returnValue; } // Static method to display dialog void ObjectivesEditor::DisplayDialog(const cmd::ArgumentList& args) { - // Create a new dialog instance - ObjectivesEditor* _instance = new ObjectivesEditor; - - try - { - // Show the instance - _instance->ShowModal(); - } - catch (ObjectivesException& e) - { - wxutil::Messagebox::ShowError( - std::string(_("Exception occurred: ")) + e.what() - ); - } - - _instance->Destroy(); + // Create a new dialog instance + ObjectivesEditor* _instance = new ObjectivesEditor; + + try + { + // Show the instance + _instance->ShowModal(); + } + catch (ObjectivesException& e) + { + wxutil::Messagebox::ShowError( + std::string(_("Exception occurred: ")) + e.what() + ); + } + + _instance->Destroy(); } // Refresh the objectives list from the ObjectiveEntity void ObjectivesEditor::refreshObjectivesList() { - _curObjective = wxDataViewItem(); - updateObjectiveButtonPanel(); + _curObjective = wxDataViewItem(); + updateObjectiveButtonPanel(); - // Clear and refresh the objective list - _objectiveList->Clear(); - _curEntity->second->populateListStore(*_objectiveList, _objectiveColumns); + // Clear and refresh the objective list + _objectiveList->Clear(); + _curEntity->second->populateListStore(*_objectiveList, _objectiveColumns); - // If there is at least one objective, make the Clear button available + // If there is at least one objective, make the Clear button available wxButton* clearObjButton = findNamedObject(this, "ObjDialogClearObjectiveButton"); - clearObjButton->Enable(!_curEntity->second->isEmpty()); + clearObjButton->Enable(!_curEntity->second->isEmpty()); } // Get the currently selected objective Objective& ObjectivesEditor::getCurrentObjective() { - // Get the objective index from the list - wxutil::TreeModel::Row row(_curObjective, *_objectiveList); - int objNum = row[_objectiveColumns.objNumber].getInteger(); + // Get the objective index from the list + wxutil::TreeModel::Row row(_curObjective, *_objectiveList); + int objNum = row[_objectiveColumns.objNumber].getInteger(); - // Pass the index to the ObjectiveEntity to get an actual Objective - return _curEntity->second->getObjective(objNum); + // Pass the index to the ObjectiveEntity to get an actual Objective + return _curEntity->second->getObjective(objNum); } void ObjectivesEditor::_onCancel(wxCommandEvent& ev) { - // Close the window without saving - EndModal(wxID_CANCEL); + // Close the window without saving + EndModal(wxID_CANCEL); } // OK button void ObjectivesEditor::_onOK(wxCommandEvent& ev) { - // Write all ObjectiveEntity data to the underlying entities - for (ObjectiveEntityMap::iterator i = _entities.begin(); - i != _entities.end(); - ++i) - { - i->second->writeToEntity(); - } + // Write all ObjectiveEntity data to the underlying entities + for (ObjectiveEntityMap::iterator i = _entities.begin(); + i != _entities.end(); + ++i) + { + i->second->writeToEntity(); + } - // Close the window - EndModal(wxID_OK); + // Close the window + EndModal(wxID_OK); } void ObjectivesEditor::selectObjectiveByIndex(int index) { - if (index == -1) return; + if (index == -1) return; - // Select the new objective - wxDataViewItem newObjLoc = _objectiveList->FindInteger(index, - _objectiveColumns.objNumber); + // Select the new objective + wxDataViewItem newObjLoc = _objectiveList->FindInteger(index, + _objectiveColumns.objNumber); - _objectiveView->Select(newObjLoc); - _curObjective = newObjLoc; - updateObjectiveButtonPanel(); + _objectiveView->Select(newObjLoc); + _curObjective = newObjLoc; + updateObjectiveButtonPanel(); } // Callback for "start active" cell toggle in entities list @@ -346,20 +341,20 @@ void ObjectivesEditor::_onEntitySelectionChanged(wxDataViewEvent& ev) void ObjectivesEditor::handleEntitySelectionChange() { - // Clear the objectives list - _objectiveList->Clear(); + // Clear the objectives list + _objectiveList->Clear(); - updateEditorButtonPanel(); + updateEditorButtonPanel(); } void ObjectivesEditor::updateObjectiveButtonPanel() { - wxButton* editObjButton = findNamedObject(this, "ObjDialogEditObjectiveButton"); - wxButton* delObjButton = findNamedObject(this, "ObjDialogDeleteObjectiveButton"); - wxButton* moveUpButton = findNamedObject(this, "ObjDialogMoveObjUpButton"); - wxButton* moveDownButton = findNamedObject(this, "ObjDialogMoveObjDownButton"); + wxButton* editObjButton = findNamedObject(this, "ObjDialogEditObjectiveButton"); + wxButton* delObjButton = findNamedObject(this, "ObjDialogDeleteObjectiveButton"); + wxButton* moveUpButton = findNamedObject(this, "ObjDialogMoveObjUpButton"); + wxButton* moveDownButton = findNamedObject(this, "ObjDialogMoveObjDownButton"); - if (_curObjective.IsOk()) + if (_curObjective.IsOk()) { // Enable the edit and delete buttons editObjButton->Enable(true); @@ -367,8 +362,8 @@ void ObjectivesEditor::updateObjectiveButtonPanel() // Check if this is the first command in the list, get the ID of the // selected item - wxutil::TreeModel::Row row(_curObjective, *_objectiveList); - int index = row[_objectiveColumns.objNumber].getInteger(); + wxutil::TreeModel::Row row(_curObjective, *_objectiveList); + int index = row[_objectiveColumns.objNumber].getInteger(); int highestIndex = _curEntity->second->getHighestObjIndex(); int lowestIndex = _curEntity->second->getLowestObjIndex(); @@ -378,24 +373,24 @@ void ObjectivesEditor::updateObjectiveButtonPanel() moveUpButton->Enable(hasPrev); moveDownButton->Enable(hasNext); - } - else + } + else { - // Disable the edit, delete and move buttons - editObjButton->Enable(false); - delObjButton->Enable(false); - moveUpButton->Enable(false); + // Disable the edit, delete and move buttons + editObjButton->Enable(false); + delObjButton->Enable(false); + moveUpButton->Enable(false); moveDownButton->Enable(false); - } + } } // Callback for current objective selection changed void ObjectivesEditor::_onObjectiveSelectionChanged(wxDataViewEvent& ev) { - // Get the selection - _curObjective = ev.GetItem(); + // Get the selection + _curObjective = ev.GetItem(); - updateObjectiveButtonPanel(); + updateObjectiveButtonPanel(); } void ObjectivesEditor::_onObjectiveActivated(wxDataViewEvent& ev) @@ -408,63 +403,63 @@ void ObjectivesEditor::_onObjectiveActivated(wxDataViewEvent& ev) void ObjectivesEditor::updateEditorButtonPanel() { - wxButton* delEntityButton = findNamedObject(this, "ObjDialogDeleteEntityButton"); - wxPanel* objButtonPanel = findNamedObject(this, "ObjDialogObjectiveButtonPanel"); + wxButton* delEntityButton = findNamedObject(this, "ObjDialogDeleteEntityButton"); + wxPanel* objButtonPanel = findNamedObject(this, "ObjDialogObjectiveButtonPanel"); - wxButton* successLogicButton = findNamedObject(this, "ObjDialogSuccessLogicButton"); - wxButton* objCondButton = findNamedObject(this, "ObjDialogObjConditionsButton"); + wxButton* successLogicButton = findNamedObject(this, "ObjDialogSuccessLogicButton"); + wxButton* objCondButton = findNamedObject(this, "ObjDialogObjConditionsButton"); - // Get the selection - wxDataViewItem item = _objectiveEntityView->GetSelection(); + // Get the selection + wxDataViewItem item = _objectiveEntityView->GetSelection(); - if (item.IsOk()) + if (item.IsOk()) { - // Get name of the entity and find the corresponding ObjectiveEntity in - // the map - wxutil::TreeModel::Row row(item, *_objectiveEntityList); - std::string name = row[_objEntityColumns.entityName]; + // Get name of the entity and find the corresponding ObjectiveEntity in + // the map + wxutil::TreeModel::Row row(item, *_objectiveEntityList); + std::string name = row[_objEntityColumns.entityName]; - // Save the current selection and refresh the objectives list - _curEntity = _entities.find(name); - refreshObjectivesList(); + // Save the current selection and refresh the objectives list + _curEntity = _entities.find(name); + refreshObjectivesList(); - // Enable the delete button and objectives panel - delEntityButton->Enable(true); + // Enable the delete button and objectives panel + delEntityButton->Enable(true); objButtonPanel->Enable(true); // Enable buttons successLogicButton->Enable(true); objCondButton->Enable(true); - } - else + } + else { - // No selection, disable the delete button and clear the objective - // panel - delEntityButton->Enable(false); - objButtonPanel->Enable(false); + // No selection, disable the delete button and clear the objective + // panel + delEntityButton->Enable(false); + objButtonPanel->Enable(false); // Disable mission logic button successLogicButton->Enable(false); objCondButton->Enable(false); - } + } } // Add a new objectives entity button void ObjectivesEditor::_onAddEntity(wxCommandEvent& ev) { - if (_objectiveEClasses.empty()) - { - // Objective entityclass(es) not defined + if (_objectiveEClasses.empty()) + { + // Objective entityclass(es) not defined wxutil::Messagebox::ShowError( _("Unable to create Objective Entity: classes not defined in registry.") ); - return; - } + return; + } - const std::string& objEClass = _objectiveEClasses.front(); + const std::string& objEClass = _objectiveEClasses.front(); - // Obtain the entity class object - IEntityClassPtr eclass = GlobalEntityClassManager().findClass(objEClass); + // Obtain the entity class object + IEntityClassPtr eclass = GlobalEntityClassManager().findClass(objEClass); if (eclass) { @@ -485,7 +480,7 @@ void ObjectivesEditor::_onAddEntity(wxCommandEvent& ev) { // Objective entityclass was not found wxutil::Messagebox::ShowError( - fmt::format(_("Unable to create Objective Entity: class '{0}' not found."), objEClass) + fmt::format(_("Unable to create Objective Entity: class '{0}' not found."), objEClass) ); } } @@ -493,33 +488,33 @@ void ObjectivesEditor::_onAddEntity(wxCommandEvent& ev) // Delete entity button void ObjectivesEditor::_onDeleteEntity(wxCommandEvent& ev) { - // Get the selection + // Get the selection wxDataViewItem item = _objectiveEntityView->GetSelection(); - if (item.IsOk()) - { - // Get the name of the selected entity - wxutil::TreeModel::Row row(item, *_objectiveEntityList); - std::string name = row[_objEntityColumns.entityName]; + if (item.IsOk()) + { + // Get the name of the selected entity + wxutil::TreeModel::Row row(item, *_objectiveEntityList); + std::string name = row[_objEntityColumns.entityName]; - // Instruct the ObjectiveEntity to delete its world node, and then - // remove it from the map - _entities[name]->deleteWorldNode(); - _entities.erase(name); + // Instruct the ObjectiveEntity to delete its world node, and then + // remove it from the map + _entities[name]->deleteWorldNode(); + _entities.erase(name); - // Update the widgets to remove the selection from the list - populateWidgets(); + // Update the widgets to remove the selection from the list + populateWidgets(); - updateEditorButtonPanel(); - } + updateEditorButtonPanel(); + } } // Add a new objective void ObjectivesEditor::_onAddObjective(wxCommandEvent& ev) { - // Add a new objective to the ObjectiveEntity and refresh the list store - _curEntity->second->addObjective(); - refreshObjectivesList(); + // Add a new objective to the ObjectiveEntity and refresh the list store + _curEntity->second->addObjective(); + refreshObjectivesList(); } void ObjectivesEditor::doEditObjective() @@ -534,78 +529,72 @@ void ObjectivesEditor::doEditObjective() refreshObjectivesList(); } -// Edit an existing objective -void ObjectivesEditor::_onEditObjective(wxCommandEvent& ev) -{ - doEditObjective(); -} - void ObjectivesEditor::_onMoveUpObjective(wxCommandEvent& ev) { - // get the current index - wxutil::TreeModel::Row row(_curObjective, *_objectiveList); - int index = row[_objectiveColumns.objNumber].getInteger(); + // get the current index + wxutil::TreeModel::Row row(_curObjective, *_objectiveList); + int index = row[_objectiveColumns.objNumber].getInteger(); - // Pass the call to the general method - int newIndex = _curEntity->second->moveObjective(index, -1); + // Pass the call to the general method + int newIndex = _curEntity->second->moveObjective(index, -1); - refreshObjectivesList(); - selectObjectiveByIndex(newIndex); + refreshObjectivesList(); + selectObjectiveByIndex(newIndex); } void ObjectivesEditor::_onMoveDownObjective(wxCommandEvent& ev) { - // get the current index - wxutil::TreeModel::Row row(_curObjective, *_objectiveList); - int index = row[_objectiveColumns.objNumber].getInteger(); + // get the current index + wxutil::TreeModel::Row row(_curObjective, *_objectiveList); + int index = row[_objectiveColumns.objNumber].getInteger(); - // Pass the call to the general method - int newIndex = _curEntity->second->moveObjective(index, +1); + // Pass the call to the general method + int newIndex = _curEntity->second->moveObjective(index, +1); - refreshObjectivesList(); - selectObjectiveByIndex(newIndex); + refreshObjectivesList(); + selectObjectiveByIndex(newIndex); } // Delete an objective void ObjectivesEditor::_onDeleteObjective(wxCommandEvent& ev) { - // Get the index of the current objective - wxutil::TreeModel::Row row(_curObjective, *_objectiveList); - int index = row[_objectiveColumns.objNumber].getInteger(); + // Get the index of the current objective + wxutil::TreeModel::Row row(_curObjective, *_objectiveList); + int index = row[_objectiveColumns.objNumber].getInteger(); - // Tell the ObjectiveEntity to delete this objective - _curEntity->second->deleteObjective(index); + // Tell the ObjectiveEntity to delete this objective + _curEntity->second->deleteObjective(index); - // Repopulate the objective list - refreshObjectivesList(); + // Repopulate the objective list + refreshObjectivesList(); } // Clear the objectives void ObjectivesEditor::_onClearObjectives(wxCommandEvent& ev) { - // Clear the entity and refresh the list - _curEntity->second->clearObjectives(); - refreshObjectivesList(); + // Clear the entity and refresh the list + _curEntity->second->clearObjectives(); + refreshObjectivesList(); } void ObjectivesEditor::_onEditLogic(wxCommandEvent& ev) { - MissionLogicDialog* dialog = new MissionLogicDialog(this, *_curEntity->second); + MissionLogicDialog* dialog = new MissionLogicDialog(this, *_curEntity->second); - dialog->ShowModal(); - dialog->Destroy(); + dialog->ShowModal(); + dialog->Destroy(); - refreshObjectivesList(); + refreshObjectivesList(); } void ObjectivesEditor::_onEditObjConditions(wxCommandEvent& ev) { - ObjectiveConditionsDialog* dialog = new ObjectiveConditionsDialog(this, *_curEntity->second); + ObjectiveConditionsDialog* dialog = new ObjectiveConditionsDialog(this, *_curEntity->second); - dialog->ShowModal(); - dialog->Destroy(); + dialog->ShowModal(); + dialog->Destroy(); - refreshObjectivesList(); + refreshObjectivesList(); } } // namespace objectives diff --git a/plugins/dm.objectives/ObjectivesEditor.h b/plugins/dm.objectives/ObjectivesEditor.h index dda3dcd006..1fa0b5e555 100644 --- a/plugins/dm.objectives/ObjectivesEditor.h +++ b/plugins/dm.objectives/ObjectivesEditor.h @@ -14,20 +14,14 @@ #include #include "wxutil/dataview/TreeView.h" -/* FORWARD DECLS */ class Entity; namespace objectives { -/** - * Dialog for adding and manipulating mission objectives in Dark Mod missions. - */ -class ObjectivesEditor : - public wxutil::DialogBase, - private wxutil::XmlResourceBasedWidget +/// Dialog for adding and manipulating mission objectives in Dark Mod missions. +class ObjectivesEditor: public wxutil::DialogBase, private wxutil::XmlResourceBasedWidget { -private: // List of target_addobjectives entities ObjectiveEntityListColumns _objEntityColumns; wxutil::TreeModel::Ptr _objectiveEntityList; @@ -37,7 +31,7 @@ class ObjectivesEditor : ObjectivesListColumns _objectiveColumns; wxutil::TreeModel::Ptr _objectiveList; wxutil::TreeView* _objectiveView; - + // Pointer to the worldspawn entity Entity* _worldSpawn; @@ -73,7 +67,6 @@ class ObjectivesEditor : void _onAddEntity(wxCommandEvent& ev); void _onDeleteEntity(wxCommandEvent& ev); void _onAddObjective(wxCommandEvent& ev); - void _onEditObjective(wxCommandEvent& ev); void _onMoveUpObjective(wxCommandEvent& ev); void _onMoveDownObjective(wxCommandEvent& ev); void _onDeleteObjective(wxCommandEvent& ev); diff --git a/radiant/RadiantApp.cpp b/radiant/RadiantApp.cpp index 25dd99bb9c..8c42b6b911 100644 --- a/radiant/RadiantApp.cpp +++ b/radiant/RadiantApp.cpp @@ -48,7 +48,7 @@ void assertToConsole( ) { std::cerr << "wxASSERT: " << file << ":" << line << ":" << func << ": [" << cond - << "]: " << msg; + << "]: " << msg << std::endl; } #endif diff --git a/radiant/clipboard/ClipboardModule.cpp b/radiant/clipboard/ClipboardModule.cpp index d091a2ecd3..1e0950f237 100644 --- a/radiant/clipboard/ClipboardModule.cpp +++ b/radiant/clipboard/ClipboardModule.cpp @@ -1,6 +1,5 @@ #include "ClipboardModule.h" -#include "itextstream.h" #include "math/Hash.h" #include #include diff --git a/radiant/settings/LocalisationModule.cpp b/radiant/settings/LocalisationModule.cpp index f66b57deca..81861beb16 100644 --- a/radiant/settings/LocalisationModule.cpp +++ b/radiant/settings/LocalisationModule.cpp @@ -46,9 +46,8 @@ void LocalisationModule::initialiseModule(const IApplicationContext& ctx) GlobalRegistry().setAttribute(registryKey, "volatile", "1"); // don't save this to user.xml // Add Preferences - IPreferencePage& page = GlobalPreferenceSystem().getPage(_("Language")); + IPreferencePage& page = GlobalPreferenceSystem().getPage(_("User Interface")); page.appendCombo(_("Language"), registryKey, langs); - page.appendLabel(_("Note: You'll need to restart DarkRadiant\nafter changing the language setting.")); } diff --git a/radiant/ui/UserInterfaceModule.cpp b/radiant/ui/UserInterfaceModule.cpp index 45c5a293ed..d52a4997f5 100644 --- a/radiant/ui/UserInterfaceModule.cpp +++ b/radiant/ui/UserInterfaceModule.cpp @@ -479,10 +479,12 @@ void UserInterfaceModule::applyEntityVertexColours() void UserInterfaceModule::registerUICommands() { - TexTool::registerCommands(); + TexTool::registerCommands(); - GlobalCommandSystem().addCommand("ProjectSettings", GameSetupDialog::Show); - GlobalCommandSystem().addCommand("Preferences", PrefDialog::ShowPrefDialog); + GlobalCommandSystem().addCommand("ProjectSettings", GameSetupDialog::Show); + GlobalCommandSystem().addCommand("Preferences", [](const auto&) { + PrefDialog::ShowDialog(); + }); GlobalCommandSystem().addCommand("clear", [](const auto&) { radiant::ClearConsoleMessage::Send(); }); @@ -494,31 +496,31 @@ void UserInterfaceModule::registerUICommands() GlobalCommandSystem().addCommand("AnimationPreview", MD5AnimationViewer::Show); GlobalCommandSystem().addCommand("EditColourScheme", ColourSchemeEditor::DisplayDialog); - GlobalCommandSystem().addCommand("MapInfo", MapInfoDialog::ShowDialog); - GlobalCommandSystem().addCommand("MouseToolMappingDialog", ToolMappingDialog::ShowDialog); + GlobalCommandSystem().addCommand("MapInfo", MapInfoDialog::ShowDialog); + GlobalCommandSystem().addCommand("MouseToolMappingDialog", ToolMappingDialog::ShowDialog); - GlobalCommandSystem().addCommand("ShowCommandList", CommandList::ShowDialog); - GlobalCommandSystem().addCommand("About", AboutDialog::showDialog); - GlobalCommandSystem().addCommand("ShowUserGuide", Documentation::showUserGuide); - GlobalCommandSystem().addCommand("OpenForumUrl", Documentation::OpenForumUrl); - GlobalCommandSystem().addCommand("OpenScriptReference", Documentation::OpenScriptReference); + GlobalCommandSystem().addCommand("ShowCommandList", CommandList::ShowDialog); + GlobalCommandSystem().addCommand("About", AboutDialog::showDialog); + GlobalCommandSystem().addCommand("ShowUserGuide", Documentation::showUserGuide); + GlobalCommandSystem().addCommand("OpenForumUrl", Documentation::OpenForumUrl); + GlobalCommandSystem().addCommand("OpenScriptReference", Documentation::OpenScriptReference); #ifndef WIN32 - GlobalCommandSystem().addCommand("ShowOfflineUserGuide", Documentation::showOfflineUserGuide); + GlobalCommandSystem().addCommand("ShowOfflineUserGuide", Documentation::showOfflineUserGuide); #endif - GlobalCommandSystem().addCommand("ExportSelectedAsModelDialog", ExportAsModelDialog::ShowDialog); - GlobalCommandSystem().addCommand("ConvertModelDialog", ConvertModelDialog::ShowDialog); + GlobalCommandSystem().addCommand("ExportSelectedAsModelDialog", ExportAsModelDialog::ShowDialog); + GlobalCommandSystem().addCommand("ConvertModelDialog", ConvertModelDialog::ShowDialog); - GlobalCommandSystem().addCommand("EntityClassTree", EClassTree::ShowDialog, { cmd::ARGTYPE_STRING | cmd::ARGTYPE_OPTIONAL }); + GlobalCommandSystem().addCommand("EntityClassTree", EClassTree::ShowDialog, { cmd::ARGTYPE_STRING | cmd::ARGTYPE_OPTIONAL }); - // ----------------------- Bind Events --------------------------------------- + // ----------------------- Bind Events --------------------------------------- - // Add the callback event - GlobalCommandSystem().addCommand("ParticlesEditor", ParticleEditor::DisplayDialog); - GlobalCommandSystem().addCommand("SkinEditor", SkinEditor::ShowDialog); + // Add the callback event + GlobalCommandSystem().addCommand("ParticlesEditor", ParticleEditor::DisplayDialog); + GlobalCommandSystem().addCommand("SkinEditor", SkinEditor::ShowDialog); - // Register the "create layer" command - GlobalCommandSystem().addCommand("CreateNewLayerDialog", CreateLayerDialog::CreateNewLayer, - { cmd::ARGTYPE_STRING | cmd::ARGTYPE_OPTIONAL }); + // Register the "create layer" command + GlobalCommandSystem().addCommand("CreateNewLayerDialog", CreateLayerDialog::CreateNewLayer, + { cmd::ARGTYPE_STRING | cmd::ARGTYPE_OPTIONAL }); GlobalCommandSystem().addWithCheck("BulgePatchDialog", BulgePatchDialog::BulgePatchCmd, selection::pred::havePatch); @@ -533,17 +535,17 @@ void UserInterfaceModule::registerUICommands() selection::pred::haveBrush, {cmd::ARGTYPE_INT}); // Set up the CloneSelection command to react on key up events only - GlobalEventManager().addCommand("CloneSelection", "CloneSelection", true); // react on keyUp + GlobalEventManager().addCommand("CloneSelection", "CloneSelection", true); // react on keyUp - GlobalEventManager().addRegistryToggle("ToggleRotationPivot", "user/ui/rotationPivotIsOrigin"); - GlobalEventManager().addRegistryToggle("ToggleSnapRotationPivot", "user/ui/snapRotationPivotToGrid"); - GlobalEventManager().addRegistryToggle("ToggleOffsetClones", "user/ui/offsetClonedObjects"); - GlobalEventManager().addRegistryToggle("ToggleFreeObjectRotation", RKEY_FREE_OBJECT_ROTATION); + GlobalEventManager().addRegistryToggle("ToggleRotationPivot", "user/ui/rotationPivotIsOrigin"); + GlobalEventManager().addRegistryToggle("ToggleSnapRotationPivot", "user/ui/snapRotationPivotToGrid"); + GlobalEventManager().addRegistryToggle("ToggleOffsetClones", "user/ui/offsetClonedObjects"); + GlobalEventManager().addRegistryToggle("ToggleFreeObjectRotation", RKEY_FREE_OBJECT_ROTATION); - GlobalEventManager().addRegistryToggle("TogTexLock", RKEY_ENABLE_TEXTURE_LOCK); + GlobalEventManager().addRegistryToggle("TogTexLock", RKEY_ENABLE_TEXTURE_LOCK); - GlobalCommandSystem().addCommand("LoadPrefab", ui::loadPrefabDialog); - GlobalCommandSystem().addCommand("OpenMapFromProject", ui::MapSelector::OpenMapFromProject); + GlobalCommandSystem().addCommand("LoadPrefab", ui::loadPrefabDialog); + GlobalCommandSystem().addCommand("OpenMapFromProject", ui::MapSelector::OpenMapFromProject); } // Static module registration diff --git a/radiant/ui/about/AboutDialog.cpp b/radiant/ui/about/AboutDialog.cpp index 6f7494c443..df72025f5b 100644 --- a/radiant/ui/about/AboutDialog.cpp +++ b/radiant/ui/about/AboutDialog.cpp @@ -40,60 +40,68 @@ AboutDialog::AboutDialog() : void AboutDialog::populateWindow() { - loadNamedPanel(this, "AboutDialogPanel"); + wxPanel* mainPanel = loadNamedPanel(this, "AboutDialogPanel"); - wxStaticText* appTitle = findNamedObject(this, "AboutDialogAppTitle"); - wxFont appTitleFont = appTitle->GetFont().Bold(); - appTitleFont.SetPointSize(appTitleFont.GetPointSize() + 4); - appTitle->SetFont(appTitleFont); - appTitle->SetLabel(RADIANT_APPNAME_FULL()); + wxStaticText* appTitle = findNamedObject(this, "AboutDialogAppTitle"); + wxFont appTitleFont = appTitle->GetFont().Bold(); + appTitleFont.SetPointSize(appTitleFont.GetPointSize() + 4); + appTitle->SetFont(appTitleFont); + appTitle->SetLabel(RADIANT_APPNAME_FULL()); - wxStaticText* buildDateText = findNamedObject(this, "AboutDialogBuildDate"); + wxStaticText* buildDateText = findNamedObject(this, "AboutDialogBuildDate"); + // Embedding the build date and time works perfectly fine on Linux too, but + // distros want reproducible builds which means the same source files and + // compiler options must produce identical output from one minute to the + // next. #if WIN32 - std::string date = __DATE__; - std::string time = __TIME__; + std::string date = __DATE__; + std::string time = __TIME__; - bool showBuildTime = registry::getValue(RKEY_SHOW_BUILD_TIME); - std::string buildDate = (showBuildTime) ? date + " " + time : date; - std::string buildDateStr = fmt::format(_("Build date: {0}"), buildDate); + bool showBuildTime = registry::getValue(RKEY_SHOW_BUILD_TIME); + std::string buildDate = (showBuildTime) ? date + " " + time : date; + std::string buildDateStr = fmt::format(_("Build date: {0}"), buildDate); - buildDateText->SetLabel(buildDateStr); + buildDateText->SetLabel(buildDateStr); #else - wxSizer* sizer = buildDateText->GetContainingSizer(); - buildDateText->Destroy(); - sizer->Layout(); + wxSizer* sizer = buildDateText->GetContainingSizer(); + buildDateText->Destroy(); + sizer->Layout(); #endif - std::string wxVersion = fmt::format(_("Version: {0:d}.{1:d}.{2:d}"), - wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER); - - findNamedObject(this, "AboutDialogWxWidgetsVersion")->SetLabel(wxVersion); - - // If anybody knows a better method to convert glubyte* to char*, please tell me... - std::string vendorStr = reinterpret_cast(glGetString(GL_VENDOR)); - std::string versionStr = reinterpret_cast(glGetString(GL_VERSION)); - std::string rendererStr = reinterpret_cast(glGetString(GL_RENDERER)); - - std::string openGLVendor = fmt::format(_("Vendor: {0}"), vendorStr); - std::string openGLVersion = fmt::format(_("Version: {0}"), versionStr); - std::string openGLRenderer = fmt::format(_("Renderer: {0}"), rendererStr); - - findNamedObject(this, "AboutDialogOpenGLVendor")->SetLabel(openGLVendor); - findNamedObject(this, "AboutDialogOpenGLVersion")->SetLabel(openGLVersion); - findNamedObject(this, "AboutDialogOpenGLRenderer")->SetLabel(openGLRenderer); - - std::string openGLExtensions = reinterpret_cast(glGetString(GL_EXTENSIONS)); - - findNamedObject(this, "AboutDialogOpenGLExtensions")->SetValue(openGLExtensions); - - findNamedObject(this, "AboutDialogOkButton")->Bind(wxEVT_BUTTON, &AboutDialog::_onClose, this); - - // Make all headers bold - wxFont bold = findNamedObject(this, "AboutDialogHeader1")->GetFont().Bold(); - findNamedObject(this, "AboutDialogHeader1")->SetFont(bold); - findNamedObject(this, "AboutDialogHeader2")->SetFont(bold); - findNamedObject(this, "AboutDialogHeader3")->SetFont(bold); + std::string wxVersion = fmt::format(_("Version: {0:d}.{1:d}.{2:d}"), + wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER); + + findNamedObject(this, "AboutDialogWxWidgetsVersion")->SetLabel(wxVersion); + + // If anybody knows a better method to convert glubyte* to char*, please tell me... + std::string vendorStr = reinterpret_cast(glGetString(GL_VENDOR)); + std::string versionStr = reinterpret_cast(glGetString(GL_VERSION)); + std::string rendererStr = reinterpret_cast(glGetString(GL_RENDERER)); + + std::string openGLVendor = fmt::format(_("Vendor: {0}"), vendorStr); + std::string openGLVersion = fmt::format(_("Version: {0}"), versionStr); + std::string openGLRenderer = fmt::format(_("Renderer: {0}"), rendererStr); + + findNamedObject(this, "AboutDialogOpenGLVendor")->SetLabel(openGLVendor); + findNamedObject(this, "AboutDialogOpenGLVersion")->SetLabel(openGLVersion); + findNamedObject(this, "AboutDialogOpenGLRenderer")->SetLabel(openGLRenderer); + + std::string openGLExtensions = reinterpret_cast(glGetString(GL_EXTENSIONS)); + + findNamedObject(this, "AboutDialogOpenGLExtensions")->SetValue(openGLExtensions); + + findNamedObject(this, "AboutDialogOkButton")->Bind(wxEVT_BUTTON, &AboutDialog::_onClose, this); + + // Make all headers bold + wxFont bold = findNamedObject(this, "AboutDialogHeader1")->GetFont().Bold(); + findNamedObject(this, "AboutDialogHeader1")->SetFont(bold); + findNamedObject(this, "AboutDialogHeader2")->SetFont(bold); + findNamedObject(this, "AboutDialogHeader3")->SetFont(bold); + + wxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); + mainSizer->Add(mainPanel, 1, wxEXPAND | wxALL); + SetSizerAndFit(mainSizer); } void AboutDialog::_onClose(wxCommandEvent& ev) diff --git a/radiant/ui/mainframe/MainFrame.cpp b/radiant/ui/mainframe/MainFrame.cpp index bf1ee895ce..2a3471a185 100644 --- a/radiant/ui/mainframe/MainFrame.cpp +++ b/radiant/ui/mainframe/MainFrame.cpp @@ -15,6 +15,7 @@ #include "registry/registry.h" #include "wxutil/MultiMonitor.h" +#include "wxutil/sourceview/SourceView.h" #include "ui/mainframe/ScreenUpdateBlocker.h" #include "ui/mainframe/AuiLayout.h" @@ -36,68 +37,55 @@ namespace { - const std::string RKEY_WINDOW_STATE = "user/ui/mainFrame/window"; - const std::string RKEY_MULTIMON_START_MONITOR = "user/ui/multiMonitor/startMonitorNum"; - const std::string RKEY_DISABLE_WIN_DESKTOP_COMP = "user/ui/compatibility/disableWindowsDesktopComposition"; + const std::string RKEY_WINDOW_STATE = "user/ui/mainFrame/window"; + const std::string RKEY_MULTIMON_START_MONITOR = "user/ui/multiMonitor/startMonitorNum"; + const std::string RKEY_DISABLE_WIN_DESKTOP_COMP = "user/ui/compatibility/disableWindowsDesktopComposition"; } namespace ui { -MainFrame::MainFrame() : - _topLevelWindow(nullptr), - _screenUpdatesEnabled(false), // not enabled until constructed - _defLoadingBlocksUpdates(false), - _mapLoadingBlocksUpdates(false) -{} - // RegisterableModule implementation const std::string& MainFrame::getName() const { - static std::string _name(MODULE_MAINFRAME); - return _name; + static std::string _name(MODULE_MAINFRAME); + return _name; } const StringSet& MainFrame::getDependencies() const { - static StringSet _dependencies; - - if (_dependencies.empty()) - { - _dependencies.insert(MODULE_XMLREGISTRY); - _dependencies.insert(MODULE_PREFERENCESYSTEM); - _dependencies.insert(MODULE_COMMANDSYSTEM); - _dependencies.insert(MODULE_ORTHOVIEWMANAGER); - _dependencies.insert(MODULE_ECLASSMANAGER); - _dependencies.insert(MODULE_MAP); - } + static StringSet _dependencies = { + MODULE_XMLREGISTRY, + MODULE_PREFERENCESYSTEM, + MODULE_COMMANDSYSTEM, + MODULE_ORTHOVIEWMANAGER, + MODULE_ECLASSMANAGER, + MODULE_MAP, + }; - return _dependencies; + return _dependencies; } void MainFrame::initialiseModule(const IApplicationContext& ctx) { - // Add another page for Multi-Monitor stuff - IPreferencePage& page = GlobalPreferenceSystem().getPage(_("Multi Monitor")); - - // Initialise the registry, if no key is set - if (GlobalRegistry().get(RKEY_MULTIMON_START_MONITOR).empty()) - { - GlobalRegistry().set(RKEY_MULTIMON_START_MONITOR, "0"); - } + // Add another page for UI stuff + IPreferencePage& page = GlobalPreferenceSystem().getPage(_("User Interface")); - ComboBoxValueList list; + // Initialise the registry, if no key is set + registry::setDefault(RKEY_MULTIMON_START_MONITOR, "0"); + registry::setDefault(wxutil::RKEY_SOURCE_FONT_SIZE, "11"); - for (unsigned int i = 0; i < wxutil::MultiMonitor::getNumMonitors(); ++i) - { - wxRect rect = wxutil::MultiMonitor::getMonitor(i); - - list.push_back( - fmt::format("Monitor {0:d} ({1:d}x{2:d})", i, rect.GetWidth(), rect.GetHeight()) - ); - } + ComboBoxValueList list; + for (unsigned int i = 0; i < wxutil::MultiMonitor::getNumMonitors(); ++i) + { + wxRect rect = wxutil::MultiMonitor::getMonitor(i); + list.push_back( + fmt::format("Monitor {0:d} ({1:d}x{2:d})", i, rect.GetWidth(), rect.GetHeight()) + ); + } - page.appendCombo(_("Start DarkRadiant on monitor"), RKEY_MULTIMON_START_MONITOR, list); + page.appendCombo(_("Start on monitor"), RKEY_MULTIMON_START_MONITOR, list); + page.appendSpinner(_("Source view font size"), wxutil::RKEY_SOURCE_FONT_SIZE, 1, 36, 1); GlobalCommandSystem().addCommand(FOCUS_CONTROL_COMMAND, std::bind(&MainFrame::focusControl, this, std::placeholders::_1), @@ -116,43 +104,43 @@ void MainFrame::initialiseModule(const IApplicationContext& ctx) { cmd::ARGTYPE_STRING | cmd::ARGTYPE_OPTIONAL } ); - GlobalCommandSystem().addCommand("Exit", sigc::mem_fun(this, &MainFrame::exitCmd)); + GlobalCommandSystem().addCommand("Exit", sigc::mem_fun(this, &MainFrame::exitCmd)); #ifdef WIN32 - HMODULE lib = LoadLibrary(L"dwmapi.dll"); + HMODULE lib = LoadLibrary(L"dwmapi.dll"); - if (lib != NULL) - { - void (WINAPI *dwmEnableComposition) (bool) = - (void (WINAPI *) (bool)) GetProcAddress(lib, "DwmEnableComposition"); + if (lib != NULL) + { + void (WINAPI *dwmEnableComposition) (bool) = + (void (WINAPI *) (bool)) GetProcAddress(lib, "DwmEnableComposition"); - if (dwmEnableComposition) - { - // Add a page for Desktop Composition stuff - IPreferencePage& compatPage = GlobalPreferenceSystem().getPage(_("Compatibility")); + if (dwmEnableComposition) + { + // Add a page for Desktop Composition stuff + IPreferencePage& compatPage = GlobalPreferenceSystem().getPage(_("Compatibility")); - compatPage.appendCheckBox(_("Disable Windows Desktop Composition"), - RKEY_DISABLE_WIN_DESKTOP_COMP); + compatPage.appendCheckBox(_("Disable Windows Desktop Composition"), + RKEY_DISABLE_WIN_DESKTOP_COMP); - GlobalRegistry().signalForKey(RKEY_DISABLE_WIN_DESKTOP_COMP).connect( + GlobalRegistry().signalForKey(RKEY_DISABLE_WIN_DESKTOP_COMP).connect( sigc::mem_fun(this, &MainFrame::keyChanged) ); - } + } - FreeLibrary(lib); - } + FreeLibrary(lib); + } - // Load the value and act - setDesktopCompositionEnabled(!registry::getValue(RKEY_DISABLE_WIN_DESKTOP_COMP)); + // Load the value and act + setDesktopCompositionEnabled(!registry::getValue(RKEY_DISABLE_WIN_DESKTOP_COMP)); #endif - _mapNameChangedConn = GlobalMapModule().signal_mapNameChanged().connect( - sigc::mem_fun(this, &MainFrame::updateTitle) - ); + _mapNameChangedConn = GlobalMapModule().signal_mapNameChanged().connect( + sigc::mem_fun(this, &MainFrame::updateTitle) + ); - _mapModifiedChangedConn = GlobalMapModule().signal_modifiedChanged().connect( - sigc::mem_fun(this, &MainFrame::updateTitle) - ); + _mapModifiedChangedConn = GlobalMapModule().signal_modifiedChanged().connect( + sigc::mem_fun(this, &MainFrame::updateTitle) + ); // When the eclass defs are in progress of being loaded, block all updates _defsLoadingSignal = GlobalDeclarationManager().signal_DeclsReloading(decl::Type::EntityDef).connect( @@ -178,52 +166,52 @@ void MainFrame::initialiseModule(const IApplicationContext& ctx) } ); - // Subscribe for the post-module init event - module::GlobalModuleRegistry().signal_allModulesInitialised().connect( - sigc::mem_fun(this, &MainFrame::postModuleInitialisation)); + // Subscribe for the post-module init event + module::GlobalModuleRegistry().signal_allModulesInitialised().connect( + sigc::mem_fun(this, &MainFrame::postModuleInitialisation)); } void MainFrame::shutdownModule() { _mapEventSignal.disconnect(); - _mapNameChangedConn.disconnect(); - _mapModifiedChangedConn.disconnect(); + _mapNameChangedConn.disconnect(); + _mapModifiedChangedConn.disconnect(); _defsLoadingSignal.disconnect(); _defsLoadedSignal.disconnect(); - disableScreenUpdates(); + disableScreenUpdates(); } void MainFrame::exitCmd(const cmd::ArgumentList& args) { - // Just tell the main application window to close, which will invoke - // appropriate event handlers. - if (getWxTopLevelWindow() != nullptr) - { - getWxTopLevelWindow()->Close(false /* don't force */); - } + // Just tell the main application window to close, which will invoke + // appropriate event handlers. + if (getWxTopLevelWindow() != nullptr) + { + getWxTopLevelWindow()->Close(false /* don't force */); + } } void MainFrame::postModuleInitialisation() { - // Initialise the mainframe - construct(); + // Initialise the mainframe + construct(); - // Load the shortcuts from the registry - GlobalEventManager().loadAccelerators(); + // Load the shortcuts from the registry + GlobalEventManager().loadAccelerators(); - // Show the top level window as late as possible - getWxTopLevelWindow()->Show(); + // Show the top level window as late as possible + getWxTopLevelWindow()->Show(); - signal_MainFrameReady().emit(); - signal_MainFrameReady().clear(); + signal_MainFrameReady().emit(); + signal_MainFrameReady().clear(); } void MainFrame::keyChanged() { #ifdef WIN32 - setDesktopCompositionEnabled(!registry::getValue(RKEY_DISABLE_WIN_DESKTOP_COMP)); + setDesktopCompositionEnabled(!registry::getValue(RKEY_DISABLE_WIN_DESKTOP_COMP)); #endif } @@ -235,37 +223,37 @@ void MainFrame::keyChanged() void MainFrame::setDesktopCompositionEnabled(bool enabled) { - HMODULE lib = LoadLibrary(L"dwmapi.dll"); + HMODULE lib = LoadLibrary(L"dwmapi.dll"); - if (lib != NULL) - { - HRESULT (WINAPI *dwmEnableComposition) (UINT) = - (HRESULT (WINAPI *) (UINT)) GetProcAddress(lib, "DwmEnableComposition"); + if (lib != NULL) + { + HRESULT (WINAPI *dwmEnableComposition) (UINT) = + (HRESULT (WINAPI *) (UINT)) GetProcAddress(lib, "DwmEnableComposition"); - if (dwmEnableComposition) - { - HRESULT result = dwmEnableComposition(enabled ? DWM_EC_ENABLECOMPOSITION : DWM_EC_DISABLECOMPOSITION); + if (dwmEnableComposition) + { + HRESULT result = dwmEnableComposition(enabled ? DWM_EC_ENABLECOMPOSITION : DWM_EC_DISABLECOMPOSITION); - if (!SUCCEEDED(result)) - { - rError() << "Could not disable desktop composition" << std::endl; - } - } + if (!SUCCEEDED(result)) + { + rError() << "Could not disable desktop composition" << std::endl; + } + } - FreeLibrary(lib); - } + FreeLibrary(lib); + } } #endif void MainFrame::construct() { - // Create the base window and the default widgets - create(); + // Create the base window and the default widgets + create(); - // Emit the "constructed" signal to give modules a chance to register - // their UI parts. Clear the signal afterwards. - signal_MainFrameConstructed().emit(); - signal_MainFrameConstructed().clear(); + // Emit the "constructed" signal to give modules a chance to register + // their UI parts. Clear the signal afterwards. + signal_MainFrameConstructed().emit(); + signal_MainFrameConstructed().clear(); // Restore the saved layout now that all signal listeners have added their controls _layout->restoreStateFromRegistry(); @@ -286,23 +274,23 @@ void MainFrame::construct() }); #endif - enableScreenUpdates(); + enableScreenUpdates(); updateAllWindows(); } void MainFrame::removeLayout() { - // Sanity check - if (!_layout) return; + // Sanity check + if (!_layout) return; - _layout->deactivate(); + _layout->deactivate(); _layout.reset(); } void MainFrame::preDestructionCleanup() { - saveWindowPosition(); + saveWindowPosition(); // Free the layout if (_layout) @@ -313,19 +301,19 @@ void MainFrame::preDestructionCleanup() void MainFrame::updateTitle() { - if (_topLevelWindow == nullptr) - { - return; - } + if (_topLevelWindow == nullptr) + { + return; + } - std::string title = GlobalMapModule().getMapName(); + std::string title = GlobalMapModule().getMapName(); - if (GlobalMapModule().isModified()) - { - title += " *"; - } + if (GlobalMapModule().isModified()) + { + title += " *"; + } - _topLevelWindow->SetTitle(title); + _topLevelWindow->SetTitle(title); } void MainFrame::onTopLevelFrameClose(wxCloseEvent& ev) @@ -333,15 +321,15 @@ void MainFrame::onTopLevelFrameClose(wxCloseEvent& ev) // If the event is vetoable, issue the shutdown message and get the green light if (ev.CanVeto()) { - radiant::ApplicationShutdownRequest request; - GlobalRadiantCore().getMessageBus().sendMessage(request); - - if (request.isDenied()) - { - // Keep running - ev.Veto(); - return; - } + radiant::ApplicationShutdownRequest request; + GlobalRadiantCore().getMessageBus().sendMessage(request); + + if (request.isDenied()) + { + // Keep running + ev.Veto(); + return; + } } _layout->saveStateToRegistry(); @@ -354,9 +342,9 @@ void MainFrame::onTopLevelFrameClose(wxCloseEvent& ev) // present preDestructionCleanup(); - // Broadcast shutdown event - signal_MainFrameShuttingDown().emit(); - signal_MainFrameShuttingDown().clear(); + // Broadcast shutdown event + signal_MainFrameShuttingDown().emit(); + signal_MainFrameShuttingDown().clear(); // Destroy the actual window _topLevelWindow->Destroy(); @@ -371,29 +359,29 @@ void MainFrame::onTopLevelFrameClose(wxCloseEvent& ev) wxFrame* MainFrame::getWxTopLevelWindow() { - return _topLevelWindow; + return _topLevelWindow; } wxBoxSizer* MainFrame::getWxMainContainer() { - return _topLevelWindow != nullptr ? _topLevelWindow->getMainContainer() : nullptr; + return _topLevelWindow != nullptr ? _topLevelWindow->getMainContainer() : nullptr; } bool MainFrame::isActiveApp() { - return wxTheApp->IsActive(); + return wxTheApp->IsActive(); } void MainFrame::createTopLevelWindow() { - // Destroy any previous toplevel window - if (_topLevelWindow) - { - _topLevelWindow->Destroy(); - } + // Destroy any previous toplevel window + if (_topLevelWindow) + { + _topLevelWindow->Destroy(); + } - // Create a new window - _topLevelWindow = new TopLevelFrame; + // Create a new window + _topLevelWindow = new TopLevelFrame; wxTheApp->SetTopWindow(_topLevelWindow); // Listen for close events @@ -402,37 +390,37 @@ void MainFrame::createTopLevelWindow() void MainFrame::restoreWindowPosition() { - // We start out maximised by default - bool isMaximised = true; + // We start out maximised by default + bool isMaximised = true; - // Load and sanitise the monitor number, the number of displays might have changed - unsigned int startMonitor = registry::getValue(RKEY_MULTIMON_START_MONITOR); + // Load and sanitise the monitor number, the number of displays might have changed + unsigned int startMonitor = registry::getValue(RKEY_MULTIMON_START_MONITOR); - if (startMonitor >= wxutil::MultiMonitor::getNumMonitors()) - { - startMonitor = 0; - } + if (startMonitor >= wxutil::MultiMonitor::getNumMonitors()) + { + startMonitor = 0; + } - // Set up the size/position from registry or the defaults - if (GlobalRegistry().keyExists(RKEY_WINDOW_STATE)) - { - _windowPosition.loadFromPath(RKEY_WINDOW_STATE); + // Set up the size/position from registry or the defaults + if (GlobalRegistry().keyExists(RKEY_WINDOW_STATE)) + { + _windowPosition.loadFromPath(RKEY_WINDOW_STATE); - isMaximised = string::convert(GlobalRegistry().getAttribute(RKEY_WINDOW_STATE, "state"), true); - } - else - { - // If no state was found in the registry, fit the window into the start monitor rectangle - _windowPosition.fitToScreen(wxutil::MultiMonitor::getMonitor(startMonitor), 0.8f, 0.8f); - } + isMaximised = string::convert(GlobalRegistry().getAttribute(RKEY_WINDOW_STATE, "state"), true); + } + else + { + // If no state was found in the registry, fit the window into the start monitor rectangle + _windowPosition.fitToScreen(wxutil::MultiMonitor::getMonitor(startMonitor), 0.8f, 0.8f); + } - // Connect the tracker which will also apply the stored size/position - _windowPosition.connect(_topLevelWindow); + // Connect the tracker which will also apply the stored size/position + _windowPosition.connect(_topLevelWindow); - if (isMaximised) - { - _topLevelWindow->Maximize(true); - } + if (isMaximised) + { + _topLevelWindow->Maximize(true); + } } wxToolBar* MainFrame::getToolbar(IMainFrame::Toolbar type) @@ -451,8 +439,8 @@ wxToolBar* MainFrame::getToolbar(IMainFrame::Toolbar type) void MainFrame::create() { - // Create the topmost window first - createTopLevelWindow(); + // Create the topmost window first + createTopLevelWindow(); _layout = std::make_shared(); _layout->activate(); @@ -461,45 +449,45 @@ void MainFrame::create() addControl(UserControl::EntityInspector, ControlSettings{ Location::PropertyPanel, true }); addControl(UserControl::MediaBrowser, ControlSettings{ Location::PropertyPanel, true }); - // Load the previous window settings from the registry - restoreWindowPosition(); + // Load the previous window settings from the registry + restoreWindowPosition(); } void MainFrame::saveWindowPosition() { - // Tell the position tracker to save the information - _windowPosition.saveToPath(RKEY_WINDOW_STATE); - - if (_topLevelWindow) - { - GlobalRegistry().setAttribute( - RKEY_WINDOW_STATE, - "state", - string::to_string(_topLevelWindow->IsMaximized()) - ); + // Tell the position tracker to save the information + _windowPosition.saveToPath(RKEY_WINDOW_STATE); - // Save the monitor number the window is currently displayed on - registry::setValue(RKEY_MULTIMON_START_MONITOR, - wxutil::MultiMonitor::getMonitorNumForWindow(_topLevelWindow)); - } + if (_topLevelWindow) + { + GlobalRegistry().setAttribute( + RKEY_WINDOW_STATE, + "state", + string::to_string(_topLevelWindow->IsMaximized()) + ); + + // Save the monitor number the window is currently displayed on + registry::setValue(RKEY_MULTIMON_START_MONITOR, + wxutil::MultiMonitor::getMonitorNumForWindow(_topLevelWindow)); + } } bool MainFrame::screenUpdatesEnabled() { - return _screenUpdatesEnabled && !_defLoadingBlocksUpdates && !_mapLoadingBlocksUpdates; + return _screenUpdatesEnabled && !_defLoadingBlocksUpdates && !_mapLoadingBlocksUpdates; } void MainFrame::enableScreenUpdates() { - _screenUpdatesEnabled = true; + _screenUpdatesEnabled = true; } void MainFrame::disableScreenUpdates() { - _screenUpdatesEnabled = false; + _screenUpdatesEnabled = false; } void MainFrame::updateAllWindows(bool force) { - if (!_screenUpdatesEnabled) return; + if (!_screenUpdatesEnabled) return; if (force) { @@ -523,9 +511,9 @@ void MainFrame::updateAllWindows(bool force) } IScopedScreenUpdateBlockerPtr MainFrame::getScopedScreenUpdateBlocker(const std::string& title, - const std::string& message, bool forceDisplay) + const std::string& message, bool forceDisplay) { - return IScopedScreenUpdateBlockerPtr(new ScreenUpdateBlocker(title, message, forceDisplay)); + return IScopedScreenUpdateBlockerPtr(new ScreenUpdateBlocker(title, message, forceDisplay)); } void MainFrame::addControl(const std::string& controlName, const ControlSettings& defaultSettings) @@ -582,17 +570,17 @@ void MainFrame::toggleMainControl(const cmd::ArgumentList& args) sigc::signal& MainFrame::signal_MainFrameConstructed() { - return _sigMainFrameConstructed; + return _sigMainFrameConstructed; } sigc::signal& MainFrame::signal_MainFrameReady() { - return _sigMainFrameReady; + return _sigMainFrameReady; } sigc::signal& MainFrame::signal_MainFrameShuttingDown() { - return _sigMainFrameShuttingDown; + return _sigMainFrameShuttingDown; } // Define the static MainFrame module diff --git a/radiant/ui/mainframe/MainFrame.h b/radiant/ui/mainframe/MainFrame.h index 379b5c967f..6ecaa5edd9 100644 --- a/radiant/ui/mainframe/MainFrame.h +++ b/radiant/ui/mainframe/MainFrame.h @@ -12,97 +12,94 @@ namespace ui class TopLevelFrame; class AuiLayout; -class MainFrame : - public IMainFrame +/// Main application window implementation +class MainFrame: public IMainFrame { -private: - TopLevelFrame* _topLevelWindow; + TopLevelFrame* _topLevelWindow = nullptr; - bool _screenUpdatesEnabled; - bool _defLoadingBlocksUpdates; - bool _mapLoadingBlocksUpdates; + bool _screenUpdatesEnabled = false; // not enabled until constructed + bool _defLoadingBlocksUpdates = false; + bool _mapLoadingBlocksUpdates = false; - wxutil::WindowPosition _windowPosition; + wxutil::WindowPosition _windowPosition; - // The current layout object - std::shared_ptr _layout; + // The current layout object + std::shared_ptr _layout; - sigc::connection _mapNameChangedConn; - sigc::connection _mapModifiedChangedConn; + sigc::connection _mapNameChangedConn; + sigc::connection _mapModifiedChangedConn; - sigc::signal _sigMainFrameConstructed; - sigc::signal _sigMainFrameReady; - sigc::signal _sigMainFrameShuttingDown; + sigc::signal _sigMainFrameConstructed; + sigc::signal _sigMainFrameReady; + sigc::signal _sigMainFrameShuttingDown; - sigc::connection _defsLoadingSignal; - sigc::connection _defsLoadedSignal; + sigc::connection _defsLoadingSignal; + sigc::connection _defsLoadedSignal; - sigc::connection _mapEventSignal; + sigc::connection _mapEventSignal; private: - void construct(); - void keyChanged(); - void preDestructionCleanup(); - void updateTitle(); + void construct(); + void keyChanged(); + void preDestructionCleanup(); + void updateTitle(); void onTopLevelFrameClose(wxCloseEvent& ev); public: - MainFrame(); - - // IMainFrame implementation - bool screenUpdatesEnabled() override; - void enableScreenUpdates() override; - void disableScreenUpdates() override; + // IMainFrame implementation + bool screenUpdatesEnabled() override; + void enableScreenUpdates() override; + void disableScreenUpdates() override; - wxFrame* getWxTopLevelWindow() override; - bool isActiveApp() override; - wxBoxSizer* getWxMainContainer() override; - wxToolBar* getToolbar(Toolbar type) override; + wxFrame* getWxTopLevelWindow() override; + bool isActiveApp() override; + wxBoxSizer* getWxMainContainer() override; + wxToolBar* getToolbar(Toolbar type) override; - void updateAllWindows(bool force = false) override; + void updateAllWindows(bool force = false) override; - IScopedScreenUpdateBlockerPtr getScopedScreenUpdateBlocker(const std::string& title, - const std::string& message, bool forceDisplay = false) override; + IScopedScreenUpdateBlockerPtr getScopedScreenUpdateBlocker(const std::string& title, + const std::string& message, bool forceDisplay = false) override; void addControl(const std::string& controlName, const ControlSettings& defaultSettings) override; - sigc::signal& signal_MainFrameConstructed() override; - sigc::signal& signal_MainFrameReady() override; - sigc::signal& signal_MainFrameShuttingDown() override; + sigc::signal& signal_MainFrameConstructed() override; + sigc::signal& signal_MainFrameReady() override; + sigc::signal& signal_MainFrameShuttingDown() override; - // Command to toggle the current layout's camera fullscreen mode - void toggleFullscreenCameraView(const cmd::ArgumentList& args); + // Command to toggle the current layout's camera fullscreen mode + void toggleFullscreenCameraView(const cmd::ArgumentList& args); - // RegisterableModule implementation - const std::string& getName() const override; - const StringSet& getDependencies() const override; - void initialiseModule(const IApplicationContext& ctx) override; - void shutdownModule() override; + // RegisterableModule implementation + const std::string& getName() const override; + const StringSet& getDependencies() const override; + void initialiseModule(const IApplicationContext& ctx) override; + void shutdownModule() override; private: - void create(); + void create(); - void exitCmd(const cmd::ArgumentList& args); - void focusControl(const cmd::ArgumentList& args); - void createControl(const cmd::ArgumentList& args); - void toggleControl(const cmd::ArgumentList& args); - void toggleMainControl(const cmd::ArgumentList& args); + void exitCmd(const cmd::ArgumentList& args); + void focusControl(const cmd::ArgumentList& args); + void createControl(const cmd::ArgumentList& args); + void toggleControl(const cmd::ArgumentList& args); + void toggleMainControl(const cmd::ArgumentList& args); - void removeLayout(); + void removeLayout(); - // Save/Restore the window position as saved to the registry - void saveWindowPosition(); - void restoreWindowPosition(); + // Save/Restore the window position as saved to the registry + void saveWindowPosition(); + void restoreWindowPosition(); - // Creates the topmost application window - void createTopLevelWindow(); + // Creates the topmost application window + void createTopLevelWindow(); - // Constructs the MainFrame and shows the Window - void postModuleInitialisation(); + // Constructs the MainFrame and shows the Window + void postModuleInitialisation(); #ifdef WIN32 - // Enables or disabled desktop composition, Windows-specific - void setDesktopCompositionEnabled(bool enabled); + // Enables or disabled desktop composition, Windows-specific + void setDesktopCompositionEnabled(bool enabled); #endif }; diff --git a/radiant/ui/prefdialog/PrefDialog.cpp b/radiant/ui/prefdialog/PrefDialog.cpp index 9f75aa51be..85f75e6a2b 100644 --- a/radiant/ui/prefdialog/PrefDialog.cpp +++ b/radiant/ui/prefdialog/PrefDialog.cpp @@ -9,7 +9,7 @@ #include "wxutil/dialog/DialogBase.h" #include -#include +#include #include #include "string/split.h" #include "string/join.h" @@ -18,13 +18,15 @@ namespace ui { +using NotebookType = wxListbook; + PrefDialog::PrefDialog(wxWindow* parent) : DialogBase(_("DarkRadiant Preferences"), parent) { wxBoxSizer* mainVbox = new wxBoxSizer(wxVERTICAL); // Notebook widget (shows tree of pages and the space for each page to be shown) - _notebook = new wxTreebook(this, wxID_ANY); + _notebook = new NotebookType(this, wxID_ANY); mainVbox->Add(_notebook, 1, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, 12); // Button box @@ -40,45 +42,20 @@ PrefDialog::PrefDialog(wxWindow* parent) void PrefDialog::createPages() { - // Now create all pages - GlobalPreferenceSystem().foreachPage([&](IPreferencePage& page) - { - // Create a page responsible for this settings::PreferencePage - PrefPage* pageWidget = new PrefPage(_notebook, page); - - // Remember this page in our mapping - const std::string& pagePath = page.getPath(); - - _pages[pagePath] = pageWidget; - - std::vector parts; - string::split(parts, pagePath, "/"); - - if (parts.size() > 1) - { - parts.pop_back(); - std::string parentPath = string::join(parts, "/"); - - PageMap::const_iterator parent = _pages.find(parentPath); - - if (parent != _pages.end()) - { - // Find the index of the parent page to perform the insert - int pos = _notebook->FindPage(parent->second); - _notebook->InsertSubPage(pos, pageWidget, page.getName()); - } - else - { - rError() << "Cannot insert page, unable to find parent path: " << parentPath << std::endl; - } - } - else - { - // Top-level page - // Append the panel as new page to the notebook - _notebook->AddPage(pageWidget, page.getName()); - } - }); + // Now create all pages + GlobalPreferenceSystem().foreachPage([&](IPreferencePage& page) + { + // Create a page responsible for this settings::PreferencePage + PrefPage* pageWidget = new PrefPage(_notebook, page); + + // Remember this page in our mapping + const std::string& pagePath = page.getPath(); + _pages[pagePath] = pageWidget; + + // Top-level page + // Append the panel as new page to the notebook + _notebook->AddPage(pageWidget, page.getName()); + }); } void PrefDialog::showModal(const std::string& requestedPage) @@ -89,13 +66,6 @@ void PrefDialog::showModal(const std::string& requestedPage) p.second->resetValues(); } - // Trigger a resize of the treebook's TreeCtrl, do this by expanding all nodes - // (one would be enough, but we want to show the whole tree anyway) - for (std::size_t page = 0; page < _notebook->GetPageCount(); ++page) - { - _notebook->ExpandNode(page, true); - } - // Is there a specific page display request? if (!requestedPage.empty()) { @@ -132,29 +102,22 @@ void PrefDialog::showModal(const std::string& requestedPage) } } -void PrefDialog::ShowPrefDialog(const cmd::ArgumentList& args) -{ - ShowDialog(); -} - void PrefDialog::showPage(const std::string& path) { - if (!_notebook) - { - rError() << "Can't show requested page, as the wxNotebook is null" << std::endl; - return; - } - - PageMap::const_iterator found = _pages.find(path); - - if (found != _pages.end()) - { - // Find the page number - int pagenum = _notebook->FindPage(found->second); - - // make it active - _notebook->SetSelection(pagenum); - } + if (!_notebook) + { + rError() << "Can't show requested page, as the wxNotebook is null" << std::endl; + return; + } + + if (PageMap::const_iterator found = _pages.find(path); found != _pages.end()) + { + // Find the page number + int pagenum = _notebook->FindPage(found->second); + + // make it active + _notebook->SetSelection(pagenum); + } } void PrefDialog::ShowDialog(const std::string& path) @@ -170,9 +133,4 @@ void PrefDialog::ShowDialog(const std::string& path) dialog->Destroy(); } -void PrefDialog::ShowProjectSettings(const cmd::ArgumentList& args) -{ - ShowDialog(_("Game")); -} - } // namespace ui diff --git a/radiant/ui/prefdialog/PrefDialog.h b/radiant/ui/prefdialog/PrefDialog.h index b38fc2dfee..9596e25ad9 100644 --- a/radiant/ui/prefdialog/PrefDialog.h +++ b/radiant/ui/prefdialog/PrefDialog.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include "iradiant.h" #include "icommandsystem.h" @@ -12,42 +13,34 @@ class wxTreebook; namespace ui { -class PrefDialog : - public wxutil::DialogBase +/// Dialog for editing user preferences +class PrefDialog: public wxutil::DialogBase { - wxTreebook* _notebook = nullptr; + wxBookCtrlBase* _notebook = nullptr; - // Each notebook page is created and maintained by a PrefPage class - // Map the page path to its widget - typedef std::map PageMap; - PageMap _pages; + // Each notebook page is created and maintained by a PrefPage class + // Map the page path to its widget + typedef std::map PageMap; + PageMap _pages; - PrefDialog(wxWindow* parent); + PrefDialog(wxWindow* parent); public: - /** greebo: Runs the modal dialog - */ - static void ShowPrefDialog(const cmd::ArgumentList& args); + /** greebo: Makes sure that the dialog is visible. + * (does nothing if the dialog is already on screen) + */ + static void ShowDialog(const std::string& path = ""); - /** greebo: Makes sure that the dialog is visible. - * (does nothing if the dialog is already on screen) - */ - static void ShowDialog(const std::string& path = ""); - - /** greebo: The command target to show the Game settings preferences. - */ - static void ShowProjectSettings(const cmd::ArgumentList& args); - - /** greebo: Displays the page with the specified path. - * - * @path: a string like "Settings/Patches" - */ - void showPage(const std::string& path); + /** greebo: Displays the page with the specified path. + * + * @path: a string like "Settings/Patches" + */ + void showPage(const std::string& path); private: - void showModal(const std::string& requestedPage); + void showModal(const std::string& requestedPage); - void createPages(); + void createPages(); }; } // namespace ui diff --git a/radiant/ui/prefdialog/PrefPage.cpp b/radiant/ui/prefdialog/PrefPage.cpp index 9b5d766d8e..d0a28626a2 100644 --- a/radiant/ui/prefdialog/PrefPage.cpp +++ b/radiant/ui/prefdialog/PrefPage.cpp @@ -17,21 +17,8 @@ PrefPage::PrefPage(wxWindow* parent, const IPreferencePage& settingsPage) : { // Create the overall panel SetSizer(new wxBoxSizer(wxVERTICAL)); - - // 12 pixel border - wxBoxSizer* overallVBox = new wxBoxSizer(wxVERTICAL); - GetSizer()->Add(overallVBox, 1, wxEXPAND | wxALL, 12); - - // Create the label, unless the page is empty - if (!settingsPage.isEmpty()) - { - wxStaticText* titleLabel = new wxStaticText(this, wxID_ANY, _settingsPage.getTitle()); - titleLabel->SetFont(titleLabel->GetFont().Bold()); - overallVBox->Add(titleLabel, 0, wxBOTTOM, 12); - } - _table = new wxFlexGridSizer(1, 2, 6, 12); - overallVBox->Add(_table, 1, wxEXPAND | wxLEFT, 6); // another 12 pixels to the left + GetSizer()->Add(_table, 1, wxEXPAND | wxALL, 12); settingsPage.foreachItem([&](const IPreferenceItemBase::Ptr& item) { diff --git a/radiantcore/patch/PatchModule.cpp b/radiantcore/patch/PatchModule.cpp index 06d71e90bb..5b374438f8 100644 --- a/radiantcore/patch/PatchModule.cpp +++ b/radiantcore/patch/PatchModule.cpp @@ -20,11 +20,6 @@ namespace patch { -namespace -{ - const char* const RKEY_PATCH_SUBDIVIDE_THRESHOLD = "user/ui/patch/subdivideThreshold"; -} - scene::INodePtr PatchModule::createPatch(PatchDefType type) { scene::INodePtr node = std::make_shared(type); @@ -68,10 +63,6 @@ void PatchModule::initialiseModule(const IApplicationContext& ctx) registerPatchCommands(); - // Construct and Register the patch-related preferences - IPreferencePage& page = GlobalPreferenceSystem().getPage(_("Patch")); - page.appendEntry(_("Patch Subdivide Threshold"), RKEY_PATCH_SUBDIVIDE_THRESHOLD); - _patchTextureChanged = Patch::signal_patchTextureChanged().connect( [] { radiant::TextureChangedMessage::Send(); }); } diff --git a/resources/icons/add.svg b/resources/icons/add.svg new file mode 100644 index 0000000000..d5a7dba0d7 --- /dev/null +++ b/resources/icons/add.svg @@ -0,0 +1,81 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/resources/icons/delete.svg b/resources/icons/delete.svg new file mode 100644 index 0000000000..a9fe111cdd --- /dev/null +++ b/resources/icons/delete.svg @@ -0,0 +1,78 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + +