Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/presentation3/src/external/ceguilua/ceguilua-0.5.0/package/HelperFunctions.pkg @ 7135

Last change on this file since 7135 was 5781, checked in by rgrieder, 15 years ago

Reverted trunk again. We might want to find a way to delete these revisions again (x3n's changes are still available as diff in the commit mails).

  • Property svn:eol-style set to native
File size: 6.4 KB
Line 
1/****************************************************
2        EventArgs casting helper functions.
3        These are not part of the core CEGUI API, merely here for
4        convenience
5*****************************************************/
6$[
7
8function CEGUI.toMouseCursorEventArgs(e)
9    return tolua.cast(e,"const CEGUI::MouseCursorEventArgs")
10end
11
12function CEGUI.toWindowEventArgs(e)
13    return tolua.cast(e,"const CEGUI::WindowEventArgs")
14end
15
16function CEGUI.toActivationEventArgs(e)
17    return tolua.cast(e,"const CEGUI::ActivationEventArgs")
18end
19
20function CEGUI.toHeaderSequenceEventArgs(e)
21    return tolua.cast(e,"const CEGUI::HeaderSequenceEventArgs")
22end
23
24function CEGUI.toMouseEventArgs(e)
25    return tolua.cast(e,"const CEGUI::MouseEventArgs")
26end
27
28function CEGUI.toKeyEventArgs(e)
29    return tolua.cast(e,"const CEGUI::KeyEventArgs")
30end
31
32function CEGUI.toDragDropEventArgs(e)
33    return tolua.cast(e,"const CEGUI::DragDropEventArgs")
34end
35
36CEGUI.EventArgs.toMouseCursorEventArgs      = CEGUI.toMouseCursorEventArgs
37CEGUI.EventArgs.toWindowEventArgs           = CEGUI.toWindowEventArgs
38CEGUI.EventArgs.toActivationEventArgs       = CEGUI.toActivationEventArgs
39CEGUI.EventArgs.toHeaderSequenceEventArgs   = CEGUI.toHeaderSequenceEventArgs
40CEGUI.EventArgs.toMouseEventArgs            = CEGUI.toMouseEventArgs
41CEGUI.EventArgs.toKeyEventArgs              = CEGUI.toKeyEventArgs
42CEGUI.EventArgs.toDragDropEventArgs         = CEGUI.toDragDropEventArgs
43
44$]
45
46
47/****************************************************
48        Functions for easy casting CEGUI::Window class
49        to the widget classes derived from it.
50       
51        all widget types gets these and they are made available as:
52        CEGUI.toButtonBase and CEGUI.Window:toButtonBase
53        etc...
54*****************************************************/
55$[
56
57function CEGUI.toButtonBase(w)
58    return tolua.cast(w,"CEGUI::ButtonBase")
59end
60
61function CEGUI.toCheckbox(w)
62    return tolua.cast(w,"CEGUI::Checkbox")
63end
64
65function CEGUI.toCombobox(w)
66    return tolua.cast(w,"CEGUI::Combobox")
67end
68
69function CEGUI.toComboDropList(w)
70    return tolua.cast(w,"CEGUI::ComboDropList")
71end
72
73function CEGUI.toDragContainer(w)
74    return tolua.cast(w,"CEGUI::DragContainer")
75end
76
77function CEGUI.toEditbox(w)
78    return tolua.cast(w,"CEGUI::Editbox")
79end
80
81function CEGUI.toFrameWindow(w)
82    return tolua.cast(w,"CEGUI::FrameWindow")
83end
84
85function CEGUI.toGUISheet(w)
86    return tolua.cast(w,"CEGUI::GUISheet")
87end
88
89function CEGUI.toItemEntry(w)
90    return tolua.cast(w,"CEGUI::ItemEntry")
91end
92
93function CEGUI.toItemListBase(w)
94    return tolua.cast(w,"CEGUI::ItemListBase")
95end
96
97function CEGUI.toItemListbox(w)
98    return tolua.cast(w,"CEGUI::ItemListbox")
99end
100
101function CEGUI.toListbox(w)
102    return tolua.cast(w,"CEGUI::Listbox")
103end
104
105function CEGUI.toListHeader(w)
106    return tolua.cast(w,"CEGUI::ListHeader")
107end
108
109function CEGUI.toListHeaderSegment(w)
110    return tolua.cast(w,"CEGUI::ListHeaderSegment")
111end
112
113function CEGUI.toMenubar(w)
114    return tolua.cast(w,"CEGUI::Menubar")
115end
116
117function CEGUI.toMenuBase(w)
118    return tolua.cast(w,"CEGUI::MenuBase")
119end
120
121function CEGUI.toMenuItem(w)
122    return tolua.cast(w,"CEGUI::MenuItem")
123end
124
125function CEGUI.toMultiColumnList(w)
126    return tolua.cast(w,"CEGUI::MultiColumnList")
127end
128
129function CEGUI.toMultiLineEditbox(w)
130    return tolua.cast(w,"CEGUI::MultiLineEditbox")
131end
132
133function CEGUI.toPopupMenu(w)
134    return tolua.cast(w,"CEGUI::PopupMenu")
135end
136
137function CEGUI.toProgressBar(w)
138    return tolua.cast(w,"CEGUI::ProgressBar")
139end
140
141function CEGUI.toPushButton(w)
142    return tolua.cast(w,"CEGUI::PushButton")
143end
144
145function CEGUI.toRadioButton(w)
146    return tolua.cast(w,"CEGUI::RadioButton")
147end
148
149function CEGUI.toScrollablePane(w)
150    return tolua.cast(w,"CEGUI::ScrollablePane")
151end
152
153function CEGUI.toScrollbar(w)
154    return tolua.cast(w,"CEGUI::Scrollbar")
155end
156
157function CEGUI.toScrolledContainer(w)
158    return tolua.cast(w,"CEGUI::ScrolledContainer")
159end
160
161function CEGUI.toScrolledItemListBase(w)
162    return tolua.cast(w,"CEGUI::ScrolledItemListBase")
163end
164
165function CEGUI.toSlider(w)
166    return tolua.cast(w,"CEGUI::Slider")
167end
168
169function CEGUI.toSpinner(w)
170    return tolua.cast(w,"CEGUI::Spinner")
171end
172
173function CEGUI.toTabButton(w)
174    return tolua.cast(w,"CEGUI::TabButton")
175end
176
177function CEGUI.toTabControl(w)
178    return tolua.cast(w,"CEGUI::TabControl")
179end
180
181function CEGUI.toTabPane(w)
182    return tolua.cast(w,"CEGUI::TabPane")
183end
184
185function CEGUI.toThumb(w)
186    return tolua.cast(w,"CEGUI::Thumb")
187end
188
189function CEGUI.toTooltip(w)
190    return tolua.cast(w,"CEGUI::Tooltip")
191end
192
193CEGUI.Window.toButtonBase = CEGUI.toButtonBase
194CEGUI.Window.toCheckbox = CEGUI.toCheckbox
195CEGUI.Window.toCombobox = CEGUI.toCombobox
196CEGUI.Window.toComboDropList = CEGUI.toComboDropList
197CEGUI.Window.toDragContainer = CEGUI.toDragContainer
198CEGUI.Window.toEditbox = CEGUI.toEditbox
199CEGUI.Window.toFrameWindow = CEGUI.toFrameWindow
200CEGUI.Window.toGUISheet = CEGUI.toGUISheet
201CEGUI.Window.toItemEntry = CEGUI.toItemEntry
202CEGUI.Window.toItemListBase = CEGUI.toItemListBase
203CEGUI.Window.toItemListbox = CEGUI.toItemListBase
204CEGUI.Window.toListbox = CEGUI.toListbox
205CEGUI.Window.toListHeader = CEGUI.toListHeader
206CEGUI.Window.toListHeaderSegment = CEGUI.toListHeaderSegment
207CEGUI.Window.toMenubar = CEGUI.toMenubar
208CEGUI.Window.toMenuBase = CEGUI.toMenuBase
209CEGUI.Window.toMenuItem = CEGUI.toMenuItem
210CEGUI.Window.toMultiColumnList = CEGUI.toMultiColumnList
211CEGUI.Window.toMultiLineEditbox = CEGUI.toMultiLineEditbox
212CEGUI.Window.toPopupMenu = CEGUI.toPopupMenu
213CEGUI.Window.toProgressBar = CEGUI.toProgressBar
214CEGUI.Window.toPushButton = CEGUI.toPushButton
215CEGUI.Window.toRadioButton = CEGUI.toRadioButton
216CEGUI.Window.toScrollablePane = CEGUI.toScrollablePane
217CEGUI.Window.toScrollbar = CEGUI.toScrollbar
218CEGUI.Window.toScrolledContainer = CEGUI.toScrolledContainer
219CEGUI.Window.toScrolledItemListBase = CEGUI.toScrolledItemListBase
220CEGUI.Window.toSlider = CEGUI.toSlider
221CEGUI.Window.toSpinner = CEGUI.toSpinner
222CEGUI.Window.toTabButton = CEGUI.toTabButton
223CEGUI.Window.toTabControl = CEGUI.toTabControl
224CEGUI.Window.toTabPane = CEGUI.toTabPane
225CEGUI.Window.toThumb = CEGUI.toThumb
226CEGUI.Window.toTooltip = CEGUI.toTooltip
227
228$]
229
230
231/****************************************************
232        Helper to create a ListboxTextItem.
233        Mimics the constructor
234*****************************************************/
235ListboxTextItem* ceguiLua_createListboxTextItem @ createListboxTextItem(string text, unsigned int item_id=0, void* item_data=0, bool disabled=false, bool auto_delete=true);
Note: See TracBrowser for help on using the repository browser.