FXInputDialog.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                         I n p u t   D i a l o g   B o x                       *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2000,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: FXInputDialog.h,v 1.17 2006/01/22 17:58:05 fox Exp $                     *
00023 ********************************************************************************/
00024 #ifndef FXINPUTDIALOG_H
00025 #define FXINPUTDIALOG_H
00026 
00027 #ifndef FXDIALOGBOX_H
00028 #include "FXDialogBox.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00035 enum {
00036   INPUTDIALOG_STRING   = 0,             
00037   INPUTDIALOG_INTEGER  = 0x01000000,    
00038   INPUTDIALOG_REAL     = 0x02000000,    
00039   INPUTDIALOG_PASSWORD = 0x04000000     
00040   };
00041 
00042 
00043 class FXTextField;
00044 
00045 
00051 class FXAPI FXInputDialog : public FXDialogBox {
00052   FXDECLARE(FXInputDialog)
00053 protected:
00054   FXTextField *input;       // Text field widget
00055   FXdouble     limlo;       // Lower limit
00056   FXdouble     limhi;       // Upper limit
00057 protected:
00058   FXInputDialog(){}
00059 private:
00060   FXInputDialog(const FXInputDialog&);
00061   FXInputDialog &operator=(const FXInputDialog&);
00062   void initialize(const FXString& text,FXIcon* icon);
00063 public:
00064   long onCmdAccept(FXObject*,FXSelector,void*);
00065 public:
00066 
00068   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);
00069 
00071   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);
00072 
00074   FXString getText() const;
00075 
00077   void setText(const FXString& text);
00078 
00080   void setNumColumns(FXint num);
00081 
00083   FXint getNumColumns() const;
00084 
00086   void setLimits(FXdouble lo,FXdouble hi){ limlo=lo; limhi=hi; }
00087 
00089   void getLimits(FXdouble& lo,FXdouble& hi){ lo=limlo; hi=limhi; }
00090 
00092   virtual FXuint execute(FXuint placement=PLACEMENT_CURSOR);
00093 
00098   static FXbool getString(FXString& result,FXWindow* owner,const FXString& caption,const FXString& label,FXIcon* icon=NULL);
00099 
00103   static FXbool getString(FXString& result,FXApp* app,const FXString& caption,const FXString& label,FXIcon* icon=NULL);
00104 
00110   static FXbool getInteger(FXint& result,FXWindow* owner,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXint lo=-2147483647,FXint hi=2147483647);
00111 
00115   static FXbool getInteger(FXint& result,FXApp* app,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXint lo=-2147483647,FXint hi=2147483647);
00116 
00122   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);
00123 
00127   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);
00128   };
00129 
00130 }
00131 
00132 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:22 2009 for TnFOX by doxygen v1.4.7