Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

wftk::Dialog Class Reference

Dialog. More...

#include <dialog.h>

Inheritance diagram for wftk::Dialog:

wftk::SingleContainer wftk::Widget wftk::ScreenArea wftk::BorderedDialog wftk::FixedDialog wftk::FullScreenDialog wftk::MessageDialog wftk::ProgressDialog wftk::QuestionBox List of all members.

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

DialoggetTop ()
 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

Detailed Description

Dialog.

A class for dialog-type windows

At creation Dialog is hidden. Call exec() to popup the dialog.


Member Function Documentation

void wftk::Dialog::exec ScreenArea root,
bool  blocking,
bool  modal
 

run the dialog window

Parameters:
root the ScreenArea that this window is subordinate to. Will take the root window per default
blocking whether the exec() will block until the dialog closes
whether this dialog will block input going to other widgets. If more than one modal dialog exists, the last created one is the only one that can receive input. 'modal' defaults to true if 'root' is null, false otherwise.
A blocking exec() will increase the dialog's refcount by 1. This is so we can support two paradigms of dialog calls.

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.

Dialog* wftk::Dialog::getTop  )  [inline, static]
 

make sure only the top modal dialog gets mouse clicks

Returns:
the dialog that is on top ?


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

Generated Mon Sep 6 21:58:16 2004.
Copyright © 1998-2003 by the respective authors.

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.