The superclass for all other Model classes. Uses a pure virtual function, so is abastract. Keeps KoMo2Model as a friend so it alone can call setJimulatorState. This class provides basic data that are needed by all other.
More...
#include <Model.h>
|
| template<class T1 , class T2 > |
| void | setButtonListener (Gtk::Button *const button, const T1 b, const T2 c) |
| | Connect any button to any member function of. More...
|
| |
| void | setButtonState (Gtk::Button *const button, const bool state, Gtk::Image *const img=nullptr, const std::string newTooltip="", const std::string newLabelText="") const |
| | Sets the state of a button to some boolean - the assumption is that if a button is not meant to be sensitive (get_sensitive() == false) then it should also not have a tooltip or many other attributes. You can also optionally update the buttons image, tooltip text, and label text. More...
|
| |
| virtual const bool | handleKeyPress (const GdkEventKey *const e)=0 |
| | Handles key presses for each model. More...
|
| |
| virtual void | changeJimulatorState (const JimulatorState newState)=0 |
| | Changes the state of Jimulator into newState. This function does not necessarily need to be virtual, as at no point should a child be stored as Model pointer. However, by making it a pure virtual function, we ensure this class cannot be instantiated. More...
|
| |
| JimulatorState | getJimulatorState () const |
| | Return the jimulatorState member object. More...
|
| |
|
|
KoMo2Model *const | parent |
| | All models have a parent model - KoMo2Model, the most senior model in the hierarchy, sets its parent to self.
|
| |
|
|
static JimulatorState | jimulatorState = JimulatorState::INITIAL |
| | JimulatorState reflects the state in which Jimulator is operating, which in turn affects the model of this process and it the views. JimulatorState is static, so all subclasses of Model can simply call getState() on themselves and have the expected value.
|
| |
The superclass for all other Model classes. Uses a pure virtual function, so is abastract. Keeps KoMo2Model as a friend so it alone can call setJimulatorState. This class provides basic data that are needed by all other.
Definition at line 35 of file Model.h.
Constructs a new Model object - just assigns the parent variable.
- Parameters
-
| parent | The parent pointer. |
Definition at line 22 of file Model.cpp.
| virtual void Model::changeJimulatorState |
( |
const JimulatorState |
newState | ) |
|
|
protectedpure virtual |
Return the jimulatorState member object.
- Returns
- JimulatorState the jimulatorState member.
Definition at line 75 of file Model.cpp.
Returns the parent pointer.
- Returns
- KoMo2Model* The parent pointer.
Definition at line 67 of file Model.cpp.
| virtual const bool Model::handleKeyPress |
( |
const GdkEventKey *const |
e | ) |
|
|
protectedpure virtual |
template<class T1 , class T2 >
| void Model::setButtonListener |
( |
Gtk::Button *const |
button, |
|
|
const T1 |
b, |
|
|
const T2 |
c |
|
) |
| |
|
protected |
Connect any button to any member function of.
- Template Parameters
-
| T1 | A pointer type to some object of any type. |
| T2 | A pointer to a T1 member function. |
- Parameters
-
| button | A pointer to the button to set the onClick event for. |
| b | A pointer to some object. |
| c | A pointer to some member function of the b object. |
Definition at line 52 of file Model.h.
| void Model::setButtonState |
( |
Gtk::Button *const |
button, |
|
|
const bool |
state, |
|
|
Gtk::Image *const |
img = nullptr, |
|
|
const std::string |
newTooltip = "", |
|
|
const std::string |
newLabelText = "" |
|
) |
| const |
|
protected |
Sets the state of a button to some boolean - the assumption is that if a button is not meant to be sensitive (get_sensitive() == false) then it should also not have a tooltip or many other attributes. You can also optionally update the buttons image, tooltip text, and label text.
- Parameters
-
| button | The button to set the attributes of. |
| state | What value to set the attributes to - specifically, if the button should be sensitive or display a tooltip. |
| newTooltip | The new tooltip text to display. |
| img | The new image to display. |
| newLabelText | The new label text to display. |
Definition at line 37 of file Model.cpp.
set the JimulatorState member object.
- Parameters
-
| val | The value to set JimulatorState to. |
Definition at line 83 of file Model.cpp.
The documentation for this class was generated from the following files: