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/window.rb
CHANGED
@@ -471,8 +471,9 @@ module Wx
|
|
471
471
|
|
472
472
|
# Sets the scrollbar properties of a built-in scrollbar.
|
473
473
|
# Let's say you wish to display 50 lines of text, using the same font. The window is sized so that you can only see 16 lines at a time. You would use:
|
474
|
-
#
|
474
|
+
# ```
|
475
475
|
# SetScrollbar(wxVERTICAL, 0, 16, 50);
|
476
|
+
# ```
|
476
477
|
# Note that with the window at this size, the thumb position can never go above 50 minus 16, or 34. You can determine how many lines are currently visible by dividing the current view size by the character height in pixels. When defining your own scrollbar behaviour, you will always need to recalculate the scrollbar settings when the window size changes. You could therefore put your scrollbar calculations and SetScrollbar call into a function named AdjustScrollbars, which can be called initially and also from your {Wx::SizeEvent} handler function.
|
477
478
|
# @see Scrolled Windows
|
478
479
|
# @see Wx::ScrollBar
|
@@ -534,8 +535,9 @@ module Wx
|
|
534
535
|
# @overload from_dip(sz)
|
535
536
|
# Convert DPI-independent pixel values to the value in pixels appropriate for the current toolkit.
|
536
537
|
# A DPI-independent pixel is just a pixel at the standard 96 DPI resolution. To keep the same physical size at higher resolution, the physical pixel value must be scaled by {Wx::Window#get_dpi_scale_factor} but this scaling may be already done by the underlying toolkit (GTK+, Cocoa, ...) automatically. This method performs the conversion only if it is not already done by the lower level toolkit and so by using it with pixel values you can guarantee that the physical size of the corresponding elements will remain the same in all resolutions under all platforms. For example, instead of creating a bitmap of the hard coded size of 32 pixels you should use
|
537
|
-
#
|
538
|
+
# ```
|
538
539
|
# wxBitmap bmp(FromDIP(32, 32));
|
540
|
+
# ```
|
539
541
|
# to avoid using tiny bitmaps on high DPI screens.
|
540
542
|
# Notice that this function is only needed when using hard coded pixel values. It is not necessary if the sizes are already based on the DPI-independent units such as dialog units or if you are relying on the controls automatic best size determination and using sizers to lay out them.
|
541
543
|
# Also note that if either component of sz has the special value of -1, it is returned unchanged independently of the current DPI, to preserve the special value of -1 in wxWidgets API (it is often used to mean "unspecified").
|
@@ -575,9 +577,10 @@ module Wx
|
|
575
577
|
# @overload to_dip(sz)
|
576
578
|
# Convert pixel values of the current toolkit to DPI-independent pixel values.
|
577
579
|
# A DPI-independent pixel is just a pixel at the standard 96 DPI resolution. To keep the same physical size at higher resolution, the physical pixel value must be scaled by {Wx::Window#get_dpi_scale_factor} but this scaling may be already done by the underlying toolkit (GTK+, Cocoa, ...) automatically. This method performs the conversion only if it is not already done by the lower level toolkit, For example, you may want to use this to store window sizes and positions so that they can be re-used regardless of the display DPI:
|
578
|
-
#
|
580
|
+
# ```
|
579
581
|
# wxPoint pt(ToDIP(GetPosition()));
|
580
582
|
# wxSize size(ToDIP(GetSize()));
|
583
|
+
# ```
|
581
584
|
#
|
582
585
|
# Also note that if either component of sz has the special value of -1, it is returned unchanged independently of the current DPI, to preserve the special value of -1 in wxWidgets API (it is often used to mean "unspecified").
|
583
586
|
# @param sz [Array(Integer, Integer), Wx::Size]
|
@@ -904,8 +907,9 @@ module Wx
|
|
904
907
|
|
905
908
|
# Sets the maximum client size of the window, to indicate to the sizer layout mechanism that this is the maximum possible size of its client area.
|
906
909
|
# Note that this method is just a shortcut for:
|
907
|
-
#
|
910
|
+
# ```
|
908
911
|
# SetMaxSize(ClientToWindowSize(size));
|
912
|
+
# ```
|
909
913
|
# @see Wx::Window#set_max_size
|
910
914
|
# @see Window Sizing Overview
|
911
915
|
# @param size [Array(Integer, Integer), Wx::Size]
|
@@ -926,8 +930,9 @@ module Wx
|
|
926
930
|
# You may need to call this if you change the window size after construction and before adding to its parent sizer.
|
927
931
|
# Note, that just as with {Wx::Window#set_min_size}, calling this method doesn't prevent the program from explicitly making the window smaller than the specified size.
|
928
932
|
# Note that this method is just a shortcut for:
|
929
|
-
#
|
933
|
+
# ```
|
930
934
|
# SetMinSize(ClientToWindowSize(size));
|
935
|
+
# ```
|
931
936
|
# @see Wx::Window#set_min_size
|
932
937
|
# @see Window Sizing Overview
|
933
938
|
# @param size [Array(Integer, Integer), Wx::Size]
|
@@ -1074,8 +1079,9 @@ module Wx
|
|
1074
1079
|
# @overload move(x, y, flags=Wx::SIZE_USE_EXISTING)
|
1075
1080
|
# Moves the window to the given position.
|
1076
1081
|
# Implementations of SetSize can also implicitly implement the {Wx::Window#move} function, which is defined in the base {Wx::Window} class as the call:
|
1077
|
-
#
|
1082
|
+
# ```
|
1078
1083
|
# SetSize(x, y, wxDefaultCoord, wxDefaultCoord, wxSIZE_USE_EXISTING);
|
1084
|
+
# ```
|
1079
1085
|
# @see Wx::Window#set_size
|
1080
1086
|
# @param x [Integer] Required x position.
|
1081
1087
|
# @param y [Integer] Required y position.
|
@@ -1084,8 +1090,9 @@ module Wx
|
|
1084
1090
|
# @overload move(pt, flags=Wx::SIZE_USE_EXISTING)
|
1085
1091
|
# Moves the window to the given position.
|
1086
1092
|
# Implementations of {Wx::Window#set_size} can also implicitly implement the {Wx::Window#move} function, which is defined in the base {Wx::Window} class as the call:
|
1087
|
-
#
|
1093
|
+
# ```
|
1088
1094
|
# SetSize(x, y, wxDefaultCoord, wxDefaultCoord, wxSIZE_USE_EXISTING);
|
1095
|
+
# ```
|
1089
1096
|
# @see Wx::Window#set_size
|
1090
1097
|
# @param pt [Array(Integer, Integer), Wx::Point] {Wx::Point} object representing the position.
|
1091
1098
|
# @param flags [Integer] See {Wx::Window#set_size} for more info about this parameter.
|
@@ -1108,8 +1115,9 @@ module Wx
|
|
1108
1115
|
# Converts a point or size from dialog units to pixels.
|
1109
1116
|
# For the x dimension, the dialog units are multiplied by the average character width and then divided by 4. For the y dimension, the dialog units are multiplied by the average character height and then divided by 8.
|
1110
1117
|
# Dialog units are used for maintaining a dialog's proportions even if the font changes. You can also use these functions programmatically. A convenience macro is defined:
|
1111
|
-
#
|
1118
|
+
# ```
|
1112
1119
|
# #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt)
|
1120
|
+
# ```
|
1113
1121
|
# @see Wx::Window#convert_pixels_to_dialog
|
1114
1122
|
# @param pt [Array(Integer, Integer), Wx::Point]
|
1115
1123
|
# @return [Wx::Point]
|
@@ -1300,7 +1308,7 @@ module Wx
|
|
1300
1308
|
# Notice that in previous versions of wxWidgets a common way to work around the above mentioned flickering problem was to define an empty EVT_ERASE_BACKGROUND handler. Setting background style to {Wx::BackgroundStyle::BG_STYLE_PAINT} is a simpler and more efficient solution to the same problem.
|
1301
1309
|
# Under {Wx::GTK} and {Wx::OSX}, you can use {Wx::BackgroundStyle::BG_STYLE_TRANSPARENT} to obtain full transparency of the window background. Note that {Wx::GTK} supports this only since GTK 2.12 with a compositing manager enabled, call {Wx::Window#is_transparent_background_supported} to check whether this is the case, see the example of doing it in the shapedsample".
|
1302
1310
|
# Also, in order for <code>SetBackgroundStyle(wxBG_STYLE_TRANSPARENT)</code> to work, it must be called before {Wx::Window#create}. If you're using your own {Wx::Window}-derived class you should write your code in the following way:
|
1303
|
-
#
|
1311
|
+
# ```
|
1304
1312
|
# class MyWidget : public wxWindow
|
1305
1313
|
# {
|
1306
1314
|
# public:
|
@@ -1314,6 +1322,7 @@ module Wx
|
|
1314
1322
|
# Create(parent, ...);
|
1315
1323
|
# }
|
1316
1324
|
# };
|
1325
|
+
# ```
|
1317
1326
|
# @see Wx::Window#set_background_colour
|
1318
1327
|
# @see Wx::Window#get_foreground_colour
|
1319
1328
|
# @see Wx::Window#set_transparent
|
@@ -1468,7 +1477,9 @@ module Wx
|
|
1468
1477
|
def handle_as_navigation_key(event) end
|
1469
1478
|
|
1470
1479
|
# Shorthand for:
|
1471
|
-
#
|
1480
|
+
# ```
|
1481
|
+
# GetEventHandler()->SafelyProcessEvent(event);
|
1482
|
+
# ```
|
1472
1483
|
# @see Wx::Window#process_window_event
|
1473
1484
|
# @param event [Wx::Event]
|
1474
1485
|
# @return [true,false]
|
@@ -1476,8 +1487,9 @@ module Wx
|
|
1476
1487
|
|
1477
1488
|
# Convenient wrapper for {Wx::Window#process_event}.
|
1478
1489
|
# This is the same as writing
|
1479
|
-
#
|
1490
|
+
# ```
|
1480
1491
|
# GetEventHandler()->ProcessEvent(event);
|
1492
|
+
# ```
|
1481
1493
|
# but more convenient. Notice that {Wx::Window#process_event} itself can't be called for {Wx::Window} objects as it ignores the event handlers associated with the window; use this function instead.
|
1482
1494
|
# @param event [Wx::Event]
|
1483
1495
|
# @return [true,false]
|
@@ -1493,9 +1505,10 @@ module Wx
|
|
1493
1505
|
# An event handler is an object that is capable of processing the events sent to a window. By default, the window is its own event handler, but an application may wish to substitute another, for example to allow central implementation of event-handling for a variety of different window classes.
|
1494
1506
|
# {Wx::Window#push_event_handler} allows an application to set up a stack of event handlers, where an event not handled by one event handler is handed to the next one in the chain.
|
1495
1507
|
# E.g. if you have two event handlers A and B and a {Wx::Window} instance W and you call:
|
1496
|
-
#
|
1508
|
+
# ```
|
1497
1509
|
# W->PushEventHandler(A);
|
1498
1510
|
# W->PushEventHandler(B);
|
1511
|
+
# ```
|
1499
1512
|
# you will end up with the following situation:
|
1500
1513
|
#
|
1501
1514
|
# Note that you can use {Wx::Window#pop_event_handler} to remove the event handler.
|
@@ -1704,10 +1717,11 @@ module Wx
|
|
1704
1717
|
# Enable or disable the window for user input.
|
1705
1718
|
# Note that when a parent window is disabled, all of its children are disabled as well and they are re-enabled again when the parent is.
|
1706
1719
|
# A window can be created initially disabled by calling this method on it before calling {Wx::Window#create} to create the actual underlying window, e.g.
|
1707
|
-
#
|
1720
|
+
# ```
|
1708
1721
|
# wxWindow* w = new MyWindow(); // Note: default ctor is used here.
|
1709
1722
|
# w->Enable(false);
|
1710
1723
|
# w->Create(parent, ... all the usual non-default ctor arguments ...);
|
1724
|
+
# ```
|
1711
1725
|
#
|
1712
1726
|
# Returns true if the window has been enabled or disabled, false if nothing was done, i.e. if the window had already been in the specified state.
|
1713
1727
|
# @see Wx::Window#is_enabled
|
@@ -2074,7 +2088,7 @@ module Wx
|
|
2074
2088
|
# Return the cursor associated with this window.
|
2075
2089
|
#
|
2076
2090
|
# @see Wx::Window#set_cursor
|
2077
|
-
# @return [
|
2091
|
+
# @return [Wx::Cursor]
|
2078
2092
|
def get_cursor; end
|
2079
2093
|
alias_method :cursor, :get_cursor
|
2080
2094
|
|
@@ -2123,8 +2137,9 @@ module Wx
|
|
2123
2137
|
|
2124
2138
|
# Request generation of touch events for this window.
|
2125
2139
|
# Each call to this function supersedes the previous ones, i.e. if you want to receive events for both zoom and rotate gestures, you need to call
|
2126
|
-
#
|
2140
|
+
# ```
|
2127
2141
|
# EnableTouchEvents(wxTOUCH_ZOOM_GESTURE | wxTOUCH_ROTATE_GESTURE);
|
2142
|
+
# ```
|
2128
2143
|
# instead of calling it twice in a row as the second call would disable the first gesture.
|
2129
2144
|
#
|
2130
2145
|
# true if the specified events were enabled or false if the current platform doesn't support touch events.
|
@@ -2158,6 +2173,7 @@ module Wx
|
|
2158
2173
|
# Does the window-specific updating after processing the update event.
|
2159
2174
|
# This function is called by {Wx::Window#update_window_ui} in order to check return values in the {Wx::UpdateUIEvent} and act appropriately. For example, to allow frame and dialog title updating, wxWidgets implements this function as follows:
|
2160
2175
|
#
|
2176
|
+
# ```
|
2161
2177
|
# // do the window-specific processing after processing the update event
|
2162
2178
|
# void wxTopLevelWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
|
2163
2179
|
# {
|
@@ -2170,6 +2186,7 @@ module Wx
|
|
2170
2186
|
# SetTitle(event.GetText());
|
2171
2187
|
# }
|
2172
2188
|
# }
|
2189
|
+
# ```
|
2173
2190
|
# @param event [Wx::UpdateUIEvent]
|
2174
2191
|
# @return [void]
|
2175
2192
|
def do_update_window_ui(event) end
|
@@ -2254,11 +2271,13 @@ module Wx
|
|
2254
2271
|
# You can call this function from your application to ensure that your UI is up-to-date at this point (as far as your {Wx::UpdateUIEvent} handlers are concerned). This may be necessary if you have called {Wx::UpdateUIEvent.set_mode} or {Wx::UpdateUIEvent.set_update_interval} to limit the overhead that wxWidgets incurs by sending update UI events in idle time. flags should be a bitlist of one or more of the {Wx::UpdateUI} enumeration.
|
2255
2272
|
# If you are calling this function from an OnInternalIdle or OnIdle function, make sure you pass the {Wx::UpdateUI::UPDATE_UI_FROMIDLE} flag, since this tells the window to only update the UI elements that need to be updated in idle time. Some windows update their elements only when necessary, for example when a menu is about to be shown. The following is an example of how to call UpdateWindowUI from an idle function.
|
2256
2273
|
#
|
2274
|
+
# ```
|
2257
2275
|
# void MyWindow::OnInternalIdle()
|
2258
2276
|
# {
|
2259
2277
|
# if (wxUpdateUIEvent::CanUpdate(this))
|
2260
2278
|
# UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
|
2261
2279
|
# }
|
2280
|
+
# ```
|
2262
2281
|
# @see Wx::UpdateUIEvent
|
2263
2282
|
# @see Wx::Window#do_update_window_ui
|
2264
2283
|
# @see Wx::Window#on_internal_idle
|
@@ -2364,15 +2383,16 @@ module Wx
|
|
2364
2383
|
# The non-default constructor of {Wx::Window} class does two things: it initializes the C++ object and it also creates the window object in the underlying graphical toolkit. The {Wx::Window#create} method can be used to perform the second part later, while the default constructor can be used to perform the first part only.
|
2365
2384
|
# Please note that the underlying window must be created exactly once, i.e. if you use the default constructor, which doesn't do this, you must call {Wx::Window#create} before using the window and if you use the non-default constructor, you can not call {Wx::Window#create}, as the underlying window is already created.
|
2366
2385
|
# Note that it is possible and, in fact, useful, to call some methods on the object between creating the C++ object itself and calling {Wx::Window#create} on it, e.g. a common pattern to avoid showing the contents of a window before it is fully initialized is:
|
2367
|
-
#
|
2386
|
+
# ```
|
2368
2387
|
# wxPanel* panel = new wxPanel(); // Note: default constructor used.
|
2369
2388
|
# panel->Hide(); // Can be called before actually creating it.
|
2370
2389
|
# panel->Create(parent, wxID_ANY, ...); // Won't be shown yet.
|
2371
2390
|
# ... create all the panel children ...
|
2372
2391
|
# panel->Show(); // Now everything will be shown at once.
|
2392
|
+
# ```
|
2373
2393
|
#
|
2374
2394
|
# Also note that it is possible to create an object of a derived type and then call {Wx::Window#create} on it:
|
2375
|
-
#
|
2395
|
+
# ```
|
2376
2396
|
# // Suppose we have this function (which would typically be in a
|
2377
2397
|
# // different translation unit (file) from the rest of the code).
|
2378
2398
|
# wxWindow* MyCreateWindowObjectFunction() {
|
@@ -2391,6 +2411,7 @@ module Wx
|
|
2391
2411
|
# // This calls the base wxWindow::Create() as it is not virtual, so
|
2392
2412
|
# // the derived class can't customize this part.
|
2393
2413
|
# window->Create(parent, wxID_ANY, ...);
|
2414
|
+
# ```
|
2394
2415
|
# This is notably used by XML Based Resource System (XRC).
|
2395
2416
|
# The parameters of this method have exactly the same meaning as the non-default constructor parameters, please refer to them for their description.
|
2396
2417
|
# true if window creation succeeded or false if it failed
|
data/lib/wx/doc/gen/window_dc.rb
CHANGED
@@ -42,10 +42,12 @@ module Wx
|
|
42
42
|
# A helper chaining this page with the next one.
|
43
43
|
# Notice that this method returns a reference to the next page, so the calls to it can, in turn, be chained:
|
44
44
|
#
|
45
|
+
# ```
|
45
46
|
# wxWizardPageSimple* firstPage = new FirstPage;
|
46
47
|
# (*firstPage).Chain(new SecondPage)
|
47
48
|
# .Chain(new ThirdPage)
|
48
49
|
# .Chain(new LastPage);
|
50
|
+
# ```
|
49
51
|
#
|
50
52
|
# This makes this method the simplest way to define the order of changes in fully static wizards, i.e. in those where the order doesn't depend on the choices made by the user in the wizard pages during run-time.
|
51
53
|
#
|
data/lib/wx/doc/gen/xml_node.rb
CHANGED
@@ -104,6 +104,8 @@ module Wx
|
|
104
104
|
# @see Wx::XmlAttribute
|
105
105
|
#
|
106
106
|
#
|
107
|
+
#
|
108
|
+
# @note This class is <b>untracked</b> and should not be derived from nor instances extended!
|
107
109
|
class XmlNode < ::Object
|
108
110
|
|
109
111
|
# @overload initialize(type, name, content=(''), lineNo=-1)
|
@@ -193,13 +195,17 @@ module Wx
|
|
193
195
|
# Returns the content of the first child node of type {Wx::XmlNodeType::XML_TEXT_NODE} or {Wx::XmlNodeType::XML_CDATA_SECTION_NODE}.
|
194
196
|
# This function is very useful since the XML snippet <code>"tagnametagcontent/tagname"</code> is represented by expat with the following tag tree:
|
195
197
|
#
|
198
|
+
# ```
|
196
199
|
# wxXML_ELEMENT_NODE name="tagname", content=""
|
197
200
|
# |-- wxXML_TEXT_NODE name="", content="tagcontent"
|
201
|
+
# ```
|
198
202
|
#
|
199
203
|
# or eventually:
|
200
204
|
#
|
205
|
+
# ```
|
201
206
|
# wxXML_ELEMENT_NODE name="tagname", content=""
|
202
207
|
# |-- wxXML_CDATA_SECTION_NODE name="", content="tagcontent"
|
208
|
+
# ```
|
203
209
|
#
|
204
210
|
# An empty string is returned if the node has no children of type {Wx::XmlNodeType::XML_TEXT_NODE} or {Wx::XmlNodeType::XML_CDATA_SECTION_NODE}, or if the content of the first child of such types is empty.
|
205
211
|
# @return [String]
|
@@ -104,9 +104,10 @@ module Wx
|
|
104
104
|
|
105
105
|
# Loads resources from XML files that match given filemask.
|
106
106
|
# Example:
|
107
|
-
#
|
107
|
+
# ```
|
108
108
|
# if (!wxXmlResource::Get()->Load("rc/*.xrc"))
|
109
109
|
# wxLogError("Couldn't load resources!");
|
110
|
+
# ```
|
110
111
|
#
|
111
112
|
# If {Wx::USE_FILESYS} is enabled, this method understands {Wx::FileSystem} URLs (see Wx::FileSystem#find_first).
|
112
113
|
#
|
@@ -150,9 +151,11 @@ module Wx
|
|
150
151
|
# parent points to parent window (if any).
|
151
152
|
# This form is used to finish creation of an already existing instance (the main reason for this is that you may want to use derived class with a new event table). Example:
|
152
153
|
#
|
154
|
+
# ```
|
153
155
|
# MyDialog dlg;
|
154
156
|
# wxXmlResource::Get()->LoadDialog(&dlg, mainFrame, "my_dialog");
|
155
157
|
# dlg.ShowModal();
|
158
|
+
# ```
|
156
159
|
# @param dlg [Wx::Dialog]
|
157
160
|
# @param parent [Wx::Window]
|
158
161
|
# @param name [String]
|
@@ -0,0 +1,75 @@
|
|
1
|
+
|
2
|
+
module Wx
|
3
|
+
|
4
|
+
class MemoryDC < Wx::DC
|
5
|
+
|
6
|
+
# Creates a Memory DC and passes that to the given block to draw on.
|
7
|
+
# Automatically unselects any source object of the MemoryDC after the block finishes.
|
8
|
+
# @overload self.draw_on()
|
9
|
+
# @yieldparam [Wx::MemoryDC] dc
|
10
|
+
# @overload self.draw_on(bitmap)
|
11
|
+
# @param [Wx::Bitmap]
|
12
|
+
# @yieldparam [Wx::MemoryDC] dc
|
13
|
+
# @overload self.draw_on(dc)
|
14
|
+
# @param [Wx::DC]
|
15
|
+
# @yieldparam [Wx::MemoryDC] dc
|
16
|
+
def self.draw_on(*arg) end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
class BufferedDC < Wx::MemoryDC
|
21
|
+
|
22
|
+
# Creates a Buffered DC and passes that to the given block to draw on.
|
23
|
+
# Destroys the DC after the block returns.
|
24
|
+
# @overload self.draw_on()
|
25
|
+
# Creates a buffer for the provided dc.
|
26
|
+
# @yieldparam [Wx::BufferedDC] dc
|
27
|
+
# @overload self.draw_on(tgt, area, style=Wx::BUFFER_CLIENT_AREA)
|
28
|
+
# Creates a buffer for the provided dc. #init must not be called when using this constructor.
|
29
|
+
# @param [Wx::DC] tgt The underlying DC: everything drawn to this object will be flushed to this DC when this object is destroyed. You may pass nil in order to just initialize the buffer, and not flush it.
|
30
|
+
# @param [Wx::Size] area The size of the bitmap to be used for buffering (this bitmap is created internally when it is not given explicitly).
|
31
|
+
# @param [Integer] style Wx::BUFFER_CLIENT_AREA to indicate that just the client area of the window is buffered, or Wx::BUFFER_VIRTUAL_AREA to indicate that the buffer bitmap covers the virtual area.
|
32
|
+
# @yieldparam [Wx::BufferedDC] dc
|
33
|
+
# @overload self.draw_on(tgt, buffer=Wx::NULL_BITMAP, style=Wx::BUFFER_CLIENT_AREA)
|
34
|
+
# Creates a buffer for the provided dc. #init must not be called when using this constructor.
|
35
|
+
# @param [Wx::DC] tgt The underlying DC: everything drawn to this object will be flushed to this DC when this object is destroyed. You may pass nil in order to just initialize the buffer, and not flush it.
|
36
|
+
# @param [Wx::Bitmap] buffer Explicitly provided bitmap to be used for buffering: this is the most efficient solution as the bitmap doesn't have to be recreated each time but it also requires more memory as the bitmap is never freed. The bitmap should have appropriate size, anything drawn outside of its bounds is clipped.
|
37
|
+
# @param [Integer] style Wx::BUFFER_CLIENT_AREA to indicate that just the client area of the window is buffered, or Wx::BUFFER_VIRTUAL_AREA to indicate that the buffer bitmap covers the virtual area.
|
38
|
+
# @yieldparam [Wx::BufferedDC] dc
|
39
|
+
def self.draw_on(*arg) end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
class BufferedPaintDC < Wx::BufferedDC
|
44
|
+
|
45
|
+
# Creates a Buffered DC and passes that to the given block to draw on.
|
46
|
+
# Destroys the DC after the block returns.
|
47
|
+
# As with Wx::BufferedDC, you may either provide the bitmap to be used for buffering or let this object create one internally (in the latter case, the size of the client part of the window is used).
|
48
|
+
#
|
49
|
+
# Pass W::xBUFFER_CLIENT_AREA for the style parameter to indicate that just the client area of the window is buffered, or Wx::BUFFER_VIRTUAL_AREA to indicate that the buffer bitmap covers the virtual area.
|
50
|
+
# @overload self.draw_on(win, style=Wx::BUFFER_CLIENT_AREA)
|
51
|
+
# @param [Wx::Window] win The underlying window; everything drawn to this object will be flushed to this window when this object is destroyed.
|
52
|
+
# @param [Integer] style Wx::BUFFER_CLIENT_AREA to indicate that just the client area of the window is buffered, or Wx::BUFFER_VIRTUAL_AREA to indicate that the buffer bitmap covers the virtual area.
|
53
|
+
# @yieldparam [Wx::BufferedPaintDC] dc
|
54
|
+
# @overload self.draw_on(win, buffer=Wx::NULL_BITMAP, style=Wx::BUFFER_CLIENT_AREA)
|
55
|
+
# @param [Wx::Window] win The underlying window; everything drawn to this object will be flushed to this window when this object is destroyed.
|
56
|
+
# @param [Wx::Bitmap] buffer Explicitly provided bitmap to be used for buffering: this is the most efficient solution as the bitmap doesn't have to be recreated each time but it also requires more memory as the bitmap is never freed. The bitmap should have appropriate size, anything drawn outside of its bounds is clipped.
|
57
|
+
# @param [Integer] style Wx::BUFFER_CLIENT_AREA to indicate that just the client area of the window is buffered, or Wx::BUFFER_VIRTUAL_AREA to indicate that the buffer bitmap covers the virtual area.
|
58
|
+
# @yieldparam [Wx::BufferedPaintDC] dc
|
59
|
+
def self.draw_on(*arg) end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
class AutoBufferedPaintDC < Wx::BufferedPaintDC
|
64
|
+
|
65
|
+
# Creates a Buffered DC and passes that to the given block to draw on.
|
66
|
+
# Destroys the DC after the block returns.
|
67
|
+
# Pass a pointer to the window on which you wish to paint.
|
68
|
+
# @note In wxRuby this method mostly exists to be consistent with the other DC classes. It is however recommended to use Wx::Window#paint_buffered instead.
|
69
|
+
# @param [Wx::Window] win The underlying window; everything drawn to this object will be flushed to this window when this object is destroyed.
|
70
|
+
# @yieldparam [Wx::AutoBufferedPaintDC] dc
|
71
|
+
def self.draw_on(win, &block) end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
module Wx
|
3
|
+
|
4
|
+
class MirrorDC < Wx::DC
|
5
|
+
|
6
|
+
# Executes the given block providing a temporary (mirror) dc as
|
7
|
+
# it's single argument.
|
8
|
+
# @param [Wx::DC] dc DC to duplicate the (mirrored) drawing on
|
9
|
+
# @param [Boolean] mirror whether to mirror or not
|
10
|
+
# @yieldparam [Wx::MirrorDC] dc the MirrorDC instance to paint on
|
11
|
+
# @return [Object] result of the block
|
12
|
+
def self.draw_on(dc, mirror) end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
module Wx::PRT
|
3
|
+
|
4
|
+
class PrinterDC < Wx::DC
|
5
|
+
|
6
|
+
# Executes the given block providing a temporary (printer) dc as
|
7
|
+
# it's single argument.
|
8
|
+
# @param [Wx::PRT::PrintData] print_data print_data defining the print settings
|
9
|
+
# @yieldparam [Wx::PrinterDC] dc the PrinterDC instance to paint on
|
10
|
+
# @return [Object] result of the block
|
11
|
+
def self.draw_on(win) end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
class PostScriptDC < Wx::DC
|
16
|
+
|
17
|
+
# Executes the given block providing a temporary (postscript) dc as
|
18
|
+
# it's single argument.
|
19
|
+
# @param [Wx::PRT::PrintData] print_data print_data defining the print settings
|
20
|
+
# @yieldparam [Wx::PostScriptDC] dc the PostScriptDC instance to paint on
|
21
|
+
# @return [Object] result of the block
|
22
|
+
def self.draw_on(win) end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
data/lib/wx/doc/screen_dc.rb
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
|
2
|
-
|
2
|
+
module Wx
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
class ScreenDC < Wx::DC
|
5
|
+
|
6
|
+
# Executes the given block providing a temporary (screen) dc as
|
7
|
+
# it's single argument.
|
8
|
+
# @yieldparam [Wx::ScreenDC] dc the ScreenDC instance to paint on
|
9
|
+
# @return [Object] result of the block
|
10
|
+
def self.draw_on; end
|
11
|
+
|
12
|
+
end
|
9
13
|
|
10
14
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
module Wx
|
3
|
+
|
4
|
+
class SVGFileDC < Wx::DC
|
5
|
+
|
6
|
+
# Executes the given block providing a temporary dc as it's single argument.
|
7
|
+
# Initializes a wxSVGFileDC with the given filename, width and height at dpi resolution, and an optional title.
|
8
|
+
# The title provides a readable name for the SVG document.
|
9
|
+
# @param [String] filename name of file to create
|
10
|
+
# @param [Integer] width width for SVG image
|
11
|
+
# @param [Integer] height height for SVG image
|
12
|
+
# @param [Float] dpi resolution for SVG image
|
13
|
+
# @param [String] title readable name for the SVG document
|
14
|
+
# @yieldparam [Wx::SVGFileDC] dc the SVGFileDC instance to paint on
|
15
|
+
# @return [Object] result of the block
|
16
|
+
def self.draw_on(filename, width=320, height=240, dpi=72, title='') end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
|
2
|
+
class Wx::VListBox
|
3
|
+
|
4
|
+
# Iterate selected items. Returns Enumerator if no block given.
|
5
|
+
# @yieldparam [Integer] sel selected item index
|
6
|
+
# @return [Enumerator,Object] if block given returns last return value of block, Enumerator otherwise
|
7
|
+
def each_selected; end
|
8
|
+
|
9
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
class Wx::WindowDisabler
|
3
|
+
|
4
|
+
# Disables all top level windows of the application (maybe with the exception of one of them) in
|
5
|
+
# and enables them back after the given block has returned.
|
6
|
+
# @param [Wx::Window,nil] to_skip window to exclude from disabling
|
7
|
+
# @return [void]
|
8
|
+
def self.disable(to_skip = nil) end
|
9
|
+
|
10
|
+
end
|
data/lib/wx/html/keyword_defs.rb
CHANGED
@@ -10,13 +10,12 @@ Wx::define_keyword_ctors(Wx::HTML::HtmlWindow) do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
# wxHtmlListBox A listbox showing HTML content
|
13
|
-
|
14
|
-
|
15
|
-
wx_ctor_params :id, :pos, :size, :choices => []
|
16
|
-
wx_ctor_params :style
|
17
|
-
wx_ctor_params :validator, :name => 'listBox'
|
13
|
+
Wx::define_keyword_ctors(Wx::HTML::HtmlListBox) do
|
14
|
+
wx_ctor_params :id, :pos, :size, :style, :name => 'HtmlListBox'
|
18
15
|
end
|
19
16
|
|
20
|
-
Wx::define_keyword_ctors(
|
21
|
-
wx_ctor_params :id, :pos, :size
|
17
|
+
Wx::define_keyword_ctors(Wx::HTML::SimpleHtmlListBox) do
|
18
|
+
wx_ctor_params :id, :pos, :size
|
19
|
+
wx_ctor_params :choices => []
|
20
|
+
wx_ctor_params :style, :validator, :name => 'SimpleHtmlListBox'
|
22
21
|
end
|
data/lib/wx/html/require.rb
CHANGED
@@ -0,0 +1,105 @@
|
|
1
|
+
|
2
|
+
class Wx::HTML::SimpleHtmlListBox
|
3
|
+
|
4
|
+
# Make this a Ruby enumerable so find, find_all, map etc are available
|
5
|
+
include Enumerable
|
6
|
+
|
7
|
+
# Passes each valid item index into the passed block
|
8
|
+
def each
|
9
|
+
get_count.times { | i | yield i }
|
10
|
+
end
|
11
|
+
|
12
|
+
# We need to cache client data in Ruby variables as we cannot access items
|
13
|
+
# during the GC mark phase as for some platforms (WXMSW at least) that would
|
14
|
+
# involve calling methods that would break in that phase.
|
15
|
+
|
16
|
+
def client_data_store
|
17
|
+
@client_data ||= []
|
18
|
+
end
|
19
|
+
private :client_data_store
|
20
|
+
|
21
|
+
wx_set_client_data = instance_method :set_client_data
|
22
|
+
define_method :set_client_data do |item, data|
|
23
|
+
item = item.to_i
|
24
|
+
wx_set_client_data.bind(self).call(item, data)
|
25
|
+
client_data_store[item] = data
|
26
|
+
end
|
27
|
+
|
28
|
+
def get_client_data(item)
|
29
|
+
client_data_store[item.to_i]
|
30
|
+
end
|
31
|
+
|
32
|
+
wx_append = instance_method :append
|
33
|
+
define_method :append do |item, data=nil|
|
34
|
+
if data
|
35
|
+
if ::Array === item
|
36
|
+
if !(::Array === data)
|
37
|
+
::Kernel.raise ::TypeError.new("Expected Array for argument 3")
|
38
|
+
elsif data.size != item.size
|
39
|
+
::Kernel.raise ::ArgumentError.new("item and data array must be equal size")
|
40
|
+
end
|
41
|
+
offs = get_count
|
42
|
+
wx_append.bind(self).call(item)
|
43
|
+
item.size.times { |ix| set_client_data(offs+ix, data[ix]) }
|
44
|
+
else
|
45
|
+
wx_append.bind(self).call(item, data)
|
46
|
+
client_data_store[get_count-1] = data
|
47
|
+
end
|
48
|
+
else
|
49
|
+
wx_append.bind(self).call(item)
|
50
|
+
# no changes to data store
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
wx_insert = instance_method :insert
|
55
|
+
define_method :insert do |item, pos, data=nil|
|
56
|
+
if data
|
57
|
+
if ::Array === item
|
58
|
+
if !(::Array === data)
|
59
|
+
::Kernel.raise ::TypeError.new("Expected Array for argument 3")
|
60
|
+
elsif data.size != item.size
|
61
|
+
::Kernel.raise ::ArgumentError.new("item and data array must be equal size")
|
62
|
+
end
|
63
|
+
wx_insert.bind(self).call(item, pos)
|
64
|
+
client_data_store.insert(pos, *::Array.new(item.size))
|
65
|
+
item.size.times { |ix| set_client_data(pos+ix, data[ix]) }
|
66
|
+
else
|
67
|
+
wx_insert.bind(self).call(item, pos, data)
|
68
|
+
client_data_store.insert(pos, data)
|
69
|
+
end
|
70
|
+
else
|
71
|
+
wx_insert.bind(self).call(item, pos)
|
72
|
+
if ::Array === item
|
73
|
+
client_data_store.insert(pos, *::Array.new(item.size))
|
74
|
+
else
|
75
|
+
client_data_store.insert(pos, nil)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
wx_set = instance_method :set
|
81
|
+
define_method :set do |items, data=nil|
|
82
|
+
if data
|
83
|
+
if !(::Array === data)
|
84
|
+
::Kernel.raise ::TypeError.new("Expected Array for argument 2")
|
85
|
+
elsif data.size != items.size
|
86
|
+
::Kernel.raise ::ArgumentError.new("items and data array must be equal size")
|
87
|
+
end
|
88
|
+
end
|
89
|
+
wx_set.bind(self).call(items)
|
90
|
+
client_data_store.clear
|
91
|
+
items.each_with_index { |item, ix| set_client_data(item, data[ix]) }
|
92
|
+
end
|
93
|
+
|
94
|
+
wx_clear = instance_method :clear
|
95
|
+
define_method :clear do
|
96
|
+
wx_clear.bind(self).call
|
97
|
+
client_data_store.clear
|
98
|
+
end
|
99
|
+
|
100
|
+
wx_delete = instance_method :delete
|
101
|
+
define_method :delete do |item|
|
102
|
+
wx_delete.bind(self).call(item.to_i)
|
103
|
+
client_data_store.slice!(item.to_i)
|
104
|
+
end
|
105
|
+
end
|
data/lib/wx/keyword_defs.rb
CHANGED
@@ -296,6 +296,13 @@ Wx::define_keyword_ctors('CheckBox') do
|
|
296
296
|
wx_ctor_params :validator, :name => 'checkBox'
|
297
297
|
end
|
298
298
|
|
299
|
+
# wxListBox A list of strings for single or multiple selection
|
300
|
+
Wx::define_keyword_ctors('ListBox') do
|
301
|
+
wx_ctor_params :id, :pos, :size, :choices => []
|
302
|
+
wx_ctor_params :style
|
303
|
+
wx_ctor_params :validator, :name => 'listBox'
|
304
|
+
end
|
305
|
+
|
299
306
|
# A listbox with a checkbox to the left of each item
|
300
307
|
Wx::define_keyword_ctors('CheckListBox') do
|
301
308
|
wx_ctor_params :id, :pos, :size, :choices, :style
|
data/lib/wx/version.rb
CHANGED