Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/particles2/src/external/ceguilua/ceguilua-0.6.2/package/HelperFunctions.pkg @ 6346

Last change on this file since 6346 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.5 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
36function CEGUI.toTreeEventArgs(e)
37    return tolua.cast(e,"const CEGUI::TreeEventArgs")
38end
39
40CEGUI.EventArgs.toMouseCursorEventArgs      = CEGUI.toMouseCursorEventArgs
41CEGUI.EventArgs.toWindowEventArgs           = CEGUI.toWindowEventArgs
42CEGUI.EventArgs.toActivationEventArgs       = CEGUI.toActivationEventArgs
43CEGUI.EventArgs.toHeaderSequenceEventArgs   = CEGUI.toHeaderSequenceEventArgs
44CEGUI.EventArgs.toMouseEventArgs            = CEGUI.toMouseEventArgs
45CEGUI.EventArgs.toKeyEventArgs              = CEGUI.toKeyEventArgs
46CEGUI.EventArgs.toDragDropEventArgs         = CEGUI.toDragDropEventArgs
47CEGUI.EventArgs.toTreeEventArgs             = CEGUI.toTreeEventArgs
48
49$]
50
51
52/****************************************************
53        Functions for easy casting CEGUI::Window class
54        to the widget classes derived from it.
55       
56        all widget types gets these and they are made available as:
57        CEGUI.toButtonBase and CEGUI.Window:toButtonBase
58        etc...
59*****************************************************/
60$[
61
62function CEGUI.toButtonBase(w)
63    return tolua.cast(w,"CEGUI::ButtonBase")
64end
65
66function CEGUI.toCheckbox(w)
67    return tolua.cast(w,"CEGUI::Checkbox")
68end
69
70function CEGUI.toCombobox(w)
71    return tolua.cast(w,"CEGUI::Combobox")
72end
73
74function CEGUI.toComboDropList(w)
75    return tolua.cast(w,"CEGUI::ComboDropList")
76end
77
78function CEGUI.toDragContainer(w)
79    return tolua.cast(w,"CEGUI::DragContainer")
80end
81
82function CEGUI.toEditbox(w)
83    return tolua.cast(w,"CEGUI::Editbox")
84end
85
86function CEGUI.toFrameWindow(w)
87    return tolua.cast(w,"CEGUI::FrameWindow")
88end
89
90function CEGUI.toGUISheet(w)
91    return tolua.cast(w,"CEGUI::GUISheet")
92end
93
94function CEGUI.toItemEntry(w)
95    return tolua.cast(w,"CEGUI::ItemEntry")
96end
97
98function CEGUI.toItemListBase(w)
99    return tolua.cast(w,"CEGUI::ItemListBase")
100end
101
102function CEGUI.toItemListbox(w)
103    return tolua.cast(w,"CEGUI::ItemListbox")
104end
105
106function CEGUI.toListbox(w)
107    return tolua.cast(w,"CEGUI::Listbox")
108end
109
110function CEGUI.toListHeader(w)
111    return tolua.cast(w,"CEGUI::ListHeader")
112end
113
114function CEGUI.toListHeaderSegment(w)
115    return tolua.cast(w,"CEGUI::ListHeaderSegment")
116end
117
118function CEGUI.toMenubar(w)
119    return tolua.cast(w,"CEGUI::Menubar")
120end
121
122function CEGUI.toMenuBase(w)
123    return tolua.cast(w,"CEGUI::MenuBase")
124end
125
126function CEGUI.toMenuItem(w)
127    return tolua.cast(w,"CEGUI::MenuItem")
128end
129
130function CEGUI.toMultiColumnList(w)
131    return tolua.cast(w,"CEGUI::MultiColumnList")
132end
133
134function CEGUI.toMultiLineEditbox(w)
135    return tolua.cast(w,"CEGUI::MultiLineEditbox")
136end
137
138function CEGUI.toPopupMenu(w)
139    return tolua.cast(w,"CEGUI::PopupMenu")
140end
141
142function CEGUI.toProgressBar(w)
143    return tolua.cast(w,"CEGUI::ProgressBar")
144end
145
146function CEGUI.toPushButton(w)
147    return tolua.cast(w,"CEGUI::PushButton")
148end
149
150function CEGUI.toRadioButton(w)
151    return tolua.cast(w,"CEGUI::RadioButton")
152end
153
154function CEGUI.toScrollablePane(w)
155    return tolua.cast(w,"CEGUI::ScrollablePane")
156end
157
158function CEGUI.toScrollbar(w)
159    return tolua.cast(w,"CEGUI::Scrollbar")
160end
161
162function CEGUI.toScrolledContainer(w)
163    return tolua.cast(w,"CEGUI::ScrolledContainer")
164end
165
166function CEGUI.toScrolledItemListBase(w)
167    return tolua.cast(w,"CEGUI::ScrolledItemListBase")
168end
169
170function CEGUI.toSlider(w)
171    return tolua.cast(w,"CEGUI::Slider")
172end
173
174function CEGUI.toSpinner(w)
175    return tolua.cast(w,"CEGUI::Spinner")
176end
177
178function CEGUI.toTabButton(w)
179    return tolua.cast(w,"CEGUI::TabButton")
180end
181
182function CEGUI.toTabControl(w)
183    return tolua.cast(w,"CEGUI::TabControl")
184end
185
186function CEGUI.toTabPane(w)
187    return tolua.cast(w,"CEGUI::TabPane")
188end
189
190function CEGUI.toThumb(w)
191    return tolua.cast(w,"CEGUI::Thumb")
192end
193
194function CEGUI.toTooltip(w)
195    return tolua.cast(w,"CEGUI::Tooltip")
196end
197
198CEGUI.Window.toButtonBase = CEGUI.toButtonBase
199CEGUI.Window.toCheckbox = CEGUI.toCheckbox
200CEGUI.Window.toCombobox = CEGUI.toCombobox
201CEGUI.Window.toComboDropList = CEGUI.toComboDropList
202CEGUI.Window.toDragContainer = CEGUI.toDragContainer
203CEGUI.Window.toEditbox = CEGUI.toEditbox
204CEGUI.Window.toFrameWindow = CEGUI.toFrameWindow
205CEGUI.Window.toGUISheet = CEGUI.toGUISheet
206CEGUI.Window.toItemEntry = CEGUI.toItemEntry
207CEGUI.Window.toItemListBase = CEGUI.toItemListBase
208CEGUI.Window.toItemListbox = CEGUI.toItemListBase
209CEGUI.Window.toListbox = CEGUI.toListbox
210CEGUI.Window.toListHeader = CEGUI.toListHeader
211CEGUI.Window.toListHeaderSegment = CEGUI.toListHeaderSegment
212CEGUI.Window.toMenubar = CEGUI.toMenubar
213CEGUI.Window.toMenuBase = CEGUI.toMenuBase
214CEGUI.Window.toMenuItem = CEGUI.toMenuItem
215CEGUI.Window.toMultiColumnList = CEGUI.toMultiColumnList
216CEGUI.Window.toMultiLineEditbox = CEGUI.toMultiLineEditbox
217CEGUI.Window.toPopupMenu = CEGUI.toPopupMenu
218CEGUI.Window.toProgressBar = CEGUI.toProgressBar
219CEGUI.Window.toPushButton = CEGUI.toPushButton
220CEGUI.Window.toRadioButton = CEGUI.toRadioButton
221CEGUI.Window.toScrollablePane = CEGUI.toScrollablePane
222CEGUI.Window.toScrollbar = CEGUI.toScrollbar
223CEGUI.Window.toScrolledContainer = CEGUI.toScrolledContainer
224CEGUI.Window.toScrolledItemListBase = CEGUI.toScrolledItemListBase
225CEGUI.Window.toSlider = CEGUI.toSlider
226CEGUI.Window.toSpinner = CEGUI.toSpinner
227CEGUI.Window.toTabButton = CEGUI.toTabButton
228CEGUI.Window.toTabControl = CEGUI.toTabControl
229CEGUI.Window.toTabPane = CEGUI.toTabPane
230CEGUI.Window.toThumb = CEGUI.toThumb
231CEGUI.Window.toTooltip = CEGUI.toTooltip
232
233$]
234
235
236/****************************************************
237        Helper to create a ListboxTextItem.
238        Mimics the constructor
239*****************************************************/
240ListboxTextItem* 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.