wxruby3 0.9.1-x64-mingw-ucrt → 0.9.3-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
Files changed (740) 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/wxbase32u_gcc_custom.dll +0 -0
  6. data/ext/wxbase32u_net_gcc_custom.dll +0 -0
  7. data/ext/wxbase32u_xml_gcc_custom.dll +0 -0
  8. data/ext/wxmsw32u_aui_gcc_custom.dll +0 -0
  9. data/ext/wxmsw32u_core_gcc_custom.dll +0 -0
  10. data/ext/wxmsw32u_gl_gcc_custom.dll +0 -0
  11. data/ext/wxmsw32u_html_gcc_custom.dll +0 -0
  12. data/ext/wxmsw32u_media_gcc_custom.dll +0 -0
  13. data/ext/wxmsw32u_propgrid_gcc_custom.dll +0 -0
  14. data/ext/wxmsw32u_qa_gcc_custom.dll +0 -0
  15. data/ext/wxmsw32u_ribbon_gcc_custom.dll +0 -0
  16. data/ext/wxmsw32u_richtext_gcc_custom.dll +0 -0
  17. data/ext/wxmsw32u_stc_gcc_custom.dll +0 -0
  18. data/ext/wxmsw32u_webview_gcc_custom.dll +0 -0
  19. data/ext/wxmsw32u_xrc_gcc_custom.dll +0 -0
  20. data/lib/wx/aui/aui_tab_ctrl.rb +18 -0
  21. data/lib/wx/aui/auinotebook.rb +6 -2
  22. data/lib/wx/aui/require.rb +1 -0
  23. data/lib/wx/core/app.rb +2 -2
  24. data/lib/wx/core/bitmap_combobox.rb +17 -21
  25. data/lib/wx/core/collapsible_pane.rb +1 -1
  26. data/lib/wx/core/combobox.rb +13 -3
  27. data/lib/wx/core/controlwithitems.rb +40 -128
  28. data/lib/wx/core/enum.rb +17 -1
  29. data/lib/wx/core/event.rb +6 -1
  30. data/lib/wx/core/events/evt_list.rb +5 -4
  31. data/lib/wx/core/evthandler.rb +8 -2
  32. data/lib/wx/core/generic_validator.rb +312 -0
  33. data/lib/wx/core/listbox.rb +2 -2
  34. data/lib/wx/core/log.rb +1 -1
  35. data/lib/wx/core/menu.rb +10 -0
  36. data/lib/wx/core/notebook.rb +6 -2
  37. data/lib/wx/core/owner_drawn_combobox.rb +45 -0
  38. data/lib/wx/core/size.rb +4 -0
  39. data/lib/wx/core/sizer.rb +12 -2
  40. data/lib/wx/core/standard_paths.rb +22 -0
  41. data/lib/wx/core/task_bar_button.rb +19 -0
  42. data/lib/wx/core/text_entry.rb +4 -1
  43. data/lib/wx/core/textctrl.rb +11 -1
  44. data/lib/wx/core/{treectrl.rb → tree_ctrl.rb} +31 -12
  45. data/lib/wx/core/validator.rb +70 -5
  46. data/lib/wx/core/window.rb +13 -7
  47. data/lib/wx/doc/app.rb +48 -38
  48. data/lib/wx/doc/art_locator.rb +48 -43
  49. data/lib/wx/doc/aui/auimanager.rb +16 -8
  50. data/lib/wx/doc/aui/auinotebook.rb +20 -5
  51. data/lib/wx/doc/clipboard.rb +11 -7
  52. data/lib/wx/doc/colour_dialog.rb +14 -10
  53. data/lib/wx/doc/comboctrl.rb +18 -0
  54. data/lib/wx/doc/controlwithitems.rb +34 -8
  55. data/lib/wx/doc/data_object.rb +2 -2
  56. data/lib/wx/doc/date_picker_ctrl.rb +23 -0
  57. data/lib/wx/doc/editable_listbox.rb +44 -0
  58. data/lib/wx/doc/enum.rb +15 -0
  59. data/lib/wx/doc/event.rb +12 -0
  60. data/lib/wx/doc/evthandler.rb +113 -108
  61. data/lib/wx/doc/extra/12_client_data.md +89 -0
  62. data/lib/wx/doc/extra/13_validators.md +139 -0
  63. data/lib/wx/doc/font.rb +1 -0
  64. data/lib/wx/doc/gc_dc.rb +6 -1
  65. data/lib/wx/doc/gdi_common.rb +4 -0
  66. data/lib/wx/doc/gen/about_dialog_info.rb +26 -2
  67. data/lib/wx/doc/gen/accelerator.rb +19 -4
  68. data/lib/wx/doc/gen/accessible.rb +48 -47
  69. data/lib/wx/doc/gen/activity_indicator.rb +10 -4
  70. data/lib/wx/doc/gen/animation.rb +19 -3
  71. data/lib/wx/doc/gen/animation_ctrl.rb +16 -7
  72. data/lib/wx/doc/gen/any_button.rb +22 -1
  73. data/lib/wx/doc/gen/app.rb +41 -5
  74. data/lib/wx/doc/gen/app_traits.rb +65 -15
  75. data/lib/wx/doc/gen/art_provider.rb +33 -7
  76. data/lib/wx/doc/gen/aui/aui_dock_art.rb +18 -3
  77. data/lib/wx/doc/gen/aui/aui_floating_frame.rb +2 -0
  78. data/lib/wx/doc/gen/aui/aui_manager.rb +35 -8
  79. data/lib/wx/doc/gen/aui/aui_manager_event.rb +11 -4
  80. data/lib/wx/doc/gen/aui/aui_mdi_child_frame.rb +4 -0
  81. data/lib/wx/doc/gen/aui/aui_mdi_client_window.rb +3 -0
  82. data/lib/wx/doc/gen/aui/aui_mdi_parent_frame.rb +8 -1
  83. data/lib/wx/doc/gen/aui/aui_notebook.rb +31 -7
  84. data/lib/wx/doc/gen/aui/aui_notebook_event.rb +5 -4
  85. data/lib/wx/doc/gen/aui/aui_pane_info.rb +38 -2
  86. data/lib/wx/doc/gen/aui/aui_tab_art.rb +9 -3
  87. data/lib/wx/doc/gen/aui/aui_tab_ctrl.rb +2 -1
  88. data/lib/wx/doc/gen/aui/aui_tool_bar.rb +20 -6
  89. data/lib/wx/doc/gen/aui/aui_tool_bar_art.rb +4 -2
  90. data/lib/wx/doc/gen/aui/aui_tool_bar_event.rb +5 -7
  91. data/lib/wx/doc/gen/aui/aui_tool_bar_item.rb +5 -1
  92. data/lib/wx/doc/gen/aui/event_list.rb +164 -160
  93. data/lib/wx/doc/gen/banner_window.rb +8 -1
  94. data/lib/wx/doc/gen/bitmap.rb +94 -16
  95. data/lib/wx/doc/gen/bitmap_button.rb +16 -8
  96. data/lib/wx/doc/gen/bitmap_combo_box.rb +20 -10
  97. data/lib/wx/doc/gen/book_ctrl_base.rb +31 -4
  98. data/lib/wx/doc/gen/book_ctrl_event.rb +9 -3
  99. data/lib/wx/doc/gen/box_sizer.rb +5 -1
  100. data/lib/wx/doc/gen/brush.rb +20 -2
  101. data/lib/wx/doc/gen/busy_info.rb +10 -2
  102. data/lib/wx/doc/gen/button.rb +31 -11
  103. data/lib/wx/doc/gen/calculate_layout_event.rb +5 -3
  104. data/lib/wx/doc/gen/calendar_ctrl.rb +38 -13
  105. data/lib/wx/doc/gen/calendar_date_attr.rb +2 -1
  106. data/lib/wx/doc/gen/calendar_event.rb +5 -2
  107. data/lib/wx/doc/gen/caret.rb +3 -1
  108. data/lib/wx/doc/gen/check_box.rb +17 -7
  109. data/lib/wx/doc/gen/check_list_box.rb +8 -6
  110. data/lib/wx/doc/gen/choice.rb +28 -9
  111. data/lib/wx/doc/gen/choicebook.rb +7 -7
  112. data/lib/wx/doc/gen/client_dc.rb +6 -2
  113. data/lib/wx/doc/gen/clipboard.rb +16 -3
  114. data/lib/wx/doc/gen/collapsible_pane.rb +9 -7
  115. data/lib/wx/doc/gen/collapsible_pane_event.rb +3 -3
  116. data/lib/wx/doc/gen/colour.rb +28 -4
  117. data/lib/wx/doc/gen/colour_dialog.rb +15 -7
  118. data/lib/wx/doc/gen/colour_picker_ctrl.rb +13 -10
  119. data/lib/wx/doc/gen/colour_picker_event.rb +5 -5
  120. data/lib/wx/doc/gen/combo_box.rb +36 -14
  121. data/lib/wx/doc/gen/combo_ctrl.rb +117 -295
  122. data/lib/wx/doc/gen/command_link_button.rb +12 -5
  123. data/lib/wx/doc/gen/context_help_button.rb +13 -3
  124. data/lib/wx/doc/gen/control.rb +22 -8
  125. data/lib/wx/doc/gen/control_with_items.rb +45 -10
  126. data/lib/wx/doc/gen/core.rb +4 -4
  127. data/lib/wx/doc/gen/cursor.rb +10 -8
  128. data/lib/wx/doc/gen/data_format.rb +7 -1
  129. data/lib/wx/doc/gen/data_object.rb +42 -18
  130. data/lib/wx/doc/gen/date_event.rb +3 -2
  131. data/lib/wx/doc/gen/date_picker_ctrl.rb +18 -8
  132. data/lib/wx/doc/gen/dc.rb +238 -36
  133. data/lib/wx/doc/gen/defs.rb +51 -51
  134. data/lib/wx/doc/gen/dial_up_event.rb +2 -1
  135. data/lib/wx/doc/gen/dial_up_manager.rb +25 -5
  136. data/lib/wx/doc/gen/dialog.rb +72 -13
  137. data/lib/wx/doc/gen/dir_dialog.rb +22 -5
  138. data/lib/wx/doc/gen/dir_filter_list_ctrl.rb +2 -0
  139. data/lib/wx/doc/gen/dir_picker_ctrl.rb +14 -10
  140. data/lib/wx/doc/gen/drag_drop.rb +28 -7
  141. data/lib/wx/doc/gen/drag_image.rb +13 -2
  142. data/lib/wx/doc/gen/editable_list_box.rb +7 -5
  143. data/lib/wx/doc/gen/event.rb +57 -26
  144. data/lib/wx/doc/gen/event_blocker.rb +2 -3
  145. data/lib/wx/doc/gen/event_filter.rb +3 -0
  146. data/lib/wx/doc/gen/event_list.rb +1656 -1652
  147. data/lib/wx/doc/gen/events.rb +305 -173
  148. data/lib/wx/doc/gen/evt_handler.rb +49 -3
  149. data/lib/wx/doc/gen/ext_help_controller.rb +10 -1
  150. data/lib/wx/doc/gen/file_ctrl.rb +28 -10
  151. data/lib/wx/doc/gen/file_ctrl_event.rb +7 -4
  152. data/lib/wx/doc/gen/file_dialog.rb +44 -14
  153. data/lib/wx/doc/gen/file_dialog_custom_control.rb +19 -0
  154. data/lib/wx/doc/gen/file_dialog_customize_hook.rb +11 -3
  155. data/lib/wx/doc/gen/file_dir_picker_event.rb +4 -4
  156. data/lib/wx/doc/gen/file_picker_ctrl.rb +12 -9
  157. data/lib/wx/doc/gen/file_system.rb +54 -15
  158. data/lib/wx/doc/gen/find_dialog_event.rb +6 -4
  159. data/lib/wx/doc/gen/find_replace_data.rb +2 -1
  160. data/lib/wx/doc/gen/find_replace_dialog.rb +4 -1
  161. data/lib/wx/doc/gen/flex_grid_sizer.rb +13 -1
  162. data/lib/wx/doc/gen/font.rb +103 -20
  163. data/lib/wx/doc/gen/font_data.rb +16 -3
  164. data/lib/wx/doc/gen/font_dialog.rb +6 -1
  165. data/lib/wx/doc/gen/font_picker_ctrl.rb +14 -7
  166. data/lib/wx/doc/gen/font_picker_event.rb +3 -3
  167. data/lib/wx/doc/gen/frame.rb +73 -15
  168. data/lib/wx/doc/gen/fs_file.rb +39 -10
  169. data/lib/wx/doc/gen/gauge.rb +19 -8
  170. data/lib/wx/doc/gen/gb_sizer_item.rb +5 -1
  171. data/lib/wx/doc/gen/gcdc.rb +3 -2
  172. data/lib/wx/doc/gen/gdi_common.rb +80 -11
  173. data/lib/wx/doc/gen/gdi_object.rb +1 -1
  174. data/lib/wx/doc/gen/generic_dir_ctrl.rb +13 -7
  175. data/lib/wx/doc/gen/graphics_context.rb +86 -10
  176. data/lib/wx/doc/gen/graphics_object.rb +35 -6
  177. data/lib/wx/doc/gen/grid/event_list.rb +168 -164
  178. data/lib/wx/doc/gen/grid/grid_cell_activatable_editor.rb +3 -0
  179. data/lib/wx/doc/gen/grid/grid_cell_attr.rb +16 -3
  180. data/lib/wx/doc/gen/grid/grid_cell_auto_wrap_string_editor.rb +1 -1
  181. data/lib/wx/doc/gen/grid/grid_cell_auto_wrap_string_renderer.rb +2 -1
  182. data/lib/wx/doc/gen/grid/grid_cell_bool_editor.rb +2 -1
  183. data/lib/wx/doc/gen/grid/grid_cell_bool_renderer.rb +1 -1
  184. data/lib/wx/doc/gen/grid/grid_cell_choice_editor.rb +2 -1
  185. data/lib/wx/doc/gen/grid/grid_cell_date_editor.rb +2 -1
  186. data/lib/wx/doc/gen/grid/grid_cell_date_renderer.rb +2 -1
  187. data/lib/wx/doc/gen/grid/grid_cell_date_time_renderer.rb +2 -1
  188. data/lib/wx/doc/gen/grid/grid_cell_editor.rb +10 -1
  189. data/lib/wx/doc/gen/grid/grid_cell_enum_editor.rb +2 -1
  190. data/lib/wx/doc/gen/grid/grid_cell_enum_renderer.rb +2 -1
  191. data/lib/wx/doc/gen/grid/grid_cell_float_editor.rb +1 -1
  192. data/lib/wx/doc/gen/grid/grid_cell_float_renderer.rb +2 -1
  193. data/lib/wx/doc/gen/grid/grid_cell_number_editor.rb +2 -1
  194. data/lib/wx/doc/gen/grid/grid_cell_number_renderer.rb +1 -1
  195. data/lib/wx/doc/gen/grid/grid_cell_renderer.rb +7 -1
  196. data/lib/wx/doc/gen/grid/grid_cell_string_renderer.rb +1 -1
  197. data/lib/wx/doc/gen/grid/grid_cell_text_editor.rb +1 -1
  198. data/lib/wx/doc/gen/grid/grid_ctrl.rb +256 -12
  199. data/lib/wx/doc/gen/grid/grid_editor_created_event.rb +6 -4
  200. data/lib/wx/doc/gen/grid/grid_event.rb +6 -4
  201. data/lib/wx/doc/gen/grid/grid_range_select_event.rb +4 -4
  202. data/lib/wx/doc/gen/grid/grid_size_event.rb +4 -4
  203. data/lib/wx/doc/gen/grid/grid_string_table.rb +8 -0
  204. data/lib/wx/doc/gen/grid/grid_table_base.rb +28 -3
  205. data/lib/wx/doc/gen/grid/grid_table_message.rb +2 -0
  206. data/lib/wx/doc/gen/grid_bag_sizer.rb +21 -7
  207. data/lib/wx/doc/gen/grid_sizer.rb +11 -1
  208. data/lib/wx/doc/gen/gui_event_loop.rb +13 -3
  209. data/lib/wx/doc/gen/header_ctrl.rb +110 -11
  210. data/lib/wx/doc/gen/header_ctrl_event.rb +4 -2
  211. data/lib/wx/doc/gen/help_controller.rb +14 -3
  212. data/lib/wx/doc/gen/help_provider.rb +22 -4
  213. data/lib/wx/doc/gen/html/event_list.rb +41 -37
  214. data/lib/wx/doc/gen/html/html_cell.rb +48 -6
  215. data/lib/wx/doc/gen/html/html_cell_event.rb +5 -4
  216. data/lib/wx/doc/gen/html/html_easy_printing.rb +20 -3
  217. data/lib/wx/doc/gen/html/html_help_controller.rb +26 -2
  218. data/lib/wx/doc/gen/html/html_help_data.rb +8 -1
  219. data/lib/wx/doc/gen/html/html_help_window.rb +9 -1
  220. data/lib/wx/doc/gen/html/html_link_event.rb +3 -3
  221. data/lib/wx/doc/gen/html/html_list_box.rb +54 -16
  222. data/lib/wx/doc/gen/html/html_printout.rb +7 -1
  223. data/lib/wx/doc/gen/html/html_window.rb +43 -6
  224. data/lib/wx/doc/gen/hyperlink_ctrl.rb +9 -8
  225. data/lib/wx/doc/gen/hyperlink_event.rb +3 -3
  226. data/lib/wx/doc/gen/icon.rb +23 -29
  227. data/lib/wx/doc/gen/icon_location.rb +1 -1
  228. data/lib/wx/doc/gen/image.rb +143 -20
  229. data/lib/wx/doc/gen/image_list.rb +25 -6
  230. data/lib/wx/doc/gen/info_bar.rb +14 -2
  231. data/lib/wx/doc/gen/keyboard_state.rb +11 -1
  232. data/lib/wx/doc/gen/list_box.rb +46 -17
  233. data/lib/wx/doc/gen/list_ctrl.rb +165 -29
  234. data/lib/wx/doc/gen/list_event.rb +13 -4
  235. data/lib/wx/doc/gen/listbook.rb +7 -7
  236. data/lib/wx/doc/gen/locale.rb +68 -4
  237. data/lib/wx/doc/gen/log.rb +58 -12
  238. data/lib/wx/doc/gen/mdi_client_window.rb +11 -2
  239. data/lib/wx/doc/gen/mdi_frame.rb +51 -7
  240. data/lib/wx/doc/gen/media_ctrl.rb +43 -18
  241. data/lib/wx/doc/gen/media_event.rb +6 -4
  242. data/lib/wx/doc/gen/memory_dc.rb +16 -6
  243. data/lib/wx/doc/gen/menu.rb +81 -26
  244. data/lib/wx/doc/gen/menu_bar.rb +74 -15
  245. data/lib/wx/doc/gen/menu_item.rb +67 -19
  246. data/lib/wx/doc/gen/message_dialog.rb +17 -8
  247. data/lib/wx/doc/gen/mini_frame.rb +14 -5
  248. data/lib/wx/doc/gen/mirror_dc.rb +1 -2
  249. data/lib/wx/doc/gen/mouse_state.rb +1 -1
  250. data/lib/wx/doc/gen/multi_choice_dialog.rb +9 -4
  251. data/lib/wx/doc/gen/non_owned_window.rb +4 -1
  252. data/lib/wx/doc/gen/notebook.rb +27 -9
  253. data/lib/wx/doc/gen/num_validator.rb +37 -0
  254. data/lib/wx/doc/gen/number_entry_dialog.rb +5 -1
  255. data/lib/wx/doc/gen/object.rb +3 -1
  256. data/lib/wx/doc/gen/owner_drawn_combo_box.rb +340 -0
  257. data/lib/wx/doc/gen/paint_dc.rb +1 -1
  258. data/lib/wx/doc/gen/palette.rb +5 -1
  259. data/lib/wx/doc/gen/panel.rb +25 -8
  260. data/lib/wx/doc/gen/pen.rb +46 -8
  261. data/lib/wx/doc/gen/pg/event_list.rb +97 -93
  262. data/lib/wx/doc/gen/pg/numeric_property_validator.rb +4 -1
  263. data/lib/wx/doc/gen/pg/pg_array_editor_dialog.rb +12 -1
  264. data/lib/wx/doc/gen/pg/pg_cell.rb +11 -3
  265. data/lib/wx/doc/gen/pg/pg_editor.rb +161 -16
  266. data/lib/wx/doc/gen/pg/pg_multi_button.rb +3 -2
  267. data/lib/wx/doc/gen/pg/pg_properties.rb +632 -83
  268. data/lib/wx/doc/gen/pg/pg_property.rb +381 -77
  269. data/lib/wx/doc/gen/pg/pg_validation_info.rb +11 -4
  270. data/lib/wx/doc/gen/pg/property_grid.rb +123 -20
  271. data/lib/wx/doc/gen/pg/property_grid_event.rb +41 -9
  272. data/lib/wx/doc/gen/pg/property_grid_interface.rb +273 -34
  273. data/lib/wx/doc/gen/pg/property_grid_manager.rb +62 -10
  274. data/lib/wx/doc/gen/pg/property_grid_page.rb +33 -8
  275. data/lib/wx/doc/gen/pg/property_grid_page_state.rb +18 -4
  276. data/lib/wx/doc/gen/picker_base.rb +22 -5
  277. data/lib/wx/doc/gen/platform_info.rb +35 -9
  278. data/lib/wx/doc/gen/popup_window.rb +7 -5
  279. data/lib/wx/doc/gen/progress_dialog.rb +5 -0
  280. data/lib/wx/doc/gen/property_sheet_dialog.rb +20 -4
  281. data/lib/wx/doc/gen/prt/event_list.rb +8 -4
  282. data/lib/wx/doc/gen/prt/page_setup_dialog.rb +3 -1
  283. data/lib/wx/doc/gen/prt/post_script_dc.rb +3 -2
  284. data/lib/wx/doc/gen/prt/preview_frame.rb +5 -1
  285. data/lib/wx/doc/gen/prt/print_abort_dialog.rb +4 -0
  286. data/lib/wx/doc/gen/prt/print_data.rb +31 -3
  287. data/lib/wx/doc/gen/prt/print_dialog.rb +5 -1
  288. data/lib/wx/doc/gen/prt/printer.rb +87 -11
  289. data/lib/wx/doc/gen/prt/printer_dc.rb +3 -1
  290. data/lib/wx/doc/gen/query_layout_info_event.rb +10 -3
  291. data/lib/wx/doc/gen/radio_box.rb +28 -10
  292. data/lib/wx/doc/gen/radio_button.rb +22 -9
  293. data/lib/wx/doc/gen/rbn/event_list.rb +127 -123
  294. data/lib/wx/doc/gen/rbn/ribbon_art_provider.rb +82 -3
  295. data/lib/wx/doc/gen/rbn/ribbon_bar.rb +26 -4
  296. data/lib/wx/doc/gen/rbn/ribbon_bar_event.rb +3 -2
  297. data/lib/wx/doc/gen/rbn/ribbon_button_bar.rb +50 -12
  298. data/lib/wx/doc/gen/rbn/ribbon_button_bar_event.rb +3 -2
  299. data/lib/wx/doc/gen/rbn/ribbon_control.rb +11 -1
  300. data/lib/wx/doc/gen/rbn/ribbon_gallery.rb +21 -11
  301. data/lib/wx/doc/gen/rbn/ribbon_gallery_event.rb +2 -2
  302. data/lib/wx/doc/gen/rbn/ribbon_page.rb +12 -1
  303. data/lib/wx/doc/gen/rbn/ribbon_panel.rb +16 -4
  304. data/lib/wx/doc/gen/rbn/ribbon_panel_event.rb +3 -3
  305. data/lib/wx/doc/gen/rbn/ribbon_tool_bar.rb +27 -3
  306. data/lib/wx/doc/gen/rbn/ribbon_tool_bar_event.rb +3 -1
  307. data/lib/wx/doc/gen/rearrange_ctrl.rb +5 -2
  308. data/lib/wx/doc/gen/rearrange_list.rb +12 -4
  309. data/lib/wx/doc/gen/region.rb +104 -17
  310. data/lib/wx/doc/gen/region_iterator.rb +1 -1
  311. data/lib/wx/doc/gen/rtc/event_list.rb +116 -112
  312. data/lib/wx/doc/gen/rtc/rich_text_box.rb +27 -9
  313. data/lib/wx/doc/gen/rtc/rich_text_buffer.rb +45 -11
  314. data/lib/wx/doc/gen/rtc/rich_text_buffer_data_object.rb +1 -1
  315. data/lib/wx/doc/gen/rtc/rich_text_composite_object.rb +23 -14
  316. data/lib/wx/doc/gen/rtc/rich_text_ctrl.rb +84 -7
  317. data/lib/wx/doc/gen/rtc/rich_text_event.rb +8 -4
  318. data/lib/wx/doc/gen/rtc/rich_text_file_handler.rb +8 -2
  319. data/lib/wx/doc/gen/rtc/rich_text_formatting_dialog.rb +8 -3
  320. data/lib/wx/doc/gen/rtc/rich_text_header_footer_data.rb +4 -2
  321. data/lib/wx/doc/gen/rtc/rich_text_html_handler.rb +6 -3
  322. data/lib/wx/doc/gen/rtc/rich_text_image.rb +7 -2
  323. data/lib/wx/doc/gen/rtc/rich_text_object.rb +82 -17
  324. data/lib/wx/doc/gen/rtc/rich_text_paragraph_layout_box.rb +54 -11
  325. data/lib/wx/doc/gen/rtc/rich_text_printing.rb +15 -2
  326. data/lib/wx/doc/gen/rtc/rich_text_style_list_box.rb +14 -9
  327. data/lib/wx/doc/gen/rtc/rich_text_style_organiser_dialog.rb +4 -1
  328. data/lib/wx/doc/gen/rtc/rich_text_xml_handler.rb +4 -3
  329. data/lib/wx/doc/gen/rtc/symbol_picker_dialog.rb +2 -2
  330. data/lib/wx/doc/gen/sash_event.rb +13 -4
  331. data/lib/wx/doc/gen/sash_layout_window.rb +21 -4
  332. data/lib/wx/doc/gen/sash_window.rb +6 -4
  333. data/lib/wx/doc/gen/screen_dc.rb +1 -1
  334. data/lib/wx/doc/gen/scroll_bar.rb +28 -10
  335. data/lib/wx/doc/gen/scrolled_canvas.rb +48 -10
  336. data/lib/wx/doc/gen/scrolled_control.rb +48 -10
  337. data/lib/wx/doc/gen/scrolled_window.rb +48 -10
  338. data/lib/wx/doc/gen/search_ctrl.rb +14 -9
  339. data/lib/wx/doc/gen/simplebook.rb +8 -1
  340. data/lib/wx/doc/gen/single_choice_dialog.rb +9 -4
  341. data/lib/wx/doc/gen/sizer.rb +91 -16
  342. data/lib/wx/doc/gen/sizer_item.rb +21 -4
  343. data/lib/wx/doc/gen/slider.rb +50 -17
  344. data/lib/wx/doc/gen/spin_button.rb +24 -10
  345. data/lib/wx/doc/gen/spin_ctrl.rb +35 -9
  346. data/lib/wx/doc/gen/spin_ctrl_double.rb +13 -7
  347. data/lib/wx/doc/gen/spin_double_event.rb +6 -4
  348. data/lib/wx/doc/gen/spin_event.rb +4 -3
  349. data/lib/wx/doc/gen/splash_screen.rb +3 -2
  350. data/lib/wx/doc/gen/splitter_event.rb +12 -4
  351. data/lib/wx/doc/gen/splitter_window.rb +100 -18
  352. data/lib/wx/doc/gen/static_bitmap.rb +109 -7
  353. data/lib/wx/doc/gen/static_box.rb +15 -7
  354. data/lib/wx/doc/gen/static_box_sizer.rb +3 -2
  355. data/lib/wx/doc/gen/static_line.rb +7 -4
  356. data/lib/wx/doc/gen/static_text.rb +10 -6
  357. data/lib/wx/doc/gen/status_bar.rb +32 -8
  358. data/lib/wx/doc/gen/stc/event_list.rb +212 -208
  359. data/lib/wx/doc/gen/stc/styled_text_ctrl.rb +207 -13
  360. data/lib/wx/doc/gen/stc/styled_text_event.rb +31 -6
  361. data/lib/wx/doc/gen/std_dialog_button_sizer.rb +7 -1
  362. data/lib/wx/doc/gen/svg_file_dc.rb +15 -7
  363. data/lib/wx/doc/gen/system_options.rb +14 -6
  364. data/lib/wx/doc/gen/system_settings.rb +9 -3
  365. data/lib/wx/doc/gen/task_bar_button.rb +324 -0
  366. data/lib/wx/doc/gen/task_bar_icon.rb +26 -8
  367. data/lib/wx/doc/gen/task_bar_icon_event.rb +5 -3
  368. data/lib/wx/doc/gen/text_attr.rb +47 -5
  369. data/lib/wx/doc/gen/text_ctrl.rb +114 -25
  370. data/lib/wx/doc/gen/text_entry.rb +69 -11
  371. data/lib/wx/doc/gen/text_entry_dialog.rb +14 -2
  372. data/lib/wx/doc/gen/text_validator.rb +58 -9
  373. data/lib/wx/doc/gen/time_picker_ctrl.rb +11 -6
  374. data/lib/wx/doc/gen/timer.rb +14 -2
  375. data/lib/wx/doc/gen/timer_event.rb +2 -2
  376. data/lib/wx/doc/gen/tip_provider.rb +6 -1
  377. data/lib/wx/doc/gen/toggle_button.rb +73 -6
  378. data/lib/wx/doc/gen/tool_bar.rb +141 -25
  379. data/lib/wx/doc/gen/tool_tip.rb +41 -5
  380. data/lib/wx/doc/gen/toolbook.rb +6 -4
  381. data/lib/wx/doc/gen/top_level_window.rb +100 -23
  382. data/lib/wx/doc/gen/tree_ctrl.rb +89 -16
  383. data/lib/wx/doc/gen/tree_event.rb +9 -4
  384. data/lib/wx/doc/gen/treebook.rb +16 -4
  385. data/lib/wx/doc/gen/ui_action_simulator.rb +10 -2
  386. data/lib/wx/doc/gen/utils.rb +94 -7
  387. data/lib/wx/doc/gen/v_list_box.rb +27 -2
  388. data/lib/wx/doc/gen/v_scrolled_window.rb +21 -4
  389. data/lib/wx/doc/gen/validator.rb +10 -14
  390. data/lib/wx/doc/gen/variant.rb +7 -0
  391. data/lib/wx/doc/gen/window.rb +415 -57
  392. data/lib/wx/doc/gen/window_dc.rb +2 -1
  393. data/lib/wx/doc/gen/window_disabler.rb +6 -2
  394. data/lib/wx/doc/gen/with_images.rb +13 -2
  395. data/lib/wx/doc/gen/wizard.rb +22 -4
  396. data/lib/wx/doc/gen/wizard_event.rb +5 -4
  397. data/lib/wx/doc/gen/wizard_page.rb +7 -2
  398. data/lib/wx/doc/gen/wizard_page_simple.rb +5 -1
  399. data/lib/wx/doc/gen/wrap_sizer.rb +5 -1
  400. data/lib/wx/doc/gen/xml_node.rb +33 -4
  401. data/lib/wx/doc/gen/xml_resource.rb +40 -5
  402. data/lib/wx/doc/generic_validator.rb +95 -0
  403. data/lib/wx/doc/graphics_context.rb +1 -0
  404. data/lib/wx/doc/grid/grid.rb +22 -1
  405. data/lib/wx/doc/help_controller.rb +11 -7
  406. data/lib/wx/doc/html/html_help_controller.rb +12 -4
  407. data/lib/wx/doc/html/simple_html_listbox.rb +22 -0
  408. data/lib/wx/doc/list_ctrl.rb +33 -29
  409. data/lib/wx/doc/menu.rb +20 -0
  410. data/lib/wx/doc/notebook.rb +21 -0
  411. data/lib/wx/doc/num_validator.rb +387 -0
  412. data/lib/wx/doc/owner_drawn_combobox.rb +96 -0
  413. data/lib/wx/doc/pg/events.rb +13 -9
  414. data/lib/wx/doc/pg/numeric_property_validator.rb +33 -0
  415. data/lib/wx/doc/pg/pg_property.rb +18 -0
  416. data/lib/wx/doc/progress_dialog.rb +36 -32
  417. data/lib/wx/doc/prt/page_setup_dialog.rb +20 -12
  418. data/lib/wx/doc/prt/print_data.rb +13 -5
  419. data/lib/wx/doc/prt/print_dialog.rb +31 -23
  420. data/lib/wx/doc/prt/printer.rb +20 -12
  421. data/lib/wx/doc/radio_box.rb +19 -15
  422. data/lib/wx/doc/rbn/ribbon_bar.rb +13 -5
  423. data/lib/wx/doc/rbn/ribbon_button_bar.rb +13 -5
  424. data/lib/wx/doc/rbn/ribbon_gallery.rb +13 -5
  425. data/lib/wx/doc/rbn/ribbon_tool_bar.rb +13 -5
  426. data/lib/wx/doc/region_iterator.rb +32 -28
  427. data/lib/wx/doc/rtc/rich_text_composite_object.rb +24 -0
  428. data/lib/wx/doc/rtc/rich_text_ctrl.rb +24 -0
  429. data/lib/wx/doc/rtc/rich_text_paragraph.rb +24 -0
  430. data/lib/wx/doc/rtc/richtext_buffer.rb +27 -19
  431. data/lib/wx/doc/rtc/richtext_printing.rb +17 -9
  432. data/lib/wx/doc/rtc/richtext_style_sheet.rb +17 -9
  433. data/lib/wx/doc/sizer.rb +20 -0
  434. data/lib/wx/doc/static_bitmap.rb +25 -0
  435. data/lib/wx/doc/stc/styled_text_ctrl.rb +24 -0
  436. data/lib/wx/doc/stream.rb +39 -35
  437. data/lib/wx/doc/system_settings.rb +30 -26
  438. data/lib/wx/doc/text_validator.rb +23 -9
  439. data/lib/wx/doc/textctrl.rb +16 -0
  440. data/lib/wx/doc/tree_ctrl.rb +95 -0
  441. data/lib/wx/doc/treebook.rb +9 -5
  442. data/lib/wx/doc/v_list_box.rb +9 -5
  443. data/lib/wx/doc/validator.rb +113 -0
  444. data/lib/wx/doc/variant.rb +164 -160
  445. data/lib/wx/doc/window.rb +87 -47
  446. data/lib/wx/doc/window_disabler.rb +10 -6
  447. data/lib/wx/grid/grid.rb +27 -4
  448. data/lib/wx/html/events/evt_list.rb +0 -10
  449. data/lib/wx/html/simple_html_listbox.rb +24 -91
  450. data/lib/wx/keyword_defs.rb +34 -2
  451. data/lib/wx/pg/pg_property.rb +22 -0
  452. data/lib/wx/rbn/ribbon_gallery.rb +0 -21
  453. data/lib/wx/rtc/require.rb +3 -0
  454. data/lib/wx/rtc/rich_text_composite_object.rb +25 -0
  455. data/lib/wx/rtc/rich_text_ctrl.rb +25 -0
  456. data/lib/wx/rtc/rich_text_paragraph.rb +25 -0
  457. data/lib/wx/stc/require.rb +1 -0
  458. data/lib/wx/stc/styled_text_ctrl.rb +25 -0
  459. data/lib/wx/version.rb +1 -1
  460. data/lib/wxruby_aui.so +0 -0
  461. data/lib/wxruby_core.so +0 -0
  462. data/lib/wxruby_grid.so +0 -0
  463. data/lib/wxruby_html.so +0 -0
  464. data/lib/wxruby_pg.so +0 -0
  465. data/lib/wxruby_prt.so +0 -0
  466. data/lib/wxruby_rbn.so +0 -0
  467. data/lib/wxruby_rtc.so +0 -0
  468. data/lib/wxruby_stc.so +0 -0
  469. data/rakelib/lib/config/linux.rb +0 -3
  470. data/rakelib/lib/config/macosx.rb +2 -2
  471. data/rakelib/lib/config/mingw.rb +13 -1
  472. data/rakelib/lib/config/unixish.rb +1 -1
  473. data/rakelib/lib/config.rb +14 -4
  474. data/rakelib/yard/templates/default/fulldoc/html/css/wxruby3.css +74 -2
  475. data/rakelib/yard/templates/default/fulldoc/html/full_list.erb +38 -0
  476. data/rakelib/yard/templates/default/fulldoc/html/setup.rb +39 -0
  477. data/rakelib/yard/templates/default/tags/html/wxrb_require.erb +10 -0
  478. data/rakelib/yard/templates/default/tags/setup.rb +16 -0
  479. data/rakelib/yard/yard-custom-templates.rb +3 -0
  480. data/samples/aui/aui.rb +1237 -1233
  481. data/samples/calendar/calendar.rb +293 -289
  482. data/samples/controls/get_item_sample.rb +83 -79
  483. data/samples/controls/htlbox.rb +331 -327
  484. data/samples/dialogs/dialogs.rb +682 -694
  485. data/samples/dialogs/wizard.rb +52 -55
  486. data/samples/dragdrop/dragdrop.rb +146 -142
  487. data/samples/drawing/bitmap.rb +29 -26
  488. data/samples/drawing/bitmap_image.rb +84 -80
  489. data/samples/drawing/graphics_drawing.rb +209 -205
  490. data/samples/drawing/image_prt.rb +344 -340
  491. data/samples/drawing/maths_images.rb +18 -1
  492. data/samples/drawing/rmagic_bitmap_image.rb +88 -84
  493. data/samples/etc/caret.rb +306 -0
  494. data/samples/etc/miniframe.rb +65 -60
  495. data/samples/etc/sash.rb +109 -105
  496. data/samples/etc/scrollwin.rb +86 -80
  497. data/samples/etc/system_settings.rb +216 -209
  498. data/samples/event/activation.rb +72 -67
  499. data/samples/event/event.rb +160 -153
  500. data/samples/event/threaded.rb +8 -1
  501. data/samples/event/update_ui_event.rb +67 -60
  502. data/samples/grid/grid.rb +188 -181
  503. data/samples/grid/gridtablebase.rb +136 -129
  504. data/samples/html/html.rb +208 -204
  505. data/samples/mdi/mdi.rb +59 -54
  506. data/samples/minimal/minimal.rb +54 -51
  507. data/samples/minimal/nothing.rb +1 -0
  508. data/samples/printing/printing.rb +367 -377
  509. data/samples/printing/printing2.rb +203 -198
  510. data/samples/propgrid/propgrid.rb +2312 -2308
  511. data/samples/propgrid/propgrid_minimal.rb +57 -50
  512. data/samples/ribbon/ribbon.rb +780 -774
  513. data/samples/sampler/ext.rb +0 -33
  514. data/samples/sampler/sample.rb +4 -9
  515. data/samples/sampler.rb +1 -1
  516. data/samples/splash/splash.rb +118 -116
  517. data/samples/text/rich_textctrl.rb +207 -201
  518. data/samples/text/richtext.rb +1409 -1405
  519. data/samples/text/scintilla.rb +137 -128
  520. data/samples/text/textctrl.rb +89 -83
  521. data/samples/text/unicode.rb +175 -168
  522. data/samples/treectrl/treectrl.rb +1430 -1426
  523. data/samples/widgets/activityindicator.rb +95 -0
  524. data/samples/widgets/art/widgets/activityindicator.xpm +278 -0
  525. data/samples/widgets/art/widgets/bmpbtn.xpm +37 -0
  526. data/samples/widgets/art/widgets/bmpcombobox.xpm +54 -0
  527. data/samples/widgets/art/widgets/button.xpm +54 -0
  528. data/samples/widgets/art/widgets/checkbox.xpm +54 -0
  529. data/samples/{bigdemo/icons → widgets/art/widgets}/choice.xpm +1 -1
  530. data/samples/widgets/art/widgets/choicebk.xpm +54 -0
  531. data/samples/widgets/art/widgets/clrpicker.xpm +193 -0
  532. data/samples/widgets/art/widgets/combobox.xpm +54 -0
  533. data/samples/widgets/art/widgets/datepick.xpm +200 -0
  534. data/samples/widgets/art/widgets/dirctrl.xpm +54 -0
  535. data/samples/widgets/art/widgets/dirpicker.xpm +213 -0
  536. data/samples/widgets/art/widgets/filepicker.xpm +214 -0
  537. data/samples/widgets/art/widgets/fontpicker.xpm +185 -0
  538. data/samples/widgets/art/widgets/gauge.xpm +54 -0
  539. data/samples/widgets/art/widgets/header.xpm +54 -0
  540. data/samples/widgets/art/widgets/hyperlnk.xpm +54 -0
  541. data/samples/widgets/art/widgets/listbook.xpm +54 -0
  542. data/samples/widgets/art/widgets/listbox.xpm +54 -0
  543. data/samples/widgets/art/widgets/native.xpm +81 -0
  544. data/samples/widgets/art/widgets/notebook.xpm +54 -0
  545. data/samples/widgets/art/widgets/odcombobox.xpm +54 -0
  546. data/samples/widgets/art/widgets/radiobox.xpm +54 -0
  547. data/samples/widgets/art/widgets/scrolbar.xpm +54 -0
  548. data/samples/widgets/art/widgets/slider.xpm +54 -0
  549. data/samples/widgets/art/widgets/spinbtn.xpm +40 -0
  550. data/samples/widgets/art/widgets/statbmp.xpm +40 -0
  551. data/samples/widgets/art/widgets/statbox.xpm +54 -0
  552. data/samples/widgets/art/widgets/stattext.xpm +54 -0
  553. data/samples/widgets/art/widgets/text.xpm +54 -0
  554. data/samples/widgets/art/widgets/timepick.xpm +207 -0
  555. data/samples/widgets/art/widgets/toggle.xpm +54 -0
  556. data/samples/widgets/art/widgets/toucan.png +0 -0
  557. data/samples/widgets/bmpcombobox.rb +651 -0
  558. data/samples/widgets/button.rb +462 -0
  559. data/samples/widgets/checkbox.rb +211 -0
  560. data/samples/widgets/choice.rb +287 -0
  561. data/samples/widgets/clrpicker.rb +156 -0
  562. data/samples/widgets/combobox.rb +516 -0
  563. data/samples/widgets/datepick.rb +215 -0
  564. data/samples/widgets/dirctrl.rb +265 -0
  565. data/samples/widgets/dirpicker.rb +158 -0
  566. data/samples/widgets/editlbox.rb +122 -0
  567. data/samples/widgets/filectrl.rb +216 -0
  568. data/samples/widgets/filepicker.rb +214 -0
  569. data/samples/widgets/fontpicker.rb +135 -0
  570. data/samples/widgets/gauge.rb +311 -0
  571. data/samples/widgets/headerctrl.rb +236 -0
  572. data/samples/widgets/hyperlink.rb +203 -0
  573. data/samples/widgets/itemcontainer.rb +185 -0
  574. data/samples/widgets/listbox.rb +473 -0
  575. data/samples/widgets/notebook.rb +488 -0
  576. data/samples/widgets/odcombobox.rb +608 -0
  577. data/samples/widgets/radiobox.rb +328 -0
  578. data/samples/widgets/searchctrl.rb +159 -0
  579. data/samples/widgets/slider.rb +594 -0
  580. data/samples/widgets/spinbtn.rb +443 -0
  581. data/samples/widgets/statbmp.rb +130 -0
  582. data/samples/widgets/static.rb +436 -0
  583. data/samples/widgets/textctrl.rb +700 -0
  584. data/samples/widgets/timepick.rb +148 -0
  585. data/samples/widgets/tn_widgets.png +0 -0
  586. data/samples/widgets/toggle.rb +385 -0
  587. data/samples/widgets/widgets.rb +1233 -0
  588. data/samples/xrc/custom_xrc_sample.rb +47 -41
  589. data/samples/xrc/xrc_sample.rb +53 -47
  590. data/tests/media/beep_lo.wav +0 -0
  591. data/tests/test_event_handling.rb +52 -34
  592. data/tests/test_events.rb +7 -0
  593. data/tests/test_item_data.rb +24 -0
  594. data/tests/test_list_ctrl.rb +1 -1
  595. data/tests/test_media_ctrl.rb +38 -0
  596. data/tests/test_menu.rb +69 -0
  597. data/tests/test_pg.rb +27 -0
  598. data/tests/test_richtext.rb +45 -0
  599. data/tests/test_sizer.rb +59 -0
  600. data/tests/test_std_controls.rb +42 -1
  601. data/tests/test_styled_text_ctrl.rb +46 -0
  602. data/tests/test_tree_ctrl.rb +138 -0
  603. data/tests/test_validators.rb +805 -0
  604. data/tests/test_window.rb +12 -0
  605. data/tests/testapp_noframe.rb +1 -1
  606. metadata +113 -138
  607. data/lib/wx/core/choice.rb +0 -14
  608. data/lib/wx/core/combo_ctrl.rb +0 -110
  609. data/samples/bigdemo/About.rbw +0 -39
  610. data/samples/bigdemo/ColorPanel.rbw +0 -23
  611. data/samples/bigdemo/GridSimple.rbw +0 -78
  612. data/samples/bigdemo/MDIDemo.rbw +0 -57
  613. data/samples/bigdemo/PopupMenu.rbw +0 -146
  614. data/samples/bigdemo/ShapedWindow.rbw +0 -128
  615. data/samples/bigdemo/Sizers.rbw +0 -541
  616. data/samples/bigdemo/bigdemo.rb +0 -817
  617. data/samples/bigdemo/demoTemplate.rbw +0 -33
  618. data/samples/bigdemo/helpfile.htb +0 -0
  619. data/samples/bigdemo/icons/Test 015.jpg +0 -0
  620. data/samples/bigdemo/icons/Test 015.png +0 -0
  621. data/samples/bigdemo/icons/choice.bmp +0 -0
  622. data/samples/bigdemo/icons/combo.bmp +0 -0
  623. data/samples/bigdemo/icons/combo.xpm +0 -27
  624. data/samples/bigdemo/icons/copy.xpm +0 -25
  625. data/samples/bigdemo/icons/cut.xpm +0 -24
  626. data/samples/bigdemo/icons/gauge.bmp +0 -0
  627. data/samples/bigdemo/icons/gauge.xpm +0 -27
  628. data/samples/bigdemo/icons/help.xpm +0 -25
  629. data/samples/bigdemo/icons/list.bmp +0 -0
  630. data/samples/bigdemo/icons/list.xpm +0 -27
  631. data/samples/bigdemo/icons/mondrian.ico +0 -0
  632. data/samples/bigdemo/icons/mondrian.xpm +0 -44
  633. data/samples/bigdemo/icons/new.xpm +0 -24
  634. data/samples/bigdemo/icons/ogl.ico +0 -0
  635. data/samples/bigdemo/icons/ogl.xpm +0 -45
  636. data/samples/bigdemo/icons/open.xpm +0 -26
  637. data/samples/bigdemo/icons/paste.bmp +0 -0
  638. data/samples/bigdemo/icons/paste.xpm +0 -38
  639. data/samples/bigdemo/icons/pointy.png +0 -0
  640. data/samples/bigdemo/icons/preview.xpm +0 -26
  641. data/samples/bigdemo/icons/print.xpm +0 -26
  642. data/samples/bigdemo/icons/radio.bmp +0 -0
  643. data/samples/bigdemo/icons/radio.xpm +0 -27
  644. data/samples/bigdemo/icons/robert.xpm +0 -415
  645. data/samples/bigdemo/icons/sashtest.ico +0 -0
  646. data/samples/bigdemo/icons/save.xpm +0 -25
  647. data/samples/bigdemo/icons/smiles.bmp +0 -0
  648. data/samples/bigdemo/icons/smiles.xpm +0 -39
  649. data/samples/bigdemo/icons/smiley.ico +0 -0
  650. data/samples/bigdemo/icons/smiley.xpm +0 -42
  651. data/samples/bigdemo/icons/stattext.xpm +0 -24
  652. data/samples/bigdemo/icons/test2.bmp +0 -0
  653. data/samples/bigdemo/icons/test2.png +0 -0
  654. data/samples/bigdemo/icons/test2.xpm +0 -79
  655. data/samples/bigdemo/icons/text.bmp +0 -0
  656. data/samples/bigdemo/icons/text.xpm +0 -27
  657. data/samples/bigdemo/icons/tog1.bmp +0 -0
  658. data/samples/bigdemo/icons/tog1.xpm +0 -38
  659. data/samples/bigdemo/icons/tog2.bmp +0 -0
  660. data/samples/bigdemo/icons/tog2.xpm +0 -38
  661. data/samples/bigdemo/icons/wxruby-128x128.png +0 -0
  662. data/samples/bigdemo/icons/wxwin.ico +0 -0
  663. data/samples/bigdemo/icons/wxwin16x16.png +0 -0
  664. data/samples/bigdemo/icons/wxwin16x16.xpm +0 -25
  665. data/samples/bigdemo/icons/wxwin32x32.png +0 -0
  666. data/samples/bigdemo/icons/wxwin48x48.png +0 -0
  667. data/samples/bigdemo/run.rb +0 -98
  668. data/samples/bigdemo/tips.txt +0 -7
  669. data/samples/bigdemo/utils.rb +0 -20
  670. data/samples/bigdemo/wxArtProvider.rbw +0 -282
  671. data/samples/bigdemo/wxBitmapButton.rbw +0 -65
  672. data/samples/bigdemo/wxButton.rbw +0 -64
  673. data/samples/bigdemo/wxCalendarCtrl.rbw +0 -59
  674. data/samples/bigdemo/wxCheckBox.rbw +0 -50
  675. data/samples/bigdemo/wxCheckListBox.rbw +0 -65
  676. data/samples/bigdemo/wxChoice.rbw +0 -47
  677. data/samples/bigdemo/wxChoicebook.rbw +0 -78
  678. data/samples/bigdemo/wxColourDialog.rbw +0 -33
  679. data/samples/bigdemo/wxComboBox.rbw +0 -77
  680. data/samples/bigdemo/wxCursor.rbw +0 -136
  681. data/samples/bigdemo/wxDialog.rbw +0 -74
  682. data/samples/bigdemo/wxDirDialog.rbw +0 -29
  683. data/samples/bigdemo/wxDragImage.rbw +0 -70
  684. data/samples/bigdemo/wxFileDialog.rbw +0 -37
  685. data/samples/bigdemo/wxFileDialog_Save.rbw +0 -35
  686. data/samples/bigdemo/wxFindReplaceDialog.rbw +0 -82
  687. data/samples/bigdemo/wxFontDialog.rbw +0 -200
  688. data/samples/bigdemo/wxFrame.rbw +0 -53
  689. data/samples/bigdemo/wxGauge.rbw +0 -65
  690. data/samples/bigdemo/wxGenericDirCtrl.rbw +0 -74
  691. data/samples/bigdemo/wxGrid.rbw +0 -66
  692. data/samples/bigdemo/wxHtmlHelpController.rbw +0 -52
  693. data/samples/bigdemo/wxListBox.rbw +0 -140
  694. data/samples/bigdemo/wxListCtrl_virtual.rbw +0 -112
  695. data/samples/bigdemo/wxMDIWindows.rbw +0 -50
  696. data/samples/bigdemo/wxMenu.rbw +0 -247
  697. data/samples/bigdemo/wxMessageDialog.rbw +0 -27
  698. data/samples/bigdemo/wxMiniFrame.rbw +0 -70
  699. data/samples/bigdemo/wxMultipleChoiceDialog.rbw +0 -29
  700. data/samples/bigdemo/wxNotebook.rbw +0 -136
  701. data/samples/bigdemo/wxProgressDialog.rbw +0 -43
  702. data/samples/bigdemo/wxRadioBox.rbw +0 -72
  703. data/samples/bigdemo/wxRadioButton.rbw +0 -125
  704. data/samples/bigdemo/wxSashWindow.rbw +0 -141
  705. data/samples/bigdemo/wxScrolledMessageDialog.rbw +0 -57
  706. data/samples/bigdemo/wxScrolledWindow.rbw +0 -199
  707. data/samples/bigdemo/wxSingleChoiceDialog.rbw +0 -33
  708. data/samples/bigdemo/wxSlider.rbw +0 -42
  709. data/samples/bigdemo/wxSpinButton.rbw +0 -50
  710. data/samples/bigdemo/wxSpinCtrl.rbw +0 -51
  711. data/samples/bigdemo/wxSplitterWindow.rbw +0 -63
  712. data/samples/bigdemo/wxStaticBitmap.rbw +0 -47
  713. data/samples/bigdemo/wxStaticText.rbw +0 -55
  714. data/samples/bigdemo/wxStatusBar.rbw +0 -126
  715. data/samples/bigdemo/wxTextCtrl.rbw +0 -149
  716. data/samples/bigdemo/wxTextEntryDialog.rbw +0 -31
  717. data/samples/bigdemo/wxToggleButton.rbw +0 -49
  718. data/samples/bigdemo/wxToolBar.rbw +0 -131
  719. data/samples/bigdemo/wxTreeCtrl.rbw +0 -191
  720. data/samples/caret/caret.rb +0 -298
  721. data/samples/caret/mondrian.xpm +0 -44
  722. data/samples/controls/books.rb +0 -189
  723. data/samples/controls/choice.xpm +0 -27
  724. data/samples/controls/combo.xpm +0 -27
  725. data/samples/controls/controls.rb +0 -1099
  726. data/samples/controls/gauge.xpm +0 -27
  727. data/samples/controls/list.xpm +0 -27
  728. data/samples/controls/mondrian.ico +0 -0
  729. data/samples/controls/mondrian.xpm +0 -44
  730. data/samples/controls/radio.xpm +0 -27
  731. data/samples/controls/stattext.xpm +0 -24
  732. data/samples/controls/test2.bmp +0 -0
  733. data/samples/controls/text.xpm +0 -27
  734. data/samples/controls/tn_books.png +0 -0
  735. data/samples/controls/tn_controls.png +0 -0
  736. data/samples/etc/choice.rb +0 -87
  737. data/samples/etc/tn_choice.png +0 -0
  738. data/samples/text/mondrian.ico +0 -0
  739. data/samples/text/mondrian.xpm +0 -44
  740. /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