Skip to content
Newer
Older
100644 141 lines (120 sloc) 4.97 KB
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored Feb 2, 2009
1 /***********************************************************************
2 * FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
b8219ec @lylejohnson Updated copyright notice for all SWIG interface files
lylejohnson authored Nov 9, 2009
3 * Copyright (c) 2001-2009 by Lyle Johnson. All Rights Reserved.
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored Feb 2, 2009
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * For further information please contact the author by e-mail
a934547 @lylejohnson Replaced e-mail address "lyle@users.sourceforge.net" with
lylejohnson authored Nov 9, 2009
20 * at "lyle@lylejohnson.name".
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored Feb 2, 2009
21 ***********************************************************************/
22
23 class FXShutter;
24 class FXScrollWindow;
25
26
27 /**
28 * A Shutter Item is a panel which is embedded inside a Shutter Widget.
29 * It can contain other user interface widgets which can be added under
30 * the content widget. The content widget is itself embedded in a scroll
31 * window to allow unlimited room for all the contents.
32 */
33 class FXShutterItem : public FXVerticalFrame {
34 protected:
35 FXButton *button;
36 FXScrollWindow *scrollWindow;
37 FXVerticalFrame *content;
38 protected:
39 FXShutterItem(){}
40 public:
41 long onFocusUp(FXObject*,FXSelector,void* PTR_EVENT);
42 long onFocusDown(FXObject*,FXSelector,void* PTR_EVENT);
43 long onCmdButton(FXObject*,FXSelector,void* PTR_IGNORE);
44 public:
45 enum{
46 ID_SHUTTERITEM_BUTTON=FXVerticalFrame::ID_LAST,
47 ID_LAST
48 };
49 public:
50 /// Constructor
51 %extend {
52 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){
53 return new FXRbShutterItem(p,text,icon,opts,x,y,w,h,pl,pr,pt,pb,hs,vs);
54 }
55 }
56
57 /// Return a pointer to the button for this item
58 FXButton* getButton() const;
59
60 /// Return a pointer to the contents for this item
61 FXVerticalFrame* getContent() const;
62
63 /// Set the status line help text for this item
64 void setHelpText(const FXString& text);
65
66 /// Get the status line help text for this item
67 FXString getHelpText() const;
68
69 /// Set the tool tip message for this item
70 void setTipText(const FXString& text);
71
72 /// Get the tool tip message for this item
73 FXString getTipText() const;
74
75 /// Destructor
76 virtual ~FXShutterItem();
77 };
78
79
80 DECLARE_FXOBJECT_VIRTUALS(FXShutterItem)
81 DECLARE_FXID_VIRTUALS(FXShutterItem)
82 DECLARE_FXDRAWABLE_VIRTUALS(FXShutterItem)
83 DECLARE_FXWINDOW_VIRTUALS(FXShutterItem)
84
85
86
87 /**
88 * The Shutter widget provides a set of foldable sub panels. Each subpanel
89 * consists of a Shutter Item which contains a button and some contents.
90 * A sub panel can be unfolded by pressing on that panel's button.
91 */
92 class FXShutter : public FXVerticalFrame {
93 protected:
94 FXint current; // Item currently open
95 FXint closing; // Item closing down
96 FXint heightIncrement; // Height delta
97 FXint closingHeight; // Closing items current height
98 FXbool closingHadScrollbar; // Closing item had a scroll bar
99 protected:
100 FXShutter(){}
101 public:
102 long onFocusUp(FXObject*,FXSelector,void* PTR_EVENT);
103 long onFocusDown(FXObject*,FXSelector,void* PTR_EVENT);
104 long onTimeout(FXObject*,FXSelector,void* PTR_IGNORE);
105 long onOpenItem(FXObject*,FXSelector,void* PTR_IGNORE);
106 long onCmdSetValue(FXObject*,FXSelector,void* PTR_INT);
107 long onCmdSetIntValue(FXObject*,FXSelector,void* PTR_PINT);
108 long onCmdGetIntValue(FXObject*,FXSelector,void* PTR_IGNORE); // FIXME
109 long onCmdOpen(FXObject*,FXSelector,void* PTR_IGNORE);
110 long onUpdOpen(FXObject*,FXSelector,void* PTR_IGNORE); // FIXME
111 public:
112 enum{
113 ID_SHUTTER_TIMEOUT=FXVerticalFrame::ID_LAST,
114 ID_OPEN_SHUTTERITEM,
115 ID_OPEN_FIRST,
116 ID_OPEN_LAST=ID_OPEN_FIRST+1000,
117 ID_LAST
118 };
119 public:
120 /// Constructor
121 %extend {
122 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){
123 return new FXRbShutter(p,tgt,sel,opts,x,y,w,h,pl,pr,pt,pb,hs,vs);
124 }
125 }
126
127 /// Return the index of the currently displayed item
128 FXint getCurrent() const;
129
130 /// Destructor
131 virtual ~FXShutter();
132 };
133
134
135 DECLARE_FXOBJECT_VIRTUALS(FXShutter)
136 DECLARE_FXID_VIRTUALS(FXShutter)
137 DECLARE_FXDRAWABLE_VIRTUALS(FXShutter)
138 DECLARE_FXWINDOW_VIRTUALS(FXShutter)
139 DECLARE_FXSHUTTER_VIRTUALS(FXShutter)
140
Something went wrong with that request. Please try again.