Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 161 lines (134 sloc) 5.414 kb
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
1 /***********************************************************************
2 * FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
b8219ec7 » lylejohnson
2009-11-09 Updated copyright notice for all SWIG interface files
3 * Copyright (c) 2001-2009 by Lyle Johnson. All Rights Reserved.
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
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
a934547f » lylejohnson
2009-11-09 Replaced e-mail address "lyle@users.sourceforge.net" with
20 * at "lyle@lylejohnson.name".
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
21 ***********************************************************************/
22
23 /// Popup internal orientation
24 enum {
25 POPUP_VERTICAL = 0, /// Vertical orientation
26 POPUP_HORIZONTAL = 0x00020000, /// Horizontal orientation
27 POPUP_SHRINKWRAP = 0x00040000 /// Shrinkwrap to content
28 };
29
30
31 /// Popup window
32 class FXPopup : public FXShell {
33 protected:
34 FXWindow *grabowner; // Window which will get grabbed when outside
35 FXColor baseColor;
36 FXColor hiliteColor;
37 FXColor shadowColor;
38 FXColor borderColor;
39 FXint border;
40 protected:
41 FXPopup();
42 virtual FXbool doesOverrideRedirect() const;
43 void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
44 void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
45 void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
46 void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
47 void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
48 void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
49 void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
50 void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
51 public:
52 long onPaint(FXObject*,FXSelector,void* PTR_EVENT);
53 long onFocusUp(FXObject*,FXSelector,void* PTR_EVENT);
54 long onFocusDown(FXObject*,FXSelector,void* PTR_EVENT);
55 long onFocusLeft(FXObject*,FXSelector,void* PTR_EVENT);
56 long onFocusRight(FXObject*,FXSelector,void* PTR_EVENT);
57 long onFocusNext(FXObject*,FXSelector,void* PTR_EVENT);
58 long onFocusPrev(FXObject*,FXSelector,void* PTR_EVENT);
59 long onEnter(FXObject*,FXSelector,void* PTR_EVENT);
60 long onLeave(FXObject*,FXSelector,void* PTR_EVENT);
61 long onMotion(FXObject*,FXSelector,void* PTR_EVENT);
62 long onMap(FXObject*,FXSelector,void* PTR_EVENT);
63 long onButtonPress(FXObject*,FXSelector,void* PTR_IGNORE);
64 long onButtonRelease(FXObject*,FXSelector,void* PTR_EVENT);
65 long onUngrabbed(FXObject*,FXSelector,void* PTR_EVENT);
66 long onCmdUnpost(FXObject*,FXSelector,void* PTR_IGNORE);
67 long onKeyPress(FXObject*,FXSelector,void* PTR_EVENT);
68 long onKeyRelease(FXObject*,FXSelector,void* PTR_EVENT);
69 long onCmdChoice(FXObject*,FXSelector,void* PTR_IGNORE);
70 public:
71 enum {
72 ID_CHOICE=FXShell::ID_LAST,
73 ID_LAST=ID_CHOICE+1000
74 };
75 public:
bea4cade »
2012-02-02 Strip all whitespaces on line endings
76
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
77 /// Construct popup pane
78 %extend {
79 FXPopup(FXWindow* owner,FXuint opts=POPUP_VERTICAL|FRAME_RAISED|FRAME_THICK,FXint x=0,FXint y=0,FXint w=0,FXint h=0){
80 return new FXRbPopup(owner,opts,x,y,w,h);
81 }
82 }
83
84 /// Return a pointer to the prior active popup
85 FXPopup* getPrevActive() const;
bea4cade »
2012-02-02 Strip all whitespaces on line endings
86
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
87 /// Return a pointer to the next active popup
88 FXPopup* getNextActive() const;
89
90 /// Change frame style
91 void setFrameStyle(FXuint style);
bea4cade »
2012-02-02 Strip all whitespaces on line endings
92
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
93 /// Return frame style
94 FXuint getFrameStyle() const;
bea4cade »
2012-02-02 Strip all whitespaces on line endings
95
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
96 /// Return border width
97 FXint getBorderWidth() const;
98
99 /// Change highlight color
100 void setHiliteColor(FXColor clr);
bea4cade »
2012-02-02 Strip all whitespaces on line endings
101
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
102 /// Return highlight color
103 FXColor getHiliteColor() const;
104
105 /// Change shadow color
106 void setShadowColor(FXColor clr);
bea4cade »
2012-02-02 Strip all whitespaces on line endings
107
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
108 /// Return shadow color
109 FXColor getShadowColor() const;
110
111 /// Change border color
112 void setBorderColor(FXColor clr);
bea4cade »
2012-02-02 Strip all whitespaces on line endings
113
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
114 /// Return border color
115 FXColor getBorderColor() const;
bea4cade »
2012-02-02 Strip all whitespaces on line endings
116
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
117 /// Change base color
118 void setBaseColor(FXColor clr);
bea4cade »
2012-02-02 Strip all whitespaces on line endings
119
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
120 /// Return base color
121 FXColor getBaseColor() const;
bea4cade »
2012-02-02 Strip all whitespaces on line endings
122
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
123 /// Return current grab owner
124 FXWindow* getGrabOwner() const;
bea4cade »
2012-02-02 Strip all whitespaces on line endings
125
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
126 /// Return popup orientation
127 FXuint getOrientation() const;
bea4cade »
2012-02-02 Strip all whitespaces on line endings
128
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
129 /// Change popup orientation
130 void setOrientation(FXuint orient);
131
132 /// Return shrinkwrap mode
133 FXbool getShrinkWrap() const;
bea4cade »
2012-02-02 Strip all whitespaces on line endings
134
45cf7d8c » lylejohnson
2009-02-02 initial checkin of r2610 from trunk
135 /// Change shrinkwrap mode
136 void setShrinkWrap(FXbool sw);
137
138 /// Destructor
139 virtual ~FXPopup();
140 };
141
142
143 DECLARE_FXOBJECT_VIRTUALS(FXPopup)
144 DECLARE_FXID_VIRTUALS(FXPopup)
145 DECLARE_FXDRAWABLE_VIRTUALS(FXPopup)
146 DECLARE_FXWINDOW_VIRTUALS(FXPopup)
147 DECLARE_FXPOPUP_VIRTUALS(FXPopup)
148
149 %{
150 static swig_type_info *FXPopup_dynamic_cast(void **ptr) {
151 FXPopup **ppPopup = reinterpret_cast<FXPopup **>(ptr);
152 FXMenuPane *pMenuPane=dynamic_cast<FXMenuPane*>(*ppPopup);
153 if(pMenuPane){
154 *ptr=reinterpret_cast<void*>(pMenuPane);
155 return SWIG_TypeQuery("FXMenuPane *");
156 }
157 return 0;
158 }
159 %}
160
161 DYNAMIC_CAST(SWIGTYPE_p_FXPopup, FXPopup_dynamic_cast);
162
Something went wrong with that request. Please try again.