MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
|
#include <Panel.h>
Public Member Functions | |
Panel (u32 width=0, u32 height=0) | |
void | Insert (Panel *child, Panel *afterOrNull) |
Panel * | Pop () |
void | Remove (Panel *child) |
void | SetVisibility (bool value) |
void | ToggleVisibility () |
bool | IsVisible () |
u32 | GetWidth () const |
u32 | GetHeight () const |
void | SetDimensions (u32 width, u32 height) |
void | SetDesiredSize (u32 width, u32 height) |
const UPoint & | GetDimensions () const |
const UPoint & | GetDesiredSize () const |
void | SetRenderPoint (const SPoint &renderPt) |
const SPoint & | GetRenderPoint () const |
const char * | GetName () const |
void | SetName (const char *name) |
void | Print (ByteSink &sink, u32 indent=0) const |
u32 | GetBackground () const |
u32 | SetBackground (const u32 color) |
u32 | GetBorder () const |
u32 | SetBorder (const u32 color) |
u32 | GetForeground () const |
u32 | SetForeground (const u32 color) |
TTF_Font * | GetFont () const |
TTF_Font * | SetFont (TTF_Font *newFont) |
SPoint | GetAbsoluteLocation () |
virtual void | Paint (Drawing &config) |
virtual void | PaintUpdateVisibility (Drawing &config) |
virtual void | PaintComponent (Drawing &config) |
virtual void | PaintBorder (Drawing &config) |
virtual void | PaintChildren (Drawing &config) |
virtual bool | Dispatch (MouseEvent &event, const Rect &rect) |
virtual bool | Handle (MouseButtonEvent &event) |
virtual bool | Handle (MouseMotionEvent &event) |
virtual void | OnMouseExit () |
virtual void | HandleResize (const UPoint &parentSize) |
void | SetAnchor (const GUIAnchor anchor) |
SPoint | GetTextSize (TTF_Font *font, const char *text) |
Static Protected Member Functions | |
static void | Indent (ByteSink &sink, u32 count) |
Protected Attributes | |
OString16 | m_name |
Rect | m_rect |
u32 | m_bdColor |
u32 | m_bgColor |
u32 | m_fgColor |
TTF_Font * | m_font |
UPoint | m_desiredSize |
SPoint | m_desiredLocation |
Panel * | m_parent |
Panel * | m_top |
Panel * | m_forward |
Panel * | m_backward |
Panel * | m_focusedChild |
bool | m_visible |
The base class for a region of the GUI system used in the MFM simulator.
|
virtual |
Dispatch a mouse event, to the appropriate subpanel depending on the stacking order and the position of the mouse. Panels should override the Handle(MouseButtonEvent) and/or Handle(MouseMotionEvent) method if they wish to handle such events. Returns true if any panel claimed to handle the event.
SPoint MFM::Panel::GetAbsoluteLocation | ( | ) |
|
inline |
Get the current background color.
|
inline |
Get the current border color.
TTF_Font * MFM::Panel::GetFont | ( | ) | const |
Get the default font for this panel. May return null. Text drawing operations will use the prevailing font (Drawing::GetFont()) if this returns null.
|
inline |
Get the current foreground color.
SPoint MFM::Panel::GetTextSize | ( | TTF_Font * | font, |
const char * | text | ||
) |
Calculates the dimensions of the resulting SDL_Surface generated when rendering a given string using a given TTF_Font .
font | The TTF_Font used to calculate the resulting size of the final SDL_Surface . |
text | The string used to calculate the resulting size of the final SDL_Surface . |
text
in font
font.
|
virtual |
Respond to a MouseButtonEvent (this includes scroll wheel events).
Reimplemented in MFM::GridPanel< GC >, MFM::GridPanel< OurGridConfig >, MFM::AbstractButton, MFM::NeighborSelectPanel< CC, R >, MFM::Slider< CC >, MFM::TextPanel< COLUMNS, LINES >, MFM::TextPanel< 120, 100 >, and MFM::MovablePanel.
|
virtual |
Respond to a MouseMotionEvent. Return true if the event should be considered handled. The default implementation does nothing and returns false.
Reimplemented in MFM::GridPanel< GC >, MFM::GridPanel< OurGridConfig >, MFM::Slider< CC >, MFM::TextPanel< COLUMNS, LINES >, MFM::TextPanel< 120, 100 >, and MFM::MovablePanel.
|
virtual |
Respond to the resizing of this panel's parent.
Reimplemented in MFM::AbstractButton.
|
virtual |
Called when a MouseMotionEvent happens which is equivalent to the mouse exiting this Panel . This is, for instance, useful if a Panel needs to stop following the mouse
Reimplemented in MFM::Slider< CC >, and MFM::MovablePanel.
|
virtual |
Paint the border of the Panel, if it has one. The default implementation paints a one pixel foreground color border.
Reimplemented in MFM::AbstractGUIDriver< GC >::ButtonPanel, MFM::AbstractGUIDriver< GC >::StatisticsPanel, MFM::Slider< CC >, MFM::AbstractCheckbox, and MFM::HelpPanel.
|
virtual |
Paint the subpanels of the Panel, if it has any. In general this should not be overridden. The default implementation draws each child in turn from the bottom of the stacking order to the top.
|
virtual |
Paint the component itself, excluding its border and any children it may have. The default implementation (which may be accessed, if overridden, via this->Panel::PaintComponent) sets the drawing foreground and background colors to the panel colors, and Clear()s the Panel.
Reimplemented in MFM::AbstractGUIDriver< GC >::StatisticsPanel, MFM::ToolboxPanel< CC >, MFM::AbstractButton, MFM::NeighborSelectPanel< CC, R >, MFM::Slider< CC >, MFM::GridPanel< GC >, MFM::GridPanel< OurGridConfig >, MFM::AtomViewPanel< GC >, MFM::AtomViewPanel< OurGridConfig >, MFM::AbstractCheckbox, MFM::HelpPanel, MFM::TextPanel< COLUMNS, LINES >, and MFM::TextPanel< 120, 100 >.
|
virtual |
Update the visibility of this Panel, if desired, at the beginning of the painting process. The default implementation (which may be accessed, if overridden, via this->Panel::IsVisible) does nothing; overriding implementations may use SetVisibility and/or ToggleVisibility to alter the visibility of this Panel before its painting begins in earnest. Note this method is called only during painting; during dispatching the m_visible variable is checked directly.
Reimplemented in MFM::AtomViewPanel< GC >, and MFM::AtomViewPanel< OurGridConfig >.
void MFM::Panel::SetAnchor | ( | const GUIAnchor | anchor | ) |
|
inline |
Set the background color. Returns prior value
|
inline |
Set the border color. Returns prior value
TTF_Font * MFM::Panel::SetFont | ( | TTF_Font * | newFont | ) |
Set the default font for this panel. Null may be passed in to clear the default font. Returns prior value.
|
inline |
Set the foreground color. Returns prior value
|
protected |
The size that this Panel wants to be, when given enough room.
|
protected |
Preferred font for text operations, if any
|
protected |