wxruby3 0.9.4-x64-mingw-ucrt → 0.9.5-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/INSTALL.md +1 -1
  3. data/README.md +2 -2
  4. data/ext/wxbase32u_gcc_custom.dll +0 -0
  5. data/ext/wxbase32u_net_gcc_custom.dll +0 -0
  6. data/ext/wxbase32u_xml_gcc_custom.dll +0 -0
  7. data/ext/wxmsw32u_aui_gcc_custom.dll +0 -0
  8. data/ext/wxmsw32u_core_gcc_custom.dll +0 -0
  9. data/ext/wxmsw32u_gl_gcc_custom.dll +0 -0
  10. data/ext/wxmsw32u_html_gcc_custom.dll +0 -0
  11. data/ext/wxmsw32u_media_gcc_custom.dll +0 -0
  12. data/ext/wxmsw32u_propgrid_gcc_custom.dll +0 -0
  13. data/ext/wxmsw32u_qa_gcc_custom.dll +0 -0
  14. data/ext/wxmsw32u_ribbon_gcc_custom.dll +0 -0
  15. data/ext/wxmsw32u_richtext_gcc_custom.dll +0 -0
  16. data/ext/wxmsw32u_stc_gcc_custom.dll +0 -0
  17. data/ext/wxmsw32u_webview_gcc_custom.dll +0 -0
  18. data/ext/wxmsw32u_xrc_gcc_custom.dll +0 -0
  19. data/lib/wx/core/combo_ctrl.rb +171 -0
  20. data/lib/wx/doc/comboctrl.rb +128 -3
  21. data/lib/wx/doc/gen/app_traits.rb +2 -54
  22. data/lib/wx/doc/gen/art_provider.rb +0 -2
  23. data/lib/wx/doc/gen/aui/aui_dock_art.rb +77 -77
  24. data/lib/wx/doc/gen/aui/aui_manager.rb +0 -1
  25. data/lib/wx/doc/gen/aui/aui_mdi_client_window.rb +5 -4
  26. data/lib/wx/doc/gen/aui/aui_tool_bar_event.rb +20 -20
  27. data/lib/wx/doc/gen/colour.rb +0 -1
  28. data/lib/wx/doc/gen/colour_dialog.rb +1 -1
  29. data/lib/wx/doc/gen/combo_box.rb +3 -2
  30. data/lib/wx/doc/gen/combo_ctrl.rb +91 -227
  31. data/lib/wx/doc/gen/core.rb +2 -2
  32. data/lib/wx/doc/gen/dc.rb +0 -3
  33. data/lib/wx/doc/gen/dialog.rb +0 -1
  34. data/lib/wx/doc/gen/events.rb +2 -24
  35. data/lib/wx/doc/gen/file_dialog.rb +0 -2
  36. data/lib/wx/doc/gen/file_dialog_customize_hook.rb +53 -61
  37. data/lib/wx/doc/gen/file_system.rb +1 -58
  38. data/lib/wx/doc/gen/frame.rb +0 -1
  39. data/lib/wx/doc/gen/grid/grid_ctrl.rb +0 -12
  40. data/lib/wx/doc/gen/header_ctrl.rb +0 -1
  41. data/lib/wx/doc/gen/image.rb +0 -2
  42. data/lib/wx/doc/gen/list_ctrl.rb +0 -1
  43. data/lib/wx/doc/gen/media_ctrl.rb +0 -6
  44. data/lib/wx/doc/gen/menu.rb +0 -2
  45. data/lib/wx/doc/gen/notebook.rb +0 -1
  46. data/lib/wx/doc/gen/pg/pg_property.rb +0 -13
  47. data/lib/wx/doc/gen/pg/pg_validation_info.rb +0 -2
  48. data/lib/wx/doc/gen/pg/property_grid.rb +0 -2
  49. data/lib/wx/doc/gen/pg/property_grid_interface.rb +2 -2
  50. data/lib/wx/doc/gen/pg/property_grid_manager.rb +0 -2
  51. data/lib/wx/doc/gen/pg/property_grid_page.rb +0 -2
  52. data/lib/wx/doc/gen/pg/property_grid_page_state.rb +0 -1
  53. data/lib/wx/doc/gen/prt/post_script_dc.rb +0 -1
  54. data/lib/wx/doc/gen/rtc/rich_text_html_handler.rb +0 -1
  55. data/lib/wx/doc/gen/rtc/rich_text_style_list_box.rb +3 -0
  56. data/lib/wx/doc/gen/rtc/rich_text_xml_handler.rb +0 -1
  57. data/lib/wx/doc/gen/scroll_bar.rb +0 -1
  58. data/lib/wx/doc/gen/sizer.rb +0 -1
  59. data/lib/wx/doc/gen/slider.rb +0 -1
  60. data/lib/wx/doc/gen/splash_screen.rb +1 -1
  61. data/lib/wx/doc/gen/stc/styled_text_ctrl.rb +0 -1
  62. data/lib/wx/doc/gen/stc/styled_text_event.rb +0 -1
  63. data/lib/wx/doc/gen/task_bar_icon.rb +0 -1
  64. data/lib/wx/doc/gen/text_ctrl.rb +0 -5
  65. data/lib/wx/doc/gen/tree_ctrl.rb +0 -2
  66. data/lib/wx/doc/gen/v_scrolled_window.rb +0 -1
  67. data/lib/wx/doc/gen/wizard.rb +0 -1
  68. data/lib/wx/doc/gen/wizard_page.rb +0 -1
  69. data/lib/wx/doc/owner_drawn_combobox.rb +5 -1
  70. data/lib/wx/version.rb +1 -1
  71. data/lib/wxruby_aui.so +0 -0
  72. data/lib/wxruby_core.so +0 -0
  73. data/lib/wxruby_grid.so +0 -0
  74. data/lib/wxruby_html.so +0 -0
  75. data/lib/wxruby_pg.so +0 -0
  76. data/lib/wxruby_prt.so +0 -0
  77. data/lib/wxruby_rbn.so +0 -0
  78. data/lib/wxruby_rtc.so +0 -0
  79. data/lib/wxruby_stc.so +0 -0
  80. data/tests/test_combo_ctrl.rb +196 -0
  81. metadata +4 -2
@@ -524,19 +524,16 @@ module Wx
524
524
  # Note that alignment styles ({Wx::TE_LEFT}, {Wx::TE_CENTRE} and {Wx::TE_RIGHT}) can be changed dynamically after control creation on WXMSW, WXGTK and WXOSX. {Wx::TE_READONLY}, {Wx::TE_PASSWORD} and wrapping styles can be dynamically changed under WXGTK but not WXMSW. The other styles can be only set during control creation.
525
525
  #
526
526
  # ## wxTextCtrl Text Format
527
- #
528
527
  # The multiline text controls always store the text as a sequence of lines separated by <code>'\n'</code> characters, i.e. in the Unix text format even on non-Unix platforms. This allows the user code to ignore the differences between the platforms but at a price: the indices in the control such as those returned by {Wx::TextCtrl#get_insertion_point} or {Wx::TextCtrl#get_selection} can <b>not</b> be used as indices into the string returned by {Wx::TextCtrl#get_value} as they're going to be slightly off for platforms using <code>"\\r\\n"</code> as separator (as Windows does).
529
528
  # Instead, if you need to obtain a substring between the 2 indices obtained from the control with the help of the functions mentioned above, you should use {Wx::TextCtrl#get_range}. And the indices themselves can only be passed to other methods, for example {Wx::TextCtrl#set_insertion_point} or {Wx::TextCtrl#set_selection}.
530
529
  # To summarize: never use the indices returned by (multiline) {Wx::TextCtrl} as indices into the string it contains, but only as arguments to be passed back to the other {Wx::TextCtrl} methods. This problem doesn't arise for single-line platforms however where the indices in the control do correspond to the positions in the value string.
531
530
  #
532
531
  # ## wxTextCtrl Positions and Coordinates
533
- #
534
532
  # It is possible to use either linear positions, i.e. roughly (but not always exactly, as explained in the previous section) the index of the character in the text contained in the control or X-Y coordinates, i.e. column and line of the character when working with this class and it provides the functions {Wx::TextCtrl#position_to_xy} and {Wx::TextCtrl#xy_to_position} to convert between the two.
535
533
  # Additionally, a position in the control can be converted to its coordinates in pixels using {Wx::TextCtrl#position_to_coords} which can be useful to e.g. show a popup menu near the given character. And, in the other direction, {Wx::TextCtrl#hit_test} can be used to find the character under, or near, the given pixel coordinates.
536
534
  # To be more precise, positions actually refer to the gaps between characters and not the characters themselves. Thus, position 0 is the one before the very first character in the control and so is a valid position even when the control is empty. And if the control contains a single character, it has two valid positions: 0 before this character and 1 after it. This, when the documentation of various functions mentions "invalid position", it doesn't consider the position just after the last character of the line to be invalid, only the positions beyond that one (e.g. 2 and greater in the single character example) are actually invalid.
537
535
  #
538
536
  # ## wxTextCtrl Styles.
539
- #
540
537
  # Multi-line text controls support styling, i.e. provide a possibility to set colours and font for individual characters in it (note that under Windows {Wx::TE_RICH} style is required for style support). To use the styles you can either call {Wx::TextCtrl#set_default_style} before inserting the text or call {Wx::TextCtrl#set_style} later to change the style of the text already in the control (the first solution is much more efficient).
541
538
  # In either case, if the style doesn't specify some of the attributes (for example you only want to set the text colour but without changing the font nor the text background), the values of the default style will be used for them. If there is no default style, the attributes of the text control itself are used.
542
539
  # So the following code correctly describes what it does: the second call to {Wx::TextCtrl#set_default_style} doesn't change the text foreground colour (which stays red) while the last one doesn't change the background colour (which stays grey):
@@ -551,7 +548,6 @@ module Wx
551
548
  # ```
552
549
  #
553
550
  # ## wxTextCtrl and C++ Streams
554
- #
555
551
  # This class multiply-inherits from std::streambuf (except for some really old compilers using non-standard iostream library), allowing code such as the following:
556
552
  #
557
553
  # ```
@@ -604,7 +600,6 @@ module Wx
604
600
  # See {Wx::StreamToTextRedirector} for more details.
605
601
  #
606
602
  # ## Event Handling.
607
- #
608
603
  # The following commands are processed by default event handlers in {Wx::TextCtrl}: {Wx::StandardID::ID_CUT}, {Wx::StandardID::ID_COPY}, {Wx::StandardID::ID_PASTE}, {Wx::StandardID::ID_UNDO}, {Wx::StandardID::ID_REDO}. The associated UI update events are also processed automatically, when the control has the focus.
609
604
  # ### Events emitted by this class
610
605
  #
@@ -235,13 +235,11 @@ module Wx
235
235
  # A similar control with a fully native implementation for GTK+ and macOS as well is {Wx::DataViewTreeCtrl}.
236
236
  #
237
237
  # ## Images in wxTreeCtrl
238
- #
239
238
  # {Wx::TreeCtrl} inherits from {Wx::WithImages} classes providing the functions for associating images with the control items. Each item refers to its image using an index, which can possibly by {Wx::WithImages::NO_IMAGE} to indicate that the item doesn't use any image at all, and the corresponding image is taken either from the vector passed to {Wx::WithImages#set_images} or from the image list passed to {Wx::WithImages#set_image_list} or {Wx::WithImages#assign_image_list} functions.
240
239
  # In addition to normal images, handled with the methods mentioned above, {Wx::TreeCtrl} also provides optional state images that may be used to indicate some additional state of the item, e.g. checked or unchecked status. These images can be set using {Wx::TreeCtrl#set_state_image_list} and {Wx::TreeCtrl#assign_state_image_list} functions that behave in the same way as the corresponding methods of {Wx::WithImages}.
241
240
  # Finally, in the generic version of this control ({Wx::GenericTreeCtrl}), also provides {Wx::TreeCtrl#set_buttons_image_list} and {Wx::TreeCtrl#assign_buttons_image_list}, which can be used to change the images used for the control buttons, used to expand or collapse its branches. These methods are not available in the native WXMSW and {Wx::Qt} implementations.
242
241
  #
243
242
  # ## Events
244
- #
245
243
  # To intercept events from a tree control, use the event table macros described in {Wx::TreeEvent}.
246
244
  # ### Styles
247
245
  #
@@ -12,7 +12,6 @@ module Wx
12
12
  # To use this class, you need to derive from it and implement the {Wx::VScrolledWindow#on_get_row_height} pure virtual method. You also must call {Wx::VScrolledWindow#set_row_count} to let the base class know how many rows it should display, but from that moment on the scrolling is handled entirely by {Wx::VScrolledWindow}. You only need to draw the visible part of contents in your <code>OnPaint()</code> method as usual. You should use {Wx::VScrolledWindow#get_visible_rows_begin} and {Wx::VScrolledWindow#get_visible_rows_end} to select the lines to display. Note that the device context origin is not shifted so the first visible row always appears at the point (0, 0) in physical as well as logical coordinates.
13
13
  #
14
14
  # ## wxWidgets 2.8 Compatibility Functions
15
- #
16
15
  # The following functions provide backwards compatibility for applications originally built using {Wx::VScrolledWindow} in 2.6 or 2.8. Originally, {Wx::VScrolledWindow} referred to scrolling "lines". We now use "units" in {Wx::VarScrollHelperBase} to avoid implying any orientation (since the functions are used for both horizontal and vertical scrolling in derived classes). And in the new {Wx::VScrolledWindow} and {Wx::HScrolledWindow} classes, we refer to them as "rows" and "columns", respectively. This is to help clear some confusion in not only those classes, but also in {Wx::HVScrolledWindow} where functions are inherited from both.
17
16
  # You are encouraged to update any existing code using these function to use the new replacements mentioned below, and avoid using these functions for any new code as they are deprecated.
18
17
  #
@@ -33,7 +33,6 @@ module Wx
33
33
  # - {Wx::EvtHandler#evt_wizard_finished}(id, meth = nil, &block): The wizard finished button was pressed.
34
34
  #
35
35
  # ## Extended styles
36
- #
37
36
  # Use the {Wx::Window#set_extra_style} function to set the following style. You will need to use two-step construction (use the default constructor, call {Wx::Wizard#set_extra_style}, then call Create).
38
37
  #
39
38
  # ### Extra Styles
@@ -12,7 +12,6 @@ module Wx
12
12
  # This class allows the programmer to decide the order of pages in the wizard dynamically (during run-time) and so provides maximal flexibility. Usually, however, the order of pages is known in advance in which case {Wx::WizardPageSimple} class is enough and it is simpler to use.
13
13
  #
14
14
  # ## Virtual functions to override
15
- #
16
15
  # To use this class, you must override {Wx::WizardPage#get_prev} and {Wx::WizardPage#get_next} pure virtual functions (or you may use {Wx::WizardPageSimple} instead). {Wx::WizardPage#get_bitmap} can also be overridden, but this should be very rarely needed.
17
16
  #
18
17
  # Category: Miscellaneous Windows
@@ -7,7 +7,11 @@
7
7
 
8
8
  module Wx
9
9
 
10
- class OwnerDrawnComboBox
10
+ class OwnerDrawnComboBox < ComboCtrl
11
+
12
+ alias :get_item_data :get_client_object
13
+
14
+ alias :set_item_data :set_client_object
11
15
 
12
16
  # Returns the label of the selected item or an empty string if no item is selected.
13
17
  #
data/lib/wx/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  # This software is released under the MIT license.
4
4
 
5
5
  module Wx
6
- WXRUBY_VERSION = '0.9.4'
6
+ WXRUBY_VERSION = '0.9.5'
7
7
  end
data/lib/wxruby_aui.so CHANGED
Binary file
data/lib/wxruby_core.so CHANGED
Binary file
data/lib/wxruby_grid.so CHANGED
Binary file
data/lib/wxruby_html.so CHANGED
Binary file
data/lib/wxruby_pg.so CHANGED
Binary file
data/lib/wxruby_prt.so CHANGED
Binary file
data/lib/wxruby_rbn.so CHANGED
Binary file
data/lib/wxruby_rtc.so CHANGED
Binary file
data/lib/wxruby_stc.so CHANGED
Binary file
@@ -0,0 +1,196 @@
1
+ # Copyright (c) 2023 M.J.N. Corino, The Netherlands
2
+ #
3
+ # This software is released under the MIT license.
4
+
5
+ require_relative './lib/wxframe_runner'
6
+ require_relative './lib/text_entry_tests'
7
+
8
+ class ComboCtrlCtrlTests < WxRuby::Test::GUITests
9
+
10
+ include TextEntryTests
11
+
12
+ class LVComboPopup < Wx::ListView
13
+
14
+ include Wx::ComboPopup
15
+
16
+ def initialize
17
+ # call default control ctor; need to call Wx::ListView#create later
18
+ super
19
+ end
20
+
21
+ def init
22
+ @value = -1
23
+ end
24
+
25
+ def create(parent)
26
+ # need to finish creating the list view here
27
+ # as calling super here would just call Wx::ComboPopup#create and not Wx::ListView#create
28
+ # we need to use Ruby magic
29
+ wx_lv_create = (Wx::ListView.instance_method :create).bind(self)
30
+ wx_lv_create.call(parent, 1, [0,0], Wx::DEFAULT_SIZE)
31
+ evt_motion :on_mouse_move
32
+ evt_left_up :on_mouse_click
33
+ end
34
+
35
+ # Return pointer to the created control
36
+ def get_control
37
+ self
38
+ end
39
+
40
+ def lv_find_item(*args)
41
+ unless @wx_lv_find_item
42
+ @wx_lv_find_item = (Wx::ListView.instance_method :find_item).bind(self)
43
+ end
44
+ @wx_lv_find_item.call(*args)
45
+ end
46
+ protected :lv_find_item
47
+
48
+ # Translate string into a list selection
49
+ def set_string_value(s)
50
+ n = lv_find_item(-1, s)
51
+ if n >= 0 && n < get_item_count
52
+ select(n)
53
+ @value = n
54
+ end
55
+ end
56
+
57
+ # Get list selection as a string
58
+ def get_string_value
59
+ return get_item_text(@value) if @value >= 0
60
+ ''
61
+ end
62
+
63
+ # Do mouse hot-tracking (which is typical in list popups)
64
+ def on_mouse_move(event)
65
+ # Move selection to cursor ...
66
+ end
67
+
68
+ # On mouse left up, set the value and close the popup
69
+ def on_mouse_click(_event)
70
+ @value = get_first_selected
71
+
72
+ # Send event as well ...
73
+
74
+ dismiss
75
+ end
76
+
77
+ end
78
+
79
+ def setup
80
+ super
81
+ @combo = Wx::ComboCtrl.new(frame_win, name: 'ComboCtrl')
82
+ @combo.set_popup_control(LVComboPopup.new)
83
+ end
84
+
85
+ def cleanup
86
+ @combo.destroy
87
+ super
88
+ end
89
+
90
+ attr_reader :combo
91
+ alias :text_entry :combo
92
+
93
+ def fill_list(list)
94
+ list.insert_item(0, 'This is the first item')
95
+ list.insert_item(1, 'This is the second item')
96
+ list.insert_item(2, 'This is the third item')
97
+ list.insert_item(3, 'This is the fourth item')
98
+ end
99
+
100
+ def test_popup
101
+ assert_equal('', combo.get_value)
102
+
103
+ assert_kind_of(Wx::ComboPopup, combo.get_popup_control)
104
+ assert_kind_of(Wx::ListView, combo.get_popup_control)
105
+ assert_kind_of(Wx::ListView, combo.get_popup_control.get_control)
106
+
107
+ assert_nothing_raised { fill_list(combo.get_popup_control) }
108
+ combo.popup
109
+
110
+ combo.set_value_by_user('This is the second item')
111
+
112
+ assert_equal('This is the second item', combo.get_popup_control.get_string_value)
113
+
114
+ combo.dismiss
115
+ end
116
+
117
+ end
118
+
119
+ class OwnerDrawnCBTests < WxRuby::Test::GUITests
120
+
121
+ include TextEntryTests
122
+
123
+ class TestODComboBox < Wx::OwnerDrawnComboBox
124
+
125
+ def on_draw_item(dc, rect, item, _flags)
126
+ return if item == Wx::NOT_FOUND
127
+
128
+ dc.set_text_foreground(Wx::BLACK)
129
+ dc.draw_text(get_string(item),
130
+ rect.x + 3,
131
+ rect.y + ((rect.height - dc.char_height)/2))
132
+ end
133
+
134
+ def on_draw_background(dc, rect, item, flags)
135
+ # If item is selected or even, or we are painting the
136
+ # combo control itself, use the default rendering.
137
+ if flags.anybits?(Wx::ODCB_PAINTING_CONTROL|Wx::ODCB_PAINTING_SELECTED) || (item & 1) == 0
138
+ super(dc,rect,item,flags)
139
+ return
140
+ end
141
+
142
+ # Otherwise, draw every other background with different colour.
143
+ bgCol = Wx::Colour.new(240,240,250)
144
+ dc.set_brush(Wx::Brush.new(bgCol))
145
+ dc.set_pen(Wx::Pen.new(bgCol))
146
+ dc.draw_rectangle(rect)
147
+ end
148
+
149
+ def on_measure_item(_item)
150
+ 48
151
+ end
152
+
153
+ def on_measure_item_width(_item)
154
+ -1 # default - will be measured from text width
155
+ end
156
+
157
+ end
158
+
159
+ def setup
160
+ super
161
+ @combo = TestODComboBox.new(frame_win, name: 'ODComboBox')
162
+ end
163
+
164
+ def cleanup
165
+ @combo.destroy
166
+ super
167
+ end
168
+
169
+ attr_reader :combo
170
+ alias :text_entry :combo
171
+
172
+ def fill_list(list)
173
+ list.append('This is the first item')
174
+ list.append('This is the second item')
175
+ list.append('This is the third item')
176
+ list.append('This is the fourth item')
177
+ end
178
+
179
+ def test_popup
180
+ assert_equal('', combo.get_value)
181
+
182
+ assert_kind_of(Wx::ComboPopup, combo.get_popup_control)
183
+ assert_kind_of(Wx::ComboPopupWx, combo.get_popup_control)
184
+ assert_kind_of(Wx::VListBox, combo.get_popup_control.get_control)
185
+
186
+ assert_nothing_raised { fill_list(combo) }
187
+ combo.popup
188
+
189
+ combo.set_value_by_user('This is the third item')
190
+
191
+ assert_equal('This is the third item', combo.get_popup_control.get_string_value)
192
+
193
+ combo.dismiss
194
+ end
195
+
196
+ 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.4
4
+ version: 0.9.5
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: 2024-01-07 00:00:00.000000000 Z
11
+ date: 2024-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -126,6 +126,7 @@ files:
126
126
  - lib/wx/core/clipboard.rb
127
127
  - lib/wx/core/collapsible_pane.rb
128
128
  - lib/wx/core/colour.rb
129
+ - lib/wx/core/combo_ctrl.rb
129
130
  - lib/wx/core/combobox.rb
130
131
  - lib/wx/core/config.rb
131
132
  - lib/wx/core/const.rb
@@ -1053,6 +1054,7 @@ files:
1053
1054
  - tests/test_book_controls.rb
1054
1055
  - tests/test_box_sizer.rb
1055
1056
  - tests/test_clipboard.rb
1057
+ - tests/test_combo_ctrl.rb
1056
1058
  - tests/test_config.rb
1057
1059
  - tests/test_dc.rb
1058
1060
  - tests/test_dialog.rb