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

FXdbNavigator.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                      Simple db navigator 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 FXDBNAVIGATOR_H
00023 #define FXDBNAVIGATOR_H
00024 
00025 #ifndef FXVERTICALFRAME_H
00026 #include <fox/FXVerticalFrame.h>
00027 #endif
00028 namespace FXEX {
00029 class FXDatabaseQuery;
00030 
00031 class FXAPI FXdbNavigator: public FXVerticalFrame {
00032   FXDECLARE(FXdbNavigator)
00033 
00034 private:
00035   FXMatrix *mtx;
00036     FXButton *bFirst;
00037     FXButton *bPrev;
00038     FXButton *bTo;
00039     FXButton *bNext;
00040     FXButton *bLst;
00041     FXButton *bAdd;
00042     FXButton *bEdit;
00043     FXButton *bDel;
00044     FXButton *bOk;
00045     FXButton *bCanc;
00046   FXDatabaseQuery *dbq;
00047 protected:
00048   FXdbNavigator() {}
00049   void setEditMode(FXbool mode);
00050 public:
00051   enum {
00052     ID_FIRST = FXVerticalFrame::ID_LAST,
00053     ID_PREV,
00054     ID_TO,
00055     ID_NEXT,
00056     ID_LST,
00057     ID_ADD,
00058     ID_EDIT,
00059     ID_DEL,
00060     ID_OK,
00061     ID_CANC,
00062     ID_DBQUERY,
00063     ID_LAST
00064   };
00065   long onFirst(FXObject *, FXSelector, void *);
00066   long onPrev(FXObject *, FXSelector, void *);
00067   long onTo(FXObject *, FXSelector, void *);
00068   long onNext(FXObject *, FXSelector, void *);
00069   long onLst(FXObject *, FXSelector, void *);
00070   long onAdd(FXObject *, FXSelector, void *);
00071   long onEdit(FXObject *, FXSelector, void *);
00072   long onDel(FXObject *, FXSelector, void *);
00073   long onOk(FXObject *, FXSelector, void *);
00074   long onCanc(FXObject *, FXSelector, void *);
00075   long onDBQuery(FXObject *, FXSelector, void *);
00076 public:
00077   FXdbNavigator(FXComposite *p, FXDatabaseQuery *dbq);
00078   virtual void create();
00079   virtual ~FXdbNavigator() {}
00080   void setQuery(FXDatabaseQuery *dbq);
00081   FXDatabaseQuery *getQuery() const { return dbq; }
00082 };
00083 
00084 }
00085 #endif /* FXDBNAVIGATOR_H */