MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions
MFM::GridPanel< GC > Class Template Reference

#include <GridPanel.h>

Inheritance diagram for MFM::GridPanel< GC >:
MFM::Panel

Public Types

enum  { W = GC::GRID_WIDTH }
 
enum  { H = GC::GRID_HEIGHT }
 
enum  { R = P::EVENT_WINDOW_RADIUS }
 
enum  { TILE_SIDE_CACHE_SITES = P::TILE_WIDTH }
 
enum  { TILE_SIDE_LIVE_SITES = TILE_SIDE_CACHE_SITES - 2*R }
 
enum  { MAX_BUCKET_FILL_DEPTH = 10000 }
 
typedef GC::CORE_CONFIG CC
 
typedef CC::PARAM_CONFIG P
 
typedef CC::ATOM_TYPE T
 
typedef Grid< GC > OurGrid
 

Public Member Functions

AtomViewPanel< GC > * GetAtomViewPanel ()
 
void SetGrid (OurGrid *mainGrid)
 
void ToggleAtomViewPanel ()
 
void ToggleDrawAtomsAsSquares ()
 
void SetGridRenderer (GridRenderer *grend)
 
void SetToolboxPanel (ToolboxPanel< CC > *toolboxPanel)
 
void SetPaintingEnabled (bool isPaintingEnabled)
 
void DeselectAtomAndTile ()
 
- 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 PaintBorder (Drawing &config)
 
virtual void PaintChildren (Drawing &config)
 
virtual bool Dispatch (MouseEvent &event, const Rect &rect)
 
virtual void OnMouseExit ()
 
virtual void HandleResize (const UPoint &parentSize)
 
void SetAnchor (const GUIAnchor anchor)
 
SPoint GetTextSize (TTF_Font *font, const char *text)
 

Static Public Attributes

static const u32 EVENT_WINDOW_RADIUS = R
 
static const u32 GRID_WIDTH_TILES = W
 
static const u32 GRID_HEIGHT_TILES = H
 
static const u32 GRID_WIDTH_LIVE_SITES = W * TILE_SIDE_LIVE_SITES
 
static const u32 GRID_HEIGHT_LIVE_TILES = H * TILE_SIDE_LIVE_SITES
 

Protected Member Functions

virtual void PaintComponent (Drawing &drawing)
 
void HandleSelectorTool (MouseButtonEvent &mbe)
 
void HandleAtomSelectorTool (MouseButtonEvent &mbe)
 
void HandlePencilTool (MouseButtonEvent &mbe)
 
void HandleBrushTool (MouseButtonEvent &mbe)
 
void HandleEraserTool (MouseButtonEvent &mbe)
 
void HandleBucketTool (MouseButtonEvent &mbe)
 
void HandleXRayTool (MouseButtonEvent &mbe)
 
void HandleAirbrushTool (MouseButtonEvent &mbe)
 
SPoint ClickPointToAtom (const SPoint &clickPt)
 
void HandleCloneTool (MouseButtonEvent &mbe)
 
void HandleAtomSelectorTool (u8 button, SPoint clickPt)
 
void HandlePencilTool (u8 button, SPoint clickPt)
 
void HandleBrushTool (u8 button, SPoint clickPt)
 
void HandleAirbrushTool (u8 button, SPoint clickPt)
 
void HandleEraserTool (u8 button, SPoint clickPt)
 
void HandleBucketTool (u8 button, SPoint clickPt)
 
void HandleXRayTool (u8 button, SPoint clickPt)
 
void HandleCloneTool (u8 button, SPoint clickPt)
 
void PaintAtom (u8 button, SPoint &clickPt, s32 brushSize, const T &atom, EditingTool tool)
 
void BucketFill (Grid< GC > &grid, const T &atom, SPoint &pt, u32 depth)
 
virtual bool Handle (MouseButtonEvent &mbe)
 
virtual bool Handle (MouseMotionEvent &mbe)
 

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

template<class GC>
class MFM::GridPanel< GC >

A template class for displaying the Grid in a Panel.

Member Function Documentation

template<class GC>
virtual bool MFM::GridPanel< GC >::Handle ( MouseButtonEvent event)
inlineprotectedvirtual

Respond to a MouseButtonEvent (this includes scroll wheel events).

Returns
true if the event should be considered handled. The default implementation does nothing and returns false.

Reimplemented from MFM::Panel.

template<class GC>
virtual bool MFM::GridPanel< GC >::Handle ( MouseMotionEvent event)
inlineprotectedvirtual

Respond to a MouseMotionEvent. Return true if the event should be considered handled. The default implementation does nothing and returns false.

Reimplemented from MFM::Panel.

template<class GC>
virtual void MFM::GridPanel< GC >::PaintComponent ( Drawing config)
inlineprotectedvirtual

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::Panel.


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