Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXDialogBox.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                              D i a l o g   B o x                              *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1998,2009 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 *********************************************************************************
00021 * $Id: FXDialogBox.h,v 1.28 2009/01/06 13:07:22 fox Exp $                       *
00022 ********************************************************************************/
00023 #ifndef FXDIALOGBOX_H
00024 #define FXDIALOGBOX_H
00025 
00026 #ifndef FXTOPWINDOW_H
00027 #include "FXTopWindow.h"
00028 #endif
00029 
00030 namespace FX {
00031 
00032 
00033 /**
00034 * DialogBox window.
00035 * When receiving ID_CANCEL or ID_ACCEPT, the DialogBox breaks out of the
00036 * modal loop and returns false or true, respectively.
00037 * To close the DialogBox when not running modally, simply send it ID_HIDE.
00038 */
00039 class FXAPI FXDialogBox : public FXTopWindow {
00040   FXDECLARE(FXDialogBox)
00041 protected:
00042   FXDialogBox(){}
00043 private:
00044   FXDialogBox(const FXDialogBox&);
00045   FXDialogBox &operator=(const FXDialogBox&);
00046 public:
00047   long onKeyPress(FXObject*,FXSelector,void*);
00048   long onKeyRelease(FXObject*,FXSelector,void*);
00049   long onCmdAccept(FXObject*,FXSelector,void*);
00050   long onCmdCancel(FXObject*,FXSelector,void*);
00051 public:
00052   enum {
00053     ID_CANCEL=FXTopWindow::ID_LAST,     /// Closes the dialog, cancel the entry
00054     ID_ACCEPT,                          /// Closes the dialog, accept the entry
00055     ID_LAST
00056     };
00057 public:
00058 
00059   /// Construct free-floating dialog
00060   FXDialogBox(FXApp* a,const FXString& name,FXuint opts=DECOR_TITLE|DECOR_BORDER,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=10,FXint pr=10,FXint pt=10,FXint pb=10,FXint hs=4,FXint vs=4);
00061 
00062   /// Construct dialog which will always float over the owner window
00063   FXDialogBox(FXWindow* owner,const FXString& name,FXuint opts=DECOR_TITLE|DECOR_BORDER,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=10,FXint pr=10,FXint pt=10,FXint pb=10,FXint hs=4,FXint vs=4);
00064 
00065   /// Run modal invocation of the dialog
00066   virtual FXuint execute(FXuint placement=PLACEMENT_CURSOR);
00067   };
00068 
00069 }
00070 
00071 #endif

Copyright © 1997-2009 Jeroen van der Zijp