ScummVM
GUI::Dialog Class Reference

#include <dialog.h>

Inheritance diagram for GUI::Dialog:
Collaboration diagram for GUI::Dialog:

Public Member Functions

 Dialog (int x, int y, int w, int h)
 
 Dialog (const Common::String &name)
 
virtual int runModal ()
 
bool isVisible () const
 
void releaseFocus ()
 
void setFocusWidget (Widget *widget)
 
WidgetgetFocusWidget ()
 
void setTickleWidget (Widget *widget)
 
void unSetTickleWidget ()
 
WidgetgetTickleWidget ()
 
virtual void reflowLayout ()
 
virtual void lostFocus ()
 
virtual void receivedFocus (int x=-1, int y=-1)
 
- Public Member Functions inherited from GUI::GuiObject
 GuiObject (int x, int y, int w, int h)
 
 GuiObject (const Common::String &name)
 
 ~GuiObject ()
 
virtual void setTextDrawableArea (const Common::Rect &r)
 
virtual int16 getRelX () const
 
virtual int16 getRelY () const
 
virtual int16 getAbsX () const
 
virtual int16 getAbsY () const
 
virtual int16 getChildX () const
 
virtual int16 getChildY () const
 
virtual uint16 getWidth () const
 
virtual uint16 getHeight () const
 
virtual bool isPointIn (int x, int y)
 
virtual Common::Rect getClipRect () const
 Returns the clipping rect to be used when drawing the children widgets of this object. More...
 

Protected Member Functions

virtual void open ()
 
virtual void close ()
 
void markWidgetsAsDirty ()
 Recursively mark all the widgets in this dialog as dirty so they are redrawn. More...
 
virtual void drawDialog (DrawLayer layerToDraw)
 Draw the dialog in its entirety (background and widgets) More...
 
void drawWidgets ()
 Draw only the dialog's widgets. More...
 
virtual void handleTickle ()
 
virtual void handleMouseDown (int x, int y, int button, int clickCount)
 
virtual void handleMouseUp (int x, int y, int button, int clickCount)
 
virtual void handleMouseWheel (int x, int y, int direction)
 
virtual void handleKeyDown (Common::KeyState state)
 
virtual void handleKeyUp (Common::KeyState state)
 
virtual void handleMouseMoved (int x, int y, int button)
 
virtual void handleMouseLeft (int button)
 
virtual void handleCommand (CommandSender *sender, uint32 cmd, uint32 data)
 
virtual void handleOtherEvent (Common::Event evt)
 
WidgetfindWidget (int x, int y)
 
WidgetfindWidget (const char *name)
 
void removeWidget (Widget *widget)
 
void setDefaultFocusedWidget ()
 
void setResult (int result)
 
int getResult () const
 
- Protected Member Functions inherited from GUI::CommandReceiver
virtual ~CommandReceiver ()
 

Protected Attributes

Widget_mouseWidget
 
Widget_focusedWidget
 
Widget_dragWidget
 
Widget_tickleWidget
 
bool _visible
 
ThemeEngine::DialogBackground _backgroundType
 
- Protected Attributes inherited from GUI::GuiObject
Common::Rect _textDrawableArea
 
int16 _x
 
int16 _y
 
uint16 _w
 
uint16 _h
 
const Common::String _name
 
Widget_firstWidget
 

Private Attributes

int _result
 

Friends

class GuiManager
 
class EventRecorder
 
class Tooltip
 

Detailed Description

Definition at line 49 of file dialog.h.

Constructor & Destructor Documentation

◆ Dialog() [1/2]

GUI::Dialog::Dialog ( int  x,
int  y,
int  w,
int  h 
)

Definition at line 41 of file dialog.cpp.

◆ Dialog() [2/2]

GUI::Dialog::Dialog ( const Common::String name)

Definition at line 55 of file dialog.cpp.

Member Function Documentation

◆ close()

◆ drawDialog()

void GUI::Dialog::drawDialog ( DrawLayer  layerToDraw)
protectedvirtual

Draw the dialog in its entirety (background and widgets)

Reimplemented in GUI::ConsoleDialog, Scumm::ValueDisplayDialog, GUI::AboutDialog, GUI::PopUpDialog, and GUI::Tooltip.

Definition at line 161 of file dialog.cpp.

◆ drawWidgets()

void GUI::Dialog::drawWidgets ( )
protected

Draw only the dialog's widgets.

Definition at line 174 of file dialog.cpp.

◆ findWidget() [1/2]

Widget * GUI::Dialog::findWidget ( int  x,
int  y 
)
protected

Definition at line 368 of file dialog.cpp.

◆ findWidget() [2/2]

Widget * GUI::Dialog::findWidget ( const char *  name)
protected

Definition at line 372 of file dialog.cpp.

◆ getFocusWidget()

Widget* GUI::Dialog::getFocusWidget ( )
inline

Definition at line 75 of file dialog.h.

◆ getResult()

int GUI::Dialog::getResult ( ) const
inlineprotected

Definition at line 116 of file dialog.h.

◆ getTickleWidget()

Widget* GUI::Dialog::getTickleWidget ( )
inline

Definition at line 79 of file dialog.h.

◆ handleCommand()

◆ handleKeyDown()

◆ handleKeyUp()

void GUI::Dialog::handleKeyUp ( Common::KeyState  state)
protectedvirtual

◆ handleMouseDown()

void GUI::Dialog::handleMouseDown ( int  x,
int  y,
int  button,
int  clickCount 
)
protectedvirtual

◆ handleMouseLeft()

virtual void GUI::Dialog::handleMouseLeft ( int  button)
inlineprotectedvirtual

Reimplemented in GUI::PopUpDialog.

Definition at line 105 of file dialog.h.

◆ handleMouseMoved()

void GUI::Dialog::handleMouseMoved ( int  x,
int  y,
int  button 
)
protectedvirtual

Reimplemented in GUI::Tooltip, GUI::PopUpDialog, and GUI::OnScreenDialog.

Definition at line 291 of file dialog.cpp.

◆ handleMouseUp()

void GUI::Dialog::handleMouseUp ( int  x,
int  y,
int  button,
int  clickCount 
)
protectedvirtual

Reimplemented in Hugo::TopMenu, GUI::AboutDialog, GUI::PopUpDialog, GUI::OnScreenDialog, and GUI::Tooltip.

Definition at line 206 of file dialog.cpp.

◆ handleMouseWheel()

void GUI::Dialog::handleMouseWheel ( int  x,
int  y,
int  direction 
)
protectedvirtual

◆ handleOtherEvent()

void GUI::Dialog::handleOtherEvent ( Common::Event  evt)
protectedvirtual

Reimplemented in GUI::LauncherDialog.

Definition at line 362 of file dialog.cpp.

◆ handleTickle()

◆ isVisible()

bool GUI::Dialog::isVisible ( ) const
inlinevirtual

Implements GUI::GuiObject.

Reimplemented in GUI::OnScreenDialog.

Definition at line 71 of file dialog.h.

◆ lostFocus()

void GUI::Dialog::lostFocus ( )
virtual

Definition at line 116 of file dialog.cpp.

◆ markWidgetsAsDirty()

void GUI::Dialog::markWidgetsAsDirty ( )
protected

Recursively mark all the widgets in this dialog as dirty so they are redrawn.

Definition at line 153 of file dialog.cpp.

◆ open()

◆ receivedFocus()

virtual void GUI::Dialog::receivedFocus ( int  x = -1,
int  y = -1 
)
inlinevirtual

Reimplemented in GUI::Tooltip.

Definition at line 83 of file dialog.h.

◆ reflowLayout()

◆ releaseFocus()

void GUI::Dialog::releaseFocus ( )
virtual

Implements GUI::GuiObject.

Reimplemented in GUI::OnScreenDialog.

Definition at line 146 of file dialog.cpp.

◆ removeWidget()

void GUI::Dialog::removeWidget ( Widget widget)
protectedvirtual

Reimplemented from GUI::GuiObject.

Definition at line 376 of file dialog.cpp.

◆ runModal()

int GUI::Dialog::runModal ( )
virtual

Reimplemented in GUI::BrowserDialog.

Definition at line 72 of file dialog.cpp.

◆ setDefaultFocusedWidget()

void GUI::Dialog::setDefaultFocusedWidget ( )
protected

Definition at line 136 of file dialog.cpp.

◆ setFocusWidget()

void GUI::Dialog::setFocusWidget ( Widget widget)

Definition at line 124 of file dialog.cpp.

◆ setResult()

void GUI::Dialog::setResult ( int  result)
inlineprotected

Definition at line 115 of file dialog.h.

◆ setTickleWidget()

void GUI::Dialog::setTickleWidget ( Widget widget)
inline

Definition at line 77 of file dialog.h.

◆ unSetTickleWidget()

void GUI::Dialog::unSetTickleWidget ( )
inline

Definition at line 78 of file dialog.h.

Friends And Related Function Documentation

◆ EventRecorder

friend class EventRecorder
friend

Definition at line 51 of file dialog.h.

◆ GuiManager

friend class GuiManager
friend

Definition at line 50 of file dialog.h.

◆ Tooltip

friend class Tooltip
friend

Definition at line 52 of file dialog.h.

Member Data Documentation

◆ _backgroundType

ThemeEngine::DialogBackground GUI::Dialog::_backgroundType
protected

Definition at line 60 of file dialog.h.

◆ _dragWidget

Widget* GUI::Dialog::_dragWidget
protected

Definition at line 56 of file dialog.h.

◆ _focusedWidget

Widget* GUI::Dialog::_focusedWidget
protected

Definition at line 55 of file dialog.h.

◆ _mouseWidget

Widget* GUI::Dialog::_mouseWidget
protected

Definition at line 54 of file dialog.h.

◆ _result

int GUI::Dialog::_result
private

Definition at line 63 of file dialog.h.

◆ _tickleWidget

Widget* GUI::Dialog::_tickleWidget
protected

Definition at line 57 of file dialog.h.

◆ _visible

bool GUI::Dialog::_visible
protected

Definition at line 58 of file dialog.h.


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