wxruby 1.9.5-universal-darwin-9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (228) hide show
  1. data/LICENSE +53 -0
  2. data/README +297 -0
  3. data/lib/wx/accessors.rb +52 -0
  4. data/lib/wx/classes/app.rb +45 -0
  5. data/lib/wx/classes/artprovider.rb +31 -0
  6. data/lib/wx/classes/bitmap.rb +23 -0
  7. data/lib/wx/classes/checklistbox.rb +45 -0
  8. data/lib/wx/classes/choice.rb +4 -0
  9. data/lib/wx/classes/clientdc.rb +13 -0
  10. data/lib/wx/classes/clipboard.rb +16 -0
  11. data/lib/wx/classes/colour.rb +47 -0
  12. data/lib/wx/classes/combobox.rb +4 -0
  13. data/lib/wx/classes/commandevent.rb +7 -0
  14. data/lib/wx/classes/controlwithitems.rb +10 -0
  15. data/lib/wx/classes/dc.rb +57 -0
  16. data/lib/wx/classes/event.rb +5 -0
  17. data/lib/wx/classes/evthandler.rb +906 -0
  18. data/lib/wx/classes/font.rb +118 -0
  19. data/lib/wx/classes/gauge.rb +12 -0
  20. data/lib/wx/classes/grid.rb +129 -0
  21. data/lib/wx/classes/helpcontroller.rb +5 -0
  22. data/lib/wx/classes/htmlhelpcontroller.rb +5 -0
  23. data/lib/wx/classes/htmlwindow.rb +6 -0
  24. data/lib/wx/classes/icon.rb +14 -0
  25. data/lib/wx/classes/image.rb +14 -0
  26. data/lib/wx/classes/listbox.rb +4 -0
  27. data/lib/wx/classes/listctrl.rb +21 -0
  28. data/lib/wx/classes/locale.rb +28 -0
  29. data/lib/wx/classes/mediactrl.rb +22 -0
  30. data/lib/wx/classes/menu.rb +62 -0
  31. data/lib/wx/classes/menuitem.rb +7 -0
  32. data/lib/wx/classes/object.rb +7 -0
  33. data/lib/wx/classes/paintdc.rb +12 -0
  34. data/lib/wx/classes/point.rb +48 -0
  35. data/lib/wx/classes/previewframe.rb +13 -0
  36. data/lib/wx/classes/rect.rb +10 -0
  37. data/lib/wx/classes/size.rb +49 -0
  38. data/lib/wx/classes/sound.rb +23 -0
  39. data/lib/wx/classes/styledtextctrl.rb +92 -0
  40. data/lib/wx/classes/textctrl.rb +14 -0
  41. data/lib/wx/classes/texturlevent.rb +6 -0
  42. data/lib/wx/classes/timer.rb +94 -0
  43. data/lib/wx/classes/treectrl.rb +44 -0
  44. data/lib/wx/classes/window.rb +82 -0
  45. data/lib/wx/classes/xmlresource.rb +16 -0
  46. data/lib/wx/keyword_ctors.rb +219 -0
  47. data/lib/wx/keyword_defs.rb +485 -0
  48. data/lib/wx/version.rb +3 -0
  49. data/lib/wx.rb +42 -0
  50. data/lib/wxruby2.bundle +0 -0
  51. data/samples/SAMPLES-LICENSE.TXT +18 -0
  52. data/samples/aui/aui.rb +1360 -0
  53. data/samples/bigdemo/About.rbw +39 -0
  54. data/samples/bigdemo/ColorPanel.rbw +25 -0
  55. data/samples/bigdemo/GridSimple.rbw +80 -0
  56. data/samples/bigdemo/MDIDemo.rbw +59 -0
  57. data/samples/bigdemo/PopupMenu.rbw +151 -0
  58. data/samples/bigdemo/ShapedWindow.rbw +135 -0
  59. data/samples/bigdemo/Sizers.rbw +545 -0
  60. data/samples/bigdemo/bigdemo.rb +824 -0
  61. data/samples/bigdemo/demoTemplate.rbw +37 -0
  62. data/samples/bigdemo/helpfile.htb +0 -0
  63. data/samples/bigdemo/icons/Test 015.jpg +0 -0
  64. data/samples/bigdemo/icons/Test 015.png +0 -0
  65. data/samples/bigdemo/icons/choice.bmp +0 -0
  66. data/samples/bigdemo/icons/choice.xpm +27 -0
  67. data/samples/bigdemo/icons/combo.bmp +0 -0
  68. data/samples/bigdemo/icons/combo.xpm +27 -0
  69. data/samples/bigdemo/icons/copy.xpm +25 -0
  70. data/samples/bigdemo/icons/cut.xpm +24 -0
  71. data/samples/bigdemo/icons/gauge.bmp +0 -0
  72. data/samples/bigdemo/icons/gauge.xpm +27 -0
  73. data/samples/bigdemo/icons/help.xpm +25 -0
  74. data/samples/bigdemo/icons/list.bmp +0 -0
  75. data/samples/bigdemo/icons/list.xpm +27 -0
  76. data/samples/bigdemo/icons/mondrian.ico +0 -0
  77. data/samples/bigdemo/icons/mondrian.xpm +44 -0
  78. data/samples/bigdemo/icons/new.xpm +24 -0
  79. data/samples/bigdemo/icons/ogl.ico +0 -0
  80. data/samples/bigdemo/icons/ogl.xpm +45 -0
  81. data/samples/bigdemo/icons/open.xpm +26 -0
  82. data/samples/bigdemo/icons/paste.bmp +0 -0
  83. data/samples/bigdemo/icons/paste.xpm +38 -0
  84. data/samples/bigdemo/icons/pointy.png +0 -0
  85. data/samples/bigdemo/icons/preview.xpm +26 -0
  86. data/samples/bigdemo/icons/print.xpm +26 -0
  87. data/samples/bigdemo/icons/radio.bmp +0 -0
  88. data/samples/bigdemo/icons/radio.xpm +27 -0
  89. data/samples/bigdemo/icons/robert.xpm +415 -0
  90. data/samples/bigdemo/icons/ruby.png +0 -0
  91. data/samples/bigdemo/icons/sashtest.ico +0 -0
  92. data/samples/bigdemo/icons/save.xpm +25 -0
  93. data/samples/bigdemo/icons/smiles.bmp +0 -0
  94. data/samples/bigdemo/icons/smiles.xpm +39 -0
  95. data/samples/bigdemo/icons/smiley.ico +0 -0
  96. data/samples/bigdemo/icons/smiley.xpm +42 -0
  97. data/samples/bigdemo/icons/stattext.xpm +24 -0
  98. data/samples/bigdemo/icons/test2.bmp +0 -0
  99. data/samples/bigdemo/icons/test2.png +0 -0
  100. data/samples/bigdemo/icons/test2.xpm +79 -0
  101. data/samples/bigdemo/icons/text.bmp +0 -0
  102. data/samples/bigdemo/icons/text.xpm +27 -0
  103. data/samples/bigdemo/icons/tog1.bmp +0 -0
  104. data/samples/bigdemo/icons/tog1.xpm +38 -0
  105. data/samples/bigdemo/icons/tog2.bmp +0 -0
  106. data/samples/bigdemo/icons/tog2.xpm +38 -0
  107. data/samples/bigdemo/icons/wxwin.ico +0 -0
  108. data/samples/bigdemo/icons/wxwin16x16.png +0 -0
  109. data/samples/bigdemo/icons/wxwin16x16.xpm +25 -0
  110. data/samples/bigdemo/icons/wxwin32x32.png +0 -0
  111. data/samples/bigdemo/icons/wxwin48x48.png +0 -0
  112. data/samples/bigdemo/run.rb +94 -0
  113. data/samples/bigdemo/tips.txt +7 -0
  114. data/samples/bigdemo/utils.rb +12 -0
  115. data/samples/bigdemo/wxArtProvider.rbw +285 -0
  116. data/samples/bigdemo/wxBitmapButton.rbw +64 -0
  117. data/samples/bigdemo/wxButton.rbw +66 -0
  118. data/samples/bigdemo/wxCalendarCtrl.rbw +72 -0
  119. data/samples/bigdemo/wxCheckBox.rbw +52 -0
  120. data/samples/bigdemo/wxCheckListBox.rbw +77 -0
  121. data/samples/bigdemo/wxChoice.rbw +49 -0
  122. data/samples/bigdemo/wxChoicebook.rbw +80 -0
  123. data/samples/bigdemo/wxColourDialog.rbw +34 -0
  124. data/samples/bigdemo/wxComboBox.rbw +79 -0
  125. data/samples/bigdemo/wxCursor.rbw +140 -0
  126. data/samples/bigdemo/wxDialog.rbw +76 -0
  127. data/samples/bigdemo/wxDirDialog.rbw +32 -0
  128. data/samples/bigdemo/wxDragImage.rbw +74 -0
  129. data/samples/bigdemo/wxFileDialog.rbw +39 -0
  130. data/samples/bigdemo/wxFileDialog_Save.rbw +38 -0
  131. data/samples/bigdemo/wxFindReplaceDialog.rbw +85 -0
  132. data/samples/bigdemo/wxFontDialog.rbw +176 -0
  133. data/samples/bigdemo/wxFrame.rbw +55 -0
  134. data/samples/bigdemo/wxGauge.rbw +73 -0
  135. data/samples/bigdemo/wxGenericDirCtrl.rbw +78 -0
  136. data/samples/bigdemo/wxGrid.rbw +68 -0
  137. data/samples/bigdemo/wxHtmlHelpController.rbw +57 -0
  138. data/samples/bigdemo/wxListBox.rbw +142 -0
  139. data/samples/bigdemo/wxListCtrl_virtual.rbw +109 -0
  140. data/samples/bigdemo/wxMDIWindows.rbw +52 -0
  141. data/samples/bigdemo/wxMenu.rbw +238 -0
  142. data/samples/bigdemo/wxMessageDialog.rbw +30 -0
  143. data/samples/bigdemo/wxMiniFrame.rbw +74 -0
  144. data/samples/bigdemo/wxMultipleChoiceDialog.rbw +34 -0
  145. data/samples/bigdemo/wxNotebook.rbw +138 -0
  146. data/samples/bigdemo/wxProgressDialog.rbw +45 -0
  147. data/samples/bigdemo/wxRadioBox.rbw +74 -0
  148. data/samples/bigdemo/wxRadioButton.rbw +127 -0
  149. data/samples/bigdemo/wxSashWindow.rbw +145 -0
  150. data/samples/bigdemo/wxScrolledMessageDialog.rbw +59 -0
  151. data/samples/bigdemo/wxScrolledWindow.rbw +201 -0
  152. data/samples/bigdemo/wxSingleChoiceDialog.rbw +35 -0
  153. data/samples/bigdemo/wxSlider.rbw +44 -0
  154. data/samples/bigdemo/wxSpinButton.rbw +52 -0
  155. data/samples/bigdemo/wxSpinCtrl.rbw +53 -0
  156. data/samples/bigdemo/wxSplitterWindow.rbw +65 -0
  157. data/samples/bigdemo/wxStaticBitmap.rbw +53 -0
  158. data/samples/bigdemo/wxStaticText.rbw +57 -0
  159. data/samples/bigdemo/wxStatusBar.rbw +128 -0
  160. data/samples/bigdemo/wxTextCtrl.rbw +151 -0
  161. data/samples/bigdemo/wxTextEntryDialog.rbw +34 -0
  162. data/samples/bigdemo/wxToggleButton.rbw +51 -0
  163. data/samples/bigdemo/wxToolBar.rbw +133 -0
  164. data/samples/bigdemo/wxTreeCtrl.rbw +192 -0
  165. data/samples/calendar/calendar.rb +275 -0
  166. data/samples/caret/caret.rb +286 -0
  167. data/samples/caret/mondrian.xpm +44 -0
  168. data/samples/controls/controls.rb +1140 -0
  169. data/samples/controls/get_item_sample.rb +87 -0
  170. data/samples/controls/icons/choice.xpm +27 -0
  171. data/samples/controls/icons/combo.xpm +27 -0
  172. data/samples/controls/icons/gauge.xpm +27 -0
  173. data/samples/controls/icons/list.xpm +27 -0
  174. data/samples/controls/icons/radio.xpm +27 -0
  175. data/samples/controls/icons/stattext.xpm +24 -0
  176. data/samples/controls/icons/text.xpm +27 -0
  177. data/samples/controls/mondrian.ico +0 -0
  178. data/samples/controls/mondrian.xpm +44 -0
  179. data/samples/controls/test2.bmp +0 -0
  180. data/samples/dialogs/dialogs.rb +724 -0
  181. data/samples/dialogs/tips.txt +18 -0
  182. data/samples/drawing/graphics_drawing.rb +236 -0
  183. data/samples/drawing/images.rb +42 -0
  184. data/samples/drawing/paperclip.png +0 -0
  185. data/samples/etc/activation.rb +108 -0
  186. data/samples/etc/choice.rb +72 -0
  187. data/samples/etc/miniframe.rb +84 -0
  188. data/samples/etc/sash.rb +135 -0
  189. data/samples/etc/scrollwin.rb +116 -0
  190. data/samples/etc/system_settings.rb +258 -0
  191. data/samples/etc/threaded.rb +78 -0
  192. data/samples/etc/wizard.rb +79 -0
  193. data/samples/event/event.rb +184 -0
  194. data/samples/grid/grid.rb +202 -0
  195. data/samples/html/html.rb +268 -0
  196. data/samples/listbook/listbook.rb +181 -0
  197. data/samples/listbook/listbook.xrc +370 -0
  198. data/samples/mdi/mdi.rb +87 -0
  199. data/samples/media/mediactrl.rb +173 -0
  200. data/samples/minimal/minimal.rb +85 -0
  201. data/samples/minimal/mondrian.ico +0 -0
  202. data/samples/minimal/mondrian.png +0 -0
  203. data/samples/minimal/nothing.rb +21 -0
  204. data/samples/opengl/cube.rb +123 -0
  205. data/samples/printing/mondrian.ico +0 -0
  206. data/samples/printing/mondrian.xpm +44 -0
  207. data/samples/printing/printing.rb +484 -0
  208. data/samples/sockets/SocketPackets.rb +27 -0
  209. data/samples/sockets/res/message-new.png +0 -0
  210. data/samples/sockets/res/user.png +0 -0
  211. data/samples/sockets/wxClient.rb +395 -0
  212. data/samples/sockets/wxServer.rb +422 -0
  213. data/samples/sockets/wxSocketGUI.rb +97 -0
  214. data/samples/text/mondrian.ico +0 -0
  215. data/samples/text/mondrian.xpm +44 -0
  216. data/samples/text/scintilla.rb +174 -0
  217. data/samples/text/textctrl.rb +124 -0
  218. data/samples/text/unicode.rb +238 -0
  219. data/samples/text/utf8.txt +15 -0
  220. data/samples/treectrl/icon1.xpm +79 -0
  221. data/samples/treectrl/icon2.xpm +53 -0
  222. data/samples/treectrl/icon3.xpm +79 -0
  223. data/samples/treectrl/icon4.xpm +43 -0
  224. data/samples/treectrl/icon5.xpm +79 -0
  225. data/samples/treectrl/treectrl.rb +1180 -0
  226. data/samples/xrc/samples.xrc +46 -0
  227. data/samples/xrc/xrc_sample.rb +107 -0
  228. metadata +305 -0
@@ -0,0 +1,824 @@
1
+ #!/usr/bin/env ruby
2
+ # Demo created by Robert Carlin,
3
+ # based on the wxPython demo by Robin Dunn
4
+ # Modified a bit by Kevin Smith and Roy Sutton
5
+
6
+ # TODO:
7
+ # Finish Scintilla integration
8
+ # Fix 'Find Next'
9
+ # Refactor editor pane
10
+ # More samples
11
+ # Finish 'rubification' of source
12
+ # Fix non-scintilla code viewer
13
+
14
+ begin
15
+ require 'wx'
16
+ rescue LoadError => no_wx_err
17
+ begin
18
+ require 'rubygems'
19
+ require 'wx'
20
+ rescue LoadError
21
+ raise no_wx_err
22
+ end
23
+ end
24
+
25
+
26
+ OVR_TEXT = "This is the WxRuby Demo. It was ported from the wxPython Demo, created by Robin Dunn. Many thanks to him for all his hard work - this demo is what it is because of him. Click on any of the items in the tree control to start the demo. Don't forget to check out the Demo Code tab - you can see the source code for each demo!\nHope you like it!"
27
+
28
+ $tree_list = [
29
+ #new stuff
30
+ #['Recent Additions', [
31
+ # 'wxMaskedNumCtrl',
32
+ # 'FloatCanvas',
33
+ # ]],
34
+
35
+ # managed windows == things with a [optional] caption you can close
36
+ ['Base Frames and Dialogs', [
37
+ 'wxDialog',
38
+ 'wxFrame',
39
+ 'wxMDIWindows',
40
+ 'wxMiniFrame',
41
+ #'wxWizard',
42
+ ]],
43
+
44
+ # the common dialogs
45
+ ['Common Dialogs', [
46
+ 'wxColourDialog',
47
+ 'wxDirDialog',
48
+ 'wxFileDialog',
49
+ 'wxFileDialog_Save',
50
+ 'wxFindReplaceDialog',
51
+ 'wxFontDialog',
52
+ 'wxMessageDialog',
53
+ #'wxPageSetupDialog',
54
+ #'wxPrintDialog',
55
+ 'wxProgressDialog',
56
+ 'wxSingleChoiceDialog',
57
+ 'wxTextEntryDialog',
58
+ ]],
59
+
60
+ # dialogs from libraries
61
+ ['More Dialogs', [
62
+ # 'ErrorDialogs',
63
+ # 'ImageBrowser',
64
+ 'wxMultipleChoiceDialog',
65
+ 'wxScrolledMessageDialog'
66
+ ]],
67
+
68
+ # core controls
69
+ ['Core Windows/Controls', [
70
+ 'PopupMenu',
71
+ 'wxBitmapButton',
72
+ 'wxButton',
73
+ 'wxCheckBox',
74
+ 'wxCheckListBox',
75
+ 'wxChoice',
76
+ 'wxChoicebook',
77
+ 'wxComboBox',
78
+ 'wxGauge',
79
+ 'wxGenericDirCtrl',
80
+ 'wxGrid',
81
+ #'wxGrid_MegaExample',
82
+ 'wxListBox',
83
+ #'wxListCtrl',
84
+ 'wxListCtrl_virtual',
85
+ 'wxMenu',
86
+ 'wxNotebook',
87
+ #'wxPopupWindow',
88
+ 'wxRadioBox',
89
+ 'wxRadioButton',
90
+ 'wxSashWindow',
91
+ 'wxScrolledWindow',
92
+ 'wxSlider',
93
+ 'wxSpinButton',
94
+ 'wxSpinCtrl',
95
+ 'wxSplitterWindow',
96
+ 'wxStaticBitmap',
97
+ 'wxStaticText',
98
+ 'wxStatusBar',
99
+ 'wxTextCtrl',
100
+ 'wxToggleButton',
101
+ 'wxToolBar',
102
+ 'wxTreeCtrl',
103
+ #'wxValidator',
104
+ ]],
105
+
106
+ # controls coming from other libraries
107
+ ['More Windows/Controls', [
108
+ #'wxFloatBar', deprecated
109
+ #'wxMVCTree', deprecated
110
+ #'wxRightTextCtrl', deprecated as we have wxTE_RIGHT now.
111
+ #'AnalogClockWindow',
112
+ #'ColourSelect',
113
+ #'ContextHelp',
114
+ #'FancyText',
115
+ #'FloatCanvas',
116
+ #'FileBrowseButton',
117
+ #'GenericButtons',
118
+ #'MaskedEditControls',
119
+ #'SplitTree',
120
+ #'TablePrint',
121
+ #'Throbber',
122
+ #'wxCalendar',
123
+ 'wxCalendarCtrl',
124
+ #'wxDynamicSashWindow',
125
+ #'wxEditableListBox',
126
+ #'wxEditor',
127
+ #'wxHtmlWindow',
128
+ #'wxIEHtmlWin',
129
+ #'wxIntCtrl',
130
+ #'wxLEDNumberCtrl',
131
+ #'wxMimeTypesManager',
132
+ #'wxMaskedNumCtrl',
133
+ #'wxMultiSash',
134
+ #'wxPopupControl',
135
+ #'wxStyledTextCtrl_1',
136
+ #'wxStyledTextCtrl_2',
137
+ #'wxTimeCtrl',
138
+ #'wxTreeListCtrl',
139
+ ]],
140
+
141
+ # How to lay out the controls in a frame/dialog
142
+ ['Window Layout', [
143
+ # 'LayoutAnchors',
144
+ # 'Layoutf',
145
+ # 'RowColSizer',
146
+ 'Sizers',
147
+ # 'wxScrolledPanel',
148
+ # 'wxXmlResource',
149
+ # 'wxXmlResourceHandler',
150
+ ]],
151
+
152
+ # ditto
153
+ #['Process and Events', [
154
+ # 'EventManager',
155
+ # 'infoframe',
156
+ # 'OOR',
157
+ # 'PythonEvents',
158
+ # 'Threads',
159
+ # 'wxKeyEvents',
160
+ # 'wxProcess',
161
+ # 'wxTimer',
162
+ # ]],
163
+
164
+ #~ # Clipboard and DnD
165
+ #~ ['Clipboard and DnD', [
166
+ #~ #'CustomDragAndDrop',
167
+ #~ 'DragAndDrop',
168
+ #~ 'URLDragAndDrop',
169
+ #~ ]],
170
+
171
+ # Images
172
+ ['Using Images', [
173
+ # 'Throbber',
174
+ 'wxArtProvider',
175
+ 'wxCursor',
176
+ 'wxDragImage',
177
+ # 'wxImage',
178
+ # 'wxImageFromStream',
179
+ # 'wxMask',
180
+ ]],
181
+
182
+ # Other stuff
183
+ ['Miscellaneous', [
184
+ # 'ColourDB',
185
+ # 'DialogUnits',
186
+ # 'DrawXXXList',
187
+ # 'FontEnumerator',
188
+ # 'PrintFramework',
189
+ 'ShapedWindow',
190
+ # 'Throbber',
191
+ # 'Unicode',
192
+ # 'wxFileHistory',
193
+ # 'wxJoystick',
194
+ # 'wxOGL',
195
+ # 'wxWave',
196
+ ]],
197
+
198
+ # need libs not coming with the demo
199
+ #['Objects using an external library', [
200
+ # 'ActiveXWrapper_Acrobat',
201
+ # 'ActiveXWrapper_IE',
202
+ # 'wxGLCanvas',
203
+ # 'wxPlotCanvas',
204
+ # ]],
205
+
206
+
207
+ ['Check out the samples dir too', [
208
+ ]],
209
+
210
+ ]
211
+
212
+ class DemoCodeViewer < Wx::TextCtrl
213
+ def intialize(parent, id)
214
+ super(parent, id, OVR_TEXT, Wx::DEFAULT_POSITION, Wx::Size.new(400, 400),
215
+ Wx::TE_MULTILINE|Wx::TE_READONLY|Wx::HSCROLL|
216
+ Wx::TE_RICH|Wx::TE_NOHIDESEL)
217
+ end
218
+ end
219
+
220
+ class WxRubyDemo < Wx::Frame
221
+ attr_accessor :otherWin
222
+
223
+ def initialize(title, pos, size, style=Wx::DEFAULT_FRAME_STYLE)
224
+ super(nil,-1,title,pos,size,style)
225
+ @demoID = 6000
226
+ @otherWin = nil
227
+
228
+ icon_file = File.join(File.dirname(__FILE__), 'icons', 'mondrian.xpm')
229
+ icon = Wx::Icon.new(icon_file, Wx::BITMAP_TYPE_XPM)
230
+ set_icon(icon)
231
+
232
+ @tbicon = DemoTaskBarIcon.new(self)
233
+
234
+ evt_idle {|event| on_idle(event)}
235
+ evt_close {|event| on_close(event)}
236
+ evt_iconize {|event| on_iconize(event)}
237
+ evt_maximize {|event| on_maximize(event)}
238
+
239
+ centre(Wx::BOTH)
240
+ create_status_bar(1, Wx::ST_SIZEGRIP)
241
+ set_status_text("Welcome to the WxRuby Demo!")
242
+
243
+ splitter = Wx::SplitterWindow.new(self, -1)
244
+ splitter2 = Wx::SplitterWindow.new(splitter, -1)
245
+
246
+ # Make a File menu
247
+
248
+ @mainmenu = Wx::MenuBar.new
249
+ menu = Wx::Menu.new
250
+ menu.append(Wx::ID_EXIT, "E&xit\tALT-X", "Get the heck outta here!")
251
+ evt_menu(Wx::ID_EXIT) {exit}
252
+ @mainmenu.append(menu, "&File")
253
+
254
+ # Make a Demo menu - thanks to Kevin Smith for figuring the submenus out!
255
+ menu = Wx::Menu.new
256
+ $tree_list.each do |item|
257
+ @submenu = Wx::Menu.new
258
+ item[1].each do |childItem|
259
+ mID = @demoID += 1
260
+ @submenu.append(mID, childItem)
261
+ evt_menu(mID) {|event| on_demo_menu(childItem)}
262
+ end
263
+ menuItem = Wx::MenuItem.new(menu, 500000, item[0], "", Wx::ITEM_NORMAL, @submenu)
264
+ menu.append_item(menuItem)
265
+ end
266
+ @mainmenu.append(menu, "&Demo")
267
+
268
+ # Make a Help menu
269
+ helpID = Wx::ID_ABOUT
270
+ findID = @demoID += 1
271
+ findnextID = @demoID += 1
272
+ clearID = @demoID += 1
273
+ menu = Wx::Menu.new
274
+ menu.append(findID, "&Find\tCtrl-F", "Find in the Demo Code")
275
+ menu.append(findnextID, "Find &Next\tF3", "Find Next")
276
+ menu.append_separator
277
+ menu.append(helpID, "&About\tCtrl-H", "wxRuby RULES!!!")
278
+ evt_menu(helpID) {|event| on_help_about(event)}
279
+ evt_menu(findID) {|event| on_help_find(event)}
280
+ evt_menu(findnextID) {|event| on_find_next(event)}
281
+ evt_find(-1) {|event| on_find(event)}
282
+ evt_find_next(-1) {|event| on_find(event)}
283
+ evt_find_close(-1) {|event| on_find_close(event)}
284
+ @mainmenu.append(menu, "&Help")
285
+ set_menu_bar(@mainmenu)
286
+
287
+ @finddata = Wx::FindReplaceData.new()
288
+
289
+ @treeMap = {}
290
+ @tree = Wx::TreeCtrl.new(splitter)
291
+ root = @tree.add_root("wxRuby Overview")
292
+ firstChild = nil
293
+
294
+ $tree_list.each do |item|
295
+ child = @tree.append_item(root, item[0])
296
+ if not firstChild then firstChild = child end
297
+ item[1].each do |childItem|
298
+ theDemo = @tree.append_item(child, childItem)
299
+ @treeMap[childItem] = theDemo
300
+ end
301
+ end
302
+ @tree.expand(root)
303
+ @tree.expand(firstChild)
304
+
305
+ evt_tree_item_expanded @tree, :on_item_expanded
306
+ evt_tree_item_collapsed @tree, :on_item_collapsed
307
+ evt_tree_sel_changed @tree, :on_tree_sel_changed
308
+ evt_tree_item_activated @tree, :on_tree_sel_changed
309
+ @tree.evt_left_down method(:on_tree_left_down)
310
+
311
+
312
+
313
+ # Create a Notebook
314
+ @nb = Wx::Notebook.new(splitter2, -1, Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, Wx::CLIP_CHILDREN)
315
+
316
+ @ovr = Wx::TextCtrl.new(@nb, -1, OVR_TEXT, Wx::DEFAULT_POSITION,
317
+ Wx::Size.new(400,400),
318
+ Wx::TE_MULTILINE|Wx::TE_READONLY|
319
+ Wx::TE_RICH|Wx::TE_NOHIDESEL)
320
+ @nb.add_page(@ovr, "Overview")
321
+
322
+ if Wx.const_defined?(:Scintilla)
323
+ panel, @txt = setup_editor(@nb)
324
+ @nb.add_page(panel, "Demo Code")
325
+ else
326
+ # FIXME: Should use DemoCodeViewer, but when we do (on Windows) it
327
+ # puts all text on one line! Can remove instance_eval
328
+ # once that's resolved
329
+ @txt = Wx::TextCtrl.new(@nb, -1, OVR_TEXT, Wx::DEFAULT_POSITION,
330
+ Wx::Size.new(400,400),
331
+ Wx::TE_MULTILINE|Wx::TE_READONLY|
332
+ Wx::HSCROLL|Wx::TE_RICH|Wx::TE_NOHIDESEL)
333
+ @txt.instance_eval { alias clear_all clear }
334
+ @txt.set_max_length(0)
335
+ @nb.add_page(@txt, "Demo Code")
336
+ end
337
+
338
+ get_demo_file(__FILE__)
339
+
340
+ @log = Wx::TextCtrl.new(splitter2, -1, "", Wx::DEFAULT_POSITION,
341
+ Wx::DEFAULT_SIZE,
342
+ Wx::TE_MULTILINE|Wx::TE_READONLY|Wx::HSCROLL)
343
+ # For some reason when the number of characters entered is
344
+ # greater than about 10,700, the text control freezes. I know
345
+ # someone mentioned this on the list a while ago...calling
346
+ # set_max_length(0) with zero as the argument tells the text
347
+ # control to default limit that the underlying native text
348
+ # control can handle.
349
+ @log.set_max_length(0)
350
+ Wx::Log::set_active_target(Wx::LogTextCtrl.new(@log))
351
+
352
+ splitter.split_vertically(@tree, splitter2, 190)
353
+ splitter2.split_horizontally(@nb, @log, 200)
354
+
355
+
356
+ splitter.set_minimum_pane_size(20)
357
+ splitter2.set_minimum_pane_size(100)
358
+
359
+ @nb.set_selection(0)
360
+ @tree.select_item(root)
361
+ show_tip()
362
+ end
363
+
364
+ def write_text(text)
365
+ Wx::log_message(text)
366
+ end
367
+
368
+ def on_idle(event)
369
+ if @otherWin != nil
370
+ @otherWin.raise()
371
+ @window = @otherWin
372
+ @otherWin = nil
373
+ end
374
+ end
375
+
376
+ def on_close(event)
377
+ @tbicon.remove_icon
378
+ destroy()
379
+ exit()
380
+ end
381
+
382
+ def on_item_expanded(event)
383
+ item = event.get_item()
384
+ Wx::log_message("on_item_expanded: %s" % @tree.get_item_text(item))
385
+ end
386
+
387
+ def on_item_collapsed(event)
388
+ item = event.get_item()
389
+ Wx::log_message("on_item_collapsed: %s" % @tree.get_item_text(item))
390
+ end
391
+
392
+ def on_tree_sel_changed(event)
393
+ item = event.get_item()
394
+ if item.nonzero?
395
+ itemText = @tree.get_item_text(item)
396
+ run_demo(itemText)
397
+ end
398
+ end
399
+
400
+ def on_tree_left_down(event)
401
+ pt = Wx::Point.new(event.get_x, event.get_y)
402
+ item = @tree.hit_test(pt)
403
+ if item == @tree.get_selection()
404
+ set_overview(@tree.get_item_text(item) + " Overview", @curOverview)
405
+ Wx::log_message(@tree.get_item_text(item) + " Overview")
406
+ end
407
+ event.skip()
408
+ end
409
+
410
+ def run_demo(itemText)
411
+ if @nb.get_page_count() == 3
412
+ if @nb.get_selection() == 2
413
+ @nb.set_selection(0)
414
+ end
415
+ if @window != nil
416
+ @window = nil
417
+ end
418
+ @nb.delete_page(2)
419
+ end
420
+
421
+ if itemText == "wxRuby Overview"
422
+ get_demo_file(__FILE__)
423
+ set_overview("wxRuby Overview", OVR_TEXT)
424
+ @nb.refresh()
425
+ @window = nil
426
+ else
427
+ demo_file = File.join( File.dirname(__FILE__), itemText + '.rbw')
428
+ if File.exist?(demo_file)
429
+ Wx::log_message("Running Demo: " + itemText + ".rbw")
430
+ get_demo_file(demo_file)
431
+ # I use load() here because it allows the user to modify
432
+ # the underlying file for each sample, so that each time
433
+ # They run it any changes made will be reflected without
434
+ # having to restart the demo.
435
+ begin
436
+ load demo_file
437
+ set_overview(itemText + " Overview", Demo::overview)
438
+ @tree.refresh()
439
+ @nb.refresh()
440
+ @window = Demo.run(self, @nb, self)
441
+ if @window.class.ancestors.include?(Wx::Window)
442
+ # Check to see if the demo returned a Wx::Window, Wx::Panel or a new class inheriting from them
443
+ # if so, create a new tab in the notebook for them
444
+ @nb.add_page(@window, "Demo")
445
+ @nb.set_selection(2)
446
+ @nb.refresh()
447
+ end
448
+ rescue Exception => problem
449
+ dlg = Wx::MessageDialog.new(self, "A problem occurred with the %s demo:\n%s\n%s" % [itemText, problem, problem.backtrace().join("\n").to_s()],
450
+ "Error!!!", Wx::OK | Wx::ICON_ERROR)
451
+ dlg.show_modal()
452
+ dlg.destroy()
453
+ end
454
+ else
455
+ @ovr.set_value("")
456
+ @txt.clear_all
457
+ @window = nil
458
+ end
459
+ end
460
+ @tree.set_focus()
461
+ end
462
+
463
+ def get_demo_file(fileName)
464
+ @filename = fileName
465
+ @txt.clear()
466
+ @txt.load_file(fileName)
467
+ if @txt.is_a?(Wx::TextCtrl)
468
+ @txt.set_insertion_point(0)
469
+ @txt.show_position(0)
470
+ end
471
+ end
472
+
473
+ def set_overview(name, text)
474
+ text ||= ''
475
+ @curOverview = text
476
+ @ovr.set_value(text)
477
+ @ovr.set_style(0,text.length,Wx::TextAttr.new(Wx::BLUE, Wx::Colour.new("White"), Wx::Font.new(12, Wx::FONTFAMILY_SWISS, Wx::FONTSTYLE_NORMAL, Wx::FONTWEIGHT_BOLD)))
478
+ @nb.set_page_text(0, name)
479
+ end
480
+
481
+ # Menu Methods
482
+
483
+ def on_file_exit(event)
484
+ close()
485
+ end
486
+
487
+ def on_help_about(event)
488
+ load File.join(File.dirname(__FILE__), "About.rbw")
489
+ about = About::MyAboutBox.new(self)
490
+ about.show_modal()
491
+ about.destroy()
492
+ end
493
+
494
+ def on_help_find(event)
495
+ @nb.set_selection(1)
496
+ @finddlg = Wx::FindReplaceDialog.new(self, @finddata, "Find", Wx::FR_NOUPDOWN | Wx::FR_NOMATCHCASE | Wx::FR_NOWHOLEWORD)
497
+ @finddlg.show()
498
+ end
499
+
500
+ def on_find(event)
501
+ # FIXME: These problems are probably resolved now
502
+ # Problems
503
+ # 1) For some reason, the control is not properly counting EOL characters - it almost seems to be skipping them
504
+ # causing the control to incorrectly set the initial insertion point for the the "found" text
505
+ # 2) This also is causing problems with the amount of text that is highlighted - the length of the highlighted string
506
+ # is less than it should be
507
+ # 3) After doing an initial "find" operation, using the "find next" operation causes the program to crash - again, I
508
+ # don't know why this is :(
509
+ # Example - When I try to find "menu", the text that gets highlighted is the newline on the second line and the "ME" of
510
+ # MENU_EXIT - a total of only 3 characters, when it should highlight all of "menu". I don't fully understand
511
+ # this problem, but it doesn't appear until after you attempt to find text beyond the first line :(
512
+ if @txt.is_a?(Wx::TextCtrl)
513
+ @nb.set_selection(1)
514
+ myEnd = @txt.get_last_position()
515
+ write_text("Last position = %d" % myEnd)
516
+ textstring = @txt.get_range(0,myEnd).downcase()
517
+ if Wx::PLATFORM == "WXMSW"
518
+ textstring.sub!(/\n/, "\r\n")
519
+ end
520
+ #write_text("textstring - %s" % textstring)
521
+ start = @txt.get_insertion_point()
522
+ write_text("insertion point = " + start.to_s())
523
+ findstring = @finddata.get_find_string().downcase()
524
+ write_text("finddata = " + findstring)
525
+ loc = textstring.index(findstring, start)
526
+ write_text("location = " + loc.to_s())
527
+ write_text("findstring.length() = " + findstring.length().to_s())
528
+ if loc == nil and start != 0
529
+ # string not found, start at beginning
530
+ start = 0
531
+ loc = textstring.index(findstring, start)
532
+ end
533
+
534
+ if loc == nil
535
+ dlg = Wx::MessageDialog.new(self, 'Find String Not Found', 'Find String Not Found in Demo File',
536
+ Wx::OK | Wx::ICON_INFORMATION)
537
+ dlg.show_modal()
538
+ dlg.destroy()
539
+ end
540
+
541
+ if @finddlg
542
+ if loc == nil
543
+ @finddlg.set_focus()
544
+ return
545
+ else
546
+ @finddlg.destroy()
547
+ end
548
+ end
549
+ @txt.show_position(loc)
550
+ @txt.set_selection(loc, loc + findstring.length())
551
+ else # Scintilla
552
+ # FIXME: Take into account search direction
553
+ @txt.set_target_start(@txt.get_target_end)
554
+ @txt.set_target_end(@txt.get_length - 1)
555
+ # FIXME: get flags from find dialog
556
+ @txt.set_search_flags(0)
557
+ loc = @txt.search_in_target(event.get_find_string)
558
+ if loc == -1
559
+ dlg = Wx::MessageDialog.new(self, 'Find String Not Found', 'Find String Not Found in Demo File',
560
+ Wx::OK | Wx::ICON_INFORMATION)
561
+ dlg.show_modal()
562
+ dlg.destroy()
563
+ end
564
+
565
+ if @finddlg
566
+ if loc == -1
567
+ @finddlg.set_focus()
568
+ return
569
+ end
570
+ end
571
+ @txt.ensure_caret_visible
572
+ @txt.set_selection(loc, loc + event.get_find_string.length)
573
+ end
574
+ end
575
+
576
+ def on_find_next(event)
577
+ # FIXME: Saving an event is probably a bad idea
578
+ if @finddata.get_find_string() != ""
579
+ on_find(event)
580
+ else
581
+ on_help_find(event)
582
+ end
583
+ end
584
+
585
+ def on_find_close(event)
586
+ event.get_dialog().destroy()
587
+ end
588
+
589
+ def show_tip()
590
+ tips_file = File.join(File.dirname(__FILE__), 'tips.txt')
591
+ tp = Wx::create_file_tip_provider( tips_file, rand(6) )
592
+ Wx::show_tip(self, tp)
593
+ end
594
+
595
+ def on_demo_menu(childItem)
596
+ # Also, for some reason I haven't figured out yet either, the demo executes two times
597
+ selectedDemo = @treeMap[childItem]
598
+ if selectedDemo
599
+ @tree.select_item(selectedDemo)
600
+ @tree.ensure_visible(selectedDemo)
601
+ end
602
+ end
603
+
604
+ def on_iconize(event)
605
+ Wx::log_message("on_iconify")
606
+ event.skip
607
+ end
608
+
609
+ def on_maximize(event)
610
+ Wx::log_message("on_maximize")
611
+ event.skip
612
+ end
613
+
614
+ # FIXME: Refactor into a class
615
+ def setup_editor(parent)
616
+ panel = Wx::Panel.new(parent)
617
+ panel.hide
618
+ sci = setup_scintilla(panel)
619
+ @save_button = Wx::Button.new(panel, -1, 'Save Changes')
620
+ @delete_button = Wx::Button.new(panel, -1, 'Delete Modified')
621
+ @save_button.enable(false);
622
+ panel.evt_button(@save_button.get_id) { on_save }
623
+ panel.evt_button(@delete_button.get_id) { on_delete }
624
+ panel.evt_sci_modified { on_modified }
625
+
626
+ radio_buttons = {:original => Wx::RadioButton.new(panel, -1, "Original", Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, Wx::RB_GROUP),
627
+ :modified => Wx::RadioButton.new(panel, -1, "Modified")}
628
+
629
+ @control_box = Wx::BoxSizer.new(Wx::HORIZONTAL)
630
+ @control_box.add(Wx::StaticText.new(panel, -1, 'Active Version:'), 0, Wx::RIGHT | Wx::LEFT | Wx::ALIGN_CENTER_VERTICAL, 5)
631
+ radio_buttons.each_pair { |id, button|
632
+ @control_box.add(button, 0, Wx::EXPAND | Wx::RIGHT, 5)
633
+ evt_radiobutton(button.get_id) { |event| on_radio_button(event) }
634
+ }
635
+ @control_box.add(@save_button, 0, Wx::RIGHT, 5)
636
+ @control_box.add(@delete_button, 0)
637
+
638
+ @box = Wx::BoxSizer.new(Wx::VERTICAL)
639
+ @box.add(@control_box, 0, Wx::EXPAND)
640
+ @box.add(Wx::StaticLine.new(panel), 0, Wx::EXPAND)
641
+
642
+ @box.add(sci, 1, Wx::EXPAND)
643
+ @box.fit(panel)
644
+ panel.set_sizer(@box)
645
+ [panel, sci]
646
+ end
647
+
648
+ def setup_scintilla(parent)
649
+ sci = Wx::Scintilla.new(parent)
650
+ font = Wx::Font.new(10, Wx::TELETYPE, Wx::NORMAL, Wx::NORMAL)
651
+ sci.style_set_font(Wx::SCI_STYLE_DEFAULT, font);
652
+ sci.set_edge_mode(Wx::SCI_EDGE_LINE)
653
+ line_num_margin = sci.text_width(Wx::SCI_STYLE_LINENUMBER, "_99999")
654
+ sci.set_margin_width(0, line_num_margin)
655
+
656
+ sci.style_set_foreground(Wx::SCI_STYLE_DEFAULT, Wx::BLACK);
657
+ sci.style_set_background(Wx::SCI_STYLE_DEFAULT, Wx::WHITE);
658
+ sci.style_set_foreground(Wx::SCI_STYLE_LINENUMBER, Wx::LIGHT_GREY);
659
+ sci.style_set_background(Wx::SCI_STYLE_LINENUMBER, Wx::WHITE);
660
+ sci.style_set_foreground(Wx::SCI_STYLE_INDENTGUIDE, Wx::LIGHT_GREY);
661
+
662
+ sci.set_tab_width(2)
663
+ sci.set_use_tabs(false)
664
+ sci.set_tab_indents(true)
665
+ sci.set_back_space_un_indents(true)
666
+ sci.set_indent(2)
667
+ sci.set_edge_column(80)
668
+
669
+ sci.set_lexer(Wx::SCI_LEX_RUBY)
670
+ sci.style_clear_all
671
+ sci.style_set_foreground(2, Wx::RED)
672
+ sci.style_set_foreground(3, Wx::GREEN)
673
+ sci.style_set_foreground(5, Wx::BLUE)
674
+ sci.style_set_foreground(6, Wx::BLUE)
675
+ sci.style_set_foreground(7, Wx::BLUE)
676
+ sci.set_key_words(0, "begin break elsif module retry unless end case next return until class ensure nil self when def false not super while alias defined? for or then yield and do if redo true else in rescue undef")
677
+
678
+ sci.set_property("fold","1")
679
+ sci.set_property("fold.compact", "0")
680
+ sci.set_property("fold.comment", "1")
681
+ sci.set_property("fold.preprocessor", "1")
682
+
683
+ sci.set_margin_width(1, 0)
684
+ sci.set_margin_type(1, Wx::SCI_MARGIN_SYMBOL)
685
+ sci.set_margin_mask(1, Wx::SCI_MASK_FOLDERS)
686
+ sci.set_margin_width(1, 20)
687
+
688
+ sci.marker_define(Wx::SCI_MARKNUM_FOLDER, Wx::SCI_MARK_PLUS)
689
+ sci.marker_define(Wx::SCI_MARKNUM_FOLDEROPEN, Wx::SCI_MARK_MINUS)
690
+ sci.marker_define(Wx::SCI_MARKNUM_FOLDEREND, Wx::SCI_MARK_EMPTY)
691
+ sci.marker_define(Wx::SCI_MARKNUM_FOLDERMIDTAIL, Wx::SCI_MARK_EMPTY)
692
+ sci.marker_define(Wx::SCI_MARKNUM_FOLDEROPENMID, Wx::SCI_MARK_EMPTY)
693
+ sci.marker_define(Wx::SCI_MARKNUM_FOLDERSUB, Wx::SCI_MARK_EMPTY)
694
+ sci.marker_define(Wx::SCI_MARKNUM_FOLDERTAIL, Wx::SCI_MARK_EMPTY)
695
+ sci.set_fold_flags(16)
696
+
697
+ sci.set_margin_sensitive(1,1)
698
+ sci
699
+ end
700
+
701
+ def on_save
702
+ if not FileTest.directory?(File.dirname(modified_filename))
703
+ if not Dir.mkdir(File.dirname(modified_filename))
704
+ Wx::log_message("Unable to create directory 'modified'")
705
+ return
706
+ end
707
+ end
708
+ File.open(modified_filename, "w") { |file|
709
+ file.write(@txt.get_text)
710
+ }
711
+ # FIXME: Reload module we just saved
712
+ end
713
+
714
+ def on_delete
715
+ if File.exists?(modified_filename)
716
+ File.unlink(modified_filename)
717
+ end
718
+ # FIXME: Update state
719
+ end
720
+
721
+ def on_modified
722
+ @save_button.enable(@txt.get_modify)
723
+ end
724
+
725
+ def on_radio_button(event)
726
+ # FIXME: Can't do anything here yet
727
+ end
728
+
729
+ def modified_filename
730
+ File.join(File.dirname(@filename), "modified", File.basename(@filename))
731
+ end
732
+ end
733
+
734
+ class DemoTaskBarIcon < Wx::TaskBarIcon
735
+ # TODO: Need a new_id function like wxPython has
736
+ TBMENU_RESTORE = 6000
737
+ TBMENU_CLOSE = 6001
738
+ TBMENU_CHANGE = 6002
739
+ TBMENU_REMOVE = 6003
740
+
741
+ def initialize(frame)
742
+ super()
743
+
744
+ @frame = frame
745
+
746
+ # starting image
747
+ icon = make_icon('ruby.png')
748
+ set_icon(icon, 'wxRuby Demo')
749
+ @image_index = 1
750
+
751
+ # events
752
+ evt_taskbar_left_dclick {|evt| on_taskbar_activate(evt) }
753
+
754
+ evt_menu(TBMENU_RESTORE) {|evt| on_taskbar_activate(evt) }
755
+ evt_menu(TBMENU_CLOSE) { @frame.close }
756
+ evt_menu(TBMENU_CHANGE) {|evt| on_taskbar_change(evt) }
757
+ evt_menu(TBMENU_REMOVE) { remove_icon }
758
+ end
759
+
760
+ def create_popup_menu
761
+ # Called by the base class when it needs to popup the menu
762
+ # (the default evt_right_down event). Create and return
763
+ # the menu to display.
764
+ menu = Wx::Menu.new
765
+ menu.append(TBMENU_RESTORE, "Restore wxRuby Demo")
766
+ menu.append(TBMENU_CLOSE, "Close wxRuby Demo")
767
+ menu.append_separator
768
+ menu.append(TBMENU_CHANGE, "Change the TB Icon")
769
+ menu.append(TBMENU_REMOVE, "Remove the TB Icon")
770
+ return menu
771
+ end
772
+
773
+ def make_icon(imgname)
774
+ # Different platforms have different requirements for the
775
+ # taskbar icon size
776
+ filename = File.join( File.dirname(__FILE__), 'icons', imgname )
777
+ img = Wx::Image.new(filename)
778
+ if Wx::PLATFORM == "WXMSW"
779
+ img = img.scale(16, 16)
780
+ elsif Wx::PLATFORM == "WXGTK"
781
+ img = img.scale(22, 22)
782
+ end
783
+ # WXMAC can be any size up to 128x128, so don't scale
784
+ icon = Wx::Icon.new
785
+ icon.copy_from_bitmap(Wx::Bitmap.new(img))
786
+ return icon
787
+ end
788
+
789
+ def on_taskbar_activate(evt)
790
+ if @frame.is_iconized
791
+ @frame.iconize(false)
792
+ end
793
+ if not @frame.is_shown
794
+ @frame.show(true)
795
+ end
796
+ @frame.raise
797
+ end
798
+
799
+ def on_taskbar_change(evt)
800
+ names = [ "ruby.png", "wxwin16x16.xpm", "smiles.xpm", "mondrian.xpm" ]
801
+ name = names[@image_index]
802
+ @image_index += 1
803
+ if @image_index >= names.length
804
+ @image_index = 0
805
+ end
806
+
807
+ icon = make_icon(name)
808
+ set_icon(icon, 'This is a new icon: ' + name)
809
+ end
810
+
811
+ end
812
+
813
+ class DemoApp < Wx::App
814
+ def on_init
815
+ frame = WxRubyDemo.new("WxRuby BIG combined demo",
816
+ Wx::DEFAULT_POSITION,
817
+ Wx::Size.new(750, 550))
818
+
819
+ frame.show(true)
820
+ end
821
+ end
822
+
823
+ demo = DemoApp.new
824
+ demo.main_loop