22 #include "precompiled.h"
47 AddSetting(GUIST_CGUISpriteInstance,
"sprite_list");
48 AddSetting(GUIST_CGUISpriteInstance,
"sprite2");
49 AddSetting(GUIST_CGUISpriteInstance,
"sprite2_over");
50 AddSetting(GUIST_CGUISpriteInstance,
"sprite2_pressed");
51 AddSetting(GUIST_CGUISpriteInstance,
"sprite2_disabled");
83 if (Message.
value ==
"size" ||
84 Message.
value ==
"absolute" ||
85 Message.
value ==
"dropdown_size" ||
86 Message.
value ==
"dropdown_buffer" ||
87 Message.
value ==
"scrollbar_style" ||
88 Message.
value ==
"button_width")
117 for (
int i=0; i<(int)pList->
m_Items.size(); ++i)
263 bool update_highlight =
false;
282 update_highlight =
true;
288 if (
m_Open && ((szChar >= SDLK_a && szChar <= SDLK_z) || szChar == SDLK_SPACE
289 || (szChar >= SDLK_0 && szChar <= SDLK_9)
291 || (szChar >= SDLK_KP0 && szChar <= SDLK_KP9)))
293 || (szChar >= SDLK_KP_0 && szChar <= SDLK_KP_9)))
311 int difference = 1250;
312 for (
int i=0; i<(int)pList->
m_Items.size(); ++i)
314 int indexOfDifference = 0;
320 indexOfDifference = j+1;
324 if (indexOfDifference > bestIndex || (indexOfDifference >= bestIndex && diff < difference))
326 bestIndex = indexOfDifference;
335 update_highlight =
true;
344 if (update_highlight)
352 float size, buffer, button_width;
403 float dropdown_size, button_width;
408 int cell_id, selected=0;
423 if (button_width > 0.f)
456 DrawText(selected, color, pos, bz+0.1f, cliparea);
459 bool *scrollbar=NULL, old;
483 return std::min(bz + 500.f, 1000.f);
virtual void HandleMessage(SGUIMessage &Message)
void DrawSprite(const CGUISpriteInstance &Sprite, int CellID, const float &Z, const CRect &Rect, const CRect &Clipping=CRect())
Draw GUI Sprite.
virtual InReaction ManuallyHandleEvent(const SDL_Event_ *ev)
Handle events manually to catch keyboard inputting.
void DrawList(const int &selected, const CStr &_sprite, const CStr &_sprite_selected, const CStr &_textcolor)
const PSRETURN PSRETURN_OK
ISoundManager * g_SoundManager
virtual CRect GetListRect() const
float left
Returning CPos representing each corner.
virtual void SetupListRect()
static PSRETURN GetSetting(const IGUIObject *pObject, const CStr &Setting, T &Value)
Retrieves a setting by name from object pointer.
virtual void PlayAsUI(const VfsPath &itemPath, bool looping)=0
#define SDL_VERSION_ATLEAST(X, Y, Z)
void SetupText()
Sets up text, should be called every time changes has been made that can change the visual...
virtual void HandleMessage(SGUIMessage &Message)
virtual float GetBufferedZ() const
Returns not the Z value, but the actual buffered Z value, i.e.
void SetupText()
Sets up text, should be called every time changes has been made that can change the visual...
virtual bool GetModified() const
Includes static functions that needs one template argument.
virtual bool MouseOver()
Checks if mouse is hovering this object.
std::vector< float > m_ItemsYPositions
List of each element's relative y position.
virtual void Draw()
Draws the Button.
std::string m_InputBuffer
std::vector< CGUIString > m_Items
List of items (as text), the post-processed result is stored in the IGUITextOwner structure of this c...
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.
virtual float GetBufferedZ() const
Returns not the Z value, but the actual buffered Z value, i.e.
CPos GetMousePos() const
Get Mouse from CGUI.
virtual void DrawText(int index, const CColor &color, const CPos &pos, float z, const CRect &clipping=CRect())
Draws the Text.
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.
virtual InReaction ManuallyHandleEvent(const SDL_Event_ *ev)
Handle events manually to catch keyboard inputting.
bool m_MouseHovering
This is an array of true or false, each element is associated with a string representing a setting...
Message send to IGUIObject::HandleMessage() in order to give life to Objects manually with a derived ...
EGUIMessageType type
Describes what the message regards.
bool PointInside(const CPos &point) const
Evalutates if point is within the rectangle.
static PSRETURN GetSettingPointer(const IGUIObject *pObject, const CStr &Setting, T *&Value)
Rectangle class used for screen rectangles.