wxruby3 0.9.1 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (472) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -0
  3. data/INSTALL.md +35 -29
  4. data/README.md +24 -15
  5. data/ext/wxruby3/include/wxRubyApp.h +338 -0
  6. data/ext/wxruby3/include/wxruby-ClientData.h +48 -0
  7. data/ext/wxruby3/include/wxruby-Config.h +6 -6
  8. data/ext/wxruby3/include/wxruby-Validator.h +39 -0
  9. data/ext/wxruby3/include/wxruby-ValidatorBinding.h +64 -0
  10. data/ext/wxruby3/swig/common.i +1 -1
  11. data/ext/wxruby3/swig/custom/director.swg +8 -0
  12. data/ext/wxruby3/swig/mark_free_impl.i +0 -33
  13. data/lib/wx/aui/aui_tab_ctrl.rb +18 -0
  14. data/lib/wx/aui/auinotebook.rb +6 -2
  15. data/lib/wx/aui/require.rb +1 -0
  16. data/lib/wx/core/app.rb +2 -2
  17. data/lib/wx/core/bitmap_combobox.rb +17 -21
  18. data/lib/wx/core/collapsible_pane.rb +1 -1
  19. data/lib/wx/core/combobox.rb +13 -3
  20. data/lib/wx/core/controlwithitems.rb +40 -128
  21. data/lib/wx/core/enum.rb +17 -1
  22. data/lib/wx/core/event.rb +6 -1
  23. data/lib/wx/core/evthandler.rb +8 -2
  24. data/lib/wx/core/generic_validator.rb +312 -0
  25. data/lib/wx/core/listbox.rb +2 -2
  26. data/lib/wx/core/log.rb +1 -1
  27. data/lib/wx/core/menu.rb +10 -0
  28. data/lib/wx/core/notebook.rb +6 -2
  29. data/lib/wx/core/owner_drawn_combobox.rb +45 -0
  30. data/lib/wx/core/size.rb +4 -0
  31. data/lib/wx/core/sizer.rb +12 -2
  32. data/lib/wx/core/standard_paths.rb +22 -0
  33. data/lib/wx/core/task_bar_button.rb +19 -0
  34. data/lib/wx/core/text_entry.rb +4 -1
  35. data/lib/wx/core/textctrl.rb +11 -1
  36. data/lib/wx/core/{treectrl.rb → tree_ctrl.rb} +31 -12
  37. data/lib/wx/core/validator.rb +70 -5
  38. data/lib/wx/core/window.rb +13 -7
  39. data/lib/wx/doc/app.rb +48 -38
  40. data/lib/wx/doc/art_locator.rb +48 -43
  41. data/lib/wx/doc/aui/auimanager.rb +16 -8
  42. data/lib/wx/doc/aui/auinotebook.rb +20 -5
  43. data/lib/wx/doc/clipboard.rb +11 -7
  44. data/lib/wx/doc/colour_dialog.rb +14 -10
  45. data/lib/wx/doc/comboctrl.rb +18 -0
  46. data/lib/wx/doc/controlwithitems.rb +34 -8
  47. data/lib/wx/doc/data_object.rb +2 -2
  48. data/lib/wx/doc/date_picker_ctrl.rb +23 -0
  49. data/lib/wx/doc/editable_listbox.rb +44 -0
  50. data/lib/wx/doc/enum.rb +15 -0
  51. data/lib/wx/doc/event.rb +12 -0
  52. data/lib/wx/doc/evthandler.rb +113 -108
  53. data/lib/wx/doc/extra/12_client_data.md +89 -0
  54. data/lib/wx/doc/extra/13_validators.md +139 -0
  55. data/lib/wx/doc/font.rb +1 -0
  56. data/lib/wx/doc/gc_dc.rb +6 -1
  57. data/lib/wx/doc/gdi_common.rb +4 -0
  58. data/lib/wx/doc/generic_validator.rb +95 -0
  59. data/lib/wx/doc/graphics_context.rb +1 -0
  60. data/lib/wx/doc/grid/grid.rb +22 -1
  61. data/lib/wx/doc/help_controller.rb +11 -7
  62. data/lib/wx/doc/html/html_help_controller.rb +12 -4
  63. data/lib/wx/doc/html/simple_html_listbox.rb +22 -0
  64. data/lib/wx/doc/list_ctrl.rb +33 -29
  65. data/lib/wx/doc/menu.rb +20 -0
  66. data/lib/wx/doc/notebook.rb +21 -0
  67. data/lib/wx/doc/num_validator.rb +387 -0
  68. data/lib/wx/doc/owner_drawn_combobox.rb +96 -0
  69. data/lib/wx/doc/pg/events.rb +13 -9
  70. data/lib/wx/doc/pg/numeric_property_validator.rb +33 -0
  71. data/lib/wx/doc/pg/pg_property.rb +18 -0
  72. data/lib/wx/doc/progress_dialog.rb +36 -32
  73. data/lib/wx/doc/prt/page_setup_dialog.rb +20 -12
  74. data/lib/wx/doc/prt/print_data.rb +13 -5
  75. data/lib/wx/doc/prt/print_dialog.rb +31 -23
  76. data/lib/wx/doc/prt/printer.rb +20 -12
  77. data/lib/wx/doc/radio_box.rb +19 -15
  78. data/lib/wx/doc/rbn/ribbon_bar.rb +13 -5
  79. data/lib/wx/doc/rbn/ribbon_button_bar.rb +13 -5
  80. data/lib/wx/doc/rbn/ribbon_gallery.rb +13 -5
  81. data/lib/wx/doc/rbn/ribbon_tool_bar.rb +13 -5
  82. data/lib/wx/doc/region_iterator.rb +32 -28
  83. data/lib/wx/doc/rtc/rich_text_composite_object.rb +24 -0
  84. data/lib/wx/doc/rtc/rich_text_ctrl.rb +24 -0
  85. data/lib/wx/doc/rtc/rich_text_paragraph.rb +24 -0
  86. data/lib/wx/doc/rtc/richtext_buffer.rb +27 -19
  87. data/lib/wx/doc/rtc/richtext_printing.rb +17 -9
  88. data/lib/wx/doc/rtc/richtext_style_sheet.rb +17 -9
  89. data/lib/wx/doc/sizer.rb +20 -0
  90. data/lib/wx/doc/static_bitmap.rb +25 -0
  91. data/lib/wx/doc/stc/styled_text_ctrl.rb +24 -0
  92. data/lib/wx/doc/stream.rb +39 -35
  93. data/lib/wx/doc/system_settings.rb +30 -26
  94. data/lib/wx/doc/text_validator.rb +23 -9
  95. data/lib/wx/doc/textctrl.rb +16 -0
  96. data/lib/wx/doc/tree_ctrl.rb +95 -0
  97. data/lib/wx/doc/treebook.rb +9 -5
  98. data/lib/wx/doc/v_list_box.rb +9 -5
  99. data/lib/wx/doc/validator.rb +113 -0
  100. data/lib/wx/doc/variant.rb +164 -160
  101. data/lib/wx/doc/window.rb +87 -47
  102. data/lib/wx/doc/window_disabler.rb +10 -6
  103. data/lib/wx/grid/grid.rb +27 -4
  104. data/lib/wx/html/simple_html_listbox.rb +24 -91
  105. data/lib/wx/keyword_defs.rb +34 -2
  106. data/lib/wx/pg/pg_property.rb +22 -0
  107. data/lib/wx/rbn/ribbon_gallery.rb +0 -21
  108. data/lib/wx/rtc/require.rb +3 -0
  109. data/lib/wx/rtc/rich_text_composite_object.rb +25 -0
  110. data/lib/wx/rtc/rich_text_ctrl.rb +25 -0
  111. data/lib/wx/rtc/rich_text_paragraph.rb +25 -0
  112. data/lib/wx/stc/require.rb +1 -0
  113. data/lib/wx/stc/styled_text_ctrl.rb +25 -0
  114. data/lib/wx/version.rb +1 -1
  115. data/rakelib/lib/config/linux.rb +0 -3
  116. data/rakelib/lib/config/macosx.rb +2 -2
  117. data/rakelib/lib/config/mingw.rb +13 -1
  118. data/rakelib/lib/config/unixish.rb +1 -1
  119. data/rakelib/lib/config.rb +14 -4
  120. data/rakelib/lib/core/include/client_data.inc +65 -0
  121. data/rakelib/lib/core/include/funcall.inc +1 -1
  122. data/rakelib/lib/core/package.rb +31 -9
  123. data/rakelib/lib/core/parameter.rb +1 -1
  124. data/rakelib/lib/core/spec.rb +6 -1
  125. data/rakelib/lib/core/spec_helper.rb +7 -1
  126. data/rakelib/lib/director/accelerator.rb +2 -3
  127. data/rakelib/lib/director/accessible.rb +47 -0
  128. data/rakelib/lib/director/app.rb +30 -319
  129. data/rakelib/lib/director/app_traits.rb +13 -13
  130. data/rakelib/lib/director/bitmap_combobox.rb +2 -2
  131. data/rakelib/lib/director/combobox.rb +22 -0
  132. data/rakelib/lib/director/comboctrl.rb +1 -55
  133. data/rakelib/lib/director/ctrl_with_items.rb +105 -26
  134. data/rakelib/lib/director/data_format.rb +1 -1
  135. data/rakelib/lib/director/date_picker_ctrl.rb +8 -6
  136. data/rakelib/lib/director/derived_dc.rb +1 -1
  137. data/rakelib/lib/director/dialog.rb +1 -0
  138. data/rakelib/lib/director/drag_image.rb +2 -3
  139. data/rakelib/lib/director/editable_listbox.rb +30 -0
  140. data/rakelib/lib/director/event.rb +104 -14
  141. data/rakelib/lib/director/event_handler.rb +3 -2
  142. data/rakelib/lib/director/frame.rb +1 -3
  143. data/rakelib/lib/director/functions.rb +4 -2
  144. data/rakelib/lib/director/gdicommon.rb +8 -10
  145. data/rakelib/lib/director/generic_dirctrl.rb +17 -0
  146. data/rakelib/lib/director/graphics_context.rb +2 -4
  147. data/rakelib/lib/director/grid_cell_attr.rb +0 -2
  148. data/rakelib/lib/director/grid_cell_editor.rb +0 -2
  149. data/rakelib/lib/director/grid_cell_renderer.rb +0 -2
  150. data/rakelib/lib/director/grid_ctrl.rb +34 -3
  151. data/rakelib/lib/director/header_ctrl.rb +6 -1
  152. data/rakelib/lib/director/html_listbox.rb +96 -22
  153. data/rakelib/lib/director/icon.rb +5 -2
  154. data/rakelib/lib/director/list_ctrl.rb +5 -6
  155. data/rakelib/lib/director/locale.rb +1 -3
  156. data/rakelib/lib/director/log.rb +1 -4
  157. data/rakelib/lib/director/media_ctrl.rb +54 -0
  158. data/rakelib/lib/director/menu.rb +16 -1
  159. data/rakelib/lib/director/menu_item.rb +2 -2
  160. data/rakelib/lib/director/num_validator.rb +495 -0
  161. data/rakelib/lib/director/numeric_property_validator.rb +131 -6
  162. data/rakelib/lib/director/owner_drawn_combobox.rb +192 -0
  163. data/rakelib/lib/director/pgproperties.rb +1 -1
  164. data/rakelib/lib/director/pgproperty.rb +27 -30
  165. data/rakelib/lib/director/property_grid_interface.rb +5 -10
  166. data/rakelib/lib/director/ribbon_button_bar.rb +3 -3
  167. data/rakelib/lib/director/ribbon_gallery.rb +3 -5
  168. data/rakelib/lib/director/richtext_composite_object.rb +25 -0
  169. data/rakelib/lib/director/richtext_ctrl.rb +14 -4
  170. data/rakelib/lib/director/richtext_formatting_dialog.rb +7 -5
  171. data/rakelib/lib/director/richtext_paragraph_layout_box.rb +9 -7
  172. data/rakelib/lib/director/sizer.rb +30 -4
  173. data/rakelib/lib/director/sizer_item.rb +13 -0
  174. data/rakelib/lib/director/static_bitmap.rb +28 -0
  175. data/rakelib/lib/director/static_box.rb +4 -5
  176. data/rakelib/lib/director/styled_text_ctrl.rb +12 -0
  177. data/rakelib/lib/director/task_bar_button.rb +30 -0
  178. data/rakelib/lib/director/task_bar_icon.rb +5 -13
  179. data/rakelib/lib/director/text_entry.rb +4 -0
  180. data/rakelib/lib/director/text_validator.rb +124 -13
  181. data/rakelib/lib/director/textctrl.rb +12 -1
  182. data/rakelib/lib/director/toggle_button.rb +1 -0
  183. data/rakelib/lib/director/tool_tip.rb +1 -1
  184. data/rakelib/lib/director/top_level_window.rb +4 -7
  185. data/rakelib/lib/director/tree_ctrl.rb +40 -6
  186. data/rakelib/lib/director/utils.rb +16 -2
  187. data/rakelib/lib/director/validator.rb +196 -21
  188. data/rakelib/lib/director/variant.rb +1 -1
  189. data/rakelib/lib/director/window.rb +40 -7
  190. data/rakelib/lib/director.rb +4 -4
  191. data/rakelib/lib/extractor/function.rb +8 -7
  192. data/rakelib/lib/extractor.rb +34 -5
  193. data/rakelib/lib/generate/analyzer.rb +9 -4
  194. data/rakelib/lib/generate/doc/busy_info.yaml +0 -2
  195. data/rakelib/lib/generate/doc/clipboard.yaml +0 -2
  196. data/rakelib/lib/generate/doc/cursor.yaml +0 -2
  197. data/rakelib/lib/generate/doc/panel.yaml +7 -0
  198. data/rakelib/lib/generate/doc.rb +85 -17
  199. data/rakelib/lib/specs/interfaces.rb +163 -160
  200. data/rakelib/lib/swig_runner.rb +55 -9
  201. data/rakelib/lib/typemap/client_data.rb +67 -0
  202. data/rakelib/lib/typemap/common.rb +33 -4
  203. data/rakelib/lib/typemap/datetime.rb +1 -1
  204. data/rakelib/lib/typemap/tree_itemid.rb +2 -2
  205. data/rakelib/yard/templates/default/fulldoc/html/css/wxruby3.css +74 -2
  206. data/rakelib/yard/templates/default/fulldoc/html/full_list.erb +38 -0
  207. data/rakelib/yard/templates/default/fulldoc/html/setup.rb +39 -0
  208. data/rakelib/yard/templates/default/tags/html/wxrb_require.erb +10 -0
  209. data/rakelib/yard/templates/default/tags/setup.rb +16 -0
  210. data/rakelib/yard/yard-custom-templates.rb +3 -0
  211. data/samples/aui/aui.rb +1237 -1233
  212. data/samples/calendar/calendar.rb +293 -289
  213. data/samples/controls/get_item_sample.rb +83 -79
  214. data/samples/controls/htlbox.rb +331 -327
  215. data/samples/dialogs/dialogs.rb +682 -694
  216. data/samples/dialogs/wizard.rb +52 -55
  217. data/samples/dragdrop/dragdrop.rb +146 -142
  218. data/samples/drawing/bitmap.rb +29 -26
  219. data/samples/drawing/bitmap_image.rb +84 -80
  220. data/samples/drawing/graphics_drawing.rb +209 -205
  221. data/samples/drawing/image_prt.rb +344 -340
  222. data/samples/drawing/maths_images.rb +18 -1
  223. data/samples/drawing/rmagic_bitmap_image.rb +88 -84
  224. data/samples/etc/caret.rb +306 -0
  225. data/samples/etc/miniframe.rb +65 -60
  226. data/samples/etc/sash.rb +109 -105
  227. data/samples/etc/scrollwin.rb +86 -80
  228. data/samples/etc/system_settings.rb +216 -209
  229. data/samples/event/activation.rb +72 -67
  230. data/samples/event/event.rb +160 -153
  231. data/samples/event/threaded.rb +8 -1
  232. data/samples/event/update_ui_event.rb +67 -60
  233. data/samples/grid/grid.rb +188 -181
  234. data/samples/grid/gridtablebase.rb +136 -129
  235. data/samples/html/html.rb +208 -204
  236. data/samples/mdi/mdi.rb +59 -54
  237. data/samples/minimal/minimal.rb +54 -51
  238. data/samples/minimal/nothing.rb +1 -0
  239. data/samples/printing/printing.rb +367 -377
  240. data/samples/printing/printing2.rb +203 -198
  241. data/samples/propgrid/propgrid.rb +2312 -2308
  242. data/samples/propgrid/propgrid_minimal.rb +57 -50
  243. data/samples/ribbon/ribbon.rb +780 -774
  244. data/samples/sampler/ext.rb +0 -33
  245. data/samples/sampler/sample.rb +4 -9
  246. data/samples/sampler.rb +1 -1
  247. data/samples/splash/splash.rb +118 -116
  248. data/samples/text/rich_textctrl.rb +207 -201
  249. data/samples/text/richtext.rb +1409 -1405
  250. data/samples/text/scintilla.rb +137 -128
  251. data/samples/text/textctrl.rb +89 -83
  252. data/samples/text/unicode.rb +175 -168
  253. data/samples/treectrl/treectrl.rb +1430 -1426
  254. data/samples/widgets/activityindicator.rb +95 -0
  255. data/samples/widgets/art/widgets/activityindicator.xpm +278 -0
  256. data/samples/widgets/art/widgets/bmpbtn.xpm +37 -0
  257. data/samples/widgets/art/widgets/bmpcombobox.xpm +54 -0
  258. data/samples/widgets/art/widgets/button.xpm +54 -0
  259. data/samples/widgets/art/widgets/checkbox.xpm +54 -0
  260. data/samples/{bigdemo/icons → widgets/art/widgets}/choice.xpm +1 -1
  261. data/samples/widgets/art/widgets/choicebk.xpm +54 -0
  262. data/samples/widgets/art/widgets/clrpicker.xpm +193 -0
  263. data/samples/widgets/art/widgets/combobox.xpm +54 -0
  264. data/samples/widgets/art/widgets/datepick.xpm +200 -0
  265. data/samples/widgets/art/widgets/dirctrl.xpm +54 -0
  266. data/samples/widgets/art/widgets/dirpicker.xpm +213 -0
  267. data/samples/widgets/art/widgets/filepicker.xpm +214 -0
  268. data/samples/widgets/art/widgets/fontpicker.xpm +185 -0
  269. data/samples/widgets/art/widgets/gauge.xpm +54 -0
  270. data/samples/widgets/art/widgets/header.xpm +54 -0
  271. data/samples/widgets/art/widgets/hyperlnk.xpm +54 -0
  272. data/samples/widgets/art/widgets/listbook.xpm +54 -0
  273. data/samples/widgets/art/widgets/listbox.xpm +54 -0
  274. data/samples/widgets/art/widgets/native.xpm +81 -0
  275. data/samples/widgets/art/widgets/notebook.xpm +54 -0
  276. data/samples/widgets/art/widgets/odcombobox.xpm +54 -0
  277. data/samples/widgets/art/widgets/radiobox.xpm +54 -0
  278. data/samples/widgets/art/widgets/scrolbar.xpm +54 -0
  279. data/samples/widgets/art/widgets/slider.xpm +54 -0
  280. data/samples/widgets/art/widgets/spinbtn.xpm +40 -0
  281. data/samples/widgets/art/widgets/statbmp.xpm +40 -0
  282. data/samples/widgets/art/widgets/statbox.xpm +54 -0
  283. data/samples/widgets/art/widgets/stattext.xpm +54 -0
  284. data/samples/widgets/art/widgets/text.xpm +54 -0
  285. data/samples/widgets/art/widgets/timepick.xpm +207 -0
  286. data/samples/widgets/art/widgets/toggle.xpm +54 -0
  287. data/samples/widgets/art/widgets/toucan.png +0 -0
  288. data/samples/widgets/bmpcombobox.rb +651 -0
  289. data/samples/widgets/button.rb +462 -0
  290. data/samples/widgets/checkbox.rb +211 -0
  291. data/samples/widgets/choice.rb +287 -0
  292. data/samples/widgets/clrpicker.rb +156 -0
  293. data/samples/widgets/combobox.rb +516 -0
  294. data/samples/widgets/datepick.rb +215 -0
  295. data/samples/widgets/dirctrl.rb +265 -0
  296. data/samples/widgets/dirpicker.rb +158 -0
  297. data/samples/widgets/editlbox.rb +122 -0
  298. data/samples/widgets/filectrl.rb +216 -0
  299. data/samples/widgets/filepicker.rb +214 -0
  300. data/samples/widgets/fontpicker.rb +135 -0
  301. data/samples/widgets/gauge.rb +311 -0
  302. data/samples/widgets/headerctrl.rb +236 -0
  303. data/samples/widgets/hyperlink.rb +203 -0
  304. data/samples/widgets/itemcontainer.rb +185 -0
  305. data/samples/widgets/listbox.rb +473 -0
  306. data/samples/widgets/notebook.rb +488 -0
  307. data/samples/widgets/odcombobox.rb +608 -0
  308. data/samples/widgets/radiobox.rb +328 -0
  309. data/samples/widgets/searchctrl.rb +159 -0
  310. data/samples/widgets/slider.rb +594 -0
  311. data/samples/widgets/spinbtn.rb +443 -0
  312. data/samples/widgets/statbmp.rb +130 -0
  313. data/samples/widgets/static.rb +436 -0
  314. data/samples/widgets/textctrl.rb +700 -0
  315. data/samples/widgets/timepick.rb +148 -0
  316. data/samples/widgets/tn_widgets.png +0 -0
  317. data/samples/widgets/toggle.rb +385 -0
  318. data/samples/widgets/widgets.rb +1233 -0
  319. data/samples/xrc/custom_xrc_sample.rb +47 -41
  320. data/samples/xrc/xrc_sample.rb +53 -47
  321. data/tests/media/beep_lo.wav +0 -0
  322. data/tests/test_event_handling.rb +52 -34
  323. data/tests/test_events.rb +7 -0
  324. data/tests/test_item_data.rb +24 -0
  325. data/tests/test_list_ctrl.rb +1 -1
  326. data/tests/test_media_ctrl.rb +38 -0
  327. data/tests/test_menu.rb +69 -0
  328. data/tests/test_pg.rb +27 -0
  329. data/tests/test_richtext.rb +45 -0
  330. data/tests/test_sizer.rb +59 -0
  331. data/tests/test_std_controls.rb +42 -1
  332. data/tests/test_styled_text_ctrl.rb +46 -0
  333. data/tests/test_tree_ctrl.rb +138 -0
  334. data/tests/test_validators.rb +805 -0
  335. data/tests/test_window.rb +12 -0
  336. data/tests/testapp_noframe.rb +1 -1
  337. metadata +121 -139
  338. data/lib/wx/core/choice.rb +0 -14
  339. data/lib/wx/core/combo_ctrl.rb +0 -110
  340. data/rakelib/lib/typemap/grid_client_data.rb +0 -58
  341. data/samples/bigdemo/About.rbw +0 -39
  342. data/samples/bigdemo/ColorPanel.rbw +0 -23
  343. data/samples/bigdemo/GridSimple.rbw +0 -78
  344. data/samples/bigdemo/MDIDemo.rbw +0 -57
  345. data/samples/bigdemo/PopupMenu.rbw +0 -146
  346. data/samples/bigdemo/ShapedWindow.rbw +0 -128
  347. data/samples/bigdemo/Sizers.rbw +0 -541
  348. data/samples/bigdemo/bigdemo.rb +0 -817
  349. data/samples/bigdemo/demoTemplate.rbw +0 -33
  350. data/samples/bigdemo/helpfile.htb +0 -0
  351. data/samples/bigdemo/icons/Test 015.jpg +0 -0
  352. data/samples/bigdemo/icons/Test 015.png +0 -0
  353. data/samples/bigdemo/icons/choice.bmp +0 -0
  354. data/samples/bigdemo/icons/combo.bmp +0 -0
  355. data/samples/bigdemo/icons/combo.xpm +0 -27
  356. data/samples/bigdemo/icons/copy.xpm +0 -25
  357. data/samples/bigdemo/icons/cut.xpm +0 -24
  358. data/samples/bigdemo/icons/gauge.bmp +0 -0
  359. data/samples/bigdemo/icons/gauge.xpm +0 -27
  360. data/samples/bigdemo/icons/help.xpm +0 -25
  361. data/samples/bigdemo/icons/list.bmp +0 -0
  362. data/samples/bigdemo/icons/list.xpm +0 -27
  363. data/samples/bigdemo/icons/mondrian.ico +0 -0
  364. data/samples/bigdemo/icons/mondrian.xpm +0 -44
  365. data/samples/bigdemo/icons/new.xpm +0 -24
  366. data/samples/bigdemo/icons/ogl.ico +0 -0
  367. data/samples/bigdemo/icons/ogl.xpm +0 -45
  368. data/samples/bigdemo/icons/open.xpm +0 -26
  369. data/samples/bigdemo/icons/paste.bmp +0 -0
  370. data/samples/bigdemo/icons/paste.xpm +0 -38
  371. data/samples/bigdemo/icons/pointy.png +0 -0
  372. data/samples/bigdemo/icons/preview.xpm +0 -26
  373. data/samples/bigdemo/icons/print.xpm +0 -26
  374. data/samples/bigdemo/icons/radio.bmp +0 -0
  375. data/samples/bigdemo/icons/radio.xpm +0 -27
  376. data/samples/bigdemo/icons/robert.xpm +0 -415
  377. data/samples/bigdemo/icons/sashtest.ico +0 -0
  378. data/samples/bigdemo/icons/save.xpm +0 -25
  379. data/samples/bigdemo/icons/smiles.bmp +0 -0
  380. data/samples/bigdemo/icons/smiles.xpm +0 -39
  381. data/samples/bigdemo/icons/smiley.ico +0 -0
  382. data/samples/bigdemo/icons/smiley.xpm +0 -42
  383. data/samples/bigdemo/icons/stattext.xpm +0 -24
  384. data/samples/bigdemo/icons/test2.bmp +0 -0
  385. data/samples/bigdemo/icons/test2.png +0 -0
  386. data/samples/bigdemo/icons/test2.xpm +0 -79
  387. data/samples/bigdemo/icons/text.bmp +0 -0
  388. data/samples/bigdemo/icons/text.xpm +0 -27
  389. data/samples/bigdemo/icons/tog1.bmp +0 -0
  390. data/samples/bigdemo/icons/tog1.xpm +0 -38
  391. data/samples/bigdemo/icons/tog2.bmp +0 -0
  392. data/samples/bigdemo/icons/tog2.xpm +0 -38
  393. data/samples/bigdemo/icons/wxruby-128x128.png +0 -0
  394. data/samples/bigdemo/icons/wxwin.ico +0 -0
  395. data/samples/bigdemo/icons/wxwin16x16.png +0 -0
  396. data/samples/bigdemo/icons/wxwin16x16.xpm +0 -25
  397. data/samples/bigdemo/icons/wxwin32x32.png +0 -0
  398. data/samples/bigdemo/icons/wxwin48x48.png +0 -0
  399. data/samples/bigdemo/run.rb +0 -98
  400. data/samples/bigdemo/tips.txt +0 -7
  401. data/samples/bigdemo/utils.rb +0 -20
  402. data/samples/bigdemo/wxArtProvider.rbw +0 -282
  403. data/samples/bigdemo/wxBitmapButton.rbw +0 -65
  404. data/samples/bigdemo/wxButton.rbw +0 -64
  405. data/samples/bigdemo/wxCalendarCtrl.rbw +0 -59
  406. data/samples/bigdemo/wxCheckBox.rbw +0 -50
  407. data/samples/bigdemo/wxCheckListBox.rbw +0 -65
  408. data/samples/bigdemo/wxChoice.rbw +0 -47
  409. data/samples/bigdemo/wxChoicebook.rbw +0 -78
  410. data/samples/bigdemo/wxColourDialog.rbw +0 -33
  411. data/samples/bigdemo/wxComboBox.rbw +0 -77
  412. data/samples/bigdemo/wxCursor.rbw +0 -136
  413. data/samples/bigdemo/wxDialog.rbw +0 -74
  414. data/samples/bigdemo/wxDirDialog.rbw +0 -29
  415. data/samples/bigdemo/wxDragImage.rbw +0 -70
  416. data/samples/bigdemo/wxFileDialog.rbw +0 -37
  417. data/samples/bigdemo/wxFileDialog_Save.rbw +0 -35
  418. data/samples/bigdemo/wxFindReplaceDialog.rbw +0 -82
  419. data/samples/bigdemo/wxFontDialog.rbw +0 -200
  420. data/samples/bigdemo/wxFrame.rbw +0 -53
  421. data/samples/bigdemo/wxGauge.rbw +0 -65
  422. data/samples/bigdemo/wxGenericDirCtrl.rbw +0 -74
  423. data/samples/bigdemo/wxGrid.rbw +0 -66
  424. data/samples/bigdemo/wxHtmlHelpController.rbw +0 -52
  425. data/samples/bigdemo/wxListBox.rbw +0 -140
  426. data/samples/bigdemo/wxListCtrl_virtual.rbw +0 -112
  427. data/samples/bigdemo/wxMDIWindows.rbw +0 -50
  428. data/samples/bigdemo/wxMenu.rbw +0 -247
  429. data/samples/bigdemo/wxMessageDialog.rbw +0 -27
  430. data/samples/bigdemo/wxMiniFrame.rbw +0 -70
  431. data/samples/bigdemo/wxMultipleChoiceDialog.rbw +0 -29
  432. data/samples/bigdemo/wxNotebook.rbw +0 -136
  433. data/samples/bigdemo/wxProgressDialog.rbw +0 -43
  434. data/samples/bigdemo/wxRadioBox.rbw +0 -72
  435. data/samples/bigdemo/wxRadioButton.rbw +0 -125
  436. data/samples/bigdemo/wxSashWindow.rbw +0 -141
  437. data/samples/bigdemo/wxScrolledMessageDialog.rbw +0 -57
  438. data/samples/bigdemo/wxScrolledWindow.rbw +0 -199
  439. data/samples/bigdemo/wxSingleChoiceDialog.rbw +0 -33
  440. data/samples/bigdemo/wxSlider.rbw +0 -42
  441. data/samples/bigdemo/wxSpinButton.rbw +0 -50
  442. data/samples/bigdemo/wxSpinCtrl.rbw +0 -51
  443. data/samples/bigdemo/wxSplitterWindow.rbw +0 -63
  444. data/samples/bigdemo/wxStaticBitmap.rbw +0 -47
  445. data/samples/bigdemo/wxStaticText.rbw +0 -55
  446. data/samples/bigdemo/wxStatusBar.rbw +0 -126
  447. data/samples/bigdemo/wxTextCtrl.rbw +0 -149
  448. data/samples/bigdemo/wxTextEntryDialog.rbw +0 -31
  449. data/samples/bigdemo/wxToggleButton.rbw +0 -49
  450. data/samples/bigdemo/wxToolBar.rbw +0 -131
  451. data/samples/bigdemo/wxTreeCtrl.rbw +0 -191
  452. data/samples/caret/caret.rb +0 -298
  453. data/samples/caret/mondrian.xpm +0 -44
  454. data/samples/controls/books.rb +0 -189
  455. data/samples/controls/choice.xpm +0 -27
  456. data/samples/controls/combo.xpm +0 -27
  457. data/samples/controls/controls.rb +0 -1099
  458. data/samples/controls/gauge.xpm +0 -27
  459. data/samples/controls/list.xpm +0 -27
  460. data/samples/controls/mondrian.ico +0 -0
  461. data/samples/controls/mondrian.xpm +0 -44
  462. data/samples/controls/radio.xpm +0 -27
  463. data/samples/controls/stattext.xpm +0 -24
  464. data/samples/controls/test2.bmp +0 -0
  465. data/samples/controls/text.xpm +0 -27
  466. data/samples/controls/tn_books.png +0 -0
  467. data/samples/controls/tn_controls.png +0 -0
  468. data/samples/etc/choice.rb +0 -87
  469. data/samples/etc/tn_choice.png +0 -0
  470. data/samples/text/mondrian.ico +0 -0
  471. data/samples/text/mondrian.xpm +0 -44
  472. /data/samples/{caret → etc}/tn_caret.png +0 -0
data/samples/aui/aui.rb CHANGED
@@ -11,1361 +11,1365 @@
11
11
 
12
12
  require 'wx'
13
13
 
14
- # A resizable control that displays its current size, and, if an AUI
15
- # arrangement, its position and layer
16
- class SizeReportCtrl < Wx::Control
17
- def initialize(parent, id, pos, size, mgr = nil)
18
- super(parent, id, pos, size)
19
- @mgr = mgr
20
- evt_paint { on_paint }
21
- evt_size { on_size }
22
- end
23
-
24
- def on_paint
25
- paint do |dc|
26
- size = get_client_size
27
-
28
- dc.set_font Wx::NORMAL_FONT
29
- dc.set_brush Wx::WHITE_BRUSH
30
- dc.set_pen Wx::WHITE_PEN
31
- dc.draw_rectangle(0, 0, size.width, size.height)
32
- dc.set_pen Wx::LIGHT_GREY_PEN
33
- dc.set_pen Wx::LIGHT_GREY_PEN
34
- dc.draw_line(0, 0, size.width, size.height)
35
- dc.draw_line(0, size.height, size.width, 0)
36
-
37
- msg = "Size: %d x %d" % [size.width, size.height]
38
- width, height = dc.get_text_extent(msg)
39
- height += 3
40
- dc.draw_text(msg,
41
- (size.width - width) / 2,
42
- (size.height - (height * 5)) / 2)
43
-
44
- if @mgr
45
- pi = @mgr.get_pane(self)
46
- msg = "Layer: %d" % pi.layer
47
- width, height = dc.get_text_extent(msg)
48
- dc.draw_text(msg,
49
- (size.width - width) / 2,
50
- ((size.height - (height * 5)) / 2) + height)
14
+ module AuiTest
15
+
16
+ # A resizable control that displays its current size, and, if an AUI
17
+ # arrangement, its position and layer
18
+ class SizeReportCtrl < Wx::Control
19
+ def initialize(parent, id, pos, size, mgr = nil)
20
+ super(parent, id, pos, size)
21
+ @mgr = mgr
22
+ evt_paint { on_paint }
23
+ evt_size { on_size }
24
+ end
51
25
 
52
- msg = "Dock: %d Row: %d" % [pi.direction, pi.row]
53
- width, height = dc.get_text_extent(msg)
54
- dc.draw_text(msg,
55
- (size.width - width) / 2,
56
- ((size.height - (height * 5)) / 2) + (height * 2))
26
+ def on_paint
27
+ paint do |dc|
28
+ size = get_client_size
57
29
 
58
- msg = "Position: %d" % pi.position
59
- width, height = dc.get_text_extent(msg)
60
- dc.draw_text(msg,
61
- (size.width - width) / 2,
62
- ((size.height - (height * 5)) / 2) + (height * 3))
30
+ dc.set_font Wx::NORMAL_FONT
31
+ dc.set_brush Wx::WHITE_BRUSH
32
+ dc.set_pen Wx::WHITE_PEN
33
+ dc.draw_rectangle(0, 0, size.width, size.height)
34
+ dc.set_pen Wx::LIGHT_GREY_PEN
35
+ dc.set_pen Wx::LIGHT_GREY_PEN
36
+ dc.draw_line(0, 0, size.width, size.height)
37
+ dc.draw_line(0, size.height, size.width, 0)
63
38
 
64
- msg = "Proportion: %d" % pi.proportion
39
+ msg = "Size: %d x %d" % [size.width, size.height]
65
40
  width, height = dc.get_text_extent(msg)
41
+ height += 3
66
42
  dc.draw_text(msg,
67
43
  (size.width - width) / 2,
68
- ((size.height - (height * 5)) / 2) + (height * 4))
44
+ (size.height - (height * 5)) / 2)
45
+
46
+ if @mgr
47
+ pi = @mgr.get_pane(self)
48
+ msg = "Layer: %d" % pi.layer
49
+ width, height = dc.get_text_extent(msg)
50
+ dc.draw_text(msg,
51
+ (size.width - width) / 2,
52
+ ((size.height - (height * 5)) / 2) + height)
53
+
54
+ msg = "Dock: %d Row: %d" % [pi.direction, pi.row]
55
+ width, height = dc.get_text_extent(msg)
56
+ dc.draw_text(msg,
57
+ (size.width - width) / 2,
58
+ ((size.height - (height * 5)) / 2) + (height * 2))
59
+
60
+ msg = "Position: %d" % pi.position
61
+ width, height = dc.get_text_extent(msg)
62
+ dc.draw_text(msg,
63
+ (size.width - width) / 2,
64
+ ((size.height - (height * 5)) / 2) + (height * 3))
65
+
66
+ msg = "Proportion: %d" % pi.proportion
67
+ width, height = dc.get_text_extent(msg)
68
+ dc.draw_text(msg,
69
+ (size.width - width) / 2,
70
+ ((size.height - (height * 5)) / 2) + (height * 4))
69
71
 
72
+ end
70
73
  end
71
74
  end
72
- end
73
-
74
- def on_size
75
- refresh
76
- end
77
- end
78
-
79
- class SettingsPanel < Wx::Panel
80
- module ID
81
- include Wx::IDHelper
82
-
83
- PaneBorderSize = self.next_id
84
- SashSize = self.next_id
85
- CaptionSize = self.next_id
86
- BackgroundColour = self.next_id
87
- SashColour = self.next_id
88
- InactiveCaptionColour = self.next_id
89
- InactiveCaptionGradientColour = self.next_id
90
- InactiveCaptionTextColour = self.next_id
91
- ActiveCaptionColour = self.next_id
92
- ActiveCaptionGradientColour = self.next_id
93
- ActiveCaptionTextColour = self.next_id
94
- BorderColour = self.next_id
95
- GripperColour = self.next_id
96
- end
97
75
 
98
- def initialize(parent, frame)
99
- super(parent, Wx::ID_ANY)
100
- @frame = frame
101
- @base_bmp = create_colour_bitmap(Wx::BLACK)
102
-
103
- # set up some spin ctrls for integer variables
104
- @border_size, s1 = make_metric_spin_ctrl(ID::PaneBorderSize,
105
- "Pane Border Size:",
106
- Wx::AUI_DOCKART_PANE_BORDER_SIZE)
107
-
108
- @sash_size, s2 = make_metric_spin_ctrl(ID::SashSize,
109
- "Sash Size:",
110
- Wx::AUI_DOCKART_SASH_SIZE)
111
-
112
- @cap_size, s3 = make_metric_spin_ctrl(ID::CaptionSize,
113
- "Caption Size:",
114
- Wx::AUI_DOCKART_CAPTION_SIZE)
115
-
116
- # colour controls
117
- @bckg_colour, s4 = make_colour_button(ID::BackgroundColour,
118
- "Background Colour:")
119
- @sash_colour, s5 = make_colour_button(ID::SashColour,
120
- "Sash Colour:")
121
- @capt_colour, s6 = make_colour_button(ID::InactiveCaptionColour,
122
- "Normal Caption:")
123
- @capt_gradnt, s7 = make_colour_button(ID::InactiveCaptionGradientColour,
124
- "Normal Caption Gradient:")
125
- @capt_text, s8 = make_colour_button(ID::InactiveCaptionTextColour,
126
- "Normal Caption Text:")
127
- @acap_colour, s9 = make_colour_button(ID::ActiveCaptionColour,
128
- "Active Caption:")
129
- @acap_gradnt, s10 = make_colour_button(ID::ActiveCaptionGradientColour,
130
- "Active Caption Gradient:")
131
- @acap_text, s11 = make_colour_button(ID::ActiveCaptionTextColour,
132
- "Active Caption Text:")
133
- @brdr_colour, s12 = make_colour_button(ID::BorderColour,
134
- "Border Colour:")
135
- @grip_colour, s13 = make_colour_button(ID::GripperColour,
136
- "Gripper Colour:")
137
-
138
- grid_sizer = Wx::GridSizer.new(2)
139
- grid_sizer.set_h_gap(5)
140
-
141
- grid_sizer.add(s1); grid_sizer.add(s4)
142
- grid_sizer.add(s2); grid_sizer.add(s5)
143
- grid_sizer.add(s3); grid_sizer.add(s13)
144
- grid_sizer.add(1, 1); grid_sizer.add(s12)
145
- grid_sizer.add(s6); grid_sizer.add(s9)
146
- grid_sizer.add(s7); grid_sizer.add(s10)
147
- grid_sizer.add(s8); grid_sizer.add(s11)
148
-
149
- cont_sizer = Wx::BoxSizer.new(Wx::VERTICAL)
150
- cont_sizer.add(grid_sizer, 1, Wx::EXPAND | Wx::ALL, 5)
151
- self.set_sizer(cont_sizer)
152
- get_sizer.set_size_hints(self)
153
- update_colours
154
-
155
- evt_spinctrl(ID::PaneBorderSize) { |e| on_pane_border_size(e) }
156
- evt_spinctrl(ID::SashSize) { |e| on_sash_size(e) }
157
- evt_spinctrl(ID::CaptionSize) { |e| on_caption_size(e) }
158
- evt_button(ID::BackgroundColour) { |e| on_set_colour(e) }
159
- evt_button(ID::SashColour) { |e| on_set_colour(e) }
160
- evt_button(ID::InactiveCaptionColour) { |e| on_set_colour(e) }
161
- evt_button(ID::InactiveCaptionGradientColour) { |e| on_set_colour(e) }
162
- evt_button(ID::InactiveCaptionTextColour) { |e| on_set_colour(e) }
163
- evt_button(ID::ActiveCaptionColour) { |e| on_set_colour(e) }
164
- evt_button(ID::ActiveCaptionGradientColour) { |e| on_set_colour(e) }
165
- evt_button(ID::ActiveCaptionTextColour) { |e| on_set_colour(e) }
166
- evt_button(ID::BorderColour) { |e| on_set_colour(e) }
167
- evt_button(ID::GripperColour) { |e| on_set_colour(e) }
76
+ def on_size
77
+ refresh
78
+ end
168
79
  end
169
80
 
170
- def update_colours()
171
- art = @frame.dock_art
172
-
173
- col = art.get_colour(Wx::AUI_DOCKART_BACKGROUND_COLOUR)
174
- @bckg_colour.bitmap_label = (create_colour_bitmap(col))
81
+ class SettingsPanel < Wx::Panel
82
+ module ID
83
+ include Wx::IDHelper
84
+
85
+ PaneBorderSize = self.next_id
86
+ SashSize = self.next_id
87
+ CaptionSize = self.next_id
88
+ BackgroundColour = self.next_id
89
+ SashColour = self.next_id
90
+ InactiveCaptionColour = self.next_id
91
+ InactiveCaptionGradientColour = self.next_id
92
+ InactiveCaptionTextColour = self.next_id
93
+ ActiveCaptionColour = self.next_id
94
+ ActiveCaptionGradientColour = self.next_id
95
+ ActiveCaptionTextColour = self.next_id
96
+ BorderColour = self.next_id
97
+ GripperColour = self.next_id
98
+ end
175
99
 
176
- col = art.get_colour(Wx::AUI_DOCKART_SASH_COLOUR)
177
- @sash_colour.bitmap_label = (create_colour_bitmap(col))
100
+ def initialize(parent, frame)
101
+ super(parent, Wx::ID_ANY)
102
+ @frame = frame
103
+ @base_bmp = create_colour_bitmap(Wx::BLACK)
104
+
105
+ # set up some spin ctrls for integer variables
106
+ @border_size, s1 = make_metric_spin_ctrl(ID::PaneBorderSize,
107
+ "Pane Border Size:",
108
+ Wx::AUI_DOCKART_PANE_BORDER_SIZE)
109
+
110
+ @sash_size, s2 = make_metric_spin_ctrl(ID::SashSize,
111
+ "Sash Size:",
112
+ Wx::AUI_DOCKART_SASH_SIZE)
113
+
114
+ @cap_size, s3 = make_metric_spin_ctrl(ID::CaptionSize,
115
+ "Caption Size:",
116
+ Wx::AUI_DOCKART_CAPTION_SIZE)
117
+
118
+ # colour controls
119
+ @bckg_colour, s4 = make_colour_button(ID::BackgroundColour,
120
+ "Background Colour:")
121
+ @sash_colour, s5 = make_colour_button(ID::SashColour,
122
+ "Sash Colour:")
123
+ @capt_colour, s6 = make_colour_button(ID::InactiveCaptionColour,
124
+ "Normal Caption:")
125
+ @capt_gradnt, s7 = make_colour_button(ID::InactiveCaptionGradientColour,
126
+ "Normal Caption Gradient:")
127
+ @capt_text, s8 = make_colour_button(ID::InactiveCaptionTextColour,
128
+ "Normal Caption Text:")
129
+ @acap_colour, s9 = make_colour_button(ID::ActiveCaptionColour,
130
+ "Active Caption:")
131
+ @acap_gradnt, s10 = make_colour_button(ID::ActiveCaptionGradientColour,
132
+ "Active Caption Gradient:")
133
+ @acap_text, s11 = make_colour_button(ID::ActiveCaptionTextColour,
134
+ "Active Caption Text:")
135
+ @brdr_colour, s12 = make_colour_button(ID::BorderColour,
136
+ "Border Colour:")
137
+ @grip_colour, s13 = make_colour_button(ID::GripperColour,
138
+ "Gripper Colour:")
139
+
140
+ grid_sizer = Wx::GridSizer.new(2)
141
+ grid_sizer.set_h_gap(5)
142
+
143
+ grid_sizer.add(s1); grid_sizer.add(s4)
144
+ grid_sizer.add(s2); grid_sizer.add(s5)
145
+ grid_sizer.add(s3); grid_sizer.add(s13)
146
+ grid_sizer.add(1, 1); grid_sizer.add(s12)
147
+ grid_sizer.add(s6); grid_sizer.add(s9)
148
+ grid_sizer.add(s7); grid_sizer.add(s10)
149
+ grid_sizer.add(s8); grid_sizer.add(s11)
150
+
151
+ cont_sizer = Wx::BoxSizer.new(Wx::VERTICAL)
152
+ cont_sizer.add(grid_sizer, 1, Wx::EXPAND | Wx::ALL, 5)
153
+ self.set_sizer(cont_sizer)
154
+ get_sizer.set_size_hints(self)
155
+ update_colours
178
156
 
179
- col = art.get_colour(Wx::AUI_DOCKART_INACTIVE_CAPTION_COLOUR)
180
- @capt_colour.bitmap_label = (create_colour_bitmap(col))
157
+ evt_spinctrl(ID::PaneBorderSize) { |e| on_pane_border_size(e) }
158
+ evt_spinctrl(ID::SashSize) { |e| on_sash_size(e) }
159
+ evt_spinctrl(ID::CaptionSize) { |e| on_caption_size(e) }
160
+ evt_button(ID::BackgroundColour) { |e| on_set_colour(e) }
161
+ evt_button(ID::SashColour) { |e| on_set_colour(e) }
162
+ evt_button(ID::InactiveCaptionColour) { |e| on_set_colour(e) }
163
+ evt_button(ID::InactiveCaptionGradientColour) { |e| on_set_colour(e) }
164
+ evt_button(ID::InactiveCaptionTextColour) { |e| on_set_colour(e) }
165
+ evt_button(ID::ActiveCaptionColour) { |e| on_set_colour(e) }
166
+ evt_button(ID::ActiveCaptionGradientColour) { |e| on_set_colour(e) }
167
+ evt_button(ID::ActiveCaptionTextColour) { |e| on_set_colour(e) }
168
+ evt_button(ID::BorderColour) { |e| on_set_colour(e) }
169
+ evt_button(ID::GripperColour) { |e| on_set_colour(e) }
170
+ end
181
171
 
182
- col = art.get_colour(Wx::AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR)
183
- @capt_gradnt.bitmap_label = (create_colour_bitmap(col))
172
+ def update_colours()
173
+ art = @frame.dock_art
184
174
 
185
- col = art.get_colour(Wx::AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR)
186
- @capt_text.bitmap_label = (create_colour_bitmap(col))
175
+ col = art.get_colour(Wx::AUI_DOCKART_BACKGROUND_COLOUR)
176
+ @bckg_colour.bitmap_label = (create_colour_bitmap(col))
187
177
 
188
- col = art.get_colour(Wx::AUI_DOCKART_ACTIVE_CAPTION_COLOUR)
189
- @acap_colour.bitmap_label = (create_colour_bitmap(col))
178
+ col = art.get_colour(Wx::AUI_DOCKART_SASH_COLOUR)
179
+ @sash_colour.bitmap_label = (create_colour_bitmap(col))
190
180
 
191
- col = art.get_colour(Wx::AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR)
192
- @acap_gradnt.bitmap_label = (create_colour_bitmap(col))
181
+ col = art.get_colour(Wx::AUI_DOCKART_INACTIVE_CAPTION_COLOUR)
182
+ @capt_colour.bitmap_label = (create_colour_bitmap(col))
193
183
 
194
- col = art.get_colour(Wx::AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR)
195
- @acap_text.bitmap_label = (create_colour_bitmap(col))
184
+ col = art.get_colour(Wx::AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR)
185
+ @capt_gradnt.bitmap_label = (create_colour_bitmap(col))
196
186
 
197
- col = art.get_colour(Wx::AUI_DOCKART_SASH_COLOUR)
198
- @brdr_colour.bitmap_label = (create_colour_bitmap(col))
187
+ col = art.get_colour(Wx::AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR)
188
+ @capt_text.bitmap_label = (create_colour_bitmap(col))
199
189
 
200
- col = art.get_colour(Wx::AUI_DOCKART_GRIPPER_COLOUR)
201
- @grip_colour.bitmap_label = (create_colour_bitmap(col))
202
- end
190
+ col = art.get_colour(Wx::AUI_DOCKART_ACTIVE_CAPTION_COLOUR)
191
+ @acap_colour.bitmap_label = (create_colour_bitmap(col))
203
192
 
204
- def on_pane_border_size(event)
205
- @frame.get_dock_art.set_metric(Wx::AUI_DOCKART_PANE_BORDER_SIZE,
206
- event.get_position)
207
- @frame.do_update
208
- end
193
+ col = art.get_colour(Wx::AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR)
194
+ @acap_gradnt.bitmap_label = (create_colour_bitmap(col))
209
195
 
210
- def on_sash_size(event)
211
- @frame.get_dock_art.set_metric(Wx::AUI_DOCKART_SASH_SIZE,
212
- event.get_position)
213
- @frame.do_update
214
- end
196
+ col = art.get_colour(Wx::AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR)
197
+ @acap_text.bitmap_label = (create_colour_bitmap(col))
215
198
 
216
- def on_caption_size(event)
217
- @frame.get_dock_art.set_metric(Wx::AUI_DOCKART_CAPTION_SIZE,
218
- event.get_position)
219
- @frame.do_update
220
- end
199
+ col = art.get_colour(Wx::AUI_DOCKART_SASH_COLOUR)
200
+ @brdr_colour.bitmap_label = (create_colour_bitmap(col))
221
201
 
222
- def on_set_colour(event)
223
- Wx.ColourDialog(@frame) do |dlg|
224
- dlg.set_title("Colour Picker")
225
-
226
- return unless dlg.show_modal == Wx::ID_OK
227
-
228
- var = nil
229
- case event.get_id()
230
- when ID::BackgroundColour
231
- var = Wx::AUI_DOCKART_BACKGROUND_COLOUR
232
- when ID::SashColour
233
- var = Wx::AUI_DOCKART_SASH_COLOUR
234
- when ID::InactiveCaptionColour
235
- var = Wx::AUI_DOCKART_INACTIVE_CAPTION_COLOUR
236
- when ID::InactiveCaptionGradientColour
237
- var = Wx::AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR
238
- when ID::InactiveCaptionTextColour
239
- var = Wx::AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR
240
- when ID::ActiveCaptionColour
241
- var = Wx::AUI_DOCKART_ACTIVE_CAPTION_COLOUR
242
- when ID::ActiveCaptionGradientColour
243
- var = Wx::AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR
244
- when ID::ActiveCaptionTextColour
245
- var = Wx::AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR
246
- when ID::BorderColour
247
- var = Wx::AUI_DOCKART_BORDER_COLOUR
248
- when ID::GripperColour
249
- var = Wx::AUI_DOCKART_GRIPPER_COLOUR
250
- else
251
- return
252
- end
202
+ col = art.get_colour(Wx::AUI_DOCKART_GRIPPER_COLOUR)
203
+ @grip_colour.bitmap_label = (create_colour_bitmap(col))
204
+ end
253
205
 
254
- @frame.get_dock_art.set_colour(var, dlg.get_colour_data.get_colour)
206
+ def on_pane_border_size(event)
207
+ @frame.get_dock_art.set_metric(Wx::AUI_DOCKART_PANE_BORDER_SIZE,
208
+ event.get_position)
255
209
  @frame.do_update
256
- update_colours
257
210
  end
258
- end
259
211
 
260
- private
261
-
262
- def make_metric_spin_ctrl(an_id, caption, metric)
263
- metric_val = @frame.get_dock_art.get_metric(metric)
264
- sp = Wx::SpinCtrl.new(self, an_id, metric_val.to_s,
265
- Wx::DEFAULT_POSITION,
266
- Wx::Size.new(50, 20),
267
- Wx::SP_ARROW_KEYS,
268
- 0, 100, metric_val)
269
-
270
- sz = Wx::BoxSizer.new(Wx::HORIZONTAL)
271
- sz.add(1, 1, 1, Wx::EXPAND)
272
- sz.add(Wx::StaticText.new(self, Wx::ID_ANY, caption))
273
- sz.add(sp)
274
- sz.add(1, 1, 1, Wx::EXPAND)
275
- sz.set_item_min_size(1, 180, 20)
276
- return sp, sz
277
- end
212
+ def on_sash_size(event)
213
+ @frame.get_dock_art.set_metric(Wx::AUI_DOCKART_SASH_SIZE,
214
+ event.get_position)
215
+ @frame.do_update
216
+ end
278
217
 
279
- # utility to make a little captioned button;
280
- # returns the button and a sizer containing the button and caption
281
- def make_colour_button(an_id, caption)
282
- bmp_butt = Wx::BitmapButton.new(self, an_id, @base_bmp,
283
- Wx::DEFAULT_POSITION,
284
- Wx::Size.new(50, 25))
285
-
286
- sz = Wx::BoxSizer.new(Wx::HORIZONTAL)
287
- sz.add(1, 1, 1, Wx::EXPAND)
288
- sz.add(Wx::StaticText.new(self, Wx::ID_ANY, caption))
289
- sz.add(bmp_butt)
290
- sz.add(1, 1, 1, Wx::EXPAND)
291
- sz.set_item_min_size(1, 180, 20)
292
- return bmp_butt, sz
293
- end
218
+ def on_caption_size(event)
219
+ @frame.get_dock_art.set_metric(Wx::AUI_DOCKART_CAPTION_SIZE,
220
+ event.get_position)
221
+ @frame.do_update
222
+ end
294
223
 
295
- # returns a 25 x 14 image with solid colour +colour+, with a 1-pixel
296
- # black border
297
- def create_colour_bitmap(colour)
298
- img = Wx::Image.new(25, 14)
299
- 0.upto(24) do |x|
300
- 0.upto(13) do |y|
301
- if (x == 0 || x == 24 || y == 0 || y == 13)
302
- pixcol = Wx::BLACK
224
+ def on_set_colour(event)
225
+ Wx.ColourDialog(@frame) do |dlg|
226
+ dlg.set_title("Colour Picker")
227
+
228
+ return unless dlg.show_modal == Wx::ID_OK
229
+
230
+ var = nil
231
+ case event.get_id()
232
+ when ID::BackgroundColour
233
+ var = Wx::AUI_DOCKART_BACKGROUND_COLOUR
234
+ when ID::SashColour
235
+ var = Wx::AUI_DOCKART_SASH_COLOUR
236
+ when ID::InactiveCaptionColour
237
+ var = Wx::AUI_DOCKART_INACTIVE_CAPTION_COLOUR
238
+ when ID::InactiveCaptionGradientColour
239
+ var = Wx::AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR
240
+ when ID::InactiveCaptionTextColour
241
+ var = Wx::AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR
242
+ when ID::ActiveCaptionColour
243
+ var = Wx::AUI_DOCKART_ACTIVE_CAPTION_COLOUR
244
+ when ID::ActiveCaptionGradientColour
245
+ var = Wx::AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR
246
+ when ID::ActiveCaptionTextColour
247
+ var = Wx::AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR
248
+ when ID::BorderColour
249
+ var = Wx::AUI_DOCKART_BORDER_COLOUR
250
+ when ID::GripperColour
251
+ var = Wx::AUI_DOCKART_GRIPPER_COLOUR
303
252
  else
304
- pixcol = colour
253
+ return
305
254
  end
306
- img.set_rgb(x, y, pixcol.red, pixcol.green, pixcol.blue)
255
+
256
+ @frame.get_dock_art.set_colour(var, dlg.get_colour_data.get_colour)
257
+ @frame.do_update
258
+ update_colours
307
259
  end
308
260
  end
309
- return Wx::Bitmap.new(img)
310
- end
311
- end
312
-
313
- class AuiFrame < Wx::Frame
314
- module ID
315
- include Wx::IDHelper
316
- CreateTree = self.next_id
317
- CreateGrid = self.next_id
318
- CreateText = self.next_id
319
- CreateHTML = self.next_id
320
- CreateNotebook = self.next_id
321
- CreateSizeReport = self.next_id
322
- GridContent = self.next_id
323
- TextContent = self.next_id
324
- TreeContent = self.next_id
325
- HTMLContent = self.next_id
326
- NotebookContent = self.next_id
327
- SizeReportContent = self.next_id
328
- CreatePerspective = self.next_id
329
- CopyPerspectiveCode = self.next_id
330
- AllowFloating = self.next_id
331
- AllowActivePane = self.next_id
332
- TransparentHint = self.next_id
333
- VenetianBlindsHint = self.next_id
334
- RectangleHint = self.next_id
335
- NoHint = self.next_id
336
- HintFade = self.next_id
337
- NoVenetianFade = self.next_id
338
- TransparentDrag = self.next_id
339
- NoGradient = self.next_id
340
- VerticalGradient = self.next_id
341
- HorizontalGradient = self.next_id
342
- LiveUpdate = self.next_id
343
- AllowToolbarResizing = self.next_id
344
- Settings = self.next_id
345
- CustomizeToolbar = self.next_id
346
- DropDownToolbarItem = self.next_id
347
- NotebookNoCloseButton = self.next_id
348
- NotebookCloseButton = self.next_id
349
- NotebookCloseButtonAll = self.next_id
350
- NotebookCloseButtonActive = self.next_id
351
- NotebookAllowTabMove = self.next_id
352
- NotebookAllowTabExternalMove = self.next_id
353
- NotebookAllowTabSplit = self.next_id
354
- NotebookWindowList = self.next_id
355
- NotebookScrollButtons = self.next_id
356
- NotebookTabFixedWidth = self.next_id
357
- NotebookArtGloss = self.next_id
358
- NotebookArtSimple = self.next_id
359
- NotebookAlignTop = self.next_id
360
- NotebookAlignBottom = self.next_id
361
-
362
- SampleItem = self.next_id
363
-
364
- FirstPerspective = CreatePerspective+1000
365
- end
366
261
 
367
- def initialize(*args)
368
- super
369
- @mgr = Wx::AuiManager.new
370
- @mgr.set_managed_window(self)
371
- @perspectives = []
372
-
373
- # set up default notebook style
374
- @notebook_style = Wx::AUI_NB_DEFAULT_STYLE |
375
- Wx::AUI_NB_TAB_EXTERNAL_MOVE | Wx::NO_BORDER
376
- @notebook_theme = 0
377
- setup_menu
378
- create_status_bar
379
- get_status_bar.set_status_text("Ready")
380
- set_min_size(Wx::Size.new(400, 300))
381
- setup_toolbars
382
- setup_panes
383
- setup_perspectives
384
- setup_events
385
- @mgr.update
386
- end
262
+ private
263
+
264
+ def make_metric_spin_ctrl(an_id, caption, metric)
265
+ metric_val = @frame.get_dock_art.get_metric(metric)
266
+ sp = Wx::SpinCtrl.new(self, an_id, metric_val.to_s,
267
+ Wx::DEFAULT_POSITION,
268
+ Wx::Size.new(50, 20),
269
+ Wx::SP_ARROW_KEYS,
270
+ 0, 100, metric_val)
271
+
272
+ sz = Wx::BoxSizer.new(Wx::HORIZONTAL)
273
+ sz.add(1, 1, 1, Wx::EXPAND)
274
+ sz.add(Wx::StaticText.new(self, Wx::ID_ANY, caption))
275
+ sz.add(sp)
276
+ sz.add(1, 1, 1, Wx::EXPAND)
277
+ sz.set_item_min_size(1, 180, 20)
278
+ return sp, sz
279
+ end
387
280
 
388
- def dock_art
389
- @mgr.art_provider
390
- end
281
+ # utility to make a little captioned button;
282
+ # returns the button and a sizer containing the button and caption
283
+ def make_colour_button(an_id, caption)
284
+ bmp_butt = Wx::BitmapButton.new(self, an_id, @base_bmp,
285
+ Wx::DEFAULT_POSITION,
286
+ Wx::Size.new(50, 25))
287
+
288
+ sz = Wx::BoxSizer.new(Wx::HORIZONTAL)
289
+ sz.add(1, 1, 1, Wx::EXPAND)
290
+ sz.add(Wx::StaticText.new(self, Wx::ID_ANY, caption))
291
+ sz.add(bmp_butt)
292
+ sz.add(1, 1, 1, Wx::EXPAND)
293
+ sz.set_item_min_size(1, 180, 20)
294
+ return bmp_butt, sz
295
+ end
391
296
 
392
- #
393
- def setup_menu
394
- mb = Wx::MenuBar.new
395
-
396
- file_menu = Wx::Menu.new
397
- file_menu.append(Wx::ID_EXIT, "Exit")
398
-
399
- view_menu = Wx::Menu.new
400
- view_menu.append(ID::CreateText, "Create Text Control")
401
- view_menu.append(ID::CreateHTML, "Create HTML Control")
402
- view_menu.append(ID::CreateTree, "Create Tree")
403
- view_menu.append(ID::CreateGrid, "Create Grid")
404
- view_menu.append(ID::CreateNotebook, "Create Notebook")
405
- view_menu.append(ID::CreateSizeReport, "Create Size Reporter")
406
- view_menu.append_separator
407
-
408
- view_menu.append(ID::GridContent,
409
- "Use a Grid for the Content Pane")
410
- view_menu.append(ID::TextContent,
411
- "Use a Text Control for the Content Pane")
412
- view_menu.append(ID::HTMLContent,
413
- "Use an HTML Control for the Content Pane")
414
- view_menu.append(ID::TreeContent,
415
- "Use a Tree Control for the Content Pane")
416
- view_menu.append(ID::NotebookContent,
417
- "Use a wxAuiNotebook control for the Content Pane")
418
- view_menu.append(ID::SizeReportContent,
419
- "Use a Size Reporter for the Content Pane")
420
-
421
- options_menu = Wx::Menu.new
422
- # Hints
423
- options_menu.append_radio_item(ID::TransparentHint,
424
- "Transparent Hint")
425
- options_menu.append_radio_item(ID::VenetianBlindsHint,
426
- "Venetian Blinds Hint")
427
- options_menu.append_radio_item(ID::RectangleHint,
428
- "Rectangle Hint")
429
- options_menu.append_radio_item(ID::NoHint,
430
- "No Hint")
431
-
432
- options_menu.append_separator
433
- # Hints Options
434
- options_menu.append_check_item(ID::HintFade,
435
- "Hint Fade-in")
436
- options_menu.append_check_item(ID::AllowFloating,
437
- "Allow Floating")
438
- options_menu.append_check_item(ID::NoVenetianFade,
439
- "Disable Venetian Blinds Hint Fade-in")
440
- options_menu.append_check_item(ID::TransparentDrag,
441
- "Transparent Drag")
442
- options_menu.append_check_item(ID::AllowActivePane,
443
- "Allow Active Pane")
444
- options_menu.append_separator
445
- options_menu.append_radio_item(ID::NoGradient,
446
- "No Caption Gradient")
447
- options_menu.append_radio_item(ID::VerticalGradient,
448
- "Vertical Caption Gradient")
449
- options_menu.append_radio_item(ID::HorizontalGradient,
450
- "Horizontal Caption Gradient")
451
- options_menu.append_separator
452
- options_menu.append(ID::Settings, "Settings Pane")
453
-
454
- notebook_menu = Wx::Menu.new
455
- notebook_menu.append_radio_item(ID::NotebookArtGloss,
456
- "Glossy Theme (Default)")
457
- notebook_menu.append_radio_item(ID::NotebookArtSimple,
458
- "Simple Theme")
459
-
460
- notebook_menu.append_separator
461
-
462
- notebook_menu.append_radio_item(ID::NotebookNoCloseButton,
463
- "No Close Button")
464
- notebook_menu.append_radio_item(ID::NotebookCloseButton,
465
- "Close Button at Right")
466
- notebook_menu.append_radio_item(ID::NotebookCloseButtonAll,
467
- "Close Button on All Tabs")
468
- notebook_menu.append_radio_item(ID::NotebookCloseButtonActive,
469
- "Close Button on Active Tab")
470
-
471
- notebook_menu.append_separator
472
- notebook_menu.append_check_item(ID::NotebookAllowTabMove,
473
- "Allow Tab Move")
474
- notebook_menu.append_check_item(ID::NotebookAllowTabExternalMove,
475
- "Allow External Tab Move")
476
- notebook_menu.append_check_item(ID::NotebookAllowTabSplit,
477
- "Allow Notebook Split")
478
- notebook_menu.append_check_item(ID::NotebookScrollButtons,
479
- "Scroll Buttons Visible")
480
- notebook_menu.append_check_item(ID::NotebookWindowList,
481
- "Window List Button Visible")
482
- notebook_menu.append_check_item(ID::NotebookTabFixedWidth,
483
- "Fixed-width Tabs")
484
-
485
- @perspectives_menu = Wx::Menu.new
486
- @perspectives_menu.append(ID::CreatePerspective,
487
- "Create Perspective")
488
- @perspectives_menu.append(ID::CopyPerspectiveCode,
489
- "Copy Perspective Data To Clipboard")
490
- @perspectives_menu.append_separator
491
- @perspectives_menu.append(ID::FirstPerspective + 0, "Default Startup")
492
- @perspectives_menu.append(ID::FirstPerspective + 1, "All Panes")
493
-
494
- help_menu = Wx::Menu.new
495
- help_menu.append(Wx::ID_ABOUT, "About...")
496
-
497
- mb.append(file_menu, "File")
498
- mb.append(view_menu, "View")
499
- mb.append(@perspectives_menu, "Perspectives")
500
- mb.append(options_menu, "Options")
501
- mb.append(notebook_menu, "Notebook")
502
- mb.append(help_menu, "Help")
503
-
504
- set_menu_bar(mb)
297
+ # returns a 25 x 14 image with solid colour +colour+, with a 1-pixel
298
+ # black border
299
+ def create_colour_bitmap(colour)
300
+ img = Wx::Image.new(25, 14)
301
+ 0.upto(24) do |x|
302
+ 0.upto(13) do |y|
303
+ if (x == 0 || x == 24 || y == 0 || y == 13)
304
+ pixcol = Wx::BLACK
305
+ else
306
+ pixcol = colour
307
+ end
308
+ img.set_rgb(x, y, pixcol.red, pixcol.green, pixcol.blue)
309
+ end
310
+ end
311
+ return Wx::Bitmap.new(img)
312
+ end
505
313
  end
506
314
 
507
- def setup_events
508
- evt_erase_background :on_erase_background
509
- evt_size :on_size
510
-
511
- evt_menu(ID::CreateTree) { |e| on_create_tree }
512
- evt_menu(ID::CreateGrid) { |e| on_create_grid }
513
- evt_menu(ID::CreateText) { |e| on_create_text }
514
- evt_menu(ID::CreateHTML) { |e| on_create_html }
515
- evt_menu(ID::CreateSizeReport) { |e| on_create_size_report }
516
- evt_menu(ID::CreateNotebook) { |e| on_create_notebook }
517
- evt_menu(ID::CreatePerspective) { |e| on_create_perspective }
518
- evt_menu(ID::CopyPerspectiveCode) { |e| on_copy_perspective_code }
519
- evt_menu(ID::AllowFloating, :on_manager_flag)
520
- evt_menu(ID::TransparentHint, :on_manager_flag)
521
- evt_menu(ID::VenetianBlindsHint, :on_manager_flag)
522
- evt_menu(ID::RectangleHint, :on_manager_flag)
523
- evt_menu(ID::NoHint, :on_manager_flag)
524
- evt_menu(ID::HintFade, :on_manager_flag)
525
- evt_menu(ID::NoVenetianFade, :on_manager_flag)
526
- evt_menu(ID::TransparentDrag, :on_manager_flag)
527
- evt_menu(ID::AllowActivePane, :on_manager_flag)
528
- evt_menu(ID::NotebookTabFixedWidth, :on_notebook_flag)
529
- evt_menu(ID::NotebookNoCloseButton, :on_notebook_flag)
530
- evt_menu(ID::NotebookCloseButton, :on_notebook_flag)
531
- evt_menu(ID::NotebookCloseButtonAll, :on_notebook_flag)
532
- evt_menu(ID::NotebookCloseButtonActive, :on_notebook_flag)
533
- evt_menu(ID::NotebookAllowTabMove, :on_notebook_flag)
534
- evt_menu(ID::NotebookAllowTabExternalMove, :on_notebook_flag)
535
- evt_menu(ID::NotebookAllowTabSplit, :on_notebook_flag)
536
- evt_menu(ID::NotebookScrollButtons, :on_notebook_flag)
537
- evt_menu(ID::NotebookWindowList, :on_notebook_flag)
538
- evt_menu(ID::NotebookArtGloss, :on_notebook_flag)
539
- evt_menu(ID::NotebookArtSimple, :on_notebook_flag)
540
- evt_menu(ID::NoGradient, :on_gradient)
541
- evt_menu(ID::VerticalGradient, :on_gradient)
542
- evt_menu(ID::HorizontalGradient, :on_gradient)
543
- evt_menu(ID::Settings) { on_settings }
544
- evt_menu(ID::GridContent, :on_change_content_pane)
545
- evt_menu(ID::TreeContent, :on_change_content_pane)
546
- evt_menu(ID::TextContent, :on_change_content_pane)
547
- evt_menu(ID::SizeReportContent, :on_change_content_pane)
548
- evt_menu(ID::HTMLContent, :on_change_content_pane)
549
- evt_menu(ID::NotebookContent, :on_change_content_pane)
550
- evt_auitoolbar_tool_dropdown(ID::DropDownToolbarItem, :on_drop_down_toolbar_item)
551
- evt_menu(Wx::ID_EXIT) { |e| on_exit }
552
- evt_menu(Wx::ID_ABOUT) { |e| on_about }
553
- evt_update_ui(ID::NotebookTabFixedWidth, :on_update_ui)
554
- evt_update_ui(ID::NotebookNoCloseButton, :on_update_ui)
555
- evt_update_ui(ID::NotebookCloseButton, :on_update_ui)
556
- evt_update_ui(ID::NotebookCloseButtonAll, :on_update_ui)
557
- evt_update_ui(ID::NotebookCloseButtonActive, :on_update_ui)
558
- evt_update_ui(ID::NotebookAllowTabMove, :on_update_ui)
559
- evt_update_ui(ID::NotebookAllowTabExternalMove, :on_update_ui)
560
- evt_update_ui(ID::NotebookAllowTabSplit, :on_update_ui)
561
- evt_update_ui(ID::NotebookScrollButtons, :on_update_ui)
562
- evt_update_ui(ID::NotebookWindowList, :on_update_ui)
563
- evt_update_ui(ID::AllowFloating, :on_update_ui)
564
- evt_update_ui(ID::TransparentHint, :on_update_ui)
565
- evt_update_ui(ID::VenetianBlindsHint, :on_update_ui)
566
- evt_update_ui(ID::RectangleHint, :on_update_ui)
567
- evt_update_ui(ID::NoHint, :on_update_ui)
568
- evt_update_ui(ID::HintFade, :on_update_ui)
569
- evt_update_ui(ID::NoVenetianFade, :on_update_ui)
570
- evt_update_ui(ID::TransparentDrag, :on_update_ui)
571
- evt_update_ui(ID::NoGradient, :on_update_ui)
572
- evt_update_ui(ID::VerticalGradient, :on_update_ui)
573
- evt_update_ui(ID::HorizontalGradient, :on_update_ui)
574
- evt_menu_range(ID::FirstPerspective,
575
- ID::FirstPerspective +
576
- @perspectives.length, :on_restore_perspective)
577
- evt_aui_pane_close :on_pane_close
578
- evt_auinotebook_page_close(Wx::ID_ANY, :on_notebook_page_close)
579
- end
315
+ class AuiFrame < Wx::Frame
316
+ module ID
317
+ include Wx::IDHelper
318
+ CreateTree = self.next_id
319
+ CreateGrid = self.next_id
320
+ CreateText = self.next_id
321
+ CreateHTML = self.next_id
322
+ CreateNotebook = self.next_id
323
+ CreateSizeReport = self.next_id
324
+ GridContent = self.next_id
325
+ TextContent = self.next_id
326
+ TreeContent = self.next_id
327
+ HTMLContent = self.next_id
328
+ NotebookContent = self.next_id
329
+ SizeReportContent = self.next_id
330
+ CreatePerspective = self.next_id
331
+ CopyPerspectiveCode = self.next_id
332
+ AllowFloating = self.next_id
333
+ AllowActivePane = self.next_id
334
+ TransparentHint = self.next_id
335
+ VenetianBlindsHint = self.next_id
336
+ RectangleHint = self.next_id
337
+ NoHint = self.next_id
338
+ HintFade = self.next_id
339
+ NoVenetianFade = self.next_id
340
+ TransparentDrag = self.next_id
341
+ NoGradient = self.next_id
342
+ VerticalGradient = self.next_id
343
+ HorizontalGradient = self.next_id
344
+ LiveUpdate = self.next_id
345
+ AllowToolbarResizing = self.next_id
346
+ Settings = self.next_id
347
+ CustomizeToolbar = self.next_id
348
+ DropDownToolbarItem = self.next_id
349
+ NotebookNoCloseButton = self.next_id
350
+ NotebookCloseButton = self.next_id
351
+ NotebookCloseButtonAll = self.next_id
352
+ NotebookCloseButtonActive = self.next_id
353
+ NotebookAllowTabMove = self.next_id
354
+ NotebookAllowTabExternalMove = self.next_id
355
+ NotebookAllowTabSplit = self.next_id
356
+ NotebookWindowList = self.next_id
357
+ NotebookScrollButtons = self.next_id
358
+ NotebookTabFixedWidth = self.next_id
359
+ NotebookArtGloss = self.next_id
360
+ NotebookArtSimple = self.next_id
361
+ NotebookAlignTop = self.next_id
362
+ NotebookAlignBottom = self.next_id
363
+
364
+ SampleItem = self.next_id
365
+
366
+ FirstPerspective = CreatePerspective+1000
367
+ end
580
368
 
581
- # create some toolbars
582
- def setup_toolbars
583
- # prepare a few custom overflow elements for the toolbars' overflow buttons
584
- append_items = []
585
- item = Wx::AUI::AuiToolBarItem.new
586
- item.set_kind(Wx::ItemKind::ITEM_SEPARATOR)
587
- append_items << item
588
- item = Wx::AUI::AuiToolBarItem.new
589
- item.set_kind(Wx::ItemKind::ITEM_NORMAL)
590
- item.set_id(ID::CustomizeToolbar)
591
- item.set_label('Customize...')
592
- append_items << item
593
-
594
- tb1 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
595
- Wx::DEFAULT_POSITION,
596
- Wx::DEFAULT_SIZE,
597
- Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW)
598
- # tb1.set_tool_bitmap_size(Wx::Size.new(48, 48))
599
- tb1.add_tool(ID::SampleItem+1, "Test",
600
- Wx::ArtProvider::get_bitmap_bundle(Wx::ART_ERROR))
601
- tb1.add_separator
602
- tb1.add_tool(ID::SampleItem+2, "Test",
603
- Wx::ArtProvider::get_bitmap_bundle(Wx::ART_QUESTION))
604
- tb1.add_tool(ID::SampleItem+3, "Test",
605
- Wx::ArtProvider::get_bitmap_bundle(Wx::ART_INFORMATION))
606
- tb1.add_tool(ID::SampleItem+4, "Test",
607
- Wx::ArtProvider::get_bitmap_bundle(Wx::ART_WARNING))
608
- tb1.add_tool(ID::SampleItem+5, "Test",
609
- Wx::ArtProvider::get_bitmap_bundle(Wx::ART_MISSING_IMAGE))
610
- tb1.set_custom_overflow_items(nil, append_items)
611
- tb1.realize
612
-
613
- tb2 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY, Wx::DEFAULT_POSITION,
614
- Wx::DEFAULT_SIZE,
615
- Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW | Wx::AUI::AUI_TB_HORIZONTAL)
616
- # tb2.set_tool_bitmap_size(Wx::Size.new(16, 16))
617
-
618
- tb2_bmp1 = Wx::ArtProvider::get_bitmap_bundle(Wx::ART_QUESTION,
619
- Wx::ART_OTHER,
620
- Wx::Size.new(24, 24))
621
- tb2.add_tool(ID::SampleItem+6, "Test", tb2_bmp1)
622
- tb2.add_tool(ID::SampleItem+7, "Test", tb2_bmp1)
623
- tb2.add_tool(ID::SampleItem+8, "Test", tb2_bmp1)
624
- tb2.add_tool(ID::SampleItem+9, "Test", tb2_bmp1)
625
- tb2.add_separator
626
- tb2.add_tool(ID::SampleItem+10, "Test", tb2_bmp1)
627
- tb2.add_tool(ID::SampleItem+11, "Test", tb2_bmp1)
628
- tb2.add_separator
629
- tb2.add_tool(ID::SampleItem+12, "Test", tb2_bmp1)
630
- tb2.add_tool(ID::SampleItem+13, "Test", tb2_bmp1)
631
- tb2.add_tool(ID::SampleItem+14, "Test", tb2_bmp1)
632
- tb2.add_tool(ID::SampleItem+15, "Test", tb2_bmp1)
633
- tb2.set_custom_overflow_items(nil, append_items)
634
- tb2.enable_tool(ID::SampleItem+6, false)
635
- tb2.realize
636
-
637
- tb3 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
638
- Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
639
- Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW)
640
- # tb3.set_tool_bitmap_size(Wx::Size.new(16, 16))
641
- tb3_bmp1 = Wx::ArtProvider::get_bitmap_bundle(Wx::ART_FOLDER,
642
- Wx::ART_OTHER,
643
- Wx::Size.new(16, 16))
644
- tb3.add_tool(ID::SampleItem+16, "Check 1", tb3_bmp1, "Check 1", Wx::ItemKind::ITEM_CHECK)
645
- tb3.add_tool(ID::SampleItem+17, "Check 2", tb3_bmp1, "Check 2", Wx::ItemKind::ITEM_CHECK)
646
- tb3.add_tool(ID::SampleItem+18, "Check 3", tb3_bmp1, "Check 3", Wx::ItemKind::ITEM_CHECK)
647
- tb3.add_tool(ID::SampleItem+19, "Check 4", tb3_bmp1, "Check 4", Wx::ItemKind::ITEM_CHECK)
648
- tb3.add_separator
649
- tb3.add_tool(ID::SampleItem+20, "Radio 1", tb3_bmp1, "Radio 1", Wx::ItemKind::ITEM_RADIO)
650
- tb3.add_tool(ID::SampleItem+21, "Radio 2", tb3_bmp1, "Radio 2", Wx::ItemKind::ITEM_RADIO)
651
- tb3.add_tool(ID::SampleItem+22, "Radio 3", tb3_bmp1, "Radio 3", Wx::ItemKind::ITEM_RADIO)
652
- tb3.add_separator
653
- tb3.add_tool(ID::SampleItem+23, "Radio 1 (Group 2)", tb3_bmp1, "Radio 1 (Group 2)", Wx::ItemKind::ITEM_RADIO)
654
- tb3.add_tool(ID::SampleItem+24, "Radio 2 (Group 2)", tb3_bmp1, "Radio 2 (Group 2)", Wx::ItemKind::ITEM_RADIO)
655
- tb3.add_tool(ID::SampleItem+25, "Radio 3 (Group 2)", tb3_bmp1, "Radio 3 (Group 2)", Wx::ItemKind::ITEM_RADIO)
656
- tb3.set_custom_overflow_items(nil, append_items)
657
- tb3.realize
658
-
659
- tb4 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
660
- Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
661
- Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW | Wx::AUI::AUI_TB_TEXT | Wx::AUI::AUI_TB_HORZ_TEXT)
662
- # tb4.set_tool_bitmap_size(Wx::Size.new(16, 16))
663
- tb4_bmp1 = Wx::ArtProvider::get_bitmap_bundle(Wx::ART_NORMAL_FILE,
664
- Wx::ART_OTHER,
665
- Wx::Size.new(16, 16))
666
- tb4.add_tool(ID::DropDownToolbarItem, "Item 1", tb4_bmp1)
667
- tb4.add_tool(ID::SampleItem+23, "Item 2", tb4_bmp1)
668
- tb4.set_tool_sticky(ID::SampleItem+23, true)
669
- tb4.add_tool(ID::SampleItem+24, "Item 3", tb4_bmp1)
670
- tb4.enable_tool(ID::SampleItem+24, false)
671
- tb4.add_tool(ID::SampleItem+25, "Item 4", tb4_bmp1)
672
- tb4.add_separator
673
- tb4.add_tool(ID::SampleItem+26, "Item 5", tb4_bmp1)
674
- tb4.add_tool(ID::SampleItem+27, "Item 6", tb4_bmp1)
675
- tb4.add_tool(ID::SampleItem+28, "Item 7", tb4_bmp1)
676
- tb4.add_tool(ID::SampleItem+29, "Item 8", tb4_bmp1)
677
- tb4.set_tool_drop_down(ID::DropDownToolbarItem, true)
678
- tb4.set_custom_overflow_items(nil, append_items)
679
- choice = Wx::Choice.new(tb4, ID::SampleItem+35)
680
- choice.append('One choice')
681
- choice.append('Another choice')
682
- tb4.add_control(choice)
683
- tb4.realize
369
+ def initialize(*args)
370
+ super
371
+ @mgr = Wx::AuiManager.new
372
+ @mgr.set_managed_window(self)
373
+ @perspectives = []
374
+
375
+ # set up default notebook style
376
+ @notebook_style = Wx::AUI_NB_DEFAULT_STYLE |
377
+ Wx::AUI_NB_TAB_EXTERNAL_MOVE | Wx::NO_BORDER
378
+ @notebook_theme = 0
379
+ setup_menu
380
+ create_status_bar
381
+ get_status_bar.set_status_text("Ready")
382
+ set_min_size(Wx::Size.new(400, 300))
383
+ setup_toolbars
384
+ setup_panes
385
+ setup_perspectives
386
+ setup_events
387
+ @mgr.update
388
+ end
684
389
 
685
- # create some toolbars
686
- tb5 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
687
- Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
688
- Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW | Wx::AUI::AUI_TB_VERTICAL)
689
- # tb5.set_tool_bitmap_size(Wx::Size.new(48, 48))
690
- tb5.add_tool(ID::SampleItem+30, "Test",
691
- Wx::ArtProvider::get_bitmap_bundle(Wx::ART_ERROR))
692
- tb5.add_separator
693
- tb5.add_tool(ID::SampleItem+31, "Test",
694
- Wx::ArtProvider::get_bitmap_bundle(Wx::ART_QUESTION))
695
- tb5.add_tool(ID::SampleItem+32, "Test",
696
- Wx::ArtProvider::get_bitmap_bundle(Wx::ART_INFORMATION))
697
- tb5.add_tool(ID::SampleItem+33, "Test",
698
- Wx::ArtProvider::get_bitmap_bundle(Wx::ART_WARNING))
699
- tb5.add_tool(ID::SampleItem+34, "Test",
700
- Wx::ArtProvider::get_bitmap_bundle(Wx::ART_MISSING_IMAGE))
701
- tb5.set_custom_overflow_items(nil, append_items)
702
- tb5.realize
703
-
704
- # add the toolbars to the manager
705
- pi = Wx::AuiPaneInfo.new
706
- pi.set_name('tb1').set_caption("Big Toolbar").toolbar_pane.top
707
- # pi.top.set_left_dockable(false).set_right_dockable(false)
708
- @mgr.add_pane(tb1, pi)
709
-
710
- pi = Wx::AuiPaneInfo.new
711
- pi.set_name('tb2').set_caption("Toolbar 2 (horizontal)").toolbar_pane.top.set_row(1)
712
- # pi.set_left_dockable(false).set_right_dockable(false)
713
- @mgr.add_pane(tb2, pi)
714
-
715
- pi = Wx::AuiPaneInfo.new
716
- pi.set_name('tb3').set_caption("Toolbar 3").toolbar_pane.top.set_row(1).set_position(1)
717
- # pi.set_left_dockable(false).set_right_dockable(false)
718
- @mgr.add_pane(tb3, pi)
719
-
720
- pi = Wx::AuiPaneInfo.new
721
- pi.set_name('tb4').set_caption("Sample Bookmark Toolbar").toolbar_pane.top.set_row(2)
722
- # pi.set_left_dockable(false).set_right_dockable(false)
723
- @mgr.add_pane(tb4, pi)
724
-
725
- pi = Wx::AuiPaneInfo.new
726
- pi.set_name('tb5').set_caption("Sample Vertical Toolbar").toolbar_pane.left.set_gripper_top
727
- # pi.set_left_dockable(false).set_right_dockable(false)
728
- @mgr.add_pane(tb5, pi)
729
-
730
- @mgr.add_pane(Wx::Button.new(self, label: 'Test Button'),
731
- Wx::AUI::AuiPaneInfo.new.set_name('tb6').toolbar_pane.top.set_row(2).set_position(1)
732
- .set_left_dockable(false).set_right_dockable(false))
733
- end
390
+ def dock_art
391
+ @mgr.art_provider
392
+ end
734
393
 
735
- def setup_panes
736
- # add a bunch of panes
737
- pi = Wx::AuiPaneInfo.new
738
- pi.set_name('test1').set_caption('Pane Caption').top
739
- @mgr.add_pane(create_size_report_ctrl, pi)
740
-
741
- pi = Wx::AuiPaneInfo.new
742
- pi.set_name('test2').set_caption('Client Size Reporter').bottom
743
- pi.set_position(1).set_close_button.set_maximize_button
744
- @mgr.add_pane(create_size_report_ctrl, pi)
745
-
746
- pi = Wx::AuiPaneInfo.new
747
- pi.set_name('test3').set_caption('Client Size Reporter').bottom
748
- pi.set_close_button.set_maximize_button
749
- @mgr.add_pane(create_size_report_ctrl, pi)
750
-
751
- pi = Wx::AuiPaneInfo.new
752
- pi.set_name('test4').set_caption('Pane Caption').left
753
- @mgr.add_pane(create_size_report_ctrl, pi)
754
-
755
- pi = Wx::AuiPaneInfo.new
756
- pi.set_name('test5').set_caption('No Close Button').right
757
- pi.set_close_button(false)
758
- @mgr.add_pane(create_size_report_ctrl, pi)
759
-
760
- pi = Wx::AuiPaneInfo.new
761
- pi.set_name('test6').set_caption('Client Size Report').right
762
- pi.set_row(1).set_close_button.set_maximize_button
763
- @mgr.add_pane(create_size_report_ctrl, pi)
764
-
765
- pi = Wx::AuiPaneInfo.new
766
- pi.set_name('test7').set_caption('Client Size Report').left
767
- pi.set_layer(1).set_close_button.set_maximize_button
768
- @mgr.add_pane(create_size_report_ctrl, pi)
769
-
770
- pi = Wx::AuiPaneInfo.new
771
- pi.set_name('test8').set_caption('Tree Pane').left
772
- pi.set_layer(1).set_position(1).set_close_button.set_maximize_button
773
- @mgr.add_pane(create_tree_ctrl, pi)
774
-
775
- pi = Wx::AuiPaneInfo.new
776
- pi_size = Wx::Size.new(200, 100)
777
- pi.set_name('test9').set_caption('Min Size 200x100').bottom
778
- pi.set_best_size(pi_size).set_min_size(pi_size)
779
- pi.set_layer(1).set_close_button.set_maximize_button
780
- @mgr.add_pane(create_size_report_ctrl, pi)
781
-
782
- wnd10 = create_text_ctrl("This pane will prompt the user before hiding.")
783
- pi = Wx::AuiPaneInfo.new
784
- pi.set_name('test10').set_caption('Text Pane with hide prompt')
785
- pi.bottom.set_layer(1).set_position(1)
786
- @mgr.add_pane(wnd10, pi)
787
-
788
- pi = Wx::AuiPaneInfo.new
789
- pi.set_name('test11').set_caption('Fixed Pane').bottom
790
- pi.set_layer(1).set_position(2).fixed
791
- @mgr.add_pane(create_size_report_ctrl, pi)
792
-
793
- pi = Wx::AuiPaneInfo.new
794
- pi.set_name('settings').set_caption('Dock Manager Settings')
795
- pi.set_dockable(false).float.hide
796
-
797
- @mgr.add_pane(SettingsPanel.new(self, self), pi)
798
-
799
- # create some center panes
800
-
801
- pi = Wx::AuiPaneInfo.new
802
- pi.set_name('grid_content').center_pane.hide
803
- @mgr.add_pane(create_grid, pi)
804
-
805
- pi = Wx::AuiPaneInfo.new
806
- pi.set_name('tree_content').center_pane.hide
807
- @mgr.add_pane(create_tree_ctrl, pi)
808
-
809
- pi = Wx::AuiPaneInfo.new
810
- pi.set_name('sizereport_content').center_pane.hide
811
- @mgr.add_pane(create_size_report_ctrl, pi)
812
-
813
- pi = Wx::AuiPaneInfo.new
814
- pi.set_name('text_content').center_pane.hide
815
- @mgr.add_pane(create_text_ctrl, pi)
816
-
817
- pi = Wx::AuiPaneInfo.new
818
- pi.set_name('html_content').center_pane.hide
819
- @mgr.add_pane(create_html_ctrl, pi)
820
-
821
- pi = Wx::AuiPaneInfo.new
822
- pi.set_name('notebook_content').center_pane.hide
823
- @mgr.add_pane(create_notebook, pi)
824
- end
394
+ #
395
+ def setup_menu
396
+ mb = Wx::MenuBar.new
397
+
398
+ file_menu = Wx::Menu.new
399
+ file_menu.append(Wx::ID_EXIT, "Exit")
400
+
401
+ view_menu = Wx::Menu.new
402
+ view_menu.append(ID::CreateText, "Create Text Control")
403
+ view_menu.append(ID::CreateHTML, "Create HTML Control")
404
+ view_menu.append(ID::CreateTree, "Create Tree")
405
+ view_menu.append(ID::CreateGrid, "Create Grid")
406
+ view_menu.append(ID::CreateNotebook, "Create Notebook")
407
+ view_menu.append(ID::CreateSizeReport, "Create Size Reporter")
408
+ view_menu.append_separator
409
+
410
+ view_menu.append(ID::GridContent,
411
+ "Use a Grid for the Content Pane")
412
+ view_menu.append(ID::TextContent,
413
+ "Use a Text Control for the Content Pane")
414
+ view_menu.append(ID::HTMLContent,
415
+ "Use an HTML Control for the Content Pane")
416
+ view_menu.append(ID::TreeContent,
417
+ "Use a Tree Control for the Content Pane")
418
+ view_menu.append(ID::NotebookContent,
419
+ "Use a wxAuiNotebook control for the Content Pane")
420
+ view_menu.append(ID::SizeReportContent,
421
+ "Use a Size Reporter for the Content Pane")
422
+
423
+ options_menu = Wx::Menu.new
424
+ # Hints
425
+ options_menu.append_radio_item(ID::TransparentHint,
426
+ "Transparent Hint")
427
+ options_menu.append_radio_item(ID::VenetianBlindsHint,
428
+ "Venetian Blinds Hint")
429
+ options_menu.append_radio_item(ID::RectangleHint,
430
+ "Rectangle Hint")
431
+ options_menu.append_radio_item(ID::NoHint,
432
+ "No Hint")
433
+
434
+ options_menu.append_separator
435
+ # Hints Options
436
+ options_menu.append_check_item(ID::HintFade,
437
+ "Hint Fade-in")
438
+ options_menu.append_check_item(ID::AllowFloating,
439
+ "Allow Floating")
440
+ options_menu.append_check_item(ID::NoVenetianFade,
441
+ "Disable Venetian Blinds Hint Fade-in")
442
+ options_menu.append_check_item(ID::TransparentDrag,
443
+ "Transparent Drag")
444
+ options_menu.append_check_item(ID::AllowActivePane,
445
+ "Allow Active Pane")
446
+ options_menu.append_separator
447
+ options_menu.append_radio_item(ID::NoGradient,
448
+ "No Caption Gradient")
449
+ options_menu.append_radio_item(ID::VerticalGradient,
450
+ "Vertical Caption Gradient")
451
+ options_menu.append_radio_item(ID::HorizontalGradient,
452
+ "Horizontal Caption Gradient")
453
+ options_menu.append_separator
454
+ options_menu.append(ID::Settings, "Settings Pane")
455
+
456
+ notebook_menu = Wx::Menu.new
457
+ notebook_menu.append_radio_item(ID::NotebookArtGloss,
458
+ "Glossy Theme (Default)")
459
+ notebook_menu.append_radio_item(ID::NotebookArtSimple,
460
+ "Simple Theme")
461
+
462
+ notebook_menu.append_separator
463
+
464
+ notebook_menu.append_radio_item(ID::NotebookNoCloseButton,
465
+ "No Close Button")
466
+ notebook_menu.append_radio_item(ID::NotebookCloseButton,
467
+ "Close Button at Right")
468
+ notebook_menu.append_radio_item(ID::NotebookCloseButtonAll,
469
+ "Close Button on All Tabs")
470
+ notebook_menu.append_radio_item(ID::NotebookCloseButtonActive,
471
+ "Close Button on Active Tab")
472
+
473
+ notebook_menu.append_separator
474
+ notebook_menu.append_check_item(ID::NotebookAllowTabMove,
475
+ "Allow Tab Move")
476
+ notebook_menu.append_check_item(ID::NotebookAllowTabExternalMove,
477
+ "Allow External Tab Move")
478
+ notebook_menu.append_check_item(ID::NotebookAllowTabSplit,
479
+ "Allow Notebook Split")
480
+ notebook_menu.append_check_item(ID::NotebookScrollButtons,
481
+ "Scroll Buttons Visible")
482
+ notebook_menu.append_check_item(ID::NotebookWindowList,
483
+ "Window List Button Visible")
484
+ notebook_menu.append_check_item(ID::NotebookTabFixedWidth,
485
+ "Fixed-width Tabs")
486
+
487
+ @perspectives_menu = Wx::Menu.new
488
+ @perspectives_menu.append(ID::CreatePerspective,
489
+ "Create Perspective")
490
+ @perspectives_menu.append(ID::CopyPerspectiveCode,
491
+ "Copy Perspective Data To Clipboard")
492
+ @perspectives_menu.append_separator
493
+ @perspectives_menu.append(ID::FirstPerspective + 0, "Default Startup")
494
+ @perspectives_menu.append(ID::FirstPerspective + 1, "All Panes")
495
+
496
+ help_menu = Wx::Menu.new
497
+ help_menu.append(Wx::ID_ABOUT, "About...")
498
+
499
+ mb.append(file_menu, "File")
500
+ mb.append(view_menu, "View")
501
+ mb.append(@perspectives_menu, "Perspectives")
502
+ mb.append(options_menu, "Options")
503
+ mb.append(notebook_menu, "Notebook")
504
+ mb.append(help_menu, "Help")
505
+
506
+ set_menu_bar(mb)
507
+ end
825
508
 
826
- # make some default perspectives
827
- def setup_perspectives
828
- perspective_all = @mgr.save_perspective
509
+ def setup_events
510
+ evt_erase_background :on_erase_background
511
+ evt_size :on_size
512
+
513
+ evt_menu(ID::CreateTree) { |e| on_create_tree }
514
+ evt_menu(ID::CreateGrid) { |e| on_create_grid }
515
+ evt_menu(ID::CreateText) { |e| on_create_text }
516
+ evt_menu(ID::CreateHTML) { |e| on_create_html }
517
+ evt_menu(ID::CreateSizeReport) { |e| on_create_size_report }
518
+ evt_menu(ID::CreateNotebook) { |e| on_create_notebook }
519
+ evt_menu(ID::CreatePerspective) { |e| on_create_perspective }
520
+ evt_menu(ID::CopyPerspectiveCode) { |e| on_copy_perspective_code }
521
+ evt_menu(ID::AllowFloating, :on_manager_flag)
522
+ evt_menu(ID::TransparentHint, :on_manager_flag)
523
+ evt_menu(ID::VenetianBlindsHint, :on_manager_flag)
524
+ evt_menu(ID::RectangleHint, :on_manager_flag)
525
+ evt_menu(ID::NoHint, :on_manager_flag)
526
+ evt_menu(ID::HintFade, :on_manager_flag)
527
+ evt_menu(ID::NoVenetianFade, :on_manager_flag)
528
+ evt_menu(ID::TransparentDrag, :on_manager_flag)
529
+ evt_menu(ID::AllowActivePane, :on_manager_flag)
530
+ evt_menu(ID::NotebookTabFixedWidth, :on_notebook_flag)
531
+ evt_menu(ID::NotebookNoCloseButton, :on_notebook_flag)
532
+ evt_menu(ID::NotebookCloseButton, :on_notebook_flag)
533
+ evt_menu(ID::NotebookCloseButtonAll, :on_notebook_flag)
534
+ evt_menu(ID::NotebookCloseButtonActive, :on_notebook_flag)
535
+ evt_menu(ID::NotebookAllowTabMove, :on_notebook_flag)
536
+ evt_menu(ID::NotebookAllowTabExternalMove, :on_notebook_flag)
537
+ evt_menu(ID::NotebookAllowTabSplit, :on_notebook_flag)
538
+ evt_menu(ID::NotebookScrollButtons, :on_notebook_flag)
539
+ evt_menu(ID::NotebookWindowList, :on_notebook_flag)
540
+ evt_menu(ID::NotebookArtGloss, :on_notebook_flag)
541
+ evt_menu(ID::NotebookArtSimple, :on_notebook_flag)
542
+ evt_menu(ID::NoGradient, :on_gradient)
543
+ evt_menu(ID::VerticalGradient, :on_gradient)
544
+ evt_menu(ID::HorizontalGradient, :on_gradient)
545
+ evt_menu(ID::Settings) { on_settings }
546
+ evt_menu(ID::GridContent, :on_change_content_pane)
547
+ evt_menu(ID::TreeContent, :on_change_content_pane)
548
+ evt_menu(ID::TextContent, :on_change_content_pane)
549
+ evt_menu(ID::SizeReportContent, :on_change_content_pane)
550
+ evt_menu(ID::HTMLContent, :on_change_content_pane)
551
+ evt_menu(ID::NotebookContent, :on_change_content_pane)
552
+ evt_auitoolbar_tool_dropdown(ID::DropDownToolbarItem, :on_drop_down_toolbar_item)
553
+ evt_menu(Wx::ID_EXIT) { |e| on_exit }
554
+ evt_menu(Wx::ID_ABOUT) { |e| on_about }
555
+ evt_update_ui(ID::NotebookTabFixedWidth, :on_update_ui)
556
+ evt_update_ui(ID::NotebookNoCloseButton, :on_update_ui)
557
+ evt_update_ui(ID::NotebookCloseButton, :on_update_ui)
558
+ evt_update_ui(ID::NotebookCloseButtonAll, :on_update_ui)
559
+ evt_update_ui(ID::NotebookCloseButtonActive, :on_update_ui)
560
+ evt_update_ui(ID::NotebookAllowTabMove, :on_update_ui)
561
+ evt_update_ui(ID::NotebookAllowTabExternalMove, :on_update_ui)
562
+ evt_update_ui(ID::NotebookAllowTabSplit, :on_update_ui)
563
+ evt_update_ui(ID::NotebookScrollButtons, :on_update_ui)
564
+ evt_update_ui(ID::NotebookWindowList, :on_update_ui)
565
+ evt_update_ui(ID::AllowFloating, :on_update_ui)
566
+ evt_update_ui(ID::TransparentHint, :on_update_ui)
567
+ evt_update_ui(ID::VenetianBlindsHint, :on_update_ui)
568
+ evt_update_ui(ID::RectangleHint, :on_update_ui)
569
+ evt_update_ui(ID::NoHint, :on_update_ui)
570
+ evt_update_ui(ID::HintFade, :on_update_ui)
571
+ evt_update_ui(ID::NoVenetianFade, :on_update_ui)
572
+ evt_update_ui(ID::TransparentDrag, :on_update_ui)
573
+ evt_update_ui(ID::NoGradient, :on_update_ui)
574
+ evt_update_ui(ID::VerticalGradient, :on_update_ui)
575
+ evt_update_ui(ID::HorizontalGradient, :on_update_ui)
576
+ evt_menu_range(ID::FirstPerspective,
577
+ ID::FirstPerspective +
578
+ @perspectives.length, :on_restore_perspective)
579
+ evt_aui_pane_close :on_pane_close
580
+ evt_auinotebook_page_close(Wx::ID_ANY, :on_notebook_page_close)
581
+ end
829
582
 
830
- @mgr.each_pane do |pane|
831
- pane.hide unless pane.is_toolbar
583
+ # create some toolbars
584
+ def setup_toolbars
585
+ # prepare a few custom overflow elements for the toolbars' overflow buttons
586
+ append_items = []
587
+ item = Wx::AUI::AuiToolBarItem.new
588
+ item.set_kind(Wx::ItemKind::ITEM_SEPARATOR)
589
+ append_items << item
590
+ item = Wx::AUI::AuiToolBarItem.new
591
+ item.set_kind(Wx::ItemKind::ITEM_NORMAL)
592
+ item.set_id(ID::CustomizeToolbar)
593
+ item.set_label('Customize...')
594
+ append_items << item
595
+
596
+ tb1 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
597
+ Wx::DEFAULT_POSITION,
598
+ Wx::DEFAULT_SIZE,
599
+ Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW)
600
+ # tb1.set_tool_bitmap_size(Wx::Size.new(48, 48))
601
+ tb1.add_tool(ID::SampleItem+1, "Test",
602
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_ERROR))
603
+ tb1.add_separator
604
+ tb1.add_tool(ID::SampleItem+2, "Test",
605
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_QUESTION))
606
+ tb1.add_tool(ID::SampleItem+3, "Test",
607
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_INFORMATION))
608
+ tb1.add_tool(ID::SampleItem+4, "Test",
609
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_WARNING))
610
+ tb1.add_tool(ID::SampleItem+5, "Test",
611
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_MISSING_IMAGE))
612
+ tb1.set_custom_overflow_items(nil, append_items)
613
+ tb1.realize
614
+
615
+ tb2 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY, Wx::DEFAULT_POSITION,
616
+ Wx::DEFAULT_SIZE,
617
+ Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW | Wx::AUI::AUI_TB_HORIZONTAL)
618
+ # tb2.set_tool_bitmap_size(Wx::Size.new(16, 16))
619
+
620
+ tb2_bmp1 = Wx::ArtProvider::get_bitmap_bundle(Wx::ART_QUESTION,
621
+ Wx::ART_OTHER,
622
+ Wx::Size.new(24, 24))
623
+ tb2.add_tool(ID::SampleItem+6, "Test", tb2_bmp1)
624
+ tb2.add_tool(ID::SampleItem+7, "Test", tb2_bmp1)
625
+ tb2.add_tool(ID::SampleItem+8, "Test", tb2_bmp1)
626
+ tb2.add_tool(ID::SampleItem+9, "Test", tb2_bmp1)
627
+ tb2.add_separator
628
+ tb2.add_tool(ID::SampleItem+10, "Test", tb2_bmp1)
629
+ tb2.add_tool(ID::SampleItem+11, "Test", tb2_bmp1)
630
+ tb2.add_separator
631
+ tb2.add_tool(ID::SampleItem+12, "Test", tb2_bmp1)
632
+ tb2.add_tool(ID::SampleItem+13, "Test", tb2_bmp1)
633
+ tb2.add_tool(ID::SampleItem+14, "Test", tb2_bmp1)
634
+ tb2.add_tool(ID::SampleItem+15, "Test", tb2_bmp1)
635
+ tb2.set_custom_overflow_items(nil, append_items)
636
+ tb2.enable_tool(ID::SampleItem+6, false)
637
+ tb2.realize
638
+
639
+ tb3 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
640
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
641
+ Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW)
642
+ # tb3.set_tool_bitmap_size(Wx::Size.new(16, 16))
643
+ tb3_bmp1 = Wx::ArtProvider::get_bitmap_bundle(Wx::ART_FOLDER,
644
+ Wx::ART_OTHER,
645
+ Wx::Size.new(16, 16))
646
+ tb3.add_tool(ID::SampleItem+16, "Check 1", tb3_bmp1, "Check 1", Wx::ItemKind::ITEM_CHECK)
647
+ tb3.add_tool(ID::SampleItem+17, "Check 2", tb3_bmp1, "Check 2", Wx::ItemKind::ITEM_CHECK)
648
+ tb3.add_tool(ID::SampleItem+18, "Check 3", tb3_bmp1, "Check 3", Wx::ItemKind::ITEM_CHECK)
649
+ tb3.add_tool(ID::SampleItem+19, "Check 4", tb3_bmp1, "Check 4", Wx::ItemKind::ITEM_CHECK)
650
+ tb3.add_separator
651
+ tb3.add_tool(ID::SampleItem+20, "Radio 1", tb3_bmp1, "Radio 1", Wx::ItemKind::ITEM_RADIO)
652
+ tb3.add_tool(ID::SampleItem+21, "Radio 2", tb3_bmp1, "Radio 2", Wx::ItemKind::ITEM_RADIO)
653
+ tb3.add_tool(ID::SampleItem+22, "Radio 3", tb3_bmp1, "Radio 3", Wx::ItemKind::ITEM_RADIO)
654
+ tb3.add_separator
655
+ tb3.add_tool(ID::SampleItem+23, "Radio 1 (Group 2)", tb3_bmp1, "Radio 1 (Group 2)", Wx::ItemKind::ITEM_RADIO)
656
+ tb3.add_tool(ID::SampleItem+24, "Radio 2 (Group 2)", tb3_bmp1, "Radio 2 (Group 2)", Wx::ItemKind::ITEM_RADIO)
657
+ tb3.add_tool(ID::SampleItem+25, "Radio 3 (Group 2)", tb3_bmp1, "Radio 3 (Group 2)", Wx::ItemKind::ITEM_RADIO)
658
+ tb3.set_custom_overflow_items(nil, append_items)
659
+ tb3.realize
660
+
661
+ tb4 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
662
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
663
+ Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW | Wx::AUI::AUI_TB_TEXT | Wx::AUI::AUI_TB_HORZ_TEXT)
664
+ # tb4.set_tool_bitmap_size(Wx::Size.new(16, 16))
665
+ tb4_bmp1 = Wx::ArtProvider::get_bitmap_bundle(Wx::ART_NORMAL_FILE,
666
+ Wx::ART_OTHER,
667
+ Wx::Size.new(16, 16))
668
+ tb4.add_tool(ID::DropDownToolbarItem, "Item 1", tb4_bmp1)
669
+ tb4.add_tool(ID::SampleItem+23, "Item 2", tb4_bmp1)
670
+ tb4.set_tool_sticky(ID::SampleItem+23, true)
671
+ tb4.add_tool(ID::SampleItem+24, "Item 3", tb4_bmp1)
672
+ tb4.enable_tool(ID::SampleItem+24, false)
673
+ tb4.add_tool(ID::SampleItem+25, "Item 4", tb4_bmp1)
674
+ tb4.add_separator
675
+ tb4.add_tool(ID::SampleItem+26, "Item 5", tb4_bmp1)
676
+ tb4.add_tool(ID::SampleItem+27, "Item 6", tb4_bmp1)
677
+ tb4.add_tool(ID::SampleItem+28, "Item 7", tb4_bmp1)
678
+ tb4.add_tool(ID::SampleItem+29, "Item 8", tb4_bmp1)
679
+ tb4.set_tool_drop_down(ID::DropDownToolbarItem, true)
680
+ tb4.set_custom_overflow_items(nil, append_items)
681
+ choice = Wx::Choice.new(tb4, ID::SampleItem+35)
682
+ choice.append('One choice')
683
+ choice.append('Another choice')
684
+ tb4.add_control(choice)
685
+ tb4.realize
686
+
687
+ # create some toolbars
688
+ tb5 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
689
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
690
+ Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW | Wx::AUI::AUI_TB_VERTICAL)
691
+ # tb5.set_tool_bitmap_size(Wx::Size.new(48, 48))
692
+ tb5.add_tool(ID::SampleItem+30, "Test",
693
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_ERROR))
694
+ tb5.add_separator
695
+ tb5.add_tool(ID::SampleItem+31, "Test",
696
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_QUESTION))
697
+ tb5.add_tool(ID::SampleItem+32, "Test",
698
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_INFORMATION))
699
+ tb5.add_tool(ID::SampleItem+33, "Test",
700
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_WARNING))
701
+ tb5.add_tool(ID::SampleItem+34, "Test",
702
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_MISSING_IMAGE))
703
+ tb5.set_custom_overflow_items(nil, append_items)
704
+ tb5.realize
705
+
706
+ # add the toolbars to the manager
707
+ pi = Wx::AuiPaneInfo.new
708
+ pi.set_name('tb1').set_caption("Big Toolbar").toolbar_pane.top
709
+ # pi.top.set_left_dockable(false).set_right_dockable(false)
710
+ @mgr.add_pane(tb1, pi)
711
+
712
+ pi = Wx::AuiPaneInfo.new
713
+ pi.set_name('tb2').set_caption("Toolbar 2 (horizontal)").toolbar_pane.top.set_row(1)
714
+ # pi.set_left_dockable(false).set_right_dockable(false)
715
+ @mgr.add_pane(tb2, pi)
716
+
717
+ pi = Wx::AuiPaneInfo.new
718
+ pi.set_name('tb3').set_caption("Toolbar 3").toolbar_pane.top.set_row(1).set_position(1)
719
+ # pi.set_left_dockable(false).set_right_dockable(false)
720
+ @mgr.add_pane(tb3, pi)
721
+
722
+ pi = Wx::AuiPaneInfo.new
723
+ pi.set_name('tb4').set_caption("Sample Bookmark Toolbar").toolbar_pane.top.set_row(2)
724
+ # pi.set_left_dockable(false).set_right_dockable(false)
725
+ @mgr.add_pane(tb4, pi)
726
+
727
+ pi = Wx::AuiPaneInfo.new
728
+ pi.set_name('tb5').set_caption("Sample Vertical Toolbar").toolbar_pane.left.set_gripper_top
729
+ # pi.set_left_dockable(false).set_right_dockable(false)
730
+ @mgr.add_pane(tb5, pi)
731
+
732
+ @mgr.add_pane(Wx::Button.new(self, label: 'Test Button'),
733
+ Wx::AUI::AuiPaneInfo.new.set_name('tb6').toolbar_pane.top.set_row(2).set_position(1)
734
+ .set_left_dockable(false).set_right_dockable(false))
832
735
  end
833
736
 
834
- @mgr.get_pane("tb1").hide
835
- @mgr.get_pane("tb6").hide
836
- @mgr.get_pane("test8").show.left.set_layer(0).set_row(0).set_position(0)
837
- @mgr.get_pane("test10").show.bottom.set_layer(0).set_row(0).set_position(0)
838
- @mgr.get_pane("notebook_content").show
839
- perspective_default = @mgr.save_perspective
737
+ def setup_panes
738
+ # add a bunch of panes
739
+ pi = Wx::AuiPaneInfo.new
740
+ pi.set_name('test1').set_caption('Pane Caption').top
741
+ @mgr.add_pane(create_size_report_ctrl, pi)
742
+
743
+ pi = Wx::AuiPaneInfo.new
744
+ pi.set_name('test2').set_caption('Client Size Reporter').bottom
745
+ pi.set_position(1).set_close_button.set_maximize_button
746
+ @mgr.add_pane(create_size_report_ctrl, pi)
747
+
748
+ pi = Wx::AuiPaneInfo.new
749
+ pi.set_name('test3').set_caption('Client Size Reporter').bottom
750
+ pi.set_close_button.set_maximize_button
751
+ @mgr.add_pane(create_size_report_ctrl, pi)
752
+
753
+ pi = Wx::AuiPaneInfo.new
754
+ pi.set_name('test4').set_caption('Pane Caption').left
755
+ @mgr.add_pane(create_size_report_ctrl, pi)
756
+
757
+ pi = Wx::AuiPaneInfo.new
758
+ pi.set_name('test5').set_caption('No Close Button').right
759
+ pi.set_close_button(false)
760
+ @mgr.add_pane(create_size_report_ctrl, pi)
761
+
762
+ pi = Wx::AuiPaneInfo.new
763
+ pi.set_name('test6').set_caption('Client Size Report').right
764
+ pi.set_row(1).set_close_button.set_maximize_button
765
+ @mgr.add_pane(create_size_report_ctrl, pi)
766
+
767
+ pi = Wx::AuiPaneInfo.new
768
+ pi.set_name('test7').set_caption('Client Size Report').left
769
+ pi.set_layer(1).set_close_button.set_maximize_button
770
+ @mgr.add_pane(create_size_report_ctrl, pi)
771
+
772
+ pi = Wx::AuiPaneInfo.new
773
+ pi.set_name('test8').set_caption('Tree Pane').left
774
+ pi.set_layer(1).set_position(1).set_close_button.set_maximize_button
775
+ @mgr.add_pane(create_tree_ctrl, pi)
776
+
777
+ pi = Wx::AuiPaneInfo.new
778
+ pi_size = Wx::Size.new(200, 100)
779
+ pi.set_name('test9').set_caption('Min Size 200x100').bottom
780
+ pi.set_best_size(pi_size).set_min_size(pi_size)
781
+ pi.set_layer(1).set_close_button.set_maximize_button
782
+ @mgr.add_pane(create_size_report_ctrl, pi)
783
+
784
+ wnd10 = create_text_ctrl("This pane will prompt the user before hiding.")
785
+ pi = Wx::AuiPaneInfo.new
786
+ pi.set_name('test10').set_caption('Text Pane with hide prompt')
787
+ pi.bottom.set_layer(1).set_position(1)
788
+ @mgr.add_pane(wnd10, pi)
789
+
790
+ pi = Wx::AuiPaneInfo.new
791
+ pi.set_name('test11').set_caption('Fixed Pane').bottom
792
+ pi.set_layer(1).set_position(2).fixed
793
+ @mgr.add_pane(create_size_report_ctrl, pi)
794
+
795
+ pi = Wx::AuiPaneInfo.new
796
+ pi.set_name('settings').set_caption('Dock Manager Settings')
797
+ pi.set_dockable(false).float.hide
798
+
799
+ @mgr.add_pane(SettingsPanel.new(self, self), pi)
800
+
801
+ # create some center panes
802
+
803
+ pi = Wx::AuiPaneInfo.new
804
+ pi.set_name('grid_content').center_pane.hide
805
+ @mgr.add_pane(create_grid, pi)
806
+
807
+ pi = Wx::AuiPaneInfo.new
808
+ pi.set_name('tree_content').center_pane.hide
809
+ @mgr.add_pane(create_tree_ctrl, pi)
810
+
811
+ pi = Wx::AuiPaneInfo.new
812
+ pi.set_name('sizereport_content').center_pane.hide
813
+ @mgr.add_pane(create_size_report_ctrl, pi)
814
+
815
+ pi = Wx::AuiPaneInfo.new
816
+ pi.set_name('text_content').center_pane.hide
817
+ @mgr.add_pane(create_text_ctrl, pi)
818
+
819
+ pi = Wx::AuiPaneInfo.new
820
+ pi.set_name('html_content').center_pane.hide
821
+ @mgr.add_pane(create_html_ctrl, pi)
822
+
823
+ pi = Wx::AuiPaneInfo.new
824
+ pi.set_name('notebook_content').center_pane.hide
825
+ @mgr.add_pane(create_notebook, pi)
826
+ end
840
827
 
841
- @perspectives << perspective_default
842
- @perspectives << perspective_all
843
- end
828
+ # make some default perspectives
829
+ def setup_perspectives
830
+ perspective_all = @mgr.save_perspective
844
831
 
845
- def get_dock_art
846
- @mgr.get_art_provider
847
- end
832
+ @mgr.each_pane do |pane|
833
+ pane.hide unless pane.is_toolbar
834
+ end
848
835
 
849
- def do_update
850
- @mgr.update
851
- end
836
+ @mgr.get_pane("tb1").hide
837
+ @mgr.get_pane("tb6").hide
838
+ @mgr.get_pane("test8").show.left.set_layer(0).set_row(0).set_position(0)
839
+ @mgr.get_pane("test10").show.bottom.set_layer(0).set_row(0).set_position(0)
840
+ @mgr.get_pane("notebook_content").show
841
+ perspective_default = @mgr.save_perspective
852
842
 
853
- def on_erase_background(event)
854
- event.skip
855
- end
843
+ @perspectives << perspective_default
844
+ @perspectives << perspective_all
845
+ end
856
846
 
857
- def on_size(event)
858
- event.skip
859
- end
847
+ def get_dock_art
848
+ @mgr.get_art_provider
849
+ end
860
850
 
861
- def on_settings
862
- float_pane = @mgr.get_pane("settings").float.show
863
- if float_pane.floating_position == Wx::DEFAULT_POSITION
864
- float_pane.floating_position = get_start_position
851
+ def do_update
852
+ @mgr.update
865
853
  end
866
- @mgr.update
867
- end
868
854
 
869
- def on_gradient(event)
870
- gradient = nil
871
- case event.get_id
872
- when ID::NoGradient
873
- gradient = Wx::AUI_GRADIENT_NONE
874
- when ID::VerticalGradient
875
- gradient = Wx::AUI_GRADIENT_VERTICAL
876
- when ID::HorizontalGradient
877
- gradient = Wx::AUI_GRADIENT_HORIZONTAL
855
+ def on_erase_background(event)
856
+ event.skip
878
857
  end
879
- return if not gradient
880
- @mgr.get_art_provider.set_metric(Wx::AUI_DOCKART_GRADIENT_TYPE,
881
- gradient)
882
- @mgr.update
883
- end
884
858
 
885
- def on_manager_flag(event)
886
- e_id = event.get_id
887
- if e_id == ID::TransparentHint or
888
- e_id == ID::VenetianBlindsHint or
889
- e_id == ID::RectangleHint or
890
- e_id == ID::NoHint
891
- flags = @mgr.get_flags
892
- flags &= ~Wx::AUI_MGR_TRANSPARENT_HINT
893
- flags &= ~Wx::AUI_MGR_VENETIAN_BLINDS_HINT
894
- flags &= ~Wx::AUI_MGR_RECTANGLE_HINT
895
- @mgr.set_flags(flags)
859
+ def on_size(event)
860
+ event.skip
896
861
  end
897
862
 
898
- flag = nil
899
- case e_id
900
- when ID::AllowFloating
901
- flag = Wx::AUI_MGR_ALLOW_FLOATING
902
- when ID::TransparentDrag
903
- flag = Wx::AUI_MGR_TRANSPARENT_DRAG
904
- when ID::HintFade
905
- flag = Wx::AUI_MGR_HINT_FADE
906
- when ID::NoVenetianFade
907
- flag = Wx::AUI_MGR_NO_VENETIAN_BLINDS_FADE
908
- when ID::AllowActivePane
909
- flag = Wx::AUI_MGR_ALLOW_ACTIVE_PANE
910
- when ID::TransparentHint
911
- flag = Wx::AUI_MGR_TRANSPARENT_HINT
912
- when ID::VenetianBlindsHint
913
- flag = Wx::AUI_MGR_VENETIAN_BLINDS_HINT
914
- when ID::RectangleHint
915
- flag = Wx::AUI_MGR_RECTANGLE_HINT
863
+ def on_settings
864
+ float_pane = @mgr.get_pane("settings").float.show
865
+ if float_pane.floating_position == Wx::DEFAULT_POSITION
866
+ float_pane.floating_position = get_start_position
867
+ end
868
+ @mgr.update
916
869
  end
917
870
 
918
- if flag
919
- @mgr.set_flags(@mgr.get_flags ^ flag)
871
+ def on_gradient(event)
872
+ gradient = nil
873
+ case event.get_id
874
+ when ID::NoGradient
875
+ gradient = Wx::AUI_GRADIENT_NONE
876
+ when ID::VerticalGradient
877
+ gradient = Wx::AUI_GRADIENT_VERTICAL
878
+ when ID::HorizontalGradient
879
+ gradient = Wx::AUI_GRADIENT_HORIZONTAL
880
+ end
881
+ return if not gradient
882
+ @mgr.get_art_provider.set_metric(Wx::AUI_DOCKART_GRADIENT_TYPE,
883
+ gradient)
884
+ @mgr.update
920
885
  end
921
886
 
922
- @mgr.update
923
- end
887
+ def on_manager_flag(event)
888
+ e_id = event.get_id
889
+ if e_id == ID::TransparentHint or
890
+ e_id == ID::VenetianBlindsHint or
891
+ e_id == ID::RectangleHint or
892
+ e_id == ID::NoHint
893
+ flags = @mgr.get_flags
894
+ flags &= ~Wx::AUI_MGR_TRANSPARENT_HINT
895
+ flags &= ~Wx::AUI_MGR_VENETIAN_BLINDS_HINT
896
+ flags &= ~Wx::AUI_MGR_RECTANGLE_HINT
897
+ @mgr.set_flags(flags)
898
+ end
924
899
 
925
- def on_notebook_flag(event)
926
- e_id = event.get_id
900
+ flag = nil
901
+ case e_id
902
+ when ID::AllowFloating
903
+ flag = Wx::AUI_MGR_ALLOW_FLOATING
904
+ when ID::TransparentDrag
905
+ flag = Wx::AUI_MGR_TRANSPARENT_DRAG
906
+ when ID::HintFade
907
+ flag = Wx::AUI_MGR_HINT_FADE
908
+ when ID::NoVenetianFade
909
+ flag = Wx::AUI_MGR_NO_VENETIAN_BLINDS_FADE
910
+ when ID::AllowActivePane
911
+ flag = Wx::AUI_MGR_ALLOW_ACTIVE_PANE
912
+ when ID::TransparentHint
913
+ flag = Wx::AUI_MGR_TRANSPARENT_HINT
914
+ when ID::VenetianBlindsHint
915
+ flag = Wx::AUI_MGR_VENETIAN_BLINDS_HINT
916
+ when ID::RectangleHint
917
+ flag = Wx::AUI_MGR_RECTANGLE_HINT
918
+ end
927
919
 
928
- if e_id == ID::NotebookNoCloseButton or
929
- e_id == ID::NotebookCloseButton or
930
- e_id == ID::NotebookCloseButtonAll or
931
- e_id == ID::NotebookCloseButtonActive
932
- @notebook_style &= ~(Wx::AUI_NB_CLOSE_BUTTON |
933
- Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB |
934
- Wx::AUI_NB_CLOSE_ON_ALL_TABS)
935
- end
920
+ if flag
921
+ @mgr.set_flags(@mgr.get_flags ^ flag)
922
+ end
936
923
 
937
- case e_id
938
- when ID::NotebookNoCloseButton
939
- # nothing
940
- when ID::NotebookCloseButton
941
- @notebook_style |= Wx::AUI_NB_CLOSE_BUTTON
942
- when ID::NotebookCloseButtonAll
943
- @notebook_style |= Wx::AUI_NB_CLOSE_ON_ALL_TABS
944
- when ID::NotebookCloseButtonActive
945
- @notebook_style |= Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB
924
+ @mgr.update
946
925
  end
947
926
 
948
- if e_id == ID::NotebookAllowTabMove
949
- @notebook_style ^= Wx::AUI_NB_TAB_MOVE
950
- end
927
+ def on_notebook_flag(event)
928
+ e_id = event.get_id
951
929
 
952
- if e_id == ID::NotebookAllowTabExternalMove
953
- @notebook_style ^= Wx::AUI_NB_TAB_EXTERNAL_MOVE
954
- elsif e_id == ID::NotebookAllowTabSplit
955
- @notebook_style ^= Wx::AUI_NB_TAB_SPLIT
956
- elsif e_id == ID::NotebookWindowList
957
- @notebook_style ^= Wx::AUI_NB_WINDOWLIST_BUTTON
958
- elsif e_id == ID::NotebookScrollButtons
959
- @notebook_style ^= Wx::AUI_NB_SCROLL_BUTTONS
960
- elsif e_id == ID::NotebookTabFixedWidth
961
- @notebook_style ^= Wx::AUI_NB_TAB_FIXED_WIDTH
962
- end
930
+ if e_id == ID::NotebookNoCloseButton or
931
+ e_id == ID::NotebookCloseButton or
932
+ e_id == ID::NotebookCloseButtonAll or
933
+ e_id == ID::NotebookCloseButtonActive
934
+ @notebook_style &= ~(Wx::AUI_NB_CLOSE_BUTTON |
935
+ Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB |
936
+ Wx::AUI_NB_CLOSE_ON_ALL_TABS)
937
+ end
938
+
939
+ case e_id
940
+ when ID::NotebookNoCloseButton
941
+ # nothing
942
+ when ID::NotebookCloseButton
943
+ @notebook_style |= Wx::AUI_NB_CLOSE_BUTTON
944
+ when ID::NotebookCloseButtonAll
945
+ @notebook_style |= Wx::AUI_NB_CLOSE_ON_ALL_TABS
946
+ when ID::NotebookCloseButtonActive
947
+ @notebook_style |= Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB
948
+ end
963
949
 
964
- @mgr.each_pane do |pane|
965
- maybe_nb = pane.window
966
- next unless maybe_nb.kind_of?(Wx::AuiNotebook)
967
- if e_id == ID::NotebookArtGloss
968
- maybe_nb.use_default_art
969
- @notebook_theme = 0
970
- elsif e_id == ID::NotebookArtSimple
971
- maybe_nb.use_simple_art
972
- @notebook_theme = 1
950
+ if e_id == ID::NotebookAllowTabMove
951
+ @notebook_style ^= Wx::AUI_NB_TAB_MOVE
973
952
  end
974
953
 
975
- maybe_nb.set_window_style_flag(@notebook_style)
976
- maybe_nb.refresh()
954
+ if e_id == ID::NotebookAllowTabExternalMove
955
+ @notebook_style ^= Wx::AUI_NB_TAB_EXTERNAL_MOVE
956
+ elsif e_id == ID::NotebookAllowTabSplit
957
+ @notebook_style ^= Wx::AUI_NB_TAB_SPLIT
958
+ elsif e_id == ID::NotebookWindowList
959
+ @notebook_style ^= Wx::AUI_NB_WINDOWLIST_BUTTON
960
+ elsif e_id == ID::NotebookScrollButtons
961
+ @notebook_style ^= Wx::AUI_NB_SCROLL_BUTTONS
962
+ elsif e_id == ID::NotebookTabFixedWidth
963
+ @notebook_style ^= Wx::AUI_NB_TAB_FIXED_WIDTH
964
+ end
965
+
966
+ @mgr.each_pane do |pane|
967
+ maybe_nb = pane.window
968
+ next unless maybe_nb.kind_of?(Wx::AuiNotebook)
969
+ if e_id == ID::NotebookArtGloss
970
+ maybe_nb.use_default_art
971
+ @notebook_theme = 0
972
+ elsif e_id == ID::NotebookArtSimple
973
+ maybe_nb.use_simple_art
974
+ @notebook_theme = 1
975
+ end
976
+
977
+ maybe_nb.set_window_style_flag(@notebook_style)
978
+ maybe_nb.refresh()
979
+ end
977
980
  end
978
- end
979
981
 
980
- def on_update_ui(event)
981
- flags = @mgr.get_flags
982
-
983
- case event.get_id
984
- when ID::NoGradient
985
- event.check(@mgr.get_art_provider.get_metric(Wx::AUI_DOCKART_GRADIENT_TYPE) == Wx::AUI_GRADIENT_NONE)
986
- when ID::VerticalGradient
987
- event.check(@mgr.get_art_provider.get_metric(Wx::AUI_DOCKART_GRADIENT_TYPE) == Wx::AUI_GRADIENT_VERTICAL)
988
- when ID::HorizontalGradient
989
- event.check(@mgr.get_art_provider.get_metric(Wx::AUI_DOCKART_GRADIENT_TYPE) == Wx::AUI_GRADIENT_HORIZONTAL)
990
- when ID::AllowFloating
991
- event.check((flags & Wx::AUI_MGR_ALLOW_FLOATING) != 0)
992
- when ID::TransparentDrag
993
- event.check((flags & Wx::AUI_MGR_TRANSPARENT_DRAG) != 0)
994
- when ID::TransparentHint
995
- event.check((flags & Wx::AUI_MGR_TRANSPARENT_HINT) != 0)
996
- when ID::VenetianBlindsHint
997
- event.check((flags & Wx::AUI_MGR_VENETIAN_BLINDS_HINT) != 0)
998
- when ID::RectangleHint
999
- event.check((flags & Wx::AUI_MGR_RECTANGLE_HINT) != 0)
1000
- when ID::NoHint
1001
- event.check((Wx::AUI_MGR_TRANSPARENT_HINT |
1002
- Wx::AUI_MGR_VENETIAN_BLINDS_HINT |
1003
- Wx::AUI_MGR_RECTANGLE_HINT) & flags == 0)
1004
- when ID::HintFade
1005
- event.check((flags & Wx::AUI_MGR_HINT_FADE) != 0)
1006
- when ID::NoVenetianFade
1007
- event.check((flags & Wx::AUI_MGR_NO_VENETIAN_BLINDS_FADE) != 0)
1008
- when ID::NotebookNoCloseButton
1009
- event.check((@notebook_style &
1010
- (Wx::AUI_NB_CLOSE_BUTTON |
1011
- Wx::AUI_NB_CLOSE_ON_ALL_TABS |
1012
- Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB)) != 0)
1013
- when ID::NotebookCloseButton
1014
- event.check((@notebook_style & Wx::AUI_NB_CLOSE_BUTTON) != 0)
1015
- when ID::NotebookCloseButtonAll
1016
- event.check((@notebook_style & Wx::AUI_NB_CLOSE_ON_ALL_TABS) != 0)
1017
- when ID::NotebookCloseButtonActive
1018
- event.check((@notebook_style & Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB) != 0)
1019
- when ID::NotebookAllowTabSplit
1020
- event.check((@notebook_style & Wx::AUI_NB_TAB_SPLIT) != 0)
1021
- when ID::NotebookAllowTabMove
1022
- event.check((@notebook_style & Wx::AUI_NB_TAB_MOVE) != 0)
1023
- when ID::NotebookAllowTabExternalMove
1024
- event.check((@notebook_style & Wx::AUI_NB_TAB_EXTERNAL_MOVE) != 0)
1025
- when ID::NotebookScrollButtons
1026
- event.check((@notebook_style & Wx::AUI_NB_SCROLL_BUTTONS) != 0)
1027
- when ID::NotebookWindowList
1028
- event.check((@notebook_style & Wx::AUI_NB_WINDOWLIST_BUTTON) != 0)
1029
- when ID::NotebookTabFixedWidth
1030
- event.check((@notebook_style & Wx::AUI_NB_TAB_FIXED_WIDTH) != 0)
1031
- when ID::NotebookArtGloss
1032
- event.check(@notebook_style == 0)
1033
- when ID::NotebookArtSimple
1034
- event.check(@notebook_style == 1)
982
+ def on_update_ui(event)
983
+ flags = @mgr.get_flags
984
+
985
+ case event.get_id
986
+ when ID::NoGradient
987
+ event.check(@mgr.get_art_provider.get_metric(Wx::AUI_DOCKART_GRADIENT_TYPE) == Wx::AUI_GRADIENT_NONE)
988
+ when ID::VerticalGradient
989
+ event.check(@mgr.get_art_provider.get_metric(Wx::AUI_DOCKART_GRADIENT_TYPE) == Wx::AUI_GRADIENT_VERTICAL)
990
+ when ID::HorizontalGradient
991
+ event.check(@mgr.get_art_provider.get_metric(Wx::AUI_DOCKART_GRADIENT_TYPE) == Wx::AUI_GRADIENT_HORIZONTAL)
992
+ when ID::AllowFloating
993
+ event.check((flags & Wx::AUI_MGR_ALLOW_FLOATING) != 0)
994
+ when ID::TransparentDrag
995
+ event.check((flags & Wx::AUI_MGR_TRANSPARENT_DRAG) != 0)
996
+ when ID::TransparentHint
997
+ event.check((flags & Wx::AUI_MGR_TRANSPARENT_HINT) != 0)
998
+ when ID::VenetianBlindsHint
999
+ event.check((flags & Wx::AUI_MGR_VENETIAN_BLINDS_HINT) != 0)
1000
+ when ID::RectangleHint
1001
+ event.check((flags & Wx::AUI_MGR_RECTANGLE_HINT) != 0)
1002
+ when ID::NoHint
1003
+ event.check((Wx::AUI_MGR_TRANSPARENT_HINT |
1004
+ Wx::AUI_MGR_VENETIAN_BLINDS_HINT |
1005
+ Wx::AUI_MGR_RECTANGLE_HINT) & flags == 0)
1006
+ when ID::HintFade
1007
+ event.check((flags & Wx::AUI_MGR_HINT_FADE) != 0)
1008
+ when ID::NoVenetianFade
1009
+ event.check((flags & Wx::AUI_MGR_NO_VENETIAN_BLINDS_FADE) != 0)
1010
+ when ID::NotebookNoCloseButton
1011
+ event.check((@notebook_style &
1012
+ (Wx::AUI_NB_CLOSE_BUTTON |
1013
+ Wx::AUI_NB_CLOSE_ON_ALL_TABS |
1014
+ Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB)) != 0)
1015
+ when ID::NotebookCloseButton
1016
+ event.check((@notebook_style & Wx::AUI_NB_CLOSE_BUTTON) != 0)
1017
+ when ID::NotebookCloseButtonAll
1018
+ event.check((@notebook_style & Wx::AUI_NB_CLOSE_ON_ALL_TABS) != 0)
1019
+ when ID::NotebookCloseButtonActive
1020
+ event.check((@notebook_style & Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB) != 0)
1021
+ when ID::NotebookAllowTabSplit
1022
+ event.check((@notebook_style & Wx::AUI_NB_TAB_SPLIT) != 0)
1023
+ when ID::NotebookAllowTabMove
1024
+ event.check((@notebook_style & Wx::AUI_NB_TAB_MOVE) != 0)
1025
+ when ID::NotebookAllowTabExternalMove
1026
+ event.check((@notebook_style & Wx::AUI_NB_TAB_EXTERNAL_MOVE) != 0)
1027
+ when ID::NotebookScrollButtons
1028
+ event.check((@notebook_style & Wx::AUI_NB_SCROLL_BUTTONS) != 0)
1029
+ when ID::NotebookWindowList
1030
+ event.check((@notebook_style & Wx::AUI_NB_WINDOWLIST_BUTTON) != 0)
1031
+ when ID::NotebookTabFixedWidth
1032
+ event.check((@notebook_style & Wx::AUI_NB_TAB_FIXED_WIDTH) != 0)
1033
+ when ID::NotebookArtGloss
1034
+ event.check(@notebook_style == 0)
1035
+ when ID::NotebookArtSimple
1036
+ event.check(@notebook_style == 1)
1037
+ end
1035
1038
  end
1036
- end
1037
1039
 
1038
- def on_pane_close(event)
1039
- if event.get_pane.name == "test10"
1040
- msg = "Are you sure you want to close/hide this pane?"
1041
- Wx.MessageDialog(self, msg, "Wx::AUI", Wx::YES_NO) do |dlg|
1042
- if dlg.show_modal != Wx::ID_YES
1043
- return event.veto
1040
+ def on_pane_close(event)
1041
+ if event.get_pane.name == "test10"
1042
+ msg = "Are you sure you want to close/hide this pane?"
1043
+ Wx.MessageDialog(self, msg, "Wx::AUI", Wx::YES_NO) do |dlg|
1044
+ if dlg.show_modal != Wx::ID_YES
1045
+ return event.veto
1046
+ end
1044
1047
  end
1045
1048
  end
1046
1049
  end
1047
- end
1048
1050
 
1049
- def on_create_perspective
1050
- msg = "Enter a name for the new perspective:"
1051
- Wx.TextEntryDialog(self, msg, "Wx::AUI Test") do |dlg|
1052
- dlg.set_value("Perspective %d" % [@perspectives.length + 1])
1053
- return unless dlg.show_modal == Wx::ID_OK
1054
- if @perspectives.length.zero?
1055
- @perspectives_menu.append_separator
1051
+ def on_create_perspective
1052
+ msg = "Enter a name for the new perspective:"
1053
+ Wx.TextEntryDialog(self, msg, "Wx::AUI Test") do |dlg|
1054
+ dlg.set_value("Perspective %d" % [@perspectives.length + 1])
1055
+ return unless dlg.show_modal == Wx::ID_OK
1056
+ if @perspectives.length.zero?
1057
+ @perspectives_menu.append_separator
1058
+ end
1059
+ @perspectives_menu.append(ID::FirstPerspective + @perspectives.length,
1060
+ dlg.get_value)
1061
+ @perspectives << @mgr.save_perspective
1056
1062
  end
1057
- @perspectives_menu.append(ID::FirstPerspective + @perspectives.length,
1058
- dlg.get_value)
1059
- @perspectives << @mgr.save_perspective
1060
1063
  end
1061
- end
1062
1064
 
1063
- def on_copy_perspective_code
1064
- Kernel.raise NotImplementedError
1065
- end
1065
+ def on_copy_perspective_code
1066
+ Kernel.raise NotImplementedError
1067
+ end
1066
1068
 
1067
- def on_restore_perspective(event)
1068
- perspective = @perspectives[event.get_id - ID::FirstPerspective]
1069
- @mgr.load_perspective(perspective)
1070
- end
1069
+ def on_restore_perspective(event)
1070
+ perspective = @perspectives[event.get_id - ID::FirstPerspective]
1071
+ @mgr.load_perspective(perspective)
1072
+ end
1071
1073
 
1072
- def on_notebook_page_close(event)
1073
- notebook = event.get_event_object
1074
- if notebook.get_page(event.get_selection).kind_of?(Wx::HtmlWindow)
1075
- msg = "Are you sure you want to close/hide this notebook page?"
1076
- Wx.MessageDialog(self, msg, "Wx::AUI", Wx::YES_NO) do |dlg|
1077
- if dlg.show_modal != Wx::ID_YES
1078
- event.veto
1079
- else
1080
- event.allow
1074
+ def on_notebook_page_close(event)
1075
+ notebook = event.get_event_object
1076
+ if notebook.get_page(event.get_selection).kind_of?(Wx::HtmlWindow)
1077
+ msg = "Are you sure you want to close/hide this notebook page?"
1078
+ Wx.MessageDialog(self, msg, "Wx::AUI", Wx::YES_NO) do |dlg|
1079
+ if dlg.show_modal != Wx::ID_YES
1080
+ event.veto
1081
+ else
1082
+ event.allow
1083
+ end
1081
1084
  end
1082
1085
  end
1083
1086
  end
1084
- end
1085
1087
 
1086
- def get_start_position
1087
- origin = client_to_screen(Wx::Point.new(0, 0))
1088
- return Wx::Point.new(origin.x + 20, origin.y + 20)
1089
- end
1088
+ def get_start_position
1089
+ origin = client_to_screen(Wx::Point.new(0, 0))
1090
+ return Wx::Point.new(origin.x + 20, origin.y + 20)
1091
+ end
1090
1092
 
1091
- def on_create_tree
1092
- pi = Wx::AuiPaneInfo.new
1093
- pi.set_caption("Tree Control").float
1094
- pi.set_floating_position(get_start_position)
1095
- pi.set_floating_size(Wx::Size.new(150, 300))
1096
- @mgr.add_pane(create_tree_ctrl, pi)
1097
- @mgr.update
1098
- end
1093
+ def on_create_tree
1094
+ pi = Wx::AuiPaneInfo.new
1095
+ pi.set_caption("Tree Control").float
1096
+ pi.set_floating_position(get_start_position)
1097
+ pi.set_floating_size(Wx::Size.new(150, 300))
1098
+ @mgr.add_pane(create_tree_ctrl, pi)
1099
+ @mgr.update
1100
+ end
1099
1101
 
1100
- def on_create_grid
1101
- pi = Wx::AuiPaneInfo.new
1102
- pi.set_caption("Grid").float
1103
- pi.set_floating_position(get_start_position)
1104
- pi.set_floating_size(Wx::Size.new(300, 200))
1105
- @mgr.add_pane(create_grid, pi)
1106
- @mgr.update
1107
- end
1102
+ def on_create_grid
1103
+ pi = Wx::AuiPaneInfo.new
1104
+ pi.set_caption("Grid").float
1105
+ pi.set_floating_position(get_start_position)
1106
+ pi.set_floating_size(Wx::Size.new(300, 200))
1107
+ @mgr.add_pane(create_grid, pi)
1108
+ @mgr.update
1109
+ end
1108
1110
 
1109
- def on_create_html
1110
- pi = Wx::AuiPaneInfo.new
1111
- pi.set_caption("HTML Control").float
1112
- pi.set_floating_position(get_start_position)
1113
- pi.set_floating_size(Wx::Size.new(300, 200))
1114
- @mgr.add_pane(create_html_ctrl, pi)
1115
- @mgr.update
1116
- end
1111
+ def on_create_html
1112
+ pi = Wx::AuiPaneInfo.new
1113
+ pi.set_caption("HTML Control").float
1114
+ pi.set_floating_position(get_start_position)
1115
+ pi.set_floating_size(Wx::Size.new(300, 200))
1116
+ @mgr.add_pane(create_html_ctrl, pi)
1117
+ @mgr.update
1118
+ end
1117
1119
 
1118
- def on_create_notebook
1119
- pi = Wx::AuiPaneInfo.new
1120
- pi.set_caption("Notebook").float
1121
- pi.set_floating_position(get_start_position)
1122
- pi.set_close_button.set_maximize_button
1123
- @mgr.add_pane(create_notebook, pi)
1124
- @mgr.update
1125
- end
1120
+ def on_create_notebook
1121
+ pi = Wx::AuiPaneInfo.new
1122
+ pi.set_caption("Notebook").float
1123
+ pi.set_floating_position(get_start_position)
1124
+ pi.set_close_button.set_maximize_button
1125
+ @mgr.add_pane(create_notebook, pi)
1126
+ @mgr.update
1127
+ end
1126
1128
 
1127
- def on_create_text
1128
- pi = Wx::AuiPaneInfo.new
1129
- pi.set_caption("Text Control").float
1130
- pi.set_floating_position(get_start_position)
1131
- @mgr.add_pane(create_text_ctrl, pi)
1132
- @mgr.update
1133
- end
1129
+ def on_create_text
1130
+ pi = Wx::AuiPaneInfo.new
1131
+ pi.set_caption("Text Control").float
1132
+ pi.set_floating_position(get_start_position)
1133
+ @mgr.add_pane(create_text_ctrl, pi)
1134
+ @mgr.update
1135
+ end
1134
1136
 
1135
- def on_create_size_report
1136
- pi = Wx::AuiPaneInfo.new
1137
- pi.set_caption("Client Size Reporter").float
1138
- pi.set_floating_position(get_start_position)
1139
- pi.set_close_button.set_maximize_button
1140
- @mgr.add_pane(create_size_report_ctrl, pi)
1141
- @mgr.update
1142
- end
1137
+ def on_create_size_report
1138
+ pi = Wx::AuiPaneInfo.new
1139
+ pi.set_caption("Client Size Reporter").float
1140
+ pi.set_floating_position(get_start_position)
1141
+ pi.set_close_button.set_maximize_button
1142
+ @mgr.add_pane(create_size_report_ctrl, pi)
1143
+ @mgr.update
1144
+ end
1143
1145
 
1144
- def on_change_content_pane(event)
1145
- e_id = event.get_id
1146
- @mgr.get_pane("grID::content").show(e_id == ID::GridContent)
1147
- @mgr.get_pane("text_content").show(e_id == ID::TextContent)
1148
- @mgr.get_pane("tree_content").show(e_id == ID::TreeContent)
1149
- @mgr.get_pane("sizereport_content").show(e_id == ID::SizeReportContent)
1150
- @mgr.get_pane("html_content").show(e_id == ID::HTMLContent)
1151
- @mgr.get_pane("notebook_content").show(e_id == ID::NotebookContent)
1152
- @mgr.update
1153
- end
1146
+ def on_change_content_pane(event)
1147
+ e_id = event.get_id
1148
+ @mgr.get_pane("grID::content").show(e_id == ID::GridContent)
1149
+ @mgr.get_pane("text_content").show(e_id == ID::TextContent)
1150
+ @mgr.get_pane("tree_content").show(e_id == ID::TreeContent)
1151
+ @mgr.get_pane("sizereport_content").show(e_id == ID::SizeReportContent)
1152
+ @mgr.get_pane("html_content").show(e_id == ID::HTMLContent)
1153
+ @mgr.get_pane("notebook_content").show(e_id == ID::NotebookContent)
1154
+ @mgr.update
1155
+ end
1154
1156
 
1155
- def on_drop_down_toolbar_item(evt)
1156
- if evt.is_drop_down_clicked
1157
- tb = evt.get_event_object
1157
+ def on_drop_down_toolbar_item(evt)
1158
+ if evt.is_drop_down_clicked
1159
+ tb = evt.get_event_object
1158
1160
 
1159
- tb.set_tool_sticky(evt.id, true)
1161
+ tb.set_tool_sticky(evt.id, true)
1160
1162
 
1161
- # create the popup menu
1162
- menuPopup = Wx::Menu.new
1163
+ # create the popup menu
1164
+ menuPopup = Wx::Menu.new
1163
1165
 
1164
- bmp = Wx::ArtProvider.get_bitmap_bundle(Wx::ART_QUESTION, Wx::ART_OTHER, from_dip(Wx::Size.new(16,16)))
1166
+ bmp = Wx::ArtProvider.get_bitmap_bundle(Wx::ART_QUESTION, Wx::ART_OTHER, from_dip(Wx::Size.new(16,16)))
1165
1167
 
1166
- m1 = Wx::MenuItem.new(menuPopup, 10001, 'Drop Down Item 1')
1167
- m1.set_bitmap(bmp)
1168
- menuPopup.append(m1)
1168
+ m1 = Wx::MenuItem.new(menuPopup, 10001, 'Drop Down Item 1')
1169
+ m1.set_bitmap(bmp)
1170
+ menuPopup.append(m1)
1169
1171
 
1170
- m2 = Wx::MenuItem.new(menuPopup, 10002, 'Drop Down Item 2')
1171
- m2.set_bitmap(bmp)
1172
- menuPopup.append(m2)
1172
+ m2 = Wx::MenuItem.new(menuPopup, 10002, 'Drop Down Item 2')
1173
+ m2.set_bitmap(bmp)
1174
+ menuPopup.append(m2)
1173
1175
 
1174
- m3 = Wx::MenuItem.new(menuPopup, 10003, 'Drop Down Item 3')
1175
- m3.set_bitmap(bmp)
1176
- menuPopup.append(m3)
1176
+ m3 = Wx::MenuItem.new(menuPopup, 10003, 'Drop Down Item 3')
1177
+ m3.set_bitmap(bmp)
1178
+ menuPopup.append(m3)
1177
1179
 
1178
- m4 = Wx::MenuItem.new(menuPopup, 10004, 'Drop Down Item 4')
1179
- m4.set_bitmap(bmp)
1180
- menuPopup.append(m4)
1180
+ m4 = Wx::MenuItem.new(menuPopup, 10004, 'Drop Down Item 4')
1181
+ m4.set_bitmap(bmp)
1182
+ menuPopup.append(m4)
1181
1183
 
1182
- # line up our menu with the button
1183
- rect = tb.get_tool_rect(evt.id)
1184
- pt = tb.client_to_screen(rect.bottom_left)
1185
- pt = screen_to_client(pt)
1184
+ # line up our menu with the button
1185
+ rect = tb.get_tool_rect(evt.id)
1186
+ pt = tb.client_to_screen(rect.bottom_left)
1187
+ pt = screen_to_client(pt)
1186
1188
 
1187
- popup_menu(menuPopup, pt)
1189
+ popup_menu(menuPopup, pt)
1188
1190
 
1189
- # make sure the button is "un-stuck"
1190
- tb.set_tool_sticky(evt.id, false)
1191
+ # make sure the button is "un-stuck"
1192
+ tb.set_tool_sticky(evt.id, false)
1193
+ end
1191
1194
  end
1192
- end
1193
1195
 
1194
- def on_exit
1195
- close(true)
1196
- end
1196
+ def on_exit
1197
+ close(true)
1198
+ end
1199
+
1200
+ def on_about
1201
+ 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"
1202
+ Wx.MessageDialog(self, msg, "Wx::AUI", Wx::OK) do |dlg|
1203
+ dlg.show_modal
1204
+ end
1205
+ end
1197
1206
 
1198
- def on_about
1199
- 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"
1200
- Wx.MessageDialog(self, msg, "Wx::AUI", Wx::OK) do |dlg|
1201
- dlg.show_modal
1207
+ def create_text_ctrl(text = "")
1208
+ if text.empty?
1209
+ text = "This is a test text box"
1210
+ end
1211
+ Wx::TextCtrl.new(self, Wx::ID_ANY, text,
1212
+ Wx::Point.new(0, 0), Wx::Size.new(150, 90),
1213
+ Wx::NO_BORDER | Wx::TE_MULTILINE)
1202
1214
  end
1203
- end
1204
1215
 
1205
- def create_text_ctrl(text = "")
1206
- if text.empty?
1207
- text = "This is a test text box"
1216
+ def create_grid
1217
+ grid = Wx::Grid.new(self, Wx::ID_ANY,
1218
+ Wx::Point.new(0, 0),
1219
+ Wx::Size.new(150, 250),
1220
+ Wx::NO_BORDER | Wx::WANTS_CHARS)
1221
+ grid.create_grid(50, 20)
1222
+ grid
1208
1223
  end
1209
- Wx::TextCtrl.new(self, Wx::ID_ANY, text,
1210
- Wx::Point.new(0, 0), Wx::Size.new(150, 90),
1211
- Wx::NO_BORDER | Wx::TE_MULTILINE)
1212
- end
1213
1224
 
1214
- def create_grid
1215
- grid = Wx::Grid.new(self, Wx::ID_ANY,
1216
- Wx::Point.new(0, 0),
1217
- Wx::Size.new(150, 250),
1218
- Wx::NO_BORDER | Wx::WANTS_CHARS)
1219
- grid.create_grid(50, 20)
1220
- grid
1221
- end
1225
+ def create_tree_ctrl
1226
+ tree = Wx::TreeCtrl.new(self, Wx::ID_ANY,
1227
+ Wx::Point.new(0, 0), Wx::Size.new(160, 250),
1228
+ Wx::TR_DEFAULT_STYLE | Wx::NO_BORDER)
1229
+
1230
+ img_list = Wx::ImageList.new(16, 16, true, 2)
1231
+ img_list.add(Wx::ArtProvider::get_bitmap(Wx::ART_FOLDER,
1232
+ Wx::ART_OTHER,
1233
+ Wx::Size.new(16, 16)))
1234
+ img_list.add(Wx::ArtProvider::get_bitmap(Wx::ART_NORMAL_FILE,
1235
+ Wx::ART_OTHER,
1236
+ Wx::Size.new(16, 16)))
1237
+ tree.set_image_list(img_list)
1238
+ root = tree.add_root("Wx::AUI Project", 0)
1239
+ items = []
1240
+ 1.upto(5) { |i| items << tree.append_item(root, "Item #{i}", 0) }
1241
+
1242
+ items.each do |id|
1243
+ 1.upto(5) { |i| tree.append_item(id, "Subitem #{i}", 0) }
1244
+ end
1222
1245
 
1223
- def create_tree_ctrl
1224
- tree = Wx::TreeCtrl.new(self, Wx::ID_ANY,
1225
- Wx::Point.new(0, 0), Wx::Size.new(160, 250),
1226
- Wx::TR_DEFAULT_STYLE | Wx::NO_BORDER)
1246
+ tree.expand(root)
1247
+ tree
1248
+ end
1227
1249
 
1228
- img_list = Wx::ImageList.new(16, 16, true, 2)
1229
- img_list.add(Wx::ArtProvider::get_bitmap(Wx::ART_FOLDER,
1230
- Wx::ART_OTHER,
1231
- Wx::Size.new(16, 16)))
1232
- img_list.add(Wx::ArtProvider::get_bitmap(Wx::ART_NORMAL_FILE,
1233
- Wx::ART_OTHER,
1234
- Wx::Size.new(16, 16)))
1235
- tree.set_image_list(img_list)
1236
- root = tree.add_root("Wx::AUI Project", 0)
1237
- items = []
1238
- 1.upto(5) { |i| items << tree.append_item(root, "Item #{i}", 0) }
1239
-
1240
- items.each do |id|
1241
- 1.upto(5) { |i| tree.append_item(id, "Subitem #{i}", 0) }
1250
+ def create_size_report_ctrl(width = 80, height = 80)
1251
+ SizeReportCtrl.new(self, Wx::ID_ANY,
1252
+ Wx::DEFAULT_POSITION,
1253
+ Wx::Size.new(width, height), @mgr)
1242
1254
  end
1243
1255
 
1244
- tree.expand(root)
1245
- tree
1246
- end
1256
+ def create_html_ctrl(parent = nil)
1257
+ if not parent
1258
+ parent = self
1259
+ end
1260
+ ctrl = Wx::HtmlWindow.new(parent, Wx::ID_ANY,
1261
+ Wx::DEFAULT_POSITION,
1262
+ Wx::Size.new(400, 300))
1263
+ ctrl.set_page <<~__HTML
1264
+ <html>
1265
+ <head><title>Test page</title></head>
1266
+ <body background="pic.png" bgcolor="#ffffff">
1267
+
1268
+ <B>wxString</B> <B>FindFirst</B>(was there a space between 'g' and 'F'?)<P>
1269
+
1270
+ <font size="+2">Unbre</font>akable word<P>
1271
+
1272
+ <pre width="50%">
1273
+ &lt;pre&gt; text, 50% wide
1274
+ </pre>
1275
+
1276
+
1277
+ <script>
1278
+ some meaningless script < is this > </is> FIXME: write real jscript here
1279
+ </script>
1280
+ text after script <b>in bold</b>
1281
+
1282
+ </body>
1283
+ </html>
1284
+ __HTML
1285
+ ctrl
1286
+ end
1247
1287
 
1248
- def create_size_report_ctrl(width = 80, height = 80)
1249
- SizeReportCtrl.new(self, Wx::ID_ANY,
1250
- Wx::DEFAULT_POSITION,
1251
- Wx::Size.new(width, height), @mgr)
1252
- end
1288
+ def create_notebook
1289
+ # create the notebook off-window to avoid flicker
1290
+ client_size = get_client_size
1291
+
1292
+ ctrl = Wx::AuiNotebook.new(self, Wx::ID_ANY,
1293
+ Wx::Point.new(client_size.width, client_size.height),
1294
+ Wx::Size.new(430, 200),
1295
+ @notebook_style)
1253
1296
 
1254
- def create_html_ctrl(parent = nil)
1255
- if not parent
1256
- parent = self
1297
+ page_bmp = Wx::ArtProvider::get_bitmap(Wx::ART_NORMAL_FILE,
1298
+ Wx::ART_OTHER,
1299
+ Wx::Size.new(16, 16))
1300
+
1301
+ ctrl.add_page(create_html_ctrl(ctrl),
1302
+ "Welcome to Wx::AUI", false, page_bmp)
1303
+
1304
+ panel = Wx::Panel.new(ctrl, Wx::ID_ANY)
1305
+ flex = Wx::FlexGridSizer.new(2)
1306
+ flex.add_growable_row(0)
1307
+ flex.add_growable_row(3)
1308
+ flex.add_growable_row(1)
1309
+
1310
+ flex.add(5, 5)
1311
+ flex.add(5, 5)
1312
+ flex.add(Wx::StaticText.new(panel, -1, "Wx::TextCtrl:"),
1313
+ 0, Wx::ALL | Wx::ALIGN_CENTRE, 5)
1314
+ flex.add(Wx::TextCtrl.new(panel, -1, "",
1315
+ Wx::DEFAULT_POSITION, Wx::Size.new(100, -1)),
1316
+ 1, Wx::ALL | Wx::ALIGN_CENTRE, 5)
1317
+
1318
+ flex.add(Wx::StaticText.new(panel, -1, "Wx::SpinCtrl:"),
1319
+ 0, Wx::ALL | Wx::ALIGN_CENTRE, 5)
1320
+ flex.add(Wx::SpinCtrl.new(panel, -1, "5",
1321
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1322
+ Wx::SP_ARROW_KEYS, 5, 50, 5),
1323
+ 1, Wx::ALL | Wx::ALIGN_CENTRE, 5)
1324
+
1325
+ flex.add(5, 5)
1326
+ flex.add(5, 5)
1327
+ panel.set_sizer(flex)
1328
+ ctrl.add_page(panel, "wxPanel", false, page_bmp)
1329
+
1330
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some text",
1331
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1332
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1333
+ "wxTextCtrl 1", false, page_bmp)
1334
+
1335
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1336
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1337
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1338
+ "wxTextCtrl 2")
1339
+
1340
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1341
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1342
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1343
+ "wxTextCtrl 3")
1344
+
1345
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1346
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1347
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1348
+ "wxTextCtrl 4")
1349
+
1350
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1351
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1352
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1353
+ "wxTextCtrl 5")
1354
+
1355
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1356
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1357
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1358
+ "wxTextCtrl 6")
1359
+
1360
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1361
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1362
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1363
+ "wxTextCtrl 7 (longer title)")
1364
+
1365
+ ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1366
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1367
+ Wx::TE_MULTILINE | Wx::NO_BORDER),
1368
+ "wxTextCtrl 8")
1369
+ return ctrl
1257
1370
  end
1258
- ctrl = Wx::HtmlWindow.new(parent, Wx::ID_ANY,
1259
- Wx::DEFAULT_POSITION,
1260
- Wx::Size.new(400, 300))
1261
- ctrl.set_page <<~__HTML
1262
- <html>
1263
- <head><title>Test page</title></head>
1264
- <body background="pic.png" bgcolor="#ffffff">
1265
-
1266
- <B>wxString</B> <B>FindFirst</B>(was there a space between 'g' and 'F'?)<P>
1267
-
1268
- <font size="+2">Unbre</font>akable word<P>
1269
-
1270
- <pre width="50%">
1271
- &lt;pre&gt; text, 50% wide
1272
- </pre>
1273
-
1274
-
1275
- <script>
1276
- some meaningless script < is this > </is> FIXME: write real jscript here
1277
- </script>
1278
- text after script <b>in bold</b>
1279
-
1280
- </body>
1281
- </html>
1282
- __HTML
1283
- ctrl
1284
1371
  end
1285
1372
 
1286
- def create_notebook
1287
- # create the notebook off-window to avoid flicker
1288
- client_size = get_client_size
1289
-
1290
- ctrl = Wx::AuiNotebook.new(self, Wx::ID_ANY,
1291
- Wx::Point.new(client_size.width, client_size.height),
1292
- Wx::Size.new(430, 200),
1293
- @notebook_style)
1294
-
1295
- page_bmp = Wx::ArtProvider::get_bitmap(Wx::ART_NORMAL_FILE,
1296
- Wx::ART_OTHER,
1297
- Wx::Size.new(16, 16))
1298
-
1299
- ctrl.add_page(create_html_ctrl(ctrl),
1300
- "Welcome to Wx::AUI", false, page_bmp)
1301
-
1302
- panel = Wx::Panel.new(ctrl, Wx::ID_ANY)
1303
- flex = Wx::FlexGridSizer.new(2)
1304
- flex.add_growable_row(0)
1305
- flex.add_growable_row(3)
1306
- flex.add_growable_row(1)
1307
-
1308
- flex.add(5, 5)
1309
- flex.add(5, 5)
1310
- flex.add(Wx::StaticText.new(panel, -1, "Wx::TextCtrl:"),
1311
- 0, Wx::ALL | Wx::ALIGN_CENTRE, 5)
1312
- flex.add(Wx::TextCtrl.new(panel, -1, "",
1313
- Wx::DEFAULT_POSITION, Wx::Size.new(100, -1)),
1314
- 1, Wx::ALL | Wx::ALIGN_CENTRE, 5)
1315
-
1316
- flex.add(Wx::StaticText.new(panel, -1, "Wx::SpinCtrl:"),
1317
- 0, Wx::ALL | Wx::ALIGN_CENTRE, 5)
1318
- flex.add(Wx::SpinCtrl.new(panel, -1, "5",
1319
- Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1320
- Wx::SP_ARROW_KEYS, 5, 50, 5),
1321
- 1, Wx::ALL | Wx::ALIGN_CENTRE, 5)
1322
-
1323
- flex.add(5, 5)
1324
- flex.add(5, 5)
1325
- panel.set_sizer(flex)
1326
- ctrl.add_page(panel, "wxPanel", false, page_bmp)
1327
-
1328
- ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some text",
1329
- Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1330
- Wx::TE_MULTILINE | Wx::NO_BORDER),
1331
- "wxTextCtrl 1", false, page_bmp)
1332
-
1333
- ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1334
- Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1335
- Wx::TE_MULTILINE | Wx::NO_BORDER),
1336
- "wxTextCtrl 2")
1337
-
1338
- ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1339
- Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1340
- Wx::TE_MULTILINE | Wx::NO_BORDER),
1341
- "wxTextCtrl 3")
1342
-
1343
- ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1344
- Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1345
- Wx::TE_MULTILINE | Wx::NO_BORDER),
1346
- "wxTextCtrl 4")
1347
-
1348
- ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1349
- Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1350
- Wx::TE_MULTILINE | Wx::NO_BORDER),
1351
- "wxTextCtrl 5")
1352
-
1353
- ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1354
- Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1355
- Wx::TE_MULTILINE | Wx::NO_BORDER),
1356
- "wxTextCtrl 6")
1357
-
1358
- ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1359
- Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1360
- Wx::TE_MULTILINE | Wx::NO_BORDER),
1361
- "wxTextCtrl 7 (longer title)")
1362
-
1363
- ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
1364
- Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
1365
- Wx::TE_MULTILINE | Wx::NO_BORDER),
1366
- "wxTextCtrl 8")
1367
- return ctrl
1368
- end
1369
1373
  end
1370
1374
 
1371
1375
  module AUISample
@@ -1379,7 +1383,7 @@ module AUISample
1379
1383
  end
1380
1384
 
1381
1385
  def self.activate
1382
- frame = AuiFrame.new(nil, Wx::ID_ANY, "Wx::AUI Sample Application",
1386
+ frame = AuiTest::AuiFrame.new(nil, Wx::ID_ANY, "Wx::AUI Sample Application",
1383
1387
  Wx::DEFAULT_POSITION,
1384
1388
  Wx::Size.new(800, 600))
1385
1389
  frame.show