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/image.rb
CHANGED
@@ -456,7 +456,7 @@ module Wx
|
|
456
456
|
# It should be noted that although using {Wx::ImageResizeQuality::IMAGE_QUALITY_HIGH} produces much nicer looking results it is a slower method. Downsampling will use the box averaging method which seems to operate very fast. If you are upsampling larger images using this method you will most likely notice that it is a bit slower and in extreme cases it will be quite substantially slower as the bicubic algorithm has to process a lot of data.
|
457
457
|
# It should also be noted that the high quality scaling may not work as expected when using a single mask colour for transparency, as the scaling will blur the image and will therefore remove the mask partially. Using the alpha channel will work.
|
458
458
|
# Example:
|
459
|
-
#
|
459
|
+
# ```
|
460
460
|
# // get the bitmap from somewhere
|
461
461
|
# wxBitmap bmp = ...;
|
462
462
|
#
|
@@ -470,6 +470,7 @@ module Wx
|
|
470
470
|
# image.Rescale(32, 32);
|
471
471
|
# bmp = image;
|
472
472
|
# }
|
473
|
+
# ```
|
473
474
|
#
|
474
475
|
# The algorithm used for the default (normal) quality value doesn't work with images larger than 65536 (2^16) pixels in either dimension for 32-bit programs. For 64-bit programs the limit is 2^48 and so not relevant in practice.
|
475
476
|
# @see Wx::Image#rescale
|
@@ -549,6 +550,7 @@ module Wx
|
|
549
550
|
# Computes the histogram of the image.
|
550
551
|
# histogram is a reference to {Wx::ImageHistogram} object. {Wx::ImageHistogram} is a specialization of {Wx::HashMap} "template" and is defined as follows:
|
551
552
|
#
|
553
|
+
# ```
|
552
554
|
# class WXDLLEXPORT wxImageHistogramEntry
|
553
555
|
# {
|
554
556
|
# public:
|
@@ -560,6 +562,7 @@ module Wx
|
|
560
562
|
# WX_DECLARE_EXPORTED_HASH_MAP(unsigned long, wxImageHistogramEntry,
|
561
563
|
# wxIntegerHash, wxIntegerEqual,
|
562
564
|
# wxImageHistogram);
|
565
|
+
# ```
|
563
566
|
#
|
564
567
|
# Returns number of colours in the histogram.
|
565
568
|
# @param histogram [Wx::ImageHistogram]
|
@@ -703,7 +706,7 @@ module Wx
|
|
703
706
|
# Returns the palette associated with the image.
|
704
707
|
# Currently the palette is only used when converting to {Wx::Bitmap} under Windows.
|
705
708
|
# Some of the {Wx::Image} handlers have been modified to set the palette if one exists in the image file (usually 256 or less colour images in GIF or PNG format).
|
706
|
-
# @return [
|
709
|
+
# @return [Wx::Palette]
|
707
710
|
def get_palette; end
|
708
711
|
alias_method :palette, :get_palette
|
709
712
|
|
@@ -764,9 +767,10 @@ module Wx
|
|
764
767
|
# Depending on how wxWidgets has been configured, not all formats may be available.
|
765
768
|
#
|
766
769
|
# You can use {Wx::Image#get_option_int} to get the hotspot when loading cursor files:
|
767
|
-
#
|
770
|
+
# ```
|
768
771
|
# int hotspot_x = image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X);
|
769
772
|
# int hotspot_y = image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y);
|
773
|
+
# ```
|
770
774
|
# @see Wx::Image#save_file
|
771
775
|
# @param stream [IO,Wx::InputStream] Opened input stream from which to load the image. Currently, the stream must support seeking.
|
772
776
|
# @param type [BitmapType] May be one of the following:
|
@@ -816,9 +820,10 @@ module Wx
|
|
816
820
|
# Depending on how wxWidgets has been configured, not all formats may be available.
|
817
821
|
#
|
818
822
|
# You can use {Wx::Image#set_option} to set the hotspot when saving an image into a cursor file (default hotspot is in the centre of the image):
|
819
|
-
#
|
823
|
+
# ```
|
820
824
|
# image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, hotspotX);
|
821
825
|
# image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y, hotspotY);
|
826
|
+
# ```
|
822
827
|
# @see Wx::Image#load_file
|
823
828
|
# @param stream [IO,Wx::OutputStream] Opened output stream to save the image to.
|
824
829
|
# @param mimetype [String] MIME type.
|
@@ -889,10 +894,11 @@ module Wx
|
|
889
894
|
# Sets the flags used for loading image files by this object.
|
890
895
|
# The flags will affect any future calls to {Wx::Image#load_file} for this object. To change the flags for all image objects, call {Wx::Image.set_default_load_flags} before creating any of them.
|
891
896
|
# Currently the only defined flag is Load_Verbose which determines if the non-fatal (i.e. not preventing the file from being loaded completely) problems should result in the calls to {log_warning} function. It is recommended to customize handling of these warnings by e.g. defining a custom log target (see Logging Overview), but if such warnings should be completely suppressed, clearing this flag provides a simple way to do it, for example:
|
892
|
-
#
|
897
|
+
# ```
|
893
898
|
# wxImage image;
|
894
899
|
# image.SetLoadFlags(image.GetLoadFlags() & ~wxImage::Load_Verbose);
|
895
900
|
# image.LoadFile(...);
|
901
|
+
# ```
|
896
902
|
# @see Wx::Image#load_file
|
897
903
|
# @see Wx::Image#set_load_flags
|
898
904
|
# @see Wx::Image#get_load_flags
|
@@ -1057,7 +1063,6 @@ module Wx
|
|
1057
1063
|
# @return [Image]
|
1058
1064
|
# @overload initialize(xpmData)
|
1059
1065
|
# Creates an image from XPM data.
|
1060
|
-
# <b>{Wx::Perl} Note:</b> Not supported by {Wx::Perl}.
|
1061
1066
|
# This constructor has become explicit in wxWidgets 3.1.6.
|
1062
1067
|
# @param xpmData [char] A pointer to XPM image data.
|
1063
1068
|
# @return [Image]
|
@@ -1066,9 +1071,10 @@ module Wx
|
|
1066
1071
|
# Depending on how wxWidgets has been configured and by which handlers have been loaded, not all formats may be available. Any handler other than BMP must be previously initialized with {Wx::Image.add_handler} or {init_all_image_handlers}.
|
1067
1072
|
#
|
1068
1073
|
# You can use {Wx::Image#get_option_int} to get the hotspot when loading cursor files:
|
1069
|
-
#
|
1074
|
+
# ```
|
1070
1075
|
# int hotspot_x = image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X);
|
1071
1076
|
# int hotspot_y = image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y);
|
1077
|
+
# ```
|
1072
1078
|
# @see Wx::Image#load_file
|
1073
1079
|
# @param name [String] Name of the file from which to load the image.
|
1074
1080
|
# @param type [BitmapType] May be one of the following:
|
@@ -1120,10 +1126,11 @@ module Wx
|
|
1120
1126
|
|
1121
1127
|
# Iterates all registered {Wx::ImageHandler} objects, and returns a string containing file extension masks suitable for passing to file open/save dialog boxes.
|
1122
1128
|
# The format of the returned string is <code>"(*.ext1;*.ext2)|*.ext1;*.ext2"</code>. It is usually a good idea to prepend a description before passing the result to the dialog. Example:
|
1123
|
-
#
|
1129
|
+
# ```
|
1124
1130
|
# wxFileDialog FileDlg( this, "Choose Image", ::wxGetCwd(), "",
|
1125
1131
|
# _("Image Files ") + wxImage::GetImageExtWildcard(),
|
1126
1132
|
# wxFD_OPEN );
|
1133
|
+
# ```
|
1127
1134
|
# @see Wx::ImageHandler
|
1128
1135
|
# @return [String]
|
1129
1136
|
def self.get_image_ext_wildcard; end
|
@@ -16,6 +16,8 @@ module Wx
|
|
16
16
|
# @see Wx::MouseState
|
17
17
|
#
|
18
18
|
#
|
19
|
+
#
|
20
|
+
# @note This class is <b>untracked</b> and should not be derived from nor instances extended!
|
19
21
|
class KeyboardState < ::Object
|
20
22
|
|
21
23
|
# Constructor initializes the modifier key settings.
|
@@ -31,13 +33,17 @@ module Wx
|
|
31
33
|
# 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::KeyboardState#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::KeyboardState#cmd_down}. See {Wx::KeyModifier} for the full list of modifiers.
|
32
34
|
# Notice that this function is easier to use correctly than, for example, {Wx::KeyboardState#control_down} because when using the latter you also have to remember to test that none of the other modifiers is pressed:
|
33
35
|
#
|
36
|
+
# ```
|
34
37
|
# if ( ControlDown() && !AltDown() && !ShiftDown() && !MetaDown() )
|
35
38
|
# ... handle Ctrl-XXX ...
|
39
|
+
# ```
|
36
40
|
#
|
37
41
|
# 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:
|
38
42
|
#
|
43
|
+
# ```
|
39
44
|
# if ( GetModifiers() == wxMOD_CONTROL )
|
40
45
|
# ... handle Ctrl-XXX ...
|
46
|
+
# ```
|
41
47
|
#
|
42
48
|
# with this function.
|
43
49
|
# @return [Integer]
|
data/lib/wx/doc/gen/list_box.rb
CHANGED
@@ -77,7 +77,6 @@ module Wx
|
|
77
77
|
# @return [ListBox]
|
78
78
|
# @overload initialize(parent, id, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, choices=nil, style=0, validator=Wx::DEFAULT_VALIDATOR, name=Wx::ListBoxNameStr)
|
79
79
|
# Constructor, creating and showing a list box.
|
80
|
-
# <b>{Wx::Perl} Note:</b> Not supported by {Wx::Perl}.
|
81
80
|
# @param parent [Wx::Window] The parent window.
|
82
81
|
# @param id [Integer] The ID of this control. A value of {Wx::StandardID::ID_ANY} indicates a default value.
|
83
82
|
# @param pos [Array(Integer, Integer), Wx::Point] The initial position. If {Wx::DEFAULT_POSITION} is specified then a default position is chosen.
|
@@ -90,7 +89,6 @@ module Wx
|
|
90
89
|
# @overload initialize(parent, id, pos, size, choices, style=0, validator=Wx::DEFAULT_VALIDATOR, name=Wx::ListBoxNameStr)
|
91
90
|
# Constructor, creating and showing a list box.
|
92
91
|
# See the other {Wx::ListBox#list_box} constructor; the only difference is that this overload takes a {Wx::ArrayString} instead of a pointer to an array of {Wx::String}.
|
93
|
-
# <b>{Wx::Perl} Note:</b> Use an array reference for the choices parameter.
|
94
92
|
# @param parent [Wx::Window]
|
95
93
|
# @param id [Integer]
|
96
94
|
# @param pos [Array(Integer, Integer), Wx::Point]
|
@@ -141,8 +139,6 @@ module Wx
|
|
141
139
|
# The number of selections.
|
142
140
|
#
|
143
141
|
# Use this with a multiple selection listbox.
|
144
|
-
#
|
145
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method takes no parameters and return the selected items as a list.
|
146
142
|
# @see Wx::ControlWithItems::GetSelection
|
147
143
|
# @see Wx::ControlWithItems::GetStringSelection
|
148
144
|
# @see Wx::ControlWithItems::SetSelection
|
@@ -165,7 +161,6 @@ module Wx
|
|
165
161
|
def hit_test(*args) end
|
166
162
|
|
167
163
|
# Insert the given number of strings before the specified position.
|
168
|
-
# <b>{Wx::Perl} Note:</b> Use an array reference for the items parameter.
|
169
164
|
# @param items [Array<String>] Labels of items to be inserted
|
170
165
|
# @param pos [Integer] Position before which to insert the items: if pos is 0 the items will be inserted in the beginning of the listbox
|
171
166
|
# @return [void]
|
@@ -195,12 +190,6 @@ module Wx
|
|
195
190
|
# @return [void]
|
196
191
|
def ensure_visible(n) end
|
197
192
|
|
198
|
-
# Return true if the listbox has {Wx::LB_SORT} style.
|
199
|
-
# This method is mostly meant for internal use only.
|
200
|
-
# @return [true,false]
|
201
|
-
def is_sorted; end
|
202
|
-
alias_method :sorted?, :is_sorted
|
203
|
-
|
204
193
|
# Return the number of items that can fit vertically in the visible area of the listbox.
|
205
194
|
# Returns -1 if the number of items per page couldn't be determined. On {Wx::GTK} this method can only determine the number of items per page if there is at least one item in the listbox.
|
206
195
|
# @return [void]
|
data/lib/wx/doc/gen/list_ctrl.rb
CHANGED
@@ -328,7 +328,7 @@ module Wx
|
|
328
328
|
# All the other functions still work with the column indices, i.e. the visual positioning of the columns on screen doesn't affect the code setting or getting their values for example.
|
329
329
|
#
|
330
330
|
# Example of reordering columns:
|
331
|
-
#
|
331
|
+
# ```
|
332
332
|
# wxListCtrl *list = new wxListCtrl(...);
|
333
333
|
# for ( int i = 0; i < 3; i++ )
|
334
334
|
# list->InsertColumn(i, wxString::Format("Column %d", i));
|
@@ -343,6 +343,7 @@ module Wx
|
|
343
343
|
# // list->GetColumnIndexFromOrder(n) will return order[n] and
|
344
344
|
# // list->GetColumnOrder() will return 1, 2 and 0 for the column 0,
|
345
345
|
# // 1 and 2 respectively
|
346
|
+
# ```
|
346
347
|
#
|
347
348
|
# === Styles
|
348
349
|
#
|
@@ -524,14 +525,12 @@ module Wx
|
|
524
525
|
# @return [Integer]
|
525
526
|
# @overload find_item(start, data)
|
526
527
|
# Find an item whose data matches this data, starting from start or the beginning if 'start' is <code>-1</code>.
|
527
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method is implemented as FindItemData(start, data).
|
528
528
|
# The next matching item if any or <code>-1</code> ({Wx::NOT_FOUND}) otherwise.
|
529
529
|
# @param start [Integer]
|
530
530
|
# @param data [Integer]
|
531
531
|
# @return [Integer]
|
532
532
|
# @overload find_item(start, pt, direction)
|
533
533
|
# Find an item nearest this position in the specified direction, starting from start or the beginning if start is -1.
|
534
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method is implemented as FindItemAtPos(start, pt, direction).
|
535
534
|
# The next matching item if any or <code>-1</code> ({Wx::NOT_FOUND}) otherwise.
|
536
535
|
# @param start [Integer]
|
537
536
|
# @param pt [Array(Integer, Integer), Wx::Point]
|
@@ -541,7 +540,6 @@ module Wx
|
|
541
540
|
|
542
541
|
# Gets information about this column.
|
543
542
|
# See {Wx::ListCtrl#set_item} for more information.
|
544
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method takes only the col parameter and returns a Wx::ListItem (or undef).
|
545
543
|
# @param col [Integer]
|
546
544
|
# @param item [Wx::ListItem]
|
547
545
|
# @return [true,false]
|
@@ -628,7 +626,6 @@ module Wx
|
|
628
626
|
alias_method :item_font, :get_item_font
|
629
627
|
|
630
628
|
# Returns the position of the item, in icon or small icon view.
|
631
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method takes only the item parameter and returns a Wx::Point (or undef).
|
632
629
|
# @param item [Integer]
|
633
630
|
# @param pos [Array(Integer, Integer), Wx::Point]
|
634
631
|
# @return [true,false]
|
@@ -637,7 +634,6 @@ module Wx
|
|
637
634
|
|
638
635
|
# Returns the rectangle representing the item's size and position, in physical coordinates.
|
639
636
|
# code is one of {Wx::LIST_RECT_BOUNDS}, {Wx::LIST_RECT_ICON}, {Wx::LIST_RECT_LABEL}.
|
640
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method takes only the item and code parameters and returns a Wx::Rect (or undef).
|
641
637
|
# @param item [Integer]
|
642
638
|
# @param code [Integer]
|
643
639
|
# @return [Array(true,false,Wx::Rect)]
|
@@ -674,6 +670,7 @@ module Wx
|
|
674
670
|
# Searches for an item with the given geometry or state, starting from item but excluding the item itself.
|
675
671
|
# If item is -1, the first item that matches the specified flags will be returned. Returns the first item with given state following item or -1 if no such item found. This function may be used to find all selected items in the control like this:
|
676
672
|
#
|
673
|
+
# ```
|
677
674
|
# long item = -1;
|
678
675
|
# for ( ;; )
|
679
676
|
# {
|
@@ -686,6 +683,7 @@ module Wx
|
|
686
683
|
# // this item is selected - do whatever is needed with it
|
687
684
|
# wxLogMessage("Item %ld is selected.", item);
|
688
685
|
# }
|
686
|
+
# ```
|
689
687
|
#
|
690
688
|
# geometry can be one of:
|
691
689
|
# - {Wx::LIST_NEXT_ABOVE}: Searches for an item above the specified item.- {Wx::LIST_NEXT_ALL}: Searches for subsequent item by index.- {Wx::LIST_NEXT_BELOW}: Searches for an item below the specified item.- {Wx::LIST_NEXT_LEFT}: Searches for an item to the left of the specified item.- {Wx::LIST_NEXT_RIGHT}: Searches for an item to the right of the specified item.
|
@@ -756,7 +754,6 @@ module Wx
|
|
756
754
|
# - {Wx::LIST_HITTEST_ABOVE}: Above the control's client area.- {Wx::LIST_HITTEST_BELOW}: Below the control's client area.- {Wx::LIST_HITTEST_TOLEFT}: To the left of the control's client area.- {Wx::LIST_HITTEST_TORIGHT}: To the right of the control's client area.- {Wx::LIST_HITTEST_NOWHERE}: Inside the control's client area but not over an item.- {Wx::LIST_HITTEST_ONITEMICON}: Over an item's icon.- {Wx::LIST_HITTEST_ONITEMLABEL}: Over an item's text.- {Wx::LIST_HITTEST_ONITEMSTATEICON}: Over the checkbox of an item.- {Wx::LIST_HITTEST_ONITEM}: Combination of {Wx::LIST_HITTEST_ONITEMICON}, {Wx::LIST_HITTEST_ONITEMLABEL}, {Wx::LIST_HITTEST_ONITEMSTATEICON}.
|
757
755
|
#
|
758
756
|
# If ptrSubItem is not NULL and the {Wx::ListCtrl} is in the report mode the subitem (or column) number will also be provided. This feature is only available in version 2.7.0 or higher and is currently only implemented under {Wx::MSW} and requires at least comctl32.dll of version 4.70 on the host system or the value stored in ptrSubItem will be always -1. To compile this feature into wxWidgets library you need to have access to commctrl.h of version 4.70 that is provided by Microsoft.
|
759
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method only takes the point parameter and returns a 2-element list (item, flags).
|
760
757
|
# @param point [Array(Integer, Integer), Wx::Point]
|
761
758
|
# @return [Array(Integer,Integer)]
|
762
759
|
def hit_test(point) end
|
@@ -790,19 +787,16 @@ module Wx
|
|
790
787
|
# @return [Integer]
|
791
788
|
# @overload insert_item(index, label)
|
792
789
|
# Insert a string item.
|
793
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method is implemented as InsertStringItem(index, label).
|
794
790
|
# @param index [Integer] Index of the new item, supplied by the application
|
795
791
|
# @param label [String] String label
|
796
792
|
# @return [Integer]
|
797
793
|
# @overload insert_item(index, imageIndex)
|
798
794
|
# Insert an image item.
|
799
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method is implemented as InsertImageItem(index, imageIndex).
|
800
795
|
# @param index [Integer] Index of the new item, supplied by the application
|
801
796
|
# @param imageIndex [Integer] Index into the image list associated with this control and view style
|
802
797
|
# @return [Integer]
|
803
798
|
# @overload insert_item(index, label, imageIndex)
|
804
799
|
# Insert an image/string item.
|
805
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method is implemented as InsertImageStringItem(index, label, imageIndex).
|
806
800
|
# @param index [Integer] Index of the new item, supplied by the application
|
807
801
|
# @param label [String] String label
|
808
802
|
# @param imageIndex [Integer] Index into the image list associated with this control and view style
|
@@ -985,11 +979,13 @@ module Wx
|
|
985
979
|
# Sets the item state.
|
986
980
|
# The stateMask is a combination of {Wx::LIST_STATE_XXX} constants described in {Wx::ListItem} documentation. For each of the bits specified in stateMask, the corresponding state is set or cleared depending on whether state argument contains the same bit or not.
|
987
981
|
# So to select an item you can use
|
988
|
-
#
|
982
|
+
# ```
|
989
983
|
# list->SetItemState(item, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
|
984
|
+
# ```
|
990
985
|
# while to deselect it you should use
|
991
|
-
#
|
986
|
+
# ```
|
992
987
|
# list->SetItemState(item, 0, wxLIST_STATE_SELECTED);
|
988
|
+
# ```
|
993
989
|
#
|
994
990
|
# Consider using {Wx::ListView} if possible to avoid dealing with this error-prone and confusing method.
|
995
991
|
# Also notice that contrary to the usual rule that only user actions generate events, this method does generate {Wx::EVT_LIST_ITEM_SELECTED} event when it is used to select an item.
|
@@ -1092,7 +1088,7 @@ module Wx
|
|
1092
1088
|
# Returns the new value to use for sort indicator after clicking a column.
|
1093
1089
|
# This helper function can be useful in the EVT_LIST_COL_CLICK handler when it updates the sort indicator after the user clicked on a column.
|
1094
1090
|
# For example:
|
1095
|
-
#
|
1091
|
+
# ```
|
1096
1092
|
# void MyListCtrl::OnColClick(wxListEvent& event)
|
1097
1093
|
# {
|
1098
1094
|
# int col = event.GetColumn();
|
@@ -1103,6 +1099,7 @@ module Wx
|
|
1103
1099
|
# SortItems(MyCompareFunction, ascending);
|
1104
1100
|
# ShowSortIndicator(col, ascending);
|
1105
1101
|
# }
|
1102
|
+
# ```
|
1106
1103
|
# @param col [Integer]
|
1107
1104
|
# @return [true,false]
|
1108
1105
|
def get_updated_ascending_sort_indicator(col) end
|
data/lib/wx/doc/gen/locale.rb
CHANGED
@@ -3779,8 +3779,8 @@ module Wx
|
|
3779
3779
|
#
|
3780
3780
|
# In wxWidgets this class manages current locale. It also initializes and activates {Wx::Translations} object that manages message catalogs.
|
3781
3781
|
# For a list of the supported languages, please see {Wx::Language} enum values. These constants may be used to specify the language in {Wx::Locale#init} and are returned by {Wx::Locale.get_system_language}.
|
3782
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} you can't use the '_' function name, so the Wx::Locale module can export the gettext and gettext_noop under any given name.
|
3783
3782
|
#
|
3783
|
+
# ```
|
3784
3784
|
# # this imports gettext ( equivalent to Wx::GetTranslation
|
3785
3785
|
# # and gettext_noop ( a noop )
|
3786
3786
|
# # into your module
|
@@ -3792,9 +3792,11 @@ module Wx
|
|
3792
3792
|
# print gettext( "Panic!" );
|
3793
3793
|
#
|
3794
3794
|
# button = Wx::Button-new( window, -1, gettext( "Label" ) );
|
3795
|
+
# ```
|
3795
3796
|
#
|
3796
3797
|
# If you need to translate a lot of strings, then adding gettext( ) around each one is a long task ( that is why _( ) was introduced ), so just choose a shorter name for gettext:
|
3797
3798
|
#
|
3799
|
+
# ```
|
3798
3800
|
# use Wx::Locale 'gettext' = 't',
|
3799
3801
|
# 'gettext_noop' = 'gettext_noop';
|
3800
3802
|
#
|
@@ -3804,6 +3806,7 @@ module Wx
|
|
3804
3806
|
# print t( "Panic!!" );
|
3805
3807
|
#
|
3806
3808
|
# # ...
|
3809
|
+
# ```
|
3807
3810
|
#
|
3808
3811
|
# ===
|
3809
3812
|
#
|
@@ -4006,9 +4009,10 @@ module Wx
|
|
4006
4009
|
end # Locale
|
4007
4010
|
|
4008
4011
|
# Encapsulates a {Wx::Language} identifier together with OS-specific information related to that language.
|
4009
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} Wx::LanguageInfo has only one method:
|
4010
|
-
# - Wx::LanguageInfo->new(language, canonicalName, WinLang, WinSubLang, Description)
|
4011
4012
|
#
|
4013
|
+
#
|
4014
|
+
#
|
4015
|
+
# @note This class is <b>untracked</b> and should not be derived from nor instances extended!
|
4012
4016
|
class LanguageInfo < ::Object
|
4013
4017
|
|
4014
4018
|
# Win32 language identifiers (LANG_xxxx, SUBLANG_xxxx).
|
data/lib/wx/doc/gen/log.rb
CHANGED
@@ -162,8 +162,9 @@ module Wx
|
|
162
162
|
|
163
163
|
# Sets the log level for the given component.
|
164
164
|
# For example, to disable all but error messages from wxWidgets network classes you may use
|
165
|
-
#
|
165
|
+
# ```
|
166
166
|
# wxLog::SetComponentLevel("wx/net", wxLOG_Error);
|
167
|
+
# ```
|
167
168
|
#
|
168
169
|
# {Wx::Log.set_log_level} may be used to set the global log level.
|
169
170
|
# @param component [String] Non-empty component name, possibly using slashes (<code>/</code>) to separate it into several parts.
|
@@ -248,7 +249,7 @@ module Wx
|
|
248
249
|
# Log the given record.
|
249
250
|
# This function should only be called from the DoLog() implementations in the derived classes if they need to call {Wx::Log#do_log_record} on another log object (they can, of course, just use {Wx::Log#do_log_record} call syntax to call it on the object itself). It should not be used for logging new messages which can be only sent to the currently active logger using OnLog() which also checks if the logging (for this level) is enabled while this method just directly calls DoLog().
|
250
251
|
# Example of use of this class from {Wx::LogChain}:
|
251
|
-
#
|
252
|
+
# ```
|
252
253
|
# void wxLogChain::DoLogRecord(wxLogLevel level,
|
253
254
|
# const wxString& msg,
|
254
255
|
# const wxLogRecordInfo& info)
|
@@ -261,6 +262,7 @@ module Wx
|
|
261
262
|
# if ( m_logNew && m_logNew != this )
|
262
263
|
# m_logNew->LogRecord(level, msg, info);
|
263
264
|
# }
|
265
|
+
# ```
|
264
266
|
# @param level [Wx::LogLevel]
|
265
267
|
# @param msg [String]
|
266
268
|
# @param info [Wx::LogRecordInfo]
|
@@ -294,6 +296,7 @@ module Wx
|
|
294
296
|
# It is especially useful when you want to divert the logs somewhere (for example to a file or a log window) but also keep showing the error messages using the standard dialogs as {Wx::LogGui} does by default.
|
295
297
|
# Example of usage:
|
296
298
|
#
|
299
|
+
# ```
|
297
300
|
# wxLogChain *logChain = new wxLogChain(new wxLogStderr);
|
298
301
|
#
|
299
302
|
# // all the log messages are sent to stderr and also processed as usually
|
@@ -302,6 +305,7 @@ module Wx
|
|
302
305
|
# // don't delete logChain directly as this would leave a dangling
|
303
306
|
# // pointer as active log target, use SetActiveTarget() instead
|
304
307
|
# delete wxLog::SetActiveTarget(...something else or NULL...);
|
308
|
+
# ```
|
305
309
|
#
|
306
310
|
# ===
|
307
311
|
#
|
data/lib/wx/doc/gen/mdi_frame.rb
CHANGED
@@ -112,8 +112,10 @@ module Wx
|
|
112
112
|
# Override this to return a different kind of client window.
|
113
113
|
# If you override this function, you must create your parent frame in two stages, or your function will never be called, due to the way C++ treats virtual functions called from constructors. For example:
|
114
114
|
#
|
115
|
+
# ```
|
115
116
|
# frame = new MyParentFrame;
|
116
117
|
# frame->Create(parent, myParentFrameId, "My Parent Frame");
|
118
|
+
# ```
|
117
119
|
#
|
118
120
|
# You might wish to derive from {Wx::MDIClientWindow} in order to implement different erase behaviour, for example, such as painting a bitmap on the background.
|
119
121
|
# Note that it is probably impossible to have a client window that scrolls as well as painting a bitmap or pattern, since in <b>OnScroll</b>, the scrollbar positions always return zero.
|
@@ -20,6 +20,7 @@ module Wx
|
|
20
20
|
# When {Wx::MediaCtrl} plays a file, it plays until the stop position is reached (currently the end of the file/stream). Right before it hits the end of the stream, it fires off a EVT_MEDIA_STOP event to its parent window, at which point the event handler can choose to veto the event, preventing the stream from actually stopping.
|
21
21
|
# Example:
|
22
22
|
#
|
23
|
+
# ```
|
23
24
|
# // bind the media event
|
24
25
|
# Bind(wxMY_ID, wxEVT_MEDIA_STOP, &MyFrame::OnMediaStop, this);
|
25
26
|
#
|
@@ -32,6 +33,7 @@ module Wx
|
|
32
33
|
# evt.Veto();
|
33
34
|
# }
|
34
35
|
# }
|
36
|
+
# ```
|
35
37
|
#
|
36
38
|
# When {Wx::MediaCtrl} stops, either by the EVT_MEDIA_STOP not being vetoed, or by manually calling {Wx::MediaCtrl#stop}, where it actually stops is not at the beginning, rather, but at the beginning of the stream. That is, when it stops and play is called, playback is guaranteed to start at the beginning of the media. This is because some streams are not seekable, and when stop is called on them they return to the beginning, thus {Wx::MediaCtrl} tries to keep consistent for all types of media.
|
37
39
|
# Note that when changing the state of the media through {Wx::MediaCtrl#play} and other methods, the media may not actually be in the {Wx::MediaState::MEDIASTATE_PLAYING}, for example. If you are relying on the media being in certain state, catch the event relevant to the state. See {Wx::MediaEvent} for the kinds of events that you can catch.
|
data/lib/wx/doc/gen/memory_dc.rb
CHANGED
@@ -6,10 +6,26 @@
|
|
6
6
|
|
7
7
|
module Wx
|
8
8
|
|
9
|
+
#
|
10
|
+
BUFFER_VIRTUAL_AREA = 1
|
11
|
+
|
12
|
+
#
|
13
|
+
BUFFER_CLIENT_AREA = 2
|
14
|
+
|
15
|
+
#
|
16
|
+
BUFFER_USES_SHARED_BUFFER = 4
|
17
|
+
|
18
|
+
# Check if the window is natively double buffered and will return a {Wx::PaintDC} if it is, a {Wx::BufferedPaintDC} otherwise.
|
19
|
+
# It is the caller's responsibility to delete the {Wx::DC} pointer when finished with it.
|
20
|
+
# @param window [Wx::Window]
|
21
|
+
# @return [Wx::DC]
|
22
|
+
def self.auto_buffered_paint_dc_factory(window) end
|
23
|
+
|
9
24
|
# A memory device context provides a means to draw graphics onto a bitmap.
|
10
25
|
# When drawing in to a mono-bitmap, using {Wx::WHITE}, {Wx::WHITE_PEN} and {Wx::WHITE_BRUSH} will draw the background colour (i.e. 0) whereas all other colours will draw the foreground colour (i.e. 1).
|
11
26
|
# A bitmap must be selected into the new memory DC before it may be used for anything. Typical usage is as follows:
|
12
27
|
#
|
28
|
+
# ```
|
13
29
|
# // Create a memory DC
|
14
30
|
# wxMemoryDC temp_dc;
|
15
31
|
# temp_dc.SelectObject(test_bitmap);
|
@@ -17,15 +33,18 @@ module Wx
|
|
17
33
|
# // We can now draw into the memory DC...
|
18
34
|
# // Copy from this DC to another DC.
|
19
35
|
# old_dc.Blit(250, 50, BITMAP_WIDTH, BITMAP_HEIGHT, temp_dc, 0, 0);
|
36
|
+
# ```
|
20
37
|
#
|
21
38
|
# Note that the memory DC must be deleted (or the bitmap selected out of it) before a bitmap can be reselected into another memory DC.
|
22
39
|
# And, before performing any other operations on the bitmap data, the bitmap must be selected out of the memory DC:
|
23
40
|
#
|
41
|
+
# ```
|
24
42
|
# temp_dc.SelectObject(wxNullBitmap);
|
43
|
+
# ```
|
25
44
|
#
|
26
45
|
# This happens automatically when {Wx::MemoryDC} object goes out of scope.
|
27
46
|
# Note that the scaling factor of the bitmap determines the scaling factor used by this device context, so when using a memory device context as a back buffer for a window, you should typically create the bitmap using the same scale factor as used by the window, e.g.
|
28
|
-
#
|
47
|
+
# ```
|
29
48
|
# void MyWindow::OnPaint(wxPaintEvent&)
|
30
49
|
# {
|
31
50
|
# wxBitmap bmp;
|
@@ -38,6 +57,7 @@ module Wx
|
|
38
57
|
# wxPaintDC dc(this);
|
39
58
|
# dc.DrawBitmap(bmp, wxPoint(0, 0));
|
40
59
|
# }
|
60
|
+
# ```
|
41
61
|
#
|
42
62
|
# ===
|
43
63
|
#
|
@@ -46,24 +66,10 @@ module Wx
|
|
46
66
|
# @see Wx::DC
|
47
67
|
#
|
48
68
|
#
|
69
|
+
#
|
70
|
+
# @note This class is <b>untracked</b> and should not be derived from nor instances extended!
|
49
71
|
class MemoryDC < DC
|
50
72
|
|
51
|
-
# @overload initialize()
|
52
|
-
# Constructs a new memory device context.
|
53
|
-
# Use the {Wx::DC#is_ok} member to test whether the constructor was successful in creating a usable device context. Don't forget to select a bitmap into the DC before drawing on it.
|
54
|
-
# @return [MemoryDC]
|
55
|
-
# @overload initialize(dc)
|
56
|
-
# Constructs a new memory device context having the same characteristics as the given existing device context.
|
57
|
-
# This constructor creates a memory device context compatible with dc in {Wx::MSW}, the argument is ignored in the other ports. If dc is NULL, a device context compatible with the screen is created, just as with the default constructor.
|
58
|
-
# @param dc [Wx::DC]
|
59
|
-
# @return [MemoryDC]
|
60
|
-
# @overload initialize(bitmap)
|
61
|
-
# Constructs a new memory device context and calls {Wx::MemoryDC#select_object} with the given bitmap.
|
62
|
-
# Use the {Wx::DC#is_ok} member to test whether the constructor was successful in creating a usable device context.
|
63
|
-
# @param bitmap [Wx::Bitmap]
|
64
|
-
# @return [MemoryDC]
|
65
|
-
def initialize(*args) end
|
66
|
-
|
67
73
|
# Allow using this device context object to modify the given bitmap contents.
|
68
74
|
# Note that if you need to only use the existing bitmap contents instead of modifying it, you should use {Wx::MemoryDC#select_object_as_source} instead.
|
69
75
|
# Before using the updated bitmap data, make sure to select it out of context first either by selecting {Wx::NULL_BITMAP} into the device context or destroying the device context entirely.
|
@@ -83,7 +89,7 @@ module Wx
|
|
83
89
|
|
84
90
|
# @overload get_selected_bitmap()
|
85
91
|
# Get the selected bitmap.
|
86
|
-
# @return [
|
92
|
+
# @return [Wx::Bitmap]
|
87
93
|
# @overload get_selected_bitmap()
|
88
94
|
# @return [Wx::Bitmap]
|
89
95
|
def get_selected_bitmap(*args) end
|
@@ -91,5 +97,86 @@ module Wx
|
|
91
97
|
|
92
98
|
end # MemoryDC
|
93
99
|
|
100
|
+
# This class provides a simple way to avoid flicker: when drawing on it, everything is in fact first drawn on an in-memory buffer (a {Wx::Bitmap}) and then copied to the screen, using the associated {Wx::DC}, only once, when this object is destroyed.
|
101
|
+
# {Wx::BufferedDC} itself is typically associated with {Wx::ClientDC}, if you want to use it in your EVT_PAINT handler, you should look at {Wx::BufferedPaintDC} instead.
|
102
|
+
# When used like this, a valid DC must be specified in the constructor while the buffer bitmap doesn't have to be explicitly provided, by default this class will allocate the bitmap of required size itself. However using a dedicated bitmap can speed up the redrawing process by eliminating the repeated creation and destruction of a possibly big bitmap. Otherwise, {Wx::BufferedDC} can be used in the same way as any other device context.
|
103
|
+
# Another possible use for {Wx::BufferedDC} is to use it to maintain a backing store for the window contents. In this case, the associated DC may be NULL but a valid backing store bitmap should be specified.
|
104
|
+
# Finally, please note that GTK+ 2.0 as well as macOS provide double buffering themselves natively. You can either use {Wx::Window#is_double_buffered} to determine whether you need to use buffering or not, or use {Wx::AutoBufferedPaintDC} to avoid needless double buffering on the systems which already do it automatically.
|
105
|
+
# ===
|
106
|
+
#
|
107
|
+
# Category: Device Contexts
|
108
|
+
# @see Wx::DC
|
109
|
+
# @see Wx::MemoryDC
|
110
|
+
# @see Wx::BufferedPaintDC
|
111
|
+
# @see Wx::AutoBufferedPaintDC
|
112
|
+
#
|
113
|
+
#
|
114
|
+
class BufferedDC < MemoryDC
|
115
|
+
|
116
|
+
# @overload init(dc, area, style=Wx::BUFFER_CLIENT_AREA)
|
117
|
+
# Initializes the object created using the default constructor.
|
118
|
+
# Please see the constructors for parameter details.
|
119
|
+
# @param dc [Wx::DC]
|
120
|
+
# @param area [Array(Integer, Integer), Wx::Size]
|
121
|
+
# @param style [Integer]
|
122
|
+
# @return [void]
|
123
|
+
# @overload init(dc, buffer=Wx::NULL_BITMAP, style=Wx::BUFFER_CLIENT_AREA)
|
124
|
+
# Initializes the object created using the default constructor.
|
125
|
+
# Please see the constructors for parameter details.
|
126
|
+
# @param dc [Wx::DC]
|
127
|
+
# @param buffer [Wx::Bitmap]
|
128
|
+
# @param style [Integer]
|
129
|
+
# @return [void]
|
130
|
+
def init(*args) end
|
131
|
+
|
132
|
+
# Blits the buffer to the dc, and detaches the dc from the buffer (so it can be effectively used once only).
|
133
|
+
# Usually only called in the destructor or by the destructor of derived classes if the BufferedDC must blit before the derived class (which may own the dc it's blitting to) is destroyed.
|
134
|
+
# @return [void]
|
135
|
+
def un_mask; end
|
136
|
+
|
137
|
+
# Set the style.
|
138
|
+
# @param style [Integer]
|
139
|
+
# @return [void]
|
140
|
+
def set_style(style) end
|
141
|
+
alias_method :style=, :set_style
|
142
|
+
|
143
|
+
# Get the style.
|
144
|
+
# @return [Integer]
|
145
|
+
def get_style; end
|
146
|
+
alias_method :style, :get_style
|
147
|
+
|
148
|
+
end # BufferedDC
|
149
|
+
|
150
|
+
# This is a subclass of {Wx::BufferedDC} which can be used inside of an <code>EVT_PAINT()</code> event handler to achieve double-buffered drawing.
|
151
|
+
# Just use this class instead of {Wx::PaintDC} and make sure {Wx::Window#set_background_style} is called with {Wx::BackgroundStyle::BG_STYLE_PAINT} somewhere in the class initialization code, and that's all you have to do to (mostly) avoid flicker. The only thing to watch out for is that if you are using this class together with {Wx::Scrolled}, you probably do <b>not</b> want to call Wx::Scrolled#prepare_dc on it as it already does this internally for the real underlying {Wx::PaintDC}.
|
152
|
+
# ===
|
153
|
+
#
|
154
|
+
# Category: Device Contexts
|
155
|
+
# @see Wx::DC
|
156
|
+
# @see Wx::BufferedDC
|
157
|
+
# @see Wx::AutoBufferedPaintDC
|
158
|
+
# @see Wx::PaintDC
|
159
|
+
#
|
160
|
+
#
|
161
|
+
class BufferedPaintDC < BufferedDC
|
162
|
+
|
163
|
+
end # BufferedPaintDC
|
164
|
+
|
165
|
+
# This {Wx::DC} derivative can be used inside of an <code>EVT_PAINT()</code> event handler to achieve double-buffered drawing.
|
166
|
+
# Just use this class instead of {Wx::PaintDC} and make sure {Wx::Window#set_background_style} is called with {Wx::BackgroundStyle::BG_STYLE_PAINT} somewhere in the class initialization code, and that's all you have to do to (mostly) avoid flicker.
|
167
|
+
# The difference between {Wx::BufferedPaintDC} and this class is that this class won't double-buffer on platforms which have native double-buffering already, avoiding any unnecessary buffering to avoid flicker.
|
168
|
+
# {Wx::AutoBufferedPaintDC} is simply a typedef of {Wx::PaintDC} on platforms that have native double-buffering, otherwise, it is a typedef of {Wx::BufferedPaintDC}.
|
169
|
+
# ===
|
170
|
+
#
|
171
|
+
# Category: Device Contexts
|
172
|
+
# @see Wx::DC
|
173
|
+
# @see Wx::BufferedPaintDC
|
174
|
+
# @see Wx::PaintDC
|
175
|
+
#
|
176
|
+
#
|
177
|
+
class AutoBufferedPaintDC < BufferedPaintDC
|
178
|
+
|
179
|
+
end # AutoBufferedPaintDC
|
180
|
+
|
94
181
|
|
95
182
|
end
|
data/lib/wx/doc/gen/menu.rb
CHANGED
@@ -55,11 +55,13 @@ module Wx
|
|
55
55
|
# @overload append(id, item=(''), helpString=(''), kind=Wx::ItemKind::ITEM_NORMAL)
|
56
56
|
# Adds a menu item.
|
57
57
|
# Example:
|
58
|
-
#
|
58
|
+
# ```
|
59
59
|
# m_pFileMenu->Append(ID_NEW_FILE, "&New file\tCTRL+N", "Creates a new XYZ document");
|
60
|
+
# ```
|
60
61
|
# or even better for stock menu items (see {Wx::MenuItem::MenuItem}):
|
61
|
-
#
|
62
|
+
# ```
|
62
63
|
# m_pFileMenu->Append(wxID_NEW, "", "Creates a new XYZ document");
|
64
|
+
# ```
|
63
65
|
#
|
64
66
|
# This command can be used after the menu has been shown, as well as on initial creation of a menu or menubar.
|
65
67
|
# @see Wx::Menu#append_separator
|
data/lib/wx/doc/gen/menu_bar.rb
CHANGED
@@ -62,8 +62,6 @@ module Wx
|
|
62
62
|
|
63
63
|
# Finds the menu item object associated with the given menu item identifier.
|
64
64
|
# The found menu item object, or NULL if one was not found.
|
65
|
-
#
|
66
|
-
# <b>{Wx::Perl} Note:</b> In {Wx::Perl} this method takes just the id parameter; in scalar context it returns the associated Wx::MenuItem, in list context it returns a 2-element list (item, submenu).
|
67
65
|
# @param id [Integer] Menu item identifier.
|
68
66
|
# @param menu [Wx::Menu] If not NULL, menu will get set to the associated menu.
|
69
67
|
# @return [Wx::MenuItem]
|