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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXShutter.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                 S h u t t e r   C o n t a i n e r   W i d g e t               *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1998,2012 by Charles W. Warren.   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 FXSHUTTER_H
00022 #define FXSHUTTER_H
00023 
00024 #ifndef FXVERTICALFRAME_H
00025 #include "FXVerticalFrame.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00031 class FXShutter;
00032 class FXButton;
00033 class FXScrollWindow;
00034 class FXShutterItem;
00035 
00036 
00043 class FXAPI FXShutterItem : public FXVerticalFrame {
00044   FXDECLARE(FXShutterItem)
00045 protected:
00046   FXButton         *button;
00047   FXScrollWindow   *scrollWindow;
00048   FXVerticalFrame  *content;
00049 protected:
00050   FXShutterItem();
00051 private:
00052   FXShutterItem(const FXShutterItem&);
00053   FXShutterItem &operator=(const FXShutterItem&);
00054 public:
00055   long onFocusUp(FXObject*,FXSelector,void*);
00056   long onFocusDown(FXObject*,FXSelector,void*);
00057   long onCmdButton(FXObject*,FXSelector,void*);
00058 public:
00059   enum{
00060     ID_SHUTTERITEM_BUTTON=FXVerticalFrame::ID_LAST,
00061     ID_LAST
00062     };
00063 public:
00064 
00066   FXShutterItem(FXShutter *p,const FXString& text=FXString::null,FXIcon* icon=NULL,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
00067 
00069   FXScrollWindow* getScrollWindow() const { return scrollWindow; }
00070 
00072   FXButton* getButton() const { return button; }
00073 
00075   FXVerticalFrame* getContent() const { return content; }
00076 
00078   void setHelpText(const FXString& text);
00079 
00081   FXString getHelpText() const;
00082 
00084   void setTipText(const FXString&  text);
00085 
00087   FXString getTipText() const;
00088 
00090   virtual void save(FXStream& store) const;
00091 
00093   virtual void load(FXStream& store);
00094 
00096   virtual ~FXShutterItem();
00097   };
00098 
00099 
00105 class FXAPI FXShutter : public FXVerticalFrame {
00106   FXDECLARE(FXShutter)
00107 protected:
00108   FXint   current;              // Item currently open
00109   FXint   closing;              // Item closing down
00110   FXint   closingHeight;        // Height of closing item
00111   FXint   heightIncrement;      // Height delta
00112 protected:
00113   FXShutter();
00114 private:
00115   FXShutter(const FXShutter&);
00116   FXShutter &operator=(const FXShutter&);
00117 public:
00118   long onFocusUp(FXObject*,FXSelector,void*);
00119   long onFocusDown(FXObject*,FXSelector,void*);
00120   long onTimeout(FXObject*,FXSelector,void*);
00121   long onOpenItem(FXObject*,FXSelector,void*);
00122   long onCmdSetValue(FXObject*,FXSelector,void*);
00123   long onCmdSetIntValue(FXObject*,FXSelector,void*);
00124   long onCmdGetIntValue(FXObject*,FXSelector,void*);
00125   long onCmdOpen(FXObject*,FXSelector,void*);
00126   long onUpdOpen(FXObject*,FXSelector,void*);
00127 public:
00128   enum{
00129     ID_SHUTTER_TIMEOUT=FXVerticalFrame::ID_LAST,
00130     ID_OPEN_SHUTTERITEM,
00131     ID_OPEN_FIRST,
00132     ID_OPEN_SECOND,
00133     ID_OPEN_THIRD,
00134     ID_OPEN_FOURTH,
00135     ID_OPEN_FIFTH,
00136     ID_OPEN_SIXTH,
00137     ID_OPEN_SEVENTH,
00138     ID_OPEN_EIGHTH,
00139     ID_OPEN_NINETH,
00140     ID_OPEN_TENTH,
00141     ID_OPEN_LAST=ID_OPEN_FIRST+100,
00142     ID_LAST
00143     };
00144 public:
00145 
00147   FXShutter(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
00148 
00150   virtual void layout();
00151 
00153   virtual void setCurrent(FXint panel,FXbool notify=false);
00154 
00156   FXint getCurrent() const { return current; }
00157 
00159   virtual void save(FXStream& store) const;
00160 
00162   virtual void load(FXStream& store);
00163 
00165   virtual ~FXShutter();
00166   };
00167 
00168 }
00169 
00170 #endif

Copyright © 1997-2011 Jeroen van der Zijp