Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
CList Class Reference

Create a list of elements, where one can be selected by the user. More...

#include <CList.h>

Inheritance diagram for CList:
IGUIScrollBarOwner IGUITextOwner IGUIObject IGUIObject CDropDown

Public Member Functions

 CList ()
 
virtual ~CList ()
 
virtual void ResetStates ()
 
virtual void AddItem (const CStrW &str, const CStrW &data)
 Adds an item last to the list. More...
 
- Public Member Functions inherited from IGUIScrollBarOwner
 IGUIScrollBarOwner ()
 
virtual ~IGUIScrollBarOwner ()
 
virtual const SGUIScrollBarStyleGetScrollBarStyle (const CStr &style) const
 Interface for the m_ScrollBar to use. More...
 
virtual void AddScrollBar (IGUIScrollBar *scrollbar)
 Add a scroll-bar. More...
 
virtual IGUIScrollBarGetScrollBar (const int &index)
 Get Scroll Bar reference (it should be transparent it's actually pointers). More...
 
- Public Member Functions inherited from IGUIObject
 IGUIObject ()
 
virtual ~IGUIObject ()
 
virtual bool MouseOver ()
 Checks if mouse is hovering this object. More...
 
const CStr & GetName () const
 Get object name, name is unique. More...
 
void SetName (const CStr &Name)
 Get object name. More...
 
CStr GetPresentableName () const
 
void AddToPointersMap (map_pObjects &ObjectMap)
 Adds object and its children to the map, it's name being the first part, and the second being itself. More...
 
void AddChild (IGUIObject *pChild)
 Notice nothing will be returned or thrown if the child hasn't been inputted into the GUI yet. More...
 
vector_pObjects::iterator ChildrenItBegin ()
 
vector_pObjects::iterator ChildrenItEnd ()
 
bool SettingExists (const CStr &Setting) const
 Checks if settings exists, only available for derived classes that has this set up, that's why the base class just returns false. More...
 
PSRETURN SetSetting (const CStr &Setting, const CStrW &Value, const bool &SkipMessage=false)
 Set a setting by string, regardless of what type it is. More...
 
PSRETURN GetSettingType (const CStr &Setting, EGUISettingType &Type) const
 Retrieves the type of a named setting. More...
 
void RegisterScriptHandler (const CStr &Action, const CStr &Code, CGUI *pGUI)
 Set the script handler for a particular object-specific action. More...
 
JSObject * GetJSObject ()
 Retrieves the JSObject representing this GUI object. More...
 
CGUIGetGUI ()
 
const CGUIGetGUI () const
 
void SetFocus ()
 Take focus! More...
 
- Public Member Functions inherited from IGUITextOwner
 IGUITextOwner ()
 
virtual ~IGUITextOwner ()
 
void AddText (SGUIText *text)
 Adds a text object. More...
 
virtual void UpdateCachedSize ()
 
virtual void DrawText (int index, const CColor &color, const CPos &pos, float z, const CRect &clipping=CRect())
 Draws the Text. More...
 
virtual bool MouseOverIcon ()
 Test if mouse position is over an icon. More...
 

Protected Member Functions

void SetupText ()
 Sets up text, should be called every time changes has been made that can change the visual. More...
 
virtual void HandleMessage (SGUIMessage &Message)
 
virtual InReaction ManuallyHandleEvent (const SDL_Event_ *ev)
 Handle events manually to catch keyboard inputting. More...
 
virtual void Draw ()
 Draws the List box. More...
 
virtual void SelectNextElement ()
 Easy select elements functions. More...
 
virtual void SelectPrevElement ()
 
virtual void SelectFirstElement ()
 
virtual void SelectLastElement ()
 
virtual bool HandleAdditionalChildren (const XMBElement &child, CXeromyces *pFile)
 Handle the <item> tag. More...
 
void UpdateAutoScroll ()
 
void DrawList (const int &selected, const CStr &_sprite, const CStr &_sprite_selected, const CStr &_textcolor)
 
virtual CRect GetListRect () const
 
virtual bool GetModified () const
 
- Protected Member Functions inherited from IGUIObject
void AddSetting (const EGUISettingType &Type, const CStr &Name)
 Add a setting to m_Settings. More...
 
virtual void Destroy ()
 Calls Destroy on all children, and deallocates all memory. More...
 
void LoadStyle (CGUI &GUIinstance, const CStr &StyleName)
 Loads a style. More...
 
void LoadStyle (const SGUIStyle &Style)
 Loads a style. More...
 
virtual float GetBufferedZ () const
 Returns not the Z value, but the actual buffered Z value, i.e. More...
 
void SetGUI (CGUI *const &pGUI)
 
void SetParent (IGUIObject *pParent)
 Set parent of this object. More...
 
bool IsFocused () const
 Check if object is focused. More...
 
IGUIObjectGetParent () const
 NOTE! This will not just return m_pParent, when that is need use it! There is one exception to it, when the parent is the top-node (the object that isn't a real object), this will return NULL, so that the top-node's children are seemingly parentless. More...
 
CPos GetMousePos () const
 Get Mouse from CGUI. More...
 
InReaction SendEvent (EGUIMessageType type, const CStr &EventName)
 Send event to this GUI object (HandleMessage and ScriptEvent) More...
 
void ScriptEvent (const CStr &Action)
 Execute the script for a particular action. More...
 
void ScriptEvent (const CStr &Action, const CScriptValRooted &Argument)
 Execute the script for a particular action. More...
 
void SetScriptHandler (const CStr &Action, JSObject *Function)
 
void UpdateMouseOver (IGUIObject *const &pMouseOver)
 Inputes the object that is currently hovered, this function updates this object accordingly (i.e. More...
 
- Protected Member Functions inherited from IGUITextOwner
void CalculateTextPosition (CRect &ObjSize, CPos &TextPos, SGUIText &Text)
 Calculate the position for the text, based on the alignment. More...
 

Protected Attributes

std::vector< float > m_ItemsYPositions
 List of each element's relative y position. More...
 
- Protected Attributes inherited from IGUIScrollBarOwner
std::vector< IGUIScrollBar * > m_ScrollBars
 Predominately you will only have one, but you can have as many as you like. More...
 
- Protected Attributes inherited from IGUIObject
CRect m_CachedActualSize
 Cached size, real size m_Size is actually dependent on resolution and can have different real outcomes, this is the real outcome cached to avoid slow calculations in real time. More...
 
CStr m_Name
 
vector_pObjects m_Children
 
IGUIObjectm_pParent
 
double m_LastClickTime [6]
 
bool m_MouseHovering
 This is an array of true or false, each element is associated with a string representing a setting. More...
 
- Protected Attributes inherited from IGUITextOwner
bool m_GeneratedTextsValid
 Whether the cached text is currently valid (if not then SetupText will be called by Draw) More...
 
std::vector< SGUIText * > m_GeneratedTexts
 Texts that are generated and ready to be rendered. More...
 

Private Attributes

bool m_Modified
 

Detailed Description

Create a list of elements, where one can be selected by the user.

The control will use a pre-processed text-object for each element, which will be managed by the IGUITextOwner structure.

A scroll-bar will appear when needed. This will be achieve with the IGUIScrollBarOwner structure.

Definition at line 66 of file CList.h.

Constructor & Destructor Documentation

CList::CList ( )

Definition at line 36 of file CList.cpp.

CList::~CList ( )
virtual

Definition at line 73 of file CList.cpp.

Member Function Documentation

void CList::AddItem ( const CStrW &  str,
const CStrW &  data 
)
virtual

Adds an item last to the list.

Definition at line 425 of file CList.cpp.

void CList::Draw ( )
protectedvirtual

Draws the List box.

Reimplemented from IGUIScrollBarOwner.

Reimplemented in CDropDown.

Definition at line 319 of file CList.cpp.

void CList::DrawList ( const int &  selected,
const CStr &  _sprite,
const CStr &  _sprite_selected,
const CStr &  _textcolor 
)
protected

Definition at line 327 of file CList.cpp.

virtual CRect CList::GetListRect ( ) const
inlineprotectedvirtual

Reimplemented in CDropDown.

Definition at line 129 of file CList.h.

virtual bool CList::GetModified ( ) const
inlineprotectedvirtual

Definition at line 133 of file CList.h.

bool CList::HandleAdditionalChildren ( const XMBElement child,
CXeromyces pFile 
)
protectedvirtual

Handle the <item> tag.

Reimplemented from IGUIObject.

Definition at line 443 of file CList.cpp.

void CList::HandleMessage ( SGUIMessage Message)
protectedvirtual
See Also
IGUIObject::HandleMessage()

Reimplemented from IGUIScrollBarOwner.

Reimplemented in CDropDown.

Definition at line 155 of file CList.cpp.

InReaction CList::ManuallyHandleEvent ( const SDL_Event_ ev)
protectedvirtual

Handle events manually to catch keyboard inputting.

Reimplemented from IGUIObject.

Reimplemented in CDropDown.

Definition at line 278 of file CList.cpp.

virtual void CList::ResetStates ( )
inlinevirtual
See Also
IGUIObject::ResetStates()

Reimplemented from IGUIScrollBarOwner.

Definition at line 77 of file CList.h.

void CList::SelectFirstElement ( )
protectedvirtual

Definition at line 494 of file CList.cpp.

void CList::SelectLastElement ( )
protectedvirtual

Definition at line 505 of file CList.cpp.

void CList::SelectNextElement ( )
protectedvirtual

Easy select elements functions.

Definition at line 459 of file CList.cpp.

void CList::SelectPrevElement ( )
protectedvirtual

Definition at line 478 of file CList.cpp.

void CList::SetupText ( )
protectedvirtual

Sets up text, should be called every time changes has been made that can change the visual.

Implements IGUITextOwner.

Definition at line 77 of file CList.cpp.

void CList::UpdateAutoScroll ( )
protected

Definition at line 519 of file CList.cpp.

Member Data Documentation

std::vector<float> CList::m_ItemsYPositions
protected

List of each element's relative y position.

Will be one larger than m_Items, because it will end with the bottom of the last element. First element will always be zero, but still stored for easy handling.

Definition at line 144 of file CList.h.

bool CList::m_Modified
private

Definition at line 148 of file CList.h.


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