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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXInputDialog.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                         I n p u t   D i a l o g   B o x                       *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2000,2012 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 #ifndef FXINPUTDIALOG_H
00022 #define FXINPUTDIALOG_H
00023 
00024 #ifndef FXDIALOGBOX_H
00025 #include "FXDialogBox.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00032 enum {
00033   INPUTDIALOG_STRING   = 0,             
00034   INPUTDIALOG_INTEGER  = 0x02000000,    
00035   INPUTDIALOG_REAL     = 0x04000000,    
00036   INPUTDIALOG_PASSWORD = 0x08000000     
00037   };
00038 
00039 
00040 class FXTextField;
00041 
00042 
00048 class FXAPI FXInputDialog : public FXDialogBox {
00049   FXDECLARE(FXInputDialog)
00050 protected:
00051   FXTextField *input;       // Text field widget
00052   FXdouble     limlo;       // Lower limit
00053   FXdouble     limhi;       // Upper limit
00054 protected:
00055   FXInputDialog(){}
00056 private:
00057   FXInputDialog(const FXInputDialog&);
00058   FXInputDialog &operator=(const FXInputDialog&);
00059   virtual void initialize(const FXString& text,FXIcon* icon);
00060 public:
00061   long onCmdAccept(FXObject*,FXSelector,void*);
00062 public:
00063 
00065   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);
00066 
00068   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);
00069 
00071   FXString getText() const;
00072 
00074   void setText(const FXString& text);
00075 
00077   void setNumColumns(FXint num);
00078 
00080   FXint getNumColumns() const;
00081 
00083   void setLimits(FXdouble lo,FXdouble hi){ limlo=lo; limhi=hi; }
00084 
00086   void getLimits(FXdouble& lo,FXdouble& hi){ lo=limlo; hi=limhi; }
00087 
00089   virtual FXuint execute(FXuint placement=PLACEMENT_CURSOR);
00090 
00095   static FXbool getString(FXString& result,FXWindow* owner,const FXString& caption,const FXString& label,FXIcon* icon=NULL);
00096 
00100   static FXbool getString(FXString& result,FXApp* app,const FXString& caption,const FXString& label,FXIcon* icon=NULL);
00101 
00107   static FXbool getInteger(FXint& result,FXWindow* owner,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXint lo=-2147483647,FXint hi=2147483647);
00108 
00112   static FXbool getInteger(FXint& result,FXApp* app,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXint lo=-2147483647,FXint hi=2147483647);
00113 
00119   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);
00120 
00124   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);
00125   };
00126 
00127 }
00128 
00129 #endif

Copyright © 1997-2011 Jeroen van der Zijp