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

FXShutter.h
Go to the documentation of this file.
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,2006 by Charles W. Warren. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (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 GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXShutter.h,v 1.26 2006/01/22 17:58:09 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXSHUTTER_H
25 #define FXSHUTTER_H
26 
27 #ifndef FXVERTICALFRAME_H
28 #include "FXVerticalFrame.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 class FXShutter;
35 class FXButton;
36 class FXScrollWindow;
37 class FXShutterItem;
38 
39 
40 /**
41 * A Shutter Item is a panel which is embedded inside a Shutter Widget.
42 * It can contain other user interface widgets which can be added under
43 * the content widget. The content widget is itself embedded in a scroll
44 * window to allow unlimited room for all the contents.
45 */
48  friend class FXShutter;
49 protected:
50  FXButton *button;
51  FXScrollWindow *scrollWindow;
52  FXVerticalFrame *content;
53 protected:
54  FXShutterItem(){}
55 private:
57  FXShutterItem &operator=(const FXShutterItem&);
58 public:
59  long onFocusUp(FXObject*,FXSelector,void*);
60  long onFocusDown(FXObject*,FXSelector,void*);
61  long onCmdButton(FXObject*,FXSelector,void*);
62 public:
63  enum{
64  ID_SHUTTERITEM_BUTTON=FXVerticalFrame::ID_LAST,
65  ID_LAST
66  };
67 public:
68  /// Constructor
70 
71  /// Return a pointer to the button for this item
72  FXButton* getButton() const { return button; }
73 
74  /// Return a pointer to the contents for this item
75  FXVerticalFrame* getContent() const { return content; }
76 
77  /// Set the status line help text for this item
78  void setHelpText(const FXString& text);
79 
80  /// Get the status line help text for this item
81  FXString getHelpText() const;
82 
83  /// Set the tool tip message for this item
84  void setTipText(const FXString& text);
85 
86  /// Get the tool tip message for this item
87  FXString getTipText() const;
88 
89  /// Destructor
90  virtual ~FXShutterItem();
91  };
92 
93 
94 /**
95 * The Shutter widget provides a set of foldable sub panels. Each subpanel
96 * consists of a Shutter Item which contains a button and some contents.
97 * A sub panel can be unfolded by pressing on that panel's button.
98 */
99 class FXAPI FXShutter : public FXVerticalFrame {
101  friend class FXShutterItem;
102 protected:
103  FXint current; // Item currently open
104  FXint closing; // Item closing down
105  FXint heightIncrement; // Height delta
106  FXint closingHeight; // Closing items current height
107  FXbool closingHadScrollbar; // Closing item had a scroll bar
108 protected:
110 private:
111  FXShutter(const FXShutter&);
112  FXShutter &operator=(const FXShutter&);
113 public:
114  long onFocusUp(FXObject*,FXSelector,void*);
115  long onFocusDown(FXObject*,FXSelector,void*);
116  long onTimeout(FXObject*,FXSelector,void*);
117  long onOpenItem(FXObject*,FXSelector,void*);
118  long onCmdSetValue(FXObject*,FXSelector,void*);
119  long onCmdSetIntValue(FXObject*,FXSelector,void*);
120  long onCmdGetIntValue(FXObject*,FXSelector,void*);
121  long onCmdOpen(FXObject*,FXSelector,void*);
122  long onUpdOpen(FXObject*,FXSelector,void*);
123 public:
124  enum{
125  ID_SHUTTER_TIMEOUT=FXVerticalFrame::ID_LAST,
126  ID_OPEN_SHUTTERITEM,
127  ID_OPEN_FIRST,
128  ID_OPEN_LAST=ID_OPEN_FIRST+1000,
129  ID_LAST
130  };
131 public:
132 
133  /// Constructor
135 
136  /// Perform layout
137  virtual void layout();
138 
139  /// Set the currently displayed item (panel = 0, 1, 2, ..., npanels-1)
140  virtual void setCurrent(FXint panel);
141 
142  /// Return the index of the currently displayed item
143  FXint getCurrent() const { return current; }
144 
145  /// Destructor
146  virtual ~FXShutter();
147  };
148 
149 }
150 
151 #endif
The Shutter widget provides a set of foldable sub panels.
Definition: FXShutter.h:90
A Shutter Item is a panel which is embedded inside a Shutter Widget.
Definition: FXShutter.h:46
Definition: FXWindow.h:241
unsigned int FXuint
Definition: fxdefs.h:396
FXuint FXSelector
Association key.
Definition: FXObject.h:53
A button provides a push button, with optional icon and/or text label.
Definition: FXButton.h:85
#define FXAPI
Definition: fxdefs.h:122
FXuchar FXbool
Definition: fxdefs.h:393
The scroll window widget scrolls an arbitrary child window.
Definition: FXScrollWindow.h:48
Base composite.
Definition: FXComposite.h:35
#define NULL
Definition: fxdefs.h:41
Vertical frame layout manager widget is used to automatically place child-windows vertically from top...
Definition: FXVerticalFrame.h:39
int FXint
Definition: fxdefs.h:397
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:45
Definition: FXPacker.h:38
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
static const FXchar null[]
Definition: FXString.h:35
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92
FXString provides essential string manipulation capabilities.
Definition: FXString.h:33

Copyright © 1997-2005 Jeroen van der Zijp