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

FXInputDialog.h
1 /********************************************************************************
2 * *
3 * I n p u t D i a l o g B o x *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2000,2017 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (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 *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXINPUTDIALOG_H
22 #define FXINPUTDIALOG_H
23 
24 #ifndef FXDIALOGBOX_H
25 #include "FXDialogBox.h"
26 #endif
27 
28 namespace FX {
29 
30 
32 enum {
33  INPUTDIALOG_STRING = 0,
34  INPUTDIALOG_INTEGER = 0x02000000,
35  INPUTDIALOG_REAL = 0x04000000,
36  INPUTDIALOG_PASSWORD = 0x08000000
37  };
38 
39 
40 class FXTextField;
41 
42 
48 class FXAPI FXInputDialog : public FXDialogBox {
49  FXDECLARE(FXInputDialog)
50 protected:
51  FXTextField *input; // Text field widget
52  FXdouble limlo; // Lower limit
53  FXdouble limhi; // Upper limit
54 protected:
55  FXInputDialog(){}
56 private:
58  FXInputDialog &operator=(const FXInputDialog&);
59  virtual void initialize(const FXString& text,FXIcon* icon);
60 public:
61  long onCmdAccept(FXObject*,FXSelector,void*);
62 public:
63 
65  FXInputDialog(FXWindow* owner,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXuint opts=INPUTDIALOG_STRING,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
66 
68  FXInputDialog(FXApp* app,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXuint opts=INPUTDIALOG_STRING,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
69 
71  FXString getText() const;
72 
74  void setText(const FXString& text);
75 
77  void setNumColumns(FXint num);
78 
80  FXint getNumColumns() const;
81 
83  void setLimits(FXdouble lo,FXdouble hi){ limlo=lo; limhi=hi; }
84 
86  void getLimits(FXdouble& lo,FXdouble& hi){ lo=limlo; hi=limhi; }
87 
89  virtual FXuint execute(FXuint placement=PLACEMENT_CURSOR);
90 
95  static FXbool getString(FXString& result,FXWindow* owner,const FXString& caption,const FXString& label,FXIcon* icon=NULL);
96 
100  static FXbool getString(FXString& result,FXApp* app,const FXString& caption,const FXString& label,FXIcon* icon=NULL);
101 
107  static FXbool getInteger(FXint& result,FXWindow* owner,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXint lo=-2147483647,FXint hi=2147483647);
108 
112  static FXbool getInteger(FXint& result,FXApp* app,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXint lo=-2147483647,FXint hi=2147483647);
113 
119  static FXbool getReal(FXdouble& result,FXWindow* owner,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXdouble lo=-1.797693134862315e+308,FXdouble hi=1.797693134862315e+308);
120 
124  static FXbool getReal(FXdouble& result,FXApp* app,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXdouble lo=-1.797693134862315e+308,FXdouble hi=1.797693134862315e+308);
125  };
126 
127 }
128 
129 #endif

Copyright © 1997-2016 Jeroen van der Zijp