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,2024 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=nullptr,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 setText(const FXString& text);
79 
81  FXString getText() const;
82 
84  void setIcon(FXIcon* ic);
85 
87  FXIcon* getIcon() const;
88 
90  void setFont(FXFont *fnt);
91 
93  FXFont* getFont() const;
94 
96  void setJustify(FXuint mode);
97 
99  FXuint getJustify() const;
100 
102  void setIconPosition(FXuint mode);
103 
105  FXuint getIconPosition() const;
106 
108  void setHelpText(const FXString& text);
109 
111  FXString getHelpText() const;
112 
114  void setTipText(const FXString& text);
115 
117  FXString getTipText() const;
118 
120  virtual void save(FXStream& store) const;
121 
123  virtual void load(FXStream& store);
124 
126  virtual ~FXShutterItem();
127  };
128 
129 
135 class FXAPI FXShutter : public FXVerticalFrame {
136  FXDECLARE(FXShutter)
137 protected:
138  FXint current; // Item currently open
139  FXint closing; // Item closing down
140  FXint closingHeight; // Height of closing item
141  FXint heightIncrement; // Height delta
142 protected:
143  FXShutter();
144 private:
145  FXShutter(const FXShutter&);
146  FXShutter &operator=(const FXShutter&);
147 public:
148  long onFocusUp(FXObject*,FXSelector,void*);
149  long onFocusDown(FXObject*,FXSelector,void*);
150  long onTimeout(FXObject*,FXSelector,void*);
151  long onOpenItem(FXObject*,FXSelector,void*);
152  long onCmdSetValue(FXObject*,FXSelector,void*);
153  long onCmdSetIntValue(FXObject*,FXSelector,void*);
154  long onCmdGetIntValue(FXObject*,FXSelector,void*);
155  long onCmdOpen(FXObject*,FXSelector,void*);
156  long onUpdOpen(FXObject*,FXSelector,void*);
157 public:
158  enum{
159  ID_SHUTTER_TIMEOUT=FXVerticalFrame::ID_LAST,
160  ID_OPEN_SHUTTERITEM,
161  ID_OPEN_FIRST,
162  ID_OPEN_SECOND,
163  ID_OPEN_THIRD,
164  ID_OPEN_FOURTH,
165  ID_OPEN_FIFTH,
166  ID_OPEN_SIXTH,
167  ID_OPEN_SEVENTH,
168  ID_OPEN_EIGHTH,
169  ID_OPEN_NINETH,
170  ID_OPEN_TENTH,
171  ID_OPEN_LAST=ID_OPEN_FIRST+100,
172  ID_LAST
173  };
174 public:
175 
177  FXShutter(FXComposite *p,FXObject* tgt=nullptr,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);
178 
180  virtual void layout();
181 
183  virtual void setCurrent(FXint panel,FXbool notify=false);
184 
186  FXint getCurrent() const { return current; }
187 
189  virtual void save(FXStream& store) const;
190 
192  virtual void load(FXStream& store);
193 
195  virtual ~FXShutter();
196  };
197 
198 }
199 
200 #endif
FXScrollWindow * getScrollWindow() const
Return a pointer to the scroll window.
Definition: FXShutter.h:69
The Shutter widget provides a set of foldable sub panels.
Definition: FXShutter.h:135
A Shutter Item is a panel which is embedded inside a Shutter Widget.
Definition: FXShutter.h:43
FXVerticalFrame * getContent() const
Return a pointer to the contents for this item.
Definition: FXShutter.h:75
A button provides a push button, with optional icon and/or text label.
Definition: FXButton.h:70
The ScrollWindow widget manages one single child window and scrolls it when the child is larger than ...
Definition: FXScrollWindow.h:50
Base composite.
Definition: FXComposite.h:32
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
Vertical frame layout manager widget is used to automatically place child-windows vertically from top...
Definition: FXVerticalFrame.h:36
Definition: FX4Splitter.h:28
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:42
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134
FXint getCurrent() const
Return the index of the currently displayed item.
Definition: FXShutter.h:186
Font class.
Definition: FXFont.h:137
FXButton * getButton() const
Return a pointer to the button for this item.
Definition: FXShutter.h:72
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42

Copyright © 1997-2022 Jeroen van der Zijp