wxruby3 0.9.0.pre.beta.11-x64-mingw-ucrt → 0.9.0.pre.beta.14-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
Files changed (272) hide show
  1. checksums.yaml +4 -4
  2. data/INSTALL.md +85 -0
  3. data/README.md +2 -0
  4. data/assets/logo.png +0 -0
  5. data/assets/logo.svg +170 -0
  6. data/assets/logo.xcf +0 -0
  7. data/ext/wxbase32u_gcc_custom.dll +0 -0
  8. data/ext/wxbase32u_net_gcc_custom.dll +0 -0
  9. data/ext/wxbase32u_xml_gcc_custom.dll +0 -0
  10. data/ext/wxmsw32u_aui_gcc_custom.dll +0 -0
  11. data/ext/wxmsw32u_core_gcc_custom.dll +0 -0
  12. data/ext/wxmsw32u_gl_gcc_custom.dll +0 -0
  13. data/ext/wxmsw32u_html_gcc_custom.dll +0 -0
  14. data/ext/wxmsw32u_media_gcc_custom.dll +0 -0
  15. data/ext/wxmsw32u_propgrid_gcc_custom.dll +0 -0
  16. data/ext/wxmsw32u_qa_gcc_custom.dll +0 -0
  17. data/ext/wxmsw32u_ribbon_gcc_custom.dll +0 -0
  18. data/ext/wxmsw32u_richtext_gcc_custom.dll +0 -0
  19. data/ext/wxmsw32u_stc_gcc_custom.dll +0 -0
  20. data/ext/wxmsw32u_webview_gcc_custom.dll +0 -0
  21. data/ext/wxmsw32u_xrc_gcc_custom.dll +0 -0
  22. data/lib/wx/accessors.rb +8 -2
  23. data/lib/wx/core/array_ext.rb +26 -0
  24. data/lib/wx/core/art_locator.rb +92 -0
  25. data/lib/wx/core/artprovider.rb +1 -1
  26. data/lib/wx/core/bitmap.rb +90 -53
  27. data/lib/wx/core/cursor.rb +12 -0
  28. data/lib/wx/core/dataformat.rb +3 -1
  29. data/lib/wx/core/dc.rb +76 -52
  30. data/lib/wx/core/enum.rb +4 -0
  31. data/lib/wx/core/event.rb +38 -5
  32. data/lib/wx/core/events/evt_list.rb +3 -2
  33. data/lib/wx/core/evthandler.rb +64 -23
  34. data/lib/wx/core/icon.rb +50 -35
  35. data/lib/wx/core/id_helper.rb +32 -0
  36. data/lib/wx/core/image.rb +63 -53
  37. data/lib/wx/core/point.rb +14 -0
  38. data/lib/wx/core/real_point.rb +15 -1
  39. data/lib/wx/core/rect.rb +42 -7
  40. data/lib/wx/core/region_iterator.rb +37 -0
  41. data/lib/wx/core/size.rb +20 -0
  42. data/lib/wx/core/window.rb +8 -31
  43. data/lib/wx/doc/array_ext.rb +27 -0
  44. data/lib/wx/doc/art_locator.rb +57 -0
  45. data/lib/wx/doc/bitmap.rb +27 -0
  46. data/lib/wx/doc/clipboard.rb +12 -0
  47. data/lib/wx/doc/const.rb +77 -0
  48. data/lib/wx/doc/cursor.rb +16 -0
  49. data/lib/wx/doc/data_object.rb +1 -2
  50. data/lib/wx/doc/dc.rb +63 -46
  51. data/lib/wx/doc/event.rb +24 -0
  52. data/lib/wx/doc/events.rb +14 -0
  53. data/lib/wx/doc/evthandler.rb +24 -3
  54. data/lib/wx/doc/extra/00_starting.md +1 -1
  55. data/lib/wx/doc/extra/06_geometry.md +10 -4
  56. data/lib/wx/doc/extra/10_art.md +105 -0
  57. data/lib/wx/doc/gc_dc.rb +21 -0
  58. data/lib/wx/doc/gdi_common.rb +122 -1
  59. data/lib/wx/doc/gen/about_dialog_info.rb +1 -4
  60. data/lib/wx/doc/gen/animation.rb +3 -3
  61. data/lib/wx/doc/gen/animation_ctrl.rb +4 -4
  62. data/lib/wx/doc/gen/any_button.rb +1 -1
  63. data/lib/wx/doc/gen/aui/aui_floating_frame.rb +1 -1
  64. data/lib/wx/doc/gen/aui/aui_manager.rb +2 -2
  65. data/lib/wx/doc/gen/aui/aui_mdi_child_frame.rb +3 -3
  66. data/lib/wx/doc/gen/aui/aui_mdi_parent_frame.rb +3 -3
  67. data/lib/wx/doc/gen/aui/aui_notebook.rb +2 -2
  68. data/lib/wx/doc/gen/aui/aui_tool_bar.rb +6 -6
  69. data/lib/wx/doc/gen/bitmap.rb +1 -1
  70. data/lib/wx/doc/gen/bitmap_button.rb +2 -2
  71. data/lib/wx/doc/gen/book_ctrl_base.rb +4 -4
  72. data/lib/wx/doc/gen/brush.rb +1 -1
  73. data/lib/wx/doc/gen/button.rb +2 -2
  74. data/lib/wx/doc/gen/calendar_ctrl.rb +3 -3
  75. data/lib/wx/doc/gen/calendar_date_attr.rb +1 -1
  76. data/lib/wx/doc/gen/check_box.rb +2 -2
  77. data/lib/wx/doc/gen/check_list_box.rb +3 -3
  78. data/lib/wx/doc/gen/choice.rb +2 -2
  79. data/lib/wx/doc/gen/choicebook.rb +2 -2
  80. data/lib/wx/doc/gen/collapsible_pane.rb +2 -2
  81. data/lib/wx/doc/gen/colour.rb +1 -3
  82. data/lib/wx/doc/gen/colour_dialog.rb +1 -2
  83. data/lib/wx/doc/gen/colour_picker_ctrl.rb +2 -2
  84. data/lib/wx/doc/gen/combo_box.rb +4 -4
  85. data/lib/wx/doc/gen/context_help_button.rb +1 -1
  86. data/lib/wx/doc/gen/control.rb +3 -3
  87. data/lib/wx/doc/gen/core.rb +2 -2
  88. data/lib/wx/doc/gen/data_format.rb +1 -1
  89. data/lib/wx/doc/gen/data_object.rb +6 -6
  90. data/lib/wx/doc/gen/date_picker_ctrl.rb +2 -2
  91. data/lib/wx/doc/gen/dc.rb +9 -9
  92. data/lib/wx/doc/gen/defs.rb +0 -4
  93. data/lib/wx/doc/gen/dialog.rb +3 -3
  94. data/lib/wx/doc/gen/dir_dialog.rb +2 -4
  95. data/lib/wx/doc/gen/dir_filter_list_ctrl.rb +2 -2
  96. data/lib/wx/doc/gen/dir_picker_ctrl.rb +2 -2
  97. data/lib/wx/doc/gen/drag_drop.rb +13 -1
  98. data/lib/wx/doc/gen/editable_list_box.rb +2 -2
  99. data/lib/wx/doc/gen/event.rb +0 -1
  100. data/lib/wx/doc/gen/event_list.rb +18 -16
  101. data/lib/wx/doc/gen/events.rb +87 -2
  102. data/lib/wx/doc/gen/ext_help_controller.rb +2 -2
  103. data/lib/wx/doc/gen/file_dialog.rb +1 -1
  104. data/lib/wx/doc/gen/file_picker_ctrl.rb +2 -2
  105. data/lib/wx/doc/gen/font.rb +6 -6
  106. data/lib/wx/doc/gen/font_dialog.rb +1 -2
  107. data/lib/wx/doc/gen/font_picker_ctrl.rb +2 -2
  108. data/lib/wx/doc/gen/frame.rb +5 -5
  109. data/lib/wx/doc/gen/fs_file.rb +2 -2
  110. data/lib/wx/doc/gen/gauge.rb +2 -2
  111. data/lib/wx/doc/gen/gdi_common.rb +18 -21
  112. data/lib/wx/doc/gen/generic_dir_ctrl.rb +2 -2
  113. data/lib/wx/doc/gen/graphics_context.rb +4 -4
  114. data/lib/wx/doc/gen/graphics_object.rb +2 -2
  115. data/lib/wx/doc/gen/grid/grid_cell_bool_editor.rb +1 -1
  116. data/lib/wx/doc/gen/grid/grid_cell_date_time_renderer.rb +1 -1
  117. data/lib/wx/doc/gen/grid/grid_cell_enum_editor.rb +1 -1
  118. data/lib/wx/doc/gen/grid/grid_cell_enum_renderer.rb +1 -1
  119. data/lib/wx/doc/gen/grid/grid_cell_float_editor.rb +1 -1
  120. data/lib/wx/doc/gen/grid/grid_cell_float_renderer.rb +1 -1
  121. data/lib/wx/doc/gen/grid/grid_ctrl.rb +7 -7
  122. data/lib/wx/doc/gen/help_controller.rb +1 -1
  123. data/lib/wx/doc/gen/html/html_cell.rb +4 -4
  124. data/lib/wx/doc/gen/html/html_easy_printing.rb +6 -6
  125. data/lib/wx/doc/gen/html/html_help_controller.rb +6 -6
  126. data/lib/wx/doc/gen/html/html_help_frame.rb +2 -2
  127. data/lib/wx/doc/gen/html/html_help_window.rb +6 -6
  128. data/lib/wx/doc/gen/html/html_list_box.rb +6 -6
  129. data/lib/wx/doc/gen/html/html_printout.rb +4 -4
  130. data/lib/wx/doc/gen/html/html_window.rb +4 -4
  131. data/lib/wx/doc/gen/icon.rb +6 -6
  132. data/lib/wx/doc/gen/image.rb +7 -7
  133. data/lib/wx/doc/gen/list_box.rb +4 -4
  134. data/lib/wx/doc/gen/list_ctrl.rb +5 -5
  135. data/lib/wx/doc/gen/listbook.rb +2 -2
  136. data/lib/wx/doc/gen/locale.rb +8 -8
  137. data/lib/wx/doc/gen/log.rb +2 -2
  138. data/lib/wx/doc/gen/mdi_frame.rb +5 -5
  139. data/lib/wx/doc/gen/media_ctrl.rb +4 -4
  140. data/lib/wx/doc/gen/menu.rb +12 -12
  141. data/lib/wx/doc/gen/menu_item.rb +1 -1
  142. data/lib/wx/doc/gen/message_dialog.rb +2 -4
  143. data/lib/wx/doc/gen/mini_frame.rb +2 -2
  144. data/lib/wx/doc/gen/notebook.rb +3 -3
  145. data/lib/wx/doc/gen/number_entry_dialog.rb +0 -1
  146. data/lib/wx/doc/gen/object.rb +0 -1
  147. data/lib/wx/doc/gen/panel.rb +2 -2
  148. data/lib/wx/doc/gen/pen.rb +2 -2
  149. data/lib/wx/doc/gen/pg/pg_array_editor_dialog.rb +1 -1
  150. data/lib/wx/doc/gen/pg/pg_cell.rb +1 -1
  151. data/lib/wx/doc/gen/pg/pg_properties.rb +20 -20
  152. data/lib/wx/doc/gen/pg/pg_property.rb +12 -12
  153. data/lib/wx/doc/gen/pg/property_grid.rb +3 -3
  154. data/lib/wx/doc/gen/pg/property_grid_interface.rb +14 -14
  155. data/lib/wx/doc/gen/pg/property_grid_manager.rb +3 -3
  156. data/lib/wx/doc/gen/pg/property_grid_page.rb +2 -2
  157. data/lib/wx/doc/gen/pg/property_grid_page_state.rb +2 -2
  158. data/lib/wx/doc/gen/popup_window.rb +3 -3
  159. data/lib/wx/doc/gen/property_sheet_dialog.rb +3 -3
  160. data/lib/wx/doc/gen/prt/print_abort_dialog.rb +1 -1
  161. data/lib/wx/doc/gen/prt/printer.rb +1 -1
  162. data/lib/wx/doc/gen/radio_box.rb +4 -4
  163. data/lib/wx/doc/gen/radio_button.rb +2 -2
  164. data/lib/wx/doc/gen/rbn/ribbon_bar.rb +2 -2
  165. data/lib/wx/doc/gen/rbn/ribbon_button_bar.rb +12 -12
  166. data/lib/wx/doc/gen/rbn/ribbon_control.rb +1 -1
  167. data/lib/wx/doc/gen/rbn/ribbon_gallery.rb +2 -2
  168. data/lib/wx/doc/gen/rbn/ribbon_page.rb +2 -2
  169. data/lib/wx/doc/gen/rbn/ribbon_panel.rb +2 -2
  170. data/lib/wx/doc/gen/rbn/ribbon_tool_bar.rb +11 -11
  171. data/lib/wx/doc/gen/region.rb +1 -1
  172. data/lib/wx/doc/gen/region_iterator.rb +76 -0
  173. data/lib/wx/doc/gen/rtc/rich_text_buffer.rb +10 -10
  174. data/lib/wx/doc/gen/rtc/rich_text_ctrl.rb +19 -19
  175. data/lib/wx/doc/gen/rtc/rich_text_file_handler.rb +2 -2
  176. data/lib/wx/doc/gen/rtc/rich_text_header_footer_data.rb +4 -4
  177. data/lib/wx/doc/gen/rtc/rich_text_html_handler.rb +1 -1
  178. data/lib/wx/doc/gen/rtc/rich_text_printing.rb +6 -6
  179. data/lib/wx/doc/gen/rtc/rich_text_xml_handler.rb +1 -1
  180. data/lib/wx/doc/gen/rtc/symbol_picker_dialog.rb +2 -2
  181. data/lib/wx/doc/gen/sash_event.rb +1 -1
  182. data/lib/wx/doc/gen/sash_layout_window.rb +2 -2
  183. data/lib/wx/doc/gen/sash_window.rb +1 -1
  184. data/lib/wx/doc/gen/scroll_bar.rb +150 -0
  185. data/lib/wx/doc/gen/scrolled_canvas.rb +2 -2
  186. data/lib/wx/doc/gen/scrolled_control.rb +2 -2
  187. data/lib/wx/doc/gen/scrolled_window.rb +2 -2
  188. data/lib/wx/doc/gen/simplebook.rb +2 -2
  189. data/lib/wx/doc/gen/sizer.rb +3 -3
  190. data/lib/wx/doc/gen/slider.rb +2 -2
  191. data/lib/wx/doc/gen/spin_button.rb +2 -2
  192. data/lib/wx/doc/gen/spin_ctrl.rb +2 -2
  193. data/lib/wx/doc/gen/splash_screen.rb +1 -1
  194. data/lib/wx/doc/gen/splitter_window.rb +2 -2
  195. data/lib/wx/doc/gen/static_bitmap.rb +2 -2
  196. data/lib/wx/doc/gen/static_box.rb +4 -4
  197. data/lib/wx/doc/gen/static_box_sizer.rb +1 -1
  198. data/lib/wx/doc/gen/static_line.rb +2 -2
  199. data/lib/wx/doc/gen/static_text.rb +2 -2
  200. data/lib/wx/doc/gen/status_bar.rb +2 -2
  201. data/lib/wx/doc/gen/stc/styled_text_ctrl.rb +3 -3
  202. data/lib/wx/doc/gen/task_bar_icon.rb +2 -2
  203. data/lib/wx/doc/gen/text_attr.rb +3 -3
  204. data/lib/wx/doc/gen/text_ctrl.rb +3 -3
  205. data/lib/wx/doc/gen/text_entry_dialog.rb +6 -8
  206. data/lib/wx/doc/gen/text_validator.rb +1 -1
  207. data/lib/wx/doc/gen/time_picker_ctrl.rb +2 -2
  208. data/lib/wx/doc/gen/tip_provider.rb +1 -3
  209. data/lib/wx/doc/gen/toggle_button.rb +2 -2
  210. data/lib/wx/doc/gen/tool_bar.rb +10 -10
  211. data/lib/wx/doc/gen/toolbook.rb +2 -2
  212. data/lib/wx/doc/gen/top_level_window.rb +4 -4
  213. data/lib/wx/doc/gen/tree_ctrl.rb +4 -4
  214. data/lib/wx/doc/gen/treebook.rb +2 -2
  215. data/lib/wx/doc/gen/utils.rb +5 -42
  216. data/lib/wx/doc/gen/v_list_box.rb +2 -2
  217. data/lib/wx/doc/gen/v_scrolled_window.rb +2 -2
  218. data/lib/wx/doc/gen/variant.rb +10 -10
  219. data/lib/wx/doc/gen/window.rb +9 -14
  220. data/lib/wx/doc/gen/wizard.rb +2 -2
  221. data/lib/wx/doc/gen/wizard_event.rb +1 -1
  222. data/lib/wx/doc/gen/xml_node.rb +2 -2
  223. data/lib/wx/doc/gen/xml_resource.rb +3 -3
  224. data/lib/wx/doc/graphics_context.rb +42 -0
  225. data/lib/wx/doc/icon.rb +18 -0
  226. data/lib/wx/doc/id_helper.rb +25 -0
  227. data/lib/wx/doc/image.rb +33 -0
  228. data/lib/wx/doc/region_iterator.rb +31 -0
  229. data/lib/wx/doc/scaled_dc.rb +1 -0
  230. data/lib/wx/doc/window.rb +18 -0
  231. data/lib/wx/global_const.rb +24 -18
  232. data/lib/wx/version.rb +1 -1
  233. data/lib/wx/wxruby/cmd/sampler.rb +3 -21
  234. data/lib/wxruby_aui.so +0 -0
  235. data/lib/wxruby_core.so +0 -0
  236. data/lib/wxruby_grid.so +0 -0
  237. data/lib/wxruby_html.so +0 -0
  238. data/lib/wxruby_pg.so +0 -0
  239. data/lib/wxruby_prt.so +0 -0
  240. data/lib/wxruby_rbn.so +0 -0
  241. data/lib/wxruby_rtc.so +0 -0
  242. data/lib/wxruby_stc.so +0 -0
  243. data/rakelib/lib/config.rb +4 -4
  244. data/samples/art/wxruby-128x128.png +0 -0
  245. data/samples/art/wxruby-256x256.png +0 -0
  246. data/samples/art/wxruby-64x64.png +0 -0
  247. data/samples/art/wxruby.ico +0 -0
  248. data/samples/art/wxruby.png +0 -0
  249. data/samples/drawing/graphics_drawing.rb +1 -2
  250. data/samples/propgrid/propgrid.rb +65 -65
  251. data/samples/sample.xpm +246 -470
  252. data/samples/treectrl/treectrl.rb +1 -1
  253. data/tests/art/my_art/sample.xpm +251 -0
  254. data/tests/art/sample3.xpm +251 -0
  255. data/tests/art/test_art/bitmap/sample.xpm +251 -0
  256. data/tests/art/test_art/bitmap/wxruby.bmp +0 -0
  257. data/tests/art/test_art/bitmap/wxruby.png +0 -0
  258. data/tests/art/test_art/bitmap/wxruby.xpm +251 -0
  259. data/tests/art/test_art/cursor/wxruby.bmp +0 -0
  260. data/tests/art/test_art/icon/sample.xpm +251 -0
  261. data/tests/art/test_art/icon/wxruby.ico +0 -0
  262. data/tests/art/test_art/icon/wxruby.png +0 -0
  263. data/tests/art/test_art/image/sample.xpm +251 -0
  264. data/tests/art/test_art/image/wxruby.jpg +0 -0
  265. data/tests/art/test_art/image/wxruby.png +0 -0
  266. data/tests/art/test_art/sample2.xpm +251 -0
  267. data/tests/test_art.rb +91 -0
  268. data/tests/test_clipboard.rb +35 -0
  269. data/tests/test_dc.rb +70 -0
  270. data/tests/test_events.rb +12 -0
  271. data/tests/test_geometry.rb +13 -0
  272. metadata +48 -5
data/lib/wx/core/rect.rb CHANGED
@@ -36,15 +36,40 @@ class Wx::Rect
36
36
  end
37
37
  end
38
38
 
39
- # make sure union and intersect are constant operations, i.e. not changing self
40
- wx_union = instance_method :union
41
- define_method :union do |rect|
42
- wx_union.bind(Wx::Rect.new(*self.to_ary)).call(rect)
39
+ # provide both constant and non-constant versions of union/intersect/inflate/deflate/offset
40
+
41
+ # first alias the wrapped (non-constant) versions with correct names
42
+ alias :union! :union
43
+ alias :intersect! :intersect
44
+ alias :inflate! :inflate
45
+ alias :deflate! :deflate
46
+
47
+ # redefine offset as offset! returning self
48
+ wx_offset = instance_method :offset
49
+ define_method :offset! do |*args|
50
+ wx_offset.bind(self).call(*args)
51
+ self
52
+ end
53
+
54
+ # next provide new constant versions
55
+ def offset(*args)
56
+ self.dup.offset!(*args)
57
+ end
58
+
59
+ def union(rect)
60
+ self.dup.union!(rect)
61
+ end
62
+
63
+ def intersect(rect)
64
+ self.dup.intersect!(rect)
65
+ end
66
+
67
+ def inflate(*args)
68
+ self.dup.inflate!(*args)
43
69
  end
44
70
 
45
- wx_intersect = instance_method :intersect
46
- define_method :intersect do |rect|
47
- wx_intersect.bind(Wx::Rect.new(*self.to_ary)).call(rect)
71
+ def deflate(*args)
72
+ self.dup.deflate!(*args)
48
73
  end
49
74
 
50
75
  alias :+ :add
@@ -54,4 +79,14 @@ class Wx::Rect
54
79
 
55
80
  # More ruby-ish names
56
81
  alias :contains? :contains
82
+
83
+ def dup
84
+ Wx::Rect.new(self.x, self.y, self.width, self.height)
85
+ end
86
+
87
+ def assign(rct)
88
+ self.position = rct.position
89
+ self.size = rct.size
90
+ self
91
+ end
57
92
  end
@@ -0,0 +1,37 @@
1
+
2
+ class Wx::RegionIterator
3
+
4
+ alias :have_rects? :have_rects
5
+
6
+ # Ruby like enumeration
7
+ def each
8
+ if block_given?
9
+ while have_rects
10
+ yield get_rect
11
+ next_rect
12
+ end
13
+ else
14
+ # The region iterator instance cannot be allowed to exist beyond the outer
15
+ # Wx::RegionIterator.for_region block as it is a temporary instance that
16
+ # will stop to exist when the outer block finishes, so we collect the rectangles
17
+ # here and return an enumerator on that
18
+ arr = []
19
+ while has_rects
20
+ arr << get_rect
21
+ next_rect
22
+ end
23
+ arr.each
24
+ end
25
+ end
26
+
27
+ def self.iterate(region, &block)
28
+ return unless block
29
+ for_region(region) do |ri|
30
+ while ri.have_rects
31
+ block.call(ri)
32
+ ri.next_rect
33
+ end
34
+ end
35
+ end
36
+
37
+ end
data/lib/wx/core/size.rb CHANGED
@@ -2,6 +2,12 @@ class Wx::Size
2
2
 
3
3
  include Comparable
4
4
 
5
+ # provide compatibility methods
6
+ alias :get_x :get_width
7
+ alias :x :get_width
8
+ alias :get_y :get_height
9
+ alias :y :get_height
10
+
5
11
  # More informative output for inspect etc
6
12
  def to_s
7
13
  "#<Wx::Size: #{width}x#{height}>"
@@ -90,4 +96,18 @@ class Wx::Size
90
96
  end
91
97
  end
92
98
  end
99
+
100
+ def dup
101
+ Wx::Size.new(self.width, self.height)
102
+ end
103
+
104
+ def to_size
105
+ self
106
+ end
107
+
108
+ def assign(sz)
109
+ self.width = sz.width
110
+ self.height = sz.height
111
+ self
112
+ end
93
113
  end
@@ -53,43 +53,20 @@ class Wx::Window
53
53
  def evt_paint(meth = nil, &block)
54
54
  paint_proc = acquire_handler(meth, block)
55
55
  wrapped_block = proc do | event |
56
- instance_variable_set("@__painting__", true)
56
+ instance_variable_set('@__painting__', true)
57
57
  paint_proc.call(event)
58
- remove_instance_variable("@__painting__")
58
+ remove_instance_variable('@__painting__')
59
59
  end
60
60
  __old_evt_paint(&wrapped_block)
61
61
  end
62
62
 
63
- # Provides bufferd drawing facility to reduce flicker for complex
64
- # drawing commands. Works similar to BufferedDC and BufferedPaintDC in
65
- # the wxWidgets API, by doing drawing on an in-memory Bitmap, then
66
- # copying the result in bulk to the screen.
67
- #
68
- # The method may be passed an existing Wx::Bitmap as the +buffer+,
69
- # otherwise one will be created.
70
- #
71
- # Works like wxAutoBufferedDC in that additional buffering will only
72
- # be done on platforms that do not already natively support buffering
73
- # for the standard PaintDC / ClientDC - Windows, in particular.
74
- def paint_buffered(buffer = nil)
75
- # OS X and GTK do double-buffering natively
76
- if self.double_buffered?
77
- paint { | dc | yield dc }
63
+ # Overload the wrapper method to check for @__painting__
64
+ wx_paint_buffered = instance_method :paint_buffered
65
+ define_method :paint_buffered do |&block|
66
+ if instance_variable_defined?('@__painting__')
67
+ wx_paint_buffered.bind(self).call(&block)
78
68
  else
79
- # client_size is the window area available for drawing upon
80
- c_size = client_size
81
- # Create an in-memory buffer if none supplied
82
- buffer ||= Wx::Bitmap.new(c_size.width, c_size.height)
83
- buffer.draw do | mem_dc |
84
- mem_dc.background = Wx::TRANSPARENT_BRUSH
85
- mem_dc.clear
86
- # Yield the bitmap for the user code to draw upon
87
- yield mem_dc
88
- paint do | dc |
89
- # Copy the buffer to the window
90
- dc.blit(0, 0, c_size.width, c_size.height, mem_dc, 0, 0)
91
- end
92
- end
69
+ self.paint(&block)
93
70
  end
94
71
  end
95
72
  end
@@ -0,0 +1,27 @@
1
+
2
+ module Wx
3
+
4
+ # Mixin module providing Array extensions.
5
+ module ArrayExt
6
+
7
+ # Returns a new Wx::Size instance created from the first two elements of the array.
8
+ # Any missing element will be supplemented by a Wx::DEFAULT_COORD value.
9
+ # The array is not altered.
10
+ # @return [Wx::Size]
11
+ def to_size; end
12
+
13
+ # Returns a new Wx::Point instance created from the first two elements of the array.
14
+ # Any missing element will be supplemented by a Wx::DEFAULT_COORD value.
15
+ # The array is not altered.
16
+ # @return [Wx::Point]
17
+ def to_point; end
18
+
19
+ # Returns a new Wx::RealPoint instance created from the first two elements of the array.
20
+ # Any missing element will be supplemented by a Wx::DEFAULT_COORD value.
21
+ # The array is not altered.
22
+ # @return [Wx::RealPoint]
23
+ def to_real_point; end
24
+
25
+ end
26
+
27
+ end
@@ -0,0 +1,57 @@
1
+
2
+
3
+ # This module provides and standardizes support for locating application art files.
4
+ #
5
+ module Wx::ArtLocator
6
+
7
+ # Default name of art folder.
8
+ ART_FOLDER = 'art'
9
+
10
+ class << self
11
+
12
+ # Returns the base name for the folder holding application art files.
13
+ # By default this returns ART_FOLDER
14
+ # @return [String]
15
+ def art_folder; end
16
+
17
+ # Sets the base name for the folder holding application art files.
18
+ # @param [String] name art folder base name
19
+ def art_folder=(name) end
20
+
21
+ # Adds one or more search paths to look for art files.
22
+ # By default ArtLocator#find_art will look only at locations of the caller's
23
+ # file path. If search paths have been added though these will be searched
24
+ # after the lookup in the caller's path has failed.
25
+ def add_search_path(*names) end
26
+ alias :add_search_paths :add_search_path
27
+
28
+ # Searches for the an art file for the given 'art_name'.
29
+ # By default the search will be performed at the following locations (in order):
30
+ # 1. <art_path>/<#art_folder>/<art_section>/<art_type>/
31
+ # 2. <art_path>/<#art_folder>/<art_section>/
32
+ # 3. <art_path>/<#art_folder>/
33
+ # 4. <art_path>/
34
+ # Where 'art_type' is any of <code>:icon</code>, <code>:bitmap</code>, <code>:cursor</code>,
35
+ # <code>:image</code> or <code>nil</code>. If 'art_type' is nil the first location will be skipped.
36
+ # In case 'art_path' == <code>nil</code> the absolute path to the folder holding the caller's
37
+ # code will be used which is determined through ::Kernel#caller_locations.
38
+ # If 'art_section' is also <code>nil</code> the basename of the caller's source file will be used.
39
+ # At each location the existence of a file with base name 'art_name' and each of the supported
40
+ # extensions for the given 'art_type' (see wxWidgets documentation) will be tested. If 'art_type' is nil
41
+ # all extensions for all supported bitmap types will be tested (similar to when 'art_type' is :image).
42
+ # If an optional Wx::BitmapType is specified through 'bmp_type' the tested extensions will
43
+ # be restricted to the extensions supported for specified the bitmap type.
44
+ #
45
+ # In case additional search paths have been specified through #add_search_path these will be
46
+ # searched after the lookup at 'art_path' fails. For each search path the same lookups
47
+ # will be performed (replacing 'art_path' by the search path).
48
+ # @param [String,Symbol] art_name base name for art file
49
+ # @param [Symbol,nil] art_type type of art to look for (:icon, :bitmap, :cursor, :image)
50
+ # @param [String,nil] art_path base path to look up the art file
51
+ # @param [String,nil] art_section optional owner folder name for art files
52
+ # @param [Wx::BitmapType,nil] bmp_type bitmap type of art file
53
+ def find_art(art_name, art_type: nil, art_path: nil, art_section: nil, bmp_type: nil) end
54
+
55
+ end
56
+
57
+ end
@@ -0,0 +1,27 @@
1
+
2
+ module Wx
3
+
4
+ # Default BitmapType for current platform. Actual value is platform dependent.
5
+ ICON_DEFAULT_TYPE = Wx::BitmapType::BITMAP_TYPE_ANY
6
+ # Default BitmapType for current platform. Actual value is platform dependent.
7
+ BITMAP_DEFAULT_TYPE = Wx::BitmapType::BITMAP_TYPE_ANY
8
+ # Default BitmapType for current platform. Actual value is platform dependent.
9
+ CURSOR_DEFAULT_TYPE = Wx::BitmapType::BITMAP_TYPE_ANY
10
+
11
+ class Bitmap
12
+
13
+ # Searches for an art file with basename 'name' and creates a Bitmap if found.
14
+ # Raises an ArgumentError if not found.
15
+ # Wx::ArtLocator::find_art is used to look up the art file using ::Kernel#caller_locations to
16
+ # determine the values for the 'art_path' and 'art_owner' arguments ('art_path' is set to the
17
+ # absolute path to the folder holding the caller's code and 'art_owner' to the basename of the
18
+ # caller's source file). The 'art_type' argument is set to <code>:icon</code>.
19
+ # @param [String,Symbol] name base name of art file
20
+ # @param [Wx::BitmapType,nil] bmp_type bitmap type for art file (nil means any supported type)
21
+ # @return [Wx::Bitmap]
22
+ # @see Wx::ArtLocator::find_art
23
+ def self.Bitmap(name, bmp_type = nil); end
24
+
25
+ end
26
+
27
+ end
@@ -0,0 +1,12 @@
1
+
2
+ class Wx::Clipboard
3
+
4
+ alias :place :set_data
5
+ alias :fetch :get_data
6
+
7
+ # Opens the global clipboard and passes the clipboard object to the block.
8
+ # @yieldparam [Wx::Clipboard] clip the global clipboard object
9
+ # @return [Object] block result
10
+ def self.open; end
11
+
12
+ end
@@ -0,0 +1,77 @@
1
+ module Wx
2
+
3
+ =begin
4
+ These constants are not documented in the wxWidgets interface headers
5
+ although they are referenced in various argument defaults which *are*
6
+ in the interface header declarations so we do want them included the
7
+ wxRuby docs so the doc links work but we do not need them in the
8
+ wxRuby implementation since these are internal to the C++ wrappers.
9
+ =end
10
+
11
+ DefaultDateTimeFormat = '%c'
12
+ DefaultTimeSpanFormat = '%H:%M:%S'
13
+
14
+ ChoiceNameStr = 'choice'
15
+ ColourPickerCtrlNameStr = 'colourpicker'
16
+ ColourPickerWidgetNameStr = 'colourpickerwidget'
17
+ HyperlinkCtrlNameStr = 'hyperlink'
18
+ PanelNameStr = 'panel'
19
+ ListBoxNameStr = 'listBox'
20
+ FrameNameStr = 'frame'
21
+ StatusLineNameStr = 'status_line'
22
+ StaticBitmapNameStr = 'staticBitmap'
23
+ WebViewNameStr = 'wxWebView'
24
+ AnimationCtrlNameStr = 'animationctrl'
25
+ ToolBarNameStr = 'toolbar'
26
+ TextCtrlNameStr = 'text'
27
+ ListCtrlNameStr = 'listCtrl'
28
+ FilePickerCtrlNameStr = 'filepicker'
29
+ FilePickerWidgetNameStr = 'filepickerwidget'
30
+ DirPickerCtrlNameStr = 'dirpicker'
31
+ DirPickerWidgetNameStr = 'dirpickerwidget'
32
+ FileCtrlNameStr = 'wxfilectrl'
33
+ StaticBoxNameStr = 'groupBox'
34
+ ButtonNameStr = 'button'
35
+ RadioBoxNameStr = 'radioBox'
36
+ StaticLineNameStr = 'staticLine'
37
+ RadioButtonNameStr = 'radioButton'
38
+ BitmapRadioButtonNameStr = 'radioButton'
39
+ GaugeNameStr = 'gauge'
40
+ DataViewCtrlNameStr = 'dataviewCtrl'
41
+ FontPickerCtrlNameStr = 'fontpicker'
42
+ FontPickerWidgetNameStr = 'fontpickerwidget'
43
+ RearrangeListNameStr = 'wxRearrangeList'
44
+ RearrangeDialogNameStr = 'wxRearrangeDlg'
45
+ NotebookNameStr = 'notebook'
46
+ ControlNameStr = 'control'
47
+ ScrollBarNameStr = 'scrollBar'
48
+ StatusBarNameStr = 'statusBar'
49
+ SliderNameStr = 'slider'
50
+ HeaderCtrlNameStr = 'wxHeaderCtrl'
51
+ BitmapComboBoxNameStr = 'bitmapComboBox'
52
+ CheckBoxNameStr = 'check'
53
+ FileDialogNameStr = 'filedlg'
54
+ AddRemoveCtrlNameStr = 'wxAddRemoveCtrl'
55
+ StaticTextNameStr = 'staticText'
56
+ ComboBoxNameStr = 'comboBox'
57
+ SearchCtrlNameStr = 'searchCtrl'
58
+ DirDialogNameStr = 'wxDirCtrl'
59
+ TreeCtrlNameStr = 'treeCtrl'
60
+ DialogNameStr = 'dialog'
61
+ CollapsibleHeaderCtrlNameStr = 'collapsibleHeader'
62
+ CollapsiblePaneNameStr = 'collapsiblePane'
63
+ BannerWindowNameStr = 'bannerwindow'
64
+ GridNameStr = 'grid'
65
+ TreeListCtrlNameStr = 'wxTreeListCtrl'
66
+ HtmlListBoxNameStr = 'htmlListBox'
67
+ SimpleHtmlListBoxNameStr = 'simpleHtmlListBox'
68
+ EditableListBoxNameStr = 'editableListBox'
69
+ VListBoxNameStr = 'wxVListBox'
70
+ CollapsiblePaneNameStr = 'collapsiblePane'
71
+ MSWHeaderCtrlNameStr = 'wxMSWHeaderCtrl'
72
+ PropertyGridManagerNameStr = 'wxPropertyGridManager'
73
+ PropertyGridNameStr = 'wxPropertyGrid'
74
+ STCNameStr = 'stcwindow'
75
+ STCNameStr = 'stcwindow'
76
+
77
+ end
@@ -0,0 +1,16 @@
1
+
2
+ class Wx::Cursor
3
+
4
+ # Searches for an art file with basename 'name' and creates a Cursor if found.
5
+ # Raises an ArgumentError if not found.
6
+ # Wx::ArtLocator::find_art is used to look up the art file using ::Kernel#caller_locations to
7
+ # determine the values for the 'art_path' and 'art_owner' arguments ('art_path' is set to the
8
+ # absolute path to the folder holding the caller's code and 'art_owner' to the basename of the
9
+ # caller's source file). The 'art_type' argument is set to <code>:icon</code>.
10
+ # @param [String,Symbol] name base name of art file
11
+ # @param [Wx::BitmapType,nil] bmp_type bitmap type for art file (nil means any supported type)
12
+ # @return [Wx::Cursor]
13
+ # @see Wx::ArtLocator::find_art
14
+ def self.Cursor(name, bmp_type = nil); end
15
+
16
+ end
@@ -80,8 +80,7 @@ module Wx
80
80
  # The default implementation calls #_get_data and determines the size of the returned data string (if any).
81
81
  # As this is not very optimal for more complex (and larger data objects) very often this method will be
82
82
  # overridden in derived classes.
83
- # @note **IMPORTANT** Please note that it is necessary to return the **size in bytes** of the data string
84
- # returned by #_get_data (not the size in characters).
83
+ # @note **IMPORTANT** Please note that it is necessary to return the **size in bytes** of the data string returned by #_get_data (not the size in characters).
85
84
  # @return [Integer]
86
85
  def _get_data_size; end
87
86
  protected :_get_data_size
data/lib/wx/doc/dc.rb CHANGED
@@ -1,49 +1,66 @@
1
1
 
2
- class Wx::DC
3
-
4
- # Provides similar functionality like wxDCBrushChanger setting the given brush as the active
5
- # brush for the DC for the duration of the block execution restoring the previous brush afterwards.
6
- # @param [Wx::Brush] brush new brush to use during block execution
7
- # @return [void]
8
- # @yieldparam [Wx::DC] dc the DC (self)
9
- def with_brush(brush) end
10
-
11
- # Provides similar functionality like wxDCPenChanger setting the given pen as the active
12
- # pen for the DC for the duration of the block execution restoring the previous pen afterwards.
13
- # @param [Wx::Pen] pen new pen to use during block execution
14
- # @return [void]
15
- # @yieldparam [Wx::DC] dc the DC (self)
16
- def with_pen(pen) end
17
-
18
- # Provides similar functionality like wxDCFontChanger setting the given font as the active
19
- # font for the DC for the duration of the block execution restoring the previous font afterwards.
20
- # @param [Wx::Font] font new font to use during block execution
21
- # @return [void]
22
- # @yieldparam [Wx::DC] dc the DC (self)
23
- def with_font(font) end
24
-
25
- # Provides similar functionality like wxDCTextColourChanger setting the given colour as the active
26
- # text foreground colour for the DC for the duration of the block execution restoring the previous colour afterwards.
27
- # @param [Wx::Colour] clr new colour to use during block execution
28
- # @return [void]
29
- # @yieldparam [Wx::DC] dc the DC (self)
30
- def with_text_foreground(clr) end
31
- alias :with_text_fg :with_text_foreground
32
-
33
- # Provides similar functionality like wxDCTextBgColourChanger setting the given colour as the active
34
- # text background colour for the DC for the duration of the block execution restoring the previous colour afterwards.
35
- # @param [Wx::Colour] clr new colour to use during block execution
36
- # @return [void]
37
- # @yieldparam [Wx::DC] dc the DC (self)
38
- def with_text_background(clr) end
39
- alias :with_text_bg :with_text_background
40
-
41
- # Provides similar functionality like wxDCTextBgModeChanger setting the given mode as the active
42
- # background mode for the DC for the duration of the block execution restoring the previous mode afterwards.
43
- # @param [Integer] mode new mode to use during block execution
44
- # @return [void]
45
- # @yieldparam [Wx::DC] dc the DC (self)
46
- def with_background_mode(mode) end
47
- alias :with_bg_mode :with_background_mode
2
+ module Wx
3
+ class DC
4
+
5
+ # Provides similar functionality like wxDCBrushChanger setting the given brush as the active
6
+ # brush for the DC for the duration of the block execution restoring the previous brush afterwards.
7
+ # @param [Wx::Brush] brush new brush to use during block execution
8
+ # @return [void]
9
+ # @yieldparam [Wx::DC] dc the DC (self)
10
+ def with_brush(brush) end
11
+
12
+ # Provides similar functionality like wxDCPenChanger setting the given pen as the active
13
+ # pen for the DC for the duration of the block execution restoring the previous pen afterwards.
14
+ # @param [Wx::Pen] pen new pen to use during block execution
15
+ # @return [void]
16
+ # @yieldparam [Wx::DC] dc the DC (self)
17
+ def with_pen(pen) end
18
+
19
+ # Provides similar functionality like wxDCFontChanger setting the given font as the active
20
+ # font for the DC for the duration of the block execution restoring the previous font afterwards.
21
+ # @param [Wx::Font] font new font to use during block execution
22
+ # @return [void]
23
+ # @yieldparam [Wx::DC] dc the DC (self)
24
+ def with_font(font) end
25
+
26
+ # Provides similar functionality like wxDCTextColourChanger setting the given colour as the active
27
+ # text foreground colour for the DC for the duration of the block execution restoring the previous colour afterwards.
28
+ # @param [Wx::Colour] clr new colour to use during block execution
29
+ # @return [void]
30
+ # @yieldparam [Wx::DC] dc the DC (self)
31
+ def with_text_foreground(clr) end
32
+ alias :with_text_fg :with_text_foreground
33
+
34
+ # Provides similar functionality like wxDCTextBgColourChanger setting the given colour as the active
35
+ # text background colour for the DC for the duration of the block execution restoring the previous colour afterwards.
36
+ # @param [Wx::Colour] clr new colour to use during block execution
37
+ # @return [void]
38
+ # @yieldparam [Wx::DC] dc the DC (self)
39
+ def with_text_background(clr) end
40
+ alias :with_text_bg :with_text_background
41
+
42
+ # Provides similar functionality like wxDCTextBgModeChanger setting the given mode as the active
43
+ # background mode for the DC for the duration of the block execution restoring the previous mode afterwards.
44
+ # @param [Integer] mode new mode to use during block execution
45
+ # @return [void]
46
+ # @yieldparam [Wx::DC] dc the DC (self)
47
+ def with_background_mode(mode) end
48
+ alias :with_bg_mode :with_background_mode
49
+
50
+ end
51
+
52
+ class MemoryDC
53
+
54
+ # Creates a Memory DC and passes that to the given block to draw on.
55
+ # Automatically unselects any source object of the MemoryDC after the block finishes.
56
+ # @overload self.draw_on(bitmap)
57
+ # @param [Wx::Bitmap]
58
+ # @yieldparam [WxMemoryDC] dc
59
+ # @overload self.draw_on(dc)
60
+ # @param [Wx::DC]
61
+ # @yieldparam [WxMemoryDC] dc
62
+ def self.draw_on(arg, &block) end
63
+
64
+ end
48
65
 
49
66
  end
@@ -0,0 +1,24 @@
1
+
2
+ module Wx
3
+
4
+ class Event
5
+
6
+ # Constructor
7
+ # @param [Integer] evt_type
8
+ # @param [Integer] id
9
+ # @param [Wx::EventPropagation] prop_level
10
+ def initialize(evt_type = Wx::EVT_NULL, id = 0, prop_level = Wx::EVENT_PROPAGATE_NONE) end
11
+
12
+ # Returns a copy of the event.
13
+ # Any event that is posted to the wxRuby event system for later action (via {Wx::EvtHandler#add_pending_event},
14
+ # {Wx::EvtHandler#queue_event} or {Wx::EvtHandler#post_event}) must implement this method.
15
+ # All standard wxRuby events fully implement this method and wxRuby has taken care of correctly handling this
16
+ # for any user defined event classes derived from either Wx::Event or Wx::CommandEvent.
17
+ # Creating user defined event classes derived for other classes than Wx::Event or Wx::CommandEvent is currently
18
+ # *not* supported in wxRuby.
19
+ # @return [Wx::Event]
20
+ def clone; end
21
+
22
+ end
23
+
24
+ end
@@ -0,0 +1,14 @@
1
+
2
+ module Wx
3
+
4
+ EVT_COMMAND_SCROLL_TOP = EVT_SCROLL_TOP
5
+ EVT_COMMAND_SCROLL_BOTTOM = EVT_SCROLL_BOTTOM
6
+ EVT_COMMAND_SCROLL_LINEUP = EVT_SCROLL_LINEUP
7
+ EVT_COMMAND_SCROLL_LINEDOWN = EVT_SCROLL_LINEDOWN
8
+ EVT_COMMAND_SCROLL_PAGEUP = EVT_SCROLL_PAGEUP
9
+ EVT_COMMAND_SCROLL_PAGEDOWN = EVT_SCROLL_PAGEDOWN
10
+ EVT_COMMAND_SCROLL_THUMBTRACK = EVT_SCROLL_THUMBTRACK
11
+ EVT_COMMAND_SCROLL_THUMBRELEASE = EVT_SCROLL_THUMBRELEASE
12
+ EVT_COMMAND_SCROLL_CHANGED = EVT_SCROLL_CHANGED
13
+
14
+ end
@@ -65,11 +65,26 @@ class Wx::EvtHandler
65
65
 
66
66
  # Convenience evt_handler to listen to all mouse events.
67
67
  # @yieldparam [Wx::MouseEvent] event event to handle
68
- def evt_mouse_events(&block) end
68
+ def evt_mouse_events(*args, &block) end
69
69
 
70
- # Convenience evt handler to listen to all scrollwin events.
70
+ # Convenience evt handler to listen to all scrollwin events
71
+ # (from Wx::ScrolledWindow).
72
+ # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc
73
+ # @yieldparam [Wx::ScrollWinEvent] event event to handle
74
+ def evt_scrollwin(meth = nil, &block) end
75
+
76
+ # Convenience evt handler to listen to all scroll events
77
+ # (from Wx::Slider and Wx::ScrollBar).
78
+ # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc
79
+ # @yieldparam [Wx::ScrollWinEvent] event event to handle
80
+ def evt_scroll(meth = nil, &block) end
81
+
82
+ # Convenience evt handler to listen to all scroll events
83
+ # (from Wx::Slider and Wx::ScrollBar) with an id.
84
+ # @param [Integer] id window identifier
85
+ # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc
71
86
  # @yieldparam [Wx::ScrollWinEvent] event event to handle
72
- def evt_scrollwin(&block) end
87
+ def evt_scroll_command(id, meth = nil, &block) end
73
88
 
74
89
  # Processes Wx::WindowDestroyEvent events.
75
90
  # In wxRuby Wx::Event#skipped will be forced to true after the provided
@@ -78,6 +93,12 @@ class Wx::EvtHandler
78
93
  # @yieldparam [Wx::WindowDestroyEvent] event event to handle
79
94
  def evt_window_destroy(&block) end
80
95
 
96
+ # Processes {Wx::EVT_TIMER} events. See {Wx::TimerEvent}.
97
+ # @param [Integer,Wx::Enum,Wx::Timer] id timer id
98
+ # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc
99
+ # @yieldparam [Wx::TimerEvent] event the event to handle
100
+ def evt_timer(id, meth = nil, &block) end
101
+
81
102
  # Schedule a call for asynchronous execution (at idle time).
82
103
  # @param meth [Symbol,String,Method,Proc] (name of) method or proc to call
83
104
  # @param args [Array<Object>] optional arguments to pass to the call
@@ -151,4 +151,4 @@ distributes implementations over various sub-modules. These sub-modules can be l
151
151
  The core module still provides the toplevel `Wx` namespace and all classes and constants declared in that namespace.
152
152
  All other modules add to that (and **all** require the core module).
153
153
 
154
- See [here](packages.md) for more details on wxRuby sub-modules.
154
+ See [here](01_packages.md) for more details on wxRuby sub-modules.