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

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,2004 by Charles W. Warren. 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.22 2004/02/08 17:17:34 fox Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXSHUTTER_H 00025 #define FXSHUTTER_H 00026 00027 #ifndef FXVERTICALFRAME_H 00028 #include "FXVerticalFrame.h" 00029 #endif 00030 00031 namespace FX { 00032 00033 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 FXint heightIncrement; // Height delta 00097 FXint closingHeight; // Closing items current height 00098 FXbool closingHadScrollbar; // Closing item had a scroll bar 00099 protected: 00100 FXShutter(){} 00101 private: 00102 FXShutter(const FXShutter&); 00103 FXShutter &operator=(const FXShutter&); 00104 public: 00105 long onFocusUp(FXObject*,FXSelector,void*); 00106 long onFocusDown(FXObject*,FXSelector,void*); 00107 long onTimeout(FXObject*,FXSelector,void*); 00108 long onOpenItem(FXObject*,FXSelector,void*); 00109 long onCmdSetValue(FXObject*,FXSelector,void*); 00110 long onCmdSetIntValue(FXObject*,FXSelector,void*); 00111 long onCmdGetIntValue(FXObject*,FXSelector,void*); 00112 long onCmdOpen(FXObject*,FXSelector,void*); 00113 long onUpdOpen(FXObject*,FXSelector,void*); 00114 public: 00115 enum{ 00116 ID_SHUTTER_TIMEOUT=FXVerticalFrame::ID_LAST, 00117 ID_OPEN_SHUTTERITEM, 00118 ID_OPEN_FIRST, 00119 ID_OPEN_LAST=ID_OPEN_FIRST+1000, 00120 ID_LAST 00121 }; 00122 public: 00123 00124 /// Constructor 00125 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); 00126 00127 /// Perform layout 00128 virtual void layout(); 00129 00130 /// Set the currently displayed item (panel = 0, 1, 2, ..., npanels-1) 00131 virtual void setCurrent(FXint panel); 00132 00133 /// Return the index of the currently displayed item 00134 FXint getCurrent() const { return current; } 00135 00136 /// Destructor 00137 virtual ~FXShutter(); 00138 }; 00139 00140 } 00141 00142 #endif

Copyright © 1997-2004 Jeroen van der Zijp