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

dialog.h

00001 /*
00002   libwftk - Worldforge Toolkit - a widget library
00003   Copyright (C) 2002 Malcolm Walker <malcolm@worldforge.org>
00004   Based on code copyright  (C) 1999-2002  Karsten Laux
00005 
00006   This library is free software; you can redistribute it and/or
00007   modify it under the terms of the GNU Lesser General Public
00008   License as published by the Free Software Foundation; either
00009   version 2.1 of the License, or (at your option) any later version.
00010   
00011   This library is distributed in the hope that it will be useful,
00012   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014   Lesser General Public License for more details.
00015   
00016   You should have received a copy of the GNU Lesser General Public
00017   License along with this library; if not, write to the
00018   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019   Boston, MA  02111-1307, SA.
00020 */
00021 
00022 #ifndef _DIALOG_H
00023 #define _DIALOG_H
00024 
00025 #include <wftk/singlecontainer.h>
00026 #include <list>
00027 
00028 namespace wftk {
00029 
00035 class Dialog : public SingleContainer
00036 {
00037 
00038  public:
00040   Dialog();
00041   virtual ~Dialog();
00042 
00044   SigC::Signal0<void> done;
00045 
00085   void exec(ScreenArea* root, bool blocking, bool modal);
00087 
00090   void exec(ScreenArea* root = 0, bool blocking = false)
00091     {exec(root, blocking, root == 0);}
00092 
00094   void close();
00095 
00097   bool isOpen() {return open_;}
00098 
00103   static Dialog* getTop() {return !highest_.empty() ? highest_.front() : 0;}
00104 
00105  protected:
00107   virtual void packingUpdateParent();
00109   virtual bool buttonEvent(Mouse::Button, bool pressed, const Point&) {return true;}
00110  private:
00112   bool open_;
00114   ScreenArea* root_;
00116   typedef std::list<Dialog*> HighStack;
00118   static HighStack highest_;
00119 };
00120 
00121 
00122 } // namespace wftk
00123 
00124 #endif // !_DIALOG

Generated Tue Oct 26 19:02:12 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.