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 override
 
void releaseFocus () override
 
void setFocusWidget (Widget *widget)
 
WidgetgetFocusWidget ()
 
void setTickleWidget (Widget *widget)
 
void unSetTickleWidget ()
 
WidgetgetTickleWidget ()
 
void reflowLayout () override
 
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 () override
 
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 handleOtherEvent (const Common::Event &evt)
 
void handleCommand (CommandSender *sender, uint32 cmd, uint32 data) override
 
WidgetfindWidget (int x, int y)
 
WidgetfindWidget (const char *name)
 
void removeWidget (Widget *widget) override
 
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 Scumm::ValueDisplayDialog, GUI::ConsoleDialog, GUI::PopUpDialog, GUI::AboutDialog, and GUI::Tooltip.

Definition at line 165 of file dialog.cpp.

◆ drawWidgets()

void GUI::Dialog::drawWidgets ( )
protected

Draw only the dialog's widgets.

Definition at line 178 of file dialog.cpp.

◆ findWidget() [1/2]

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

Definition at line 374 of file dialog.cpp.

◆ findWidget() [2/2]

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

Definition at line 370 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::PopUpDialog, GUI::Tooltip, and GUI::OnScreenDialog.

Definition at line 295 of file dialog.cpp.

◆ handleMouseUp()

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

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

Definition at line 210 of file dialog.cpp.

◆ handleMouseWheel()

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

◆ handleOtherEvent()

virtual void GUI::Dialog::handleOtherEvent ( const Common::Event evt)
inlineprotectedvirtual

Reimplemented in GUI::LauncherDialog.

Definition at line 106 of file dialog.h.

◆ handleTickle()

◆ isVisible()

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

Implements GUI::GuiObject.

Reimplemented in GUI::OnScreenDialog.

Definition at line 71 of file dialog.h.

◆ lostFocus()

void GUI::Dialog::lostFocus ( )
virtual

Definition at line 120 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 157 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 ( )
overridevirtual

Implements GUI::GuiObject.

Reimplemented in GUI::OnScreenDialog.

Definition at line 150 of file dialog.cpp.

◆ removeWidget()

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

Reimplemented from GUI::GuiObject.

Definition at line 378 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 140 of file dialog.cpp.

◆ setFocusWidget()

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

Definition at line 128 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: