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

FXDialogBox.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * D i a l o g B o x *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXDialogBox.h,v 1.23 2006/01/22 17:58:00 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXDIALOGBOX_H
25 #define FXDIALOGBOX_H
26 
27 #ifndef FXTOPWINDOW_H
28 #include "FXTopWindow.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 /**
35 * DialogBox window.
36 * When receiving ID_CANCEL or ID_ACCEPT, the DialogBox breaks out of the
37 * modal loop and returns FALSE or TRUE, respectively.
38 * To close the DialogBox when not running modally, simply send it ID_HIDE.
39 */
40 class FXAPI FXDialogBox : public FXTopWindow {
42 protected:
43  FXDialogBox(){}
44 private:
45  FXDialogBox(const FXDialogBox&);
46  FXDialogBox &operator=(const FXDialogBox&);
47 public:
48  long onKeyPress(FXObject*,FXSelector,void*);
49  long onKeyRelease(FXObject*,FXSelector,void*);
50  long onCmdAccept(FXObject*,FXSelector,void*);
51  long onCmdCancel(FXObject*,FXSelector,void*);
52 public:
53  enum {
54  ID_CANCEL=FXTopWindow::ID_LAST, /// Closes the dialog, cancel the entry
55  ID_ACCEPT, /// Closes the dialog, accept the entry
56  ID_LAST
57  };
58 public:
59 
60  /// Construct free-floating dialog
61  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);
62 
63  /// Construct dialog which will always float over the owner window
64  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);
65 
66  /// Run modal invocation of the dialog
67  virtual FXuint execute(FXuint placement=PLACEMENT_CURSOR);
68  };
69 
70 }
71 
72 #endif
Definition: FXTopWindow.h:130
DialogBox window.
Definition: FXDialogBox.h:40
Base class for all windows.
Definition: FXWindow.h:115
unsigned int FXuint
Definition: fxdefs.h:396
FXuint FXSelector
Association key.
Definition: FXObject.h:53
Window title.
Definition: FXTopWindow.h:41
Border.
Definition: FXTopWindow.h:45
#define FXAPI
Definition: fxdefs.h:122
Application Object.
Definition: FXApp.h:158
FXString name(const FXString &file)
Return name and extension part of the path name.
Place it under the cursor position.
Definition: FXTopWindow.h:62
Definition: FX4Splitter.h:31
int FXint
Definition: fxdefs.h:397
Abstract base class for all top-level windows.
Definition: FXTopWindow.h:106
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92
FXString provides essential string manipulation capabilities.
Definition: FXString.h:33

Copyright © 1997-2005 Jeroen van der Zijp