NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
NumeRe::Window Class Reference

This class represents an abstract window handled by the window manager. More...

#include <windowmanager.hpp>

Collaboration diagram for NumeRe::Window:

Public Member Functions

 Window ()
 Default constructor. Initializes an invalid window. More...
 
 Window (const Window &window)
 Copy constructor. More...
 
 Window (WindowType type, WindowManager *manager, const WindowSettings &settings)
 Generic window constructor. More...
 
 Window (WindowType type, WindowManager *manager, GraphHelper *graph)
 Graph window constructor. More...
 
 Window (WindowType type, WindowManager *manager, tinyxml2::XMLDocument *layoutString)
 Custom window constructor. More...
 
 ~Window ()
 Destructor. Unregisters the current window in the window manager and deletes the layout pointer, if it is non-zero. More...
 
Windowoperator= (const Window &window)
 This member function is the public overload of the assignment operator. More...
 
WindowType getType () const
 
GraphHelpergetGraph ()
 
const WindowSettingsgetWindowSettings () const
 
size_t getId () const
 
const tinyxml2::XMLDocumentgetLayout () const
 
void connect (CustomWindow *_window)
 
bool creationFinished ()
 
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 for the current window. More...
 
std::vector< int > getWindowItems (const std::string &_selection) const
 Returns a vector of item ids corresponding to the available window items of this window. More...
 
bool closeWindow ()
 Closes the current window. More...
 
WinItemValue getItemValue (int windowItemID) const
 Returns the value of the selected window item as a string. More...
 
std::string getItemLabel (int windowItemID) const
 Returns the label of the selected window item as a string. More...
 
std::string getItemState (int windowItemID) const
 Returns the state of the selected window item as a string. More...
 
std::string getItemColor (int windowItemID) const
 Returns the color of the selected window item as a string. More...
 
std::string getPropValue (const std::string &varName) const
 Returns the value of the selected property as a string. More...
 
std::string getProperties () const
 Returns a list of all available window properties (comp. prop) in this window. More...
 
bool setItemValue (const WinItemValue &_value, int windowItemID)
 Enables changing the value of the selected window item to the passed value. More...
 
bool setItemLabel (const std::string &_label, int windowItemID)
 Enables changing the label of the selected window item to the passed label. More...
 
bool setItemState (const std::string &_state, int windowItemID)
 Enables changing the state of the selected window item to the passed state. More...
 
bool setItemColor (const std::string &_color, int windowItemID)
 Enables changing the color of the selected window item to the passed color. More...
 
bool setItemGraph (GraphHelper *_helper, int windowItemID)
 Updates the graph in the custom window. More...
 
bool setPropValue (const std::string &_value, const std::string &varName)
 This function sets the value of the selected window property. More...
 

Private Member Functions

void registerWindow ()
 This private member function registers the current window in the window manager. This will automatically take the ownership from a copied window. More...
 
void unregisterWindow ()
 This private member function will unregister the current window in the window manager. More...
 
void assignWindow (const Window &window)
 This private member function is the generalisation of the assignment operator and the copy constructor. More...
 
void detach ()
 This private member function is used by the window manager to detach itself from this window to avoid segmentation faults at application shutdown. More...
 

Private Attributes

WindowType nType
 
GraphHelperm_graph
 
WindowManagerm_manager
 
CustomWindowm_customWindow
 
WindowSettings m_settings
 
tinyxml2::XMLDocumentm_layout
 
size_t nWindowID
 

Friends

class WindowManager
 

Detailed Description

This class represents an abstract window handled by the window manager.

Definition at line 128 of file windowmanager.hpp.

Constructor & Destructor Documentation

◆ Window() [1/5]

NumeRe::Window::Window ( )

Default constructor. Initializes an invalid window.

Definition at line 38 of file windowmanager.cpp.

References m_customWindow, m_graph, m_layout, m_manager, nType, nWindowID, and NumeRe::WINDOW_NONE.

◆ Window() [2/5]

NumeRe::Window::Window ( const Window window)

Copy constructor.

Parameters
windowconst Window&

Definition at line 55 of file windowmanager.cpp.

References assignWindow().

Here is the call graph for this function:

◆ Window() [3/5]

NumeRe::Window::Window ( WindowType  type,
WindowManager manager,
const WindowSettings settings 
)

Generic window constructor.

Parameters
typeWindowType
managerWindowManager*
settingsconst WindowSettings&

Definition at line 69 of file windowmanager.cpp.

References m_manager, m_settings, nType, and registerWindow().

Here is the call graph for this function:

◆ Window() [4/5]

NumeRe::Window::Window ( WindowType  type,
WindowManager manager,
GraphHelper graph 
)

Graph window constructor.

Parameters
typeWindowType
managerWindowManager*
graphGraphHelper*

Definition at line 87 of file windowmanager.cpp.

References m_graph, m_manager, nType, and registerWindow().

Here is the call graph for this function:

◆ Window() [5/5]

NumeRe::Window::Window ( WindowType  type,
WindowManager manager,
tinyxml2::XMLDocument layoutString 
)

Custom window constructor.

Parameters
typeWindowType
managerWindowManager*
layoutStringtinyxml2::XMLDocument*

Definition at line 105 of file windowmanager.cpp.

References m_layout, m_manager, nType, and registerWindow().

Here is the call graph for this function:

◆ ~Window()

NumeRe::Window::~Window ( )

Destructor. Unregisters the current window in the window manager and deletes the layout pointer, if it is non-zero.

Definition at line 120 of file windowmanager.cpp.

References m_layout, and unregisterWindow().

Here is the call graph for this function:

Member Function Documentation

◆ assignWindow()

void NumeRe::Window::assignWindow ( const Window window)
private

This private member function is the generalisation of the assignment operator and the copy constructor.

Parameters
windowconst Window&
Returns
void

Definition at line 169 of file windowmanager.cpp.

References m_graph, m_layout, m_manager, m_settings, nType, nWindowID, registerWindow(), and unregisterWindow().

Referenced by operator=(), and Window().

Here is the call graph for this function:

◆ closeWindow()

bool NumeRe::Window::closeWindow ( )

Closes the current window.

Returns
bool

Definition at line 502 of file windowmanager.cpp.

References CustomWindow::closeWindow(), and m_customWindow.

Referenced by windowCommand().

Here is the call graph for this function:

◆ connect()

void NumeRe::Window::connect ( CustomWindow _window)
inline

Definition at line 180 of file windowmanager.hpp.

References m_customWindow.

◆ creationFinished()

bool NumeRe::Window::creationFinished ( )
inline

Definition at line 185 of file windowmanager.hpp.

References m_customWindow.

Referenced by windowCommand().

◆ detach()

void NumeRe::Window::detach ( )
private

This private member function is used by the window manager to detach itself from this window to avoid segmentation faults at application shutdown.

Returns
void
Note
This is needed, because wxWidgets will not automatically destruct windows after they are closed (rather they are closed in some idle time).

Definition at line 524 of file windowmanager.cpp.

References m_manager.

◆ getGraph()

GraphHelper * NumeRe::Window::getGraph ( )
inline

Definition at line 160 of file windowmanager.hpp.

References m_graph.

Referenced by NumeReWindow::showGraph().

◆ getId()

size_t NumeRe::Window::getId ( ) const
inline

Definition at line 170 of file windowmanager.hpp.

References nWindowID.

Referenced by NumeRe::WindowManager::createWindow(), and CustomWindow::handleEvent().

◆ getItemColor()

std::string NumeRe::Window::getItemColor ( int  windowItemID) const

Returns the color of the selected window item as a string.

Parameters
windowItemIDint
Returns
std::string

Definition at line 340 of file windowmanager.cpp.

References CustomWindow::getItemColor(), and m_customWindow.

Referenced by getParametersFromWindow().

Here is the call graph for this function:

◆ getItemLabel()

std::string NumeRe::Window::getItemLabel ( int  windowItemID) const

Returns the label of the selected window item as a string.

Parameters
windowItemIDint
Returns
std::string

Definition at line 306 of file windowmanager.cpp.

References CustomWindow::getItemLabel(), and m_customWindow.

Referenced by getParametersFromWindow().

Here is the call graph for this function:

◆ getItemState()

std::string NumeRe::Window::getItemState ( int  windowItemID) const

Returns the state of the selected window item as a string.

Parameters
windowItemIDint
Returns
std::string

Definition at line 323 of file windowmanager.cpp.

References CustomWindow::getItemState(), and m_customWindow.

Referenced by getParametersFromWindow().

Here is the call graph for this function:

◆ getItemValue()

NumeRe::WinItemValue NumeRe::Window::getItemValue ( int  windowItemID) const

Returns the value of the selected window item as a string.

Parameters
windowItemIDint
Returns
NumeRe::WinItemValue

Definition at line 281 of file windowmanager.cpp.

References CustomWindow::getItemValue(), m_customWindow, WindowItemValue::stringValue, NumeRe::WinItemValue::stringValue, WindowItemValue::tableValue, NumeRe::WinItemValue::tableValue, WindowItemValue::type, and NumeRe::WinItemValue::type.

Referenced by getParametersFromWindow().

Here is the call graph for this function:

◆ getLayout()

const tinyxml2::XMLDocument * NumeRe::Window::getLayout ( ) const
inline

Definition at line 175 of file windowmanager.hpp.

References m_layout.

Referenced by CustomWindow::layout().

◆ getProperties()

std::string NumeRe::Window::getProperties ( ) const

Returns a list of all available window properties (comp. prop) in this window.

Returns
std::string

Definition at line 373 of file windowmanager.cpp.

References CustomWindow::getProperties(), and m_customWindow.

Referenced by windowCommand().

Here is the call graph for this function:

◆ getPropValue()

std::string NumeRe::Window::getPropValue ( const std::string &  varName) const

Returns the value of the selected property as a string.

Parameters
varNameconst std::string&
Returns
std::string

Definition at line 357 of file windowmanager.cpp.

References CustomWindow::getPropValue(), and m_customWindow.

Referenced by getParametersFromWindow().

Here is the call graph for this function:

◆ getType()

WindowType NumeRe::Window::getType ( ) const
inline

Definition at line 155 of file windowmanager.hpp.

References nType.

Referenced by NumeReWindow::showWindow(), and NumeRe::WindowManager::unregisterWindow().

◆ getWindowItems()

std::vector< int > NumeRe::Window::getWindowItems ( const std::string &  _selection) const

Returns a vector of item ids corresponding to the available window items of this window.

Parameters
_selectionconst std::string&
Returns
std::vector<int>

Definition at line 233 of file windowmanager.cpp.

References CustomWindow::BUTTON, CustomWindow::CHECKBOX, CustomWindow::COMBOBOX, CustomWindow::DROPDOWN, CustomWindow::GAUGE, CustomWindow::getWindowItems(), CustomWindow::GRAPHER, CustomWindow::IMAGE, m_customWindow, CustomWindow::MENUITEM, CustomWindow::RADIOGROUP, CustomWindow::SLIDER, CustomWindow::SPINCTRL, CustomWindow::TABLE, CustomWindow::TEXT, CustomWindow::TEXTCTRL, and CustomWindow::TREELIST.

Referenced by windowCommand().

Here is the call graph for this function:

◆ getWindowSettings()

◆ operator=()

Window & NumeRe::Window::operator= ( const Window window)

This member function is the public overload of the assignment operator.

Parameters
windowconst Window&
Returns
Window&

Definition at line 199 of file windowmanager.cpp.

References assignWindow().

Here is the call graph for this function:

◆ registerWindow()

void NumeRe::Window::registerWindow ( )
private

This private member function registers the current window in the window manager. This will automatically take the ownership from a copied window.

Returns
void

Definition at line 138 of file windowmanager.cpp.

References m_manager, nWindowID, and NumeRe::WindowManager::registerWindow().

Referenced by assignWindow(), and Window().

Here is the call graph for this function:

◆ setItemColor()

bool NumeRe::Window::setItemColor ( const std::string &  _color,
int  windowItemID 
)

Enables changing the color of the selected window item to the passed color.

Parameters
_colorconst std::string&
windowItemIDint
Returns
bool

Definition at line 451 of file windowmanager.cpp.

References m_customWindow, and CustomWindow::setItemColor().

Referenced by setParametersInWindow().

Here is the call graph for this function:

◆ setItemGraph()

bool NumeRe::Window::setItemGraph ( GraphHelper _helper,
int  windowItemID 
)

Updates the graph in the custom window.

Parameters
_helperGraphHelper*
windowItemIDint
Returns
bool

Definition at line 469 of file windowmanager.cpp.

References m_customWindow, and CustomWindow::setItemGraph().

Referenced by createPlot().

Here is the call graph for this function:

◆ setItemLabel()

bool NumeRe::Window::setItemLabel ( const std::string &  _label,
int  windowItemID 
)

Enables changing the label of the selected window item to the passed label.

Parameters
_labelconst std::string&
windowItemIDint
Returns
bool

Definition at line 415 of file windowmanager.cpp.

References m_customWindow, and CustomWindow::setItemLabel().

Referenced by setParametersInWindow().

Here is the call graph for this function:

◆ setItemState()

bool NumeRe::Window::setItemState ( const std::string &  _state,
int  windowItemID 
)

Enables changing the state of the selected window item to the passed state.

Parameters
_stateconst std::string&
windowItemIDint
Returns
bool

Definition at line 433 of file windowmanager.cpp.

References m_customWindow, and CustomWindow::setItemState().

Referenced by setParametersInWindow().

Here is the call graph for this function:

◆ setItemValue()

bool NumeRe::Window::setItemValue ( const WinItemValue _value,
int  windowItemID 
)

Enables changing the value of the selected window item to the passed value.

Parameters
_valueconst NumeRe::WinItemValue&
windowItemIDint
Returns
bool

Definition at line 391 of file windowmanager.cpp.

References m_customWindow, CustomWindow::setItemValue(), WindowItemValue::stringValue, NumeRe::WinItemValue::stringValue, WindowItemValue::tableValue, NumeRe::WinItemValue::tableValue, WindowItemValue::type, and NumeRe::WinItemValue::type.

Referenced by setParametersInWindow().

Here is the call graph for this function:

◆ setPropValue()

bool NumeRe::Window::setPropValue ( const std::string &  _value,
const std::string &  varName 
)

This function sets the value of the selected window property.

Parameters
_valueconst std::string&
varNameconst std::string&
Returns
bool

Definition at line 487 of file windowmanager.cpp.

References m_customWindow, and CustomWindow::setPropValue().

Referenced by setParametersInWindow().

Here is the call graph for this function:

◆ unregisterWindow()

void NumeRe::Window::unregisterWindow ( )
private

This private member function will unregister the current window in the window manager.

Returns
void

Definition at line 153 of file windowmanager.cpp.

References m_manager, nWindowID, and NumeRe::WindowManager::unregisterWindow().

Referenced by assignWindow(), and ~Window().

Here is the call graph for this function:

◆ updateWindowInformation()

void NumeRe::Window::updateWindowInformation ( int  status,
const std::string &  _return 
)

This public member function can be used to update the stored window information in the window manager for the current window.

Parameters
statusint
_returnconst std::string&
Returns
void

Definition at line 217 of file windowmanager.cpp.

References m_manager, nWindowID, NumeRe::STATUS_RUNNING, and NumeRe::WindowManager::updateWindowInformation().

Referenced by CustomWindow::OnClose(), NumeReWindow::showDirDialog(), NumeReWindow::showFileDialog(), NumeReWindow::showListDialog(), NumeReWindow::showMessageBox(), NumeReWindow::showSelectionDialog(), and NumeReWindow::showTextEntry().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ WindowManager

friend class WindowManager
friend

Definition at line 131 of file windowmanager.hpp.

Member Data Documentation

◆ m_customWindow

◆ m_graph

GraphHelper* NumeRe::Window::m_graph
private

Definition at line 133 of file windowmanager.hpp.

Referenced by assignWindow(), getGraph(), and Window().

◆ m_layout

tinyxml2::XMLDocument* NumeRe::Window::m_layout
mutableprivate

Definition at line 137 of file windowmanager.hpp.

Referenced by assignWindow(), getLayout(), Window(), and ~Window().

◆ m_manager

WindowManager* NumeRe::Window::m_manager
private

◆ m_settings

WindowSettings NumeRe::Window::m_settings
private

Definition at line 136 of file windowmanager.hpp.

Referenced by assignWindow(), getWindowSettings(), and Window().

◆ nType

WindowType NumeRe::Window::nType
private

Definition at line 132 of file windowmanager.hpp.

Referenced by assignWindow(), getType(), and Window().

◆ nWindowID

size_t NumeRe::Window::nWindowID
private

The documentation for this class was generated from the following files: