wxruby3 0.9.2-x64-mingw-ucrt → 0.9.4-x64-mingw-ucrt

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