MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions
MFM::AbstractCheckbox Class Referenceabstract

#include <AbstractCheckbox.h>

Inheritance diagram for MFM::AbstractCheckbox:
MFM::AbstractButton MFM::Panel MFM::AbstractCheckboxExternal MFM::AbstractGUIDriver< GC >::AbstractGridCheckbox MFM::AbstractGUIDriver< GC >::BGRButton MFM::AbstractGUIDriver< GC >::GridRenderButton MFM::AbstractGUIDriver< GC >::GridRunCheckbox MFM::AbstractGUIDriver< GC >::HeatmapButton

Public Member Functions

 AbstractCheckbox ()
 
 AbstractCheckbox (const char *text)
 
virtual void PaintBorder (Drawing &d)
 
virtual void PaintComponent (Drawing &d)
 
virtual void OnClick (u8 button)
 
virtual void OnCheck (bool value)=0
 
virtual bool IsChecked () const =0
 
virtual void SetChecked (bool checked)=0
 
- Public Member Functions inherited from MFM::AbstractButton
 AbstractButton ()
 
 AbstractButton (const char *text)
 
 AbstractButton (SDL_Surface *icon)
 
 AbstractButton (const char *text, SDL_Surface *icon)
 
 ~AbstractButton ()
 
void SetLocation (const SPoint &location)
 
void SetIcon (SDL_Surface *icon)
 
SDL_Surface * GetIcon ()
 
void SetDimensions (const SPoint &dimensions)
 
void SetEnabled (bool isEnabled)
 
void SetText (const char *text)
 
const char * GetText ()
 
bool IsEnabled () const
 
bool Contains (SPoint &pt)
 
virtual bool Handle (MouseButtonEvent &event)
 
virtual void HandleResize (const UPoint &parentSize)
 
bool PaintClickHighlight (Drawing &d)
 
virtual void PaintComponentNonClick (Drawing &d)
 
virtual void OnPress (u8 button)
 
- Public Member Functions inherited from MFM::Panel
 Panel (u32 width=0, u32 height=0)
 
void Insert (Panel *child, Panel *afterOrNull)
 
PanelPop ()
 
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 UPointGetDimensions () const
 
const UPointGetDesiredSize () const
 
void SetRenderPoint (const SPoint &renderPt)
 
const SPointGetRenderPoint () 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 PaintChildren (Drawing &config)
 
virtual bool Dispatch (MouseEvent &event, const Rect &rect)
 
virtual bool Handle (MouseMotionEvent &event)
 
virtual void OnMouseExit ()
 
void SetAnchor (const GUIAnchor anchor)
 
SPoint GetTextSize (TTF_Font *font, const char *text)
 

Additional Inherited Members

- Static Protected Member Functions inherited from MFM::Panel
static void Indent (ByteSink &sink, u32 count)
 
- Protected Attributes inherited from MFM::Panel
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
 
Panelm_parent
 
Panelm_top
 
Panelm_forward
 
Panelm_backward
 
Panelm_focusedChild
 
bool m_visible
 

Detailed Description

A subclass of an AbstractButton, used to toggle a boolean value.

Constructor & Destructor Documentation

MFM::AbstractCheckbox::AbstractCheckbox ( )
inline

Constructs a new AbstractCheckbox which is not linked to a boolean value and is therefore not ready to be used.

MFM::AbstractCheckbox::AbstractCheckbox ( const char *  text)
inline

Constructs a new AbstractCheckbox which displays a given string as its text. The resulting AbstractCheckbox still needs to be given an external backing value in order to be used.

Member Function Documentation

virtual bool MFM::AbstractCheckbox::IsChecked ( ) const
pure virtual

Checks to see if this AbstractCheckbox is in its on state.

Implemented in MFM::AbstractCheckboxExternal.

virtual void MFM::AbstractCheckbox::OnCheck ( bool  value)
pure virtual

Called when this AbstractCheckbox is clicked. A value is given describing whether or not this AbstractCheckbox is checked.

Parameters
valueif this AbstractCheckbox is in its on state, else false .

Implemented in MFM::AbstractGUIDriver< GC >::BGRButton, MFM::AbstractGUIDriver< GC >::HeatmapButton, MFM::AbstractGUIDriver< GC >::GridRenderButton, and MFM::AbstractGUIDriver< GC >::GridRunCheckbox.

virtual void MFM::AbstractCheckbox::OnClick ( u8  button)
inlinevirtual

Pure abstract behavior method. This is called if this AbstractButton is enabled and has decided that it has been clicked on . Overriding this method allows the subclass of this AbstractButton to behave in any way it pleases upon being clicked.

Parameters
buttonThe SDL mouse button that has been pressed to generate this mouse hit, i.e. SDL_BUTTON_LEFT , SDL_BUTTON_MIDDLE, or SDL_BUTTON_RIGHT .

Implements MFM::AbstractButton.

virtual void MFM::AbstractCheckbox::PaintBorder ( Drawing config)
inlinevirtual

Paint the border of the Panel, if it has one. The default implementation paints a one pixel foreground color border.

Reimplemented from MFM::Panel.

virtual void MFM::AbstractCheckbox::PaintComponent ( Drawing config)
inlinevirtual

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 from MFM::AbstractButton.

virtual void MFM::AbstractCheckbox::SetChecked ( bool  checked)
pure virtual

Set this checkbox value to checked.

Implemented in MFM::AbstractCheckboxExternal.


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