wxruby3 0.9.0.pre.beta.13-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/accessors.rb +8 -2
- 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/global_const.rb +24 -18
- 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
data/lib/wx/doc/gen/text_ctrl.rb
CHANGED
@@ -522,33 +522,40 @@ module Wx
|
|
522
522
|
# 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.
|
523
523
|
# 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):
|
524
524
|
#
|
525
|
+
# ```
|
525
526
|
# text->SetDefaultStyle(wxTextAttr(*wxRED));
|
526
527
|
# text->AppendText("Red text\n");
|
527
528
|
# text->SetDefaultStyle(wxTextAttr(wxNullColour, *wxLIGHT_GREY));
|
528
529
|
# text->AppendText("Red on grey text\n");
|
529
530
|
# text->SetDefaultStyle(wxTextAttr(*wxBLUE));
|
530
531
|
# text->AppendText("Blue on grey text\n");
|
532
|
+
# ```
|
531
533
|
#
|
532
534
|
# == wxTextCtrl and C++ Streams
|
533
535
|
#
|
534
536
|
# This class multiply-inherits from std::streambuf (except for some really old compilers using non-standard iostream library), allowing code such as the following:
|
535
537
|
#
|
538
|
+
# ```
|
536
539
|
# wxTextCtrl *control = new wxTextCtrl(...);
|
537
540
|
#
|
538
541
|
# ostream stream(control)
|
539
542
|
#
|
540
543
|
# stream << 123.456 << " some text\n";
|
541
544
|
# stream.flush();
|
545
|
+
# ```
|
542
546
|
#
|
543
547
|
# Note that even if your build of wxWidgets doesn't support this (the symbol {Wx::HAS_TEXT_WINDOW_STREAM} has value of 0 then) you can still use {Wx::TextCtrl} itself in a stream-like manner:
|
544
548
|
#
|
549
|
+
# ```
|
545
550
|
# wxTextCtrl *control = new wxTextCtrl(...);
|
546
551
|
#
|
547
552
|
# *control << 123.456 << " some text\n";
|
553
|
+
# ```
|
548
554
|
#
|
549
555
|
# However the possibility to create a std::ostream associated with {Wx::TextCtrl} may be useful if you need to redirect the output of a function taking a std::ostream as parameter to a text control.
|
550
556
|
# Another commonly requested need is to redirect std::cout to the text control. This may be done in the following way:
|
551
557
|
#
|
558
|
+
# ```
|
552
559
|
# #include <iostream>
|
553
560
|
#
|
554
561
|
# wxTextCtrl *control = new wxTextCtrl(...);
|
@@ -560,9 +567,11 @@ module Wx
|
|
560
567
|
# ...
|
561
568
|
#
|
562
569
|
# std::cout.rdbuf(sbOld);
|
570
|
+
# ```
|
563
571
|
#
|
564
572
|
# But wxWidgets provides a convenient class to make it even simpler so instead you may just do
|
565
573
|
#
|
574
|
+
# ```
|
566
575
|
# #include <iostream>
|
567
576
|
#
|
568
577
|
# wxTextCtrl *control = new wxTextCtrl(...);
|
@@ -571,6 +580,7 @@ module Wx
|
|
571
580
|
#
|
572
581
|
# // all output to cout goes into the text control until the exit from
|
573
582
|
# // current scope
|
583
|
+
# ```
|
574
584
|
#
|
575
585
|
# See {Wx::StreamToTextRedirector} for more details.
|
576
586
|
#
|
@@ -708,7 +718,6 @@ module Wx
|
|
708
718
|
# Finds the row and column of the character at the specified point.
|
709
719
|
# If the return code is not {Wx::TextCtrlHitTestResult::TE_HT_UNKNOWN} the row and column of the character closest to this position are returned, otherwise the output parameters are not modified.
|
710
720
|
# Please note that this function is currently only implemented in {Wx::Univ}, {Wx::MSW} and {Wx::GTK} ports and always returns {Wx::TextCtrlHitTestResult::TE_HT_UNKNOWN} in the other ports.
|
711
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this function takes only the pt argument and returns a 3-element list (result, col, row).
|
712
721
|
# @see Wx::TextCtrl#position_to_xy
|
713
722
|
# @see Wx::TextCtrl#xy_to_position
|
714
723
|
# @param pt [Array(Integer, Integer), Wx::Point] The position of the point to check, in window device coordinates.
|
@@ -765,8 +774,6 @@ module Wx
|
|
765
774
|
|
766
775
|
# Converts given position to a zero-based column, line number pair.
|
767
776
|
# true on success, false on failure (most likely due to a too large position parameter).
|
768
|
-
#
|
769
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this function takes only the pos argument and returns a 2-element list (x, y).
|
770
777
|
# @see Wx::TextCtrl#xy_to_position
|
771
778
|
# @param pos [Integer] Position.
|
772
779
|
# @return [Array(Integer, Integer), nil]
|
@@ -135,6 +135,7 @@ module Wx
|
|
135
135
|
# Notice that insertion position is, in general, different from the index of the character the cursor position at in the string returned by {Wx::TextEntry#get_value}. While this is always the case for the single line controls, multi-line controls can use two characters <code>"\\r\\n"</code> as line separator (this is notably the case under MSW) meaning that indices in the control and its string value are offset by 1 for every line.
|
136
136
|
# Hence to correctly get the character at the current cursor position, taking into account that there can be none if the cursor is at the end of the string, you could do the following:
|
137
137
|
#
|
138
|
+
# ```
|
138
139
|
# wxString GetCurrentChar(wxTextCtrl *tc)
|
139
140
|
# {
|
140
141
|
# long pos = tc->GetInsertionPoint();
|
@@ -143,6 +144,7 @@ module Wx
|
|
143
144
|
#
|
144
145
|
# return tc->GetRange(pos, pos + 1);
|
145
146
|
# }
|
147
|
+
# ```
|
146
148
|
# @return [Integer]
|
147
149
|
def get_insertion_point; end
|
148
150
|
alias_method :insertion_point, :get_insertion_point
|
@@ -162,8 +164,6 @@ module Wx
|
|
162
164
|
|
163
165
|
# Gets the current selection span.
|
164
166
|
# If the returned values are equal, there was no selection. Please note that the indices returned may be used with the other {Wx::TextCtrl} methods but don't necessarily represent the correct indices into the string returned by {Wx::TextEntry#get_value} for multiline controls under Windows (at least,) you should use {Wx::TextEntry#get_string_selection} to get the selected text.
|
165
|
-
#
|
166
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method takes no parameters and returns a 2-element list (from, to).
|
167
167
|
# @return [Array(Integer,Integer)]
|
168
168
|
def get_selection; end
|
169
169
|
alias_method :selection, :get_selection
|
@@ -317,6 +317,8 @@ module Wx
|
|
317
317
|
# Custom completer objects used with {Wx::TextEntry#auto_complete} must derive from this class and implement its pure virtual method returning the completions. You would typically use a custom completer when the total number of completions is too big for performance to be acceptable if all of them need to be returned at once but if they can be generated hierarchically, i.e. only the first component initially, then the second one after the user finished entering the first one and so on.
|
318
318
|
# When inheriting from this class you need to implement its two pure virtual methods. This allows returning the results incrementally and may or not be convenient depending on where do they come from. If you prefer to return all the completions at once, you should inherit from {Wx::TextCompleterSimple} instead.
|
319
319
|
#
|
320
|
+
#
|
321
|
+
# @note This class is <b>untracked</b> and should not be derived from nor instances extended!
|
320
322
|
class TextCompleter < ::Object
|
321
323
|
|
322
324
|
# Function called to start iteration over the completions for the given prefix.
|
@@ -341,7 +343,7 @@ module Wx
|
|
341
343
|
# A simpler base class for custom completer objects.
|
342
344
|
# This class may be simpler to use than the base {Wx::TextCompleter} as it allows to implement only a single virtual method instead of two of them (at the price of storing all completions in a temporary array).
|
343
345
|
# Here is a simple example of a custom completer that completes the names of some chess pieces. Of course, as the total list here has only four items it would have been much simpler to just specify the array containing all the completions in this example but the same approach could be used when the total number of completions is much higher provided the number of possibilities for each word is still relatively small:
|
344
|
-
#
|
346
|
+
# ```
|
345
347
|
# class MyTextCompleter : public wxTextCompleterSimple
|
346
348
|
# {
|
347
349
|
# public:
|
@@ -368,9 +370,12 @@ module Wx
|
|
368
370
|
# ...
|
369
371
|
# wxTextCtrl *text = ...;
|
370
372
|
# text->AutoComplete(new MyTextCompleter);
|
373
|
+
# ```
|
371
374
|
#
|
372
375
|
# ===
|
373
376
|
#
|
377
|
+
#
|
378
|
+
# @note This class is <b>untracked</b> and should not be derived from nor instances extended!
|
374
379
|
class TextCompleterSimple < TextCompleter
|
375
380
|
|
376
381
|
# Pure virtual method returning all possible completions for the given prefix.
|
@@ -53,7 +53,7 @@ module Wx
|
|
53
53
|
# @overload set_text_validator(validator)
|
54
54
|
# Associate a validator with the text control used by the dialog.
|
55
55
|
# These methods can be used to limit the user entry to only some characters, e.g.
|
56
|
-
#
|
56
|
+
# ```
|
57
57
|
# wxTextEntryDialog dlg(this, ...);
|
58
58
|
# dlg.SetTextValidator(wxFILTER_ALPHA);
|
59
59
|
# if ( dlg.ShowModal() == wxID_OK )
|
@@ -61,6 +61,7 @@ module Wx
|
|
61
61
|
# // We can be certain that this string contains letters only.
|
62
62
|
# wxString value = dlg.GetValue();
|
63
63
|
# }
|
64
|
+
# ```
|
64
65
|
#
|
65
66
|
# The first overload uses the provided validator which can be of a custom class derived from {Wx::TextValidator} while the second one creates a {Wx::TextValidator} with the specified style.
|
66
67
|
# @param validator [Wx::TextValidator]
|
@@ -68,7 +69,7 @@ module Wx
|
|
68
69
|
# @overload set_text_validator(style=Wx::TextValidatorStyle::FILTER_NONE)
|
69
70
|
# Associate a validator with the text control used by the dialog.
|
70
71
|
# These methods can be used to limit the user entry to only some characters, e.g.
|
71
|
-
#
|
72
|
+
# ```
|
72
73
|
# wxTextEntryDialog dlg(this, ...);
|
73
74
|
# dlg.SetTextValidator(wxFILTER_ALPHA);
|
74
75
|
# if ( dlg.ShowModal() == wxID_OK )
|
@@ -76,6 +77,7 @@ module Wx
|
|
76
77
|
# // We can be certain that this string contains letters only.
|
77
78
|
# wxString value = dlg.GetValue();
|
78
79
|
# }
|
80
|
+
# ```
|
79
81
|
#
|
80
82
|
# The first overload uses the provided validator which can be of a custom class derived from {Wx::TextValidator} while the second one creates a {Wx::TextValidator} with the specified style.
|
81
83
|
# @param style [TextValidatorStyle]
|
@@ -19,6 +19,7 @@ module Wx
|
|
19
19
|
# {Wx::TimerEvent} object is passed to the event handler of timer events (see {Wx::Timer#set_owner}).
|
20
20
|
# For example:
|
21
21
|
#
|
22
|
+
# ```
|
22
23
|
# class MyFrame : public wxFrame
|
23
24
|
# {
|
24
25
|
# public:
|
@@ -44,6 +45,7 @@ module Wx
|
|
44
45
|
# {
|
45
46
|
# // do whatever you want to do every second here
|
46
47
|
# }
|
48
|
+
# ```
|
47
49
|
#
|
48
50
|
# ===
|
49
51
|
#
|
data/lib/wx/doc/gen/tool_bar.rb
CHANGED
@@ -96,14 +96,17 @@ module Wx
|
|
96
96
|
# Note that many methods in {Wx::ToolBar} such as {Wx::ToolBar#add_tool} return a <code>wxToolBarToolBase*</code> object. This should be regarded as an opaque handle representing the newly added toolbar item, providing access to its id and position within the toolbar. Changes to the item's state should be made through calls to {Wx::ToolBar} methods, for example {Wx::ToolBar#enable_tool}. Calls to {Wx::ToolBarToolBase} methods (undocumented by purpose) will not change the visible state of the item within the tool bar.
|
97
97
|
# After you have added all the tools you need, you must call {Wx::ToolBar#realize} to effectively construct and display the toolbar.
|
98
98
|
# <b>{Wx::MSW} note</b>: Note that under {Wx::MSW} toolbar paints tools to reflect system-wide colours. If you use more than 16 colours in your tool bitmaps, you may wish to suppress this behaviour, otherwise system colours in your bitmaps will inadvertently be mapped to system colours. To do this, set the msw.remap system option before creating the toolbar:
|
99
|
-
#
|
99
|
+
# ```
|
100
100
|
# wxSystemOptions::SetOption("msw.remap", 0);
|
101
|
+
# ```
|
101
102
|
# If you wish to use 32-bit images (which include an alpha channel for transparency) use:
|
102
|
-
#
|
103
|
+
# ```
|
103
104
|
# wxSystemOptions::SetOption("msw.remap", 2);
|
105
|
+
# ```
|
104
106
|
# Then colour remapping is switched off, and a transparent background used. But only use this option under Windows XP with true colour:
|
105
|
-
#
|
107
|
+
# ```
|
106
108
|
# if (wxTheApp->GetComCtl32Version() >= 600 && ::wxDisplayDepth() >= 32)
|
109
|
+
# ```
|
107
110
|
#
|
108
111
|
# === Styles
|
109
112
|
#
|
@@ -506,11 +509,12 @@ module Wx
|
|
506
509
|
# It is usually unnecessary to call this function, as the tools will always be made big enough to fit the size of the bitmaps used in them. Moreover, calling it forces {Wx::ToolBar} to scale its images in high DPI using the provided size, instead of letting {Wx::BitmapBundle} used for the tool bitmaps determine the best suitable bitmap size, which may result in suboptimal appearance.
|
507
510
|
# If you do call it, it must be done before toolbar is {Wx::ToolBar#realize}'d.
|
508
511
|
# Example of using this function to force the bitmaps to be at least 32 pixels wide and tall (at normal DPI):
|
509
|
-
#
|
512
|
+
# ```
|
510
513
|
# toolbar->SetToolBitmapSize(FromDIP(wxSize(32, 32)));
|
511
514
|
# toolbar->AddTool(wxID_NEW, "New", wxBitmapBundle::FromXXX(...));
|
512
515
|
# ...
|
513
516
|
# toolbar->Realize();
|
517
|
+
# ```
|
514
518
|
# @see Wx::ToolBar#get_tool_bitmap_size
|
515
519
|
# @see Wx::ToolBar#get_tool_size
|
516
520
|
# @param size [Array(Integer, Integer), Wx::Size] The size of the bitmaps in the toolbar in logical pixels.
|
@@ -164,7 +164,7 @@ module Wx
|
|
164
164
|
# Returns all icons associated with the window, there will be none of them if neither {Wx::TopLevelWindow#set_icon} nor {Wx::TopLevelWindow#set_icons} had been called before.
|
165
165
|
# Use {Wx::TopLevelWindow#get_icon} to get the main icon of the window.
|
166
166
|
# @see Wx::IconBundle
|
167
|
-
# @return [
|
167
|
+
# @return [Wx::IconBundle]
|
168
168
|
def get_icons; end
|
169
169
|
alias_method :icons, :get_icons
|
170
170
|
|
@@ -239,8 +239,9 @@ module Wx
|
|
239
239
|
# Notice that because of the native system limitations the identifiers of the items added to the system menu must be multiples of 16, otherwise no events will be generated for them.
|
240
240
|
# The returned pointer must not be deleted, it is owned by the window and will be only deleted when the window itself is destroyed.
|
241
241
|
# This function is not available in the other ports by design, any occurrences of it in the portable code must be guarded by
|
242
|
-
#
|
242
|
+
# ```
|
243
243
|
# #ifdef __WXMSW__
|
244
|
+
# ```
|
244
245
|
# preprocessor guards.
|
245
246
|
# @return [Wx::Menu]
|
246
247
|
def msw_get_system_menu; end
|
@@ -434,9 +435,11 @@ module Wx
|
|
434
435
|
# This method is specific to {Wx::Universal} port.
|
435
436
|
# Use native or custom-drawn decorations for this window only. Notice that to have any effect this method must be called before really creating the window, i.e. two step creation must be used:
|
436
437
|
#
|
438
|
+
# ```
|
437
439
|
# MyFrame *frame = new MyFrame; // use default ctor
|
438
440
|
# frame->UseNativeDecorations(false); // change from default "true"
|
439
441
|
# frame->Create(parent, title, ...); // really create the frame
|
442
|
+
# ```
|
440
443
|
# @see Wx::TopLevelWindow#use_native_decorations_by_default
|
441
444
|
# @see Wx::TopLevelWindow#is_using_native_decorations
|
442
445
|
# @param native [true,false]
|
data/lib/wx/doc/gen/tree_ctrl.rb
CHANGED
@@ -437,7 +437,6 @@ module Wx
|
|
437
437
|
# If textOnly is true, only the rectangle around the item's label will be returned, otherwise the item's image is also taken into account.
|
438
438
|
# The return value is true if the rectangle was successfully retrieved or <code></code> false if it was not (in this case rect is not changed) for example, if the item is currently invisible.
|
439
439
|
# Notice that the rectangle coordinates are logical, not physical ones. So, for example, the x coordinate may be negative if the tree has a horizontal scrollbar and its position is not 0.
|
440
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method only takes the item and textOnly parameters and returns a Wx::Rect (or undef).
|
441
440
|
# @param item [Wx::TreeItemId]
|
442
441
|
# @param rect [Wx::Rect]
|
443
442
|
# @param textOnly [true,false]
|
@@ -504,7 +503,6 @@ module Wx
|
|
504
503
|
alias_method :item_background_colour, :get_item_background_colour
|
505
504
|
|
506
505
|
# Returns the tree item data associated with the item.
|
507
|
-
# <b>{Wx::Perl} Note:</b> {Wx::Perl} provides the following shortcut method:
|
508
506
|
# - GetPlData(item): returns the Perl data associated with the Wx::TreeItemData. It is just the same as tree->GetItemData(item)->GetData().
|
509
507
|
# @see Wx::TreeItemData
|
510
508
|
# @param item [Wx::TreeItemId]
|
@@ -619,8 +617,6 @@ module Wx
|
|
619
617
|
# flags is a bitlist of the following:
|
620
618
|
#
|
621
619
|
# - {Wx::TREE_HITTEST_ABOVE}: Above the client area.- {Wx::TREE_HITTEST_BELOW}: Below the client area.- {Wx::TREE_HITTEST_NOWHERE}: In the client area but below the last item.- {Wx::TREE_HITTEST_ONITEMBUTTON}: On the button associated with an item.- {Wx::TREE_HITTEST_ONITEMICON}: On the bitmap associated with an item.- {Wx::TREE_HITTEST_ONITEMINDENT}: In the indentation associated with an item.- {Wx::TREE_HITTEST_ONITEMLABEL}: On the label (string) associated with an item.- {Wx::TREE_HITTEST_ONITEMRIGHT}: In the area to the right of an item.- {Wx::TREE_HITTEST_ONITEMSTATEICON}: On the state icon for a tree view item that is in a user-defined state.- {Wx::TREE_HITTEST_TOLEFT}: To the right of the client area.- {Wx::TREE_HITTEST_TORIGHT}: To the left of the client area.
|
622
|
-
#
|
623
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method only takes the point parameter and returns a 2-element list (item, flags).
|
624
620
|
# @param point [Array(Integer, Integer), Wx::Point]
|
625
621
|
# @return [Array(Wx::TreeItemId,Integer)]
|
626
622
|
def hit_test(point) end
|
@@ -736,8 +732,6 @@ module Wx
|
|
736
732
|
|
737
733
|
# Sets the item client data.
|
738
734
|
# Notice that the client data previously associated with the item (if any) is not freed by this function and so calling this function multiple times for the same item will result in memory leaks unless you delete the old item data pointer yourself.
|
739
|
-
# <b>{Wx::Perl} Note:</b> {Wx::Perl} provides the following shortcut method:
|
740
|
-
# - SetPlData(item, data): sets the Perl data associated with the Wx::TreeItemData. It is just the same as tree->GetItemData(item)->SetData(data).
|
741
735
|
# @param item [Wx::TreeItemId]
|
742
736
|
# @param data [Object]
|
743
737
|
# @return [void]
|
@@ -0,0 +1,100 @@
|
|
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
|
+
# {Wx::UIActionSimulator} is a class used to simulate user interface actions such as a mouse click or a key press.
|
10
|
+
# Common usage for this class would be to provide playback and record (aka macro recording) functionality for users, or to drive unit tests by simulating user sessions.
|
11
|
+
# See the wxUIActionSimulator Sample for an example of using this class.
|
12
|
+
#
|
13
|
+
# ===
|
14
|
+
#
|
15
|
+
#
|
16
|
+
# @note This class is <b>untracked</b> and should not be derived from nor instances extended!
|
17
|
+
class UIActionSimulator < ::Object
|
18
|
+
|
19
|
+
# Default constructor.
|
20
|
+
# @return [UIActionSimulator]
|
21
|
+
def initialize; end
|
22
|
+
|
23
|
+
# @overload mouse_move(x, y)
|
24
|
+
# Move the mouse to the specified coordinates.
|
25
|
+
# @param x [Integer] x coordinate to move to, in screen coordinates.
|
26
|
+
# @param y [Integer] y coordinate to move to, in screen coordinates.
|
27
|
+
# @return [true,false]
|
28
|
+
# @overload mouse_move(point)
|
29
|
+
# Move the mouse to the specified coordinates.
|
30
|
+
# @param point [Array(Integer, Integer), Wx::Point] Point to move to, in screen coordinates.
|
31
|
+
# @return [true,false]
|
32
|
+
def mouse_move(*args) end
|
33
|
+
|
34
|
+
# Press a mouse button.
|
35
|
+
# @param button [Integer] Button to press. Valid constants are {Wx::MOUSE_BTN_LEFT}, {Wx::MOUSE_BTN_MIDDLE}, and {Wx::MOUSE_BTN_RIGHT}.
|
36
|
+
# @return [true,false]
|
37
|
+
def mouse_down(button=Wx::MOUSE_BTN_LEFT) end
|
38
|
+
|
39
|
+
# Release a mouse button.
|
40
|
+
# @param button [Integer] Button to press. See {Wx::UIActionSimulator#mouse_down} for a list of valid constants.
|
41
|
+
# @return [true,false]
|
42
|
+
def mouse_up(button=Wx::MOUSE_BTN_LEFT) end
|
43
|
+
|
44
|
+
# Click a mouse button.
|
45
|
+
# @param button [Integer] Button to press. See {Wx::UIActionSimulator#mouse_down} for a list of valid constants.
|
46
|
+
# @return [true,false]
|
47
|
+
def mouse_click(button=Wx::MOUSE_BTN_LEFT) end
|
48
|
+
|
49
|
+
# Double-click a mouse button.
|
50
|
+
# @param button [Integer] Button to press. See {Wx::UIActionSimulator#mouse_down} for a list of valid constants.
|
51
|
+
# @return [true,false]
|
52
|
+
def mouse_dbl_click(button=Wx::MOUSE_BTN_LEFT) end
|
53
|
+
|
54
|
+
# Perform a drag and drop operation.
|
55
|
+
# @param x1 [Integer] x start coordinate, in screen coordinates.
|
56
|
+
# @param y1 [Integer] y start coordinate, in screen coordinates.
|
57
|
+
# @param x2 [Integer] x destination coordinate, in screen coordinates.
|
58
|
+
# @param y2 [Integer] y destination coordinate, in screen coordinates.
|
59
|
+
# @param button [Integer] Button to press. See {Wx::UIActionSimulator#mouse_down} for a list of valid constants.
|
60
|
+
# @return [true,false]
|
61
|
+
def mouse_drag_drop(x1, y1, x2, y2, button=Wx::MOUSE_BTN_LEFT) end
|
62
|
+
|
63
|
+
# Press a key.
|
64
|
+
# If you are using modifiers then it needs to be paired with an identical KeyUp or the modifiers will not be released (MSW and macOS).
|
65
|
+
# @param keycode [Integer] Key to operate on, as an integer. It is interpreted as a {Wx::KeyCode}.
|
66
|
+
# @param modifiers [Integer] A combination of {Wx::KeyModifier} flags to be pressed with the given keycode.
|
67
|
+
# @return [true,false]
|
68
|
+
def key_down(keycode, modifiers=Wx::KeyModifier::MOD_NONE) end
|
69
|
+
|
70
|
+
# Release a key.
|
71
|
+
# @param keycode [Integer] Key to operate on, as an integer. It is interpreted as a {Wx::KeyCode}.
|
72
|
+
# @param modifiers [Integer] A combination of {Wx::KeyModifier} flags to be pressed with the given keycode.
|
73
|
+
# @return [true,false]
|
74
|
+
def key_up(keycode, modifiers=Wx::KeyModifier::MOD_NONE) end
|
75
|
+
|
76
|
+
# Press and release a key.
|
77
|
+
# @param keycode [Integer] Key to operate on, as an integer. It is interpreted as a {Wx::KeyCode}.
|
78
|
+
# @param modifiers [Integer] A combination of {Wx::KeyModifier} flags to be pressed with the given keycode.
|
79
|
+
# @return [true,false]
|
80
|
+
def char(keycode, modifiers=Wx::KeyModifier::MOD_NONE) end
|
81
|
+
|
82
|
+
# Simulate selection of an item with the given text.
|
83
|
+
# This method selects an item in the currently focused {Wx::Choice}, {Wx::ComboBox}, {Wx::ListBox} and similar controls. It does it by simulating keyboard events, so the behaviour should be the same as if the item was really selected by the user.
|
84
|
+
# Notice that the implementation of this method uses {yield} and so events can be dispatched from it.
|
85
|
+
#
|
86
|
+
# true if the item text was successfully selected or false if the currently focused window is not one of the controls allowing item selection or if the item with the given text was not found in it.
|
87
|
+
# @param text [String] The text of the item to select.
|
88
|
+
# @return [true,false]
|
89
|
+
def select(text) end
|
90
|
+
|
91
|
+
# Emulate typing in the keys representing the given string.
|
92
|
+
# Currently only the ASCII letters are universally supported. Digits and punctuation characters can be used with the standard QWERTY (US) keyboard layout but may not work with other layouts.
|
93
|
+
# @param text [String] The string, containing only US ASCII characters, to type.
|
94
|
+
# @return [true,false]
|
95
|
+
def text(text) end
|
96
|
+
|
97
|
+
end # UIActionSimulator
|
98
|
+
|
99
|
+
|
100
|
+
end
|
data/lib/wx/doc/gen/utils.rb
CHANGED
@@ -50,7 +50,7 @@ module Wx
|
|
50
50
|
# For normal keys, returns true if the specified key is currently down.
|
51
51
|
# For togglable keys (Caps Lock, Num Lock and Scroll Lock), returns true if the key is toggled such that its LED indicator is lit. There is currently no way to test whether togglable keys are up or down.
|
52
52
|
# Even though there are virtual key codes defined for mouse buttons, they cannot be used with this function currently.
|
53
|
-
# In {Wx::GTK}, this function can be only used with modifier keys (
|
53
|
+
# In {Wx::GTK}, this function can be only used with modifier keys ({Wx::K_ALT}, {Wx::K_CONTROL} and {Wx::K_SHIFT}) when not using X11 backend currently.
|
54
54
|
# @param key [KeyCode]
|
55
55
|
# @return [true,false]
|
56
56
|
def self.get_key_state(key) end
|
@@ -71,24 +71,6 @@ module Wx
|
|
71
71
|
# @return [true,false]
|
72
72
|
def deselect_all; end
|
73
73
|
|
74
|
-
# Returns the index of the first selected item in the listbox or {Wx::NOT_FOUND} if no items are currently selected.
|
75
|
-
# cookie is an opaque parameter which should be passed to the subsequent calls to {Wx::VListBox#get_next_selected}. It is needed in order to allow parallel iterations over the selected items.
|
76
|
-
# Here is a typical example of using these functions:
|
77
|
-
#
|
78
|
-
# unsigned long cookie;
|
79
|
-
# int item = hlbox->GetFirstSelected(cookie);
|
80
|
-
# while ( item != wxNOT_FOUND )
|
81
|
-
# {
|
82
|
-
# // ... process item ...
|
83
|
-
# item = hlbox->GetNextSelected(cookie);
|
84
|
-
# }
|
85
|
-
#
|
86
|
-
# This method is only valid for multi selection listboxes.
|
87
|
-
# @param cookie [unsigned long]
|
88
|
-
# @return [Integer]
|
89
|
-
def get_first_selected(cookie) end
|
90
|
-
alias_method :first_selected, :get_first_selected
|
91
|
-
|
92
74
|
# Get the number of items in the control.
|
93
75
|
#
|
94
76
|
# @see Wx::VListBox#set_item_count
|
@@ -110,14 +92,6 @@ module Wx
|
|
110
92
|
def get_item_rect(item) end
|
111
93
|
alias_method :item_rect, :get_item_rect
|
112
94
|
|
113
|
-
# Returns the index of the next selected item or {Wx::NOT_FOUND} if there are no more.
|
114
|
-
# This method is only valid for multi selection listboxes.
|
115
|
-
# @see Wx::VListBox#get_first_selected
|
116
|
-
# @param cookie [unsigned long]
|
117
|
-
# @return [Integer]
|
118
|
-
def get_next_selected(cookie) end
|
119
|
-
alias_method :next_selected, :get_next_selected
|
120
|
-
|
121
95
|
# Returns the number of the items currently selected.
|
122
96
|
# It is valid for both single and multi selection controls. In the former case it may only return 0 or 1 however.
|
123
97
|
# @see Wx::VListBox#is_selected
|
@@ -218,6 +192,42 @@ module Wx
|
|
218
192
|
# @return [void]
|
219
193
|
def toggle(item) end
|
220
194
|
|
195
|
+
|
196
|
+
protected
|
197
|
+
|
198
|
+
# The derived class must implement this function to actually draw the item with the given index on the provided DC.
|
199
|
+
# TodoChange this function signature to non-const.
|
200
|
+
# @param dc [Wx::DC] The device context to use for drawing.
|
201
|
+
# @param rect [Wx::Rect] The bounding rectangle for the item being drawn (DC clipping region is set to this rectangle before calling this function).
|
202
|
+
# @param n [Integer] The index of the item to be drawn.
|
203
|
+
# @return [void]
|
204
|
+
def on_draw_item(dc, rect, n) end
|
205
|
+
|
206
|
+
# This method is used to draw the item's background and, maybe, a border around it.
|
207
|
+
# The base class version implements a reasonable default behaviour which consists in drawing the selected item with the standard background colour and drawing a border around the item if it is either selected or current.
|
208
|
+
# TodoChange this function signature to non-const.
|
209
|
+
# @param dc [Wx::DC]
|
210
|
+
# @param rect [Wx::Rect]
|
211
|
+
# @param n [Integer]
|
212
|
+
# @return [void]
|
213
|
+
def on_draw_background(dc, rect, n) end
|
214
|
+
|
215
|
+
# This method may be used to draw separators between the lines.
|
216
|
+
# The rectangle passed to it may be modified, typically to deflate it a bit before passing to {Wx::VListBox#on_draw_item}.
|
217
|
+
# The base class version of this method doesn't do anything.
|
218
|
+
#
|
219
|
+
# TodoChange this function signature to non-const.
|
220
|
+
# @param dc [Wx::DC] The device context to use for drawing.
|
221
|
+
# @param rect [Wx::Rect] The bounding rectangle for the item.
|
222
|
+
# @param n [Integer] The index of the item.
|
223
|
+
# @return [void]
|
224
|
+
def on_draw_separator(dc, rect, n) end
|
225
|
+
|
226
|
+
# The derived class must implement this method to return the height of the specified item (in pixels).
|
227
|
+
# @param n [Integer]
|
228
|
+
# @return [Integer]
|
229
|
+
def on_measure_item(n) end
|
230
|
+
|
221
231
|
end # VListBox
|
222
232
|
|
223
233
|
|
data/lib/wx/doc/gen/validator.rb
CHANGED
@@ -43,9 +43,10 @@ module Wx
|
|
43
43
|
# Associates a window with the validator.
|
44
44
|
# This function is automatically called by wxWidgets when creating a {Wx::Window}-derived class instance which takes a {Wx::Validator} reference. Since wxWidgets 3.1.1, it can be overridden in custom validators in order to perform any one-time initialization or checks of the window when the validator is associated with it.
|
45
45
|
# E.g.
|
46
|
-
#
|
46
|
+
# ```
|
47
47
|
# new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0,
|
48
48
|
# wxTextValidator(wxFILTER_ALPHA, &g_data.m_string));
|
49
|
+
# ```
|
49
50
|
# will automatically link the {Wx::TextValidator} instance with the {Wx::TextCtrl} instance and call {Wx::Validator#set_window} method on the {Wx::TextValidator} object.
|
50
51
|
# @param window [Wx::Window]
|
51
52
|
# @return [void]
|
data/lib/wx/doc/gen/variant.rb
CHANGED
@@ -17,6 +17,7 @@ module Wx
|
|
17
17
|
# An optional name member is associated with a {Wx::Variant}. This might be used, for example, in CORBA or OLE automation classes, where named parameters are required.
|
18
18
|
# Note that as of wxWidgets 2.7.1, {Wx::Variant} is reference counted. Additionally, the convenience macros DECLARE_VARIANT_OBJECT() and IMPLEMENT_VARIANT_OBJECT() were added so that adding (limited) support for conversion to and from {Wx::Variant} can be very easily implemented without modifying either {Wx::Variant} or the class to be stored by {Wx::Variant}. Since assignment operators cannot be declared outside the class, the shift left operators are used like this:
|
19
19
|
#
|
20
|
+
# ```
|
20
21
|
# // in the header file
|
21
22
|
# DECLARE_VARIANT_OBJECT(MyClass)
|
22
23
|
#
|
@@ -30,13 +31,16 @@ module Wx
|
|
30
31
|
#
|
31
32
|
# // or
|
32
33
|
# value << variant;
|
34
|
+
# ```
|
33
35
|
#
|
34
36
|
# For this to work, MyClass must derive from {Wx::Object}, implement the wxWidgets RTTI system and support the assignment operator and equality operator for itself. Ideally, it should also be reference counted to make copying operations cheap and fast. This can be most easily implemented using the reference counting support offered by {Wx::Object} itself. By default, wxWidgets already implements the shift operator conversion for a few of its drawing related classes:
|
35
37
|
#
|
38
|
+
# ```
|
36
39
|
# IMPLEMENT_VARIANT_OBJECT(wxColour)
|
37
40
|
# IMPLEMENT_VARIANT_OBJECT(wxImage)
|
38
41
|
# IMPLEMENT_VARIANT_OBJECT(wxIcon)
|
39
42
|
# IMPLEMENT_VARIANT_OBJECT(wxBitmap)
|
43
|
+
# ```
|
40
44
|
#
|
41
45
|
# Note that as of wxWidgets 2.9.0, {Wx::VariantData} no longer inherits from {Wx::Object} and {Wx::Variant} no longer uses the type-unsafe {Wx::List} class for list operations but the type-safe {Wx::VariantList} class. Also, {Wx::VariantData} now supports the Wx::VariantData#clone function for implementing the {Wx::Variant#unshare} function. Wx::VariantData#clone is implemented automatically by IMPLEMENT_VARIANT_OBJECT().
|
42
46
|
# Since {Wx::VariantData} no longer derives from {Wx::Object}, any code that tests the type of the data using {dynamic_cast} will require adjustment. You can use the macro {dynamic_cast_variant_data} with the same arguments as {dynamic_cast}, to use C++ RTTI type information instead of wxWidgets RTTI.
|
@@ -46,6 +50,7 @@ module Wx
|
|
46
50
|
# {Wx::GRID::GridCellAttr::AttrKind::Any} is a more modern, template-based variant class. It is not directly compatible with {Wx::Variant}, but there is a transparent conversion layer.
|
47
51
|
# Following is an example how to use these conversions with {Wx::PG::PropertyGrid}'s property class {Wx::PG::PGProperty} (which currently uses {Wx::Variants} both internally and in the public API):
|
48
52
|
#
|
53
|
+
# ```
|
49
54
|
# // Get property value as wxAny instead of wxVariant
|
50
55
|
# wxAny value = property->GetValue();
|
51
56
|
#
|
@@ -55,6 +60,7 @@ module Wx
|
|
55
60
|
# // Write back new value to property
|
56
61
|
# value = "New Value";
|
57
62
|
# property->SetValue(value);
|
63
|
+
# ```
|
58
64
|
#
|
59
65
|
# Some caveats:
|
60
66
|
# - In {Wx::GRID::GridCellAttr::AttrKind::Any}, there are no separate types for handling integers of different sizes, so converting {Wx::GRID::GridCellAttr::AttrKind::Any} with 'long long' value will yield {Wx::Variant} of "long" type when the value is small enough to fit in without overflow. Otherwise, variant type "longlong" is used. Also note that {Wx::GRID::GridCellAttr::AttrKind::Any} holding unsigned integer will always be converted to "ulonglong" {Wx::Variant} type.
|
@@ -65,6 +71,7 @@ module Wx
|
|
65
71
|
#
|
66
72
|
# Supplied conversion functions will automatically work with all built-in {Wx::Variant} types, and also with all user-specified types generated using IMPLEMENT_VARIANT_OBJECT(). For hand-built {Wx::VariantData} classes, you will need to use supplied macros in a following manner:
|
67
73
|
#
|
74
|
+
# ```
|
68
75
|
# // Declare wxVariantData for data type Foo
|
69
76
|
# class wxVariantDataFoo: public wxVariantData
|
70
77
|
# {
|
@@ -79,6 +86,7 @@ module Wx
|
|
79
86
|
# };
|
80
87
|
#
|
81
88
|
# IMPLEMENT_TRIVIAL_WXANY_CONVERSION(Foo, wxVariantDataFoo)
|
89
|
+
# ```
|
82
90
|
#
|
83
91
|
# ===
|
84
92
|
#
|
@@ -87,6 +95,8 @@ module Wx
|
|
87
95
|
# @see Wx::GRID::GridCellAttr::AttrKind::Any
|
88
96
|
#
|
89
97
|
#
|
98
|
+
#
|
99
|
+
# @note This class is <b>untracked</b> and should not be derived from nor instances extended!
|
90
100
|
class Variant < Object
|
91
101
|
|
92
102
|
# Appends a value to the list.
|