ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Base class for widgets which need to edit text, like ListWidget and EditTextWidget. More...

#include <editable.h>

Inheritance diagram for GUI::EditableWidget:
Collaboration diagram for GUI::EditableWidget:

List of all members.

Public Types

typedef Common::String String

Public Member Functions

 EditableWidget (GuiObject *boss, int x, int y, int w, int h, const char *tooltip=nullptr, uint32 cmd=0)
 EditableWidget (GuiObject *boss, const String &name, const char *tooltip=nullptr, uint32 cmd=0)
 ~EditableWidget () override
void init ()
virtual void setEditString (const String &str)
virtual const StringgetEditString () const
void handleTickle () override
bool handleKeyDown (Common::KeyState state) override
void reflowLayout () override
bool setCaretPos (int newPos)

Protected Member Functions

virtual void startEditMode ()=0
virtual void endEditMode ()=0
virtual void abortEditMode ()=0
virtual Common::Rect getEditRect () const =0
 The area where text input is being made.
virtual int getCaretOffset () const
void drawCaret (bool erase)
bool adjustOffset ()
void makeCaretVisible ()
void defaultKeyDownHandler (Common::KeyState &state, bool &dirty, bool &forcecaret, bool &handled)
void setFontStyle (ThemeEngine::FontStyle font)
virtual bool tryInsertChar (byte c, int pos)

Protected Attributes

String _editString
uint32 _cmd
bool _caretVisible
uint32 _caretTime
int _caretPos
bool _caretInverse
int _editScrollOffset
Graphics::TextAlign _align
Graphics::TextAlign _drawAlign
ThemeEngine::FontStyle _font
ThemeEngine::TextInversionState _inversion

Detailed Description

Base class for widgets which need to edit text, like ListWidget and EditTextWidget.

Definition at line 42 of file editable.h.


Member Typedef Documentation

Reimplemented in GUI::EditTextWidget, and GUI::ListWidget.

Definition at line 44 of file editable.h.


Constructor & Destructor Documentation

GUI::EditableWidget::EditableWidget ( GuiObject boss,
int  x,
int  y,
int  w,
int  h,
const char *  tooltip = nullptr,
uint32  cmd = 0 
)

Definition at line 31 of file editable.cpp.

GUI::EditableWidget::EditableWidget ( GuiObject boss,
const String name,
const char *  tooltip = nullptr,
uint32  cmd = 0 
)

Definition at line 36 of file editable.cpp.

GUI::EditableWidget::~EditableWidget (  )  [override]

Definition at line 57 of file editable.cpp.


Member Function Documentation

virtual void GUI::EditableWidget::abortEditMode (  )  [protected, pure virtual]

Implemented in GUI::EditTextWidget, and GUI::ListWidget.

bool GUI::EditableWidget::adjustOffset (  )  [protected]

Definition at line 356 of file editable.cpp.

void GUI::EditableWidget::defaultKeyDownHandler ( Common::KeyState state,
bool &  dirty,
bool &  forcecaret,
bool &  handled 
) [protected]

Definition at line 262 of file editable.cpp.

void GUI::EditableWidget::drawCaret ( bool  erase  )  [protected]

Definition at line 279 of file editable.cpp.

virtual void GUI::EditableWidget::endEditMode (  )  [protected, pure virtual]

Implemented in GUI::EditTextWidget, and GUI::ListWidget.

int GUI::EditableWidget::getCaretOffset (  )  const [protected, virtual]

Definition at line 274 of file editable.cpp.

virtual Common::Rect GUI::EditableWidget::getEditRect (  )  const [protected, pure virtual]

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.

Implemented in GUI::EditTextWidget, and GUI::ListWidget.

virtual const String& GUI::EditableWidget::getEditString (  )  const [inline, virtual]

Definition at line 73 of file editable.h.

bool GUI::EditableWidget::handleKeyDown ( Common::KeyState  state  )  [override]

Reimplemented in GUI::ListWidget.

Definition at line 95 of file editable.cpp.

void GUI::EditableWidget::handleTickle (  )  [override]

Reimplemented in GUI::ListWidget.

Definition at line 87 of file editable.cpp.

void GUI::EditableWidget::init (  ) 

Definition at line 41 of file editable.cpp.

void GUI::EditableWidget::makeCaretVisible (  )  [protected]

Definition at line 384 of file editable.cpp.

void GUI::EditableWidget::reflowLayout (  )  [override]

Reimplemented in GUI::EditTextWidget, and GUI::ListWidget.

Definition at line 60 of file editable.cpp.

bool GUI::EditableWidget::setCaretPos ( int  newPos  ) 

Definition at line 350 of file editable.cpp.

void GUI::EditableWidget::setEditString ( const String str  )  [virtual]

Reimplemented in GUI::EditTextWidget.

Definition at line 72 of file editable.cpp.

void GUI::EditableWidget::setFontStyle ( ThemeEngine::FontStyle  font  )  [inline, protected]

Definition at line 98 of file editable.h.

virtual void GUI::EditableWidget::startEditMode (  )  [protected, pure virtual]

Implemented in GUI::EditTextWidget, and GUI::ListWidget.

bool GUI::EditableWidget::tryInsertChar ( byte  c,
int  pos 
) [protected, virtual]

Reimplemented in GUI::DomainEditTextWidget.

Definition at line 79 of file editable.cpp.


Member Data Documentation

Definition at line 58 of file editable.h.

Definition at line 54 of file editable.h.

Definition at line 52 of file editable.h.

Definition at line 51 of file editable.h.

Definition at line 50 of file editable.h.

Reimplemented in GUI::ListWidget.

Definition at line 48 of file editable.h.

Definition at line 59 of file editable.h.

Definition at line 56 of file editable.h.

Definition at line 46 of file editable.h.

Definition at line 61 of file editable.h.


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


Generated on Sat Jul 4 2020 05:03:59 for ResidualVM by doxygen 1.7.1
curved edge   curved edge