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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (238) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -0
  3. data/README.md +47 -4
  4. data/assets/hello_button.png +0 -0
  5. data/assets/hello_button_clicked.png +0 -0
  6. data/assets/hello_world.png +0 -0
  7. data/assets/repo-social-preview.png +0 -0
  8. data/ext/wxbase32u_gcc_custom.dll +0 -0
  9. data/ext/wxbase32u_net_gcc_custom.dll +0 -0
  10. data/ext/wxbase32u_xml_gcc_custom.dll +0 -0
  11. data/ext/wxmsw32u_aui_gcc_custom.dll +0 -0
  12. data/ext/wxmsw32u_core_gcc_custom.dll +0 -0
  13. data/ext/wxmsw32u_gl_gcc_custom.dll +0 -0
  14. data/ext/wxmsw32u_html_gcc_custom.dll +0 -0
  15. data/ext/wxmsw32u_media_gcc_custom.dll +0 -0
  16. data/ext/wxmsw32u_propgrid_gcc_custom.dll +0 -0
  17. data/ext/wxmsw32u_qa_gcc_custom.dll +0 -0
  18. data/ext/wxmsw32u_ribbon_gcc_custom.dll +0 -0
  19. data/ext/wxmsw32u_richtext_gcc_custom.dll +0 -0
  20. data/ext/wxmsw32u_stc_gcc_custom.dll +0 -0
  21. data/ext/wxmsw32u_webview_gcc_custom.dll +0 -0
  22. data/ext/wxmsw32u_xrc_gcc_custom.dll +0 -0
  23. data/lib/wx/core/art_locator.rb +2 -2
  24. data/lib/wx/core/artprovider.rb +2 -2
  25. data/lib/wx/core/bitmap.rb +6 -5
  26. data/lib/wx/core/bitmap_combobox.rb +34 -0
  27. data/lib/wx/core/controlwithitems.rb +52 -14
  28. data/lib/wx/core/cursor.rb +1 -1
  29. data/lib/wx/core/dc.rb +0 -20
  30. data/lib/wx/core/event_blocker.rb +14 -0
  31. data/lib/wx/core/events/evt_list.rb +12 -0
  32. data/lib/wx/core/evthandler.rb +36 -0
  33. data/lib/wx/core/find_replace_dialog.rb +24 -0
  34. data/lib/wx/core/icon.rb +1 -1
  35. data/lib/wx/core/image.rb +1 -1
  36. data/lib/wx/core/paintdc.rb +8 -0
  37. data/lib/wx/core/text_entry.rb +15 -0
  38. data/lib/wx/core/v_list_box.rb +13 -0
  39. data/lib/wx/core/window.rb +1 -1
  40. data/lib/wx/doc/busy_info.rb +21 -0
  41. data/lib/wx/doc/client_dc.rb +28 -0
  42. data/lib/wx/doc/controlwithitems.rb +11 -0
  43. data/lib/wx/doc/dc.rb +0 -14
  44. data/lib/wx/doc/event_blocker.rb +27 -0
  45. data/lib/wx/doc/evthandler.rb +4 -0
  46. data/lib/wx/doc/extra/02_lifecycles.md +49 -0
  47. data/lib/wx/doc/extra/10_art.md +1 -1
  48. data/lib/wx/doc/extra/11_drawing_and_dc.md +62 -0
  49. data/lib/wx/doc/gen/about_dialog_info.rb +27 -24
  50. data/lib/wx/doc/gen/accelerator.rb +11 -12
  51. data/lib/wx/doc/gen/app.rb +6 -3
  52. data/lib/wx/doc/gen/art_provider.rb +53 -29
  53. data/lib/wx/doc/gen/aui/aui_manager.rb +4 -0
  54. data/lib/wx/doc/gen/aui/aui_mdi_child_frame.rb +1 -1
  55. data/lib/wx/doc/gen/aui/aui_pane_info.rb +2 -0
  56. data/lib/wx/doc/gen/aui/aui_tab_ctrl.rb +2 -0
  57. data/lib/wx/doc/gen/bitmap.rb +25 -25
  58. data/lib/wx/doc/gen/bitmap_combo_box.rb +157 -0
  59. data/lib/wx/doc/gen/box_sizer.rb +6 -8
  60. data/lib/wx/doc/gen/brush.rb +2 -0
  61. data/lib/wx/doc/gen/busy_info.rb +52 -46
  62. data/lib/wx/doc/gen/caret.rb +0 -4
  63. data/lib/wx/doc/gen/check_list_box.rb +0 -2
  64. data/lib/wx/doc/gen/choice.rb +1 -5
  65. data/lib/wx/doc/gen/client_dc.rb +13 -18
  66. data/lib/wx/doc/gen/clipboard.rb +30 -27
  67. data/lib/wx/doc/gen/collapsible_pane.rb +11 -9
  68. data/lib/wx/doc/gen/colour.rb +6 -3
  69. data/lib/wx/doc/gen/colour_dialog.rb +111 -23
  70. data/lib/wx/doc/gen/combo_box.rb +2 -4
  71. data/lib/wx/doc/gen/control.rb +20 -18
  72. data/lib/wx/doc/gen/core.rb +2 -2
  73. data/lib/wx/doc/gen/cursor.rb +18 -50
  74. data/lib/wx/doc/gen/data_format.rb +0 -2
  75. data/lib/wx/doc/gen/data_object.rb +37 -44
  76. data/lib/wx/doc/gen/dc.rb +16 -24
  77. data/lib/wx/doc/gen/defs.rb +3 -40
  78. data/lib/wx/doc/gen/dialog.rb +21 -17
  79. data/lib/wx/doc/gen/dir_dialog.rb +10 -8
  80. data/lib/wx/doc/gen/event.rb +2 -2
  81. data/lib/wx/doc/gen/event_blocker.rb +49 -0
  82. data/lib/wx/doc/gen/event_filter.rb +95 -0
  83. data/lib/wx/doc/gen/event_list.rb +16 -2
  84. data/lib/wx/doc/gen/events.rb +103 -112
  85. data/lib/wx/doc/gen/evt_handler.rb +28 -52
  86. data/lib/wx/doc/gen/file_dialog.rb +8 -4
  87. data/lib/wx/doc/gen/find_replace_dialog.rb +1 -1
  88. data/lib/wx/doc/gen/font.rb +10 -2
  89. data/lib/wx/doc/gen/font_data.rb +2 -0
  90. data/lib/wx/doc/gen/font_dialog.rb +1 -1
  91. data/lib/wx/doc/gen/frame.rb +4 -3
  92. data/lib/wx/doc/gen/fs_file.rb +8 -0
  93. data/lib/wx/doc/gen/gcdc.rb +2 -22
  94. data/lib/wx/doc/gen/gdi_common.rb +18 -2
  95. data/lib/wx/doc/gen/gdi_object.rb +2 -0
  96. data/lib/wx/doc/gen/graphics_context.rb +4 -43
  97. data/lib/wx/doc/gen/graphics_object.rb +2 -0
  98. data/lib/wx/doc/gen/grid/grid_cell_attr.rb +2 -1
  99. data/lib/wx/doc/gen/grid/grid_ctrl.rb +4 -2
  100. data/lib/wx/doc/gen/grid/grid_table_message.rb +2 -0
  101. data/lib/wx/doc/gen/grid_bag_sizer.rb +4 -0
  102. data/lib/wx/doc/gen/help_controller.rb +4 -1
  103. data/lib/wx/doc/gen/html/html_cell.rb +4 -1
  104. data/lib/wx/doc/gen/html/html_help_controller.rb +4 -1
  105. data/lib/wx/doc/gen/html/html_help_data.rb +4 -0
  106. data/lib/wx/doc/gen/html/html_help_window.rb +2 -1
  107. data/lib/wx/doc/gen/html/html_list_box.rb +138 -11
  108. data/lib/wx/doc/gen/html/html_window.rb +9 -3
  109. data/lib/wx/doc/gen/icon.rb +7 -1
  110. data/lib/wx/doc/gen/icon_location.rb +2 -0
  111. data/lib/wx/doc/gen/image.rb +15 -8
  112. data/lib/wx/doc/gen/keyboard_state.rb +6 -0
  113. data/lib/wx/doc/gen/list_box.rb +0 -11
  114. data/lib/wx/doc/gen/list_ctrl.rb +10 -13
  115. data/lib/wx/doc/gen/locale.rb +7 -3
  116. data/lib/wx/doc/gen/log.rb +6 -2
  117. data/lib/wx/doc/gen/mdi_frame.rb +2 -0
  118. data/lib/wx/doc/gen/media_ctrl.rb +2 -0
  119. data/lib/wx/doc/gen/memory_dc.rb +105 -18
  120. data/lib/wx/doc/gen/menu.rb +4 -2
  121. data/lib/wx/doc/gen/menu_bar.rb +0 -2
  122. data/lib/wx/doc/gen/menu_item.rb +9 -3
  123. data/lib/wx/doc/gen/message_dialog.rb +6 -3
  124. data/lib/wx/doc/gen/mirror_dc.rb +2 -8
  125. data/lib/wx/doc/gen/mouse_state.rb +2 -0
  126. data/lib/wx/doc/gen/multi_choice_dialog.rb +0 -2
  127. data/lib/wx/doc/gen/non_owned_window.rb +2 -1
  128. data/lib/wx/doc/gen/notebook.rb +4 -2
  129. data/lib/wx/doc/gen/paint_dc.rb +2 -6
  130. data/lib/wx/doc/gen/palette.rb +3 -3
  131. data/lib/wx/doc/gen/pen.rb +6 -1
  132. data/lib/wx/doc/gen/pg/pg_editor.rb +2 -1
  133. data/lib/wx/doc/gen/pg/pg_multi_button.rb +4 -0
  134. data/lib/wx/doc/gen/pg/pg_properties.rb +30 -3
  135. data/lib/wx/doc/gen/pg/pg_property.rb +30 -4
  136. data/lib/wx/doc/gen/pg/pg_validation_info.rb +2 -0
  137. data/lib/wx/doc/gen/pg/property_grid.rb +5 -2
  138. data/lib/wx/doc/gen/pg/property_grid_interface.rb +6 -2
  139. data/lib/wx/doc/gen/pg/property_grid_manager.rb +2 -0
  140. data/lib/wx/doc/gen/pg/property_grid_page_state.rb +2 -0
  141. data/lib/wx/doc/gen/picker_base.rb +2 -1
  142. data/lib/wx/doc/gen/platform_info.rb +4 -1
  143. data/lib/wx/doc/gen/property_sheet_dialog.rb +2 -0
  144. data/lib/wx/doc/gen/prt/post_script_dc.rb +2 -8
  145. data/lib/wx/doc/gen/prt/print_data.rb +6 -0
  146. data/lib/wx/doc/gen/prt/printer.rb +0 -3
  147. data/lib/wx/doc/gen/prt/printer_dc.rb +2 -6
  148. data/lib/wx/doc/gen/radio_box.rb +2 -2
  149. data/lib/wx/doc/gen/rbn/ribbon_art_provider.rb +6 -0
  150. data/lib/wx/doc/gen/rbn/ribbon_panel.rb +1 -1
  151. data/lib/wx/doc/gen/region.rb +2 -0
  152. data/lib/wx/doc/gen/rtc/rich_text_buffer.rb +6 -0
  153. data/lib/wx/doc/gen/rtc/rich_text_ctrl.rb +0 -4
  154. data/lib/wx/doc/gen/rtc/rich_text_header_footer_data.rb +2 -0
  155. data/lib/wx/doc/gen/rtc/rich_text_html_handler.rb +2 -1
  156. data/lib/wx/doc/gen/rtc/symbol_picker_dialog.rb +2 -0
  157. data/lib/wx/doc/gen/screen_dc.rb +2 -0
  158. data/lib/wx/doc/gen/scroll_bar.rb +2 -1
  159. data/lib/wx/doc/gen/scrolled_canvas.rb +4 -8
  160. data/lib/wx/doc/gen/scrolled_control.rb +4 -8
  161. data/lib/wx/doc/gen/scrolled_window.rb +4 -8
  162. data/lib/wx/doc/gen/search_ctrl.rb +131 -0
  163. data/lib/wx/doc/gen/single_choice_dialog.rb +0 -2
  164. data/lib/wx/doc/gen/sizer.rb +14 -3
  165. data/lib/wx/doc/gen/splash_screen.rb +2 -0
  166. data/lib/wx/doc/gen/static_box.rb +6 -3
  167. data/lib/wx/doc/gen/static_box_sizer.rb +2 -1
  168. data/lib/wx/doc/gen/status_bar.rb +0 -5
  169. data/lib/wx/doc/gen/stc/styled_text_ctrl.rb +4 -5
  170. data/lib/wx/doc/gen/svg_file_dc.rb +10 -11
  171. data/lib/wx/doc/gen/text_ctrl.rb +10 -3
  172. data/lib/wx/doc/gen/text_entry.rb +8 -3
  173. data/lib/wx/doc/gen/text_entry_dialog.rb +4 -2
  174. data/lib/wx/doc/gen/timer_event.rb +2 -0
  175. data/lib/wx/doc/gen/tool_bar.rb +8 -4
  176. data/lib/wx/doc/gen/top_level_window.rb +5 -2
  177. data/lib/wx/doc/gen/tree_ctrl.rb +0 -6
  178. data/lib/wx/doc/gen/ui_action_simulator.rb +100 -0
  179. data/lib/wx/doc/gen/utils.rb +1 -1
  180. data/lib/wx/doc/gen/v_list_box.rb +36 -26
  181. data/lib/wx/doc/gen/validator.rb +2 -1
  182. data/lib/wx/doc/gen/variant.rb +10 -0
  183. data/lib/wx/doc/gen/window.rb +38 -17
  184. data/lib/wx/doc/gen/window_dc.rb +2 -0
  185. data/lib/wx/doc/gen/window_disabler.rb +2 -0
  186. data/lib/wx/doc/gen/wizard_page_simple.rb +2 -0
  187. data/lib/wx/doc/gen/xml_node.rb +6 -0
  188. data/lib/wx/doc/gen/xml_resource.rb +4 -1
  189. data/lib/wx/doc/memory_dc.rb +75 -0
  190. data/lib/wx/doc/mirror_dc.rb +16 -0
  191. data/lib/wx/doc/prt/printer_dc.rb +26 -0
  192. data/lib/wx/doc/screen_dc.rb +10 -6
  193. data/lib/wx/doc/svg_file_dc.rb +20 -0
  194. data/lib/wx/doc/v_list_box.rb +9 -0
  195. data/lib/wx/doc/window_disabler.rb +10 -0
  196. data/lib/wx/html/keyword_defs.rb +6 -7
  197. data/lib/wx/html/require.rb +1 -0
  198. data/lib/wx/html/simple_html_listbox.rb +105 -0
  199. data/lib/wx/keyword_defs.rb +7 -0
  200. data/lib/wx/version.rb +1 -1
  201. data/lib/wx/wxruby/cmd/test.rb +1 -1
  202. data/lib/wxruby_aui.so +0 -0
  203. data/lib/wxruby_core.so +0 -0
  204. data/lib/wxruby_grid.so +0 -0
  205. data/lib/wxruby_html.so +0 -0
  206. data/lib/wxruby_pg.so +0 -0
  207. data/lib/wxruby_prt.so +0 -0
  208. data/lib/wxruby_rbn.so +0 -0
  209. data/lib/wxruby_rtc.so +0 -0
  210. data/lib/wxruby_stc.so +0 -0
  211. data/rakelib/install.rb +3 -1
  212. data/rakelib/yard/yard/relative_markdown_links.rb +5 -1
  213. data/samples/bigdemo/wxArtProvider.rbw +5 -4
  214. data/samples/controls/controls.rb +2 -2
  215. data/samples/controls/htlbox.rb +411 -0
  216. data/samples/controls/tn_htlbox.png +0 -0
  217. data/samples/drawing/graphics_drawing.rb +1 -2
  218. data/samples/drawing/{svgtest.rb → image_prt.rb} +49 -18
  219. data/samples/drawing/tn_image_prt.png +0 -0
  220. data/samples/propgrid/propgrid.rb +23 -21
  221. data/samples/ribbon/ribbon.rb +47 -46
  222. data/tests/lib/wxapp_runner.rb +3 -3
  223. data/tests/lib/wxframe_runner.rb +59 -0
  224. data/tests/test_app_event_filter.rb +74 -0
  225. data/tests/test_art_provider.rb +52 -0
  226. data/tests/test_clipboard.rb +2 -1
  227. data/tests/test_event_handling.rb +199 -16
  228. data/tests/test_events.rb +4 -11
  229. data/tests/test_gdi_object.rb +161 -0
  230. data/tests/test_intl.rb +11 -14
  231. data/tests/test_item_data.rb +33 -1
  232. data/tests/test_std_controls.rb +147 -0
  233. metadata +38 -8
  234. data/lib/wx/doc/gen/auto_buffered_paint_dc.rb +0 -47
  235. data/lib/wx/doc/gen/buffered_dc.rb +0 -95
  236. data/lib/wx/doc/gen/buffered_paint_dc.rb +0 -55
  237. data/lib/wx/doc/gen/colour_data.rb +0 -96
  238. data/samples/drawing/tn_svgtest.png +0 -0
@@ -0,0 +1,161 @@
1
+
2
+ require_relative './lib/wxapp_runner'
3
+
4
+ class TestGDIObjects < Test::Unit::TestCase
5
+
6
+ def test_icon
7
+ ico = Wx::Icon(:sample3)
8
+ assert(ico.ok?)
9
+ frame = Wx::Frame.new(nil)
10
+ frame.set_icon(ico)
11
+ GC.start
12
+ ico_cpy = frame.get_icon
13
+ GC.start
14
+ assert(ico_cpy.ok?)
15
+ assert_not_equal(ico.object_id, ico_cpy.object_id)
16
+ ico = nil
17
+ ico_cpy = nil
18
+ GC.start
19
+ ico_cpy = frame.get_icon
20
+ GC.start
21
+ assert(ico_cpy.ok?)
22
+ assert_not_equal(ico.object_id, ico_cpy.object_id)
23
+ end
24
+
25
+ def test_icon_bundle
26
+ ib = Wx::IconBundle.new
27
+ ib.add_icon(Wx::Icon(:sample3))
28
+ img = Wx::Image(:sample3)
29
+ ib.add_icon(Wx::Icon.from_bitmap(img.scale(img.get_size.width*2, img.get_size.height*2).to_bitmap))
30
+ assert_equal(2, ib.get_icon_count)
31
+ frame = Wx::Frame.new(nil)
32
+ frame.set_icons(ib)
33
+ GC.start
34
+ ib_cpy = frame.get_icons
35
+ GC.start
36
+ assert_equal(2, ib_cpy.get_icon_count)
37
+ assert_not_equal(ib.object_id, ib_cpy.object_id)
38
+ ib = nil
39
+ ib_cpy = nil
40
+ GC.start
41
+ ib_cpy = frame.get_icons
42
+ GC.start
43
+ assert_equal(2, ib_cpy.get_icon_count)
44
+ assert_not_equal(ib.object_id, ib_cpy.object_id)
45
+ end
46
+
47
+ def test_bitmap_bundle
48
+ bb = Wx::BitmapBundle.from_bitmaps(Wx::Bitmap(:sample3), Wx::Bitmap.new(Wx::ArtLocator.find_art(:sample, art_section: 'my_art')))
49
+ assert(bb.ok?)
50
+ mi = Wx::MenuItem.new(nil, 1, 'test')
51
+ mi.set_bitmap(bb)
52
+ GC.start
53
+ bb_cpy = mi.get_bitmap_bundle
54
+ GC.start
55
+ assert(bb_cpy.ok?)
56
+ assert_not_equal(bb.object_id, bb_cpy.object_id)
57
+ bb = nil
58
+ bb_cpy = nil
59
+ GC.start
60
+ bb_cpy = mi.get_bitmap_bundle
61
+ GC.start
62
+ assert(bb_cpy.ok?)
63
+ assert_not_equal(bb.object_id, bb_cpy.object_id)
64
+ end
65
+
66
+ def test_bitmap
67
+ bmp = Wx::Bitmap(:sample3)
68
+ assert(bmp.ok?)
69
+ mi = Wx::MenuItem.new(nil, 1, 'test')
70
+ mi.set_bitmap(bmp)
71
+ GC.start
72
+ bmp_cpy = mi.get_bitmap
73
+ GC.start
74
+ assert(bmp_cpy.ok?)
75
+ assert_not_equal(bmp.object_id, bmp_cpy.object_id)
76
+ bmp = nil
77
+ bmp_cpy = nil
78
+ GC.start
79
+ bmp_cpy = mi.get_bitmap
80
+ GC.start
81
+ assert(bmp_cpy.ok?)
82
+ assert_not_equal(bmp.object_id, bmp_cpy.object_id)
83
+ end
84
+
85
+ def test_colour
86
+ col = Wx::Colour.new('red')
87
+ assert(col.ok?)
88
+ Wx::MemoryDC.draw_on(Wx::Bitmap.new(600, 400)) do |dc|
89
+ dc.set_text_background(col)
90
+ GC.start
91
+ col_cpy = dc.get_text_background
92
+ GC.start
93
+ assert(col_cpy.ok?)
94
+ assert_not_equal(col.object_id, col_cpy.object_id)
95
+ col = col_cpy = nil
96
+ GC.start
97
+ col_cpy = dc.get_text_background
98
+ GC.start
99
+ assert(col_cpy.ok?)
100
+ assert_not_equal(col.object_id, col_cpy.object_id)
101
+ end
102
+ end
103
+
104
+ def test_font
105
+ font = Wx::Font.new(10, Wx::FontFamily::FONTFAMILY_DEFAULT, Wx::FontStyle::FONTSTYLE_NORMAL, Wx::FontWeight::FONTWEIGHT_BOLD)
106
+ assert(font.ok?)
107
+ Wx::MemoryDC.draw_on(Wx::Bitmap.new(600, 400)) do |dc|
108
+ dc.set_font(font)
109
+ GC.start
110
+ font_cpy = dc.get_font
111
+ GC.start
112
+ assert(font_cpy.ok?)
113
+ assert_not_equal(font.object_id, font_cpy.object_id)
114
+ font = font_cpy = nil
115
+ GC.start
116
+ font_cpy = dc.get_font
117
+ GC.start
118
+ assert(font_cpy.ok?)
119
+ assert_not_equal(font.object_id, font_cpy.object_id)
120
+ end
121
+ end
122
+
123
+ def test_brush
124
+ brush = Wx::Brush.new(:black)
125
+ assert(brush.ok?)
126
+ Wx::MemoryDC.draw_on(Wx::Bitmap.new(600, 400)) do |dc|
127
+ dc.set_brush(brush)
128
+ GC.start
129
+ brush_cpy = dc.get_brush
130
+ GC.start
131
+ assert(brush_cpy.ok?)
132
+ assert_not_equal(brush.object_id, brush_cpy.object_id)
133
+ brush = brush_cpy = nil
134
+ GC.start
135
+ brush_cpy = dc.get_brush
136
+ GC.start
137
+ assert(brush_cpy.ok?)
138
+ assert_not_equal(brush.object_id, brush_cpy.object_id)
139
+ end
140
+ end
141
+
142
+ def test_pen
143
+ pen = Wx::Pen.new(:black, 1, Wx::PenStyle::PENSTYLE_SOLID)
144
+ assert(pen.ok?)
145
+ Wx::MemoryDC.draw_on(Wx::Bitmap.new(600, 400)) do |dc|
146
+ dc.set_pen(pen)
147
+ GC.start
148
+ pen_cpy = dc.get_pen
149
+ GC.start
150
+ assert(pen_cpy.ok?)
151
+ assert_not_equal(pen.object_id, pen_cpy.object_id)
152
+ pen = pen_cpy = nil
153
+ GC.start
154
+ pen_cpy = dc.get_pen
155
+ GC.start
156
+ assert(pen_cpy.ok?)
157
+ assert_not_equal(pen.object_id, pen_cpy.object_id)
158
+ end
159
+ end
160
+
161
+ end
data/tests/test_intl.rb CHANGED
@@ -35,20 +35,17 @@ class TestInternationalisation < Test::Unit::TestCase
35
35
  assert_nil( Wx::Locale.find_language_info('xx') )
36
36
  end
37
37
 
38
- # def test_add_language_info
39
- # flunk 'Wx::Locale.add_language is not yet implemented'
40
- # # FIXME - typemaps for wxString are not picked up when SWIG converts
41
- # # the struct definition; so maybe do an %extend for this method that
42
- # # accepts string canonical name and description and Win32
43
- # # identifiers, and returns an integer id. See Locale.i
44
- # language_marain = Wx::Locale.add_language('ma_MA', 'Marain',
45
- # 0, 0)
46
- # assert_kind_of(Integer, language_marain)
47
- # lang_info = Wx::Locale.find_language_info('ma_MA')
48
- # assert_equal(Wx::LANGUAGE_MARAIN, lang_info.language)
49
- # assert_equal('ma_MA', lang_info.canonical_name)
50
- # assert_equal('Marain', lang_info.description)
51
- # end
38
+ def test_add_language_info
39
+ new_lang_info = Wx::LanguageInfo.new
40
+ new_lang_info.canonical_name = 'ma_MA'
41
+ new_lang_info.description = 'Marain'
42
+ new_lang_info.language = 1000
43
+ Wx::Locale.add_language(new_lang_info)
44
+ lang_info = Wx::Locale.find_language_info('ma_MA')
45
+ assert_equal(1000, lang_info.language)
46
+ assert_equal('ma_MA', lang_info.canonical_name)
47
+ assert_equal('Marain', lang_info.description)
48
+ end
52
49
 
53
50
  def test_get_system_language
54
51
  sys_lang = Wx::Locale.get_system_language
@@ -91,6 +91,31 @@ class TestItemData < Test::Unit::TestCase
91
91
  GC.start
92
92
  end
93
93
 
94
+ def do_sorted_control_with_items_assertions(f)
95
+ f.control.append(%w[Beta Alpha Gamma Delta], [1, 'a', :sym, true])
96
+ assert_equal(4, f.control.count)
97
+ assert_equal('a', f.control.get_item_data(0))
98
+ assert_equal(1, f.control.get_item_data(1))
99
+ assert_equal(true, f.control.get_item_data(2))
100
+ assert_equal(:sym, f.control.get_item_data(3))
101
+ GC.start
102
+ assert_equal('a', f.control.get_client_data(0))
103
+ assert_equal(1, f.control.get_client_data(1))
104
+ assert_equal(true, f.control.get_client_data(2))
105
+ assert_equal(:sym, f.control.get_client_data(3))
106
+ GC.start
107
+ f.control.delete(2)
108
+ GC.start
109
+ assert_equal(3, f.control.count)
110
+ assert_equal('a', f.control.get_item_data(0))
111
+ assert_equal(1, f.control.get_item_data(1))
112
+ assert_equal(:sym, f.control.get_item_data(2))
113
+ GC.start
114
+ assert_equal('a', f.control.get_client_data(0))
115
+ assert_equal(1, f.control.get_client_data(1))
116
+ assert_equal(:sym, f.control.get_client_data(2))
117
+ end
118
+
94
119
  def test_treectrl_itemdata
95
120
  f = CtrlContainerFrame.new(Wx::TreeCtrl)
96
121
  tree = f.control
@@ -157,7 +182,14 @@ class TestItemData < Test::Unit::TestCase
157
182
  do_control_with_items_assertions(f)
158
183
  f.close(true)
159
184
  end
160
-
185
+
186
+ def test_sorted_listbox_itemdata
187
+ f = CtrlContainerFrame.new(Wx::ListBox, Wx::DEFAULT_POSITION,
188
+ Wx::DEFAULT_SIZE, [], Wx::LB_SORT)
189
+ do_sorted_control_with_items_assertions(f)
190
+ f.close(true)
191
+ end
192
+
161
193
  def test_combobox_itemdata
162
194
  f = CtrlContainerFrame.new(Wx::ComboBox, '', Wx::DEFAULT_POSITION,
163
195
  Wx::DEFAULT_SIZE, %w[hash string float])
@@ -0,0 +1,147 @@
1
+
2
+ require_relative './lib/wxframe_runner'
3
+
4
+ class ButtonTests < WxRuby::Test::GUITests
5
+
6
+ def setup
7
+ super
8
+ @button = Wx::Button.new(test_frame, name: 'Button')
9
+ Wx.get_app.yield
10
+ end
11
+
12
+ def cleanup
13
+ @button.destroy
14
+ Wx.get_app.yield
15
+ super
16
+ end
17
+
18
+ attr_reader :button
19
+
20
+ if Wx.has_feature?(:USE_UIACTIONSIMULATOR)
21
+
22
+ def test_click
23
+ count = count_events(button, :evt_button) do
24
+ sim = Wx::UIActionSimulator.new
25
+
26
+ # We move in slightly to account for window decorations, we need to yield
27
+ # after every Wx::UIActionSimulator action to keep everything working in GTK
28
+ sim.mouse_move(button.get_screen_position + Wx::Point.new(10, 10))
29
+ Wx.get_app.yield
30
+
31
+ sim.mouse_click
32
+ Wx.get_app.yield
33
+ end
34
+
35
+ assert_equal(1, count)
36
+ end
37
+
38
+ def test_disabled
39
+ button.disable
40
+ count = count_events(button, :evt_button) do
41
+ sim = Wx::UIActionSimulator.new
42
+
43
+ # We move in slightly to account for window decorations, we need to yield
44
+ # after every Wx::UIActionSimulator action to keep everything working in GTK
45
+ sim.mouse_move(button.get_screen_position + Wx::Point.new(10, 10))
46
+ Wx.get_app.yield
47
+
48
+ sim.mouse_click
49
+ Wx.get_app.yield
50
+ end
51
+
52
+ assert_equal(0, count)
53
+ end
54
+
55
+ end # wxUSE_UIACTIONSIMULATOR
56
+
57
+ def test_bitmap
58
+ # We start with no bitmaps
59
+ assert(!button.get_bitmap.ok?)
60
+
61
+ # Some bitmap, doesn't really matter which.
62
+ bmp = Wx::ArtProvider.get_bitmap(Wx::ART_INFORMATION)
63
+
64
+ button.set_bitmap(bmp)
65
+
66
+ assert(button.get_bitmap.ok?)
67
+
68
+ # The call above shouldn't affect any other bitmaps as returned by the API
69
+ # even though the same (normal) bitmap does appear for all the states.
70
+ assert( !button.get_bitmap_current.ok? )
71
+ assert( !button.get_bitmap_disabled.ok? )
72
+ assert( !button.get_bitmap_focus.ok? )
73
+ assert( !button.get_bitmap_pressed.ok? )
74
+
75
+ # Do set one of the bitmaps now.
76
+ button.set_bitmap_pressed(Wx::ArtProvider.get_bitmap(Wx::ART_ERROR))
77
+ assert( button.get_bitmap_pressed.ok? )
78
+
79
+ # Check that resetting the button label doesn't result in problems when
80
+ # updating the bitmap later, as it used to be the case in wxGTK (#18898).
81
+ button.set_label('')
82
+ assert_nothing_raised { button.disable }
83
+
84
+ # Also check that setting an invalid bitmap doesn't do anything untoward,
85
+ # such as crashing, as it used to do in wxOSX (#19257).
86
+ assert_nothing_raised { button.set_bitmap_pressed(Wx::NULL_BITMAP) }
87
+ assert( !button.get_bitmap_pressed.ok? )
88
+ end
89
+
90
+ end
91
+
92
+ class TextCtrlTests < WxRuby::Test::GUITests
93
+
94
+ def setup
95
+ super
96
+ @text = Wx::TextCtrl.new(test_frame, name: 'Text')
97
+ Wx.get_app.yield
98
+ end
99
+
100
+ def cleanup
101
+ @text.destroy
102
+ Wx.get_app.yield
103
+ super
104
+ end
105
+
106
+ attr_reader :text
107
+
108
+
109
+ if Wx.has_feature?(:USE_UIACTIONSIMULATOR)
110
+
111
+ def test_text
112
+ assert_equal('', text.get_value)
113
+ sim = Wx::UIActionSimulator.new
114
+
115
+ updates = count_events(text, :evt_text) do |c_upd|
116
+ maxlen_count = count_events(text, :evt_text_maxlen) do |c_maxlen|
117
+ # set focus to text control
118
+ text.set_focus
119
+ Wx.get_app.yield
120
+
121
+ sim.text('Hello')
122
+ Wx.get_app.yield
123
+
124
+ assert_equal('Hello', text.get_value)
125
+ assert_equal(5, c_upd.count)
126
+
127
+ text.set_max_length(10)
128
+ sim.text('World')
129
+ Wx.get_app.yield
130
+
131
+ assert_equal('HelloWorld', text.get_value)
132
+ assert_equal(10, c_upd.count)
133
+ assert_equal(0, c_maxlen.count)
134
+
135
+ sim.text('!')
136
+ Wx.get_app.yield
137
+
138
+ assert_equal('HelloWorld', text.get_value)
139
+ assert_equal(10, c_upd.count)
140
+ assert_equal(1, c_maxlen.count)
141
+ end
142
+ end
143
+ end
144
+
145
+ end
146
+
147
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wxruby3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0.pre.beta.14
4
+ version: 0.9.0.pre.rc.1
5
5
  platform: x64-mingw-ucrt
6
6
  authors:
7
7
  - Martin Corino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-22 00:00:00.000000000 Z
11
+ date: 2023-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -67,9 +67,13 @@ files:
67
67
  - INSTALL.md
68
68
  - LICENSE
69
69
  - README.md
70
+ - assets/hello_button.png
71
+ - assets/hello_button_clicked.png
72
+ - assets/hello_world.png
70
73
  - assets/logo.png
71
74
  - assets/logo.svg
72
75
  - assets/logo.xcf
76
+ - assets/repo-social-preview.png
73
77
  - bin/wxruby
74
78
  - bin/wxruby.bat
75
79
  - ext/mkrf_conf_bingem.rb
@@ -103,6 +107,7 @@ files:
103
107
  - lib/wx/core/art_locator.rb
104
108
  - lib/wx/core/artprovider.rb
105
109
  - lib/wx/core/bitmap.rb
110
+ - lib/wx/core/bitmap_combobox.rb
106
111
  - lib/wx/core/busycursor.rb
107
112
  - lib/wx/core/choice.rb
108
113
  - lib/wx/core/choicedlg.rb
@@ -119,9 +124,11 @@ files:
119
124
  - lib/wx/core/dialog.rb
120
125
  - lib/wx/core/enum.rb
121
126
  - lib/wx/core/event.rb
127
+ - lib/wx/core/event_blocker.rb
122
128
  - lib/wx/core/events/evt_list.rb
123
129
  - lib/wx/core/evthandler.rb
124
130
  - lib/wx/core/ext.rb
131
+ - lib/wx/core/find_replace_dialog.rb
125
132
  - lib/wx/core/font.rb
126
133
  - lib/wx/core/font/encoding.rb
127
134
  - lib/wx/core/functions.rb
@@ -144,6 +151,7 @@ files:
144
151
  - lib/wx/core/menuitem.rb
145
152
  - lib/wx/core/notebook.rb
146
153
  - lib/wx/core/object.rb
154
+ - lib/wx/core/paintdc.rb
147
155
  - lib/wx/core/pen_info.rb
148
156
  - lib/wx/core/platform_info.rb
149
157
  - lib/wx/core/point.rb
@@ -154,11 +162,13 @@ files:
154
162
  - lib/wx/core/size.rb
155
163
  - lib/wx/core/sizer.rb
156
164
  - lib/wx/core/splash_screen.rb
165
+ - lib/wx/core/text_entry.rb
157
166
  - lib/wx/core/textctrl.rb
158
167
  - lib/wx/core/timer.rb
159
168
  - lib/wx/core/toolbar.rb
160
169
  - lib/wx/core/toolbartool.rb
161
170
  - lib/wx/core/treectrl.rb
171
+ - lib/wx/core/v_list_box.rb
162
172
  - lib/wx/core/validator.rb
163
173
  - lib/wx/core/variant.rb
164
174
  - lib/wx/core/vboxsizer.rb
@@ -170,15 +180,19 @@ files:
170
180
  - lib/wx/doc/aui/auimanager.rb
171
181
  - lib/wx/doc/aui/auinotebook.rb
172
182
  - lib/wx/doc/bitmap.rb
183
+ - lib/wx/doc/busy_info.rb
184
+ - lib/wx/doc/client_dc.rb
173
185
  - lib/wx/doc/clipboard.rb
174
186
  - lib/wx/doc/colour_dialog.rb
175
187
  - lib/wx/doc/const.rb
188
+ - lib/wx/doc/controlwithitems.rb
176
189
  - lib/wx/doc/core.rb
177
190
  - lib/wx/doc/cursor.rb
178
191
  - lib/wx/doc/data_object.rb
179
192
  - lib/wx/doc/dc.rb
180
193
  - lib/wx/doc/enum.rb
181
194
  - lib/wx/doc/event.rb
195
+ - lib/wx/doc/event_blocker.rb
182
196
  - lib/wx/doc/events.rb
183
197
  - lib/wx/doc/evthandler.rb
184
198
  - lib/wx/doc/extra/00_starting.md
@@ -192,6 +206,7 @@ files:
192
206
  - lib/wx/doc/extra/08_extensions.md
193
207
  - lib/wx/doc/extra/09_exceptions.md
194
208
  - lib/wx/doc/extra/10_art.md
209
+ - lib/wx/doc/extra/11_drawing_and_dc.md
195
210
  - lib/wx/doc/functions.rb
196
211
  - lib/wx/doc/gc_dc.rb
197
212
  - lib/wx/doc/gdi_common.rb
@@ -220,15 +235,13 @@ files:
220
235
  - lib/wx/doc/gen/aui/aui_tool_bar_event.rb
221
236
  - lib/wx/doc/gen/aui/aui_tool_bar_item.rb
222
237
  - lib/wx/doc/gen/aui/event_list.rb
223
- - lib/wx/doc/gen/auto_buffered_paint_dc.rb
224
238
  - lib/wx/doc/gen/bitmap.rb
225
239
  - lib/wx/doc/gen/bitmap_button.rb
240
+ - lib/wx/doc/gen/bitmap_combo_box.rb
226
241
  - lib/wx/doc/gen/book_ctrl_base.rb
227
242
  - lib/wx/doc/gen/book_ctrl_event.rb
228
243
  - lib/wx/doc/gen/box_sizer.rb
229
244
  - lib/wx/doc/gen/brush.rb
230
- - lib/wx/doc/gen/buffered_dc.rb
231
- - lib/wx/doc/gen/buffered_paint_dc.rb
232
245
  - lib/wx/doc/gen/busy_info.rb
233
246
  - lib/wx/doc/gen/button.rb
234
247
  - lib/wx/doc/gen/calculate_layout_event.rb
@@ -245,7 +258,6 @@ files:
245
258
  - lib/wx/doc/gen/collapsible_pane.rb
246
259
  - lib/wx/doc/gen/collapsible_pane_event.rb
247
260
  - lib/wx/doc/gen/colour.rb
248
- - lib/wx/doc/gen/colour_data.rb
249
261
  - lib/wx/doc/gen/colour_dialog.rb
250
262
  - lib/wx/doc/gen/colour_picker_ctrl.rb
251
263
  - lib/wx/doc/gen/colour_picker_event.rb
@@ -270,6 +282,8 @@ files:
270
282
  - lib/wx/doc/gen/drag_image.rb
271
283
  - lib/wx/doc/gen/editable_list_box.rb
272
284
  - lib/wx/doc/gen/event.rb
285
+ - lib/wx/doc/gen/event_blocker.rb
286
+ - lib/wx/doc/gen/event_filter.rb
273
287
  - lib/wx/doc/gen/event_list.rb
274
288
  - lib/wx/doc/gen/events.rb
275
289
  - lib/wx/doc/gen/evt_handler.rb
@@ -441,6 +455,7 @@ files:
441
455
  - lib/wx/doc/gen/scrolled_canvas.rb
442
456
  - lib/wx/doc/gen/scrolled_control.rb
443
457
  - lib/wx/doc/gen/scrolled_window.rb
458
+ - lib/wx/doc/gen/search_ctrl.rb
444
459
  - lib/wx/doc/gen/simplebook.rb
445
460
  - lib/wx/doc/gen/single_choice_dialog.rb
446
461
  - lib/wx/doc/gen/sizer.rb
@@ -484,6 +499,7 @@ files:
484
499
  - lib/wx/doc/gen/tree_ctrl.rb
485
500
  - lib/wx/doc/gen/tree_event.rb
486
501
  - lib/wx/doc/gen/treebook.rb
502
+ - lib/wx/doc/gen/ui_action_simulator.rb
487
503
  - lib/wx/doc/gen/utils.rb
488
504
  - lib/wx/doc/gen/v_list_box.rb
489
505
  - lib/wx/doc/gen/v_scrolled_window.rb
@@ -506,6 +522,8 @@ files:
506
522
  - lib/wx/doc/icon.rb
507
523
  - lib/wx/doc/id_helper.rb
508
524
  - lib/wx/doc/image.rb
525
+ - lib/wx/doc/memory_dc.rb
526
+ - lib/wx/doc/mirror_dc.rb
509
527
  - lib/wx/doc/pg/events.rb
510
528
  - lib/wx/doc/pg/pg_property.rb
511
529
  - lib/wx/doc/pg/pgeditor.rb
@@ -516,6 +534,7 @@ files:
516
534
  - lib/wx/doc/prt/print_data.rb
517
535
  - lib/wx/doc/prt/print_dialog.rb
518
536
  - lib/wx/doc/prt/printer.rb
537
+ - lib/wx/doc/prt/printer_dc.rb
519
538
  - lib/wx/doc/rbn/ribbon_bar.rb
520
539
  - lib/wx/doc/rbn/ribbon_button_bar.rb
521
540
  - lib/wx/doc/rbn/ribbon_gallery.rb
@@ -526,10 +545,13 @@ files:
526
545
  - lib/wx/doc/screen_dc.rb
527
546
  - lib/wx/doc/stock_objects.rb
528
547
  - lib/wx/doc/stream.rb
548
+ - lib/wx/doc/svg_file_dc.rb
529
549
  - lib/wx/doc/system_settings.rb
530
550
  - lib/wx/doc/treebook.rb
551
+ - lib/wx/doc/v_list_box.rb
531
552
  - lib/wx/doc/variant.rb
532
553
  - lib/wx/doc/window.rb
554
+ - lib/wx/doc/window_disabler.rb
533
555
  - lib/wx/doc/xml_resource.rb
534
556
  - lib/wx/global_const.rb
535
557
  - lib/wx/grid.rb
@@ -544,6 +566,7 @@ files:
544
566
  - lib/wx/html/htmlwindow.rb
545
567
  - lib/wx/html/keyword_defs.rb
546
568
  - lib/wx/html/require.rb
569
+ - lib/wx/html/simple_html_listbox.rb
547
570
  - lib/wx/keyword_ctors.rb
548
571
  - lib/wx/keyword_defs.rb
549
572
  - lib/wx/pg.rb
@@ -744,6 +767,7 @@ files:
744
767
  - samples/controls/controls.rb
745
768
  - samples/controls/gauge.xpm
746
769
  - samples/controls/get_item_sample.rb
770
+ - samples/controls/htlbox.rb
747
771
  - samples/controls/list.xpm
748
772
  - samples/controls/mondrian.ico
749
773
  - samples/controls/mondrian.xpm
@@ -754,6 +778,7 @@ files:
754
778
  - samples/controls/tn_books.png
755
779
  - samples/controls/tn_controls.png
756
780
  - samples/controls/tn_get_item_sample.png
781
+ - samples/controls/tn_htlbox.png
757
782
  - samples/dialogs/dialogs.rb
758
783
  - samples/dialogs/tips.txt
759
784
  - samples/dialogs/tn_dialogs.png
@@ -765,16 +790,16 @@ files:
765
790
  - samples/drawing/bitmap.rb
766
791
  - samples/drawing/bitmap_image.rb
767
792
  - samples/drawing/graphics_drawing.rb
793
+ - samples/drawing/image_prt.rb
768
794
  - samples/drawing/maths_images.rb
769
795
  - samples/drawing/rmagic_bitmap_image.rb
770
796
  - samples/drawing/ruby-logo.jpg
771
- - samples/drawing/svgtest.rb
772
797
  - samples/drawing/tn_bitmap.png
773
798
  - samples/drawing/tn_bitmap_image.png
774
799
  - samples/drawing/tn_graphics_drawing.png
800
+ - samples/drawing/tn_image_prt.png
775
801
  - samples/drawing/tn_maths_images.png
776
802
  - samples/drawing/tn_rmagic_bitmap_image.png
777
- - samples/drawing/tn_svgtest.png
778
803
  - samples/etc/choice.rb
779
804
  - samples/etc/miniframe.rb
780
805
  - samples/etc/sash.rb
@@ -934,16 +959,21 @@ files:
934
959
  - tests/art/test_art/image/wxruby.png
935
960
  - tests/art/test_art/sample2.xpm
936
961
  - tests/lib/wxapp_runner.rb
962
+ - tests/lib/wxframe_runner.rb
963
+ - tests/test_app_event_filter.rb
937
964
  - tests/test_art.rb
965
+ - tests/test_art_provider.rb
938
966
  - tests/test_basic.rb
939
967
  - tests/test_clipboard.rb
940
968
  - tests/test_dc.rb
941
969
  - tests/test_dialog.rb
942
970
  - tests/test_event_handling.rb
943
971
  - tests/test_events.rb
972
+ - tests/test_gdi_object.rb
944
973
  - tests/test_geometry.rb
945
974
  - tests/test_intl.rb
946
975
  - tests/test_item_data.rb
976
+ - tests/test_std_controls.rb
947
977
  - tests/test_variant.rb
948
978
  - tests/testapp.rb
949
979
  - tests/testapp_noframe.rb
@@ -1,47 +0,0 @@
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
- #
10
- BUFFER_VIRTUAL_AREA = 1
11
-
12
- #
13
- BUFFER_CLIENT_AREA = 2
14
-
15
- #
16
- BUFFER_USES_SHARED_BUFFER = 4
17
-
18
- # Check if the window is natively double buffered and will return a {Wx::PaintDC} if it is, a {Wx::BufferedPaintDC} otherwise.
19
- # It is the caller's responsibility to delete the {Wx::DC} pointer when finished with it.
20
- # @param window [Wx::Window]
21
- # @return [Wx::DC]
22
- def self.auto_buffered_paint_dc_factory(window) end
23
-
24
- # This {Wx::DC} derivative can be used inside of an <code>EVT_PAINT()</code> event handler to achieve double-buffered drawing.
25
- # Just use this class instead of {Wx::PaintDC} and make sure {Wx::Window#set_background_style} is called with {Wx::BackgroundStyle::BG_STYLE_PAINT} somewhere in the class initialization code, and that's all you have to do to (mostly) avoid flicker.
26
- # The difference between {Wx::BufferedPaintDC} and this class is that this class won't double-buffer on platforms which have native double-buffering already, avoiding any unnecessary buffering to avoid flicker.
27
- # {Wx::AutoBufferedPaintDC} is simply a typedef of {Wx::PaintDC} on platforms that have native double-buffering, otherwise, it is a typedef of {Wx::BufferedPaintDC}.
28
- # ===
29
- #
30
- # Category: Device Contexts
31
- # @see Wx::DC
32
- # @see Wx::BufferedPaintDC
33
- # @see Wx::PaintDC
34
- #
35
- #
36
- class AutoBufferedPaintDC < BufferedPaintDC
37
-
38
- # Constructor.
39
- # Pass a pointer to the window on which you wish to paint.
40
- # @param window [Wx::Window]
41
- # @return [AutoBufferedPaintDC]
42
- def initialize(window) end
43
-
44
- end # AutoBufferedPaintDC
45
-
46
-
47
- end