![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
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,2002 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: FXShutter.h,v 1.15 2002/01/18 22:42:54 jeroen Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXSHUTTER_H 00025 #define FXSHUTTER_H 00026 00027 #ifndef FXVERTICALFRAME_H 00028 #include "FXVerticalFrame.h" 00029 #endif 00030 00031 00032 00033 struct FXTimer; 00034 class FXShutter; 00035 class FXButton; 00036 class FXScrollWindow; 00037 class FXShutterItem; 00038 00039 00040 /// Shutter Control 00041 class FXAPI FXShutterItem : public FXVerticalFrame { 00042 FXDECLARE(FXShutterItem) 00043 friend class FXShutter; 00044 protected: 00045 FXButton *button; 00046 FXScrollWindow *scrollWindow; 00047 FXVerticalFrame *content; 00048 protected: 00049 FXShutterItem(){} 00050 private: 00051 FXShutterItem(const FXShutterItem&); 00052 FXShutterItem &operator=(const FXShutterItem&); 00053 public: 00054 long onFocusUp(FXObject*,FXSelector,void*); 00055 long onFocusDown(FXObject*,FXSelector,void*); 00056 long onCmdButton(FXObject*,FXSelector,void*); 00057 public: 00058 enum{ 00059 ID_SHUTTERITEM_BUTTON=FXVerticalFrame::ID_LAST, 00060 ID_LAST 00061 }; 00062 public: 00063 /// Constructor 00064 FXShutterItem(FXShutter *p,const FXString& text=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); 00065 00066 /// Return a pointer to the button for this item 00067 FXButton* getButton() const { return button; } 00068 00069 /// Return a pointer to the contents for this item 00070 FXVerticalFrame* getContent() const { return content; } 00071 00072 /// Set the status line help text for this item 00073 void setHelpText(const FXString& text); 00074 00075 /// Get the status line help text for this item 00076 FXString getHelpText() const; 00077 00078 /// Set the tool tip message for this item 00079 void setTipText(const FXString& text); 00080 00081 /// Get the tool tip message for this item 00082 FXString getTipText() const; 00083 00084 /// Destructor 00085 virtual ~FXShutterItem(); 00086 }; 00087 00088 00089 /// Shutter Control 00090 class FXAPI FXShutter : public FXVerticalFrame { 00091 FXDECLARE(FXShutter) 00092 friend class FXShutterItem; 00093 protected: 00094 FXint current; // Item currently open 00095 FXint closing; // Item closing down 00096 FXTimer *timer; // Timer for animation 00097 FXint heightIncrement; // Height delta 00098 FXint closingHeight; // Closing items current height 00099 FXbool closingHadScrollbar; // Closing item had a scroll bar 00100 protected: 00101 FXShutter(){} 00102 virtual void layout(); 00103 private: 00104 FXShutter(const FXShutter&); 00105 FXShutter &operator=(const FXShutter&); 00106 public: 00107 long onFocusUp(FXObject*,FXSelector,void*); 00108 long onFocusDown(FXObject*,FXSelector,void*); 00109 long onTimeout(FXObject*,FXSelector,void*); 00110 long onOpenItem(FXObject*,FXSelector,void*); 00111 long onCmdSetValue(FXObject*,FXSelector,void*); 00112 long onCmdSetIntValue(FXObject*,FXSelector,void*); 00113 long onCmdGetIntValue(FXObject*,FXSelector,void*); 00114 long onCmdOpen(FXObject*,FXSelector,void*); 00115 long onUpdOpen(FXObject*,FXSelector,void*); 00116 public: 00117 enum{ 00118 ID_SHUTTER_TIMEOUT=FXVerticalFrame::ID_LAST, 00119 ID_OPEN_SHUTTERITEM, 00120 ID_OPEN_FIRST, 00121 ID_OPEN_LAST=ID_OPEN_FIRST+1000, 00122 ID_LAST 00123 }; 00124 public: 00125 /// Constructor 00126 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); 00127 00128 /// Set the currently displayed item (panel = 0, 1, 2, ..., npanels-1) 00129 virtual void setCurrent(FXint panel); 00130 00131 /// Return the index of the currently displayed item 00132 FXint getCurrent() const { return current; } 00133 00134 /// Destructor 00135 virtual ~FXShutter(); 00136 }; 00137 00138 00139 #endif