wxruby3 0.9.0.pre.beta.14-x64-mingw-ucrt → 0.9.0.pre.rc.2-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
Files changed (278) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -0
  3. data/INSTALL.md +51 -22
  4. data/README.md +81 -6
  5. data/assets/hello_button-macos.png +0 -0
  6. data/assets/hello_button-msw.png +0 -0
  7. data/assets/hello_button.png +0 -0
  8. data/assets/hello_button_clicked-macos.png +0 -0
  9. data/assets/hello_button_clicked-msw.png +0 -0
  10. data/assets/hello_button_clicked.png +0 -0
  11. data/assets/hello_button_clicked_combi.png +0 -0
  12. data/assets/hello_world-macos.png +0 -0
  13. data/assets/hello_world-msw.png +0 -0
  14. data/assets/hello_world.png +0 -0
  15. data/assets/hello_world_combi.png +0 -0
  16. data/assets/repo-social-preview.png +0 -0
  17. data/ext/wxbase32u_gcc_custom.dll +0 -0
  18. data/ext/wxbase32u_net_gcc_custom.dll +0 -0
  19. data/ext/wxbase32u_xml_gcc_custom.dll +0 -0
  20. data/ext/wxmsw32u_aui_gcc_custom.dll +0 -0
  21. data/ext/wxmsw32u_core_gcc_custom.dll +0 -0
  22. data/ext/wxmsw32u_gl_gcc_custom.dll +0 -0
  23. data/ext/wxmsw32u_html_gcc_custom.dll +0 -0
  24. data/ext/wxmsw32u_media_gcc_custom.dll +0 -0
  25. data/ext/wxmsw32u_propgrid_gcc_custom.dll +0 -0
  26. data/ext/wxmsw32u_qa_gcc_custom.dll +0 -0
  27. data/ext/wxmsw32u_ribbon_gcc_custom.dll +0 -0
  28. data/ext/wxmsw32u_richtext_gcc_custom.dll +0 -0
  29. data/ext/wxmsw32u_stc_gcc_custom.dll +0 -0
  30. data/ext/wxmsw32u_webview_gcc_custom.dll +0 -0
  31. data/ext/wxmsw32u_xrc_gcc_custom.dll +0 -0
  32. data/lib/wx/core/art_locator.rb +2 -2
  33. data/lib/wx/core/artprovider.rb +2 -2
  34. data/lib/wx/core/bitmap.rb +6 -5
  35. data/lib/wx/core/bitmap_combobox.rb +34 -0
  36. data/lib/wx/core/brush.rb +6 -0
  37. data/lib/wx/core/controlwithitems.rb +52 -14
  38. data/lib/wx/core/cursor.rb +1 -1
  39. data/lib/wx/core/dc.rb +0 -20
  40. data/lib/wx/core/event_blocker.rb +14 -0
  41. data/lib/wx/core/events/evt_list.rb +19 -0
  42. data/lib/wx/core/evthandler.rb +48 -2
  43. data/lib/wx/core/find_replace_dialog.rb +24 -0
  44. data/lib/wx/core/font.rb +22 -14
  45. data/lib/wx/core/helpprovider.rb +2 -2
  46. data/lib/wx/core/icon.rb +1 -1
  47. data/lib/wx/core/image.rb +1 -1
  48. data/lib/wx/core/menu.rb +5 -0
  49. data/lib/wx/core/paintdc.rb +8 -0
  50. data/lib/wx/core/pen.rb +6 -0
  51. data/lib/wx/core/text_entry.rb +15 -0
  52. data/lib/wx/core/v_list_box.rb +13 -0
  53. data/lib/wx/core/window.rb +29 -2
  54. data/lib/wx/doc/app.rb +40 -0
  55. data/lib/wx/doc/brush.rb +17 -0
  56. data/lib/wx/doc/busy_info.rb +21 -0
  57. data/lib/wx/doc/client_dc.rb +28 -0
  58. data/lib/wx/doc/controlwithitems.rb +11 -0
  59. data/lib/wx/doc/dc.rb +0 -14
  60. data/lib/wx/doc/event_blocker.rb +27 -0
  61. data/lib/wx/doc/evthandler.rb +4 -0
  62. data/lib/wx/doc/extra/02_lifecycles.md +49 -0
  63. data/lib/wx/doc/extra/10_art.md +1 -1
  64. data/lib/wx/doc/extra/11_drawing_and_dc.md +62 -0
  65. data/lib/wx/doc/font.rb +27 -0
  66. data/lib/wx/doc/gen/about_dialog_info.rb +27 -24
  67. data/lib/wx/doc/gen/accelerator.rb +11 -12
  68. data/lib/wx/doc/gen/activity_indicator.rb +65 -0
  69. data/lib/wx/doc/gen/app.rb +6 -3
  70. data/lib/wx/doc/gen/art_provider.rb +53 -29
  71. data/lib/wx/doc/gen/aui/aui_manager.rb +4 -0
  72. data/lib/wx/doc/gen/aui/aui_mdi_child_frame.rb +1 -1
  73. data/lib/wx/doc/gen/aui/aui_pane_info.rb +2 -0
  74. data/lib/wx/doc/gen/aui/aui_tab_ctrl.rb +2 -0
  75. data/lib/wx/doc/gen/aui/aui_tool_bar.rb +2 -2
  76. data/lib/wx/doc/gen/bitmap.rb +25 -25
  77. data/lib/wx/doc/gen/bitmap_combo_box.rb +157 -0
  78. data/lib/wx/doc/gen/box_sizer.rb +6 -8
  79. data/lib/wx/doc/gen/brush.rb +2 -0
  80. data/lib/wx/doc/gen/busy_info.rb +52 -46
  81. data/lib/wx/doc/gen/caret.rb +0 -4
  82. data/lib/wx/doc/gen/check_list_box.rb +0 -2
  83. data/lib/wx/doc/gen/choice.rb +1 -5
  84. data/lib/wx/doc/gen/client_dc.rb +13 -18
  85. data/lib/wx/doc/gen/clipboard.rb +30 -27
  86. data/lib/wx/doc/gen/collapsible_pane.rb +11 -9
  87. data/lib/wx/doc/gen/colour.rb +6 -3
  88. data/lib/wx/doc/gen/colour_dialog.rb +111 -23
  89. data/lib/wx/doc/gen/combo_box.rb +2 -4
  90. data/lib/wx/doc/gen/context_help_button.rb +48 -0
  91. data/lib/wx/doc/gen/control.rb +20 -18
  92. data/lib/wx/doc/gen/core.rb +2 -2
  93. data/lib/wx/doc/gen/cursor.rb +18 -50
  94. data/lib/wx/doc/gen/data_format.rb +0 -2
  95. data/lib/wx/doc/gen/data_object.rb +37 -44
  96. data/lib/wx/doc/gen/dc.rb +16 -24
  97. data/lib/wx/doc/gen/defs.rb +3 -40
  98. data/lib/wx/doc/gen/dialog.rb +21 -17
  99. data/lib/wx/doc/gen/dir_dialog.rb +10 -8
  100. data/lib/wx/doc/gen/event.rb +2 -2
  101. data/lib/wx/doc/gen/event_blocker.rb +51 -0
  102. data/lib/wx/doc/gen/event_filter.rb +88 -0
  103. data/lib/wx/doc/gen/event_list.rb +23 -2
  104. data/lib/wx/doc/gen/events.rb +103 -112
  105. data/lib/wx/doc/gen/evt_handler.rb +28 -52
  106. data/lib/wx/doc/gen/file_dialog.rb +53 -50
  107. data/lib/wx/doc/gen/find_replace_dialog.rb +1 -1
  108. data/lib/wx/doc/gen/font.rb +19 -2
  109. data/lib/wx/doc/gen/font_data.rb +2 -0
  110. data/lib/wx/doc/gen/font_dialog.rb +1 -1
  111. data/lib/wx/doc/gen/frame.rb +4 -3
  112. data/lib/wx/doc/gen/fs_file.rb +8 -0
  113. data/lib/wx/doc/gen/gcdc.rb +2 -22
  114. data/lib/wx/doc/gen/gdi_common.rb +18 -2
  115. data/lib/wx/doc/gen/gdi_object.rb +2 -0
  116. data/lib/wx/doc/gen/graphics_context.rb +4 -43
  117. data/lib/wx/doc/gen/graphics_object.rb +2 -0
  118. data/lib/wx/doc/gen/grid/grid_cell_attr.rb +2 -1
  119. data/lib/wx/doc/gen/grid/grid_ctrl.rb +4 -2
  120. data/lib/wx/doc/gen/grid/grid_table_message.rb +2 -0
  121. data/lib/wx/doc/gen/grid_bag_sizer.rb +4 -0
  122. data/lib/wx/doc/gen/help_controller.rb +4 -1
  123. data/lib/wx/doc/gen/html/html_cell.rb +4 -1
  124. data/lib/wx/doc/gen/html/html_help_controller.rb +4 -1
  125. data/lib/wx/doc/gen/html/html_help_data.rb +4 -0
  126. data/lib/wx/doc/gen/html/html_help_window.rb +2 -1
  127. data/lib/wx/doc/gen/html/html_list_box.rb +138 -11
  128. data/lib/wx/doc/gen/html/html_window.rb +9 -3
  129. data/lib/wx/doc/gen/hyperlink_ctrl.rb +147 -0
  130. data/lib/wx/doc/gen/hyperlink_event.rb +43 -0
  131. data/lib/wx/doc/gen/icon.rb +7 -1
  132. data/lib/wx/doc/gen/icon_location.rb +2 -0
  133. data/lib/wx/doc/gen/image.rb +15 -8
  134. data/lib/wx/doc/gen/keyboard_state.rb +6 -0
  135. data/lib/wx/doc/gen/list_box.rb +0 -11
  136. data/lib/wx/doc/gen/list_ctrl.rb +10 -13
  137. data/lib/wx/doc/gen/locale.rb +7 -3
  138. data/lib/wx/doc/gen/log.rb +6 -2
  139. data/lib/wx/doc/gen/mdi_frame.rb +2 -0
  140. data/lib/wx/doc/gen/media_ctrl.rb +2 -0
  141. data/lib/wx/doc/gen/memory_dc.rb +105 -18
  142. data/lib/wx/doc/gen/menu.rb +4 -2
  143. data/lib/wx/doc/gen/menu_bar.rb +0 -8
  144. data/lib/wx/doc/gen/menu_item.rb +9 -3
  145. data/lib/wx/doc/gen/message_dialog.rb +6 -3
  146. data/lib/wx/doc/gen/mirror_dc.rb +2 -8
  147. data/lib/wx/doc/gen/mouse_state.rb +2 -0
  148. data/lib/wx/doc/gen/multi_choice_dialog.rb +0 -2
  149. data/lib/wx/doc/gen/non_owned_window.rb +2 -1
  150. data/lib/wx/doc/gen/notebook.rb +4 -2
  151. data/lib/wx/doc/gen/paint_dc.rb +2 -6
  152. data/lib/wx/doc/gen/palette.rb +3 -3
  153. data/lib/wx/doc/gen/pen.rb +6 -1
  154. data/lib/wx/doc/gen/pg/pg_editor.rb +2 -1
  155. data/lib/wx/doc/gen/pg/pg_multi_button.rb +4 -0
  156. data/lib/wx/doc/gen/pg/pg_properties.rb +30 -3
  157. data/lib/wx/doc/gen/pg/pg_property.rb +30 -4
  158. data/lib/wx/doc/gen/pg/pg_validation_info.rb +2 -0
  159. data/lib/wx/doc/gen/pg/property_grid.rb +5 -2
  160. data/lib/wx/doc/gen/pg/property_grid_interface.rb +6 -2
  161. data/lib/wx/doc/gen/pg/property_grid_manager.rb +2 -0
  162. data/lib/wx/doc/gen/pg/property_grid_page_state.rb +2 -0
  163. data/lib/wx/doc/gen/picker_base.rb +2 -1
  164. data/lib/wx/doc/gen/platform_info.rb +4 -1
  165. data/lib/wx/doc/gen/property_sheet_dialog.rb +2 -0
  166. data/lib/wx/doc/gen/prt/post_script_dc.rb +2 -8
  167. data/lib/wx/doc/gen/prt/print_data.rb +6 -0
  168. data/lib/wx/doc/gen/prt/printer.rb +0 -3
  169. data/lib/wx/doc/gen/prt/printer_dc.rb +2 -6
  170. data/lib/wx/doc/gen/radio_box.rb +2 -10
  171. data/lib/wx/doc/gen/rbn/ribbon_art_provider.rb +6 -0
  172. data/lib/wx/doc/gen/rbn/ribbon_panel.rb +1 -1
  173. data/lib/wx/doc/gen/region.rb +2 -0
  174. data/lib/wx/doc/gen/rtc/rich_text_buffer.rb +6 -0
  175. data/lib/wx/doc/gen/rtc/rich_text_ctrl.rb +0 -4
  176. data/lib/wx/doc/gen/rtc/rich_text_header_footer_data.rb +2 -0
  177. data/lib/wx/doc/gen/rtc/rich_text_html_handler.rb +2 -1
  178. data/lib/wx/doc/gen/rtc/symbol_picker_dialog.rb +2 -0
  179. data/lib/wx/doc/gen/screen_dc.rb +2 -0
  180. data/lib/wx/doc/gen/scroll_bar.rb +2 -1
  181. data/lib/wx/doc/gen/scrolled_canvas.rb +4 -8
  182. data/lib/wx/doc/gen/scrolled_control.rb +4 -8
  183. data/lib/wx/doc/gen/scrolled_window.rb +4 -8
  184. data/lib/wx/doc/gen/search_ctrl.rb +131 -0
  185. data/lib/wx/doc/gen/single_choice_dialog.rb +0 -2
  186. data/lib/wx/doc/gen/sizer.rb +14 -3
  187. data/lib/wx/doc/gen/splash_screen.rb +2 -0
  188. data/lib/wx/doc/gen/static_box.rb +6 -3
  189. data/lib/wx/doc/gen/static_box_sizer.rb +2 -1
  190. data/lib/wx/doc/gen/status_bar.rb +0 -5
  191. data/lib/wx/doc/gen/stc/styled_text_ctrl.rb +4 -5
  192. data/lib/wx/doc/gen/svg_file_dc.rb +10 -11
  193. data/lib/wx/doc/gen/text_ctrl.rb +10 -3
  194. data/lib/wx/doc/gen/text_entry.rb +8 -3
  195. data/lib/wx/doc/gen/text_entry_dialog.rb +4 -2
  196. data/lib/wx/doc/gen/timer_event.rb +2 -0
  197. data/lib/wx/doc/gen/tool_bar.rb +8 -4
  198. data/lib/wx/doc/gen/top_level_window.rb +5 -2
  199. data/lib/wx/doc/gen/tree_ctrl.rb +0 -6
  200. data/lib/wx/doc/gen/ui_action_simulator.rb +100 -0
  201. data/lib/wx/doc/gen/utils.rb +1 -1
  202. data/lib/wx/doc/gen/v_list_box.rb +36 -26
  203. data/lib/wx/doc/gen/validator.rb +2 -1
  204. data/lib/wx/doc/gen/variant.rb +10 -0
  205. data/lib/wx/doc/gen/window.rb +38 -17
  206. data/lib/wx/doc/gen/window_dc.rb +2 -0
  207. data/lib/wx/doc/gen/window_disabler.rb +2 -0
  208. data/lib/wx/doc/gen/wizard_page_simple.rb +2 -0
  209. data/lib/wx/doc/gen/xml_node.rb +6 -0
  210. data/lib/wx/doc/gen/xml_resource.rb +4 -1
  211. data/lib/wx/doc/memory_dc.rb +75 -0
  212. data/lib/wx/doc/mirror_dc.rb +16 -0
  213. data/lib/wx/doc/pen.rb +17 -0
  214. data/lib/wx/doc/prt/printer_dc.rb +26 -0
  215. data/lib/wx/doc/radio_box.rb +20 -0
  216. data/lib/wx/doc/screen_dc.rb +10 -6
  217. data/lib/wx/doc/svg_file_dc.rb +20 -0
  218. data/lib/wx/doc/v_list_box.rb +9 -0
  219. data/lib/wx/doc/window.rb +27 -0
  220. data/lib/wx/doc/window_disabler.rb +10 -0
  221. data/lib/wx/html/keyword_defs.rb +6 -7
  222. data/lib/wx/html/require.rb +1 -0
  223. data/lib/wx/html/simple_html_listbox.rb +105 -0
  224. data/lib/wx/keyword_defs.rb +83 -75
  225. data/lib/wx/prt/keyword_defs.rb +5 -1
  226. data/lib/wx/version.rb +1 -1
  227. data/lib/wx/wxruby/cmd/test.rb +1 -1
  228. data/lib/wxruby_aui.so +0 -0
  229. data/lib/wxruby_core.so +0 -0
  230. data/lib/wxruby_grid.so +0 -0
  231. data/lib/wxruby_html.so +0 -0
  232. data/lib/wxruby_pg.so +0 -0
  233. data/lib/wxruby_prt.so +0 -0
  234. data/lib/wxruby_rbn.so +0 -0
  235. data/lib/wxruby_rtc.so +0 -0
  236. data/lib/wxruby_stc.so +0 -0
  237. data/rakelib/install.rb +20 -7
  238. data/rakelib/lib/config/linux.rb +4 -2
  239. data/rakelib/lib/config/macosx.rb +120 -1
  240. data/rakelib/lib/config/mingw.rb +6 -1
  241. data/rakelib/lib/config/unixish.rb +26 -11
  242. data/rakelib/lib/config.rb +15 -6
  243. data/rakelib/yard/yard/relative_markdown_links.rb +5 -1
  244. data/samples/aui/aui.rb +432 -363
  245. data/samples/bigdemo/wxArtProvider.rbw +5 -4
  246. data/samples/controls/controls.rb +2 -2
  247. data/samples/controls/htlbox.rb +411 -0
  248. data/samples/controls/tn_htlbox.png +0 -0
  249. data/samples/drawing/graphics_drawing.rb +1 -2
  250. data/samples/drawing/{svgtest.rb → image_prt.rb} +49 -18
  251. data/samples/drawing/tn_image_prt.png +0 -0
  252. data/samples/propgrid/propgrid.rb +26 -21
  253. data/samples/ribbon/ribbon.rb +47 -46
  254. data/samples/sampler/editor.rb +33 -25
  255. data/samples/sampler/sample.rb +2 -2
  256. data/samples/sampler/stc_editor.rb +4 -2
  257. data/tests/lib/item_container_tests.rb +82 -0
  258. data/tests/lib/text_entry_tests.rb +80 -0
  259. data/tests/lib/wxapp_runner.rb +15 -3
  260. data/tests/lib/wxframe_runner.rb +144 -0
  261. data/tests/test_app_event_filter.rb +74 -0
  262. data/tests/test_art_provider.rb +52 -0
  263. data/tests/test_clipboard.rb +2 -1
  264. data/tests/test_event_handling.rb +199 -16
  265. data/tests/test_events.rb +4 -11
  266. data/tests/test_ext_controls.rb +28 -0
  267. data/tests/test_font.rb +239 -0
  268. data/tests/test_gdi_object.rb +161 -0
  269. data/tests/test_intl.rb +16 -15
  270. data/tests/test_item_data.rb +33 -1
  271. data/tests/test_std_controls.rb +373 -0
  272. data/tests/test_window.rb +340 -0
  273. metadata +61 -8
  274. data/lib/wx/doc/gen/auto_buffered_paint_dc.rb +0 -47
  275. data/lib/wx/doc/gen/buffered_dc.rb +0 -95
  276. data/lib/wx/doc/gen/buffered_paint_dc.rb +0 -55
  277. data/lib/wx/doc/gen/colour_data.rb +0 -96
  278. data/samples/drawing/tn_svgtest.png +0 -0
@@ -72,15 +72,16 @@ module Wx
72
72
  # @overload get_size_from_text_size(xlen, ylen=-1)
73
73
  # Determine the size needed by the control to leave the given area for its text.
74
74
  # This function is mostly useful with control displaying short amounts of text that can be edited by the user, e.g. {Wx::TextCtrl}, {Wx::ComboBox}, {Wx::SearchCtrl} etc. Typically it is used to size these controls for the maximal amount of input they are supposed to contain, for example:
75
- #
76
- # // Create a control for post code entry.
77
- # wxTextCtrl* postcode = new wxTextCtrl(this, ...);
75
+ # ```ruby
76
+ # # Create a control for post code entry.
77
+ # postcode = Wx::TextCtrl.new(self, ...)
78
78
  #
79
- # // And set its initial and minimal size to be big enough for
80
- # // entering 5 digits.
81
- # postcode->SetInitialSize(
82
- # postcode->GetSizeFromTextSize(
83
- # postcode->GetTextExtent("99999")));
79
+ # # And set its initial and minimal size to be big enough for
80
+ # # entering 5 digits.
81
+ # postcode.set_initial_size(
82
+ # postcode.get_size_from_text_size(
83
+ # postcode.get_text_extent("99999")))
84
+ # ```
84
85
  #
85
86
  # Currently this method is only implemented for {Wx::TextCtrl}, {Wx::ComboBox} and {Wx::Choice} in {Wx::MSW} and {Wx::GTK}.
86
87
  #
@@ -97,11 +98,11 @@ module Wx
97
98
 
98
99
  # Determine the minimum size needed by the control to display the given text.
99
100
  # The helper function that uses combination of {Wx::Control#get_size_from_text_size} and {Wx::Control#get_text_extent} which used together pretty often:
100
- #
101
- # wxSize GetSizeFromText(const wxString& text) const
102
- # {
103
- # return GetSizeFromTextSize(GetTextExtent(text).GetWidth());
104
- # }
101
+ # ```ruby
102
+ # def get_size_from_text(text)
103
+ # get_size_from_text_size(get_text_extent(text))
104
+ # end
105
+ # ```
105
106
  #
106
107
  # The size that the control should have to leave the area of the specified text. May return {Wx::DEFAULT_SIZE} if this method is not implemented for this particular control under the current platform.
107
108
  # @param text [String] The given text.
@@ -127,12 +128,13 @@ module Wx
127
128
  # Sets the controls label to a string using markup.
128
129
  # Simple markup supported by this function can be used to apply different fonts or colours to different parts of the control label when supported. If markup is not supported by the control or platform, it is simply stripped and {Wx::Control#set_label} is used with the resulting string.
129
130
  # For example,
130
- #
131
- # wxStaticText *text;
131
+ # ```ruby
132
+ # text = Wx::StaticText.new
132
133
  # ...
133
- # text->SetLabelMarkup("<b>&amp;Bed</b> &amp;mp; "
134
- # "<span foreground='red'>breakfast</span> "
135
- # "available <big>HERE</big>");
134
+ # text.set_label_markup("<b>&amp;Bed</b> &amp;mp; "+
135
+ # "<span foreground='red'>breakfast</span> "+
136
+ # "available <big>HERE</big>")
137
+ # ```
136
138
  # would show the string using bold, red and big for the corresponding words under {Wx::GTK} but will simply show the string "Bed &amp; breakfast
137
139
  # available HERE" on the other platforms. In any case, the "B" of "Bed" will be underlined to indicate that it can be used as a mnemonic for this control.
138
140
  # The supported tags are:
@@ -7,10 +7,10 @@
7
7
  module Wx
8
8
 
9
9
  # wxRuby version string
10
- Wx::WXRUBY_VERSION = '0.9.0-beta.14'
10
+ Wx::WXRUBY_VERSION = '0.9.0-rc.2'
11
11
 
12
12
  # wxRuby version release type (alpha, beta, rc)
13
- Wx::WXRUBY_RELEASE_TYPE = 'beta.14'
13
+ Wx::WXRUBY_RELEASE_TYPE = 'rc.2'
14
14
  # wxRuby major version number
15
15
  Wx::WXRUBY_MAJOR = 0
16
16
  # wxRuby minor version number
@@ -11,63 +11,30 @@ module Wx
11
11
  NULL_CURSOR = nil
12
12
 
13
13
  # A cursor is a small bitmap usually used for denoting where the mouse pointer is, with a picture that might indicate the interpretation of a mouse click.
14
- # As with icons, cursors in X and MS Windows are created in a different manner. Therefore, separate cursors will be created for the different environments. Platform-specific methods for creating a {Wx::Cursor} object are catered for, and this is an occasion where conditional compilation will probably be required (see {Wx::Icon} for an example).
15
- # A single cursor object may be used in many windows (any subwindow type). The wxWidgets convention is to set the cursor for a window, as in X, rather than to set it globally as in MS Windows, although a global {set_cursor} function is also available for MS Windows use.
16
- #
17
- # == Creating a Custom Cursor
18
- #
19
- # The following is an example of creating a cursor from 32x32 bitmap data (down_bits) and a mask (down_mask) where 1 is black and 0 is white for the bits, and 1 is opaque and 0 is transparent for the mask. It works on Windows and GTK+.
20
- #
21
- # static char down_bits[] = { 255, 255, 255, 255, 31,
22
- # 255, 255, 255, 31, 255, 255, 255, 31, 255, 255, 255,
23
- # 31, 255, 255, 255, 31, 255, 255, 255, 31, 255, 255,
24
- # 255, 31, 255, 255, 255, 31, 255, 255, 255, 25, 243,
25
- # 255, 255, 19, 249, 255, 255, 7, 252, 255, 255, 15, 254,
26
- # 255, 255, 31, 255, 255, 255, 191, 255, 255, 255, 255,
27
- # 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
28
- # 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
29
- # 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
30
- # 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
31
- # 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
32
- # 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
33
- # 255 };
34
- #
35
- # static char down_mask[] = { 240, 1, 0, 0, 240, 1,
36
- # 0, 0, 240, 1, 0, 0, 240, 1, 0, 0, 240, 1, 0, 0, 240, 1,
37
- # 0, 0, 240, 1, 0, 0, 240, 1, 0, 0, 255, 31, 0, 0, 255,
38
- # 31, 0, 0, 254, 15, 0, 0, 252, 7, 0, 0, 248, 3, 0, 0,
39
- # 240, 1, 0, 0, 224, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0,
40
- # 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
41
- # 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
42
- # 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
43
- # 0, 0, 0, 0, 0 };
44
- #
45
- # #ifdef __WXMSW__
46
- # wxBitmap down_bitmap(down_bits, 32, 32);
47
- # wxBitmap down_mask_bitmap(down_mask, 32, 32);
48
- #
49
- # down_bitmap.SetMask(new wxMask(down_mask_bitmap));
50
- # wxImage down_image = down_bitmap.ConvertToImage();
51
- # down_image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, 6);
52
- # down_image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y, 14);
53
- # wxCursor down_cursor = wxCursor(down_image);
54
- # #elif defined(__WXGTK__) or defined(__WXMOTIF__)
55
- # wxCursor down_cursor = wxCursor(down_bits, 32, 32, 6, 14,
56
- # down_mask, wxWHITE, wxBLACK);
57
- # #endif
14
+ # As with icons, cursors in X and MS Windows are created in a different manner. Therefore, separate cursors
15
+ # will be created for the different environments. Platform-specific methods for creating a {Wx::Cursor} object
16
+ # are catered for, and this is an occasion where conditional compilation will probably be required
17
+ # (see {Wx::Icon} for an example).
18
+ # A single cursor object may be used in many windows (any subwindow type). The wxWidgets convention is to set
19
+ # the cursor for a window, as in X, rather than to set it globally as in MS Windows, although a global
20
+ # {set_cursor} function is also available for MS Windows use.
58
21
  #
59
22
  # ===
60
23
  #
61
24
  # Category: Graphics Device Interface (GDI)
62
25
  # Predefined objects/pointers:
63
- # - {Wx::NULL_CURSOR}- {Wx::STANDARD_CURSOR}- {Wx::HOURGLASS_CURSOR}- {Wx::CROSS_CURSOR}
26
+ # - {Wx::NULL_CURSOR}
27
+ # - {Wx::STANDARD_CURSOR}
28
+ # - {Wx::HOURGLASS_CURSOR}
29
+ # - {Wx::CROSS_CURSOR}
64
30
  # @see Wx::Bitmap
65
31
  # @see Wx::Icon
66
32
  # @see Wx::Window#set_cursor
67
- # @see set_cursor
68
- # @see Wx::StockCursor
33
+ # @see Wx.set_cursor
34
+ # @see Wx::StockCursor
69
35
  #
70
36
  #
37
+ # @note This class is <b>untracked</b> and should not be derived from nor instances extended!
71
38
  class Cursor < GDIObject
72
39
 
73
40
  # @overload initialize()
@@ -93,9 +60,10 @@ module Wx
93
60
  # In {Wx::GTK}, colour cursors and alpha channel are supported (starting from GTK+ 2.2). Otherwise the two most frequent colors will be used for foreground and background. In any case, the cursor will be displayed at the size of the image.
94
61
  # Under {Wx::Mac} (Cocoa), large cursors are supported.
95
62
  # Notice that the image can define the cursor hot spot. To set it you need to use {Wx::Image#set_option} with {Wx::IMAGE_OPTION_CUR_HOTSPOT_X} or {Wx::IMAGE_OPTION_CUR_HOTSPOT_Y}, e.g.
96
- #
97
- # image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, hotSpotX);
98
- # image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, hotSpotY);
63
+ # ```ruby
64
+ # image.set_option(Wx::IMAGE_OPTION_CUR_HOTSPOT_X, hotSpotX)
65
+ # image.set_option(Wx::IMAGE_OPTION_CUR_HOTSPOT_X, hotSpotY)
66
+ # ```
99
67
  # @param image [Wx::Image]
100
68
  # @return [Cursor]
101
69
  # @overload initialize(xpmData)
@@ -48,12 +48,10 @@ module Wx
48
48
 
49
49
  # @overload initialize(format=Wx::DataFormatId::DF_INVALID)
50
50
  # Constructs a data format object for one of the standard data formats or an empty data object (use {Wx::DataFormat#set_type} or {Wx::DataFormat#set_id} later in this case).
51
- # <b>{Wx::Perl} Note:</b> In {Wx::Perl} use Wx::Bitmap->newNative(format).
52
51
  # @param format [DataFormatId]
53
52
  # @return [DataFormat]
54
53
  # @overload initialize(format)
55
54
  # Constructs a data format object for a custom format identified by its name format.
56
- # <b>{Wx::Perl} Note:</b> In {Wx::Perl} use Wx::Bitmap->newUser(format).
57
55
  # @param format [String]
58
56
  # @return [DataFormat]
59
57
  def initialize(*args) end
@@ -28,7 +28,7 @@ module Wx
28
28
  # Note that neither the GTK+ data transfer mechanisms for clipboard and drag and drop, nor OLE data transfer, copies any data until another application actually requests the data. This is in contrast to the 'feel' offered to the user of a program who would normally think that the data resides in the clipboard after having pressed 'Copy' - in reality it is only declared to be available.
29
29
  # You may also derive your own data object classes from {Wx::CustomDataObject} for user-defined types. The format of user-defined data is given as a mime-type string literal, such as "application/word" or "image/png". These strings are used as they are under Unix (so far only GTK+) to identify a format and are translated into their Windows equivalent under Win32 (using the OLE IDataObject for data exchange to and from the clipboard and for drag and drop). Note that the format string translation under Windows is not yet finished.
30
30
  # Each class derived directly from {Wx::DataObject} must override and implement all of its functions which are pure virtual in the base class. The data objects which only render their data or only set it (i.e. work in only one direction), should return 0 from {Wx::DataObject#get_format_count}.
31
- # <b>{Wx::Perl} Note:</b> This class is not currently usable from {Wx::Perl}; you may use Wx::PlDataObjectSimple instead.
31
+ #
32
32
  # ===
33
33
  #
34
34
  # Category: Clipboard and Drag & Drop
@@ -72,7 +72,6 @@ module Wx
72
72
 
73
73
  # Copies all formats supported in the given direction dir to the array pointed to by formats.
74
74
  # There must be enough space for GetFormatCount(dir) formats in it.
75
- # <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method only takes the dir parameter. In scalar context it returns the first format in the list, in list context it returns a list containing all the supported formats.
76
75
  # @param dir [Direction]
77
76
  # @return [Array<Wx::DataFormat>]
78
77
  def get_all_formats(dir=Wx::DataObjectSimpleBase::Direction::Get) end
@@ -136,51 +135,43 @@ module Wx
136
135
  # See {Wx::DataObject} documentation for the reasons why you might prefer to use {Wx::DataObject} directly instead of {Wx::DataObjectComposite} for efficiency reasons.
137
136
  # This example shows how a composite data object capable of storing either bitmaps or file names (presumably of bitmap files) can be initialized and used:
138
137
  #
139
- # MyDropTarget::MyDropTarget()
140
- # {
141
- # wxDataObjectComposite* dataobj = new wxDataObjectComposite();
142
- # dataobj->Add(new wxBitmapDataObject(), true);
143
- # dataobj->Add(new wxFileDataObject());
144
- # SetDataObject(dataobj);
145
- # }
146
- #
147
- # wxDragResult MyDropTarget::OnData(wxCoord x, wxCoord y,
148
- # wxDragResult defaultDragResult)
149
- # {
150
- # if ( !GetData() )
151
- # return wxDragNone;
152
- #
153
- # wxDataObjectComposite *
154
- # dataobjComp = static_cast<wxDataObjectComposite *>(GetDataObject());
155
- #
156
- # wxDataFormat format = dataobjComp->GetReceivedFormat();
157
- # wxDataObject *dataobj = dataobjComp->GetObject(format);
158
- # switch ( format.GetType() )
159
- # {
160
- # case wxDF_BITMAP:
161
- # {
162
- # wxBitmapDataObject *
163
- # dataobjBitmap = static_cast<wxBitmapDataObject *>(dataobj);
164
- #
165
- # ... use dataobj->GetBitmap() ...
166
- # }
167
- # break;
138
+ # ```ruby
139
+ # class MyDropTarget < Wx::DropTarget
140
+ #
141
+ # def initialize
142
+ # dataobj = Wx::DataObjectComposite.new
143
+ # dataobj.add(Wx::BitmapDataObject.new, true)
144
+ # dataobj.add(Wx::FileDataObject.new)
145
+ # set_data_object(dataobj)
146
+ # end
168
147
  #
169
- # case wxDF_FILENAME:
170
- # {
171
- # wxFileDataObject *
172
- # dataobjFile = static_cast<wxFileDataObject *>(dataobj);
148
+ # def on_data(x, y, defaultDragResult)
149
+ # return Wx::DragNone unless get_data
173
150
  #
174
- # ... use dataobj->GetFilenames() ...
175
- # }
176
- # break;
151
+ # dataobj_comp = get_data_object
177
152
  #
178
- # default:
179
- # wxFAIL_MSG( "unexpected data object format" );
180
- # }
153
+ # format = dataobj_comp.get_received_format
154
+ # dataobj = dataobj_comp.get_object(format)
155
+ # case format.get_type
156
+ # when Wx::DataFormatId::DF_BITMAP
157
+ # # dataobj is Wx::BitmapDataObject
158
+ #
159
+ # ... use dataobj.get_bitmap ...
160
+ #
161
+ # when Wx::DataFormatId::DF_FILENAME
162
+ # # dataobj is Wx::FileDataObject
163
+ #
164
+ # ... use dataobj->GetFilenames() ...
165
+ #
166
+ # else
167
+ # Wx.log_error("unexpected data object format")
168
+ # end
181
169
  #
182
- # return defaultDragResult;
183
- # }
170
+ # defaultDragResult
171
+ # end
172
+ #
173
+ # end
174
+ # ```
184
175
  #
185
176
  # ===
186
177
  #
@@ -383,7 +374,9 @@ module Wx
383
374
  # {Wx::URLDataObject} is a {Wx::DataObject} containing an URL and can be used e.g.
384
375
  # when you need to put an URL on or retrieve it from the clipboard:
385
376
  #
386
- # wxTheClipboard->SetData(new wxURLDataObject(url));
377
+ # ```ruby
378
+ # Wx::Clipboard.open { |clip| clip.place(Wx::URLDataObject.new(url))
379
+ # ```
387
380
  #
388
381
  # The actual base class of this class is not always {Wx::DataObject} itself, but rather either {Wx::DataObjectComposite} in {Wx::MSW} and {Wx::GTK} or {Wx::TextDataObject} in the other ports. Please don't rely on the exact base class, it is not guaranteed that it won't change in the future.
389
382
  #
data/lib/wx/doc/gen/dc.rb CHANGED
@@ -162,6 +162,8 @@ module Wx
162
162
  # @see Wx::DCClipper
163
163
  #
164
164
  #
165
+ #
166
+ # @note This class is <b>untracked</b> and should not be derived from nor instances extended!
165
167
  class DC < Object
166
168
 
167
169
  # Convert device X coordinate to logical coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.
@@ -431,7 +433,6 @@ module Wx
431
433
 
432
434
  # Draws lines using an array of points of size n adding the optional offset coordinate.
433
435
  # The current pen is used for drawing the lines.
434
- # <b>{Wx::Perl} Note:</b> Not supported by {Wx::Perl}.
435
436
  # @param points [Array<Wx::Point>,Array<Array<Integer>>]
436
437
  # @param xoffset [Integer]
437
438
  # @param yoffset [Integer]
@@ -454,7 +455,6 @@ module Wx
454
455
  # The first and last points are automatically closed.
455
456
  # The last argument specifies the fill rule: <b>{Wx::PolygonFillMode::ODDEVEN_RULE}</b> (the default) or <b>{Wx::PolygonFillMode::WINDING_RULE}</b>.
456
457
  # The current pen is used for drawing the outline, and the current brush for filling the shape. Using a transparent brush suppresses filling.
457
- # <b>{Wx::Perl} Note:</b> Not supported by {Wx::Perl}.
458
458
  # @param points [Array<Wx::Point>,Array<Array<Integer>>]
459
459
  # @param xoffset [Integer]
460
460
  # @param yoffset [Integer]
@@ -540,13 +540,10 @@ module Wx
540
540
  # Draws a spline between all given points using the current pen.
541
541
  # The number of points must be at least 2 for the spline to be drawn.
542
542
  # Drawn curve is not an interpolating curve - it does not go through all points. It may be considered a smoothing curve.
543
- #
544
- # <b>{Wx::Perl} Note:</b> Not supported by {Wx::Perl}.
545
543
  # @param points [Array<Wx::Point>,Array<Array<Integer>>]
546
544
  # @return [void]
547
545
  # @overload draw_spline(x1, y1, x2, y2, x3, y3)
548
546
  # This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
549
- # <b>{Wx::Perl} Note:</b> Not supported by {Wx::Perl}.
550
547
  # @param x1 [Integer]
551
548
  # @param y1 [Integer]
552
549
  # @param x2 [Integer]
@@ -711,8 +708,6 @@ module Wx
711
708
  # If the optional parameter font is specified and valid, then it is used for the text extent calculation, otherwise the currently selected font is used.
712
709
  # If string is empty, its horizontal extent is 0 but, for convenience when using this function for allocating enough space for a possibly multi-line string, its vertical extent is the same as the height of an empty line of text. Please note that this behaviour differs from that of {Wx::DC#get_text_extent}.
713
710
  # This function works with both single-line and multi-line strings.
714
- #
715
- # <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method is implemented as GetMultiLineTextExtent(string, font = undef) returning a 3-element list (width, height, line_height)
716
711
  # @see Wx::Font
717
712
  # @see Wx::DC#set_font
718
713
  # @see Wx::DC#get_partial_text_extents
@@ -728,8 +723,6 @@ module Wx
728
723
  # The text extent as a {Wx::Size} object.
729
724
  #
730
725
  # This function works with both single-line and multi-line strings.
731
- #
732
- # <b>{Wx::Perl} Note:</b> Not supported by {Wx::Perl}.
733
726
  # @see Wx::Font
734
727
  # @see Wx::DC#set_font
735
728
  # @see Wx::DC#get_partial_text_extents
@@ -745,8 +738,6 @@ module Wx
745
738
  # If the optional parameter font is specified and valid, then it is used for the text extent calculation. Otherwise the currently selected font is.
746
739
  # If string is empty, its extent is 0 in both directions, as expected.
747
740
  # This function only works with single-line strings.
748
- #
749
- # <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method is implemented as GetTextExtent(string, font = undef) returning a 4-element list (width, height, descent, externalLeading)
750
741
  # @see Wx::Font
751
742
  # @see Wx::DC#set_font
752
743
  # @see Wx::DC#get_partial_text_extents
@@ -758,7 +749,6 @@ module Wx
758
749
  alias_method :text_extent, :get_text_extent
759
750
 
760
751
  # This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
761
- # <b>{Wx::Perl} Note:</b> Not supported by {Wx::Perl}.
762
752
  # @param string [String]
763
753
  # @return [Wx::Size]
764
754
  def get_text_size(string) end
@@ -872,6 +862,10 @@ module Wx
872
862
  # @return [true,false]
873
863
  def start_doc(message) end
874
864
 
865
+ # Starts a document page (only relevant when outputting to a printer).
866
+ # @return [void]
867
+ def start_page; end
868
+
875
869
  # Ends a document (only relevant when outputting to a printer).
876
870
  # @return [void]
877
871
  def end_doc; end
@@ -964,21 +958,21 @@ module Wx
964
958
  # Gets the brush used for painting the background.
965
959
  #
966
960
  # @see Wx::DC#set_background
967
- # @return [void]
961
+ # @return [Wx::Brush]
968
962
  def get_background; end
969
963
  alias_method :background, :get_background
970
964
 
971
965
  # Gets the current brush.
972
966
  #
973
967
  # @see Wx::DC#set_brush
974
- # @return [void]
968
+ # @return [Wx::Brush]
975
969
  def get_brush; end
976
970
  alias_method :brush, :get_brush
977
971
 
978
972
  # Gets the current pen.
979
973
  #
980
974
  # @see Wx::DC#set_pen
981
- # @return [void]
975
+ # @return [Wx::Pen]
982
976
  def get_pen; end
983
977
  alias_method :pen, :get_pen
984
978
 
@@ -1141,14 +1135,12 @@ module Wx
1141
1135
  # It can be used to scale graphics to fit the page.
1142
1136
  # For example, if maxX and maxY represent the maximum horizontal and vertical 'pixel' values used in your application, the following code will scale the graphic to fit on the printer page:
1143
1137
  #
1144
- # wxCoord w, h;
1145
- # dc.GetSize(&w, &h);
1146
- # double scaleX = (double)(maxX / w);
1147
- # double scaleY = (double)(maxY / h);
1148
- # dc.SetUserScale(min(scaleX, scaleY),min(scaleX, scaleY));
1149
- #
1150
- # <b>{Wx::Perl} Note:</b> In {Wx::Perl} there are two methods instead of a single overloaded method:
1151
- # - {Wx::DC#get_size}: returns a Wx::Size object.- GetSizeWH(): returns a 2-element list (width, height).
1138
+ # ```ruby
1139
+ # sz = dc.get_dimensions
1140
+ # scaleX = (maxX.to_f / sz.width)
1141
+ # scaleY = (maxY.to_f / sz.height);
1142
+ # dc.set_user_scale([scaleX, scaleY].min,[scaleX, scaleY].min)
1143
+ # ```
1152
1144
  # @return [Array(Integer,Integer)]
1153
1145
  def get_dimensions; end
1154
1146
  alias_method :dimensions, :get_dimensions
@@ -1169,7 +1161,7 @@ module Wx
1169
1161
  alias_method :size_mm, :get_size_mm
1170
1162
 
1171
1163
  # Gets the current user scale factor.
1172
- # <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method takes no arguments and return a two element array (x, y).
1164
+ #
1173
1165
  # @see Wx::DC#set_user_scale
1174
1166
  # @param x [double]
1175
1167
  # @param y [double]
@@ -1430,7 +1430,7 @@ module Wx
1430
1430
 
1431
1431
  # Virtual keycodes used by {Wx::KeyEvent} and some other wxWidgets functions.
1432
1432
  #
1433
- # Note that the range 0..255 corresponds to the characters of the current locale, in particular the 32..127 subrange is for the ASCII symbols, and all the special key values such as WXK_END lie above this range.
1433
+ # Note that the range 0..255 corresponds to the characters of the current locale, in particular the 32..127 subrange is for the ASCII symbols, and all the special key values such as {Wx::K_END} lie above this range.
1434
1434
  #
1435
1435
  class KeyCode < Wx::Enum
1436
1436
 
@@ -1598,11 +1598,11 @@ module Wx
1598
1598
  #
1599
1599
  K_ALT = Wx::KeyCode.new(307)
1600
1600
 
1601
- # Note that under macOS, to improve compatibility with other systems, 'WXK_CONTROL' represents the 'Command' key.
1601
+ # Note that under macOS, to improve compatibility with other systems, '{Wx::K_CONTROL}' represents the 'Command' key.
1602
1602
  #
1603
1603
  K_CONTROL = Wx::KeyCode.new(308)
1604
1604
 
1605
- # Under macOS, where the 'Command' key is mapped to 'Control' to improve compatibility with other systems, WXK_RAW_CONTROL may be used to obtain the state of the actual 'Control' key ('WXK_CONTROL' would obtain the status of the 'Command' key).
1605
+ # Under macOS, where the 'Command' key is mapped to 'Control' to improve compatibility with other systems, {Wx::K_RAW}_CONTROL may be used to obtain the state of the actual 'Control' key ('{Wx::K_CONTROL}' would obtain the status of the 'Command' key).
1606
1606
  #
1607
1607
  K_RAW_CONTROL = Wx::KeyCode.new(308)
1608
1608
 
@@ -2787,42 +2787,5 @@ module Wx
2787
2787
  #
2788
2788
  DEFAULT_COORD = -1
2789
2789
 
2790
- # A function which deletes and nulls the pointer.
2791
- # This function uses operator delete to free the pointer and also sets it to NULL. Notice that this does not work for arrays, use {deletea} for them.
2792
- #
2793
- # MyClass *ptr = new MyClass;
2794
- # ...
2795
- # wxDELETE(ptr);
2796
- # wxASSERT(!ptr);
2797
- # @param ptr [T]
2798
- # @return [void]
2799
- def self.delete(ptr) end
2800
-
2801
- # A function which deletes and nulls the pointer.
2802
- # This function uses vector operator delete (delete[]) to free the array pointer and also sets it to NULL. Notice that this does not work for non-array pointers, use {delete} for them.
2803
- #
2804
- # MyClass *array = new MyClass[17];
2805
- # ...
2806
- # wxDELETEA(array);
2807
- # wxASSERT(!array);
2808
- # @see delete
2809
- # @param array [T]
2810
- # @return [void]
2811
- def self.deletea(array) end
2812
-
2813
- # Swaps the contents of two variables.
2814
- # This is similar to std::swap() but can be used even on the platforms where the standard C++ library is not available (if you don't target such platforms, please use std::swap() instead).
2815
- # The function relies on type T being copy constructible and assignable.
2816
- # Example of use:
2817
- #
2818
- # int x = 3,
2819
- # y = 4;
2820
- # wxSwap(x, y);
2821
- # wxASSERT( x == 4 && y == 3 );
2822
- # @param first [T]
2823
- # @param second [T]
2824
- # @return [void]
2825
- def self.swap(first, second) end
2826
-
2827
2790
 
2828
2791
  end
@@ -53,28 +53,32 @@ module Wx
53
53
  # == Modal and Modeless
54
54
  #
55
55
  # There are two kinds of dialog, modal and modeless. A modal dialog blocks program flow and user input on other windows until it is dismissed, whereas a modeless dialog behaves more like a frame in that program flow continues, and input in other windows is still possible. To show a modal dialog you should use the {Wx::Dialog#show_modal} method while to show a dialog modelessly you simply use {Wx::Dialog#show}, just as with frames.
56
- # Note that the modal dialog is one of the very few examples of {Wx::Window}-derived objects which may be created on the stack and not on the heap. In other words, while most windows would be created like this:
56
+ # Note that dialogs need to be explicitly destroyed when closed and not used anymore. The traditional code for this would be like:
57
57
  #
58
- # void AskUser()
59
- # {
60
- # MyAskDialog *dlg = new MyAskDialog(...);
61
- # if ( dlg->ShowModal() == wxID_OK )
62
- # // ...
63
- # //else: dialog was cancelled or some another button pressed
58
+ # ```ruby
59
+ # def ask_user
60
+ # dlg = MyAskDialog.new(...)
61
+ # if dlg.show_modal == Wx::ID_OK
62
+ # # ...
63
+ # #else: dialog was cancelled or some another button pressed
64
+ # end
64
65
  #
65
- # dlg->Destroy();
66
- # }
66
+ # dlg.destroy
67
+ # end
68
+ # ```
67
69
  #
68
70
  # You can achieve the same result with dialogs by using simpler code:
69
71
  #
70
- # void AskUser()
71
- # {
72
- # MyAskDialog dlg(...);
73
- # if ( dlg.ShowModal() == wxID_OK )
74
- # // ...
75
- #
76
- # // no need to call Destroy() here
77
- # }
72
+ # ```ruby
73
+ # def ask_user
74
+ # MyAskDialog(...) do |dlg|
75
+ # if dlg.show_modal == Wx::ID_OK
76
+ # # ...
77
+ # #else: dialog was cancelled or some another button pressed
78
+ # end
79
+ # end
80
+ # end
81
+ # ```
78
82
  #
79
83
  # An application can define a {Wx::CloseEvent} handler for the dialog to respond to system close events.
80
84
  # === Styles
@@ -40,11 +40,12 @@ module Wx
40
40
  # The arguments have the same meaning as those of {Wx::DirDialog#initialize}. The message is displayed at the top, and the default_path, if specified, is set as the initial selection.
41
41
  # The application must check for an empty return value (if the user pressed Cancel). For example:
42
42
  #
43
- # const wxString& dir = wxDirSelector("Choose a folder");
44
- # if ( !dir.empty() )
45
- # {
46
- # ...
47
- # }
43
+ # ```ruby
44
+ # dir = Wx.dir_selector('Choose a folder')
45
+ # unless dir.empty?
46
+ # ...
47
+ # end
48
+ # ```
48
49
  # @param message [String]
49
50
  # @param default_path [String]
50
51
  # @param style [Integer]
@@ -65,9 +66,10 @@ module Wx
65
66
  # - {Wx::DD_SHOW_HIDDEN}: Show hidden and system folders. This flag is only available since wxWidgets 3.1.4
66
67
  #
67
68
  # Notice that {Wx::RESIZE_BORDER} has special side effect under Windows where two different directory selection dialogs are available and this style also implicitly selects the new version as the old one always has fixed size. As the new version is almost always preferable, it is recommended that {Wx::RESIZE_BORDER} style be always used. This is the case if the dialog is created with the default style value but if you need to use any additional styles you should still specify {Wx::DD_DEFAULT_STYLE} unless you explicitly need to use the old dialog version under Windows. E.g. do
68
- #
69
- # wxDirDialog dlg(NULL, "Choose input directory", "",
70
- # wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST);
69
+ # ```ruby
70
+ # Wx::DirDialog(nil, 'Choose input directory', '',
71
+ # Wx::DD_DEFAULT_STYLE | Wx::DD_DIR_MUST_EXIST)
72
+ # ```
71
73
  # instead of just using {Wx::DD_DIR_MUST_EXIST} style alone.
72
74
  # MacOS 10.11+ does not display a title bar on the dialog. Use {Wx::DirDialog#set_message} to change the string displayed to the user at the top of the dialog after creation. The {Wx::DirDialog#set_title} method is provided for compatibility with pre-10.11 MacOS versions that do still support displaying the title bar.
73
75
  #
@@ -80,7 +80,7 @@ module Wx
80
80
  #
81
81
  K_CATEGORY_CUT = Wx::KeyCategoryFlags.new(16)
82
82
 
83
- # union of WXK_CATEGORY_ARROW, WXK_CATEGORY_PAGING, and WXK_CATEGORY_JUMP categories
83
+ # union of {Wx::K_CATEGORY}_ARROW, {Wx::K_CATEGORY}_PAGING, and {Wx::K_CATEGORY}_JUMP categories
84
84
  #
85
85
  K_CATEGORY_NAVIGATION = Wx::KeyCategoryFlags.new(7)
86
86
 
@@ -697,7 +697,7 @@ module Wx
697
697
  # An event is a structure holding information about an event passed to a callback or member function.
698
698
  # {Wx::Event} used to be a multipurpose event object, and is an abstract base class for other event classes (see below).
699
699
  # For more information about events, see the Events and Event Handling overview.
700
- # <b>{Wx::Perl} Note:</b> In {Wx::Perl} custom event classes should be derived from Wx::PlEvent and Wx::PlCommandEvent.
700
+ #
701
701
  # ===
702
702
  #
703
703
  # Category: {Wx::Events}
@@ -0,0 +1,51 @@
1
+ # :stopdoc:
2
+ # This file is automatically generated by the WXRuby3 documentation
3
+ # generator. Do not alter this file.
4
+ # :startdoc:
5
+
6
+
7
+ module Wx
8
+
9
+ # This class is a special event handler which allows discarding any event (or a set of event types) directed to a specific window.
10
+ # Example:
11
+ #
12
+ # ```ruby
13
+ # class MyWindow
14
+ #
15
+ # ...
16
+ #
17
+ # def do_something
18
+ # # block all events directed to this window
19
+ # Wx::EventBlocker.blocked_for(self) do
20
+ # # while we do 1000 function_that_sends_events calls
21
+ # 1000.times { |i| function_that_sends_events(i) }
22
+ # end
23
+ # # old event handler restored; generated event(s) from next call will be processed
24
+ # function_that_sends_events(0)
25
+ # end
26
+ #
27
+ # ...
28
+ #
29
+ # end
30
+ # ```
31
+ #
32
+ # ===
33
+ #
34
+ # Category: {Wx::Events}
35
+ # @see How Events are Processed
36
+ # @see Wx::EvtHandler
37
+ #
38
+ #
39
+ #
40
+ # @note This class is <b>untracked</b> and should not be derived from nor instances extended!
41
+ class EventBlocker < EvtHandler
42
+
43
+ # Adds to the list of event types which should be blocked the given eventType.
44
+ # @param eventType [Integer]
45
+ # @return [void]
46
+ def block(eventType) end
47
+
48
+ end # EventBlocker
49
+
50
+
51
+ end