1. Cafu Engine
  2. Cafu Engine
  3. Cafu
  4. Issues


Issue #125 resolved

component system (for GUI windows)

Carsten Fuchs
created an issue

= Overview = In the forum thread at http://www.cafu.de/forum/viewtopic.php?f=6&t=1099, author "midix" suggested to use a "component system" for game entities in the Cafu Engine.

Whereas until now we used class hierarchies to introduce new features, component systems are a way to break the inherent limitations and inflexibility. Composing game entities of components to bring in new features in an additive manner removes the combinatorial complexity that exists with class inheritance, can improve encapsulation (features are encapsulated in components), and gives users both more flexibility and control.

The forum thread subsequently gathered a lot of additional and related information, see there for all the details.

= GUI Windows = During my research, it turned out that the ''windows'' of a GUI essentially profit from a component system as much as game entities do.

In Cafu we already have a pretty good GUI system with an existing class hierarchy for GUI windows. The window class hierarchy starts to suffer (mildly still) from the very problems that a component system is supposed to solve, and at the same time is much smaller than our game entity class hierarchy.

As we're still relatively new to component systems, at this time we cannot foresee all the ramifications and consequences or obligations that switching to a component system will bring. As such, the GUI window class hierarchy seems to be a very good field to introduce a component system to Cafu. It being both "small" but also seeing use in real life makes it the ideal ground for gathering experience, making experiments and learning more about it. The experiences gathered in the course of the implementation of this ticket are intended to facilitate the future migration of the game entities to a component system, too.

Therefore, the objective of this ticket is to introduce a component system that is supposed to replace the current GUI window class hierarchy.

Comments (95)

  1. Carsten Fuchs reporter

    (In [683]) GuiSys: Introduce component system.

    This change is a first sketch for introducing a component system for GUI windows. It does not add any new functionality yet, but just shows some outline how this might be conceptually done.

    References #125.

  2. Carsten Fuchs reporter

    (In [684]) GuiSys: Law of the Big Three for "component" classes.

    This change adds copy ctors, dtors and the assignment operator to the "component" classes. These are required so that ComponentBaseT and its derived classes can properly be used in WindowTs.

    References #125.

  3. Carsten Fuchs reporter

    (In [685]) GuiSys: Have components have references to their parent window.

    Components can never have NULL pointers to their parent window, so better use a reference instead. (I think that in the course of the development of the component system we will still need non-const references before we will eventually be able to make them const.)

    References #125.

  4. Carsten Fuchs reporter

    (In [687]) GuiSys: Update ComponentBaseT::UpdateDependencies() method.

    It becomes clear that ComponentBaseT::ResolveDependencies() is called not only when a window and its components have been loaded (a one time issue at init time), but also when a window is copied or when it has been modified in the GUI editor. This change reflects this insight by renaming the method and updating its documentation.

    References #125.

  5. Carsten Fuchs reporter

    (In [688]) GuiSys: Reference-count components.

    ComponentBaseT and derived classes must be reference-counted so that they can be bound to our Lua script instances. As a consequence, we cannot store raw pointers to components in their parent windows (or anywhere!) either.

    References #125.

  6. Carsten Fuchs reporter

    (In [690]) CaWE: Introduce component system to GUI Editor.

    The recently added component system for GUI windows is now also introduced to the GUI Editor in CaWE: The GUI Editor gets a "Component" menu and a "add component" command so that the user can add components to windows. (At this time however, the "Window Inspector" has not yet been updated, so that the newly added components are not yet visible in the user interface.)

    References #125.

  7. Carsten Fuchs reporter

    In [changeset:"693/svn"]: {{{

    !CommitTicketReference repository="svn" revision="693"

    TypeSys: Add classes for wrapping variables (of component classes).

    The member variables of component classes must have specific features that are provided by the wrapper classes that are introduced in this change. See the detailed comment in Libs/Variables.hpp for details.

    References #125. }}}

  8. Carsten Fuchs reporter

    In [changeset:"694/svn"]: {{{

    !CommitTicketReference repository="svn" revision="694"

    GuiSys: Add type introspection to the ComponentBaseT hierarchy.

    This change adds a cf::TypeSys::VarManT instance to the ComponentBaseT class and some (test) cf::TypeSys::VarT<T> variables to ComponentTransformT.

    References #125. }}}

  9. Carsten Fuchs reporter

    In [changeset:"695/svn"]: {{{

    !CommitTicketReference repository="svn" revision="695"

    GUI Editor: Add full support for components to the "Window Inspector".

    This very important change adds visitors for the variables of our window components that: - create a wxPGProperty for the visited variable and add it to the given wxPropertyGridManager, - on Observer notification update the value of the given property to the value of the visited variable, and - update the value of the visited variable according to the given EVT_PG_CHANGING event.

    This change also adds: - the required CommandSetCompVarT to change the value of a cf::TypeSys::VarT<T> variable, - the required functions in the Observer pattern code, and - the required "glue code" in WindowInspectorT.

    References #125. }}}

  10. Carsten Fuchs reporter

    In [changeset:"696/svn"]: {{{

    !CommitTicketReference repository="svn" revision="696"

    GUI Editor: In WindowInspectorT, use EVT_PG_CHANGING for component properties.

    We used to handle changes of our component properties along with the normal (somewhat outdated) window properties in WindowInspectorT::OnPropertyGridChanged(), where however it is too late to veto the related event. As the window properties rely on the "changed" (not the "changing") event, we separated our component properties from them, which are now handled in the new WindowInspectorT::OnPropertyGridChanging() handler.

    References #125. }}}

  11. Carsten Fuchs reporter

    In [changeset:"697/svn"]: {{{

    !CommitTicketReference repository="svn" revision="697"

    GUI Editor: Add support for "composed" (Vector3fT) component variables.

    For more complete and more realistic testing and perspective, we add a VarT<T> variable type to our ComponentTransformT class whose base type T is a "composed" type (a Vector3fT), and extend the GUI Editor appropriately.

    It is expected that "composed" types like Vector3fT will later occur in real code frequently and prominently, so accounting for them right from the start through all code paths seems like a reasonable thing to do.

    References #125. }}}

  12. Carsten Fuchs reporter

    In [changeset:"698/svn"]: {{{

    !CommitTicketReference repository="svn" revision="698"

    GuiSys: Add support for getting/setting component variables in Lua.

    The values of component variables can now be retrieved and set in Lua. If comp is a component in Lua, and filename is a variable of comp, then we can get and set its value like this: {{{


    comp:set("filename", "image.png")


    Note that at this time, there is no support yet for creating new components in Lua, and there is no support yet for the more natural short form: {{{


    comp.filename = "image.png"


    References #125. }}}

  13. Carsten Fuchs reporter

    In [changeset:"699/svn"]: {{{

    !CommitTicketReference repository="svn" revision="699"

    GuiSys: Allow components to exist "stand-alone": independent and not a part of any window.

    Components now have two clearly defined invariants: "part of" and "not part of" a window.

    The normal invariant is that a window knows the components it is composed of, because it hosts them, and reversely, that each component knows its parent window that hosts it.

    In the second invariant, a component is independent of any window: neither is it part of the components list of a window, nor does it reversely have a parent window assigned.

    The latter is very useful when windows are dynamically constructed, or components are added to or removed from windows at runtime. This occurs in the Undo/Redo system of our GUI Editor, as well as when components are created and handled in scripts.

    Also see r685, which did not foresee that true "stand-alone" would be required. References #125. }}}

  14. Carsten Fuchs reporter

    In [changeset:"700/svn"]: {{{

    !CommitTicketReference repository="svn" revision="700"

    GuiSys: Add script methods AddComponent(), RemoveComponent() and GetComponents() to WindowT.

    References #125. }}}

  15. Carsten Fuchs reporter

    In [changeset:"701/svn"]: {{{

    !CommitTicketReference repository="svn" revision="701"

    GuiSys: Extend the gui:new() script method to create both new components and windows.

    References #125. }}}

  16. Carsten Fuchs reporter

    In [changeset:"702/svn"]: {{{

    !CommitTicketReference repository="svn" revision="702"

    GuiSys: Update the WindowT::AddComponent() script method to accept an arbitrary number of component arguments.

    References #125. }}}

  17. Carsten Fuchs reporter

    In [changeset:"703/svn"]: {{{

    !CommitTicketReference repository="svn" revision="703"

    GuiSys: Fix initialization of the Gui script state, so that also ComponentBaseT objects can be bound to the script.

    References #125. }}}

  18. Carsten Fuchs reporter

    In [changeset:"704/svn"]: {{{

    !CommitTicketReference repository="svn" revision="704"

    GUI Editor: Add serialization of components.

    Components are now saved along with their window when a GUI is saved.

    References #125. }}}

  19. Carsten Fuchs reporter

    In [changeset:"705/svn"]: {{{

    !CommitTicketReference repository="svn" revision="705"

    GuiSys: Add optional parameter Index to WindowT::AddComponent().

    Callers can now specify the position among the other components the new component is inserted at. This generally widens the use of this method, especially in the GUI Editor, e.g. for undoing "delete" commands, for "move up/down" commands, etc.

    References #125. }}}

  20. Carsten Fuchs reporter

    In [changeset:"706/svn"]: {{{

    !CommitTicketReference repository="svn" revision="706"

    GUI Editor: Revised CommandAddComponentT.

    A new component can now be added at an arbitrary index among the other components that already are in the window. This matches the increased flexibility added to WindowT::AddComponent() in the previous revision r705.

    References #125. }}}

  21. Carsten Fuchs reporter

    In [changeset:"707/svn"]: {{{

    !CommitTicketReference repository="svn" revision="707"

    GUI Editor: Add CommandDeleteComponentT.

    This command complements CommandAddComponentT. It is nowhere used yet.

    References #125. }}}

  22. Carsten Fuchs reporter

    In [changeset:"708/svn"]: {{{

    !CommitTicketReference repository="svn" revision="708"

    GUI Editor: Add a context menu for window components.

    Components can now be moved up and down, and be removed again.

    References #125. }}}

  23. Anonymous

    In [changeset:"1d0a2d8b5005660fd9b51839851fb24b1a722c79/git"]: {{{

    !CommitTicketReference repository="git" revision="1d0a2d8b5005660fd9b51839851fb24b1a722c79"

    GuiSys: Add method SetText() to the ComponentTextT class.

    Other C++ code (especially other components) would normally have to use GetMemberVars().Find("Text") to set this components text value. This auxiliary method makes the task much easier.

    References #125. }}}

  24. Anonymous

    In [changeset:"52ce8058d5d90a0a23ac63c986ed387c853fb121/git"]: {{{

    !CommitTicketReference repository="git" revision="52ce8058d5d90a0a23ac63c986ed387c853fb121"

    GuiSys: In the GuiImplT ctor, replace parameter bool IsInlineCode with int Flags.

    Obviously, I also add a corresponding enum InitFlagsT in order to give our flags symbolic names. This change improves both the readability and the extensibility of the code (I plan to add additional flags soon).

    References #125. }}}

  25. Anonymous

    In [changeset:"ea0cd2e35181d661a444665f29bca279f1938a40/git"]: {{{

    !CommitTicketReference repository="git" revision="ea0cd2e35181d661a444665f29bca279f1938a40"

    GuiSys: In ComponentTextT, replace static const int class members with plain enums.

    static const int class members are surprisingly troublesome: - When initialized (the value is assigned) in the .cpp definition file, as it was, then these variables are not considered constants when used in case statements in ''different'' .cpp files (which only include the header / declaration file, which in turn doesn't state the values). - But when the values are assigned in the header file, as it was up to r36ab41 on 2013-02-12, then the GCC linker requires that the variables are also defined in a .cpp file (or else there remain undefined references), whereas VC++ 2010 requires that this is not done (or else there are multiple definitions).

    References #125. }}}

  26. Anonymous

    In [changeset:"b4f5130cb4adf61637c88cce54ef888334cbe7b0/git"]: {{{

    !CommitTicketReference repository="git" revision="b4f5130cb4adf61637c88cce54ef888334cbe7b0"

    GUI Editor: Convert subclasses of WindowT to components when a GUI file is saved.

    This is intentionally limited to subclasses of WindowT for now. That is, conversion of WindowT details itself (e.g. text, border, image) is currently omitted.

    This separation into two steps improves the clarity of the conversion, and gives us a better chance to fix custom GUI scripts as an intermediate step.

    References #125. }}}

  27. Anonymous

    In [changeset:"6d2838e09820248504a0037f84e0669a8705d96c/git"]: {{{

    !CommitTicketReference repository="git" revision="6d2838e09820248504a0037f84e0669a8705d96c"

    GuiSys: Let ComponentListBoxT colors each have their own alpha value.

    It's more flexible this way, and we can maintain backwards-compatibility with the old listbox window subclass.

    References #125. }}}

  28. Anonymous

    In [changeset:"867cc949d0f45c4f4c37a1822d88757df4b3cdc1/git"]: {{{

    !CommitTicketReference repository="git" revision="867cc949d0f45c4f4c37a1822d88757df4b3cdc1"

    GuiSys: Add script method WindowT::GetComponent() that returns the (n-th) component of the given (type) name.

    This change complements [changeset:f8e572/git], where the method was introduced only for C++.

    References #125. }}}

  29. Anonymous

    In [changeset:"9a9fe6cba5e5eb2f4cff38d2624d4d92ef8f2d45/git"]: {{{

    !CommitTicketReference repository="git" revision="9a9fe6cba5e5eb2f4cff38d2624d4d92ef8f2d45"

    GuiSys: Add script method ComponentTextEditT::SetText() that sets the given text in the related Text sibling component ''and'' moves the cursor position to its end.

    References #125. }}}

  30. Anonymous

    In [changeset:"b8a5c14df1e05a0079aa0453f127faad01dde4ae/git"]: {{{

    !CommitTicketReference repository="git" revision="b8a5c14df1e05a0079aa0453f127faad01dde4ae"

    GuiSys: Change signature of ComponentChoiceT::OnSelectionChanged() callback, remove SelNum parameter.

    We used to pass the index number of the newly selected item before, but it has been removed and the signature is now empty.

    The main reason for this change was that the index number, e.g. named SelNum, was in OnSelectionChanged() implementation often used like this:

    local Item = self:get("Items")[SelNum]

    However, this is now much better written as

    local Item = self:GetSelItem()

    Note that the code can still easily learn the same SelNum as before:

    local SelNum = self:get("Selection")

    References #125. }}}

  31. Anonymous

    In [changeset:"22d4d4e7503c810adc2218d5d3540f9e0173d346/git"]: {{{

    !CommitTicketReference repository="git" revision="22d4d4e7503c810adc2218d5d3540f9e0173d346"

    GuiSys: Change signature of ComponentListBoxT::OnSelectionChanged() callback, remove SelNum parameter.

    We used to pass the index number of the newly selected item before, but it has been removed and the signature is now empty.

    The main reason for this change was that the index number, e.g. named SelNum, was in OnSelectionChanged() implementation often used like this:

    local Item = self:get("Items")[SelNum]

    However, this is now much better written as

    local Item = self:GetSelItem()

    Note that the code can still easily learn the same SelNum as before:

    local SelNum = self:get("Selection")

    References #125. }}}

  32. Anonymous

    In [changeset:"233e29e87f679148846ce3ab165c8cbbebc71e57/git"]: {{{

    !CommitTicketReference repository="git" revision="233e29e87f679148846ce3ab165c8cbbebc71e57"

    GuiSys: Add script method gui:Init().

    With the new method, GUI scripts can have the OnInit() window callbacks be processed before it would automatically be done at the end of the main script.

    This is useful whenever the main script wants to rely on the effects of the OnInit() methods, e.g. the proper default values all being set, the components being instantiated, etc.

    References #125. }}}

  33. Anonymous

    In [changeset:"7a7adf22040c1373ee02f8f80f9183996bbff4bc/git"]: {{{

    !CommitTicketReference repository="git" revision="7a7adf22040c1373ee02f8f80f9183996bbff4bc"

    GUI Editor: Fix conversion of subclasses of WindowT to components when a GUI file is saved.

    This was initially introduced in [changeset:b4f513/git] and accidentally broken in [changeset:8e1173/git], where item index numbers were changed to start at 1.

    References #125. }}}

  34. Anonymous

    In [changeset:"41adfa6c1e9202f1e1d62ba1e8745dd278eff116/git"]: {{{

    !CommitTicketReference repository="git" revision="41adfa6c1e9202f1e1d62ba1e8745dd278eff116"

    DeathMatch GUIs: (partially) convert GUIs to component system.

    Using the code introduced in [changeset:b4f513/git] on 2013-02-22, partially convert GUIs to the new component system.

    This was done by loading and saving all _init.cgui files ''twice'': - first to have them re-written by the conversion code, - then to have them cleanly written by the normal save code.

    The conversion is partial, because: - As indicated in [changeset:b4f513/git], only ''subclasses'' of WindowT are converted (so only three GUIs are affected). - It doesn't work: The scripts in the related _main.cgui files must now be fixed.

    References #125. }}}

  35. Anonymous

    In [changeset:"d4a665c50abd4f3659cdcaf5f76e67391737617f/git"]: {{{

    !CommitTicketReference repository="git" revision="d4a665c50abd4f3659cdcaf5f76e67391737617f"

    DeathMatch GUIs: Fix the GUIs that were converted in the previous revision.

    Adapting the "main" GUI scripts to the new component system requires a lot of manual work that unfortunately cannot be schematicized or be done automatically.

    References #125. }}}

  36. Anonymous

    In [changeset:"5d551d8d28ad9d02cdc0272331f001640e78819e/git"]: {{{

    !CommitTicketReference repository="git" revision="5d551d8d28ad9d02cdc0272331f001640e78819e"

    GuiSys: Override the set() script method for ComponentChoiceTs.

    The override allows choices to "auto-sync" (update the text in the related text component) whenever one of its parameters is changed. (This change is required to complete the previous revision.)

    References #125. }}}

  37. Anonymous

    In [changeset:"caec74a8389ba283ef037aff2f5b0760fae8516f/git"]: {{{

    !CommitTicketReference repository="git" revision="caec74a8389ba283ef037aff2f5b0760fae8516f"

    GUI Editor: Convert attributes of WindowT to components when a GUI file is saved.

    This change complements [changeset:b4f513/git] of 2013-02-22. With it, quasi all our "old" window features are converted to components.

    References #125. }}}

  38. Anonymous

    In [changeset:"a018dc77c985a83f960c5bb90da452117cb45c6a/git"]: {{{

    !CommitTicketReference repository="git" revision="a018dc77c985a83f960c5bb90da452117cb45c6a"

    DeathMatch GUIs: (partially) convert GUIs to component system, covering WindowT attributes.

    This change continues the conversion begun in [changeset:41adfa/git] of 2013-02-25.

    Using the code introduced in [changeset:caec74/git] on 2013-03-08, continue converting the GUIs to the new component system, now covering the attributes of class WindowT.

    This was done by loading and saving all _init.cgui files ''twice'': - first to have them re-written by the conversion code, - then to have them cleanly written by the normal save code.

    The conversion is partial, because: - Now also the attributes of WindowT are converted, but the window rectangles are still written in the old way, too, in order to ease the upcoming transition in the code. - It doesn't work: The scripts in the related _main.cgui files must now be fixed, especially interpolations.

    References #125. }}}

  39. Anonymous

    In [changeset:"23e1ff099d7add5036abdc788ddc65e0c95a994f/git"]: {{{

    !CommitTicketReference repository="git" revision="23e1ff099d7add5036abdc788ddc65e0c95a994f"

    DeathMatch GUIs: Remove empty "Image" components.

    The previous conversion steps introduced some "Image" components with an alpha value of zero. These components cause no harm, but are leftover artifacts that we clean-up in this revision.

    References #125. }}}

  40. Anonymous

    In [changeset:"0f3d841e4c5c60c0ac9e05570a06adb641b674ef/git"]: {{{

    !CommitTicketReference repository="git" revision="0f3d841e4c5c60c0ac9e05570a06adb641b674ef"

    GuiSys: Remove now obsolete subclasses of WindowT.

    The subclasses of WindowT have long been obsoleted by the new components. This change finally removes them.

    References #125. }}}

  41. Anonymous

    In [changeset:"3e2e855b8631569c8104dbcf60eefe38e39341f0/git"]: {{{

    !CommitTicketReference repository="git" revision="3e2e855b8631569c8104dbcf60eefe38e39341f0"

    GuiSys: Remove now obsolete attributes of WindowT.

    The attributes of WindowT have long been obsoleted by the new components. This change finally removes them.

    References #125. }}}

  42. Anonymous

    In [changeset:"ba4742386be8bcf0ac0a0b2923570adc60e34ee6/git"]: {{{

    !CommitTicketReference repository="git" revision="ba4742386be8bcf0ac0a0b2923570adc60e34ee6"

    GuiSys: Prepare ComponentTransformT for removal.

    We no longer save "Transform" components to .cgui files, because "transform" data should and will be in the future inherent attributes of the WindowT class itself.

    References #125. }}}

  43. Anonymous

    In [changeset:"4f4efcc7a85cce03580a03a9a754ed7be167936b/git"]: {{{

    !CommitTicketReference repository="git" revision="4f4efcc7a85cce03580a03a9a754ed7be167936b"

    GUI Editor: Save window transform data in "Transform" component style.

    Beforehand it was saved in self:set("rect", ...) style, which is now obsolete.

    References #125. }}}

  44. Anonymous

    In [changeset:"daa208143dbe5ef831c30f8ceb8fbae21d775b1f/git"]: {{{

    !CommitTicketReference repository="git" revision="daa208143dbe5ef831c30f8ceb8fbae21d775b1f"

    GUI Editor: Properly handle cf::TypeSys::VarT<>s that "clean" values in their Set() method.

    When the user enters a new value in the "Window Inspector", eventually code like {{{



    }}} is called. Note that if Var is of a type derived from cf::TypeSys::VarT<>, the Set() method may well set Var to a value that is different from Event.GetValue().

    This change makes sure that the property in the "Window Inspector" reflects the actual value of Var.

    References #125. }}}

  45. Anonymous

    In [changeset:"da3fe78a3fc6eb34e353c1996af2bfc5cd634a87/git"]: {{{

    !CommitTicketReference repository="git" revision="da3fe78a3fc6eb34e353c1996af2bfc5cd634a87"

    GuiSys: Flag the "Basics" and "Transform" components as "fundamental".

    Fundamental components are explicit C++ members of class WindowT. Users cannot delete them in the GUI Editor or via script, and cannot add new ones in the GUI Editor. (It is possible to add additional ones via script, but not useful.) Note that most components are not fundamental, but "custom": Users can freely add or delete them in the GUI Editor or via scripts.

    References #125. }}}

  46. Anonymous

    In [changeset:"09918933adccf7ede93b8088985f8debc2981298/git"]: {{{

    !CommitTicketReference repository="git" revision="09918933adccf7ede93b8088985f8debc2981298"

    GuiSys: In ComponentTextT, handle "Text" as a ''long'' string property, and have the "(Font-)Name" property enumerate the available fonts.

    This generically fixes cases where for variables of type string a list of choices is available.

    References #125. }}}

  47. Anonymous

    In [changeset:"8ac1db562c7d89dd8fa599d6319ff9af14f6e2d4/git"]: {{{

    !CommitTicketReference repository="git" revision="8ac1db562c7d89dd8fa599d6319ff9af14f6e2d4"

    GuiSys: In ComponentTextT, rename property "Name" to "Font".

    "Name" actually meant "Font name", so the new label "Font" is more intuitive and descriptive.

    The bulk work of updating the _init.cgui files was accomplished by temporarily applying this simple patch, with which the files were opened and re-saved in CaWE: {{{


    diff --git a/Libs/GuiSys/CompBase.cpp b/Libs/GuiSys/CompBase.cpp index 4151dd5..1b8c0ec 100644 --- a/Libs/GuiSys/CompBase.cpp +++ b/Libs/GuiSys/CompBase.cpp @@ -207,6 +207,10 @@ int ComponentBaseT::Set(lua_State LuaState) VarVisitorSetFromLuaT SetFromLua(LuaState); IntrusivePtrT<ComponentBaseT> Comp = Binder.GetCheckedObjectParam< IntrusivePtrT<ComponentBaseT> >(1); const char VarName = luaL_checkstring(LuaState, 2); + + if (strcmp(Comp->GetName(), "Text") == 0 && strcmp(VarName, "Name") == 0) + VarName = "Font"; + cf::TypeSys::VarBaseT* Var = Comp->m_MemberVars.Find(VarName);

     if (!Var)


    References #125. }}}

  48. Anonymous

    In [changeset:"649586efc4c9e56778b7d9624998580153012aa8/git"]: {{{

    !CommitTicketReference repository="git" revision="649586efc4c9e56778b7d9624998580153012aa8"

    DeathMatch GUIs: Revise GUIs, fix the remaining conversion artifacts.

    After the multi-step conversion of the GUIs to the new component system, the components were converted properly, but not always in the order that produced the same visual result as before. More precisely, some "Image" components that were intended as background images were too early in the order and thus rendered too late, so that they covered the background and unintentionally the text as well. This change brings such components in proper order.

    Also, the old system did not have a "padding" feature for the rendered text, and had to compensate this lack with cleverly inserted space characters or offset window positions. This change also removes the old compensations and sets proper "padding" instead.

    References #125. }}}

  49. Anonymous

    In [changeset:"81e30c9a45f57c06368c9b9af6881d6377300322/git"]: {{{

    !CommitTicketReference repository="git" revision="81e30c9a45f57c06368c9b9af6881d6377300322"

    GuiSys: Augment WindowT so that it can hold an application-specific component.

    The WindowT holds the new application component very much like the "Basics" and "Transform" components, but knows next to nothing about it (except that it is derived from ComponentBaseT). The application component can be set by the application, and is in fact intended for the sole use by the application. For example, the GUI Editor could use it to implement a "selection gizmo".

    References #125. }}}

  50. Anonymous

    In [changeset:"ad25262ed68535723c0c64391a8c8f58203f571a/git"]: {{{

    !CommitTicketReference repository="git" revision="ad25262ed68535723c0c64391a8c8f58203f571a"

    GUI Editor: Introduce ComponentSelectionT as an example for an application component and as a replacement for the old EditorWindowT class.

    References #125. }}}

  51. Anonymous

    In [changeset:"5911447ce9ddc9db559fb7c961e0bcf38545e0fd/git"]: {{{

    !CommitTicketReference repository="git" revision="5911447ce9ddc9db559fb7c961e0bcf38545e0fd"

    GUI Editor: Employ ComponentSelectionT as a replacement for the old EditorWindowT class.

    EditorWindowT was derived from WindowT::ExtDataT, which has become unused and thus removed as well.

    This change also contains a few miscellaneous fixes.

    References #125. }}}

  52. Anonymous

    In [changeset:"627688cf8394543a5c2978da238b1f9530dfb169/git"]: {{{

    !CommitTicketReference repository="git" revision="627688cf8394543a5c2978da238b1f9530dfb169"

    Merge branch 'gui-component-system'.

    Although we're far from done with "component systems" in general, both the 'gui-component-system' branch as well as the related ticket #125 have well served their purpose: The successful introduction of a component system for our GUI windows.

    The introduction was a complete success, and we're very pleased with the results.

    Future work will address: - the use of a component system also for game entities, - extra features like "Prefabs", - scripting documentation, - ...

    Closes #125. }}}

  53. Log in to comment