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

FXdbTextField.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                            db text field control                              *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2003 by Giancarlo Formicuccia.  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 #ifndef FXDBTEXTFIELD_H
00023 #define FXDBTEXTFIELD_H
00024 
00025 #ifndef FXTEXTFIELD_H
00026 #include <fox/FXTextField.h>
00027 #endif
00028 namespace FXEX {
00029 class FXDatabaseField;
00030 class FXDatabaseQuery;
00031 
00032 class FXAPI FXdbTextField: public FXTextField {
00033   FXDECLARE(FXdbTextField)
00034 private:
00035   FXbool forceReadOnly;
00036   FXbool virtuallyEditable;
00037   FXDatabaseField *dbf;
00038   FXDatabaseQuery *dbq;
00039 protected:
00040   FXdbTextField() {}
00041 public:
00042   enum {
00043     ID_DBFIELD = FXTextField::ID_LAST,
00044     ID_LAST
00045   };
00046   long onDBField(FXObject *, FXSelector, void *);
00047 public:
00048   FXdbTextField(FXComposite* p,FXint ncols,FXObject* tgt=NULL,FXSelector sel=0,
00049     FXuint opts=TEXTFIELD_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,
00050     FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
00051   virtual ~FXdbTextField();
00052   virtual void create();
00053   void setEditable(FXbool edit=TRUE);
00054   void setText(const FXString &text);
00055 
00056   void bindTo(FXDatabaseQuery *dbq, const FXString &col);
00057   void bindTo(FXDatabaseQuery *dbq, FXint col);
00058 };
00059 
00060 }
00061 
00062 #endif /* FXDBTEXTFIELD_H */