19#include "../gui/compositions/customwindow.hpp"
237 if (_selection ==
"checkbox")
239 else if (_selection ==
"button")
241 else if (_selection ==
"textfield")
243 else if (_selection ==
"dropdown")
245 else if (_selection ==
"combobox")
247 else if (_selection ==
"radio")
249 else if (_selection ==
"bitmap")
251 else if (_selection ==
"tablegrid")
253 else if (_selection ==
"gauge")
255 else if (_selection ==
"spinbut")
257 else if (_selection ==
"statictext" || _selection ==
"text")
259 else if (_selection ==
"grapher")
261 else if (_selection ==
"treelist")
263 else if (_selection ==
"slider")
265 else if (_selection ==
"menuitem")
269 return std::vector<int>();
291 val.
type = value.
type.ToStdString();
564 if (
id == std::string::npos)
597 if (iter !=
m_windowMap.end() && iter->second.window == window)
607 iter->second.window =
nullptr;
632 if (iter->second.window)
634 iter->second.window->detach();
656 return window.
getId();
672 Window window(type,
this, settings);
676 return window.
getId();
695 return window.
getId();
763 winInfo = iter->second;
bool setItemState(const wxString &_state, int windowItemID)
Change the state of the selected item.
bool setItemValue(WindowItemValue &_value, int windowItemID)
Change the value of the selected item.
wxString getItemLabel(int windowItemID) const
Get the label of the selected item.
bool setItemGraph(GraphHelper *_helper, int windowItemID)
Updates the selected grapher item.
std::vector< int > getWindowItems(WindowItemType _type) const
Returns a list of all window item IDs, which correspond to the selected WindowItemType.
bool setPropValue(const wxString &_value, const wxString &varName)
Sets the value of the selected window property.
bool setItemLabel(const wxString &_label, int windowItemID)
Change the label of the selected item.
wxString getProperties() const
Returns a list of all available window properties.
wxString getPropValue(const wxString &varName) const
Returns the value of the selected window property.
wxString getItemColor(int windowItemID) const
Get the color of the selected item.
wxString getItemState(int windowItemID) const
Get the state of the selected item.
bool setItemColor(const wxString &_color, int windowItemID)
Change the color of the selected item.
WindowItemValue getItemValue(int windowItemID) const
Get the value of the selected item.
bool closeWindow()
Close this window.
This class encapsulates the mglGraph object during transmission from the kernel to the GUI.
This class represents an abstract window handled by the window manager.
std::string getItemColor(int windowItemID) const
Returns the color of the selected window item as a string.
bool setItemState(const std::string &_state, int windowItemID)
Enables changing the state of the selected window item to the passed state.
void updateWindowInformation(int status, const std::string &_return)
This public member function can be used to update the stored window information in the window manager...
WindowManager * m_manager
Window & operator=(const Window &window)
This member function is the public overload of the assignment operator.
Window()
Default constructor. Initializes an invalid window.
tinyxml2::XMLDocument * m_layout
WinItemValue getItemValue(int windowItemID) const
Returns the value of the selected window item as a string.
std::vector< int > getWindowItems(const std::string &_selection) const
Returns a vector of item ids corresponding to the available window items of this window.
void assignWindow(const Window &window)
This private member function is the generalisation of the assignment operator and the copy constructo...
std::string getItemLabel(int windowItemID) const
Returns the label of the selected window item as a string.
void registerWindow()
This private member function registers the current window in the window manager. This will automatica...
bool setItemColor(const std::string &_color, int windowItemID)
Enables changing the color of the selected window item to the passed color.
WindowType getType() const
std::string getItemState(int windowItemID) const
Returns the state of the selected window item as a string.
CustomWindow * m_customWindow
std::string getProperties() const
Returns a list of all available window properties (comp. prop) in this window.
~Window()
Destructor. Unregisters the current window in the window manager and deletes the layout pointer,...
bool setItemGraph(GraphHelper *_helper, int windowItemID)
Updates the graph in the custom window.
bool setItemValue(const WinItemValue &_value, int windowItemID)
Enables changing the value of the selected window item to the passed value.
bool setPropValue(const std::string &_value, const std::string &varName)
This function sets the value of the selected window property.
void detach()
This private member function is used by the window manager to detach itself from this window to avoid...
bool closeWindow()
Closes the current window.
void unregisterWindow()
This private member function will unregister the current window in the window manager.
std::string getPropValue(const std::string &varName) const
Returns the value of the selected property as a string.
bool setItemLabel(const std::string &_label, int windowItemID)
Enables changing the label of the selected window item to the passed label.
WindowSettings m_settings
This is the window manager of the kernel. All windows opened by the kernel will be registered here.
void unregisterWindow(Window *window, size_t id)
This member function will unregister a window. This is done only if the ID and the window pointer are...
size_t registerWindow(Window *window, size_t id)
This member function registers a new window or changes the registration to a new window.
WindowInformation getWindowInformationModal(size_t windowId)
This public member function will return the window information stored in the internal map....
WindowManager()
Empty window manager constructor.
WindowInformation getWindowInformation(size_t windowId)
This public member function will return the window information stored in the internal map....
std::map< size_t, WindowInformation > m_windowMap
~WindowManager()
Destructor. It will detach all registered windows from the manager. This is done to avoid segmentatio...
void updateWindowInformation(const WindowInformation &information)
This function is used by the registered windows to inform the window manager about new window statuse...
size_t createWindow(GraphHelper *graph)
This public member function will create a window object containing the passed graph.
static NumeReKernel * getInstance()
This static member function returns a a pointer to the singleton instance of the kernel.
void showWindow(const NumeRe::Window &window)
This member function passes a window object to the user interface, which will then converted into a r...
WindowType
Enumeration for the window type.
Kernel representation of the WindowItemValue structure of the CustomWindow class.
This class contains the window information to create the dialog in the GUI.
A structure to simplify reading and updating window item values.