wxruby3 0.9.0.pre.beta.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (754) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +13 -0
  3. data/CREDITS.md +52 -0
  4. data/LICENSE +21 -0
  5. data/README.md +139 -0
  6. data/bin/wxruby +9 -0
  7. data/ext/mkrf_conf_srcgem.rb +64 -0
  8. data/ext/wxruby3/include/wxruby-runtime.h +104 -0
  9. data/ext/wxruby3/swig/RubyStockObjects.i +62 -0
  10. data/ext/wxruby3/swig/common.i +110 -0
  11. data/ext/wxruby3/swig/custom/rubyprimtypes.swg +225 -0
  12. data/ext/wxruby3/swig/custom/rubytracking.swg +60 -0
  13. data/ext/wxruby3/swig/custom/swig3/rubyrun.swg +456 -0
  14. data/ext/wxruby3/swig/custom/swig4/rubyrun.swg +459 -0
  15. data/ext/wxruby3/swig/mark_free_impl.i +377 -0
  16. data/ext/wxruby3/swig/memory_management.i +142 -0
  17. data/ext/wxruby3/swig/typedefs.i +27 -0
  18. data/ext/wxruby3/swig/wx.i +282 -0
  19. data/ext/wxruby3/swig/wx.rc +19 -0
  20. data/ext/wxruby3/wxruby.ico +0 -0
  21. data/lib/wx/accessors.rb +63 -0
  22. data/lib/wx/aui/auimanager.rb +17 -0
  23. data/lib/wx/aui/auinotebook.rb +9 -0
  24. data/lib/wx/aui/require.rb +9 -0
  25. data/lib/wx/aui.rb +14 -0
  26. data/lib/wx/core/acceleratortable.rb +28 -0
  27. data/lib/wx/core/animation.rb +18 -0
  28. data/lib/wx/core/app.rb +89 -0
  29. data/lib/wx/core/artprovider.rb +31 -0
  30. data/lib/wx/core/bitmap.rb +59 -0
  31. data/lib/wx/core/busycursor.rb +12 -0
  32. data/lib/wx/core/choice.rb +4 -0
  33. data/lib/wx/core/choicedlg.rb +54 -0
  34. data/lib/wx/core/clientdc.rb +13 -0
  35. data/lib/wx/core/clipboard.rb +56 -0
  36. data/lib/wx/core/collapsible_pane.rb +12 -0
  37. data/lib/wx/core/colour.rb +34 -0
  38. data/lib/wx/core/combobox.rb +4 -0
  39. data/lib/wx/core/controlwithitems.rb +10 -0
  40. data/lib/wx/core/data_object.rb +10 -0
  41. data/lib/wx/core/dataformat.rb +26 -0
  42. data/lib/wx/core/dc.rb +68 -0
  43. data/lib/wx/core/dialog.rb +50 -0
  44. data/lib/wx/core/enum.rb +28 -0
  45. data/lib/wx/core/event.rb +16 -0
  46. data/lib/wx/core/evthandler.rb +253 -0
  47. data/lib/wx/core/ext.rb +58 -0
  48. data/lib/wx/core/font.rb +22 -0
  49. data/lib/wx/core/functions.rb +44 -0
  50. data/lib/wx/core/gauge.rb +12 -0
  51. data/lib/wx/core/genericdirctrl.rb +36 -0
  52. data/lib/wx/core/hboxsizer.rb +6 -0
  53. data/lib/wx/core/helpcontroller.rb +5 -0
  54. data/lib/wx/core/helpcontrollerhelpprovider.rb +24 -0
  55. data/lib/wx/core/helpprovider.rb +15 -0
  56. data/lib/wx/core/icon.rb +40 -0
  57. data/lib/wx/core/image.rb +68 -0
  58. data/lib/wx/core/imagelist.rb +3 -0
  59. data/lib/wx/core/listbox.rb +4 -0
  60. data/lib/wx/core/listctrl.rb +33 -0
  61. data/lib/wx/core/locale.rb +73 -0
  62. data/lib/wx/core/log.rb +20 -0
  63. data/lib/wx/core/menu.rb +78 -0
  64. data/lib/wx/core/menu_bar.rb +20 -0
  65. data/lib/wx/core/menuitem.rb +7 -0
  66. data/lib/wx/core/notebook.rb +9 -0
  67. data/lib/wx/core/object.rb +14 -0
  68. data/lib/wx/core/pen_info.rb +11 -0
  69. data/lib/wx/core/platform_info.rb +13 -0
  70. data/lib/wx/core/point.rb +92 -0
  71. data/lib/wx/core/real_point.rb +92 -0
  72. data/lib/wx/core/rect.rb +57 -0
  73. data/lib/wx/core/simplehelpprovider.rb +38 -0
  74. data/lib/wx/core/size.rb +86 -0
  75. data/lib/wx/core/sizer.rb +43 -0
  76. data/lib/wx/core/splash_screen.rb +44 -0
  77. data/lib/wx/core/textctrl.rb +8 -0
  78. data/lib/wx/core/timer.rb +104 -0
  79. data/lib/wx/core/toolbar.rb +37 -0
  80. data/lib/wx/core/toolbartool.rb +4 -0
  81. data/lib/wx/core/treectrl.rb +46 -0
  82. data/lib/wx/core/validator.rb +8 -0
  83. data/lib/wx/core/variant.rb +62 -0
  84. data/lib/wx/core/vboxsizer.rb +6 -0
  85. data/lib/wx/core/window.rb +95 -0
  86. data/lib/wx/core/window_update_locker.rb +12 -0
  87. data/lib/wx/core/xmlresource.rb +56 -0
  88. data/lib/wx/core.rb +61 -0
  89. data/lib/wx/doc/aui/auimanager.rb +12 -0
  90. data/lib/wx/doc/aui/auinotebook.rb +9 -0
  91. data/lib/wx/doc/colour_dialog.rb +15 -0
  92. data/lib/wx/doc/core.rb +11 -0
  93. data/lib/wx/doc/dc.rb +49 -0
  94. data/lib/wx/doc/enum.rb +88 -0
  95. data/lib/wx/doc/evthandler.rb +87 -0
  96. data/lib/wx/doc/extra/00_starting.md +154 -0
  97. data/lib/wx/doc/extra/01_packages.md +179 -0
  98. data/lib/wx/doc/extra/02_lifecycles.md +116 -0
  99. data/lib/wx/doc/extra/03_dialogs.md +57 -0
  100. data/lib/wx/doc/extra/04_enums.md +143 -0
  101. data/lib/wx/doc/extra/05_event-handling.md +166 -0
  102. data/lib/wx/doc/extra/06_geometry.md +56 -0
  103. data/lib/wx/doc/extra/07_colour_and_font.md +52 -0
  104. data/lib/wx/doc/extra/08_extensions.md +144 -0
  105. data/lib/wx/doc/extra/09_exceptions.md +54 -0
  106. data/lib/wx/doc/functions.rb +221 -0
  107. data/lib/wx/doc/gdi_common.rb +181 -0
  108. data/lib/wx/doc/grid/grid.rb +20 -0
  109. data/lib/wx/doc/help_controller.rb +14 -0
  110. data/lib/wx/doc/html/html_help_controller.rb +8 -0
  111. data/lib/wx/doc/pg/events.rb +15 -0
  112. data/lib/wx/doc/pg/pg_property.rb +8 -0
  113. data/lib/wx/doc/pg/pgeditor.rb +21 -0
  114. data/lib/wx/doc/pg/property_grid.rb +48 -0
  115. data/lib/wx/doc/pg/property_grid_interface.rb +64 -0
  116. data/lib/wx/doc/prt/page_setup_dialog.rb +15 -0
  117. data/lib/wx/doc/prt/print_data.rb +9 -0
  118. data/lib/wx/doc/prt/print_dialog.rb +26 -0
  119. data/lib/wx/doc/prt/printer.rb +15 -0
  120. data/lib/wx/doc/rbn/ribbon_bar.rb +9 -0
  121. data/lib/wx/doc/rbn/ribbon_button_bar.rb +9 -0
  122. data/lib/wx/doc/rbn/ribbon_gallery.rb +9 -0
  123. data/lib/wx/doc/rbn/ribbon_tool_bar.rb +9 -0
  124. data/lib/wx/doc/rtc/richtext_printing.rb +14 -0
  125. data/lib/wx/doc/screen_dc.rb +10 -0
  126. data/lib/wx/doc/stock_objects.rb +98 -0
  127. data/lib/wx/doc/stream.rb +38 -0
  128. data/lib/wx/doc/system_settings.rb +29 -0
  129. data/lib/wx/doc/treebook.rb +9 -0
  130. data/lib/wx/doc/variant.rb +163 -0
  131. data/lib/wx/doc/xml_resource.rb +19 -0
  132. data/lib/wx/global_const.rb +84 -0
  133. data/lib/wx/grid/grid.rb +7 -0
  134. data/lib/wx/grid/keyword_defs.rb +10 -0
  135. data/lib/wx/grid/require.rb +9 -0
  136. data/lib/wx/grid.rb +14 -0
  137. data/lib/wx/helpers.rb +65 -0
  138. data/lib/wx/html/htmlhelpcontroller.rb +6 -0
  139. data/lib/wx/html/htmlwindow.rb +19 -0
  140. data/lib/wx/html/keyword_defs.rb +22 -0
  141. data/lib/wx/html/require.rb +10 -0
  142. data/lib/wx/html.rb +15 -0
  143. data/lib/wx/keyword_ctors.rb +226 -0
  144. data/lib/wx/keyword_defs.rb +487 -0
  145. data/lib/wx/pg/events.rb +14 -0
  146. data/lib/wx/pg/keyword_defs.rb +15 -0
  147. data/lib/wx/pg/pg_editor.rb +13 -0
  148. data/lib/wx/pg/pg_properties.rb +24 -0
  149. data/lib/wx/pg/pg_property.rb +27 -0
  150. data/lib/wx/pg/property_grid.rb +71 -0
  151. data/lib/wx/pg/property_grid_interface.rb +46 -0
  152. data/lib/wx/pg/require.rb +12 -0
  153. data/lib/wx/pg.rb +14 -0
  154. data/lib/wx/prt/keyword_defs.rb +8 -0
  155. data/lib/wx/prt/page_setup_dialog.rb +15 -0
  156. data/lib/wx/prt/previewframe.rb +13 -0
  157. data/lib/wx/prt/require.rb +8 -0
  158. data/lib/wx/prt.rb +14 -0
  159. data/lib/wx/rbn/events.rb +4 -0
  160. data/lib/wx/rbn/keyword_defs.rb +43 -0
  161. data/lib/wx/rbn/require.rb +12 -0
  162. data/lib/wx/rbn/ribbon_art_provider.rb +10 -0
  163. data/lib/wx/rbn/ribbon_bar.rb +12 -0
  164. data/lib/wx/rbn/ribbon_button_bar.rb +26 -0
  165. data/lib/wx/rbn/ribbon_control.rb +25 -0
  166. data/lib/wx/rbn/ribbon_gallery.rb +26 -0
  167. data/lib/wx/rbn/ribbon_page.rb +15 -0
  168. data/lib/wx/rbn/ribbon_panel.rb +15 -0
  169. data/lib/wx/rbn/ribbon_tool_bar.rb +26 -0
  170. data/lib/wx/rbn.rb +14 -0
  171. data/lib/wx/rtc/ext.rb +15 -0
  172. data/lib/wx/rtc/keyword_defs.rb +17 -0
  173. data/lib/wx/rtc/require.rb +8 -0
  174. data/lib/wx/rtc.rb +15 -0
  175. data/lib/wx/stc/keyword_defs.rb +8 -0
  176. data/lib/wx/stc/require.rb +7 -0
  177. data/lib/wx/stc.rb +14 -0
  178. data/lib/wx/version.rb +3 -0
  179. data/lib/wx/wxruby/base.rb +87 -0
  180. data/lib/wx/wxruby/cmd/sampler.rb +68 -0
  181. data/lib/wx/wxruby/cmd/test.rb +27 -0
  182. data/lib/wx.rb +14 -0
  183. data/rakelib/build.rake +62 -0
  184. data/rakelib/build.rb +141 -0
  185. data/rakelib/config.rake +48 -0
  186. data/rakelib/configure.rb +131 -0
  187. data/rakelib/doc.rake +21 -0
  188. data/rakelib/doc.rb +35 -0
  189. data/rakelib/install.rake +30 -0
  190. data/rakelib/install.rb +220 -0
  191. data/rakelib/lib/config/cygwin.rb +6 -0
  192. data/rakelib/lib/config/linux.rb +78 -0
  193. data/rakelib/lib/config/macosx.rb +6 -0
  194. data/rakelib/lib/config/mingw.rb +133 -0
  195. data/rakelib/lib/config/netbsd.rb +6 -0
  196. data/rakelib/lib/config/unixish.rb +187 -0
  197. data/rakelib/lib/config.rb +673 -0
  198. data/rakelib/lib/core/include/enum.inc +306 -0
  199. data/rakelib/lib/core/include/funcall.inc +277 -0
  200. data/rakelib/lib/core/include/init.inc +95 -0
  201. data/rakelib/lib/core/mapping.rb +1116 -0
  202. data/rakelib/lib/core/package.rb +634 -0
  203. data/rakelib/lib/core/parameter.rb +222 -0
  204. data/rakelib/lib/core/spec.rb +468 -0
  205. data/rakelib/lib/core/spec_helper.rb +405 -0
  206. data/rakelib/lib/director/about_dialog_info.rb +24 -0
  207. data/rakelib/lib/director/accelerator.rb +88 -0
  208. data/rakelib/lib/director/animation.rb +84 -0
  209. data/rakelib/lib/director/animation_ctrl.rb +24 -0
  210. data/rakelib/lib/director/any_button.rb +34 -0
  211. data/rakelib/lib/director/app.rb +420 -0
  212. data/rakelib/lib/director/art_provider.rb +124 -0
  213. data/rakelib/lib/director/aui_dock_art.rb +23 -0
  214. data/rakelib/lib/director/aui_floating_frame.rb +26 -0
  215. data/rakelib/lib/director/aui_manager.rb +114 -0
  216. data/rakelib/lib/director/aui_manager_event.rb +22 -0
  217. data/rakelib/lib/director/aui_mdi_child_frame.rb +50 -0
  218. data/rakelib/lib/director/aui_mdi_client_window.rb +23 -0
  219. data/rakelib/lib/director/aui_mdi_parent_frame.rb +26 -0
  220. data/rakelib/lib/director/aui_notebook.rb +77 -0
  221. data/rakelib/lib/director/aui_notebook_event.rb +23 -0
  222. data/rakelib/lib/director/aui_pane_info.rb +102 -0
  223. data/rakelib/lib/director/aui_tab_art.rb +47 -0
  224. data/rakelib/lib/director/aui_tab_ctrl.rb +121 -0
  225. data/rakelib/lib/director/aui_toolbar.rb +22 -0
  226. data/rakelib/lib/director/aui_toolbar_art.rb +24 -0
  227. data/rakelib/lib/director/aui_toolbar_event.rb +23 -0
  228. data/rakelib/lib/director/aui_toolbar_item.rb +21 -0
  229. data/rakelib/lib/director/bitmap.rb +87 -0
  230. data/rakelib/lib/director/book_ctrls.rb +104 -0
  231. data/rakelib/lib/director/brush.rb +28 -0
  232. data/rakelib/lib/director/busy_info.rb +71 -0
  233. data/rakelib/lib/director/button.rb +22 -0
  234. data/rakelib/lib/director/calendar_ctrl.rb +98 -0
  235. data/rakelib/lib/director/calendar_date_attr.rb +22 -0
  236. data/rakelib/lib/director/caret.rb +31 -0
  237. data/rakelib/lib/director/check_listbox.rb +33 -0
  238. data/rakelib/lib/director/choice.rb +32 -0
  239. data/rakelib/lib/director/clipboard.rb +37 -0
  240. data/rakelib/lib/director/collapsible_pane.rb +22 -0
  241. data/rakelib/lib/director/collapsible_pane_event.rb +22 -0
  242. data/rakelib/lib/director/colour.rb +64 -0
  243. data/rakelib/lib/director/colour_picker_ctrl.rb +22 -0
  244. data/rakelib/lib/director/combobox.rb +37 -0
  245. data/rakelib/lib/director/control.rb +22 -0
  246. data/rakelib/lib/director/ctrl_with_items.rb +68 -0
  247. data/rakelib/lib/director/cursor.rb +28 -0
  248. data/rakelib/lib/director/data_format.rb +31 -0
  249. data/rakelib/lib/director/data_object.rb +64 -0
  250. data/rakelib/lib/director/date_event.rb +141 -0
  251. data/rakelib/lib/director/date_picker_ctrl.rb +39 -0
  252. data/rakelib/lib/director/dc.rb +52 -0
  253. data/rakelib/lib/director/defs.rb +139 -0
  254. data/rakelib/lib/director/derived_dc.rb +64 -0
  255. data/rakelib/lib/director/dialog.rb +214 -0
  256. data/rakelib/lib/director/dir_filterlist_ctrl.rb +29 -0
  257. data/rakelib/lib/director/dir_picker_ctrl.rb +22 -0
  258. data/rakelib/lib/director/drag_image.rb +20 -0
  259. data/rakelib/lib/director/dragdrop.rb +61 -0
  260. data/rakelib/lib/director/editable_listbox.rb +21 -0
  261. data/rakelib/lib/director/event.rb +171 -0
  262. data/rakelib/lib/director/event_handler.rb +410 -0
  263. data/rakelib/lib/director/events.rb +39 -0
  264. data/rakelib/lib/director/file_picker_ctrl.rb +22 -0
  265. data/rakelib/lib/director/find_dialog_event.rb +22 -0
  266. data/rakelib/lib/director/find_replace_data.rb +20 -0
  267. data/rakelib/lib/director/font.rb +138 -0
  268. data/rakelib/lib/director/font_data.rb +22 -0
  269. data/rakelib/lib/director/font_picker_ctrl.rb +22 -0
  270. data/rakelib/lib/director/frame.rb +74 -0
  271. data/rakelib/lib/director/fs_file.rb +353 -0
  272. data/rakelib/lib/director/functions.rb +284 -0
  273. data/rakelib/lib/director/gdi_object.rb +21 -0
  274. data/rakelib/lib/director/gdicommon.rb +94 -0
  275. data/rakelib/lib/director/generic_dirctrl.rb +24 -0
  276. data/rakelib/lib/director/graphics_context.rb +143 -0
  277. data/rakelib/lib/director/graphics_object.rb +69 -0
  278. data/rakelib/lib/director/grid_cell_attr.rb +53 -0
  279. data/rakelib/lib/director/grid_cell_editor.rb +434 -0
  280. data/rakelib/lib/director/grid_cell_renderer.rb +132 -0
  281. data/rakelib/lib/director/grid_ctrl.rb +390 -0
  282. data/rakelib/lib/director/grid_range_select_event.rb +23 -0
  283. data/rakelib/lib/director/grid_table_base.rb +63 -0
  284. data/rakelib/lib/director/grid_table_message.rb +20 -0
  285. data/rakelib/lib/director/help_controller.rb +75 -0
  286. data/rakelib/lib/director/help_provider.rb +103 -0
  287. data/rakelib/lib/director/html_cell.rb +36 -0
  288. data/rakelib/lib/director/html_easy_printing.rb +45 -0
  289. data/rakelib/lib/director/html_event.rb +24 -0
  290. data/rakelib/lib/director/html_help_data.rb +43 -0
  291. data/rakelib/lib/director/html_help_frame.rb +25 -0
  292. data/rakelib/lib/director/html_listbox.rb +54 -0
  293. data/rakelib/lib/director/html_printout.rb +47 -0
  294. data/rakelib/lib/director/html_window.rb +114 -0
  295. data/rakelib/lib/director/icon.rb +33 -0
  296. data/rakelib/lib/director/image.rb +111 -0
  297. data/rakelib/lib/director/image_list.rb +21 -0
  298. data/rakelib/lib/director/list_ctrl.rb +197 -0
  299. data/rakelib/lib/director/listbox.rb +32 -0
  300. data/rakelib/lib/director/locale.rb +35 -0
  301. data/rakelib/lib/director/log.rb +32 -0
  302. data/rakelib/lib/director/mdi_frame.rb +36 -0
  303. data/rakelib/lib/director/media_ctrl.rb +22 -0
  304. data/rakelib/lib/director/menu.rb +92 -0
  305. data/rakelib/lib/director/menu_bar.rb +28 -0
  306. data/rakelib/lib/director/menu_item.rb +36 -0
  307. data/rakelib/lib/director/mouse_state.rb +21 -0
  308. data/rakelib/lib/director/numeric_property_validator.rb +38 -0
  309. data/rakelib/lib/director/object.rb +32 -0
  310. data/rakelib/lib/director/page_setup_dialog.rb +30 -0
  311. data/rakelib/lib/director/palette.rb +25 -0
  312. data/rakelib/lib/director/panel.rb +22 -0
  313. data/rakelib/lib/director/pen.rb +174 -0
  314. data/rakelib/lib/director/pgarray_editor_dialog.rb +64 -0
  315. data/rakelib/lib/director/pgcell.rb +68 -0
  316. data/rakelib/lib/director/pgeditor.rb +154 -0
  317. data/rakelib/lib/director/pgmulti_button.rb +22 -0
  318. data/rakelib/lib/director/pgproperties.rb +216 -0
  319. data/rakelib/lib/director/pgproperty.rb +207 -0
  320. data/rakelib/lib/director/pgvalidation_info.rb +24 -0
  321. data/rakelib/lib/director/pickerbase.rb +22 -0
  322. data/rakelib/lib/director/platform_info.rb +49 -0
  323. data/rakelib/lib/director/popup_window.rb +23 -0
  324. data/rakelib/lib/director/preview_frame.rb +39 -0
  325. data/rakelib/lib/director/print_data.rb +33 -0
  326. data/rakelib/lib/director/print_dialog.rb +36 -0
  327. data/rakelib/lib/director/printer.rb +61 -0
  328. data/rakelib/lib/director/property_grid.rb +174 -0
  329. data/rakelib/lib/director/property_grid_event.rb +23 -0
  330. data/rakelib/lib/director/property_grid_interface.rb +227 -0
  331. data/rakelib/lib/director/property_grid_manager.rb +90 -0
  332. data/rakelib/lib/director/property_grid_page.rb +76 -0
  333. data/rakelib/lib/director/property_grid_page_state.rb +32 -0
  334. data/rakelib/lib/director/radio_box.rb +39 -0
  335. data/rakelib/lib/director/region.rb +25 -0
  336. data/rakelib/lib/director/ribbon_art_provider.rb +154 -0
  337. data/rakelib/lib/director/ribbon_bar.rb +24 -0
  338. data/rakelib/lib/director/ribbon_bar_event.rb +22 -0
  339. data/rakelib/lib/director/ribbon_button_bar.rb +37 -0
  340. data/rakelib/lib/director/ribbon_button_bar_event.rb +40 -0
  341. data/rakelib/lib/director/ribbon_ctrl.rb +28 -0
  342. data/rakelib/lib/director/ribbon_gallery.rb +33 -0
  343. data/rakelib/lib/director/ribbon_gallery_event.rb +27 -0
  344. data/rakelib/lib/director/ribbon_page.rb +21 -0
  345. data/rakelib/lib/director/ribbon_panel.rb +22 -0
  346. data/rakelib/lib/director/ribbon_panel_event.rb +22 -0
  347. data/rakelib/lib/director/ribbon_tool_bar.rb +146 -0
  348. data/rakelib/lib/director/ribbon_tool_bar_event.rb +22 -0
  349. data/rakelib/lib/director/richtext_buffer.rb +46 -0
  350. data/rakelib/lib/director/richtext_ctrl.rb +63 -0
  351. data/rakelib/lib/director/richtext_event.rb +25 -0
  352. data/rakelib/lib/director/richtext_file_handler.rb +42 -0
  353. data/rakelib/lib/director/richtext_header_footer_data.rb +21 -0
  354. data/rakelib/lib/director/richtext_printing.rb +44 -0
  355. data/rakelib/lib/director/sash_layout_event.rb +22 -0
  356. data/rakelib/lib/director/sash_layout_window.rb +23 -0
  357. data/rakelib/lib/director/sash_window.rb +23 -0
  358. data/rakelib/lib/director/scrolled_t.rb +67 -0
  359. data/rakelib/lib/director/sizer.rb +67 -0
  360. data/rakelib/lib/director/sizer_item.rb +35 -0
  361. data/rakelib/lib/director/splash_screen.rb +24 -0
  362. data/rakelib/lib/director/splitter_event.rb +28 -0
  363. data/rakelib/lib/director/splitter_window.rb +25 -0
  364. data/rakelib/lib/director/static_bitmap.rb +24 -0
  365. data/rakelib/lib/director/static_box.rb +26 -0
  366. data/rakelib/lib/director/status_bar.rb +86 -0
  367. data/rakelib/lib/director/styled_text_ctrl.rb +82 -0
  368. data/rakelib/lib/director/styled_text_event.rb +25 -0
  369. data/rakelib/lib/director/system_options.rb +22 -0
  370. data/rakelib/lib/director/system_settings.rb +47 -0
  371. data/rakelib/lib/director/task_bar_icon.rb +77 -0
  372. data/rakelib/lib/director/text_attr.rb +22 -0
  373. data/rakelib/lib/director/text_entry.rb +26 -0
  374. data/rakelib/lib/director/text_validator.rb +47 -0
  375. data/rakelib/lib/director/textctrl.rb +80 -0
  376. data/rakelib/lib/director/time_picker_ctrl.rb +24 -0
  377. data/rakelib/lib/director/timer.rb +37 -0
  378. data/rakelib/lib/director/tip_provider.rb +44 -0
  379. data/rakelib/lib/director/toggle_button.rb +22 -0
  380. data/rakelib/lib/director/tool_bar.rb +62 -0
  381. data/rakelib/lib/director/tool_tip.rb +20 -0
  382. data/rakelib/lib/director/top_level_window.rb +105 -0
  383. data/rakelib/lib/director/tree_ctrl.rb +411 -0
  384. data/rakelib/lib/director/tree_event.rb +78 -0
  385. data/rakelib/lib/director/utils.rb +55 -0
  386. data/rakelib/lib/director/validator.rb +44 -0
  387. data/rakelib/lib/director/variant.rb +549 -0
  388. data/rakelib/lib/director/vlistbox.rb +46 -0
  389. data/rakelib/lib/director/vscrolled_window.rb +59 -0
  390. data/rakelib/lib/director/window.rb +296 -0
  391. data/rakelib/lib/director/window_disabler.rb +44 -0
  392. data/rakelib/lib/director/with_images.rb +65 -0
  393. data/rakelib/lib/director/wizard_page.rb +35 -0
  394. data/rakelib/lib/director/xml_node.rb +48 -0
  395. data/rakelib/lib/director/xml_resource.rb +141 -0
  396. data/rakelib/lib/director.rb +487 -0
  397. data/rakelib/lib/ext/enum_chain.rb +22 -0
  398. data/rakelib/lib/extractor/class.rb +384 -0
  399. data/rakelib/lib/extractor/enum.rb +94 -0
  400. data/rakelib/lib/extractor/function.rb +377 -0
  401. data/rakelib/lib/extractor/module.rb +140 -0
  402. data/rakelib/lib/extractor/variable.rb +145 -0
  403. data/rakelib/lib/extractor.rb +438 -0
  404. data/rakelib/lib/generate/analyzer.rb +593 -0
  405. data/rakelib/lib/generate/base.rb +37 -0
  406. data/rakelib/lib/generate/doc.rb +833 -0
  407. data/rakelib/lib/generate/interface.rb +742 -0
  408. data/rakelib/lib/generate/rakedep.rb +130 -0
  409. data/rakelib/lib/specs/interfaces.rb +324 -0
  410. data/rakelib/lib/streams.rb +206 -0
  411. data/rakelib/lib/swig_runner.rb +682 -0
  412. data/rakelib/lib/typemap/array_int_selections.rb +57 -0
  413. data/rakelib/lib/typemap/common.rb +613 -0
  414. data/rakelib/lib/typemap/data_format.rb +76 -0
  415. data/rakelib/lib/typemap/data_object_data.rb +99 -0
  416. data/rakelib/lib/typemap/datetime.rb +64 -0
  417. data/rakelib/lib/typemap/grid_client_data.rb +55 -0
  418. data/rakelib/lib/typemap/grid_coords.rb +65 -0
  419. data/rakelib/lib/typemap/html_cell.rb +57 -0
  420. data/rakelib/lib/typemap/io_streams.rb +162 -0
  421. data/rakelib/lib/typemap/pgcell.rb +35 -0
  422. data/rakelib/lib/typemap/pgeditor.rb +35 -0
  423. data/rakelib/lib/typemap/pgprop_arg.rb +74 -0
  424. data/rakelib/lib/typemap/pgproperty.rb +35 -0
  425. data/rakelib/lib/typemap/points_list.rb +124 -0
  426. data/rakelib/lib/typemap/richtext.rb +67 -0
  427. data/rakelib/lib/typemap/tree_itemid.rb +49 -0
  428. data/rakelib/lib/util/string.rb +141 -0
  429. data/rakelib/prepost.rake +91 -0
  430. data/rakelib/prepost.rb +26 -0
  431. data/rakelib/run.rake +49 -0
  432. data/rakelib/yard/templates/default/fulldoc/html/css/wxruby3.css +7 -0
  433. data/rakelib/yard/templates/default/layout/html/setup.rb +5 -0
  434. data/rakelib/yard/yard/relative_markdown_links/version.rb +8 -0
  435. data/rakelib/yard/yard/relative_markdown_links.rb +39 -0
  436. data/rakelib/yard/yard-custom-templates.rb +2 -0
  437. data/rakelib/yard/yard-relative_markdown_links.rb +4 -0
  438. data/samples/art/wxruby-128x128.png +0 -0
  439. data/samples/art/wxruby-256x256.png +0 -0
  440. data/samples/art/wxruby-64x64.png +0 -0
  441. data/samples/art/wxruby.ico +0 -0
  442. data/samples/art/wxruby.png +0 -0
  443. data/samples/aui/aui.rb +1321 -0
  444. data/samples/aui/tn_aui.png +0 -0
  445. data/samples/bigdemo/About.rbw +39 -0
  446. data/samples/bigdemo/ColorPanel.rbw +23 -0
  447. data/samples/bigdemo/GridSimple.rbw +78 -0
  448. data/samples/bigdemo/MDIDemo.rbw +57 -0
  449. data/samples/bigdemo/PopupMenu.rbw +146 -0
  450. data/samples/bigdemo/ShapedWindow.rbw +128 -0
  451. data/samples/bigdemo/Sizers.rbw +541 -0
  452. data/samples/bigdemo/bigdemo.rb +810 -0
  453. data/samples/bigdemo/demoTemplate.rbw +33 -0
  454. data/samples/bigdemo/helpfile.htb +0 -0
  455. data/samples/bigdemo/icons/Test 015.jpg +0 -0
  456. data/samples/bigdemo/icons/Test 015.png +0 -0
  457. data/samples/bigdemo/icons/choice.bmp +0 -0
  458. data/samples/bigdemo/icons/choice.xpm +27 -0
  459. data/samples/bigdemo/icons/combo.bmp +0 -0
  460. data/samples/bigdemo/icons/combo.xpm +27 -0
  461. data/samples/bigdemo/icons/copy.xpm +25 -0
  462. data/samples/bigdemo/icons/cut.xpm +24 -0
  463. data/samples/bigdemo/icons/gauge.bmp +0 -0
  464. data/samples/bigdemo/icons/gauge.xpm +27 -0
  465. data/samples/bigdemo/icons/help.xpm +25 -0
  466. data/samples/bigdemo/icons/list.bmp +0 -0
  467. data/samples/bigdemo/icons/list.xpm +27 -0
  468. data/samples/bigdemo/icons/mondrian.ico +0 -0
  469. data/samples/bigdemo/icons/mondrian.xpm +44 -0
  470. data/samples/bigdemo/icons/new.xpm +24 -0
  471. data/samples/bigdemo/icons/ogl.ico +0 -0
  472. data/samples/bigdemo/icons/ogl.xpm +45 -0
  473. data/samples/bigdemo/icons/open.xpm +26 -0
  474. data/samples/bigdemo/icons/paste.bmp +0 -0
  475. data/samples/bigdemo/icons/paste.xpm +38 -0
  476. data/samples/bigdemo/icons/pointy.png +0 -0
  477. data/samples/bigdemo/icons/preview.xpm +26 -0
  478. data/samples/bigdemo/icons/print.xpm +26 -0
  479. data/samples/bigdemo/icons/radio.bmp +0 -0
  480. data/samples/bigdemo/icons/radio.xpm +27 -0
  481. data/samples/bigdemo/icons/robert.xpm +415 -0
  482. data/samples/bigdemo/icons/sashtest.ico +0 -0
  483. data/samples/bigdemo/icons/save.xpm +25 -0
  484. data/samples/bigdemo/icons/smiles.bmp +0 -0
  485. data/samples/bigdemo/icons/smiles.xpm +39 -0
  486. data/samples/bigdemo/icons/smiley.ico +0 -0
  487. data/samples/bigdemo/icons/smiley.xpm +42 -0
  488. data/samples/bigdemo/icons/stattext.xpm +24 -0
  489. data/samples/bigdemo/icons/test2.bmp +0 -0
  490. data/samples/bigdemo/icons/test2.png +0 -0
  491. data/samples/bigdemo/icons/test2.xpm +79 -0
  492. data/samples/bigdemo/icons/text.bmp +0 -0
  493. data/samples/bigdemo/icons/text.xpm +27 -0
  494. data/samples/bigdemo/icons/tog1.bmp +0 -0
  495. data/samples/bigdemo/icons/tog1.xpm +38 -0
  496. data/samples/bigdemo/icons/tog2.bmp +0 -0
  497. data/samples/bigdemo/icons/tog2.xpm +38 -0
  498. data/samples/bigdemo/icons/wxruby-128x128.png +0 -0
  499. data/samples/bigdemo/icons/wxwin.ico +0 -0
  500. data/samples/bigdemo/icons/wxwin16x16.png +0 -0
  501. data/samples/bigdemo/icons/wxwin16x16.xpm +25 -0
  502. data/samples/bigdemo/icons/wxwin32x32.png +0 -0
  503. data/samples/bigdemo/icons/wxwin48x48.png +0 -0
  504. data/samples/bigdemo/run.rb +91 -0
  505. data/samples/bigdemo/tips.txt +7 -0
  506. data/samples/bigdemo/utils.rb +12 -0
  507. data/samples/bigdemo/wxArtProvider.rbw +281 -0
  508. data/samples/bigdemo/wxBitmapButton.rbw +65 -0
  509. data/samples/bigdemo/wxButton.rbw +64 -0
  510. data/samples/bigdemo/wxCalendarCtrl.rbw +59 -0
  511. data/samples/bigdemo/wxCheckBox.rbw +50 -0
  512. data/samples/bigdemo/wxCheckListBox.rbw +65 -0
  513. data/samples/bigdemo/wxChoice.rbw +47 -0
  514. data/samples/bigdemo/wxChoicebook.rbw +78 -0
  515. data/samples/bigdemo/wxColourDialog.rbw +33 -0
  516. data/samples/bigdemo/wxComboBox.rbw +77 -0
  517. data/samples/bigdemo/wxCursor.rbw +136 -0
  518. data/samples/bigdemo/wxDialog.rbw +74 -0
  519. data/samples/bigdemo/wxDirDialog.rbw +29 -0
  520. data/samples/bigdemo/wxDragImage.rbw +70 -0
  521. data/samples/bigdemo/wxFileDialog.rbw +37 -0
  522. data/samples/bigdemo/wxFileDialog_Save.rbw +35 -0
  523. data/samples/bigdemo/wxFindReplaceDialog.rbw +82 -0
  524. data/samples/bigdemo/wxFontDialog.rbw +200 -0
  525. data/samples/bigdemo/wxFrame.rbw +53 -0
  526. data/samples/bigdemo/wxGauge.rbw +65 -0
  527. data/samples/bigdemo/wxGenericDirCtrl.rbw +74 -0
  528. data/samples/bigdemo/wxGrid.rbw +66 -0
  529. data/samples/bigdemo/wxHtmlHelpController.rbw +52 -0
  530. data/samples/bigdemo/wxListBox.rbw +140 -0
  531. data/samples/bigdemo/wxListCtrl_virtual.rbw +112 -0
  532. data/samples/bigdemo/wxMDIWindows.rbw +50 -0
  533. data/samples/bigdemo/wxMenu.rbw +247 -0
  534. data/samples/bigdemo/wxMessageDialog.rbw +27 -0
  535. data/samples/bigdemo/wxMiniFrame.rbw +70 -0
  536. data/samples/bigdemo/wxMultipleChoiceDialog.rbw +29 -0
  537. data/samples/bigdemo/wxNotebook.rbw +136 -0
  538. data/samples/bigdemo/wxProgressDialog.rbw +43 -0
  539. data/samples/bigdemo/wxRadioBox.rbw +72 -0
  540. data/samples/bigdemo/wxRadioButton.rbw +125 -0
  541. data/samples/bigdemo/wxSashWindow.rbw +141 -0
  542. data/samples/bigdemo/wxScrolledMessageDialog.rbw +57 -0
  543. data/samples/bigdemo/wxScrolledWindow.rbw +199 -0
  544. data/samples/bigdemo/wxSingleChoiceDialog.rbw +33 -0
  545. data/samples/bigdemo/wxSlider.rbw +42 -0
  546. data/samples/bigdemo/wxSpinButton.rbw +50 -0
  547. data/samples/bigdemo/wxSpinCtrl.rbw +51 -0
  548. data/samples/bigdemo/wxSplitterWindow.rbw +63 -0
  549. data/samples/bigdemo/wxStaticBitmap.rbw +47 -0
  550. data/samples/bigdemo/wxStaticText.rbw +55 -0
  551. data/samples/bigdemo/wxStatusBar.rbw +126 -0
  552. data/samples/bigdemo/wxTextCtrl.rbw +149 -0
  553. data/samples/bigdemo/wxTextEntryDialog.rbw +31 -0
  554. data/samples/bigdemo/wxToggleButton.rbw +49 -0
  555. data/samples/bigdemo/wxToolBar.rbw +131 -0
  556. data/samples/bigdemo/wxTreeCtrl.rbw +191 -0
  557. data/samples/calendar/calendar.rb +363 -0
  558. data/samples/calendar/tn_calendar.png +0 -0
  559. data/samples/caret/caret.rb +293 -0
  560. data/samples/caret/mondrian.xpm +44 -0
  561. data/samples/caret/tn_caret.png +0 -0
  562. data/samples/controls/books.rb +183 -0
  563. data/samples/controls/choice.xpm +27 -0
  564. data/samples/controls/combo.xpm +27 -0
  565. data/samples/controls/controls.rb +1143 -0
  566. data/samples/controls/gauge.xpm +27 -0
  567. data/samples/controls/get_item_sample.rb +117 -0
  568. data/samples/controls/list.xpm +27 -0
  569. data/samples/controls/mondrian.ico +0 -0
  570. data/samples/controls/mondrian.xpm +44 -0
  571. data/samples/controls/radio.xpm +27 -0
  572. data/samples/controls/stattext.xpm +24 -0
  573. data/samples/controls/test2.bmp +0 -0
  574. data/samples/controls/text.xpm +27 -0
  575. data/samples/controls/tn_books.png +0 -0
  576. data/samples/controls/tn_controls.png +0 -0
  577. data/samples/controls/tn_get_item_sample.png +0 -0
  578. data/samples/dialogs/dialogs.rb +879 -0
  579. data/samples/dialogs/tips.txt +18 -0
  580. data/samples/dialogs/tn_dialogs.png +0 -0
  581. data/samples/dialogs/tn_wizard.png +0 -0
  582. data/samples/dialogs/wizard.rb +89 -0
  583. data/samples/dragdrop/dragdrop.rb +200 -0
  584. data/samples/dragdrop/tn_dragdrop.png +0 -0
  585. data/samples/drawing/SVGlogo24.xpm +310 -0
  586. data/samples/drawing/bitmap.rb +76 -0
  587. data/samples/drawing/bitmap_image.rb +131 -0
  588. data/samples/drawing/graphics_drawing.rb +257 -0
  589. data/samples/drawing/maths_images.rb +327 -0
  590. data/samples/drawing/rmagic_bitmap_image.rb +139 -0
  591. data/samples/drawing/ruby-logo.jpg +0 -0
  592. data/samples/drawing/svgtest.rb +373 -0
  593. data/samples/drawing/tn_bitmap.png +0 -0
  594. data/samples/drawing/tn_bitmap_image.png +0 -0
  595. data/samples/drawing/tn_graphics_drawing.png +0 -0
  596. data/samples/drawing/tn_maths_images.png +0 -0
  597. data/samples/drawing/tn_rmagic_bitmap_image.png +0 -0
  598. data/samples/drawing/tn_svgtest.png +0 -0
  599. data/samples/etc/choice.rb +82 -0
  600. data/samples/etc/miniframe.rb +92 -0
  601. data/samples/etc/sash.rb +140 -0
  602. data/samples/etc/scrollwin.rb +120 -0
  603. data/samples/etc/system_settings.rb +263 -0
  604. data/samples/etc/tn_choice.png +0 -0
  605. data/samples/etc/tn_miniframe.png +0 -0
  606. data/samples/etc/tn_sash.png +0 -0
  607. data/samples/etc/tn_scrollwin.png +0 -0
  608. data/samples/etc/tn_system_settings.png +0 -0
  609. data/samples/event/activation.rb +129 -0
  610. data/samples/event/event.rb +220 -0
  611. data/samples/event/threaded.rb +141 -0
  612. data/samples/event/tn_activation.png +0 -0
  613. data/samples/event/tn_event.png +0 -0
  614. data/samples/event/tn_threaded.png +0 -0
  615. data/samples/event/tn_update_ui_event.png +0 -0
  616. data/samples/event/update_ui_event.rb +91 -0
  617. data/samples/grid/grid.rb +224 -0
  618. data/samples/grid/gridtablebase.rb +178 -0
  619. data/samples/grid/tn_grid.png +0 -0
  620. data/samples/grid/tn_gridtablebase.png +0 -0
  621. data/samples/html/8859_2.htm +14 -0
  622. data/samples/html/cp1250.htm +19 -0
  623. data/samples/html/foo.png +0 -0
  624. data/samples/html/html.rb +278 -0
  625. data/samples/html/i18n.gif +0 -0
  626. data/samples/html/imagemap.htm +20 -0
  627. data/samples/html/imagemap.png +0 -0
  628. data/samples/html/listtest.htm +28 -0
  629. data/samples/html/pic.png +0 -0
  630. data/samples/html/pic2.bmp +0 -0
  631. data/samples/html/regres.htm +20 -0
  632. data/samples/html/subsup.html +42 -0
  633. data/samples/html/tables.htm +255 -0
  634. data/samples/html/test.htm +375 -0
  635. data/samples/html/tn_html.png +0 -0
  636. data/samples/mdi/mdi.rb +118 -0
  637. data/samples/mdi/tn_mdi.png +0 -0
  638. data/samples/minimal/minimal.rb +95 -0
  639. data/samples/minimal/mondrian.ico +0 -0
  640. data/samples/minimal/mondrian.png +0 -0
  641. data/samples/minimal/nothing.rb +38 -0
  642. data/samples/minimal/tn_minimal.png +0 -0
  643. data/samples/minimal/tn_nothing.png +0 -0
  644. data/samples/printing/mondrian.ico +0 -0
  645. data/samples/printing/mondrian.xpm +44 -0
  646. data/samples/printing/printing.rb +499 -0
  647. data/samples/printing/printing2.rb +251 -0
  648. data/samples/printing/sample-text.txt +213 -0
  649. data/samples/printing/tn_printing.png +0 -0
  650. data/samples/printing/tn_printing2.png +0 -0
  651. data/samples/propgrid/propgrid.rb +2711 -0
  652. data/samples/propgrid/propgrid_minimal.rb +107 -0
  653. data/samples/propgrid/sample_props.rb +434 -0
  654. data/samples/propgrid/tn_propgrid.png +0 -0
  655. data/samples/propgrid/tn_propgrid_minimal.png +0 -0
  656. data/samples/ribbon/align_center.xpm +21 -0
  657. data/samples/ribbon/align_left.xpm +21 -0
  658. data/samples/ribbon/align_right.xpm +21 -0
  659. data/samples/ribbon/aui_style.xpm +53 -0
  660. data/samples/ribbon/auto_crop_selection.xpm +55 -0
  661. data/samples/ribbon/auto_crop_selection_small.xpm +33 -0
  662. data/samples/ribbon/circle.xpm +38 -0
  663. data/samples/ribbon/circle_small.xpm +22 -0
  664. data/samples/ribbon/colours.xpm +25 -0
  665. data/samples/ribbon/cross.xpm +38 -0
  666. data/samples/ribbon/empty.xpm +23 -0
  667. data/samples/ribbon/expand_selection_h.xpm +46 -0
  668. data/samples/ribbon/expand_selection_v.xpm +46 -0
  669. data/samples/ribbon/eye.xpm +26 -0
  670. data/samples/ribbon/hexagon.xpm +38 -0
  671. data/samples/ribbon/msw_style.xpm +65 -0
  672. data/samples/ribbon/position_left.xpm +22 -0
  673. data/samples/ribbon/position_top.xpm +22 -0
  674. data/samples/ribbon/ribbon.rb +900 -0
  675. data/samples/ribbon/ribbon.xpm +54 -0
  676. data/samples/ribbon/selection_panel.xpm +23 -0
  677. data/samples/ribbon/square.xpm +38 -0
  678. data/samples/ribbon/tn_ribbon.png +0 -0
  679. data/samples/ribbon/triangle.xpm +38 -0
  680. data/samples/sample.xpm +475 -0
  681. data/samples/sampler/back.xpm +21 -0
  682. data/samples/sampler/copy.xpm +44 -0
  683. data/samples/sampler/cut.xpm +46 -0
  684. data/samples/sampler/editor.rb +560 -0
  685. data/samples/sampler/ext.rb +51 -0
  686. data/samples/sampler/filesave.xpm +42 -0
  687. data/samples/sampler/find.xpm +62 -0
  688. data/samples/sampler/findrepl.xpm +63 -0
  689. data/samples/sampler/forward.xpm +21 -0
  690. data/samples/sampler/paste.xpm +46 -0
  691. data/samples/sampler/play.xpm +24 -0
  692. data/samples/sampler/redo.xpm +58 -0
  693. data/samples/sampler/sample.rb +347 -0
  694. data/samples/sampler/stc_editor.rb +321 -0
  695. data/samples/sampler/txt_editor.rb +130 -0
  696. data/samples/sampler/undo.xpm +58 -0
  697. data/samples/sampler.rb +394 -0
  698. data/samples/splash/mobile.xpm +1835 -0
  699. data/samples/splash/splash.png +0 -0
  700. data/samples/splash/splash.rb +164 -0
  701. data/samples/splash/tn_splash.png +0 -0
  702. data/samples/text/document-open.png +0 -0
  703. data/samples/text/document-save.png +0 -0
  704. data/samples/text/edit-copy.png +0 -0
  705. data/samples/text/edit-cut.png +0 -0
  706. data/samples/text/edit-paste.png +0 -0
  707. data/samples/text/edit-redo.png +0 -0
  708. data/samples/text/edit-undo.png +0 -0
  709. data/samples/text/format-text-bold.png +0 -0
  710. data/samples/text/format-text-italic.png +0 -0
  711. data/samples/text/format-text-underline.png +0 -0
  712. data/samples/text/mondrian.ico +0 -0
  713. data/samples/text/mondrian.xpm +44 -0
  714. data/samples/text/preferences-desktop-font.png +0 -0
  715. data/samples/text/rich_textctrl.rb +326 -0
  716. data/samples/text/scintilla.rb +179 -0
  717. data/samples/text/textctrl.rb +124 -0
  718. data/samples/text/tn_rich_textctrl.png +0 -0
  719. data/samples/text/tn_scintilla.png +0 -0
  720. data/samples/text/tn_textctrl.png +0 -0
  721. data/samples/text/tn_unicode.png +0 -0
  722. data/samples/text/unicode.rb +238 -0
  723. data/samples/text/utf8.txt +15 -0
  724. data/samples/treectrl/checked.xpm +54 -0
  725. data/samples/treectrl/icon1.xpm +79 -0
  726. data/samples/treectrl/icon2.xpm +53 -0
  727. data/samples/treectrl/icon3.xpm +79 -0
  728. data/samples/treectrl/icon4.xpm +43 -0
  729. data/samples/treectrl/icon5.xpm +79 -0
  730. data/samples/treectrl/state1.xpm +145 -0
  731. data/samples/treectrl/state2.xpm +144 -0
  732. data/samples/treectrl/state3.xpm +142 -0
  733. data/samples/treectrl/state4.xpm +145 -0
  734. data/samples/treectrl/state5.xpm +85 -0
  735. data/samples/treectrl/tn_treectrl.png +0 -0
  736. data/samples/treectrl/treectrl.rb +1720 -0
  737. data/samples/treectrl/unchecked.xpm +30 -0
  738. data/samples/xrc/custom_dialog.xrc +46 -0
  739. data/samples/xrc/custom_xrc_sample.rb +84 -0
  740. data/samples/xrc/samples.xrc +46 -0
  741. data/samples/xrc/tn_xrc_sample.png +0 -0
  742. data/samples/xrc/xrc_sample.rb +86 -0
  743. data/tests/test_basic.rb +20 -0
  744. data/tests/test_clipboard.rb +241 -0
  745. data/tests/test_dialog.rb +28 -0
  746. data/tests/test_event_handling.rb +103 -0
  747. data/tests/test_events.rb +45 -0
  748. data/tests/test_geometry.rb +141 -0
  749. data/tests/test_intl.rb +107 -0
  750. data/tests/test_item_data.rb +120 -0
  751. data/tests/test_variant.rb +151 -0
  752. data/tests/testapp.rb +40 -0
  753. data/tests/testapp_noframe.rb +28 -0
  754. metadata +874 -0
@@ -0,0 +1,1321 @@
1
+ #!/usr/bin/env ruby
2
+ # wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
3
+ # Adapted for wxRuby3
4
+ # Copyright (c) M.J.N. Corino, The Netherlands
5
+ ###
6
+
7
+ require 'wx'
8
+
9
+ # A resizable control that displays its current size, and, if an AUI
10
+ # arrangement, its position and layer
11
+ class SizeReportCtrl < Wx::Control
12
+ def initialize(parent, id, pos, size, mgr = nil)
13
+ super(parent, id, pos, size)
14
+ @mgr = mgr
15
+ evt_paint { on_paint }
16
+ evt_size { on_size }
17
+ end
18
+
19
+ def on_paint
20
+ paint do |dc|
21
+ size = get_client_size
22
+
23
+ dc.set_font Wx::NORMAL_FONT
24
+ dc.set_brush Wx::WHITE_BRUSH
25
+ dc.set_pen Wx::WHITE_PEN
26
+ dc.draw_rectangle(0, 0, size.width, size.height)
27
+ dc.set_pen Wx::LIGHT_GREY_PEN
28
+ dc.set_pen Wx::LIGHT_GREY_PEN
29
+ dc.draw_line(0, 0, size.width, size.height)
30
+ dc.draw_line(0, size.height, size.width, 0)
31
+
32
+ msg = "Size: %d x %d" % [size.width, size.height]
33
+ width, height = dc.get_text_extent(msg)
34
+ height += 3
35
+ dc.draw_text(msg,
36
+ (size.width - width) / 2,
37
+ (size.height - (height * 5)) / 2)
38
+
39
+ if @mgr
40
+ pi = @mgr.get_pane(self)
41
+ msg = "Layer: %d" % pi.layer
42
+ width, height = dc.get_text_extent(msg)
43
+ dc.draw_text(msg,
44
+ (size.width - width) / 2,
45
+ ((size.height - (height * 5)) / 2) + height)
46
+
47
+ msg = "Dock: %d Row: %d" % [pi.direction, pi.row]
48
+ width, height = dc.get_text_extent(msg)
49
+ dc.draw_text(msg,
50
+ (size.width - width) / 2,
51
+ ((size.height - (height * 5)) / 2) + (height * 2))
52
+
53
+ msg = "Position: %d" % pi.position
54
+ width, height = dc.get_text_extent(msg)
55
+ dc.draw_text(msg,
56
+ (size.width - width) / 2,
57
+ ((size.height - (height * 5)) / 2) + (height * 3))
58
+
59
+ msg = "Proportion: %d" % pi.proportion
60
+ width, height = dc.get_text_extent(msg)
61
+ dc.draw_text(msg,
62
+ (size.width - width) / 2,
63
+ ((size.height - (height * 5)) / 2) + (height * 4))
64
+
65
+ end
66
+ end
67
+ end
68
+
69
+ def on_size
70
+ refresh
71
+ end
72
+ end
73
+
74
+ class SettingsPanel < Wx::Panel
75
+ consts = %w[
76
+ ID_PaneBorderSize
77
+ ID_SashSize
78
+ ID_CaptionSize
79
+ ID_BackgroundColour
80
+ ID_SashColour
81
+ ID_InactiveCaptionColour
82
+ ID_InactiveCaptionGradientColour
83
+ ID_InactiveCaptionTextColour
84
+ ID_ActiveCaptionColour
85
+ ID_ActiveCaptionGradientColour
86
+ ID_ActiveCaptionTextColour
87
+ ID_BorderColour
88
+ ID_GripperColour ]
89
+
90
+ consts.each_with_index do |c, i|
91
+ const_set(c, 1001 + i)
92
+ end
93
+
94
+ def initialize(parent, frame)
95
+ super(parent, Wx::ID_ANY)
96
+ @frame = frame
97
+ @base_bmp = create_colour_bitmap(Wx::BLACK)
98
+
99
+ # set up some spin ctrls for integer variables
100
+ @border_size, s1 = make_metric_spin_ctrl(ID_PaneBorderSize,
101
+ "Pane Border Size:",
102
+ Wx::AUI_DOCKART_PANE_BORDER_SIZE)
103
+
104
+ @sash_size, s2 = make_metric_spin_ctrl(ID_SashSize,
105
+ "Sash Size:",
106
+ Wx::AUI_DOCKART_SASH_SIZE)
107
+
108
+ @cap_size, s3 = make_metric_spin_ctrl(ID_CaptionSize,
109
+ "Caption Size:",
110
+ Wx::AUI_DOCKART_CAPTION_SIZE)
111
+
112
+ # colour controls
113
+ @bckg_colour, s4 = make_colour_button(ID_BackgroundColour,
114
+ "Background Colour:")
115
+ @sash_colour, s5 = make_colour_button(ID_SashColour,
116
+ "Sash Colour:")
117
+ @capt_colour, s6 = make_colour_button(ID_InactiveCaptionColour,
118
+ "Normal Caption:")
119
+ @capt_gradnt, s7 = make_colour_button(ID_InactiveCaptionGradientColour,
120
+ "Normal Caption Gradient:")
121
+ @capt_text, s8 = make_colour_button(ID_InactiveCaptionTextColour,
122
+ "Normal Caption Text:")
123
+ @acap_colour, s9 = make_colour_button(ID_ActiveCaptionColour,
124
+ "Active Caption:")
125
+ @acap_gradnt, s10 = make_colour_button(ID_ActiveCaptionGradientColour,
126
+ "Active Caption Gradient:")
127
+ @acap_text, s11 = make_colour_button(ID_ActiveCaptionTextColour,
128
+ "Active Caption Text:")
129
+ @brdr_colour, s12 = make_colour_button(ID_BorderColour,
130
+ "Border Colour:")
131
+ @grip_colour, s13 = make_colour_button(ID_GripperColour,
132
+ "Gripper Colour:")
133
+
134
+ grid_sizer = Wx::GridSizer.new(2)
135
+ grid_sizer.set_h_gap(5)
136
+
137
+ grid_sizer.add(s1); grid_sizer.add(s4)
138
+ grid_sizer.add(s2); grid_sizer.add(s5)
139
+ grid_sizer.add(s3); grid_sizer.add(s13)
140
+ grid_sizer.add(1, 1); grid_sizer.add(s12)
141
+ grid_sizer.add(s6); grid_sizer.add(s9)
142
+ grid_sizer.add(s7); grid_sizer.add(s10)
143
+ grid_sizer.add(s8); grid_sizer.add(s11)
144
+
145
+ cont_sizer = Wx::BoxSizer.new(Wx::VERTICAL)
146
+ cont_sizer.add(grid_sizer, 1, Wx::EXPAND | Wx::ALL, 5)
147
+ self.set_sizer(cont_sizer)
148
+ get_sizer.set_size_hints(self)
149
+ update_colours
150
+
151
+ evt_spinctrl(ID_PaneBorderSize) { |e| on_pane_border_size(e) }
152
+ evt_spinctrl(ID_SashSize) { |e| on_sash_size(e) }
153
+ evt_spinctrl(ID_CaptionSize) { |e| on_caption_size(e) }
154
+ evt_button(ID_BackgroundColour) { |e| on_set_colour(e) }
155
+ evt_button(ID_SashColour) { |e| on_set_colour(e) }
156
+ evt_button(ID_InactiveCaptionColour) { |e| on_set_colour(e) }
157
+ evt_button(ID_InactiveCaptionGradientColour) { |e| on_set_colour(e) }
158
+ evt_button(ID_InactiveCaptionTextColour) { |e| on_set_colour(e) }
159
+ evt_button(ID_ActiveCaptionColour) { |e| on_set_colour(e) }
160
+ evt_button(ID_ActiveCaptionGradientColour) { |e| on_set_colour(e) }
161
+ evt_button(ID_ActiveCaptionTextColour) { |e| on_set_colour(e) }
162
+ evt_button(ID_BorderColour) { |e| on_set_colour(e) }
163
+ evt_button(ID_GripperColour) { |e| on_set_colour(e) }
164
+ end
165
+
166
+ def update_colours()
167
+ art = @frame.dock_art
168
+
169
+ col = art.get_colour(Wx::AUI_DOCKART_BACKGROUND_COLOUR)
170
+ @bckg_colour.bitmap_label = (create_colour_bitmap(col))
171
+
172
+ col = art.get_colour(Wx::AUI_DOCKART_SASH_COLOUR)
173
+ @sash_colour.bitmap_label = (create_colour_bitmap(col))
174
+
175
+ col = art.get_colour(Wx::AUI_DOCKART_INACTIVE_CAPTION_COLOUR)
176
+ @capt_colour.bitmap_label = (create_colour_bitmap(col))
177
+
178
+ col = art.get_colour(Wx::AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR)
179
+ @capt_gradnt.bitmap_label = (create_colour_bitmap(col))
180
+
181
+ col = art.get_colour(Wx::AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR)
182
+ @capt_text.bitmap_label = (create_colour_bitmap(col))
183
+
184
+ col = art.get_colour(Wx::AUI_DOCKART_ACTIVE_CAPTION_COLOUR)
185
+ @acap_colour.bitmap_label = (create_colour_bitmap(col))
186
+
187
+ col = art.get_colour(Wx::AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR)
188
+ @acap_gradnt.bitmap_label = (create_colour_bitmap(col))
189
+
190
+ col = art.get_colour(Wx::AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR)
191
+ @acap_text.bitmap_label = (create_colour_bitmap(col))
192
+
193
+ col = art.get_colour(Wx::AUI_DOCKART_SASH_COLOUR)
194
+ @brdr_colour.bitmap_label = (create_colour_bitmap(col))
195
+
196
+ col = art.get_colour(Wx::AUI_DOCKART_GRIPPER_COLOUR)
197
+ @grip_colour.bitmap_label = (create_colour_bitmap(col))
198
+ end
199
+
200
+ def on_pane_border_size(event)
201
+ @frame.get_dock_art.set_metric(Wx::AUI_DOCKART_PANE_BORDER_SIZE,
202
+ event.get_position)
203
+ @frame.do_update
204
+ end
205
+
206
+ def on_sash_size(event)
207
+ @frame.get_dock_art.set_metric(Wx::AUI_DOCKART_SASH_SIZE,
208
+ event.get_position)
209
+ @frame.do_update
210
+ end
211
+
212
+ def on_caption_size(event)
213
+ @frame.get_dock_art.set_metric(Wx::AUI_DOCKART_CAPTION_SIZE,
214
+ event.get_position)
215
+ @frame.do_update
216
+ end
217
+
218
+ def on_set_colour(event)
219
+ Wx.ColourDialog(@frame) do |dlg|
220
+ dlg.set_title("Colour Picker")
221
+
222
+ return unless dlg.show_modal == Wx::ID_OK
223
+
224
+ var = nil
225
+ case event.get_id()
226
+ when ID_BackgroundColour
227
+ var = Wx::AUI_DOCKART_BACKGROUND_COLOUR
228
+ when ID_SashColour
229
+ var = Wx::AUI_DOCKART_SASH_COLOUR
230
+ when ID_InactiveCaptionColour
231
+ var = Wx::AUI_DOCKART_INACTIVE_CAPTION_COLOUR
232
+ when ID_InactiveCaptionGradientColour
233
+ var = Wx::AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR
234
+ when ID_InactiveCaptionTextColour
235
+ var = Wx::AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR
236
+ when ID_ActiveCaptionColour
237
+ var = Wx::AUI_DOCKART_ACTIVE_CAPTION_COLOUR
238
+ when ID_ActiveCaptionGradientColour
239
+ var = Wx::AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR
240
+ when ID_ActiveCaptionTextColour
241
+ var = Wx::AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR
242
+ when ID_BorderColour
243
+ var = Wx::AUI_DOCKART_BORDER_COLOUR
244
+ when ID_GripperColour
245
+ var = Wx::AUI_DOCKART_GRIPPER_COLOUR
246
+ else
247
+ return
248
+ end
249
+
250
+ @frame.get_dock_art.set_colour(var, dlg.get_colour_data.get_colour)
251
+ @frame.do_update
252
+ update_colours
253
+ end
254
+ end
255
+
256
+ private
257
+
258
+ def make_metric_spin_ctrl(an_id, caption, metric)
259
+ metric_val = @frame.get_dock_art.get_metric(metric)
260
+ sp = Wx::SpinCtrl.new(self, an_id, metric_val.to_s,
261
+ Wx::DEFAULT_POSITION,
262
+ Wx::Size.new(50, 20),
263
+ Wx::SP_ARROW_KEYS,
264
+ 0, 100, metric_val)
265
+
266
+ sz = Wx::BoxSizer.new(Wx::HORIZONTAL)
267
+ sz.add(1, 1, 1, Wx::EXPAND)
268
+ sz.add(Wx::StaticText.new(self, Wx::ID_ANY, caption))
269
+ sz.add(sp)
270
+ sz.add(1, 1, 1, Wx::EXPAND)
271
+ sz.set_item_min_size(1, 180, 20)
272
+ return sp, sz
273
+ end
274
+
275
+ # utility to make a little captioned button;
276
+ # returns the button and a sizer containing the button and caption
277
+ def make_colour_button(an_id, caption)
278
+ bmp_butt = Wx::BitmapButton.new(self, an_id, @base_bmp,
279
+ Wx::DEFAULT_POSITION,
280
+ Wx::Size.new(50, 25))
281
+
282
+ sz = Wx::BoxSizer.new(Wx::HORIZONTAL)
283
+ sz.add(1, 1, 1, Wx::EXPAND)
284
+ sz.add(Wx::StaticText.new(self, Wx::ID_ANY, caption))
285
+ sz.add(bmp_butt)
286
+ sz.add(1, 1, 1, Wx::EXPAND)
287
+ sz.set_item_min_size(1, 180, 20)
288
+ return bmp_butt, sz
289
+ end
290
+
291
+ # returns a 25 x 14 image with solid colour +colour+, with a 1-pixel
292
+ # black border
293
+ def create_colour_bitmap(colour)
294
+ img = Wx::Image.new(25, 14)
295
+ 0.upto(24) do |x|
296
+ 0.upto(13) do |y|
297
+ if (x == 0 || x == 24 || y == 0 || y == 13)
298
+ pixcol = Wx::BLACK
299
+ else
300
+ pixcol = colour
301
+ end
302
+ img.set_rgb(x, y, pixcol.red, pixcol.green, pixcol.blue)
303
+ end
304
+ end
305
+ return Wx::Bitmap.new(img)
306
+ end
307
+ end
308
+
309
+ class AuiFrame < Wx::Frame
310
+ consts = %w[
311
+ ID_CreateTree
312
+ ID_CreateGrid
313
+ ID_CreateText
314
+ ID_CreateHTML
315
+ ID_CreateNotebook
316
+ ID_CreateSizeReport
317
+ ID_GridContent
318
+ ID_TextContent
319
+ ID_TreeContent
320
+ ID_HTMLContent
321
+ ID_NotebookContent
322
+ ID_SizeReportContent
323
+ ID_CreatePerspective
324
+ ID_CopyPerspectiveCode
325
+ ID_AllowFloating
326
+ ID_AllowActivePane
327
+ ID_TransparentHint
328
+ ID_VenetianBlindsHint
329
+ ID_RectangleHint
330
+ ID_NoHint
331
+ ID_HintFade
332
+ ID_NoVenetianFade
333
+ ID_TransparentDrag
334
+ ID_NoGradient
335
+ ID_VerticalGradient
336
+ ID_HorizontalGradient
337
+ ID_Settings
338
+ ID_NotebookNoCloseButton
339
+ ID_NotebookCloseButton
340
+ ID_NotebookCloseButtonAll
341
+ ID_NotebookCloseButtonActive
342
+ ID_NotebookAllowTabMove
343
+ ID_NotebookAllowTabExternalMove
344
+ ID_NotebookAllowTabSplit
345
+ ID_NotebookWindowList
346
+ ID_NotebookScrollButtons
347
+ ID_NotebookTabFixedWidth
348
+ ID_NotebookArtGloss
349
+ ID_NotebookArtSimple ]
350
+
351
+ consts.each_with_index do |c, i|
352
+ const_set(c, 2000 + i)
353
+ end
354
+ ID_FirstPerspective = ID_CreatePerspective + 1000
355
+
356
+ def initialize(*args)
357
+ super
358
+ @mgr = Wx::AuiManager.new
359
+ @mgr.set_managed_window(self)
360
+ @perspectives = []
361
+
362
+ # set up default notebook style
363
+ @notebook_style = Wx::AUI_NB_DEFAULT_STYLE |
364
+ Wx::AUI_NB_TAB_EXTERNAL_MOVE | Wx::NO_BORDER
365
+ @notebook_theme = 0
366
+ setup_menu
367
+ create_status_bar
368
+ get_status_bar.set_status_text("Ready")
369
+ set_min_size(Wx::Size.new(400, 300))
370
+ setup_toolbars
371
+ setup_panes
372
+ setup_perspectives
373
+ setup_events
374
+ @mgr.update
375
+ end
376
+
377
+ def dock_art
378
+ @mgr.art_provider
379
+ end
380
+
381
+ #
382
+ def setup_menu
383
+ mb = Wx::MenuBar.new
384
+
385
+ file_menu = Wx::Menu.new
386
+ file_menu.append(Wx::ID_EXIT, "Exit")
387
+
388
+ view_menu = Wx::Menu.new
389
+ view_menu.append(ID_CreateText, "Create Text Control")
390
+ view_menu.append(ID_CreateHTML, "Create HTML Control")
391
+ view_menu.append(ID_CreateTree, "Create Tree")
392
+ view_menu.append(ID_CreateGrid, "Create Grid")
393
+ view_menu.append(ID_CreateNotebook, "Create Notebook")
394
+ view_menu.append(ID_CreateSizeReport, "Create Size Reporter")
395
+ view_menu.append_separator
396
+
397
+ view_menu.append(ID_GridContent,
398
+ "Use a Grid for the Content Pane")
399
+ view_menu.append(ID_TextContent,
400
+ "Use a Text Control for the Content Pane")
401
+ view_menu.append(ID_HTMLContent,
402
+ "Use an HTML Control for the Content Pane")
403
+ view_menu.append(ID_TreeContent,
404
+ "Use a Tree Control for the Content Pane")
405
+ view_menu.append(ID_NotebookContent,
406
+ "Use a wxAuiNotebook control for the Content Pane")
407
+ view_menu.append(ID_SizeReportContent,
408
+ "Use a Size Reporter for the Content Pane")
409
+
410
+ options_menu = Wx::Menu.new
411
+ # Hints
412
+ options_menu.append_radio_item(ID_TransparentHint,
413
+ "Transparent Hint")
414
+ options_menu.append_radio_item(ID_VenetianBlindsHint,
415
+ "Venetian Blinds Hint")
416
+ options_menu.append_radio_item(ID_RectangleHint,
417
+ "Rectangle Hint")
418
+ options_menu.append_radio_item(ID_NoHint,
419
+ "No Hint")
420
+
421
+ options_menu.append_separator
422
+ # Hints Options
423
+ options_menu.append_check_item(ID_HintFade,
424
+ "Hint Fade-in")
425
+ options_menu.append_check_item(ID_AllowFloating,
426
+ "Allow Floating")
427
+ options_menu.append_check_item(ID_NoVenetianFade,
428
+ "Disable Venetian Blinds Hint Fade-in")
429
+ options_menu.append_check_item(ID_TransparentDrag,
430
+ "Transparent Drag")
431
+ options_menu.append_check_item(ID_AllowActivePane,
432
+ "Allow Active Pane")
433
+ options_menu.append_separator
434
+ options_menu.append_radio_item(ID_NoGradient,
435
+ "No Caption Gradient")
436
+ options_menu.append_radio_item(ID_VerticalGradient,
437
+ "Vertical Caption Gradient")
438
+ options_menu.append_radio_item(ID_HorizontalGradient,
439
+ "Horizontal Caption Gradient")
440
+ options_menu.append_separator
441
+ options_menu.append(ID_Settings, "Settings Pane")
442
+
443
+ notebook_menu = Wx::Menu.new
444
+ notebook_menu.append_radio_item(ID_NotebookArtGloss,
445
+ "Glossy Theme (Default)")
446
+ notebook_menu.append_radio_item(ID_NotebookArtSimple,
447
+ "Simple Theme")
448
+
449
+ notebook_menu.append_separator
450
+
451
+ notebook_menu.append_radio_item(ID_NotebookNoCloseButton,
452
+ "No Close Button")
453
+ notebook_menu.append_radio_item(ID_NotebookCloseButton,
454
+ "Close Button at Right")
455
+ notebook_menu.append_radio_item(ID_NotebookCloseButtonAll,
456
+ "Close Button on All Tabs")
457
+ notebook_menu.append_radio_item(ID_NotebookCloseButtonActive,
458
+ "Close Button on Active Tab")
459
+
460
+ notebook_menu.append_separator
461
+ notebook_menu.append_check_item(ID_NotebookAllowTabMove,
462
+ "Allow Tab Move")
463
+ notebook_menu.append_check_item(ID_NotebookAllowTabExternalMove,
464
+ "Allow External Tab Move")
465
+ notebook_menu.append_check_item(ID_NotebookAllowTabSplit,
466
+ "Allow Notebook Split")
467
+ notebook_menu.append_check_item(ID_NotebookScrollButtons,
468
+ "Scroll Buttons Visible")
469
+ notebook_menu.append_check_item(ID_NotebookWindowList,
470
+ "Window List Button Visible")
471
+ notebook_menu.append_check_item(ID_NotebookTabFixedWidth,
472
+ "Fixed-width Tabs")
473
+
474
+ @perspectives_menu = Wx::Menu.new
475
+ @perspectives_menu.append(ID_CreatePerspective,
476
+ "Create Perspective")
477
+ @perspectives_menu.append(ID_CopyPerspectiveCode,
478
+ "Copy Perspective Data To Clipboard")
479
+ @perspectives_menu.append_separator
480
+ @perspectives_menu.append(ID_FirstPerspective + 0, "Default Startup")
481
+ @perspectives_menu.append(ID_FirstPerspective + 1, "All Panes")
482
+
483
+ help_menu = Wx::Menu.new
484
+ help_menu.append(Wx::ID_ABOUT, "About...")
485
+
486
+ mb.append(file_menu, "File")
487
+ mb.append(view_menu, "View")
488
+ mb.append(@perspectives_menu, "Perspectives")
489
+ mb.append(options_menu, "Options")
490
+ mb.append(notebook_menu, "Notebook")
491
+ mb.append(help_menu, "Help")
492
+
493
+ set_menu_bar(mb)
494
+ end
495
+
496
+ def setup_events
497
+ evt_erase_background { |e| on_erase_background(e) }
498
+ evt_size { |e| on_size(e) }
499
+
500
+ evt_menu(ID_CreateTree) { |e| on_create_tree }
501
+ evt_menu(ID_CreateGrid) { |e| on_create_grid }
502
+ evt_menu(ID_CreateText) { |e| on_create_text }
503
+ evt_menu(ID_CreateHTML) { |e| on_create_html }
504
+ evt_menu(ID_CreateSizeReport) { |e| on_create_size_report }
505
+ evt_menu(ID_CreateNotebook) { |e| on_create_notebook }
506
+ evt_menu(ID_CreatePerspective) { |e| on_create_perspective }
507
+ evt_menu(ID_CopyPerspectiveCode) { |e| on_copy_perspective_code }
508
+ evt_menu(ID_AllowFloating) { |e| on_manager_flag(e) }
509
+ evt_menu(ID_TransparentHint) { |e| on_manager_flag(e) }
510
+ evt_menu(ID_VenetianBlindsHint) { |e| on_manager_flag(e) }
511
+ evt_menu(ID_RectangleHint) { |e| on_manager_flag(e) }
512
+ evt_menu(ID_NoHint) { |e| on_manager_flag(e) }
513
+ evt_menu(ID_HintFade) { |e| on_manager_flag(e) }
514
+ evt_menu(ID_NoVenetianFade) { |e| on_manager_flag(e) }
515
+ evt_menu(ID_TransparentDrag) { |e| on_manager_flag(e) }
516
+ evt_menu(ID_AllowActivePane) { |e| on_manager_flag(e) }
517
+ evt_menu(ID_NotebookTabFixedWidth) { |e| on_notebook_flag(e) }
518
+ evt_menu(ID_NotebookNoCloseButton) { |e| on_notebook_flag(e) }
519
+ evt_menu(ID_NotebookCloseButton) { |e| on_notebook_flag(e) }
520
+ evt_menu(ID_NotebookCloseButtonAll) { |e| on_notebook_flag(e) }
521
+ evt_menu(ID_NotebookCloseButtonActive) { |e| on_notebook_flag(e) }
522
+ evt_menu(ID_NotebookAllowTabMove) { |e| on_notebook_flag(e) }
523
+ evt_menu(ID_NotebookAllowTabExternalMove) { |e| on_notebook_flag(e) }
524
+ evt_menu(ID_NotebookAllowTabSplit) { |e| on_notebook_flag(e) }
525
+ evt_menu(ID_NotebookScrollButtons) { |e| on_notebook_flag(e) }
526
+ evt_menu(ID_NotebookWindowList) { |e| on_notebook_flag(e) }
527
+ evt_menu(ID_NotebookArtGloss) { |e| on_notebook_flag(e) }
528
+ evt_menu(ID_NotebookArtSimple) { |e| on_notebook_flag(e) }
529
+ evt_menu(ID_NoGradient) { |e| on_gradient(e) }
530
+ evt_menu(ID_VerticalGradient) { |e| on_gradient(e) }
531
+ evt_menu(ID_HorizontalGradient) { |e| on_gradient(e) }
532
+ evt_menu(ID_Settings) { on_settings }
533
+ evt_menu(ID_GridContent) { |e| on_change_content_pane(e) }
534
+ evt_menu(ID_TreeContent) { |e| on_change_content_pane(e) }
535
+ evt_menu(ID_TextContent) { |e| on_change_content_pane(e) }
536
+ evt_menu(ID_SizeReportContent) { |e| on_change_content_pane(e) }
537
+ evt_menu(ID_HTMLContent) { |e| on_change_content_pane(e) }
538
+ evt_menu(ID_NotebookContent) { |e| on_change_content_pane(e) }
539
+ evt_menu(Wx::ID_EXIT) { |e| on_exit }
540
+ evt_menu(Wx::ID_ABOUT) { |e| on_about }
541
+ evt_update_ui(ID_NotebookTabFixedWidth) { |e| on_update_ui(e) }
542
+ evt_update_ui(ID_NotebookNoCloseButton) { |e| on_update_ui(e) }
543
+ evt_update_ui(ID_NotebookCloseButton) { |e| on_update_ui(e) }
544
+ evt_update_ui(ID_NotebookCloseButtonAll) { |e| on_update_ui(e) }
545
+ evt_update_ui(ID_NotebookCloseButtonActive) { |e| on_update_ui(e) }
546
+ evt_update_ui(ID_NotebookAllowTabMove) { |e| on_update_ui(e) }
547
+ evt_update_ui(ID_NotebookAllowTabExternalMove) { |e| on_update_ui(e) }
548
+ evt_update_ui(ID_NotebookAllowTabSplit) { |e| on_update_ui(e) }
549
+ evt_update_ui(ID_NotebookScrollButtons) { |e| on_update_ui(e) }
550
+ evt_update_ui(ID_NotebookWindowList) { |e| on_update_ui(e) }
551
+ evt_update_ui(ID_AllowFloating) { |e| on_update_ui(e) }
552
+ evt_update_ui(ID_TransparentHint) { |e| on_update_ui(e) }
553
+ evt_update_ui(ID_VenetianBlindsHint) { |e| on_update_ui(e) }
554
+ evt_update_ui(ID_RectangleHint) { |e| on_update_ui(e) }
555
+ evt_update_ui(ID_NoHint) { |e| on_update_ui(e) }
556
+ evt_update_ui(ID_HintFade) { |e| on_update_ui(e) }
557
+ evt_update_ui(ID_NoVenetianFade) { |e| on_update_ui(e) }
558
+ evt_update_ui(ID_TransparentDrag) { |e| on_update_ui(e) }
559
+ evt_update_ui(ID_NoGradient) { |e| on_update_ui(e) }
560
+ evt_update_ui(ID_VerticalGradient) { |e| on_update_ui(e) }
561
+ evt_update_ui(ID_HorizontalGradient) { |e| on_update_ui(e) }
562
+ evt_menu_range(ID_FirstPerspective,
563
+ ID_FirstPerspective +
564
+ @perspectives.length) { |e| on_restore_perspective(e) }
565
+ evt_aui_pane_close { |e| on_pane_close(e) }
566
+ evt_auinotebook_page_close(Wx::ID_ANY) { |e| on_notebook_page_close(e) }
567
+ end
568
+
569
+ # create some toolbars
570
+ def setup_toolbars
571
+ tb1 = Wx::ToolBar.new(self, Wx::ID_ANY,
572
+ Wx::DEFAULT_POSITION,
573
+ Wx::DEFAULT_SIZE,
574
+ Wx::TB_FLAT | Wx::TB_NODIVIDER)
575
+ tb1.set_tool_bitmap_size(Wx::Size.new(48, 48))
576
+ tb1.add_tool(101, "Test",
577
+ Wx::ArtProvider::get_bitmap(Wx::ART_ERROR))
578
+ tb1.add_separator
579
+ tb1.add_tool(102, "Test",
580
+ Wx::ArtProvider::get_bitmap(Wx::ART_QUESTION))
581
+ tb1.add_tool(103, "Test",
582
+ Wx::ArtProvider::get_bitmap(Wx::ART_INFORMATION))
583
+ tb1.add_tool(103, "Test",
584
+ Wx::ArtProvider::get_bitmap(Wx::ART_WARNING));
585
+ tb1.add_tool(103, "Test",
586
+ Wx::ArtProvider::get_bitmap(Wx::ART_MISSING_IMAGE));
587
+ tb1.realize
588
+
589
+ tb2 = Wx::ToolBar.new(self, Wx::ID_ANY, Wx::DEFAULT_POSITION,
590
+ Wx::DEFAULT_SIZE,
591
+ Wx::TB_FLAT | Wx::TB_NODIVIDER)
592
+ tb2.set_tool_bitmap_size(Wx::Size.new(16, 16))
593
+
594
+ tb2_bmp1 = Wx::ArtProvider::get_bitmap(Wx::ART_QUESTION,
595
+ Wx::ART_OTHER,
596
+ Wx::Size.new(16, 16))
597
+ tb2.add_tool(101, "Test", tb2_bmp1);
598
+ tb2.add_tool(101, "Test", tb2_bmp1);
599
+ tb2.add_tool(101, "Test", tb2_bmp1);
600
+ tb2.add_tool(101, "Test", tb2_bmp1);
601
+ tb2.add_separator
602
+ tb2.add_tool(101, "Test", tb2_bmp1);
603
+ tb2.add_tool(101, "Test", tb2_bmp1);
604
+ tb2.add_separator
605
+ tb2.add_tool(101, "Test", tb2_bmp1);
606
+ tb2.add_tool(101, "Test", tb2_bmp1);
607
+ tb2.add_tool(101, "Test", tb2_bmp1);
608
+ tb2.add_tool(101, "Test", tb2_bmp1);
609
+ tb2.realize
610
+
611
+ tb3 = Wx::ToolBar.new(self, Wx::ID_ANY,
612
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
613
+ Wx::TB_FLAT | Wx::TB_NODIVIDER)
614
+ tb3.set_tool_bitmap_size(Wx::Size.new(16, 16))
615
+ tb3_bmp1 = Wx::ArtProvider::get_bitmap(Wx::ART_FOLDER,
616
+ Wx::ART_OTHER,
617
+ Wx::Size.new(16, 16))
618
+ tb3.add_tool(101, "Test", tb3_bmp1)
619
+ tb3.add_tool(101, "Test", tb3_bmp1)
620
+ tb3.add_tool(101, "Test", tb3_bmp1)
621
+ tb3.add_tool(101, "Test", tb3_bmp1)
622
+ tb3.add_separator
623
+ tb3.add_tool(101, "Test", tb3_bmp1)
624
+ tb3.add_tool(101, "Test", tb3_bmp1)
625
+ tb3.realize
626
+
627
+ tb4 = Wx::ToolBar.new(self, Wx::ID_ANY,
628
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
629
+ Wx::TB_FLAT | Wx::TB_NODIVIDER | Wx::TB_HORZ_TEXT)
630
+ tb4.set_tool_bitmap_size(Wx::Size.new(16, 16))
631
+ tb4_bmp1 = Wx::ArtProvider::get_bitmap(Wx::ART_NORMAL_FILE,
632
+ Wx::ART_OTHER,
633
+ Wx::Size.new(16, 16))
634
+ tb4.add_tool(101, "Item 1", tb4_bmp1)
635
+ tb4.add_tool(101, "Item 2", tb4_bmp1)
636
+ tb4.add_tool(101, "Item 3", tb4_bmp1)
637
+ tb4.add_tool(101, "Item 4", tb4_bmp1)
638
+ tb4.add_separator
639
+ tb4.add_tool(101, "Item 5", tb4_bmp1)
640
+ tb4.add_tool(101, "Item 6", tb4_bmp1)
641
+ tb4.add_tool(101, "Item 7", tb4_bmp1)
642
+ tb4.add_tool(101, "Item 8", tb4_bmp1)
643
+ tb4.realize
644
+
645
+ # create some toolbars
646
+ tb5 = Wx::ToolBar.new(self, Wx::ID_ANY,
647
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
648
+ Wx::TB_FLAT | Wx::TB_NODIVIDER | Wx::TB_VERTICAL)
649
+ tb5.set_tool_bitmap_size(Wx::Size.new(48, 48))
650
+ tb5.add_tool(101, "Test",
651
+ Wx::ArtProvider::get_bitmap(Wx::ART_ERROR))
652
+ tb5.add_separator
653
+ tb5.add_tool(102, "Test",
654
+ Wx::ArtProvider::get_bitmap(Wx::ART_QUESTION))
655
+ tb5.add_tool(103, "Test",
656
+ Wx::ArtProvider::get_bitmap(Wx::ART_INFORMATION))
657
+ tb5.add_tool(103, "Test",
658
+ Wx::ArtProvider::get_bitmap(Wx::ART_WARNING))
659
+ tb5.add_tool(103, "Test",
660
+ Wx::ArtProvider::get_bitmap(Wx::ART_MISSING_IMAGE))
661
+ tb5.realize
662
+
663
+ # add the toolbars to the manager
664
+ pi = Wx::AuiPaneInfo.new
665
+ pi.set_name('tb1').set_caption("Big Toolbar").toolbar_pane
666
+ pi.top.set_left_dockable(false).set_right_dockable(false)
667
+ @mgr.add_pane(tb1, pi)
668
+
669
+ pi = Wx::AuiPaneInfo.new
670
+ pi.set_name('tb2').set_caption("Toolbar 2").toolbar_pane
671
+ pi.top.set_row(1)
672
+ pi.set_left_dockable(false).set_right_dockable(false)
673
+ @mgr.add_pane(tb2, pi)
674
+
675
+ pi = Wx::AuiPaneInfo.new
676
+ pi.set_name('tb3').set_caption("Toolbar 3").toolbar_pane
677
+ pi.top.set_row(1).set_position(1)
678
+ pi.set_left_dockable(false).set_right_dockable(false)
679
+ @mgr.add_pane(tb3, pi)
680
+
681
+ pi = Wx::AuiPaneInfo.new
682
+ pi.set_name('tb4').set_caption("Sample Bookmark Toolbar")
683
+ pi.toolbar_pane.top.set_row(2)
684
+ pi.set_left_dockable(false).set_right_dockable(false)
685
+ @mgr.add_pane(tb4, pi)
686
+
687
+ pi = Wx::AuiPaneInfo.new
688
+ pi.set_name('tb5').set_caption("Sample Vertical Toolbar")
689
+ pi.toolbar_pane.left.set_gripper_top
690
+ pi.set_left_dockable(false).set_right_dockable(false)
691
+ @mgr.add_pane(tb5, pi)
692
+ end
693
+
694
+ def setup_panes
695
+ # add a bunch of panes
696
+ pi = Wx::AuiPaneInfo.new
697
+ pi.set_name('test1').set_caption('Pane Caption').top
698
+ @mgr.add_pane(create_size_report_ctrl, pi)
699
+
700
+ pi = Wx::AuiPaneInfo.new
701
+ pi.set_name('test2').set_caption('Client Size Reporter').bottom
702
+ pi.set_position(1).set_close_button.set_maximize_button
703
+ @mgr.add_pane(create_size_report_ctrl, pi)
704
+
705
+ pi = Wx::AuiPaneInfo.new
706
+ pi.set_name('test3').set_caption('Client Size Reporter').bottom
707
+ pi.set_close_button.set_maximize_button
708
+ @mgr.add_pane(create_size_report_ctrl, pi)
709
+
710
+ pi = Wx::AuiPaneInfo.new
711
+ pi.set_name('test4').set_caption('Pane Caption').left
712
+ @mgr.add_pane(create_size_report_ctrl, pi)
713
+
714
+ pi = Wx::AuiPaneInfo.new
715
+ pi.set_name('test5').set_caption('No Close Button').right
716
+ pi.set_close_button(false)
717
+ @mgr.add_pane(create_size_report_ctrl, pi)
718
+
719
+ pi = Wx::AuiPaneInfo.new
720
+ pi.set_name('test6').set_caption('Client Size Report').right
721
+ pi.set_row(1).set_close_button.set_maximize_button
722
+ @mgr.add_pane(create_size_report_ctrl, pi)
723
+
724
+ pi = Wx::AuiPaneInfo.new
725
+ pi.set_name('test7').set_caption('Client Size Report').left
726
+ pi.set_layer(1).set_close_button.set_maximize_button
727
+ @mgr.add_pane(create_size_report_ctrl, pi)
728
+
729
+ pi = Wx::AuiPaneInfo.new
730
+ pi.set_name('test8').set_caption('Tree Pane').left
731
+ pi.set_layer(1).set_position(1).set_close_button.set_maximize_button
732
+ @mgr.add_pane(create_tree_ctrl, pi)
733
+
734
+ pi = Wx::AuiPaneInfo.new
735
+ pi_size = Wx::Size.new(200, 100)
736
+ pi.set_name('test9').set_caption('Min Size 200x100').bottom
737
+ pi.set_best_size(pi_size).set_min_size(pi_size)
738
+ pi.set_layer(1).set_close_button.set_maximize_button
739
+ @mgr.add_pane(create_size_report_ctrl, pi)
740
+
741
+ wnd10 = create_text_ctrl("This pane will prompt the user before hiding.")
742
+ pi = Wx::AuiPaneInfo.new
743
+ pi.set_name('test10').set_caption('Text Pane with hide prompt')
744
+ pi.bottom.set_layer(1).set_position(1)
745
+ @mgr.add_pane(wnd10, pi)
746
+
747
+ pi = Wx::AuiPaneInfo.new
748
+ pi.set_name('test11').set_caption('Fixed Pane').bottom
749
+ pi.set_layer(1).set_position(2).fixed
750
+ @mgr.add_pane(create_size_report_ctrl, pi)
751
+
752
+ pi = Wx::AuiPaneInfo.new
753
+ pi.set_name('settings').set_caption('Dock Manager Settings')
754
+ pi.set_dockable(false).float.hide
755
+
756
+ @mgr.add_pane(SettingsPanel.new(self, self), pi)
757
+
758
+ # create some center panes
759
+
760
+ pi = Wx::AuiPaneInfo.new
761
+ pi.set_name('grid_content').center_pane.hide
762
+ @mgr.add_pane(create_grid, pi)
763
+
764
+ pi = Wx::AuiPaneInfo.new
765
+ pi.set_name('tree_content').center_pane.hide
766
+ @mgr.add_pane(create_tree_ctrl, pi)
767
+
768
+ pi = Wx::AuiPaneInfo.new
769
+ pi.set_name('sizereport_content').center_pane.hide
770
+ @mgr.add_pane(create_size_report_ctrl, pi)
771
+
772
+ pi = Wx::AuiPaneInfo.new
773
+ pi.set_name('text_content').center_pane.hide
774
+ @mgr.add_pane(create_text_ctrl, pi)
775
+
776
+ pi = Wx::AuiPaneInfo.new
777
+ pi.set_name('html_content').center_pane.hide
778
+ @mgr.add_pane(create_html_ctrl, pi)
779
+
780
+ pi = Wx::AuiPaneInfo.new
781
+ pi.set_name('notebook_content').center_pane.hide
782
+ @mgr.add_pane(create_notebook, pi)
783
+
784
+ pi = Wx::AuiPaneInfo.new
785
+ pi.set_name('tb6').toolbar_pane.top
786
+ pi.set_row(2).set_position(1)
787
+ pi.set_left_dockable(false).set_right_dockable(false)
788
+ @mgr.add_pane(Wx::Button.new(self, Wx::ID_ANY, "Test Button"), pi)
789
+ end
790
+
791
+ # make some default perspectives
792
+ def setup_perspectives
793
+ perspective_all = @mgr.save_perspective
794
+
795
+ @mgr.each_pane do |pane|
796
+ pane.hide unless pane.is_toolbar
797
+ end
798
+
799
+ @mgr.get_pane("tb1").hide
800
+ @mgr.get_pane("tb6").hide
801
+ @mgr.get_pane("test8").show.left.set_layer(0).set_row(0).set_position(0)
802
+ @mgr.get_pane("test10").show.bottom.set_layer(0).set_row(0).set_position(0)
803
+ @mgr.get_pane("notebook_content").show
804
+ perspective_default = @mgr.save_perspective
805
+
806
+ @perspectives << perspective_default
807
+ @perspectives << perspective_all
808
+ end
809
+
810
+ def get_dock_art
811
+ @mgr.get_art_provider
812
+ end
813
+
814
+ def do_update
815
+ @mgr.update
816
+ end
817
+
818
+ def on_erase_background(event)
819
+ event.skip
820
+ end
821
+
822
+ def on_size(event)
823
+ event.skip
824
+ end
825
+
826
+ def on_settings
827
+ float_pane = @mgr.get_pane("settings").float.show
828
+ if float_pane.floating_position == Wx::DEFAULT_POSITION
829
+ float_pane.floating_position = get_start_position
830
+ end
831
+ @mgr.update
832
+ end
833
+
834
+ def on_gradient(event)
835
+ gradient = nil
836
+ case event.get_id
837
+ when ID_NoGradient
838
+ gradient = Wx::AUI_GRADIENT_NONE
839
+ when ID_VerticalGradient
840
+ gradient = Wx::AUI_GRADIENT_VERTICAL
841
+ when ID_HorizontalGradient
842
+ gradient = Wx::AUI_GRADIENT_HORIZONTAL
843
+ end
844
+ return if not gradient
845
+ @mgr.get_art_provider.set_metric(Wx::AUI_DOCKART_GRADIENT_TYPE,
846
+ gradient)
847
+ @mgr.update
848
+ end
849
+
850
+ def on_manager_flag(event)
851
+ e_id = event.get_id
852
+ if e_id == ID_TransparentHint or
853
+ e_id == ID_VenetianBlindsHint or
854
+ e_id == ID_RectangleHint or
855
+ e_id == ID_NoHint
856
+ flags = @mgr.get_flags
857
+ flags &= ~Wx::AUI_MGR_TRANSPARENT_HINT
858
+ flags &= ~Wx::AUI_MGR_VENETIAN_BLINDS_HINT
859
+ flags &= ~Wx::AUI_MGR_RECTANGLE_HINT
860
+ @mgr.set_flags(flags)
861
+ end
862
+
863
+ flag = nil
864
+ case e_id
865
+ when ID_AllowFloating
866
+ flag = Wx::AUI_MGR_ALLOW_FLOATING
867
+ when ID_TransparentDrag
868
+ flag = Wx::AUI_MGR_TRANSPARENT_DRAG
869
+ when ID_HintFade
870
+ flag = Wx::AUI_MGR_HINT_FADE
871
+ when ID_NoVenetianFade
872
+ flag = Wx::AUI_MGR_NO_VENETIAN_BLINDS_FADE
873
+ when ID_AllowActivePane
874
+ flag = Wx::AUI_MGR_ALLOW_ACTIVE_PANE
875
+ when ID_TransparentHint
876
+ flag = Wx::AUI_MGR_TRANSPARENT_HINT
877
+ when ID_VenetianBlindsHint
878
+ flag = Wx::AUI_MGR_VENETIAN_BLINDS_HINT
879
+ when ID_RectangleHint
880
+ flag = Wx::AUI_MGR_RECTANGLE_HINT
881
+ end
882
+
883
+ if flag
884
+ @mgr.set_flags(@mgr.get_flags ^ flag)
885
+ end
886
+
887
+ @mgr.update
888
+ end
889
+
890
+ def on_notebook_flag(event)
891
+ e_id = event.get_id
892
+
893
+ if e_id == ID_NotebookNoCloseButton or
894
+ e_id == ID_NotebookCloseButton or
895
+ e_id == ID_NotebookCloseButtonAll or
896
+ e_id == ID_NotebookCloseButtonActive
897
+ @notebook_style &= ~(Wx::AUI_NB_CLOSE_BUTTON |
898
+ Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB |
899
+ Wx::AUI_NB_CLOSE_ON_ALL_TABS)
900
+ end
901
+
902
+ case e_id
903
+ when ID_NotebookNoCloseButton
904
+ # nothing
905
+ when ID_NotebookCloseButton
906
+ @notebook_style |= Wx::AUI_NB_CLOSE_BUTTON
907
+ when ID_NotebookCloseButtonAll
908
+ @notebook_style |= Wx::AUI_NB_CLOSE_ON_ALL_TABS
909
+ when ID_NotebookCloseButtonActive
910
+ @notebook_style |= Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB
911
+ end
912
+
913
+ if e_id == ID_NotebookAllowTabMove
914
+ @notebook_style ^= Wx::AUI_NB_TAB_MOVE
915
+ end
916
+
917
+ if e_id == ID_NotebookAllowTabExternalMove
918
+ @notebook_style ^= Wx::AUI_NB_TAB_EXTERNAL_MOVE
919
+ elsif e_id == ID_NotebookAllowTabSplit
920
+ @notebook_style ^= Wx::AUI_NB_TAB_SPLIT
921
+ elsif e_id == ID_NotebookWindowList
922
+ @notebook_style ^= Wx::AUI_NB_WINDOWLIST_BUTTON
923
+ elsif e_id == ID_NotebookScrollButtons
924
+ @notebook_style ^= Wx::AUI_NB_SCROLL_BUTTONS
925
+ elsif e_id == ID_NotebookTabFixedWidth
926
+ @notebook_style ^= Wx::AUI_NB_TAB_FIXED_WIDTH
927
+ end
928
+
929
+ @mgr.each_pane do |pane|
930
+ maybe_nb = pane.window
931
+ next unless maybe_nb.kind_of?(Wx::AuiNotebook)
932
+ if e_id == ID_NotebookArtGloss
933
+ maybe_nb.use_default_art
934
+ @notebook_theme = 0
935
+ elsif e_id == ID_NotebookArtSimple
936
+ maybe_nb.use_simple_art
937
+ @notebook_theme = 1
938
+ end
939
+
940
+ maybe_nb.set_window_style_flag(@notebook_style)
941
+ maybe_nb.refresh()
942
+ end
943
+ end
944
+
945
+ def on_update_ui(event)
946
+ flags = @mgr.get_flags
947
+
948
+ case event.get_id
949
+ when ID_NoGradient
950
+ event.check(@mgr.get_art_provider.get_metric(Wx::AUI_DOCKART_GRADIENT_TYPE) == Wx::AUI_GRADIENT_NONE)
951
+ when ID_VerticalGradient
952
+ event.check(@mgr.get_art_provider.get_metric(Wx::AUI_DOCKART_GRADIENT_TYPE) == Wx::AUI_GRADIENT_VERTICAL)
953
+ when ID_HorizontalGradient
954
+ event.check(@mgr.get_art_provider.get_metric(Wx::AUI_DOCKART_GRADIENT_TYPE) == Wx::AUI_GRADIENT_HORIZONTAL)
955
+ when ID_AllowFloating
956
+ event.check((flags & Wx::AUI_MGR_ALLOW_FLOATING) != 0)
957
+ when ID_TransparentDrag
958
+ event.check((flags & Wx::AUI_MGR_TRANSPARENT_DRAG) != 0)
959
+ when ID_TransparentHint
960
+ event.check((flags & Wx::AUI_MGR_TRANSPARENT_HINT) != 0)
961
+ when ID_VenetianBlindsHint
962
+ event.check((flags & Wx::AUI_MGR_VENETIAN_BLINDS_HINT) != 0)
963
+ when ID_RectangleHint
964
+ event.check((flags & Wx::AUI_MGR_RECTANGLE_HINT) != 0)
965
+ when ID_NoHint
966
+ event.check((Wx::AUI_MGR_TRANSPARENT_HINT |
967
+ Wx::AUI_MGR_VENETIAN_BLINDS_HINT |
968
+ Wx::AUI_MGR_RECTANGLE_HINT) & flags == 0)
969
+ when ID_HintFade
970
+ event.check((flags & Wx::AUI_MGR_HINT_FADE) != 0)
971
+ when ID_NoVenetianFade
972
+ event.check((flags & Wx::AUI_MGR_NO_VENETIAN_BLINDS_FADE) != 0)
973
+ when ID_NotebookNoCloseButton
974
+ event.check((@notebook_style &
975
+ (Wx::AUI_NB_CLOSE_BUTTON |
976
+ Wx::AUI_NB_CLOSE_ON_ALL_TABS |
977
+ Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB)) != 0)
978
+ when ID_NotebookCloseButton
979
+ event.check((@notebook_style & Wx::AUI_NB_CLOSE_BUTTON) != 0)
980
+ when ID_NotebookCloseButtonAll
981
+ event.check((@notebook_style & Wx::AUI_NB_CLOSE_ON_ALL_TABS) != 0)
982
+ when ID_NotebookCloseButtonActive
983
+ event.check((@notebook_style & Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB) != 0)
984
+ when ID_NotebookAllowTabSplit
985
+ event.check((@notebook_style & Wx::AUI_NB_TAB_SPLIT) != 0)
986
+ when ID_NotebookAllowTabMove
987
+ event.check((@notebook_style & Wx::AUI_NB_TAB_MOVE) != 0)
988
+ when ID_NotebookAllowTabExternalMove
989
+ event.check((@notebook_style & Wx::AUI_NB_TAB_EXTERNAL_MOVE) != 0)
990
+ when ID_NotebookScrollButtons
991
+ event.check((@notebook_style & Wx::AUI_NB_SCROLL_BUTTONS) != 0)
992
+ when ID_NotebookWindowList
993
+ event.check((@notebook_style & Wx::AUI_NB_WINDOWLIST_BUTTON) != 0)
994
+ when ID_NotebookTabFixedWidth
995
+ event.check((@notebook_style & Wx::AUI_NB_TAB_FIXED_WIDTH) != 0)
996
+ when ID_NotebookArtGloss
997
+ event.check(@notebook_style == 0)
998
+ when ID_NotebookArtSimple
999
+ event.check(@notebook_style == 1)
1000
+ end
1001
+ end
1002
+
1003
+ def on_pane_close(event)
1004
+ if event.get_pane.name == "test10"
1005
+ msg = "Are you sure you want to close/hide this pane?"
1006
+ Wx.MessageDialog(self, msg, "Wx::AUI", Wx::YES_NO) do |dlg|
1007
+ if dlg.show_modal != Wx::ID_YES
1008
+ return event.veto
1009
+ end
1010
+ end
1011
+ end
1012
+ end
1013
+
1014
+ def on_create_perspective
1015
+ msg = "Enter a name for the new perspective:"
1016
+ Wx.TextEntryDialog(self, msg, "Wx::AUI Test") do |dlg|
1017
+ dlg.set_value("Perspective %d" % [@perspectives.length + 1])
1018
+ return unless dlg.show_modal == Wx::ID_OK
1019
+ if @perspectives.length.zero?
1020
+ @perspectives_menu.append_separator
1021
+ end
1022
+ @perspectives_menu.append(ID_FirstPerspective + @perspectives.length,
1023
+ dlg.get_value)
1024
+ @perspectives << @mgr.save_perspective
1025
+ end
1026
+ end
1027
+
1028
+ def on_copy_perspective_code
1029
+ Kernel.raise NotImplementedError
1030
+ end
1031
+
1032
+ def on_restore_perspective(event)
1033
+ perspective = @perspectives[event.get_id - ID_FirstPerspective]
1034
+ @mgr.load_perspective(perspective)
1035
+ end
1036
+
1037
+ def on_notebook_page_close(event)
1038
+ notebook = event.get_event_object
1039
+ if notebook.get_page(event.get_selection).kind_of?(Wx::HtmlWindow)
1040
+ msg = "Are you sure you want to close/hide this notebook page?"
1041
+ Wx.MessageDialog(self, msg, "Wx::AUI", Wx::YES_NO) do |dlg|
1042
+ if dlg.show_modal != Wx::ID_YES
1043
+ event.veto
1044
+ else
1045
+ event.allow
1046
+ end
1047
+ end
1048
+ end
1049
+ end
1050
+
1051
+ def get_start_position
1052
+ origin = client_to_screen(Wx::Point.new(0, 0))
1053
+ return Wx::Point.new(origin.x + 20, origin.y + 20)
1054
+ end
1055
+
1056
+ def on_create_tree
1057
+ pi = Wx::AuiPaneInfo.new
1058
+ pi.set_caption("Tree Control").float
1059
+ pi.set_floating_position(get_start_position)
1060
+ pi.set_floating_size(Wx::Size.new(150, 300))
1061
+ @mgr.add_pane(create_tree_ctrl, pi)
1062
+ @mgr.update
1063
+ end
1064
+
1065
+ def on_create_grid
1066
+ pi = Wx::AuiPaneInfo.new
1067
+ pi.set_caption("Grid").float
1068
+ pi.set_floating_position(get_start_position)
1069
+ pi.set_floating_size(Wx::Size.new(300, 200))
1070
+ @mgr.add_pane(create_grid, pi)
1071
+ @mgr.update
1072
+ end
1073
+
1074
+ def on_create_html
1075
+ pi = Wx::AuiPaneInfo.new
1076
+ pi.set_caption("HTML Control").float
1077
+ pi.set_floating_position(get_start_position)
1078
+ pi.set_floating_size(Wx::Size.new(300, 200))
1079
+ @mgr.add_pane(create_html_ctrl, pi)
1080
+ @mgr.update
1081
+ end
1082
+
1083
+ def on_create_notebook
1084
+ pi = Wx::AuiPaneInfo.new
1085
+ pi.set_caption("Notebook").float
1086
+ pi.set_floating_position(get_start_position)
1087
+ pi.set_close_button.set_maximize_button
1088
+ @mgr.add_pane(create_notebook, pi)
1089
+ @mgr.update
1090
+ end
1091
+
1092
+ def on_create_text
1093
+ pi = Wx::AuiPaneInfo.new
1094
+ pi.set_caption("Text Control").float
1095
+ pi.set_floating_position(get_start_position)
1096
+ @mgr.add_pane(create_text_ctrl, pi)
1097
+ @mgr.update
1098
+ end
1099
+
1100
+ def on_create_size_report
1101
+ pi = Wx::AuiPaneInfo.new
1102
+ pi.set_caption("Client Size Reporter").float
1103
+ pi.set_floating_position(get_start_position)
1104
+ pi.set_close_button.set_maximize_button
1105
+ @mgr.add_pane(create_size_report_ctrl, pi)
1106
+ @mgr.update
1107
+ end
1108
+
1109
+ def on_change_content_pane(event)
1110
+ e_id = event.get_id
1111
+ @mgr.get_pane("grid_content").show(e_id == ID_GridContent)
1112
+ @mgr.get_pane("text_content").show(e_id == ID_TextContent)
1113
+ @mgr.get_pane("tree_content").show(e_id == ID_TreeContent)
1114
+ @mgr.get_pane("sizereport_content").show(e_id == ID_SizeReportContent)
1115
+ @mgr.get_pane("html_content").show(e_id == ID_HTMLContent)
1116
+ @mgr.get_pane("notebook_content").show(e_id == ID_NotebookContent)
1117
+ @mgr.update
1118
+ end
1119
+
1120
+ def on_exit
1121
+ close(true)
1122
+ end
1123
+
1124
+ def on_about
1125
+ msg = "Wx::AUI Demo\nAn advanced window management library for wxRuby\nAdapted by Alex Fenton from the wxWidgets AUI Demo\n which is (c) Copyright 2005-2006, Kirix Corporation"
1126
+ Wx.MessageDialog(self, msg, "Wx::AUI", Wx::OK) do |dlg|
1127
+ dlg.show_modal
1128
+ end
1129
+ end
1130
+
1131
+ def create_text_ctrl(text = "")
1132
+ if text.empty?
1133
+ text = "This is a test text box"
1134
+ end
1135
+ Wx::TextCtrl.new(self, Wx::ID_ANY, text,
1136
+ Wx::Point.new(0, 0), Wx::Size.new(150, 90),
1137
+ Wx::NO_BORDER | Wx::TE_MULTILINE)
1138
+ end
1139
+
1140
+ def create_grid
1141
+ grid = Wx::Grid.new(self, Wx::ID_ANY,
1142
+ Wx::Point.new(0, 0),
1143
+ Wx::Size.new(150, 250),
1144
+ Wx::NO_BORDER | Wx::WANTS_CHARS)
1145
+ grid.create_grid(50, 20)
1146
+ grid
1147
+ end
1148
+
1149
+ def create_tree_ctrl
1150
+ tree = Wx::TreeCtrl.new(self, Wx::ID_ANY,
1151
+ Wx::Point.new(0, 0), Wx::Size.new(160, 250),
1152
+ Wx::TR_DEFAULT_STYLE | Wx::NO_BORDER)
1153
+
1154
+ img_list = Wx::ImageList.new(16, 16, true, 2)
1155
+ img_list.add(Wx::ArtProvider::get_bitmap(Wx::ART_FOLDER,
1156
+ Wx::ART_OTHER,
1157
+ Wx::Size.new(16, 16)))
1158
+ img_list.add(Wx::ArtProvider::get_bitmap(Wx::ART_NORMAL_FILE,
1159
+ Wx::ART_OTHER,
1160
+ Wx::Size.new(16, 16)))
1161
+ tree.set_image_list(img_list)
1162
+ root = tree.add_root("Wx::AUI Project", 0)
1163
+ items = []
1164
+ 1.upto(5) { |i| items << tree.append_item(root, "Item #{i}", 0) }
1165
+
1166
+ items.each do |id|
1167
+ 1.upto(5) { |i| tree.append_item(id, "Subitem #{i}", 0) }
1168
+ end
1169
+
1170
+ tree.expand(root)
1171
+ tree
1172
+ end
1173
+
1174
+ def create_size_report_ctrl(width = 80, height = 80)
1175
+ SizeReportCtrl.new(self, Wx::ID_ANY,
1176
+ Wx::DEFAULT_POSITION,
1177
+ Wx::Size.new(width, height), @mgr)
1178
+ end
1179
+
1180
+ def create_html_ctrl(parent = nil)
1181
+ if not parent
1182
+ parent = self
1183
+ end
1184
+ ctrl = Wx::HtmlWindow.new(parent, Wx::ID_ANY,
1185
+ Wx::DEFAULT_POSITION,
1186
+ Wx::Size.new(400, 300))
1187
+ ctrl.set_page <<~__HTML
1188
+ <html>
1189
+ <head><title>Test page</title></head>
1190
+ <body background="pic.png" bgcolor="#ffffff">
1191
+
1192
+ <B>wxString</B> <B>FindFirst</B>(was there a space between 'g' and 'F'?)<P>
1193
+
1194
+ <font size="+2">Unbre</font>akable word<P>
1195
+
1196
+ <pre width="50%">
1197
+ &lt;pre&gt; text, 50% wide
1198
+ </pre>
1199
+
1200
+
1201
+ <script>
1202
+ some meaningless script < is this > </is> FIXME: write real jscript here
1203
+ </script>
1204
+ text after script <b>in bold</b>
1205
+
1206
+ </body>
1207
+ </html>
1208
+ __HTML
1209
+ ctrl
1210
+ end
1211
+
1212
+ def create_notebook
1213
+ # create the notebook off-window to avoid flicker
1214
+ client_size = get_client_size
1215
+
1216
+ ctrl = Wx::AuiNotebook.new(self, Wx::ID_ANY,
1217
+ Wx::Point.new(client_size.width, client_size.height),
1218
+ Wx::Size.new(430, 200),
1219
+ @notebook_style)
1220
+
1221
+ page_bmp = Wx::ArtProvider::get_bitmap(Wx::ART_NORMAL_FILE,
1222
+ Wx::ART_OTHER,
1223
+ Wx::Size.new(16, 16))
1224
+
1225
+ ctrl.add_page(create_html_ctrl(ctrl),
1226
+ "Welcome to Wx::AUI", false, page_bmp)
1227
+
1228
+ panel = Wx::Panel.new(ctrl, Wx::ID_ANY)
1229
+ flex = Wx::FlexGridSizer.new(2)
1230
+ flex.add_growable_row(0)
1231
+ flex.add_growable_row(3)
1232
+ flex.add_growable_row(1)
1233
+
1234
+ flex.add(5, 5)
1235
+ flex.add(5, 5)
1236
+ flex.add(Wx::StaticText.new(panel, -1, "Wx::TextCtrl:"),
1237
+ 0, Wx::ALL | Wx::ALIGN_CENTRE, 5)
1238
+ flex.add(Wx::TextCtrl.new(panel, -1, "",
1239
+ Wx::DEFAULT_POSITION, Wx::Size.new(100, -1)),
1240
+ 1, Wx::ALL | Wx::ALIGN_CENTRE, 5)
1241
+
1242
+ flex.add(Wx::StaticText.new(panel, -1, "Wx::SpinCtrl:"),
1243
+ 0, Wx::ALL | Wx::ALIGN_CENTRE, 5)
1244
+ flex.add(Wx::SpinCtrl.new(panel, -1, "5",
1245
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1246
+ Wx::SP_ARROW_KEYS, 5, 50, 5),
1247
+ 1, Wx::ALL | Wx::ALIGN_CENTRE, 5)
1248
+
1249
+ flex.add(5, 5)
1250
+ flex.add(5, 5)
1251
+ panel.set_sizer(flex)
1252
+ ctrl.add_page(panel, "wxPanel", false, page_bmp)
1253
+
1254
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some text",
1255
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1256
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1257
+ "wxTextCtrl 1", false, page_bmp)
1258
+
1259
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1260
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1261
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1262
+ "wxTextCtrl 2")
1263
+
1264
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1265
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1266
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1267
+ "wxTextCtrl 3")
1268
+
1269
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1270
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1271
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1272
+ "wxTextCtrl 4")
1273
+
1274
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1275
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1276
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1277
+ "wxTextCtrl 5")
1278
+
1279
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1280
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1281
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1282
+ "wxTextCtrl 6")
1283
+
1284
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1285
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1286
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1287
+ "wxTextCtrl 7 (longer title)")
1288
+
1289
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1290
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1291
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1292
+ "wxTextCtrl 8")
1293
+ return ctrl
1294
+ end
1295
+ end
1296
+
1297
+ module AUISample
1298
+
1299
+ include WxRuby::Sample if defined? WxRuby::Sample
1300
+
1301
+ def self.describe
1302
+ { file: __FILE__,
1303
+ summary: 'wxRuby AUI example.',
1304
+ description: 'wxRuby example demonstrating the AUI framework.' }
1305
+ end
1306
+
1307
+ def self.activate
1308
+ frame = AuiFrame.new(nil, Wx::ID_ANY, "Wx::AUI Sample Application",
1309
+ Wx::DEFAULT_POSITION,
1310
+ Wx::Size.new(800, 600))
1311
+ frame.show
1312
+ frame
1313
+ end
1314
+
1315
+ if $0 == __FILE__
1316
+ Wx::App.run do
1317
+ AUISample.activate
1318
+ end
1319
+ end
1320
+
1321
+ end