wxruby3 0.9.0.pre.beta.14 → 0.9.0.pre.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/README.md +47 -4
- data/assets/hello_button.png +0 -0
- data/assets/hello_button_clicked.png +0 -0
- data/assets/hello_world.png +0 -0
- data/assets/repo-social-preview.png +0 -0
- data/ext/wxruby3/include/wxruby-runtime.h +1 -0
- data/ext/wxruby3/swig/memory_management.i +6 -10
- data/ext/wxruby3/swig/wx.i +17 -6
- data/lib/wx/core/art_locator.rb +2 -2
- data/lib/wx/core/artprovider.rb +2 -2
- data/lib/wx/core/bitmap.rb +6 -5
- data/lib/wx/core/bitmap_combobox.rb +34 -0
- data/lib/wx/core/controlwithitems.rb +52 -14
- data/lib/wx/core/cursor.rb +1 -1
- data/lib/wx/core/dc.rb +0 -20
- data/lib/wx/core/event_blocker.rb +14 -0
- data/lib/wx/core/evthandler.rb +36 -0
- data/lib/wx/core/find_replace_dialog.rb +24 -0
- data/lib/wx/core/icon.rb +1 -1
- data/lib/wx/core/image.rb +1 -1
- data/lib/wx/core/paintdc.rb +8 -0
- data/lib/wx/core/text_entry.rb +15 -0
- data/lib/wx/core/v_list_box.rb +13 -0
- data/lib/wx/core/window.rb +1 -1
- data/lib/wx/doc/busy_info.rb +21 -0
- data/lib/wx/doc/client_dc.rb +28 -0
- data/lib/wx/doc/controlwithitems.rb +11 -0
- data/lib/wx/doc/dc.rb +0 -14
- data/lib/wx/doc/event_blocker.rb +27 -0
- data/lib/wx/doc/evthandler.rb +4 -0
- data/lib/wx/doc/extra/02_lifecycles.md +49 -0
- data/lib/wx/doc/extra/10_art.md +1 -1
- data/lib/wx/doc/extra/11_drawing_and_dc.md +62 -0
- data/lib/wx/doc/memory_dc.rb +75 -0
- data/lib/wx/doc/mirror_dc.rb +16 -0
- data/lib/wx/doc/prt/printer_dc.rb +26 -0
- data/lib/wx/doc/screen_dc.rb +10 -6
- data/lib/wx/doc/svg_file_dc.rb +20 -0
- data/lib/wx/doc/v_list_box.rb +9 -0
- data/lib/wx/doc/window_disabler.rb +10 -0
- data/lib/wx/html/keyword_defs.rb +6 -7
- data/lib/wx/html/require.rb +1 -0
- data/lib/wx/html/simple_html_listbox.rb +105 -0
- data/lib/wx/keyword_defs.rb +7 -0
- data/lib/wx/version.rb +1 -1
- data/lib/wx/wxruby/cmd/test.rb +1 -1
- data/rakelib/install.rb +3 -1
- data/rakelib/lib/core/mapping.rb +5 -5
- data/rakelib/lib/core/spec.rb +7 -3
- data/rakelib/lib/core/spec_helper.rb +9 -1
- data/rakelib/lib/director/accelerator.rb +1 -1
- data/rakelib/lib/director/app.rb +25 -3
- data/rakelib/lib/director/art_provider.rb +5 -1
- data/rakelib/lib/director/aui_pane_info.rb +1 -1
- data/rakelib/lib/director/aui_tab_ctrl.rb +1 -1
- data/rakelib/lib/director/bitmap.rb +2 -1
- data/rakelib/lib/director/bitmap_combobox.rb +32 -0
- data/rakelib/lib/director/brush.rb +1 -0
- data/rakelib/lib/director/busy_info.rb +1 -1
- data/rakelib/lib/director/choice.rb +1 -0
- data/rakelib/lib/director/clipboard.rb +1 -1
- data/rakelib/lib/director/colour.rb +1 -0
- data/rakelib/lib/director/colour_picker_ctrl.rb +1 -1
- data/rakelib/lib/director/combobox.rb +1 -2
- data/rakelib/lib/director/ctrl_with_items.rb +3 -0
- data/rakelib/lib/director/cursor.rb +1 -0
- data/rakelib/lib/director/data_object.rb +5 -7
- data/rakelib/lib/director/dc.rb +5 -1
- data/rakelib/lib/director/defs.rb +3 -0
- data/rakelib/lib/director/derived_dc.rb +278 -27
- data/rakelib/lib/director/dialog.rb +4 -1
- data/rakelib/lib/director/dir_picker_ctrl.rb +1 -1
- data/rakelib/lib/director/event.rb +3 -3
- data/rakelib/lib/director/event_blocker.rb +41 -0
- data/rakelib/lib/director/event_filter.rb +20 -0
- data/rakelib/lib/director/event_handler.rb +29 -2
- data/rakelib/lib/director/file_picker_ctrl.rb +1 -1
- data/rakelib/lib/director/find_replace_data.rb +1 -0
- data/rakelib/lib/director/font.rb +2 -1
- data/rakelib/lib/director/font_data.rb +1 -0
- data/rakelib/lib/director/font_picker_ctrl.rb +1 -1
- data/rakelib/lib/director/gdi_object.rb +1 -0
- data/rakelib/lib/director/graphics_context.rb +6 -6
- data/rakelib/lib/director/grid_table_message.rb +1 -1
- data/rakelib/lib/director/html_cell.rb +1 -1
- data/rakelib/lib/director/html_data_object.rb +5 -7
- data/rakelib/lib/director/html_listbox.rb +65 -1
- data/rakelib/lib/director/icon.rb +2 -0
- data/rakelib/lib/director/listbox.rb +1 -0
- data/rakelib/lib/director/locale.rb +2 -1
- data/rakelib/lib/director/palette.rb +1 -0
- data/rakelib/lib/director/pen.rb +2 -1
- data/rakelib/lib/director/pgproperties.rb +1 -1
- data/rakelib/lib/director/pgproperty.rb +1 -1
- data/rakelib/lib/director/pgvalidation_info.rb +1 -1
- data/rakelib/lib/director/platform_info.rb +1 -1
- data/rakelib/lib/director/print_data.rb +1 -1
- data/rakelib/lib/director/property_grid_interface.rb +1 -1
- data/rakelib/lib/director/property_grid_page_state.rb +1 -1
- data/rakelib/lib/director/region.rb +1 -0
- data/rakelib/lib/director/ribbon_art_provider.rb +1 -1
- data/rakelib/lib/director/richtext_buffer_data_object.rb +5 -7
- data/rakelib/lib/director/richtext_header_footer_data.rb +1 -1
- data/rakelib/lib/director/searchctrl.rb +24 -0
- data/rakelib/lib/director/sizer.rb +2 -2
- data/rakelib/lib/director/styled_text_ctrl.rb +2 -0
- data/rakelib/lib/director/text_entry.rb +2 -2
- data/rakelib/lib/director/tree_ctrl.rb +6 -3
- data/rakelib/lib/director/uiaction_simulator.rb +20 -0
- data/rakelib/lib/director/variant.rb +1 -1
- data/rakelib/lib/director/vlistbox.rb +25 -0
- data/rakelib/lib/director/window.rb +0 -6
- data/rakelib/lib/director/with_images.rb +1 -1
- data/rakelib/lib/director/xml_node.rb +1 -1
- data/rakelib/lib/extractor/function.rb +5 -3
- data/rakelib/lib/generate/doc/about_dialog_info.yaml +46 -0
- data/rakelib/lib/generate/doc/accelerator.yaml +21 -0
- data/rakelib/lib/generate/doc/art_provider.yaml +35 -0
- data/rakelib/lib/generate/doc/bitmap.yaml +37 -0
- data/rakelib/lib/generate/doc/box_sizer.yaml +15 -0
- data/rakelib/lib/generate/doc/busy_info.yaml +74 -0
- data/rakelib/lib/generate/doc/client_dc.yaml +19 -0
- data/rakelib/lib/generate/doc/clipboard.yaml +43 -0
- data/rakelib/lib/generate/doc/collapsible_pane.yaml +21 -0
- data/rakelib/lib/generate/doc/colour_dialog.yaml +32 -0
- data/rakelib/lib/generate/doc/control.yaml +46 -0
- data/rakelib/lib/generate/doc/cursor.yaml +40 -0
- data/rakelib/lib/generate/doc/data_object.yaml +55 -0
- data/rakelib/lib/generate/doc/dc.yaml +14 -0
- data/rakelib/lib/generate/doc/dialog.yaml +36 -0
- data/rakelib/lib/generate/doc/dir_dialog.yaml +25 -0
- data/rakelib/lib/generate/doc/events.yaml +152 -0
- data/rakelib/lib/generate/doc/evt_handler.yaml +63 -0
- data/rakelib/lib/generate/doc.rb +76 -13
- data/rakelib/lib/generate/interface.rb +11 -0
- data/rakelib/lib/specs/interfaces.rb +5 -4
- data/rakelib/lib/swig_runner.rb +3 -3
- data/rakelib/lib/typemap/common.rb +15 -3
- data/rakelib/lib/util/string.rb +1 -0
- data/rakelib/yard/yard/relative_markdown_links.rb +5 -1
- data/samples/bigdemo/wxArtProvider.rbw +5 -4
- data/samples/controls/controls.rb +2 -2
- data/samples/controls/htlbox.rb +411 -0
- data/samples/controls/tn_htlbox.png +0 -0
- data/samples/drawing/graphics_drawing.rb +1 -2
- data/samples/drawing/{svgtest.rb → image_prt.rb} +49 -18
- data/samples/drawing/tn_image_prt.png +0 -0
- data/samples/propgrid/propgrid.rb +23 -21
- data/samples/ribbon/ribbon.rb +47 -46
- data/tests/lib/wxapp_runner.rb +3 -3
- data/tests/lib/wxframe_runner.rb +59 -0
- data/tests/test_app_event_filter.rb +74 -0
- data/tests/test_art_provider.rb +52 -0
- data/tests/test_clipboard.rb +2 -1
- data/tests/test_event_handling.rb +199 -16
- data/tests/test_events.rb +4 -11
- data/tests/test_gdi_object.rb +161 -0
- data/tests/test_intl.rb +11 -14
- data/tests/test_item_data.rb +33 -1
- data/tests/test_std_controls.rb +147 -0
- metadata +56 -4
- 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
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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
|
data/tests/test_item_data.rb
CHANGED
@@ -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.
|
4
|
+
version: 0.9.0.pre.rc.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Corino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -80,9 +80,13 @@ files:
|
|
80
80
|
- INSTALL.md
|
81
81
|
- LICENSE
|
82
82
|
- README.md
|
83
|
+
- assets/hello_button.png
|
84
|
+
- assets/hello_button_clicked.png
|
85
|
+
- assets/hello_world.png
|
83
86
|
- assets/logo.png
|
84
87
|
- assets/logo.svg
|
85
88
|
- assets/logo.xcf
|
89
|
+
- assets/repo-social-preview.png
|
86
90
|
- bin/wxruby
|
87
91
|
- ext/mkrf_conf_srcgem.rb
|
88
92
|
- ext/wxruby3/include/wxruby-ScaledDC.h
|
@@ -113,6 +117,7 @@ files:
|
|
113
117
|
- lib/wx/core/art_locator.rb
|
114
118
|
- lib/wx/core/artprovider.rb
|
115
119
|
- lib/wx/core/bitmap.rb
|
120
|
+
- lib/wx/core/bitmap_combobox.rb
|
116
121
|
- lib/wx/core/busycursor.rb
|
117
122
|
- lib/wx/core/choice.rb
|
118
123
|
- lib/wx/core/choicedlg.rb
|
@@ -129,8 +134,10 @@ files:
|
|
129
134
|
- lib/wx/core/dialog.rb
|
130
135
|
- lib/wx/core/enum.rb
|
131
136
|
- lib/wx/core/event.rb
|
137
|
+
- lib/wx/core/event_blocker.rb
|
132
138
|
- lib/wx/core/evthandler.rb
|
133
139
|
- lib/wx/core/ext.rb
|
140
|
+
- lib/wx/core/find_replace_dialog.rb
|
134
141
|
- lib/wx/core/font.rb
|
135
142
|
- lib/wx/core/functions.rb
|
136
143
|
- lib/wx/core/gauge.rb
|
@@ -152,6 +159,7 @@ files:
|
|
152
159
|
- lib/wx/core/menuitem.rb
|
153
160
|
- lib/wx/core/notebook.rb
|
154
161
|
- lib/wx/core/object.rb
|
162
|
+
- lib/wx/core/paintdc.rb
|
155
163
|
- lib/wx/core/pen_info.rb
|
156
164
|
- lib/wx/core/platform_info.rb
|
157
165
|
- lib/wx/core/point.rb
|
@@ -162,11 +170,13 @@ files:
|
|
162
170
|
- lib/wx/core/size.rb
|
163
171
|
- lib/wx/core/sizer.rb
|
164
172
|
- lib/wx/core/splash_screen.rb
|
173
|
+
- lib/wx/core/text_entry.rb
|
165
174
|
- lib/wx/core/textctrl.rb
|
166
175
|
- lib/wx/core/timer.rb
|
167
176
|
- lib/wx/core/toolbar.rb
|
168
177
|
- lib/wx/core/toolbartool.rb
|
169
178
|
- lib/wx/core/treectrl.rb
|
179
|
+
- lib/wx/core/v_list_box.rb
|
170
180
|
- lib/wx/core/validator.rb
|
171
181
|
- lib/wx/core/variant.rb
|
172
182
|
- lib/wx/core/vboxsizer.rb
|
@@ -178,15 +188,19 @@ files:
|
|
178
188
|
- lib/wx/doc/aui/auimanager.rb
|
179
189
|
- lib/wx/doc/aui/auinotebook.rb
|
180
190
|
- lib/wx/doc/bitmap.rb
|
191
|
+
- lib/wx/doc/busy_info.rb
|
192
|
+
- lib/wx/doc/client_dc.rb
|
181
193
|
- lib/wx/doc/clipboard.rb
|
182
194
|
- lib/wx/doc/colour_dialog.rb
|
183
195
|
- lib/wx/doc/const.rb
|
196
|
+
- lib/wx/doc/controlwithitems.rb
|
184
197
|
- lib/wx/doc/core.rb
|
185
198
|
- lib/wx/doc/cursor.rb
|
186
199
|
- lib/wx/doc/data_object.rb
|
187
200
|
- lib/wx/doc/dc.rb
|
188
201
|
- lib/wx/doc/enum.rb
|
189
202
|
- lib/wx/doc/event.rb
|
203
|
+
- lib/wx/doc/event_blocker.rb
|
190
204
|
- lib/wx/doc/events.rb
|
191
205
|
- lib/wx/doc/evthandler.rb
|
192
206
|
- lib/wx/doc/extra/00_starting.md
|
@@ -200,6 +214,7 @@ files:
|
|
200
214
|
- lib/wx/doc/extra/08_extensions.md
|
201
215
|
- lib/wx/doc/extra/09_exceptions.md
|
202
216
|
- lib/wx/doc/extra/10_art.md
|
217
|
+
- lib/wx/doc/extra/11_drawing_and_dc.md
|
203
218
|
- lib/wx/doc/functions.rb
|
204
219
|
- lib/wx/doc/gc_dc.rb
|
205
220
|
- lib/wx/doc/gdi_common.rb
|
@@ -210,6 +225,8 @@ files:
|
|
210
225
|
- lib/wx/doc/icon.rb
|
211
226
|
- lib/wx/doc/id_helper.rb
|
212
227
|
- lib/wx/doc/image.rb
|
228
|
+
- lib/wx/doc/memory_dc.rb
|
229
|
+
- lib/wx/doc/mirror_dc.rb
|
213
230
|
- lib/wx/doc/pg/events.rb
|
214
231
|
- lib/wx/doc/pg/pg_property.rb
|
215
232
|
- lib/wx/doc/pg/pgeditor.rb
|
@@ -220,6 +237,7 @@ files:
|
|
220
237
|
- lib/wx/doc/prt/print_data.rb
|
221
238
|
- lib/wx/doc/prt/print_dialog.rb
|
222
239
|
- lib/wx/doc/prt/printer.rb
|
240
|
+
- lib/wx/doc/prt/printer_dc.rb
|
223
241
|
- lib/wx/doc/rbn/ribbon_bar.rb
|
224
242
|
- lib/wx/doc/rbn/ribbon_button_bar.rb
|
225
243
|
- lib/wx/doc/rbn/ribbon_gallery.rb
|
@@ -230,10 +248,13 @@ files:
|
|
230
248
|
- lib/wx/doc/screen_dc.rb
|
231
249
|
- lib/wx/doc/stock_objects.rb
|
232
250
|
- lib/wx/doc/stream.rb
|
251
|
+
- lib/wx/doc/svg_file_dc.rb
|
233
252
|
- lib/wx/doc/system_settings.rb
|
234
253
|
- lib/wx/doc/treebook.rb
|
254
|
+
- lib/wx/doc/v_list_box.rb
|
235
255
|
- lib/wx/doc/variant.rb
|
236
256
|
- lib/wx/doc/window.rb
|
257
|
+
- lib/wx/doc/window_disabler.rb
|
237
258
|
- lib/wx/doc/xml_resource.rb
|
238
259
|
- lib/wx/global_const.rb
|
239
260
|
- lib/wx/grid.rb
|
@@ -246,6 +267,7 @@ files:
|
|
246
267
|
- lib/wx/html/htmlwindow.rb
|
247
268
|
- lib/wx/html/keyword_defs.rb
|
248
269
|
- lib/wx/html/require.rb
|
270
|
+
- lib/wx/html/simple_html_listbox.rb
|
249
271
|
- lib/wx/keyword_ctors.rb
|
250
272
|
- lib/wx/keyword_defs.rb
|
251
273
|
- lib/wx/pg.rb
|
@@ -333,6 +355,7 @@ files:
|
|
333
355
|
- rakelib/lib/director/aui_toolbar_event.rb
|
334
356
|
- rakelib/lib/director/aui_toolbar_item.rb
|
335
357
|
- rakelib/lib/director/bitmap.rb
|
358
|
+
- rakelib/lib/director/bitmap_combobox.rb
|
336
359
|
- rakelib/lib/director/book_ctrls.rb
|
337
360
|
- rakelib/lib/director/brush.rb
|
338
361
|
- rakelib/lib/director/busy_info.rb
|
@@ -366,6 +389,8 @@ files:
|
|
366
389
|
- rakelib/lib/director/dragdrop.rb
|
367
390
|
- rakelib/lib/director/editable_listbox.rb
|
368
391
|
- rakelib/lib/director/event.rb
|
392
|
+
- rakelib/lib/director/event_blocker.rb
|
393
|
+
- rakelib/lib/director/event_filter.rb
|
369
394
|
- rakelib/lib/director/event_handler.rb
|
370
395
|
- rakelib/lib/director/events.rb
|
371
396
|
- rakelib/lib/director/file_picker_ctrl.rb
|
@@ -467,6 +492,7 @@ files:
|
|
467
492
|
- rakelib/lib/director/sash_window.rb
|
468
493
|
- rakelib/lib/director/scroll_bar.rb
|
469
494
|
- rakelib/lib/director/scrolled_t.rb
|
495
|
+
- rakelib/lib/director/searchctrl.rb
|
470
496
|
- rakelib/lib/director/sizer.rb
|
471
497
|
- rakelib/lib/director/sizer_item.rb
|
472
498
|
- rakelib/lib/director/slider.rb
|
@@ -494,6 +520,7 @@ files:
|
|
494
520
|
- rakelib/lib/director/top_level_window.rb
|
495
521
|
- rakelib/lib/director/tree_ctrl.rb
|
496
522
|
- rakelib/lib/director/tree_event.rb
|
523
|
+
- rakelib/lib/director/uiaction_simulator.rb
|
497
524
|
- rakelib/lib/director/utils.rb
|
498
525
|
- rakelib/lib/director/validator.rb
|
499
526
|
- rakelib/lib/director/variant.rb
|
@@ -515,6 +542,24 @@ files:
|
|
515
542
|
- rakelib/lib/generate/analyzer.rb
|
516
543
|
- rakelib/lib/generate/base.rb
|
517
544
|
- rakelib/lib/generate/doc.rb
|
545
|
+
- rakelib/lib/generate/doc/about_dialog_info.yaml
|
546
|
+
- rakelib/lib/generate/doc/accelerator.yaml
|
547
|
+
- rakelib/lib/generate/doc/art_provider.yaml
|
548
|
+
- rakelib/lib/generate/doc/bitmap.yaml
|
549
|
+
- rakelib/lib/generate/doc/box_sizer.yaml
|
550
|
+
- rakelib/lib/generate/doc/busy_info.yaml
|
551
|
+
- rakelib/lib/generate/doc/client_dc.yaml
|
552
|
+
- rakelib/lib/generate/doc/clipboard.yaml
|
553
|
+
- rakelib/lib/generate/doc/collapsible_pane.yaml
|
554
|
+
- rakelib/lib/generate/doc/colour_dialog.yaml
|
555
|
+
- rakelib/lib/generate/doc/control.yaml
|
556
|
+
- rakelib/lib/generate/doc/cursor.yaml
|
557
|
+
- rakelib/lib/generate/doc/data_object.yaml
|
558
|
+
- rakelib/lib/generate/doc/dc.yaml
|
559
|
+
- rakelib/lib/generate/doc/dialog.yaml
|
560
|
+
- rakelib/lib/generate/doc/dir_dialog.yaml
|
561
|
+
- rakelib/lib/generate/doc/events.yaml
|
562
|
+
- rakelib/lib/generate/doc/evt_handler.yaml
|
518
563
|
- rakelib/lib/generate/interface.rb
|
519
564
|
- rakelib/lib/generate/rakedep.rb
|
520
565
|
- rakelib/lib/specs/interfaces.rb
|
@@ -676,6 +721,7 @@ files:
|
|
676
721
|
- samples/controls/controls.rb
|
677
722
|
- samples/controls/gauge.xpm
|
678
723
|
- samples/controls/get_item_sample.rb
|
724
|
+
- samples/controls/htlbox.rb
|
679
725
|
- samples/controls/list.xpm
|
680
726
|
- samples/controls/mondrian.ico
|
681
727
|
- samples/controls/mondrian.xpm
|
@@ -686,6 +732,7 @@ files:
|
|
686
732
|
- samples/controls/tn_books.png
|
687
733
|
- samples/controls/tn_controls.png
|
688
734
|
- samples/controls/tn_get_item_sample.png
|
735
|
+
- samples/controls/tn_htlbox.png
|
689
736
|
- samples/dialogs/dialogs.rb
|
690
737
|
- samples/dialogs/tips.txt
|
691
738
|
- samples/dialogs/tn_dialogs.png
|
@@ -697,16 +744,16 @@ files:
|
|
697
744
|
- samples/drawing/bitmap.rb
|
698
745
|
- samples/drawing/bitmap_image.rb
|
699
746
|
- samples/drawing/graphics_drawing.rb
|
747
|
+
- samples/drawing/image_prt.rb
|
700
748
|
- samples/drawing/maths_images.rb
|
701
749
|
- samples/drawing/rmagic_bitmap_image.rb
|
702
750
|
- samples/drawing/ruby-logo.jpg
|
703
|
-
- samples/drawing/svgtest.rb
|
704
751
|
- samples/drawing/tn_bitmap.png
|
705
752
|
- samples/drawing/tn_bitmap_image.png
|
706
753
|
- samples/drawing/tn_graphics_drawing.png
|
754
|
+
- samples/drawing/tn_image_prt.png
|
707
755
|
- samples/drawing/tn_maths_images.png
|
708
756
|
- samples/drawing/tn_rmagic_bitmap_image.png
|
709
|
-
- samples/drawing/tn_svgtest.png
|
710
757
|
- samples/etc/choice.rb
|
711
758
|
- samples/etc/miniframe.rb
|
712
759
|
- samples/etc/sash.rb
|
@@ -866,16 +913,21 @@ files:
|
|
866
913
|
- tests/art/test_art/image/wxruby.png
|
867
914
|
- tests/art/test_art/sample2.xpm
|
868
915
|
- tests/lib/wxapp_runner.rb
|
916
|
+
- tests/lib/wxframe_runner.rb
|
917
|
+
- tests/test_app_event_filter.rb
|
869
918
|
- tests/test_art.rb
|
919
|
+
- tests/test_art_provider.rb
|
870
920
|
- tests/test_basic.rb
|
871
921
|
- tests/test_clipboard.rb
|
872
922
|
- tests/test_dc.rb
|
873
923
|
- tests/test_dialog.rb
|
874
924
|
- tests/test_event_handling.rb
|
875
925
|
- tests/test_events.rb
|
926
|
+
- tests/test_gdi_object.rb
|
876
927
|
- tests/test_geometry.rb
|
877
928
|
- tests/test_intl.rb
|
878
929
|
- tests/test_item_data.rb
|
930
|
+
- tests/test_std_controls.rb
|
879
931
|
- tests/test_variant.rb
|
880
932
|
- tests/testapp.rb
|
881
933
|
- tests/testapp_noframe.rb
|
Binary file
|