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

FXShutter.h
1 /********************************************************************************
2 * *
3 * S h u t t e r C o n t a i n e r W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1998,2017 by Charles W. Warren. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXSHUTTER_H
22 #define FXSHUTTER_H
23 
24 #ifndef FXVERTICALFRAME_H
25 #include "FXVerticalFrame.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 class FXShutter;
32 class FXButton;
33 class FXScrollWindow;
34 class FXShutterItem;
35 
36 
43 class FXAPI FXShutterItem : public FXVerticalFrame {
44  FXDECLARE(FXShutterItem)
45 protected:
46  FXButton *button;
47  FXScrollWindow *scrollWindow;
48  FXVerticalFrame *content;
49 protected:
50  FXShutterItem();
51 private:
53  FXShutterItem &operator=(const FXShutterItem&);
54 public:
55  long onFocusUp(FXObject*,FXSelector,void*);
56  long onFocusDown(FXObject*,FXSelector,void*);
57  long onCmdButton(FXObject*,FXSelector,void*);
58 public:
59  enum{
60  ID_SHUTTERITEM_BUTTON=FXVerticalFrame::ID_LAST,
61  ID_LAST
62  };
63 public:
64 
66  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);
67 
69  FXScrollWindow* getScrollWindow() const { return scrollWindow; }
70 
72  FXButton* getButton() const { return button; }
73 
75  FXVerticalFrame* getContent() const { return content; }
76 
78  void setHelpText(const FXString& text);
79 
81  FXString getHelpText() const;
82 
84  void setTipText(const FXString& text);
85 
87  FXString getTipText() const;
88 
90  virtual void save(FXStream& store) const;
91 
93  virtual void load(FXStream& store);
94 
96  virtual ~FXShutterItem();
97  };
98 
99 
105 class FXAPI FXShutter : public FXVerticalFrame {
106  FXDECLARE(FXShutter)
107 protected:
108  FXint current; // Item currently open
109  FXint closing; // Item closing down
110  FXint closingHeight; // Height of closing item
111  FXint heightIncrement; // Height delta
112 protected:
113  FXShutter();
114 private:
115  FXShutter(const FXShutter&);
116  FXShutter &operator=(const FXShutter&);
117 public:
118  long onFocusUp(FXObject*,FXSelector,void*);
119  long onFocusDown(FXObject*,FXSelector,void*);
120  long onTimeout(FXObject*,FXSelector,void*);
121  long onOpenItem(FXObject*,FXSelector,void*);
122  long onCmdSetValue(FXObject*,FXSelector,void*);
123  long onCmdSetIntValue(FXObject*,FXSelector,void*);
124  long onCmdGetIntValue(FXObject*,FXSelector,void*);
125  long onCmdOpen(FXObject*,FXSelector,void*);
126  long onUpdOpen(FXObject*,FXSelector,void*);
127 public:
128  enum{
129  ID_SHUTTER_TIMEOUT=FXVerticalFrame::ID_LAST,
130  ID_OPEN_SHUTTERITEM,
131  ID_OPEN_FIRST,
132  ID_OPEN_SECOND,
133  ID_OPEN_THIRD,
134  ID_OPEN_FOURTH,
135  ID_OPEN_FIFTH,
136  ID_OPEN_SIXTH,
137  ID_OPEN_SEVENTH,
138  ID_OPEN_EIGHTH,
139  ID_OPEN_NINETH,
140  ID_OPEN_TENTH,
141  ID_OPEN_LAST=ID_OPEN_FIRST+100,
142  ID_LAST
143  };
144 public:
145 
147  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);
148 
150  virtual void layout();
151 
153  virtual void setCurrent(FXint panel,FXbool notify=false);
154 
156  FXint getCurrent() const { return current; }
157 
159  virtual void save(FXStream& store) const;
160 
162  virtual void load(FXStream& store);
163 
165  virtual ~FXShutter();
166  };
167 
168 }
169 
170 #endif

Copyright © 1997-2016 Jeroen van der Zijp