ScummVM API documentation
GUI::ListWidget Class Reference
Inheritance diagram for GUI::ListWidget:
GUI::EditableWidget GUI::Widget GUI::CommandSender GUI::GuiObject GUI::CommandReceiver GUI::GroupedListWidget GUI::MassAddListWidget

Classes

struct  ListData
 

Public Types

typedef bool(* FilterMatcher) (void *arg, int idx, const Common::U32String &item, const Common::U32String &token)
 
typedef Common::Array< ListDataListDataArray
 

Public Member Functions

 ListWidget (Dialog *boss, const Common::String &name, const Common::U32String &tooltip=Common::U32String(), uint32 cmd=0)
 
 ListWidget (Dialog *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip=Common::U32String(), uint32 cmd=0)
 
 ListWidget (Dialog *boss, int x, int y, int w, int h, const Common::U32String &tooltip=Common::U32String(), uint32 cmd=0)
 
bool containsWidget (Widget *) const override
 
WidgetfindWidget (int x, int y) override
 
void setList (const Common::U32StringArray &list)
 
const Common::U32StringArraygetList () const
 
void append (const Common::String &s)
 
void setSelected (int item)
 
int getSelected () const
 
const Common::U32String getSelectedString () const
 
void setNumberingMode (NumberingMode numberingMode)
 
void scrollTo (int item)
 
void scrollToEnd ()
 
int getCurrentScrollPos () const
 
void enableQuickSelect (bool enable)
 
Common::String getQuickSelectString () const
 
void enableDictionarySelect (bool enable)
 
bool isEditable () const
 
void setEditable (bool editable)
 
void setEditColor (ThemeEngine::FontColor color)
 
void setFilterMatcher (FilterMatcher matcher, void *arg)
 
void startEditMode () override
 
void endEditMode () override
 
void setFilter (const Common::U32String &filter, bool redraw=true)
 
void handleTickle () override
 
void handleMouseDown (int x, int y, int button, int clickCount) override
 
void handleMouseUp (int x, int y, int button, int clickCount) override
 
void handleMouseWheel (int x, int y, int direction) override
 
void handleMouseMoved (int x, int y, int button) override
 
void handleMouseLeft (int button) override
 
bool handleKeyDown (Common::KeyState state) override
 
bool handleKeyUp (Common::KeyState state) override
 
void handleCommand (CommandSender *sender, uint32 cmd, uint32 data) override
 
void reflowLayout () override
 
bool wantsFocus () override
 
- Public Member Functions inherited from GUI::EditableWidget
 EditableWidget (GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip=Common::U32String(), uint32 cmd=0)
 
 EditableWidget (GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip=Common::U32String(), uint32 cmd=0)
 
 EditableWidget (GuiObject *boss, const Common::String &name, const Common::U32String &tooltip=Common::U32String(), uint32 cmd=0)
 
void init ()
 
virtual void setEditString (const Common::U32String &str)
 
virtual const Common::U32StringgetEditString () const
 
void handleOtherEvent (const Common::Event &evt) override
 
void moveCaretToStart (bool shiftPressed)
 
void moveCaretToEnd (bool shiftPressed)
 
bool setCaretPos (int newPos)
 
void setSelectionOffset (int newOffset)
 
- Public Member Functions inherited from GUI::Widget
 Widget (GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip=Common::U32String())
 
 Widget (GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip=Common::U32String())
 
 Widget (GuiObject *boss, const Common::String &name, const Common::U32String &tooltip=Common::U32String())
 
void init ()
 
void setNext (Widget *w)
 
void setBoss (GuiObject *newBoss)
 
Widgetnext ()
 
int16 getAbsX () const override
 
int16 getAbsY () const override
 
virtual void setPos (int x, int y)
 
virtual void setSize (int w, int h)
 
virtual void getMinSize (int &minWidth, int &minHeight)
 
virtual void handleMouseEntered (int button)
 
virtual void markAsDirty ()
 
virtual void draw ()
 
void receivedFocus ()
 
void lostFocus ()
 
uint32 getType () const
 
void setFlags (int flags)
 
void clearFlags (int flags)
 
int getFlags () const
 
void setEnabled (bool e)
 
bool isEnabled () const
 
void setVisible (bool e)
 
bool isVisible () const override
 
bool useRTL () const
 
uint8 parseHotkey (const Common::U32String &label)
 
Common::U32String cleanupHotkey (const Common::U32String &label)
 
bool hasTooltip () const
 
const Common::U32StringgetTooltip () const
 
void setTooltip (const Common::U32String &tooltip)
 
void setTooltip (const Common::String &tooltip)
 
void read (const Common::U32String &str)
 
- Public Member Functions inherited from GUI::GuiObject
 GuiObject (int x, int y, int w, int h, bool scale=false)
 
 GuiObject (const Common::String &name)
 
virtual void setTextDrawableArea (const Common::Rect &r)
 
virtual void resize (int x, int y, int w, int h, bool scale=true)
 
virtual WidgetaddChild (Widget *newChild)
 
virtual int16 getRelX () const
 
virtual int16 getRelY () const
 
virtual int16 getChildX () const
 
virtual int16 getChildY () const
 
virtual uint16 getWidth () const
 
virtual uint16 getHeight () const
 
virtual void removeWidget (Widget *widget)
 
virtual bool isPointIn (int x, int y)
 
virtual Common::Rect getClipRect () const
 
virtual void handleTooltipUpdate (int x, int y)
 
- Public Member Functions inherited from GUI::CommandSender
 CommandSender (CommandReceiver *target)
 
void setTarget (CommandReceiver *target)
 
CommandReceivergetTarget () const
 
virtual void sendCommand (uint32 cmd, uint32 data)
 

Static Public Member Functions

static Common::U32String getThemeColor (byte r, byte g, byte b)
 
static Common::U32String getThemeColor (ThemeEngine::FontColor color)
 
static ThemeEngine::FontColor getThemeColor (const Common::U32String &color)
 
static Common::U32String stripGUIformatting (const Common::U32String &str)
 
static Common::U32String escapeString (const Common::U32String &str)
 
- Static Public Member Functions inherited from GUI::Widget
static WidgetfindWidgetInChain (Widget *start, int x, int y)
 
static WidgetfindWidgetInChain (Widget *start, const char *name)
 
static bool containsWidgetInChain (Widget *start, Widget *search)
 

Protected Member Functions

void drawWidget () override
 
int findItem (int x, int y) const
 Finds the item at position (x,y). Returns -1 if there is no item there.
 
void scrollBarRecalc ()
 
void abortEditMode () override
 
Common::Rect getEditRect () const override
 
int getCaretOffset () const override
 
void copyListData (const Common::U32StringArray &list)
 
void receivedFocusWidget () override
 
void lostFocusWidget () override
 
void checkBounds ()
 
void scrollToCurrent ()
 
virtual ThemeEngine::WidgetStateInfo getItemState (int item) const
 
void drawFormattedText (const Common::Rect &r, const Common::U32String &str, ThemeEngine::WidgetStateInfo state=ThemeEngine::kStateEnabled, Graphics::TextAlign align=Graphics::kTextAlignCenter, ThemeEngine::TextInversionState inverted=ThemeEngine::kTextInversionNone, int deltax=0, bool useEllipsis=true, ThemeEngine::FontColor color=ThemeEngine::kFontColorFormatting)
 
- Protected Member Functions inherited from GUI::EditableWidget
virtual int getSelectionCarretOffset () const
 
void drawCaret (bool erase, bool useRelativeCoordinates=false)
 
bool adjustOffset ()
 
void makeCaretVisible ()
 
void defaultKeyDownHandler (Common::KeyState &state, bool &dirty, bool &forcecaret, bool &handled)
 
void setFontStyle (ThemeEngine::FontStyle font)
 
virtual bool isCharAllowed (Common::u32char_type_t c) const
 
bool tryInsertChar (Common::u32char_type_t c, int pos)
 
int caretVisualPos (int logicalPos) const
 
int caretLogicalPos () const
 
void clearSelection ()
 
- Protected Member Functions inherited from GUI::Widget
void updateState (int oldFlags, int newFlags)
 
void releaseFocus () override
 

Protected Attributes

Common::U32StringArray _list
 
Common::U32StringArray _cleanedList
 
ListDataArray _dataList
 
Common::Array< int > _listIndex
 
bool _editable
 
bool _editMode
 
NumberingMode _numberingMode
 
int _currentPos
 
int _entriesPerPage
 
int _selectedItem
 
ScrollBarWidget_scrollBar
 
int _currentKeyDown
 
Common::String _quickSelectStr
 
uint32 _quickSelectTime
 
int _hlLeftPadding
 
int _hlRightPadding
 
int _leftPadding
 
int _rightPadding
 
int _topPadding
 
int _bottomPadding
 
int _scrollBarWidth
 
Common::U32String _filter
 
bool _quickSelect
 
bool _dictionarySelect
 
uint32 _cmd
 
ThemeEngine::FontColor _editColor
 
int _lastRead
 
FilterMatcher _filterMatcher
 
void * _filterMatcherArg
 
- Protected Attributes inherited from GUI::EditableWidget
Common::U32String _editString
 
uint32 _cmd
 
bool _caretVisible
 
uint32 _caretTime
 
int _caretPos
 
bool _caretInverse
 
int _editScrollOffset
 
int _selCaretPos
 
int _selOffset
 
bool _shiftPressed
 
bool _isDragging
 
bool _disableSelection
 
Graphics::TextAlign _align
 
Graphics::TextAlign _drawAlign
 
ThemeEngine::FontStyle _font
 
ThemeEngine::TextInversionState _inversion
 
- Protected Attributes inherited from GUI::Widget
uint32 _type
 
GuiObject_boss
 
Widget_next
 
bool _hasFocus
 
ThemeEngine::WidgetStateInfo _state
 
Common::U32String _tooltip
 
- Protected Attributes inherited from GUI::GuiObject
Common::Rect _textDrawableArea
 
int16 _x
 
int16 _y
 
uint16 _w
 
uint16 _h
 
bool _useRTL
 
const Common::String _name
 
Widget_firstWidget
 
- Protected Attributes inherited from GUI::CommandSender
CommandReceiver_target
 

Member Function Documentation

◆ getEditRect()

Common::Rect GUI::ListWidget::getEditRect ( ) const
overrideprotectedvirtual

The area where text input is being made. This should exactly match the rect with which the actual edit string is drawn otherwise nasty graphics glitches when redrawing the caret can occur.

Implements GUI::EditableWidget.


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