Gwork: 0.3.0Dev
Gwk::Controls::Base Class Reference

This is the base class for all Gwork controls. More...

#include <Base.h>

Inheritance diagram for Gwk::Controls::Base:
Gwk::Event::Handler Gwk::Controls::BaseScrollBar Gwk::Controls::Canvas Gwk::Controls::CheckBoxWithLabel Gwk::Controls::CollapsibleCategory Gwk::Controls::ColorLerpBox Gwk::Controls::ColorPicker Gwk::Controls::ColorSlider Gwk::Controls::CrossSplitter Gwk::Controls::DockBase Gwk::Controls::FilePicker Gwk::Controls::FolderPicker Gwk::Controls::HSVColorPicker Gwk::Controls::ImagePanel Gwk::Controls::Label Gwk::Controls::LabeledRadioButton Gwk::Controls::Layout::CalcPosition Gwk::Controls::Layout::Table Gwk::Controls::Layout::TableRow Gwk::Controls::Layout::Tile Gwk::Controls::MenuDivider Gwk::Controls::PageControl Gwk::Controls::Properties Gwk::Controls::Property::Base Gwk::Controls::PropertyRow Gwk::Controls::RadioButtonController Gwk::Controls::Rectangle Gwk::Controls::ResizableControl Gwk::Controls::RichLabel Gwk::Controls::ScrollControl Gwk::Controls::Slider Gwk::Controls::SplitterVertical Gwk::Controls::TabControl Gwk::Controls::TabStrip Gwk::Controls::ToolBarStrip Gwk::Controls::TreeNode Gwk::ControlsInternal::ColorDisplay Gwk::ControlsInternal::Dragger Gwk::ControlsInternal::Highlight Gwk::ControlsInternal::Modal Gwk::ControlsInternal::Text TestUnit

Public Types

typedef std::list< Base * > List
 
typedef std::map< Gwk::String, Gwk::Event::Caller * > AccelMap
 
- Public Types inherited from Gwk::Event::Handler
typedef void(Handler::* Function) (Gwk::Controls::Base *fromPanel)
 
typedef void(Handler::* FunctionBlank) ()
 
typedef void(Handler::* FunctionWithInformation) (Gwk::Event::Info info)
 

Public Member Functions

 Base (Base *parent, const Gwk::String &Name="")
 
virtual const char * GetTypeName () const
 
virtual const char * GetParentTypeName () const
 
virtual void DelayedDelete ()
 
virtual void PreDelete (Gwk::Skin::Base *skin)
 
virtual void SetParent (Controls::Base *parent)
 
virtual Controls::BaseGetParent () const
 
virtual Controls::CanvasGetCanvas ()
 
virtual Base::List & GetChildren ()
 
virtual bool IsChild (Controls::Base *child)
 
virtual unsigned int NumChildren ()
 
virtual Controls::BaseGetChild (unsigned int i)
 
virtual bool SizeToChildren (bool w=true, bool h=true)
 
virtual Gwk::Point ChildrenSize ()
 
virtual Controls::BaseFindChildByName (const Gwk::String &name, bool bRecursive=false)
 
template<class T >
T * FindChild (const Gwk::String &name, bool bRecursive=false)
 
virtual void SetName (const Gwk::String &name)
 
virtual const Gwk::String & GetName ()
 
virtual void Think ()
 
virtual void RemoveAllChildren ()
 
virtual void SendToBack (void)
 
virtual void BringToFront (void)
 
virtual void BringNextToControl (Controls::Base *child, bool bBehind)
 
virtual Gwk::Point LocalPosToCanvas (const Gwk::Point &in=Point(0, 0))
 
virtual Gwk::Point CanvasPosToLocal (const Gwk::Point &in)
 
virtual void Dock (Position dock)
 
virtual Position GetDock () const
 
virtual void RestrictToParent (bool restrict)
 
virtual bool ShouldRestrictToParent ()
 
virtual int X () const
 Get X position of Control.
 
virtual int Y () const
 Get Y position of Control.
 
virtual int Width () const
 Get Control width.
 
virtual int Height () const
 Get Control height.
 
virtual int Bottom () const
 
virtual int Right () const
 Get right boundary of control.
 
virtual const MarginGetMargin () const
 Get the margin of the control.
 
virtual const PaddingGetPadding () const
 Get the padding for the control.
 
virtual void SetPos (int x, int y)
 
virtual void SetPos (const Point &p)
 
virtual Point GetPos () const
 
virtual void SetWidth (int w)
 
virtual void SetHeight (int h)
 
virtual bool SetSize (int w, int h)
 
virtual bool SetSize (const Point &p)
 
virtual Point GetSize () const
 
virtual bool SetBounds (int x, int y, int w, int h)
 
virtual bool SetBounds (const Gwk::Rect &bounds)
 
virtual void SetPadding (const Padding &padding)
 
virtual void SetMargin (const Margin &margin)
 
virtual void MoveTo (int x, int y)
 MoveTo is identical to SetPos except it uses ShouldRestrictToParent().
 
virtual void MoveBy (int x, int y)
 
virtual const Gwk::RectGetBounds () const
 
virtual Controls::BaseGetControlAt (int x, int y, bool bOnlyIfMouseEnabled=true)
 
virtual const Gwk::RectGetInnerBounds () const
 
virtual const Gwk::RectGetRenderBounds () const
 
virtual void DoRender (Gwk::Skin::Base *skin)
 
virtual void DoCacheRender (Gwk::Skin::Base *skin, Gwk::Controls::Base *master)
 
virtual void RenderRecursive (Gwk::Skin::Base *skin, const Gwk::Rect &cliprect)
 
virtual bool ShouldClip ()
 
virtual void SetHidden (bool hidden)
 
virtual bool Hidden () const
 Returns true only if this control is hidden.
 
virtual bool Visible () const
 Returns false if this control or its parents are hidden.
 
virtual void Hide ()
 Make control invisible.
 
virtual void Show ()
 Make control visible if hidden.
 
virtual void SetSkin (Skin::Base *skin, bool doChildren=false)
 
virtual Gwk::Skin::BaseGetSkin (void)
 
virtual bool ShouldDrawBackground ()
 
virtual void SetShouldDrawBackground (bool b)
 
virtual void OnMouseMoved (int x, int y, int deltaX, int deltaY)
 
virtual bool OnMouseWheeled (int iDelta)
 
virtual void OnMouseClickLeft (int, int, bool)
 
virtual void OnMouseClickRight (int, int, bool)
 
virtual void OnMouseDoubleClickLeft (int x, int y)
 
virtual void OnMouseDoubleClickRight (int x, int y)
 
virtual void OnMouseEnter ()
 
virtual void OnMouseLeave ()
 
virtual void OnLostKeyboardFocus ()
 
virtual void OnKeyboardFocus ()
 
virtual void SetMouseInputEnabled (bool b)
 
virtual bool GetMouseInputEnabled ()
 
virtual void SetKeyboardInputEnabled (bool b)
 
virtual bool GetKeyboardInputEnabled () const
 
virtual bool NeedsInputChars ()
 
virtual bool OnChar (Gwk::UnicodeChar)
 
virtual bool OnKeyPress (int iKey, bool bPress=true)
 
virtual bool OnKeyRelease (int iKey)
 
virtual void OnPaste (Controls::Base *)
 
virtual void OnCopy (Controls::Base *)
 
virtual void OnCut (Controls::Base *)
 
virtual void OnSelectAll (Controls::Base *)
 
virtual bool OnKeyTab (bool bDown)
 
virtual bool OnKeySpace (bool)
 
virtual bool OnKeyReturn (bool)
 
virtual bool OnKeyBackspace (bool)
 
virtual bool OnKeyDelete (bool)
 
virtual bool OnKeyRight (bool)
 
virtual bool OnKeyLeft (bool)
 
virtual bool OnKeyHome (bool)
 
virtual bool OnKeyEnd (bool)
 
virtual bool OnKeyUp (bool)
 
virtual bool OnKeyDown (bool)
 
virtual bool OnKeyEscape (bool)
 
virtual bool IsHovered () const
 
virtual bool ShouldDrawHover () const
 
virtual void Touch ()
 
virtual void OnChildTouched (Controls::Base *child)
 
virtual bool IsOnTop ()
 
virtual bool IsFocussed ()
 
virtual void Focus ()
 
virtual void Unfocus ()
 
virtual void SetDisabled (bool active)
 
virtual bool IsDisabled ()
 
virtual void Redraw ()
 
virtual void UpdateColors ()
 
virtual void EnableCacheToTexture ()
 
virtual bool IsCachedToTexture () const
 Query if this control is cached to a texture.
 
virtual void SetCursor (unsigned char c)
 
virtual void UpdateCursor ()
 
virtual Gwk::Point GetMinimumSize ()
 
virtual Gwk::Point GetMaximumSize ()
 
virtual void SetToolTip (const Gwk::String &strText)
 
virtual void SetToolTip (Base *tooltip)
 
virtual BaseGetToolTip ()
 
virtual bool IsMenuComponent ()
 
virtual void CloseMenus ()
 
virtual bool IsTabable ()
 
virtual void SetTabable (bool isTabable)
 
void DefaultAccel (Gwk::Controls::Base *)
 
virtual void AcceleratePressed ()
 
virtual bool AccelOnlyFocus ()
 
virtual bool HandleAccelerator (Gwk::String &accelerator)
 
template<typename T >
void AddAccelerator (const String &accelerator, T func, Gwk::Event::Handler *handler=nullptr)
 
void AddAccelerator (const String &accelerator)
 
bool NeedsLayout ()
 
void Invalidate ()
 
void InvalidateParent ()
 
void InvalidateChildren (bool bRecursive=false)
 
void SetPosition (Position pos, int xpadding=0, int ypadding=0)
 
virtual void DragAndDrop_SetPackage (bool bDraggable, const String &strName="", void *userData=nullptr)
 
virtual bool DragAndDrop_Draggable ()
 
virtual bool DragAndDrop_ShouldStartDrag ()
 
virtual void DragAndDrop_StartDragging (Gwk::DragAndDrop::Package *package, int x, int y)
 
virtual Gwk::DragAndDrop::PackageDragAndDrop_GetPackage (int x, int y)
 
virtual void DragAndDrop_EndDragging (bool, int, int)
 
virtual void DragAndDrop_HoverEnter (Gwk::DragAndDrop::Package *, int, int)
 
virtual void DragAndDrop_HoverLeave (Gwk::DragAndDrop::Package *)
 
virtual void DragAndDrop_Hover (Gwk::DragAndDrop::Package *, int, int)
 
virtual bool DragAndDrop_HandleDrop (Gwk::DragAndDrop::Package *package, int x, int y)
 
virtual bool DragAndDrop_CanAcceptPackage (Gwk::DragAndDrop::Package *)
 
virtual Gwk::Controls::BaseDynamicCast (const char *Variable)
 
void DoNotIncludeInSize ()
 
bool ShouldIncludeInSize ()
 
virtual String GetChildValue (const Gwk::String &strName)
 
virtual String GetValue ()
 
virtual void SetValue (const String &strValue)
 
virtual void DoAction ()
 
virtual void SetAction (Event::Handler *object, Handler::FunctionWithInformation function, const Gwk::Event::Packet &packet)
 
virtual int GetNamedChildren (Gwk::ControlList &list, const Gwk::String &strName, bool bDeep=true)
 
virtual Gwk::ControlList GetNamedChildren (const Gwk::String &strName, bool bDeep=true)
 
- Public Member Functions inherited from Gwk::Event::Handler
void RegisterCaller (Caller *)
 
void UnRegisterCaller (Caller *)
 

Static Public Member Functions

static const char * GetTypeNameStatic ()
 
static const char * GetIdentifier ()
 

Public Attributes

AccelMap m_accelerators
 
Gwk::Event::Caller onHoverEnter
 
Gwk::Event::Caller onHoverLeave
 
Base::List Children
 
UserDataStorage UserData
 

Protected Member Functions

virtual void AddChild (Controls::Base *child)
 
virtual void RemoveChild (Controls::Base *parent)
 
virtual void OnChildAdded (Controls::Base *child)
 
virtual void OnChildRemoved (Controls::Base *child)
 
virtual void OnBoundsChanged (Gwk::Rect oldBounds)
 
virtual void OnChildBoundsChanged (Gwk::Rect oldChildBounds, Base *child)
 
virtual void OnScaleChanged ()
 
virtual void UpdateRenderBounds ()
 
virtual void Render (Gwk::Skin::Base *skin)
 
virtual void RenderUnder (Gwk::Skin::Base *)
 
virtual void RenderOver (Gwk::Skin::Base *)
 
virtual void RenderFocus (Gwk::Skin::Base *)
 
virtual void OnSkinChanged (Gwk::Skin::Base *newSkin)
 
virtual BaseInner ()
 
virtual void RecurseLayout (Skin::Base *skin)
 
virtual void Layout (Skin::Base *skin)
 
virtual void PostLayout (Skin::Base *)
 
- Protected Member Functions inherited from Gwk::Event::Handler
void CleanLinks ()
 

Protected Attributes

Gwk::Rect m_innerBounds
 
Basem_parent
 
Basem_innerPanel
 
Basem_actualParent
 
Basem_toolTip
 
Skin::Basem_skin
 
Gwk::Rect m_bounds
 
Gwk::Rect m_renderBounds
 
Padding m_padding
 
Margin m_margin
 
Gwk::String m_name
 
bool m_bRestrictToParent
 
bool m_bDisabled
 
bool m_bHidden
 
bool m_bMouseInputEnabled
 
bool m_bKeyboardInputEnabled
 
bool m_bDrawBackground
 
Position m_dock
 
unsigned char m_cursor
 
bool m_tabable
 
bool m_bNeedsLayout
 
bool m_bCacheTextureDirty
 
bool m_bCacheToTexture
 
DragAndDrop::Packagem_dragAndDrop_Package
 
bool m_bIncludeInSize
 
- Protected Attributes inherited from Gwk::Event::Handler
std::list< Caller * > m_callers
 

Detailed Description

This is the base class for all Gwork controls.

Member Function Documentation

◆ EnableCacheToTexture()

virtual void Gwk::Controls::Base::EnableCacheToTexture ( )
inlinevirtual

Enable caching to texture optimisation for this control.

Note
Must have GetCTT() implemented in the Renderer.

◆ GetInnerBounds()

virtual const Gwk::Rect& Gwk::Controls::Base::GetInnerBounds ( ) const
inlinevirtual

InnerBounds is the area inside the control that doesn't have child controls docked to it.

Member Data Documentation

◆ m_actualParent

Base* Gwk::Controls::Base::m_actualParent
protected

This is the panel's actual parent - most likely the logical parent's InnerPanel (if it has one). You should rarely need this.

◆ m_innerPanel

Base* Gwk::Controls::Base::m_innerPanel
protected

If the InnerPanel exists our children will automatically become children of that instead of us - allowing us to move them all around by moving that panel (useful for scrolling etc).

◆ m_parent

Base* Gwk::Controls::Base::m_parent
protected

The logical parent. It's usually what you expect, the control you've parented it to.


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