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.
- 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/wxbase32u_gcc_custom.dll +0 -0
- data/ext/wxbase32u_net_gcc_custom.dll +0 -0
- data/ext/wxbase32u_xml_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_aui_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_core_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_gl_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_html_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_media_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_propgrid_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_qa_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_ribbon_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_richtext_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_stc_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_webview_gcc_custom.dll +0 -0
- data/ext/wxmsw32u_xrc_gcc_custom.dll +0 -0
- 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/events/evt_list.rb +12 -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/gen/about_dialog_info.rb +27 -24
- data/lib/wx/doc/gen/accelerator.rb +11 -12
- data/lib/wx/doc/gen/app.rb +6 -3
- data/lib/wx/doc/gen/art_provider.rb +53 -29
- data/lib/wx/doc/gen/aui/aui_manager.rb +4 -0
- data/lib/wx/doc/gen/aui/aui_mdi_child_frame.rb +1 -1
- data/lib/wx/doc/gen/aui/aui_pane_info.rb +2 -0
- data/lib/wx/doc/gen/aui/aui_tab_ctrl.rb +2 -0
- data/lib/wx/doc/gen/bitmap.rb +25 -25
- data/lib/wx/doc/gen/bitmap_combo_box.rb +157 -0
- data/lib/wx/doc/gen/box_sizer.rb +6 -8
- data/lib/wx/doc/gen/brush.rb +2 -0
- data/lib/wx/doc/gen/busy_info.rb +52 -46
- data/lib/wx/doc/gen/caret.rb +0 -4
- data/lib/wx/doc/gen/check_list_box.rb +0 -2
- data/lib/wx/doc/gen/choice.rb +1 -5
- data/lib/wx/doc/gen/client_dc.rb +13 -18
- data/lib/wx/doc/gen/clipboard.rb +30 -27
- data/lib/wx/doc/gen/collapsible_pane.rb +11 -9
- data/lib/wx/doc/gen/colour.rb +6 -3
- data/lib/wx/doc/gen/colour_dialog.rb +111 -23
- data/lib/wx/doc/gen/combo_box.rb +2 -4
- data/lib/wx/doc/gen/control.rb +20 -18
- data/lib/wx/doc/gen/core.rb +2 -2
- data/lib/wx/doc/gen/cursor.rb +18 -50
- data/lib/wx/doc/gen/data_format.rb +0 -2
- data/lib/wx/doc/gen/data_object.rb +37 -44
- data/lib/wx/doc/gen/dc.rb +16 -24
- data/lib/wx/doc/gen/defs.rb +3 -40
- data/lib/wx/doc/gen/dialog.rb +21 -17
- data/lib/wx/doc/gen/dir_dialog.rb +10 -8
- data/lib/wx/doc/gen/event.rb +2 -2
- data/lib/wx/doc/gen/event_blocker.rb +49 -0
- data/lib/wx/doc/gen/event_filter.rb +95 -0
- data/lib/wx/doc/gen/event_list.rb +16 -2
- data/lib/wx/doc/gen/events.rb +103 -112
- data/lib/wx/doc/gen/evt_handler.rb +28 -52
- data/lib/wx/doc/gen/file_dialog.rb +8 -4
- data/lib/wx/doc/gen/find_replace_dialog.rb +1 -1
- data/lib/wx/doc/gen/font.rb +10 -2
- data/lib/wx/doc/gen/font_data.rb +2 -0
- data/lib/wx/doc/gen/font_dialog.rb +1 -1
- data/lib/wx/doc/gen/frame.rb +4 -3
- data/lib/wx/doc/gen/fs_file.rb +8 -0
- data/lib/wx/doc/gen/gcdc.rb +2 -22
- data/lib/wx/doc/gen/gdi_common.rb +18 -2
- data/lib/wx/doc/gen/gdi_object.rb +2 -0
- data/lib/wx/doc/gen/graphics_context.rb +4 -43
- data/lib/wx/doc/gen/graphics_object.rb +2 -0
- data/lib/wx/doc/gen/grid/grid_cell_attr.rb +2 -1
- data/lib/wx/doc/gen/grid/grid_ctrl.rb +4 -2
- data/lib/wx/doc/gen/grid/grid_table_message.rb +2 -0
- data/lib/wx/doc/gen/grid_bag_sizer.rb +4 -0
- data/lib/wx/doc/gen/help_controller.rb +4 -1
- data/lib/wx/doc/gen/html/html_cell.rb +4 -1
- data/lib/wx/doc/gen/html/html_help_controller.rb +4 -1
- data/lib/wx/doc/gen/html/html_help_data.rb +4 -0
- data/lib/wx/doc/gen/html/html_help_window.rb +2 -1
- data/lib/wx/doc/gen/html/html_list_box.rb +138 -11
- data/lib/wx/doc/gen/html/html_window.rb +9 -3
- data/lib/wx/doc/gen/icon.rb +7 -1
- data/lib/wx/doc/gen/icon_location.rb +2 -0
- data/lib/wx/doc/gen/image.rb +15 -8
- data/lib/wx/doc/gen/keyboard_state.rb +6 -0
- data/lib/wx/doc/gen/list_box.rb +0 -11
- data/lib/wx/doc/gen/list_ctrl.rb +10 -13
- data/lib/wx/doc/gen/locale.rb +7 -3
- data/lib/wx/doc/gen/log.rb +6 -2
- data/lib/wx/doc/gen/mdi_frame.rb +2 -0
- data/lib/wx/doc/gen/media_ctrl.rb +2 -0
- data/lib/wx/doc/gen/memory_dc.rb +105 -18
- data/lib/wx/doc/gen/menu.rb +4 -2
- data/lib/wx/doc/gen/menu_bar.rb +0 -2
- data/lib/wx/doc/gen/menu_item.rb +9 -3
- data/lib/wx/doc/gen/message_dialog.rb +6 -3
- data/lib/wx/doc/gen/mirror_dc.rb +2 -8
- data/lib/wx/doc/gen/mouse_state.rb +2 -0
- data/lib/wx/doc/gen/multi_choice_dialog.rb +0 -2
- data/lib/wx/doc/gen/non_owned_window.rb +2 -1
- data/lib/wx/doc/gen/notebook.rb +4 -2
- data/lib/wx/doc/gen/paint_dc.rb +2 -6
- data/lib/wx/doc/gen/palette.rb +3 -3
- data/lib/wx/doc/gen/pen.rb +6 -1
- data/lib/wx/doc/gen/pg/pg_editor.rb +2 -1
- data/lib/wx/doc/gen/pg/pg_multi_button.rb +4 -0
- data/lib/wx/doc/gen/pg/pg_properties.rb +30 -3
- data/lib/wx/doc/gen/pg/pg_property.rb +30 -4
- data/lib/wx/doc/gen/pg/pg_validation_info.rb +2 -0
- data/lib/wx/doc/gen/pg/property_grid.rb +5 -2
- data/lib/wx/doc/gen/pg/property_grid_interface.rb +6 -2
- data/lib/wx/doc/gen/pg/property_grid_manager.rb +2 -0
- data/lib/wx/doc/gen/pg/property_grid_page_state.rb +2 -0
- data/lib/wx/doc/gen/picker_base.rb +2 -1
- data/lib/wx/doc/gen/platform_info.rb +4 -1
- data/lib/wx/doc/gen/property_sheet_dialog.rb +2 -0
- data/lib/wx/doc/gen/prt/post_script_dc.rb +2 -8
- data/lib/wx/doc/gen/prt/print_data.rb +6 -0
- data/lib/wx/doc/gen/prt/printer.rb +0 -3
- data/lib/wx/doc/gen/prt/printer_dc.rb +2 -6
- data/lib/wx/doc/gen/radio_box.rb +2 -2
- data/lib/wx/doc/gen/rbn/ribbon_art_provider.rb +6 -0
- data/lib/wx/doc/gen/rbn/ribbon_panel.rb +1 -1
- data/lib/wx/doc/gen/region.rb +2 -0
- data/lib/wx/doc/gen/rtc/rich_text_buffer.rb +6 -0
- data/lib/wx/doc/gen/rtc/rich_text_ctrl.rb +0 -4
- data/lib/wx/doc/gen/rtc/rich_text_header_footer_data.rb +2 -0
- data/lib/wx/doc/gen/rtc/rich_text_html_handler.rb +2 -1
- data/lib/wx/doc/gen/rtc/symbol_picker_dialog.rb +2 -0
- data/lib/wx/doc/gen/screen_dc.rb +2 -0
- data/lib/wx/doc/gen/scroll_bar.rb +2 -1
- data/lib/wx/doc/gen/scrolled_canvas.rb +4 -8
- data/lib/wx/doc/gen/scrolled_control.rb +4 -8
- data/lib/wx/doc/gen/scrolled_window.rb +4 -8
- data/lib/wx/doc/gen/search_ctrl.rb +131 -0
- data/lib/wx/doc/gen/single_choice_dialog.rb +0 -2
- data/lib/wx/doc/gen/sizer.rb +14 -3
- data/lib/wx/doc/gen/splash_screen.rb +2 -0
- data/lib/wx/doc/gen/static_box.rb +6 -3
- data/lib/wx/doc/gen/static_box_sizer.rb +2 -1
- data/lib/wx/doc/gen/status_bar.rb +0 -5
- data/lib/wx/doc/gen/stc/styled_text_ctrl.rb +4 -5
- data/lib/wx/doc/gen/svg_file_dc.rb +10 -11
- data/lib/wx/doc/gen/text_ctrl.rb +10 -3
- data/lib/wx/doc/gen/text_entry.rb +8 -3
- data/lib/wx/doc/gen/text_entry_dialog.rb +4 -2
- data/lib/wx/doc/gen/timer_event.rb +2 -0
- data/lib/wx/doc/gen/tool_bar.rb +8 -4
- data/lib/wx/doc/gen/top_level_window.rb +5 -2
- data/lib/wx/doc/gen/tree_ctrl.rb +0 -6
- data/lib/wx/doc/gen/ui_action_simulator.rb +100 -0
- data/lib/wx/doc/gen/utils.rb +1 -1
- data/lib/wx/doc/gen/v_list_box.rb +36 -26
- data/lib/wx/doc/gen/validator.rb +2 -1
- data/lib/wx/doc/gen/variant.rb +10 -0
- data/lib/wx/doc/gen/window.rb +38 -17
- data/lib/wx/doc/gen/window_dc.rb +2 -0
- data/lib/wx/doc/gen/window_disabler.rb +2 -0
- data/lib/wx/doc/gen/wizard_page_simple.rb +2 -0
- data/lib/wx/doc/gen/xml_node.rb +6 -0
- data/lib/wx/doc/gen/xml_resource.rb +4 -1
- 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/lib/wxruby_aui.so +0 -0
- data/lib/wxruby_core.so +0 -0
- data/lib/wxruby_grid.so +0 -0
- data/lib/wxruby_html.so +0 -0
- data/lib/wxruby_pg.so +0 -0
- data/lib/wxruby_prt.so +0 -0
- data/lib/wxruby_rbn.so +0 -0
- data/lib/wxruby_rtc.so +0 -0
- data/lib/wxruby_stc.so +0 -0
- data/rakelib/install.rb +3 -1
- 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 +38 -8
- data/lib/wx/doc/gen/auto_buffered_paint_dc.rb +0 -47
- data/lib/wx/doc/gen/buffered_dc.rb +0 -95
- data/lib/wx/doc/gen/buffered_paint_dc.rb +0 -55
- data/lib/wx/doc/gen/colour_data.rb +0 -96
- data/samples/drawing/tn_svgtest.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b0789682f3f41499d529e24441bcff8b0ec200db6b1a84cbac198e445f73f33
|
4
|
+
data.tar.gz: f48166b2c460c774916a7d2b177b73bdc353c0c7f3f35c760de3d6aa9a66dd57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f817d5543dcf138ff6c21b161beff6e8e93677db8922d37da6bcebb4a2940a44400c16b9800ee44ccce4b574eecd1eb2c0db909ab464bcbfb0a0cb89870063c
|
7
|
+
data.tar.gz: 113af98388e9253f223fb5176f9722a61b7485f7a4a56dd79080a6eb55aafc3c6929522977d95e0564e7761e4655c8fdc3dde22796a108f8c5ba853329ca4ee0
|
data/.yardopts
CHANGED
data/README.md
CHANGED
@@ -13,12 +13,53 @@ Reviving wxRuby
|
|
13
13
|
|
14
14
|
## Introduction
|
15
15
|
|
16
|
-
wxRuby3 is a cross-platform GUI library for Ruby, based on the [wxWidgets](https://wxwidgets.org)
|
16
|
+
wxRuby3 is a cross-platform GUI library for Ruby, based on the mature [wxWidgets](https://wxwidgets.org)
|
17
17
|
GUI toolkit for C++. It uses native widgets wherever possible, providing
|
18
18
|
the correct look, feel and behaviour to GUI applications on Windows, OS
|
19
19
|
X and Linux/GTK. wxRuby aims to provide a comprehensive solution to
|
20
20
|
developing professional-standard desktop applications in Ruby.
|
21
21
|
|
22
|
+
## Usage examples
|
23
|
+
|
24
|
+
### Hello world
|
25
|
+
|
26
|
+
wxRuby3 is very easy to use.
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
require 'wx'
|
30
|
+
|
31
|
+
Wx::App.run do
|
32
|
+
Wx::Frame.new(nil, title: 'Hello world!').show
|
33
|
+
end
|
34
|
+
```
|
35
|
+
|
36
|
+
![Hello_World](assets/hello_world.png "Hello World sample")
|
37
|
+
|
38
|
+
### Hello Button
|
39
|
+
|
40
|
+
Anyone who is familiar with wxWidgets should feel right at home since the API may be Ruby-fied, it is still easily
|
41
|
+
recognizable (but being Ruby-fied allowing for elegant and compact coding). And for those that do not have previous
|
42
|
+
experience do not fear, wxRuby3 comes with detailed [documentation](https://mcorino.github.io/wxRuby3/file.00_starting.html) and lots of examples and test.
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
require 'wx'
|
46
|
+
|
47
|
+
class TheFrame < Wx::Frame
|
48
|
+
def initialize(title)
|
49
|
+
super(nil, title: title)
|
50
|
+
panel = Wx::Panel.new(self)
|
51
|
+
button = Wx::Button.new(panel, label: 'Click me')
|
52
|
+
button.evt_button(Wx::ID_ANY) { Wx.message_box('Hello. Thanks for clicking me!', 'Hello Button sample') }
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
Wx::App.run { TheFrame.new('Hello world!').show }
|
57
|
+
```
|
58
|
+
|
59
|
+
![Hello_Button](assets/hello_button.png "Hello Button sample")
|
60
|
+
![Hello_Button_Clicked](assets/hello_button_clicked.png "Hello Button sample clicked")
|
61
|
+
|
62
|
+
|
22
63
|
## wxRuby3 licence
|
23
64
|
|
24
65
|
wxRuby3 is free and open-source. It is distributed under the liberal
|
@@ -54,8 +95,10 @@ of these products.
|
|
54
95
|
|
55
96
|
Currently the following are fully supported:
|
56
97
|
|
57
|
-
|
58
|
-
|
98
|
+
| Platform | Ruby version(s) | wxWidgets version(s) |
|
99
|
+
|----------------------------------------------------------------------------|-----------------| --- |
|
100
|
+
| Windows 10 (tested)<br>(most likely also Windows 11) | Ruby >= 2.5<br>(RubyInstaller MSYS2-DevKit) | wxWidgets >= 3.2 |
|
101
|
+
| Linux (tested; any AMD-64 distribution)<br>(most likely also i686 and ARM) | Ruby >= 2.5 | wxWidgets >= 3.2 |
|
59
102
|
|
60
103
|
Support for other platforms is not being actively developed at present,
|
61
104
|
but patches are welcome. It is likely to be much simpler to get wxRuby
|
@@ -109,7 +152,7 @@ which may be relevant.
|
|
109
152
|
|
110
153
|
### What wxWidgets features are supported by wxRuby3?
|
111
154
|
|
112
|
-
wxRuby supports almost all of the wxWidgets 3.
|
155
|
+
wxRuby supports almost all of the wxWidgets 3.2+ GUI API, providing over
|
113
156
|
600 classes in total. wxWidgets classes that provide general and/or non-GUI
|
114
157
|
programming support features, such as strings, networking, threading, database
|
115
158
|
access and such are not and will never be ported, as it's assumed that
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/wx/core/art_locator.rb
CHANGED
@@ -54,7 +54,7 @@ module Wx
|
|
54
54
|
private :search_paths
|
55
55
|
|
56
56
|
def add_search_path(*paths)
|
57
|
-
paths.flatten.each { |p|
|
57
|
+
paths.flatten.each { |p| search_paths << p.to_s unless search_paths.include?(p.to_s) }
|
58
58
|
end
|
59
59
|
alias :add_search_paths :add_search_path
|
60
60
|
|
@@ -74,7 +74,7 @@ module Wx
|
|
74
74
|
|
75
75
|
def find_art(art_name, art_type: nil, art_path: nil, art_section: nil, bmp_type: nil)
|
76
76
|
unless art_path
|
77
|
-
caller_path = caller_locations(1).first.absolute_path
|
77
|
+
caller_path = caller_locations(1).first.absolute_path || caller_locations(1).first.path
|
78
78
|
art_path = File.dirname(caller_path)
|
79
79
|
art_section ||= File.basename(caller_path, '.*')
|
80
80
|
end
|
data/lib/wx/core/artprovider.rb
CHANGED
@@ -7,7 +7,7 @@ class Wx::ArtProvider
|
|
7
7
|
wx_push_back = instance_method(:push_back)
|
8
8
|
define_method(:push_back) do | art_prov |
|
9
9
|
wx_push_back.bind(self).call(art_prov)
|
10
|
-
@__art_provs.
|
10
|
+
@__art_provs.push(art_prov)
|
11
11
|
end
|
12
12
|
|
13
13
|
wx_pop = instance_method(:pop)
|
@@ -19,7 +19,7 @@ class Wx::ArtProvider
|
|
19
19
|
wx_push = instance_method(:push)
|
20
20
|
define_method(:push) do | art_prov |
|
21
21
|
wx_push.bind(self).call(art_prov)
|
22
|
-
@__art_provs.
|
22
|
+
@__art_provs.unshift(art_prov)
|
23
23
|
end
|
24
24
|
|
25
25
|
wx_delete = instance_method(:delete)
|
data/lib/wx/core/bitmap.rb
CHANGED
@@ -86,15 +86,16 @@ module Wx
|
|
86
86
|
# Accepts a block, which will be passed a device context which can be
|
87
87
|
# used to draw upon the Bitmap
|
88
88
|
def draw
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
89
|
+
return unless block_given?
|
90
|
+
Wx::MemoryDC.draw_on(self) do |dc|
|
91
|
+
dc.select_object(self)
|
92
|
+
yield dc
|
93
|
+
end
|
93
94
|
end
|
94
95
|
end
|
95
96
|
|
96
97
|
def self.Bitmap(name, bmp_type = nil)
|
97
|
-
art_path = File.dirname(caller_path = caller_locations(1).first.absolute_path)
|
98
|
+
art_path = File.dirname(caller_path = caller_locations(1).first.absolute_path || caller_locations(1).first.path)
|
98
99
|
art_owner = File.basename(caller_path, '.*')
|
99
100
|
art_file = ArtLocator.find_art(name, art_type: :bitmap, art_path: art_path, art_section: art_owner, bmp_type: bmp_type)
|
100
101
|
::Kernel.raise ArgumentError, "Cannot locate art file for #{name}:Bitmap" unless art_file
|
@@ -0,0 +1,34 @@
|
|
1
|
+
|
2
|
+
module Wx
|
3
|
+
|
4
|
+
class BitmapCombobox < Wx::ComboBox
|
5
|
+
|
6
|
+
# We need to cache client data in Ruby variables as we cannot access items
|
7
|
+
# during the GC mark phase as for some platforms (WXMSW at least) that would
|
8
|
+
# involve calling methods that would break in that phase.
|
9
|
+
|
10
|
+
wx_append = instance_method :append
|
11
|
+
define_method :append do |item, bitmap=Wx::NULL_BITMAP, data=nil|
|
12
|
+
itm_pos = if data
|
13
|
+
wx_append.bind(self).call(item, bitmap, data)
|
14
|
+
else
|
15
|
+
wx_append.bind(self).call(item, bitmap)
|
16
|
+
end
|
17
|
+
client_data_store.insert(itm_pos, data)
|
18
|
+
itm_pos
|
19
|
+
end
|
20
|
+
|
21
|
+
wx_insert = instance_method :insert
|
22
|
+
define_method :insert do |item, bitmap, pos, data=nil|
|
23
|
+
itm_pos = if data
|
24
|
+
wx_insert.bind(self).call(item, bitmap, pos, data)
|
25
|
+
else
|
26
|
+
wx_insert.bind(self).call(item, bitmap, pos)
|
27
|
+
end
|
28
|
+
client_data_store.insert(itm_pos, data)
|
29
|
+
itm_pos
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -32,6 +32,7 @@ class Wx::ControlWithItems
|
|
32
32
|
|
33
33
|
wx_append = instance_method :append
|
34
34
|
define_method :append do |item, data=nil|
|
35
|
+
itm_pos = -1
|
35
36
|
if data
|
36
37
|
if ::Array === item
|
37
38
|
if !(::Array === data)
|
@@ -39,21 +40,42 @@ class Wx::ControlWithItems
|
|
39
40
|
elsif data.size != item.size
|
40
41
|
::Kernel.raise ::ArgumentError.new("item and data array must be equal size")
|
41
42
|
end
|
42
|
-
|
43
|
-
|
44
|
-
|
43
|
+
if sorted?
|
44
|
+
item.each_with_index do |itm, ix|
|
45
|
+
itm_pos = wx_append.bind(self).call(itm, data[ix])
|
46
|
+
client_data_store.insert(itm_pos, data[ix])
|
47
|
+
end
|
48
|
+
else
|
49
|
+
offs = get_count
|
50
|
+
itm_pos = wx_append.bind(self).call(item)
|
51
|
+
item.size.times { |ix| set_client_data(offs+ix, data[ix]) }
|
52
|
+
end
|
45
53
|
else
|
46
|
-
wx_append.bind(self).call(item, data)
|
47
|
-
client_data_store
|
54
|
+
itm_pos = wx_append.bind(self).call(item, data)
|
55
|
+
client_data_store.insert(itm_pos, data)
|
48
56
|
end
|
49
57
|
else
|
50
|
-
|
51
|
-
|
58
|
+
if ::Array === item
|
59
|
+
if sorted?
|
60
|
+
item.each_with_index do |itm, ix|
|
61
|
+
itm_pos = wx_append.bind(self).call(itm, data[ix])
|
62
|
+
client_data_store.insert(itm_pos, nil)
|
63
|
+
end
|
64
|
+
else
|
65
|
+
itm_pos = wx_append.bind(self).call(item)
|
66
|
+
client_data_store.concat(::Array.new(item.size))
|
67
|
+
end
|
68
|
+
else
|
69
|
+
itm_pos = wx_append.bind(self).call(item)
|
70
|
+
client_data_store.insert(itm_pos, nil)
|
71
|
+
end
|
52
72
|
end
|
73
|
+
itm_pos
|
53
74
|
end
|
54
75
|
|
55
76
|
wx_insert = instance_method :insert
|
56
77
|
define_method :insert do |item, pos, data=nil|
|
78
|
+
itm_pos = -1
|
57
79
|
if data
|
58
80
|
if ::Array === item
|
59
81
|
if !(::Array === data)
|
@@ -61,21 +83,37 @@ class Wx::ControlWithItems
|
|
61
83
|
elsif data.size != item.size
|
62
84
|
::Kernel.raise ::ArgumentError.new("item and data array must be equal size")
|
63
85
|
end
|
64
|
-
|
65
|
-
|
66
|
-
|
86
|
+
if sorted?
|
87
|
+
item.each_with_index do |itm, ix|
|
88
|
+
itm_pos = wx_insert.bind(self).call(itm, data[ix])
|
89
|
+
client_data_store.insert(itm_pos, data[ix])
|
90
|
+
end
|
91
|
+
else
|
92
|
+
itm_pos = wx_insert.bind(self).call(item, pos)
|
93
|
+
client_data_store.insert(pos, *::Array.new(item.size))
|
94
|
+
item.size.times { |ix| set_client_data(pos+ix, data[ix]) }
|
95
|
+
end
|
67
96
|
else
|
68
|
-
wx_insert.bind(self).call(item, pos, data)
|
69
|
-
client_data_store.insert(
|
97
|
+
itm_pos = wx_insert.bind(self).call(item, pos, data)
|
98
|
+
client_data_store.insert(itm_pos, data)
|
70
99
|
end
|
71
100
|
else
|
72
|
-
wx_insert.bind(self).call(item, pos)
|
73
101
|
if ::Array === item
|
74
|
-
|
102
|
+
if sorted?
|
103
|
+
item.each_with_index do |itm, ix|
|
104
|
+
itm_pos = wx_insert.bind(self).call(itm)
|
105
|
+
client_data_store.insert(itm_pos, nil)
|
106
|
+
end
|
107
|
+
else
|
108
|
+
itm_pos = wx_insert.bind(self).call(item, pos)
|
109
|
+
client_data_store.insert(pos, *::Array.new(item.size))
|
110
|
+
end
|
75
111
|
else
|
112
|
+
itm_pos = wx_insert.bind(self).call(item, pos)
|
76
113
|
client_data_store.insert(pos, nil)
|
77
114
|
end
|
78
115
|
end
|
116
|
+
itm_pos
|
79
117
|
end
|
80
118
|
|
81
119
|
wx_set = instance_method :set
|
data/lib/wx/core/cursor.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
module Wx
|
3
3
|
|
4
4
|
def self.Cursor(name, bmp_type = nil, *rest)
|
5
|
-
art_path = File.dirname(caller_path = caller_locations(1).first.absolute_path)
|
5
|
+
art_path = File.dirname(caller_path = caller_locations(1).first.absolute_path || caller_locations(1).first.path)
|
6
6
|
art_owner = File.basename(caller_path, '.*')
|
7
7
|
art_file = ArtLocator.find_art(name, art_type: :icon, art_path: art_path, art_section: art_owner, bmp_type: bmp_type)
|
8
8
|
::Kernel.raise ArgumentError, "Cannot locate art file for #{name}:Cursor" unless art_file
|
data/lib/wx/core/dc.rb
CHANGED
@@ -69,24 +69,4 @@ module Wx
|
|
69
69
|
|
70
70
|
end
|
71
71
|
|
72
|
-
class MemoryDC
|
73
|
-
|
74
|
-
# convenience method for drawing on a temporary memory DC
|
75
|
-
def self.draw_on(arg)
|
76
|
-
dc = case arg
|
77
|
-
when Wx::Bitmap, Wx::DC
|
78
|
-
self.new(arg)
|
79
|
-
else
|
80
|
-
::Kernel.raise ArgumentError, 'Expected Wx::Bitmap or Wx::DC'
|
81
|
-
end
|
82
|
-
begin
|
83
|
-
yield(dc) if block_given?
|
84
|
-
ensure
|
85
|
-
dc.select_object(Wx::NULL_BITMAP)
|
86
|
-
end
|
87
|
-
nil
|
88
|
-
end
|
89
|
-
|
90
|
-
end
|
91
|
-
|
92
72
|
end
|
@@ -1180,6 +1180,7 @@ class Wx::EvtHandler
|
|
1180
1180
|
Wx::EVT_COMBOBOX_CLOSEUP,
|
1181
1181
|
Wx::CommandEvent
|
1182
1182
|
] if Wx.const_defined?(:EVT_COMBOBOX_CLOSEUP)
|
1183
|
+
# from wxBitmapComboBox
|
1183
1184
|
# from wxRadioBox
|
1184
1185
|
# from wxPanel
|
1185
1186
|
# from wxNotebook
|
@@ -1195,6 +1196,17 @@ class Wx::EvtHandler
|
|
1195
1196
|
] if Wx.const_defined?(:EVT_NOTEBOOK_PAGE_CHANGING)
|
1196
1197
|
# from wxListBox
|
1197
1198
|
# from wxChoice
|
1199
|
+
# from wxSearchCtrl
|
1200
|
+
self.register_event_type EventType[
|
1201
|
+
'evt_search', 1,
|
1202
|
+
Wx::EVT_SEARCH,
|
1203
|
+
Wx::CommandEvent
|
1204
|
+
] if Wx.const_defined?(:EVT_SEARCH)
|
1205
|
+
self.register_event_type EventType[
|
1206
|
+
'evt_search_cancel', 1,
|
1207
|
+
Wx::EVT_SEARCH_CANCEL,
|
1208
|
+
Wx::CommandEvent
|
1209
|
+
] if Wx.const_defined?(:EVT_SEARCH_CANCEL)
|
1198
1210
|
# from wxCollapsiblePane
|
1199
1211
|
# from wxSlider
|
1200
1212
|
# from wxScrollBar
|
data/lib/wx/core/evthandler.rb
CHANGED
@@ -17,9 +17,45 @@ class Wx::EvtHandler
|
|
17
17
|
|
18
18
|
# Fast look-up hash to map event type ids to ruby event classes
|
19
19
|
EVENT_TYPE_CLASS_MAP = {}
|
20
|
+
private_constant :EVENT_TYPE_CLASS_MAP
|
20
21
|
# Hash to look up EVT constants from symbol names of evt handler
|
21
22
|
# methods; used internally by disconnect (see EvtHandler.i)
|
22
23
|
EVENT_NAME_TYPE_MAP = {}
|
24
|
+
private_constant :EVENT_NAME_TYPE_MAP
|
25
|
+
|
26
|
+
class << self
|
27
|
+
|
28
|
+
def get_event_type_class_map
|
29
|
+
EVENT_TYPE_CLASS_MAP
|
30
|
+
end
|
31
|
+
private :get_event_type_class_map
|
32
|
+
|
33
|
+
# Add caching for added event filters as we need to keep these alive
|
34
|
+
# for as long as they are registered
|
35
|
+
|
36
|
+
def event_filters
|
37
|
+
@event_filters ||= []
|
38
|
+
end
|
39
|
+
private :event_filters
|
40
|
+
|
41
|
+
wx_add_filter = instance_method :add_filter
|
42
|
+
define_method :add_filter do |filter|
|
43
|
+
wx_add_filter.bind(self).call(filter)
|
44
|
+
event_filters << filter
|
45
|
+
end
|
46
|
+
|
47
|
+
wx_remove_filter = instance_method :remove_filter
|
48
|
+
define_method :remove_filter do |filter|
|
49
|
+
wx_remove_filter.bind(self).call(filter)
|
50
|
+
event_filters.delete(filter)
|
51
|
+
end
|
52
|
+
|
53
|
+
def clear_filters
|
54
|
+
event_filters.each { |f| remove_filter(f) }
|
55
|
+
event_filters.clear
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
23
59
|
|
24
60
|
# Given a Wx EventType id (eg Wx::EVT_MENU), returns a WxRuby Event
|
25
61
|
# class which should be passed to event handler blocks. The actual
|
@@ -0,0 +1,24 @@
|
|
1
|
+
|
2
|
+
module Wx
|
3
|
+
|
4
|
+
class FindReplaceDialog < Wx::Dialog
|
5
|
+
|
6
|
+
# add caching for FindReplaceData object
|
7
|
+
# dialog does not take over ownership but does allow referencing
|
8
|
+
# the data object so we need to keep it alive here
|
9
|
+
|
10
|
+
wx_initialize = instance_method :initialize
|
11
|
+
define_method :initialize do |parent, data, *args|
|
12
|
+
wx_initialize.bind(self).call(parent, data, *args)
|
13
|
+
@fr_data = data
|
14
|
+
end
|
15
|
+
|
16
|
+
wx_set_data = instance_method :set_data
|
17
|
+
define_method :set_data do |data|
|
18
|
+
wx_set_data.bind(self).call(data)
|
19
|
+
@fr_data = data
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
data/lib/wx/core/icon.rb
CHANGED
@@ -51,7 +51,7 @@ module Wx
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def self.Icon(name, bmp_type = nil, *rest)
|
54
|
-
art_path = File.dirname(caller_path = caller_locations(1).first.absolute_path)
|
54
|
+
art_path = File.dirname(caller_path = caller_locations(1).first.absolute_path || caller_locations(1).first.path)
|
55
55
|
art_owner = File.basename(caller_path, '.*')
|
56
56
|
art_file = ArtLocator.find_art(name, art_type: :icon, art_path: art_path, art_section: art_owner, bmp_type: bmp_type)
|
57
57
|
::Kernel.raise ArgumentError, "Cannot locate art file for #{name}:Icon" unless art_file
|
data/lib/wx/core/image.rb
CHANGED
@@ -69,7 +69,7 @@ module Wx
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def self.Image(name, bmp_type = nil, *rest)
|
72
|
-
art_path = File.dirname(caller_path = caller_locations(1).first.absolute_path)
|
72
|
+
art_path = File.dirname(caller_path = caller_locations(1).first.absolute_path || caller_locations(1).first.path)
|
73
73
|
art_owner = File.basename(caller_path, '.*')
|
74
74
|
art_file = ArtLocator.find_art(name, art_type: :image, art_path: art_path, art_section: art_owner, bmp_type: bmp_type)
|
75
75
|
::Kernel.raise ArgumentError, "Cannot locate art file for #{name}:Image" unless art_file
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
module Wx
|
3
|
+
|
4
|
+
module TextEntry
|
5
|
+
|
6
|
+
wx_auto_complete = instance_method :auto_complete
|
7
|
+
define_method :auto_complete do |completer|
|
8
|
+
if wx_auto_complete.bind(self).call(completer)
|
9
|
+
@completer = completer # keep the Ruby object alive
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
class Wx::VListBox
|
3
|
+
|
4
|
+
wx_each_selected = instance_method :each_selected
|
5
|
+
define_method :each_selected do |&block|
|
6
|
+
if block
|
7
|
+
wx_each_selected.bind(self).call(&block)
|
8
|
+
else
|
9
|
+
::Enumerator.new { |y| wx_each_selected.bind(self).call { |sel| y << sel } }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
data/lib/wx/core/window.rb
CHANGED
@@ -49,7 +49,7 @@ class Wx::Window
|
|
49
49
|
# This modified version of evt_paint sets a variable indicating that a
|
50
50
|
# paint event is being handled just before running the event
|
51
51
|
# handler. This ensures that any call to Window#paint within the
|
52
|
-
# handler will supply a Wx::PaintDC (see
|
52
|
+
# handler will supply a Wx::PaintDC (see Window SWIG director).
|
53
53
|
def evt_paint(meth = nil, &block)
|
54
54
|
paint_proc = acquire_handler(meth, block)
|
55
55
|
wrapped_block = proc do | event |
|
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
module Wx
|
3
|
+
|
4
|
+
class BusyInfo
|
5
|
+
|
6
|
+
# @overload busy(message, parent=nil)
|
7
|
+
# Shows busy info window with message, blocks event handling and calls the given block
|
8
|
+
# passing the BusyInfo instance as argument.
|
9
|
+
# @param [String] message
|
10
|
+
# @param [Wx::Window,nil] parent
|
11
|
+
# @yieldparam [Wx::BusyInfo] bi BusyInfo instance
|
12
|
+
# @overload busy(busy_info)
|
13
|
+
# Shows busy info window according to busy_info settings, blocks event handling and calls the given block
|
14
|
+
# passing the BusyInfo instance as argument.
|
15
|
+
# @param [Wx::BusyInfoFlags] busy_info
|
16
|
+
# @yieldparam [Wx::BusyInfo] bi BusyInfo instance
|
17
|
+
def self.busy(*args) end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
module Wx
|
3
|
+
|
4
|
+
class ClientDC < Wx::DC
|
5
|
+
|
6
|
+
# Executes the given block providing a temporary (client) dc as
|
7
|
+
# it's single argument.
|
8
|
+
# @param [Wx::Window] win window to draw on
|
9
|
+
# @yieldparam [Wx::ClientDC] dc the ClientDC instance to paint on
|
10
|
+
# @return [Object] result of the block
|
11
|
+
def self.draw_on(win) end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
class PaintDC < Wx::ClientDC
|
16
|
+
|
17
|
+
# Executes the given block providing a temporary dc as
|
18
|
+
# it's single argument.
|
19
|
+
# Pass a pointer to the window on which you wish to paint.
|
20
|
+
# @note In wxRuby this method mostly exists to be consistent with the other DC classes. It is however recommended to use Wx::Window#paint instead.
|
21
|
+
# @param [Wx::Window] win window to draw on
|
22
|
+
# @yieldparam [Wx::PaintDC] dc the PaintDC instance to paint on
|
23
|
+
# @return [Object] result of the block
|
24
|
+
def self.draw_on(win) end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
class Wx::ControlWithItems
|
3
|
+
|
4
|
+
# Returns true if the items in the control are sorted
|
5
|
+
# (style Wx::LB_SORT for list boxes or Wx::CB_SORT for combo boxes).
|
6
|
+
# This method is mostly meant for internal use only.
|
7
|
+
# @return [Boolean] true is sorted, false otherwise
|
8
|
+
def is_sorted; end
|
9
|
+
alias :sorted? :is_sorted
|
10
|
+
|
11
|
+
end
|
data/lib/wx/doc/dc.rb
CHANGED
@@ -49,18 +49,4 @@ module Wx
|
|
49
49
|
|
50
50
|
end
|
51
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
|
65
|
-
|
66
52
|
end
|