#include <dialog.h>
Inheritance diagram for wftk::Dialog:
Public Member Functions | |
Dialog () | |
Create a dialog. | |
void | exec (ScreenArea *root, bool blocking, bool modal) |
run the dialog window | |
void | exec (ScreenArea *root=0, bool blocking=false) |
This version is only here to make 'modal' default to 'root == 0'. | |
void | close () |
Forcibly close this dialog. | |
bool | isOpen () |
Returns true if the dialog is visible. | |
Static Public Member Functions | |
Dialog * | getTop () |
make sure only the top modal dialog gets mouse clicks | |
Public Attributes | |
SigC::Signal0< void > | done |
signal sent when dialog is closed | |
Protected Member Functions | |
virtual void | packingUpdateParent () |
Toss packing call upwards to parent. | |
virtual bool | buttonEvent (Mouse::Button, bool pressed, const Point &) |
we don't want this propagating out of the dialog |
A class for dialog-type windows
At creation Dialog is hidden. Call exec() to popup the dialog.
|
run the dialog window
For non-blocking calls: (new MyDialog())->exec(); In this case, the dialog is created with a floating reference. The exec() call places the dialog in a parent window (the root window by default), which bumps the refcount and drops the floating reference. When the dialog is closed, it is removed from its parent window, its refcount drops, and it is deleted. For blocking calls: MyDialog dialog; dialog.exec(0, true); We never want to delete this dialog, since it's declared on the stack. The exec() call bumps its refcount by one, so even after the dialog closes and exec() exits it still has a nonzero refcount. With no additional intervention, the dialog will live until it goes out of scope. For more complicated situations, the user can make appropriate ref() and unref() calls to get the desired dialog behavior. A dialog will also play the "open" and "close" named Sample resources when it is opened and closed. |
|
make sure only the top modal dialog gets mouse clicks
|
This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.