22 #include "precompiled.h"
43 AddSetting(GUIST_CGUISpriteInstance,
"sprite");
96 float buffer_zone=0.f;
106 bool scrollbottom =
false;
135 switch (Message.
type)
138 if (Message.
value ==
"scrollbar")
144 if (Message.
value ==
"scrollbar_style")
146 CStr scrollbar_style;
181 CStr scrollbar_style;
256 std::vector<SGUIText*>::iterator text_it;
257 std::list<SGUIText::SSpriteCall>::iterator sprite_it;
CPos m_TextPos
Placement of text.
void SetupText()
Sets up text, should be called every time changes has been made that can change the visual...
void DrawSprite(const CGUISpriteInstance &Sprite, int CellID, const float &Z, const CRect &Rect, const CRect &Clipping=CRect())
Draw GUI Sprite.
const PSRETURN PSRETURN_OK
float left
Returning CPos representing each corner.
static PSRETURN GetSetting(const IGUIObject *pObject, const CStr &Setting, T &Value)
Retrieves a setting by name from object pointer.
CStrW m_TooltipStyle
Tooltip style.
CRect m_Area
Size and position of sprite.
A sprite call to the CRenderer.
virtual float GetBufferedZ() const
Returns not the Z value, but the actual buffered Z value, i.e.
void CalculateTextPosition(CRect &ObjSize, CPos &TextPos, SGUIText &Text)
Calculate the position for the text, based on the alignment.
Includes static functions that needs one template argument.
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
virtual void HandleMessage(SGUIMessage &Message)
void AddSetting(const EGUISettingType &Type, const CStr &Name)
Add a setting to m_Settings.
CRect m_CachedActualSize
Cached size, real size m_Size is actually dependent on resolution and can have different real outcome...
Made to represent screen positions and delta values.
CPos GetMousePos() const
Get Mouse from CGUI.
virtual void HandleMessage(SGUIMessage &Message)
virtual void DrawText(int index, const CColor &color, const CPos &pos, float z, const CRect &clipping=CRect())
Draws the Text.
PSRETURN SetSetting(const CStr &Setting, const CStrW &Value, const bool &SkipMessage=false)
Set a setting by string, regardless of what type it is.
static PSRETURN SetSetting(IGUIObject *pObject, const CStr &Setting, const T &Value, const bool &SkipMessage=false)
Sets a value by name using a real datatype as input.
std::vector< SGUIText * > m_GeneratedTexts
Texts that are generated and ready to be rendered.
Message send to IGUIObject::HandleMessage() in order to give life to Objects manually with a derived ...
EGUIMessageType type
Describes what the message regards.
std::list< SSpriteCall > m_SpriteCalls
List of sprites, or "icons" that should be rendered along with the text.
bool PointInside(const CPos &point) const
Evalutates if point is within the rectangle.
void AddText(SGUIText *text)
Adds a text object.
virtual void Draw()
Draws the Text.
CStrW m_Tooltip
Tooltip text.
String class, substitute for CStr, but that parses the tags and builds up a list of all text that wil...
SGUIText GenerateText(const CGUIString &Text, const CStrW &Font, const float &Width, const float &BufferZone, const IGUIObject *pObject=NULL)
Generate a SGUIText object from the inputted string.
CPos TopLeft() const
Get Position equivalent to top/left corner.
static PSRETURN GetSettingPointer(const IGUIObject *pObject, const CStr &Setting, T *&Value)
An SGUIText object is a parsed string, divided into text-rendering components.
Rectangle class used for screen rectangles.
virtual bool MouseOverIcon()
Test if mouse position is over an icon.