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,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (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 GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXDialogBox.h,v 1.23 2006/01/22 17:58:00 fox Exp $                       *
00023 ********************************************************************************/
00024 #ifndef FXDIALOGBOX_H
00025 #define FXDIALOGBOX_H
00026 
00027 #ifndef FXTOPWINDOW_H
00028 #include "FXTopWindow.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00034 /**
00035 * DialogBox window.
00036 * When receiving ID_CANCEL or ID_ACCEPT, the DialogBox breaks out of the
00037 * modal loop and returns FALSE or TRUE, respectively.
00038 * To close the DialogBox when not running modally, simply send it ID_HIDE.
00039 */
00040 class FXAPI FXDialogBox : public FXTopWindow {
00041   FXDECLARE(FXDialogBox)
00042 protected:
00043   FXDialogBox(){}
00044 private:
00045   FXDialogBox(const FXDialogBox&);
00046   FXDialogBox &operator=(const FXDialogBox&);
00047 public:
00048   long onKeyPress(FXObject*,FXSelector,void*);
00049   long onKeyRelease(FXObject*,FXSelector,void*);
00050   long onCmdAccept(FXObject*,FXSelector,void*);
00051   long onCmdCancel(FXObject*,FXSelector,void*);
00052 public:
00053   enum {
00054     ID_CANCEL=FXTopWindow::ID_LAST,     /// Closes the dialog, cancel the entry
00055     ID_ACCEPT,                          /// Closes the dialog, accept the entry
00056     ID_LAST
00057     };
00058 public:
00059 
00060   /// Construct free-floating dialog
00061   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);
00062 
00063   /// Construct dialog which will always float over the owner window
00064   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);
00065 
00066   /// Run modal invocation of the dialog
00067   virtual FXuint execute(FXuint placement=PLACEMENT_CURSOR);
00068   };
00069 
00070 }
00071 
00072 #endif

Copyright © 1997-2005 Jeroen van der Zijp