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
data/lib/wx/doc/gen/events.rb
CHANGED
@@ -574,13 +574,17 @@ module Wx
|
|
574
574
|
# The return value is a combination of {Wx::KeyModifier::MOD_ALT}, {Wx::KeyModifier::MOD_CONTROL}, {Wx::KeyModifier::MOD_SHIFT} and {Wx::KeyModifier::MOD_META} bit masks. Additionally, {Wx::KeyModifier::MOD_NONE} is defined as 0, i.e. corresponds to no modifiers (see {Wx::MouseEvent#has_any_modifiers}) and {Wx::KeyModifier::MOD_CMD} is either {Wx::KeyModifier::MOD_CONTROL} (MSW and Unix) or {Wx::KeyModifier::MOD_META} (Mac), see {Wx::MouseEvent#cmd_down}. See {Wx::KeyModifier} for the full list of modifiers.
|
575
575
|
# Notice that this function is easier to use correctly than, for example, {Wx::MouseEvent#control_down} because when using the latter you also have to remember to test that none of the other modifiers is pressed:
|
576
576
|
#
|
577
|
-
#
|
578
|
-
#
|
577
|
+
# ```ruby
|
578
|
+
# if event.control_down && !event.alt_down && !event.shift_down && !event.meta_down
|
579
|
+
# # ... handle Ctrl-XXX ...
|
580
|
+
# ```
|
579
581
|
#
|
580
582
|
# and forgetting to do it can result in serious program bugs (e.g. program not working with European keyboard layout where AltGr key which is seen by the program as combination of CTRL and ALT is used). On the other hand, you can simply write:
|
581
583
|
#
|
582
|
-
#
|
583
|
-
#
|
584
|
+
# ```ruby
|
585
|
+
# if event.get_modifiers == Wx::KeyModifier::MOD_CONTROL
|
586
|
+
# # ... handle Ctrl-XXX ...
|
587
|
+
# ```
|
584
588
|
#
|
585
589
|
# with this function.
|
586
590
|
# @return [Integer]
|
@@ -681,7 +685,7 @@ module Wx
|
|
681
685
|
def initialize(x=0, y=0) end
|
682
686
|
|
683
687
|
# Returns a reference to the cursor specified by this event.
|
684
|
-
# @return [
|
688
|
+
# @return [Wx::Cursor]
|
685
689
|
def get_cursor; end
|
686
690
|
alias_method :cursor, :get_cursor
|
687
691
|
|
@@ -925,18 +929,18 @@ module Wx
|
|
925
929
|
end # PressAndTapEvent
|
926
930
|
|
927
931
|
# This event class contains information about key press and release events.
|
928
|
-
# The main information carried by this event is the key being pressed or released. It can be accessed using one of {Wx::KeyEvent#get_unicode_key}, {Wx::KeyEvent#get_key_code} or {Wx::KeyEvent#get_raw_key_code} functions. For the printable characters, {Wx::KeyEvent#get_unicode_key} should be used as it works for any keys, including non-Latin-1 characters that can be entered when using national keyboard layouts. {Wx::KeyEvent#get_key_code} should be used to handle special characters (such as cursor arrows keys or HOME or INS and so on) which correspond to {Wx::KeyCode} enum elements above the
|
932
|
+
# The main information carried by this event is the key being pressed or released. It can be accessed using one of {Wx::KeyEvent#get_unicode_key}, {Wx::KeyEvent#get_key_code} or {Wx::KeyEvent#get_raw_key_code} functions. For the printable characters, {Wx::KeyEvent#get_unicode_key} should be used as it works for any keys, including non-Latin-1 characters that can be entered when using national keyboard layouts. {Wx::KeyEvent#get_key_code} should be used to handle special characters (such as cursor arrows keys or HOME or INS and so on) which correspond to {Wx::KeyCode} enum elements above the {Wx::K_START} constant. While {Wx::KeyEvent#get_key_code} also returns the character code for Latin-1 keys for compatibility, it doesn't work for Unicode characters in general and will return {Wx::K_NONE} for any non-Latin-1 ones. If both {Wx::KeyEvent#get_unicode_key} and {Wx::KeyEvent#get_key_code} return {Wx::K_NONE} then the key has no WXK_xxx mapping and {Wx::KeyEvent#get_raw_key_code} can be used to distinguish between keys, but raw key codes are platform specific. For these reasons, it is recommended to always use {Wx::KeyEvent#get_unicode_key} and only fall back to {Wx::KeyEvent#get_key_code} if {Wx::KeyEvent#get_unicode_key} returned {Wx::K_NONE}, meaning that the event corresponds to a non-printable special keys, then optionally check {Wx::KeyEvent#get_raw_key_code} if {Wx::KeyEvent#get_key_code} also returned {Wx::K_NONE} or simply ignore that key.
|
929
933
|
# While these three functions can be used with the events of {Wx::EVT_KEY_DOWN}, {Wx::EVT_KEY_UP} and {Wx::EVT_CHAR} types, the values returned by them are different for the first two events and the last one. For the latter, the key returned corresponds to the character that would appear in e.g. a text zone if the user pressed the key in it. As such, its value depends on the current state of the Shift key and, for the letters, on the state of Caps Lock modifier. For example, if A key is pressed without Shift being held down, {Wx::KeyEvent} of type {Wx::EVT_CHAR} generated for this key press will return (from either {Wx::KeyEvent#get_key_code} or {Wx::KeyEvent#get_unicode_key} as their meanings coincide for ASCII characters) key code of 97 corresponding the ASCII value of a. And if the same key is pressed but with Shift being held (or Caps Lock being active), then the key could would be 65, i.e. ASCII value of capital A.
|
930
934
|
# However for the key down and up events the returned key code will instead be A independently of the state of the modifier keys i.e. it depends only on physical key being pressed and is not translated to its logical representation using the current keyboard state. Such untranslated key codes are defined as follows:
|
931
935
|
# - For the letters they correspond to the upper case value of the letter.- For the other alphanumeric keys (e.g. 7 or <code>+</code>), the untranslated key code corresponds to the character produced by the key when it is pressed without Shift. E.g. in standard US keyboard layout the untranslated key code for the key <code>=/+</code> in the upper right corner of the keyboard is 61 which is the ASCII value of <code>=</code>.- For the rest of the keys (i.e. special non-printable keys) it is the same as the normal key code as no translation is used anyhow.
|
932
936
|
#
|
933
|
-
# Notice that the first rule applies to all Unicode letters, not just the usual Latin-1 ones. However for non-Latin-1 letters only {Wx::KeyEvent#get_unicode_key} can be used to retrieve the key code as {Wx::KeyEvent#get_key_code} just returns
|
937
|
+
# Notice that the first rule applies to all Unicode letters, not just the usual Latin-1 ones. However for non-Latin-1 letters only {Wx::KeyEvent#get_unicode_key} can be used to retrieve the key code as {Wx::KeyEvent#get_key_code} just returns {Wx::K_NONE} in this case.
|
934
938
|
# Also, note that {Wx::EVT_CHAR} events are not generated for keys which do not have a wxWidgets mapping, so {Wx::KeyEvent#get_raw_key_code} should never be required for this event.
|
935
939
|
# To summarize: you should handle {Wx::EVT_CHAR} if you need the translated key and {Wx::EVT_KEY_DOWN} if you only need the value of the key itself, independent of the current keyboard state.
|
936
940
|
# Not all key down events may be generated by the user. As an example, {Wx::EVT_KEY_DOWN} with <code>=</code> key code can be generated using the standard US keyboard layout but not using the German one because the <code>=</code> key corresponds to Shift-0 key combination in this layout and the key code for it is 0, not <code>=</code>. Because of this you should avoid requiring your users to type key events that might be impossible to enter on their keyboard.
|
937
941
|
#
|
938
|
-
# Another difference between key and char events is that another kind of translation is done for the latter ones when the Control key is pressed: char events for ASCII letters in this case carry codes corresponding to the ASCII value of Ctrl-Latter, i.e. 1 for Ctrl-A, 2 for Ctrl-B and so on until 26 for Ctrl-Z. This is convenient for terminal-like applications and can be completely ignored by all the other ones (if you need to handle Ctrl-A it is probably a better idea to use the key event rather than the char one). Notice that currently no translation is done for the presses of <code></code>[, <code>\</code>, <code></code>], <code>^</code> and _ keys which might be mapped to ASCII values from 27 to 31. Since version 2.9.2, the enum values
|
939
|
-
# Finally, modifier keys only generate key events but no char events at all. The modifiers keys are
|
942
|
+
# Another difference between key and char events is that another kind of translation is done for the latter ones when the Control key is pressed: char events for ASCII letters in this case carry codes corresponding to the ASCII value of Ctrl-Latter, i.e. 1 for Ctrl-A, 2 for Ctrl-B and so on until 26 for Ctrl-Z. This is convenient for terminal-like applications and can be completely ignored by all the other ones (if you need to handle Ctrl-A it is probably a better idea to use the key event rather than the char one). Notice that currently no translation is done for the presses of <code></code>[, <code>\</code>, <code></code>], <code>^</code> and _ keys which might be mapped to ASCII values from 27 to 31. Since version 2.9.2, the enum values {Wx::K_CONTROL}_A - {Wx::K_CONTROL}_Z can be used instead of the non-descriptive constant values 1-26.
|
943
|
+
# Finally, modifier keys only generate key events but no char events at all. The modifiers keys are {Wx::K_SHIFT}, {Wx::K_CONTROL}, {Wx::K_ALT} and various {Wx::K_WINDOWS}_XXX from {Wx::KeyCode} enum.
|
940
944
|
# Modifier keys events are special in one additional aspect: usually the keyboard state associated with a key press is well defined, e.g. {Wx::KeyboardState#shift_down} returns true only if the Shift key was held pressed when the key that generated this event itself was pressed. There is an ambiguity for the key press events for Shift key itself however. By convention, it is considered to be already pressed when it is pressed and already released when it is released. In other words, {Wx::EVT_KEY_DOWN} event for the Shift key itself will have {Wx::KeyModifier::MOD_SHIFT} in {Wx::KeyEvent#get_modifiers} and {Wx::KeyEvent#shift_down} will return true while the {Wx::EVT_KEY_UP} event for Shift itself will not have {Wx::KeyModifier::MOD_SHIFT} in its modifiers and {Wx::KeyEvent#shift_down} will return false.
|
941
945
|
# <b>Tip:</b> You may discover the key codes and modifiers generated by all the keys on your system interactively by running the Key Event Sample wxWidgets sample and pressing some keys in it.
|
942
946
|
# If a key down (EVT_KEY_DOWN) event is caught and the event handler does not call <code>event.Skip()</code> then the corresponding char event (EVT_CHAR) will not happen. This is by design and enables the programs that handle both types of events to avoid processing the same key twice. As a consequence, if you do not want to suppress the {Wx::EVT_CHAR} events for the keys you handle, always call <code>event.Skip()</code> in your {Wx::EVT_KEY_DOWN} handler. Not doing may also prevent accelerators defined using this key from working.
|
@@ -976,44 +980,34 @@ module Wx
|
|
976
980
|
def initialize(keyEventType=Wx::EVT_NULL) end
|
977
981
|
|
978
982
|
# Returns the key code of the key that generated this event.
|
979
|
-
# ASCII symbols return normal ASCII values, while events from special keys such as "left cursor arrow" (
|
980
|
-
# Note that this method returns a meaningful value only for special non-alphanumeric keys or if the user entered a Latin-1 character (this includes ASCII and the accented letters found in Western European languages but not letters of other alphabets such as e.g. Cyrillic). Otherwise it simply method returns
|
981
|
-
# Using {Wx::KeyEvent#get_unicode_key} is in general the right thing to do if you are interested in the characters typed by the user, {Wx::KeyEvent#get_key_code} should be only used for special keys (for which {Wx::KeyEvent#get_unicode_key} returns
|
983
|
+
# ASCII symbols return normal ASCII values, while events from special keys such as "left cursor arrow" ({Wx::K_LEFT}) return values outside of the ASCII range. See {Wx::KeyCode} for a full list of the virtual key codes.
|
984
|
+
# Note that this method returns a meaningful value only for special non-alphanumeric keys or if the user entered a Latin-1 character (this includes ASCII and the accented letters found in Western European languages but not letters of other alphabets such as e.g. Cyrillic). Otherwise it simply method returns {Wx::K_NONE} and {Wx::KeyEvent#get_unicode_key} should be used to obtain the corresponding Unicode character.
|
985
|
+
# Using {Wx::KeyEvent#get_unicode_key} is in general the right thing to do if you are interested in the characters typed by the user, {Wx::KeyEvent#get_key_code} should be only used for special keys (for which {Wx::KeyEvent#get_unicode_key} returns nil). To handle both kinds of keys you might write:
|
986
|
+
# ```ruby
|
987
|
+
# def on_char(event)
|
988
|
+
# uc = event.get_unicode_key
|
989
|
+
# if uc
|
990
|
+
# # It's a "normal" character. Notice that this includes
|
991
|
+
# # control characters in 1..31 range, e.g. Wx::K_RETURN or
|
992
|
+
# # Wx::K_BACK, so check for them explicitly.
|
993
|
+
# if uc.ord >= 32
|
994
|
+
# Wx.log_message("You pressed '#{uc}'")
|
995
|
+
# else
|
996
|
+
# # It's a control character
|
997
|
+
# ...
|
998
|
+
# end
|
999
|
+
# else # No Unicode equivalent.
|
1000
|
+
# # It's a special key, deal with all the known ones:
|
1001
|
+
# case event.get_key_code
|
1002
|
+
# when Wx::K_LEFT, Wx::K_RIGHT
|
1003
|
+
# ... move cursor ...
|
982
1004
|
#
|
983
|
-
#
|
984
|
-
#
|
985
|
-
#
|
986
|
-
#
|
987
|
-
#
|
988
|
-
#
|
989
|
-
# // control characters in 1..31 range, e.g. WXK_RETURN or
|
990
|
-
# // WXK_BACK, so check for them explicitly.
|
991
|
-
# if ( uc >= 32 )
|
992
|
-
# {
|
993
|
-
# wxLogMessage("You pressed '%c'", uc);
|
994
|
-
# }
|
995
|
-
# else
|
996
|
-
# {
|
997
|
-
# // It's a control character
|
998
|
-
# ...
|
999
|
-
# }
|
1000
|
-
# }
|
1001
|
-
# else // No Unicode equivalent.
|
1002
|
-
# {
|
1003
|
-
# // It's a special key, deal with all the known ones:
|
1004
|
-
# switch ( event.GetKeyCode() )
|
1005
|
-
# {
|
1006
|
-
# case WXK_LEFT:
|
1007
|
-
# case WXK_RIGHT:
|
1008
|
-
# ... move cursor ...
|
1009
|
-
# break;
|
1010
|
-
#
|
1011
|
-
# case WXK_F1:
|
1012
|
-
# ... give help ...
|
1013
|
-
# break;
|
1014
|
-
# }
|
1015
|
-
# }
|
1016
|
-
# }
|
1005
|
+
# when Wx::K_F1:
|
1006
|
+
# ... give help ...
|
1007
|
+
# end
|
1008
|
+
# end
|
1009
|
+
# end
|
1010
|
+
# ```
|
1017
1011
|
# @return [Integer]
|
1018
1012
|
def get_key_code; end
|
1019
1013
|
alias_method :key_code, :get_key_code
|
@@ -1050,7 +1044,7 @@ module Wx
|
|
1050
1044
|
alias_method :raw_key_flags, :get_raw_key_flags
|
1051
1045
|
|
1052
1046
|
# Returns the Unicode character corresponding to this key event.
|
1053
|
-
# If the key pressed doesn't have any character value (e.g. a cursor key) this method will return
|
1047
|
+
# If the key pressed doesn't have any character value (e.g. a cursor key) this method will return nil. In this case you should use {Wx::KeyEvent#get_key_code} to retrieve the value of the key.
|
1054
1048
|
# This function is only available in Unicode build, i.e. when {Wx::Setup::USE_UNICODE} is 1.
|
1055
1049
|
# @return [String]
|
1056
1050
|
def get_unicode_key; end
|
@@ -1086,13 +1080,17 @@ module Wx
|
|
1086
1080
|
# The return value is a combination of {Wx::KeyModifier::MOD_ALT}, {Wx::KeyModifier::MOD_CONTROL}, {Wx::KeyModifier::MOD_SHIFT} and {Wx::KeyModifier::MOD_META} bit masks. Additionally, {Wx::KeyModifier::MOD_NONE} is defined as 0, i.e. corresponds to no modifiers (see {Wx::KeyEvent#has_any_modifiers}) and {Wx::KeyModifier::MOD_CMD} is either {Wx::KeyModifier::MOD_CONTROL} (MSW and Unix) or {Wx::KeyModifier::MOD_META} (Mac), see {Wx::KeyEvent#cmd_down}. See {Wx::KeyModifier} for the full list of modifiers.
|
1087
1081
|
# Notice that this function is easier to use correctly than, for example, {Wx::KeyEvent#control_down} because when using the latter you also have to remember to test that none of the other modifiers is pressed:
|
1088
1082
|
#
|
1089
|
-
#
|
1090
|
-
#
|
1083
|
+
# ```ruby
|
1084
|
+
# if event.control_down && !event.alt_down && !event.shift_down && !event.meta_down
|
1085
|
+
# # ... handle Ctrl-XXX ...
|
1086
|
+
# ```
|
1091
1087
|
#
|
1092
1088
|
# and forgetting to do it can result in serious program bugs (e.g. program not working with European keyboard layout where AltGr key which is seen by the program as combination of CTRL and ALT is used). On the other hand, you can simply write:
|
1093
1089
|
#
|
1094
|
-
#
|
1095
|
-
#
|
1090
|
+
# ```ruby
|
1091
|
+
# if event.get_modifiers == Wx::KeyModifier::MOD_CONTROL
|
1092
|
+
# # ... handle Ctrl-XXX ...
|
1093
|
+
# ```
|
1096
1094
|
#
|
1097
1095
|
# with this function.
|
1098
1096
|
# @return [Integer]
|
@@ -1273,45 +1271,38 @@ module Wx
|
|
1273
1271
|
|
1274
1272
|
# A paint event is sent when a window's contents needs to be repainted.
|
1275
1273
|
# The handler of this event must create a {Wx::PaintDC} object and use it for painting the window contents. For example:
|
1276
|
-
#
|
1277
|
-
#
|
1278
|
-
#
|
1279
|
-
#
|
1280
|
-
#
|
1281
|
-
#
|
1282
|
-
#
|
1274
|
+
# ```ruby
|
1275
|
+
# def on_paint(event)
|
1276
|
+
# self.pain do |dc|
|
1277
|
+
# draw_my_document(dc)
|
1278
|
+
# end
|
1279
|
+
# end
|
1280
|
+
# ```
|
1283
1281
|
#
|
1284
1282
|
# Notice that you must not create other kinds of {Wx::DC} (e.g. {Wx::ClientDC} or {Wx::WindowDC}) in EVT_PAINT handlers and also don't create {Wx::PaintDC} outside of this event handlers.
|
1285
1283
|
# You can optimize painting by retrieving the rectangles that have been damaged and only repainting these. The rectangles are in terms of the client area, and are unscrolled, so you will need to do some calculations using the current view position to obtain logical, scrolled units. Here is an example of using the {Wx::RegionIterator} class:
|
1286
|
-
#
|
1287
|
-
#
|
1288
|
-
#
|
1289
|
-
#
|
1290
|
-
#
|
1291
|
-
#
|
1292
|
-
#
|
1293
|
-
#
|
1294
|
-
#
|
1295
|
-
#
|
1296
|
-
#
|
1297
|
-
#
|
1298
|
-
#
|
1299
|
-
#
|
1300
|
-
#
|
1301
|
-
#
|
1302
|
-
#
|
1303
|
-
#
|
1304
|
-
#
|
1305
|
-
#
|
1306
|
-
#
|
1307
|
-
#
|
1308
|
-
#
|
1309
|
-
# // Repaint this rectangle
|
1310
|
-
# ...some code...
|
1311
|
-
#
|
1312
|
-
# upd ++ ;
|
1313
|
-
# }
|
1314
|
-
# }
|
1284
|
+
# ```ruby
|
1285
|
+
# # Called when window needs to be repainted.
|
1286
|
+
# def on_paint(event)
|
1287
|
+
# self.paint do |dc|
|
1288
|
+
# # Find Out where the window has scrolled to
|
1289
|
+
# vb_pt = get_view_start # Top left corner of client
|
1290
|
+
#
|
1291
|
+
# Wx::RegionIterator.for_region(get_update_region) do |region_it|
|
1292
|
+
#
|
1293
|
+
# int vX,vY,vW,vH
|
1294
|
+
# wxRegionIterator upd(GetUpdateRegion()) # get the update rect list
|
1295
|
+
#
|
1296
|
+
# region_it.each do |rct|
|
1297
|
+
# # rct == Dimensions of client area to repaint in pixels
|
1298
|
+
#
|
1299
|
+
# # Repaint this rectangle
|
1300
|
+
# ...some code...
|
1301
|
+
# end
|
1302
|
+
# end
|
1303
|
+
# end
|
1304
|
+
# end
|
1305
|
+
# ```
|
1315
1306
|
#
|
1316
1307
|
# Please notice that in general it is impossible to change the drawing of a standard control (such as {Wx::Button}) and so you shouldn't attempt to handle paint events for them as even if it might work on some platforms, this is inherently not portable and won't work everywhere.
|
1317
1308
|
#
|
@@ -1447,9 +1438,9 @@ module Wx
|
|
1447
1438
|
# @param eventType [Integer]
|
1448
1439
|
# @param active [true,false]
|
1449
1440
|
# @param id [Integer]
|
1450
|
-
# @param
|
1441
|
+
# @param activationReason [Reason]
|
1451
1442
|
# @return [ActivateEvent]
|
1452
|
-
def initialize(eventType=Wx::EVT_NULL, active=true, id=0,
|
1443
|
+
def initialize(eventType=Wx::EVT_NULL, active=true, id=0, activationReason=Wx::ActivateEvent::Reason::Reason_Unknown) end
|
1453
1444
|
|
1454
1445
|
# Returns true if the application or window is being activated, false otherwise.
|
1455
1446
|
# @return [true,false]
|
@@ -1549,22 +1540,21 @@ module Wx
|
|
1549
1540
|
# If you don't destroy the window, you should call {Wx::CloseEvent#veto} to let the calling code know that you did not destroy the window. This allows the {Wx::Window#close} function to return true or false depending on whether the close instruction was honoured or not.
|
1550
1541
|
# Example of a {Wx::CloseEvent} handler:
|
1551
1542
|
#
|
1552
|
-
#
|
1553
|
-
#
|
1554
|
-
#
|
1555
|
-
#
|
1556
|
-
#
|
1557
|
-
#
|
1558
|
-
#
|
1559
|
-
#
|
1560
|
-
#
|
1561
|
-
#
|
1562
|
-
# }
|
1563
|
-
# }
|
1543
|
+
# ```ruby
|
1544
|
+
# def on_close(event)
|
1545
|
+
# if event.can_veto? && @file_not_saved
|
1546
|
+
# if Wx.message_box("The file has not been saved... continue closing?",
|
1547
|
+
# "Please confirm",
|
1548
|
+
# Wx::ICON_QUESTION | Wx::YES_NO) != Wx::YES)
|
1549
|
+
# event.veto
|
1550
|
+
# return
|
1551
|
+
# end
|
1552
|
+
# end
|
1564
1553
|
#
|
1565
|
-
#
|
1566
|
-
#
|
1567
|
-
#
|
1554
|
+
# destroy # you may also do: event.skip
|
1555
|
+
# # since the default event handler does call #destroy too
|
1556
|
+
# end
|
1557
|
+
# ```
|
1568
1558
|
#
|
1569
1559
|
# See also <code>samples/dialogs</code> for a full example of interrupting closing an application when there are e.g. unsaved files.
|
1570
1560
|
# The EVT_END_SESSION event is slightly different as it is sent by the system when the user session is ending (e.g. because of log out or shutdown) and so all windows are being forcefully closed. At least under MSW, after the handler for this event is executed the program is simply killed by the system. Because of this, the default handler for this event provided by wxWidgets calls all the usual cleanup code (including {Wx::App#on_exit}) so that it could still be executed and exit()s the process itself, without waiting for being killed. If this behaviour is for some reason undesirable, make sure that you define a handler for this event in your {Wx::App}-derived class and do not call <code>event.Skip()</code> in it (but be aware that the system will still kill your application).
|
@@ -1796,8 +1786,9 @@ module Wx
|
|
1796
1786
|
|
1797
1787
|
# Returns the identifier of the button changing state.
|
1798
1788
|
# The return value is
|
1799
|
-
#
|
1789
|
+
# ```
|
1800
1790
|
# 1 << n
|
1791
|
+
# ```
|
1801
1792
|
# where n is the index of the button changing state, which can also be retrieved using {Wx::JoystickEvent#get_button_ordinal}.
|
1802
1793
|
# Note that for n equal to 1, 2, 3 or 4 there are predefined {Wx::JOY_BUTTONn} constants which can be used for more clarity, however these constants are not defined for the buttons beyond the first four.
|
1803
1794
|
# @return [Integer]
|
@@ -1949,13 +1940,13 @@ module Wx
|
|
1949
1940
|
|
1950
1941
|
# Returns true if the UI element can be checked.
|
1951
1942
|
# For the event handlers that can be used for multiple items, not all of which can be checked, this method can be useful to determine whether to call {Wx::UpdateUIEvent#check} on the event object or not, i.e. the main use case for this method is:
|
1952
|
-
#
|
1953
|
-
#
|
1954
|
-
#
|
1955
|
-
#
|
1956
|
-
#
|
1957
|
-
#
|
1958
|
-
#
|
1943
|
+
# ```ruby
|
1944
|
+
# def on_update_ui(event)
|
1945
|
+
# ....
|
1946
|
+
# if event.is_checkable
|
1947
|
+
# event.check(...some condition...)
|
1948
|
+
# end
|
1949
|
+
# ```
|
1959
1950
|
# @return [true,false]
|
1960
1951
|
def is_checkable; end
|
1961
1952
|
alias_method :checkable?, :is_checkable
|
@@ -21,30 +21,7 @@ module Wx
|
|
21
21
|
|
22
22
|
# Queue event for a later processing.
|
23
23
|
# This method is similar to {Wx::EvtHandler#process_event} but while the latter is synchronous, i.e. the event is processed immediately, before the function returns, this one is asynchronous and returns immediately while the event will be processed at some later time (usually during the next event loop iteration).
|
24
|
-
# Another important difference is that this method takes ownership of the event parameter, i.e. it will delete it itself. This implies that the
|
25
|
-
# {Wx::EvtHandler#queue_event} can be used for inter-thread communication from the worker threads to the main thread, it is safe in the sense that it uses locking internally and avoids the problem mentioned in {Wx::EvtHandler#add_pending_event} documentation by ensuring that the event object is not used by the calling thread any more. Care should still be taken to avoid that some fields of this object are used by it, notably any {Wx::String} members of the event object must not be shallow copies of another {Wx::String} object as this would result in them still using the same string buffer behind the scenes. For example:
|
26
|
-
#
|
27
|
-
# void FunctionInAWorkerThread(const wxString& str)
|
28
|
-
# {
|
29
|
-
# wxCommandEvent* evt = new wxCommandEvent;
|
30
|
-
#
|
31
|
-
# // NOT evt->SetString(str) as this would be a shallow copy
|
32
|
-
# evt->SetString(str.c_str()); // make a deep copy
|
33
|
-
#
|
34
|
-
# wxTheApp->QueueEvent( evt );
|
35
|
-
# }
|
36
|
-
#
|
37
|
-
# Note that you can use {Wx::ThreadEvent} instead of {Wx::CommandEvent} to avoid this problem:
|
38
|
-
#
|
39
|
-
# void FunctionInAWorkerThread(const wxString& str)
|
40
|
-
# {
|
41
|
-
# wxThreadEvent evt;
|
42
|
-
# evt.SetString(str);
|
43
|
-
#
|
44
|
-
# // wxThreadEvent::Clone() makes sure that the internal wxString
|
45
|
-
# // member is not shared by other wxString instances:
|
46
|
-
# wxTheApp->QueueEvent( evt.Clone() );
|
47
|
-
# }
|
24
|
+
# Another important difference is that this method takes ownership of the event parameter, i.e. it will delete it itself. This implies that the pointer can't be used any more after the function returns (as it can be deleted at any moment).
|
48
25
|
#
|
49
26
|
# Finally notice that this method automatically wakes up the event loop if it is currently idle by calling {wake_up_idle} so there is no need to do it manually when using it.
|
50
27
|
# @param event [Wx::Event] A heap-allocated event to be queued, {Wx::EvtHandler#queue_event} takes ownership of it. This parameter shouldn't be NULL.
|
@@ -126,9 +103,10 @@ module Wx
|
|
126
103
|
|
127
104
|
# Sets the pointer to the next handler.
|
128
105
|
# See {Wx::EvtHandler#process_event} for more info about how the chains of event handlers are internally used. Also remember that {Wx::EvtHandler} uses double-linked lists and thus if you use this function, you should also call {Wx::EvtHandler#set_previous_handler} on the argument passed to this function:
|
129
|
-
#
|
130
|
-
# handlerA
|
131
|
-
# handlerB
|
106
|
+
# ```ruby
|
107
|
+
# handlerA.set_next_handler(handlerB)
|
108
|
+
# handlerB.set_previous_handler(handlerA)
|
109
|
+
# ```
|
132
110
|
# @see How Events are Processed
|
133
111
|
# @param handler [Wx::EvtHandler] The event handler to be set as the next handler. Cannot be NULL.
|
134
112
|
# @return [void]
|
@@ -159,13 +137,13 @@ module Wx
|
|
159
137
|
|
160
138
|
# Add an event filter whose FilterEvent() method will be called for each and every event processed by wxWidgets.
|
161
139
|
# The filters are called in LIFO order and {Wx::App} is registered as an event filter by default. The pointer must remain valid until it's removed with {Wx::EvtHandler.remove_filter} and is not deleted by {Wx::EvtHandler}.
|
162
|
-
# @param filter [Wx::EventFilter]
|
140
|
+
# @param filter [Wx::EventFilter,Wx::App]
|
163
141
|
# @return [void]
|
164
142
|
def self.add_filter(filter) end
|
165
143
|
|
166
144
|
# Remove a filter previously installed with {Wx::EvtHandler.add_filter}.
|
167
145
|
# It's an error to remove a filter that hadn't been previously added or was already removed.
|
168
|
-
# @param filter [Wx::EventFilter]
|
146
|
+
# @param filter [Wx::EventFilter,Wx::App]
|
169
147
|
# @return [void]
|
170
148
|
def self.remove_filter(filter) end
|
171
149
|
|
@@ -179,19 +157,18 @@ module Wx
|
|
179
157
|
# Method called by {Wx::EvtHandler#process_event} before examining this object event tables.
|
180
158
|
# This method can be overridden to hook into the event processing logic as early as possible. You should usually call the base class version when overriding this method, even if {Wx::EvtHandler} itself does nothing here, some derived classes do use this method, e.g. {Wx::Window} implements support for {Wx::Validator} in it.
|
181
159
|
# Example:
|
182
|
-
#
|
183
|
-
# class MyClass
|
184
|
-
# {
|
160
|
+
# ```ruby
|
161
|
+
# class MyClass < BaseClass # inheriting from Wx::EvtHandler
|
185
162
|
# ...
|
186
|
-
# protected
|
187
|
-
#
|
188
|
-
#
|
189
|
-
#
|
190
|
-
# return true;
|
163
|
+
# protected
|
164
|
+
# def try_before(event)
|
165
|
+
# if my_pre_process(event)
|
166
|
+
# return true
|
191
167
|
#
|
192
|
-
#
|
193
|
-
#
|
194
|
-
#
|
168
|
+
# super
|
169
|
+
# end
|
170
|
+
# end
|
171
|
+
# ```
|
195
172
|
# @see Wx::EvtHandler#process_event
|
196
173
|
# @param event [Wx::Event]
|
197
174
|
# @return [true,false]
|
@@ -200,19 +177,18 @@ module Wx
|
|
200
177
|
# Method called by {Wx::EvtHandler#process_event} as last resort.
|
201
178
|
# This method can be overridden to implement post-processing for the events which were not processed anywhere else.
|
202
179
|
# The base class version handles forwarding the unprocessed events to {Wx::App} at {Wx::EvtHandler} level and propagating them upwards the window child-parent chain at {Wx::Window} level and so should usually be called when overriding this method:
|
203
|
-
#
|
204
|
-
# class MyClass
|
205
|
-
# {
|
180
|
+
# ```ruby
|
181
|
+
# class MyClass < BaseClass # inheriting from Wx::EvtHandler
|
206
182
|
# ...
|
207
|
-
# protected
|
208
|
-
#
|
209
|
-
#
|
210
|
-
#
|
211
|
-
#
|
212
|
-
#
|
213
|
-
#
|
214
|
-
#
|
215
|
-
#
|
183
|
+
# protected
|
184
|
+
# def try_after(event)
|
185
|
+
# if super
|
186
|
+
# return true
|
187
|
+
#
|
188
|
+
# my_post_process(event)
|
189
|
+
# end
|
190
|
+
# end
|
191
|
+
# ```
|
216
192
|
# @see Wx::EvtHandler#process_event
|
217
193
|
# @param event [Wx::Event]
|
218
194
|
# @return [true,false]
|
@@ -52,7 +52,7 @@ module Wx
|
|
52
52
|
# This class represents the file chooser dialog.
|
53
53
|
# The path and filename are distinct elements of a full file pathname. If path is {Wx::EmptyString}, the current directory will be used. If filename is {Wx::EmptyString}, no default filename will be supplied. The wildcard determines what files are displayed in the file selector, and file extension supplies a type extension for the required filename.
|
54
54
|
# The typical usage for the open file dialog is:
|
55
|
-
#
|
55
|
+
# ```
|
56
56
|
# void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
|
57
57
|
# {
|
58
58
|
# if (...current content has not been saved...)
|
@@ -81,9 +81,10 @@ module Wx
|
|
81
81
|
#
|
82
82
|
# ...
|
83
83
|
# }
|
84
|
+
# ```
|
84
85
|
#
|
85
86
|
# The typical usage for the save file dialog is instead somewhat simpler:
|
86
|
-
#
|
87
|
+
# ```
|
87
88
|
# void MyFrame::OnSaveAs(wxCommandEvent& WXUNUSED(event))
|
88
89
|
# {
|
89
90
|
# wxFileDialog
|
@@ -104,16 +105,19 @@ module Wx
|
|
104
105
|
#
|
105
106
|
# ...
|
106
107
|
# }
|
108
|
+
# ```
|
107
109
|
#
|
108
110
|
# == Wildcard Filters
|
109
111
|
#
|
110
112
|
# All implementations of the {Wx::FileDialog} provide a wildcard filter. Typing a filename containing wildcards (*, ?) in the filename text item, and clicking on Ok, will result in only those files matching the pattern being displayed. The wildcard may be a specification for multiple types of file with a description for each, such as:
|
111
|
-
#
|
113
|
+
# ```
|
112
114
|
# "BMP and GIF files (*.bmp;*.gif)|*.bmp;*.gif|PNG files (*.png)|*.png"
|
115
|
+
# ```
|
113
116
|
#
|
114
117
|
# On Mac macOS in the open file dialog the filter choice box is not shown by default. Instead all given wildcards are applied at the same time: So in the above example all bmp, gif and png files are displayed. To enforce the display of the filter choice set the corresponding {Wx::SystemOptions} before calling the file open dialog:
|
115
|
-
#
|
118
|
+
# ```
|
116
119
|
# wxSystemOptions::SetOption(wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES, 1)
|
120
|
+
# ```
|
117
121
|
# But in contrast to Windows and Unix, where the file type choice filters only the selected files, on Mac macOS even in this case the dialog shows all files matching all file types. The files which does not match the currently selected file type are greyed out and are not selectable.
|
118
122
|
#
|
119
123
|
# == Dialog Customization
|
data/lib/wx/doc/gen/font.rb
CHANGED
@@ -657,6 +657,8 @@ module Wx
|
|
657
657
|
# @see Wx::SystemSettings
|
658
658
|
#
|
659
659
|
#
|
660
|
+
#
|
661
|
+
# @note This class is <b>untracked</b> and should not be derived from nor instances extended!
|
660
662
|
class Font < GDIObject
|
661
663
|
|
662
664
|
# Returns a font with the same face/size as the given one but with normal weight and style and not underlined nor stricken through.
|
@@ -1082,16 +1084,19 @@ module Wx
|
|
1082
1084
|
# Creates a font object using the specified font description.
|
1083
1085
|
# This is the preferred way to create font objects as using this ctor results in more readable code and it is also extensible, e.g. it could continue to be used if support for more font attributes is added in the future. For example, this constructor provides the only way of creating fonts with strike-through style.
|
1084
1086
|
# Example of creating a font using this ctor:
|
1085
|
-
#
|
1087
|
+
# ```
|
1086
1088
|
# wxFont font(wxFontInfo(10).Bold().Underlined());
|
1089
|
+
# ```
|
1087
1090
|
# @param fontInfo [Wx::FontInfo]
|
1088
1091
|
# @return [Font]
|
1089
1092
|
# @overload initialize(pointSize, family, style, weight, underline=false, faceName=(''), encoding=Wx::FontEncoding::FONTENCODING_DEFAULT)
|
1090
1093
|
# Creates a font object with the specified attributes and size in points.
|
1091
1094
|
# Notice that the use of this constructor is often more verbose and less readable than using wxFont(const wxFontInfo& font), e.g. the example in that constructor documentation would need to be written as:
|
1092
1095
|
#
|
1096
|
+
# ```
|
1093
1097
|
# wxFont font(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
|
1094
1098
|
# wxFONTWEIGHT_BOLD, true);
|
1099
|
+
# ```
|
1095
1100
|
#
|
1096
1101
|
# If the desired font does not exist, the closest match will be chosen. Under Windows, only scalable TrueType fonts are used.
|
1097
1102
|
# @param pointSize [Integer] Size in points. See {Wx::Font#set_point_size} for more info. Notice that, for historical reasons, the value 70 here is interpreted at {Wx::DEFAULT} and results in creation of the font with the default size and not of a font with the size of 70pt. If you really need the latter, please use SetPointSize(70). Note that this constructor and the matching Create() method overload are the only places in {Wx::Font} API handling {Wx::DEFAULT} specially: neither {Wx::Font#set_point_size} nor the constructor taking {Wx::FontInfo} handle this value in this way.
|
@@ -1155,12 +1160,15 @@ module Wx
|
|
1155
1160
|
|
1156
1161
|
# This class is a helper used for {Wx::Font} creation using named parameter idiom: it allows specifying various {Wx::Font} attributes using the chained calls to its clearly named methods instead of passing them in the fixed order to {Wx::Font} constructors.
|
1157
1162
|
# For example, to create an italic font with the given face name and size you could use:
|
1158
|
-
#
|
1163
|
+
# ```
|
1159
1164
|
# wxFont font(wxFontInfo(12).FaceName("Helvetica").Italic());
|
1165
|
+
# ```
|
1160
1166
|
#
|
1161
1167
|
# Notice that all of the methods of this object return a reference to the object itself, allowing the calls to them to be chained as in the example above.
|
1162
1168
|
# All methods taking boolean parameters can be used to turn the specified font attribute on or off and turn it on by default.
|
1163
1169
|
#
|
1170
|
+
#
|
1171
|
+
# @note This class is <b>untracked</b> and should not be derived from nor instances extended!
|
1164
1172
|
class FontInfo < ::Object
|
1165
1173
|
|
1166
1174
|
# @overload initialize()
|
data/lib/wx/doc/gen/font_data.rb
CHANGED
data/lib/wx/doc/gen/frame.rb
CHANGED
@@ -50,7 +50,9 @@ module Wx
|
|
50
50
|
#
|
51
51
|
# The default frame style is for normal, resizable frames. To create a frame which cannot be resized by user, you may use the following combination of styles:
|
52
52
|
#
|
53
|
+
# ```
|
53
54
|
# wxDEFAULT_FRAME_STYLE & ~(wxRESIZE_BORDER | wxMAXIMIZE_BOX)
|
55
|
+
# ```
|
54
56
|
#
|
55
57
|
# See also the Window Styles.
|
56
58
|
#
|
@@ -238,8 +240,6 @@ module Wx
|
|
238
240
|
|
239
241
|
# Sets the widths of the fields in the status bar.
|
240
242
|
# The widths of the variable fields are calculated from the total width of all fields, minus the sum of widths of the non-variable fields, divided by the number of variable fields.
|
241
|
-
#
|
242
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method takes the field widths as parameters.
|
243
243
|
# @param n [Integer] The number of fields in the status bar. It must be the same used in CreateStatusBar.
|
244
244
|
# @param widths_field [int] Must contain an array of n integers, each of which is a status field width in pixels. A value of -1 indicates that the field is variable width; at least one field must be -1. You should delete this array after calling {Wx::Frame#set_status_widths}.
|
245
245
|
# @return [void]
|
@@ -255,8 +255,9 @@ module Wx
|
|
255
255
|
# Returns a {Wx::TaskBarButton} pointer representing the taskbar button of the window under Windows 7 or later. The returned {Wx::TaskBarButton} may be used, if non-NULL, to access the functionality including thumbnail representations, thumbnail toolbars, notification and status overlays, and progress indicators.
|
256
256
|
# The returned pointer must not be deleted, it is owned by the frame and will be only deleted when the frame itself is destroyed.
|
257
257
|
# This function is not available in the other ports by design, any occurrences of it in the portable code must be guarded by
|
258
|
-
#
|
258
|
+
# ```
|
259
259
|
# #ifdef __WXMSW__
|
260
|
+
# ```
|
260
261
|
# preprocessor guards.
|
261
262
|
# @return [Wx::TaskBarButton]
|
262
263
|
def msw_get_task_bar_button; end
|
data/lib/wx/doc/gen/fs_file.rb
CHANGED
@@ -40,6 +40,7 @@ module Wx
|
|
40
40
|
# You probably won't use it. See the Note for details.
|
41
41
|
# It is seldom used by the application programmer but you will need it if you are writing your own virtual FS. For example you may need something similar to {Wx::MemoryInputStream}, but because {Wx::MemoryInputStream} doesn't free the memory when destroyed and thus passing a memory stream pointer into {Wx::FSFile} constructor would lead to memory leaks, you can write your own class derived from {Wx::FSFile}:
|
42
42
|
#
|
43
|
+
# ```
|
43
44
|
# class wxMyFSFile : public wxFSFile
|
44
45
|
# {
|
45
46
|
# private:
|
@@ -49,6 +50,7 @@ module Wx
|
|
49
50
|
# ~wxMyFSFile() {free(m_Mem);}
|
50
51
|
# // of course dtor is virtual ;-)
|
51
52
|
# };
|
53
|
+
# ```
|
52
54
|
#
|
53
55
|
# If you are not sure of the meaning of these params, see the description of the GetXXXX() functions.
|
54
56
|
# @param stream [IO] The input stream that will be used to access data
|
@@ -113,6 +115,8 @@ module Wx
|
|
113
115
|
# @see Wx::StreamBuffer
|
114
116
|
#
|
115
117
|
#
|
118
|
+
#
|
119
|
+
# @note This class is <b>untracked</b> and should not be derived from nor instances extended!
|
116
120
|
class StreamBase < ::Object
|
117
121
|
|
118
122
|
# Creates a dummy stream object.
|
@@ -166,6 +170,8 @@ module Wx
|
|
166
170
|
#
|
167
171
|
# Category: {Wx::Streams}
|
168
172
|
#
|
173
|
+
#
|
174
|
+
# @note This class is <b>untracked</b> and should not be derived from nor instances extended!
|
169
175
|
class InputStream < StreamBase
|
170
176
|
|
171
177
|
# Creates a dummy input stream.
|
@@ -230,6 +236,8 @@ module Wx
|
|
230
236
|
#
|
231
237
|
# Category: {Wx::Streams}
|
232
238
|
#
|
239
|
+
#
|
240
|
+
# @note This class is <b>untracked</b> and should not be derived from nor instances extended!
|
233
241
|
class OutputStream < StreamBase
|
234
242
|
|
235
243
|
# Creates a dummy {Wx::OutputStream} object.
|