49 return *itemA < *itemB;
66 if (state != SDL_BUTTON_LMASK)
76 if (state == SDL_BUTTON_LMASK) {
147 _uR(1.0f), _uG(1.0f), _uB(1.0f), _uA(1.0f),
148 _sR(1.0f), _sG(1.0f), _sB(0.0f), _sA(1.0f), _spacing(spacing) {
156 _text->setClickable(
true);
174 _text->setPosition(x, y, z);
198 return _text->getWidth();
234 ModelWidget(gui, tag, model), _contentX(0.0f), _contentY(0.0f), _contentZ(0.0f),
235 _startItem(0), _selectedItem(0xFFFFFFFF), _up(0), _down(0), _scrollbar(0), _locked(false),
236 _mode(kModeStatic), _hasScrollbar(false), _dblClicked(false) {
256 float topX = 8.0f, topY =
getHeight() - 6.0f, topZ = 0.0f;
276 float minX, minY, minZ;
285 float maxX, maxY, maxZ;
294 float scrollRange = minY - (maxY - 10) -
_up->
getHeight() - 1;
359 (*it)->getPosition(sX, sY, sZ);
365 (*it)->setPosition(sX + nX, sY + nY, sZ + nZ);
395 for (std::vector<WidgetListItem *>::iterator i =
_items.begin(); i !=
_items.end(); ++i)
423 for (std::vector<WidgetListItem *>::iterator i =
_items.begin(); i !=
_items.end(); ++i) {
424 (*i)->addGroupMember(*item);
448 std::vector<WidgetListItem *>::iterator itItem;
449 for (std::vector<WidgetListItem *>::iterator i =
_items.begin(); i !=
_items.end(); ++i) {
450 (*i)->removeGroupMember(*item);
492 float itemHeight =
_items.front()->getHeight();
516 _items[it]->_itemNumber = it;
530 std::vector<Common::UString> lines;
533 for (std::vector<Common::UString>::iterator l = lines.begin(); l != lines.end(); ++l)
569 float itemHeight =
_items.front()->getHeight();
619 if (item >=
_items.size())
float getHeight() const
Get the widget's height.
The global graphics manager.
A class holding an UTF-8 string.
~WidgetListItemTextLine()
void reset(PointerType o=0)
Resets the pointer with the new value.
float split(const Common::UString &line, std::vector< Common::UString > &lines, float maxWidth=0.0f, float maxHeight=0.0f, bool trim=true) const
bool endsWith(const UString &with) const
WidgetListItemTextLine(::Engines::GUI &gui, const Common::UString &font, const Common::UString &text, float spacing=0.0f)
void getPosition(float &x, float &y, float &z) const
Get the position of the node.
void setPosition(float x, float y, float z)
Set the widget's position.
Basic exceptions to throw.
void setClickable(bool clickable)
Set the object's clickable state.
static UString format(const char *s,...) GCC_PRINTF(1
Print formatted data into an UString object, similar to sprintf().
Utility templates and functions.
void setUnselectedColor(float r, float g, float b, float a)
A node within a 3D model.
bool hasNode(const Common::UString &node) const
Does the specified node exist in the current state?
bool compPtrItem(WidgetListItem *itemA, WidgetListItem *itemB)
Common::ScopedPtr< Graphics::Aurora::Text > _text
void setTag(const Common::UString &tag)
Set the widget's tag.
void show()
Show the widget.
void setSelectedColor(float r, float g, float b, float a)
float getWidth() const
Get the widget's width.
ModelNode * getNode(const Common::UString &node)
Get the specified node, from the current state.
void hide()
Hide the widget.
virtual float getHeight() const =0
Return the height of a character.
#define GfxMan
Shortcut for accessing the graphics manager.
#define FontMan
Shortcut for accessing the font manager.
A text line widget within a NWN listbox widget.