wxruby3 0.9.0.pre.rc.1 → 0.9.0.pre.rc.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/INSTALL.md +73 -22
- data/README.md +40 -8
- data/assets/hello_button-macos.png +0 -0
- data/assets/hello_button-msw.png +0 -0
- data/assets/hello_button_clicked-macos.png +0 -0
- data/assets/hello_button_clicked-msw.png +0 -0
- data/assets/hello_button_clicked_combi.png +0 -0
- data/assets/hello_world-macos.png +0 -0
- data/assets/hello_world-msw.png +0 -0
- data/assets/hello_world_combi.png +0 -0
- data/ext/wxruby3/swig/wx.i +2 -0
- data/lib/wx/core/brush.rb +6 -0
- data/lib/wx/core/event_loop.rb +7 -0
- data/lib/wx/core/evthandler.rb +12 -2
- data/lib/wx/core/font.rb +22 -14
- data/lib/wx/core/helpprovider.rb +2 -2
- data/lib/wx/core/image.rb +33 -0
- data/lib/wx/core/listctrl.rb +17 -13
- data/lib/wx/core/log.rb +90 -0
- data/lib/wx/core/menu.rb +5 -0
- data/lib/wx/core/pen.rb +6 -0
- data/lib/wx/core/window.rb +28 -1
- data/lib/wx/doc/app.rb +40 -0
- data/lib/wx/doc/bitmap.rb +11 -15
- data/lib/wx/doc/brush.rb +17 -0
- data/lib/wx/doc/event_loop.rb +7 -0
- data/lib/wx/doc/extra/00_starting.md +6 -6
- data/lib/wx/doc/extra/02_lifecycles.md +9 -8
- data/lib/wx/doc/extra/09_exceptions.md +1 -1
- data/lib/wx/doc/extra/11_drawing_and_dc.md +4 -4
- data/lib/wx/doc/font.rb +27 -0
- data/lib/wx/doc/functions.rb +51 -23
- data/lib/wx/doc/gc_dc.rb +1 -1
- data/lib/wx/doc/image.rb +42 -12
- data/lib/wx/doc/list_ctrl.rb +32 -0
- data/lib/wx/doc/log.rb +28 -0
- data/lib/wx/doc/pen.rb +17 -0
- data/lib/wx/doc/prt/printer_dc.rb +2 -2
- data/lib/wx/doc/radio_box.rb +20 -0
- data/lib/wx/doc/scaled_dc.rb +1 -1
- data/lib/wx/doc/text_validator.rb +12 -0
- data/lib/wx/doc/window.rb +27 -0
- data/lib/wx/keyword_defs.rb +77 -76
- data/lib/wx/prt/keyword_defs.rb +5 -1
- data/lib/wx/version.rb +1 -1
- data/rakelib/install.rb +17 -6
- data/rakelib/lib/config/linux.rb +4 -2
- data/rakelib/lib/config/macosx.rb +120 -1
- data/rakelib/lib/config/mingw.rb +6 -1
- data/rakelib/lib/config/unixish.rb +26 -11
- data/rakelib/lib/config.rb +15 -6
- data/rakelib/lib/core/mapping.rb +15 -10
- data/rakelib/lib/core/package.rb +4 -1
- data/rakelib/lib/core/spec.rb +23 -12
- data/rakelib/lib/core/spec_helper.rb +6 -0
- data/rakelib/lib/director/app.rb +30 -1
- data/rakelib/lib/director/aui_toolbar.rb +41 -0
- data/rakelib/lib/director/brush.rb +10 -1
- data/rakelib/lib/director/combobox.rb +1 -1
- data/rakelib/lib/director/context_help_button.rb +23 -0
- data/rakelib/lib/director/dialog.rb +33 -2
- data/rakelib/lib/director/event_loop.rb +26 -0
- data/rakelib/lib/director/font.rb +12 -3
- data/rakelib/lib/director/functions.rb +44 -48
- data/rakelib/lib/director/help_provider.rb +8 -10
- data/rakelib/lib/director/hyperlink_event.rb +22 -0
- data/rakelib/lib/director/image.rb +32 -0
- data/rakelib/lib/director/list_ctrl.rb +3 -2
- data/rakelib/lib/director/log.rb +64 -4
- data/rakelib/lib/director/menu.rb +0 -3
- data/rakelib/lib/director/menu_bar.rb +3 -0
- data/rakelib/lib/director/pen.rb +10 -1
- data/rakelib/lib/director/popup_window.rb +18 -0
- data/rakelib/lib/director/radio_box.rb +15 -4
- data/rakelib/lib/director/searchctrl.rb +2 -1
- data/rakelib/lib/director/static_box.rb +1 -1
- data/rakelib/lib/director/styled_text_ctrl.rb +1 -1
- data/rakelib/lib/director/text_entry.rb +30 -0
- data/rakelib/lib/director/text_validator.rb +8 -2
- data/rakelib/lib/director/textctrl.rb +1 -1
- data/rakelib/lib/director/variant.rb +17 -4
- data/rakelib/lib/director/window.rb +37 -1
- data/rakelib/lib/extractor/function.rb +7 -7
- data/rakelib/lib/extractor/variable.rb +6 -6
- data/rakelib/lib/generate/doc/aui_manager.yaml +21 -0
- data/rakelib/lib/generate/doc/context_help_button.yaml +16 -0
- data/rakelib/lib/generate/doc/event_blocker.yaml +27 -0
- data/rakelib/lib/generate/doc/event_filter.yaml +47 -0
- data/rakelib/lib/generate/doc/file_dialog.yaml +68 -0
- data/rakelib/lib/generate/doc/font.yaml +29 -0
- data/rakelib/lib/generate/doc/frame.yaml +23 -0
- data/rakelib/lib/generate/doc/fs_file.yaml +11 -0
- data/rakelib/lib/generate/doc/gdi_common.yaml +36 -0
- data/rakelib/lib/generate/doc/graphics_context.yaml +34 -0
- data/rakelib/lib/generate/doc/gui_event_loop.yaml +12 -0
- data/rakelib/lib/generate/doc/help_controller.yaml +24 -0
- data/rakelib/lib/generate/doc/icon.yaml +11 -0
- data/rakelib/lib/generate/doc/image.yaml +87 -0
- data/rakelib/lib/generate/doc/keyboard_state.yaml +19 -0
- data/rakelib/lib/generate/doc/list_ctrl.yaml +77 -0
- data/rakelib/lib/generate/doc/locale.yaml +12 -0
- data/rakelib/lib/generate/doc/log.yaml +86 -0
- data/rakelib/lib/generate/doc/mdi_frame.yaml +12 -0
- data/rakelib/lib/generate/doc/memory_dc.yaml +42 -0
- data/rakelib/lib/generate/doc/menu.yaml +17 -0
- data/rakelib/lib/generate/doc/menu_item.yaml +43 -0
- data/rakelib/lib/generate/doc/message_dialog.yaml +36 -0
- data/rakelib/lib/generate/doc/non_owned_window.yaml +14 -0
- data/rakelib/lib/generate/doc/notebook.yaml +18 -0
- data/rakelib/lib/generate/doc/pen.yaml +11 -0
- data/rakelib/lib/generate/doc/picker_base.yaml +19 -0
- data/rakelib/lib/generate/doc/platform_info.yaml +15 -0
- data/rakelib/lib/generate/doc/property_sheet_dialog.yaml +26 -0
- data/rakelib/lib/generate/doc/scroll_bar.yaml +11 -0
- data/rakelib/lib/generate/doc/scrolled_canvas.yaml +37 -0
- data/rakelib/lib/generate/doc/scrolled_control.yaml +37 -0
- data/rakelib/lib/generate/doc/scrolled_window.yaml +37 -0
- data/rakelib/lib/generate/doc/sizer.yaml +69 -0
- data/rakelib/lib/generate/doc/splash_screen.yaml +18 -0
- data/rakelib/lib/generate/doc/static_box.yaml +52 -0
- data/rakelib/lib/generate/doc/static_box_sizer.yaml +22 -0
- data/rakelib/lib/generate/doc/svg_file_dc.yaml +11 -0
- data/rakelib/lib/generate/doc/text_ctrl.yaml +19 -0
- data/rakelib/lib/generate/doc/text_entry.yaml +42 -0
- data/rakelib/lib/generate/doc/text_entry_dialog.yaml +17 -0
- data/rakelib/lib/generate/doc/timer_event.yaml +28 -0
- data/rakelib/lib/generate/doc/tool_bar.yaml +35 -0
- data/rakelib/lib/generate/doc/top_level_window.yaml +23 -0
- data/rakelib/lib/generate/doc/validator.yaml +12 -0
- data/rakelib/lib/generate/doc/variant.yaml +29 -0
- data/rakelib/lib/generate/doc/window.yaml +249 -0
- data/rakelib/lib/generate/doc/wizard_page_simple.yaml +14 -0
- data/rakelib/lib/generate/doc/xml_node.yaml +7 -0
- data/rakelib/lib/generate/doc/xml_resource.yaml +27 -0
- data/rakelib/lib/generate/doc.rb +36 -2
- data/rakelib/lib/generate/interface.rb +11 -10
- data/rakelib/lib/specs/interfaces.rb +5 -1
- data/rakelib/lib/swig_runner.rb +37 -0
- data/samples/aui/aui.rb +432 -363
- data/samples/propgrid/propgrid.rb +3 -0
- data/samples/sampler/editor.rb +33 -25
- data/samples/sampler/sample.rb +2 -2
- data/samples/sampler/stc_editor.rb +4 -2
- data/tests/lib/item_container_tests.rb +82 -0
- data/tests/lib/text_entry_tests.rb +80 -0
- data/tests/lib/wxapp_runner.rb +12 -0
- data/tests/lib/wxframe_runner.rb +89 -4
- data/tests/test_art.rb +9 -0
- data/tests/test_box_sizer.rb +161 -0
- data/tests/test_ext_controls.rb +28 -0
- data/tests/test_font.rb +239 -0
- data/tests/test_grid_sizer.rb +148 -0
- data/tests/test_intl.rb +5 -1
- data/tests/test_list_ctrl.rb +53 -0
- data/tests/test_log.rb +163 -0
- data/tests/test_std_controls.rb +321 -37
- data/tests/test_timer.rb +95 -0
- data/tests/test_window.rb +340 -0
- metadata +85 -2
data/lib/wx/doc/app.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
class Wx::App
|
3
|
+
|
4
|
+
# Set the menu item id for the About menu item.
|
5
|
+
# Default is {Wx::ID_ABOUT}
|
6
|
+
# @param [Integer] id
|
7
|
+
def set_mac_about_menu_itemid(id) end
|
8
|
+
alias :mac_about_menu_itemid= :set_mac_about_menu_itemid
|
9
|
+
|
10
|
+
# Get the current menu item id for the About menu item.
|
11
|
+
# Default is {Wx::ID_ABOUT}
|
12
|
+
# @return [Integer]
|
13
|
+
def get_mac_about_menu_itemid(id) end
|
14
|
+
alias :mac_about_menu_itemid :get_mac_about_menu_itemid
|
15
|
+
|
16
|
+
# Set the menu item id for the Preferences menu item.
|
17
|
+
# Default is {Wx::ID_PREFERENCES}
|
18
|
+
# @param [Integer] id
|
19
|
+
def set_mac_preferences_menu_itemid(id) end
|
20
|
+
alias :mac_preferences_menu_itemid= :set_mac_preferences_menu_itemid
|
21
|
+
|
22
|
+
# Get the current menu item id for the Preferences menu item.
|
23
|
+
# Default is {Wx::ID_PREFERENCES}
|
24
|
+
# @return [Integer]
|
25
|
+
def get_mac_preferences_menu_itemid(id) end
|
26
|
+
alias :mac_preferences_menu_itemid :get_mac_preferences_menu_itemid
|
27
|
+
|
28
|
+
# Set the menu item id for the Exit menu item.
|
29
|
+
# Default is {Wx::ID_EXIT}
|
30
|
+
# @param [Integer] id
|
31
|
+
def set_mac_exit_menu_itemid(id) end
|
32
|
+
alias :mac_exit_menu_itemid= :set_mac_exit_menu_itemid
|
33
|
+
|
34
|
+
# Get the current menu item id for the Exit menu item.
|
35
|
+
# Default is {Wx::ID_EXIT}
|
36
|
+
# @return [Integer]
|
37
|
+
def get_mac_exit_menu_itemid(id) end
|
38
|
+
alias :mac_exit_menu_itemid :get_mac_exit_menu_itemid
|
39
|
+
|
40
|
+
end
|
data/lib/wx/doc/bitmap.rb
CHANGED
@@ -8,20 +8,16 @@ module Wx
|
|
8
8
|
# Default BitmapType for current platform. Actual value is platform dependent.
|
9
9
|
CURSOR_DEFAULT_TYPE = Wx::BitmapType::BITMAP_TYPE_ANY
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
# @see Wx::ArtLocator::find_art
|
23
|
-
def self.Bitmap(name, bmp_type = nil); end
|
24
|
-
|
25
|
-
end
|
11
|
+
# Searches for an art file with basename 'name' and creates a Bitmap if found.
|
12
|
+
# Raises an ArgumentError if not found.
|
13
|
+
# Wx::ArtLocator::find_art is used to look up the art file using ::Kernel#caller_locations to
|
14
|
+
# determine the values for the 'art_path' and 'art_owner' arguments ('art_path' is set to the
|
15
|
+
# absolute path to the folder holding the caller's code and 'art_owner' to the basename of the
|
16
|
+
# caller's source file). The 'art_type' argument is set to <code>:icon</code>.
|
17
|
+
# @param [String,Symbol] name base name of art file
|
18
|
+
# @param [Wx::BitmapType,nil] bmp_type bitmap type for art file (nil means any supported type)
|
19
|
+
# @return [Wx::Bitmap]
|
20
|
+
# @see Wx::ArtLocator::find_art
|
21
|
+
def self.Bitmap(name, bmp_type = nil); end
|
26
22
|
|
27
23
|
end
|
data/lib/wx/doc/brush.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
module Wx
|
3
|
+
|
4
|
+
class Brush
|
5
|
+
|
6
|
+
# Finds a brush with the specified attributes in the global list and returns it, else creates a new brush, adds it to the global brush list, and returns it.
|
7
|
+
# @param [Wx::Colour,String,Symbol] colour The Brush colour.
|
8
|
+
# @param [Wx::BrushStyle] style The brush style. See {Wx::BrushStyle} for a list of the styles.
|
9
|
+
# @return [Wx::Brush]
|
10
|
+
def self.find_or_create_brush(colour, style=Wx::BrushStyle::BRUSHSTYLE_SOLID) end
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
# In wxRuby this is simply an alias for the Brush class.
|
15
|
+
TheBrushList = Wx::Brush
|
16
|
+
|
17
|
+
end
|
@@ -18,9 +18,9 @@ is available for anyone to look at and use in any way they like. Also, anyone ca
|
|
18
18
|
and enhancements to the project.
|
19
19
|
|
20
20
|
Like wxWidgets wxRuby is a cross platform toolkit. This means that the same program will run on multiple platforms
|
21
|
-
without modification. Currently Supported platforms are Microsoft Windows and Linux or other
|
22
|
-
unix-like systems with GTK2 or GTK3 libraries.
|
23
|
-
|
21
|
+
without modification. Currently Supported platforms are Microsoft Windows, MacOSX and Linux or other
|
22
|
+
unix-like systems with GTK2 or GTK3 libraries. Contributions to achieve support for other wxWidgets supported platforms
|
23
|
+
are appreciated.
|
24
24
|
|
25
25
|
Since the programming language is Ruby, wxRuby programs are simple and easy to write and understand. To accomplish the
|
26
26
|
full Ruby experience wxRuby has not ported the wxWidgets API 1 on 1 to Ruby but has made an effort to make the wxRuby
|
@@ -75,7 +75,7 @@ require 'wx'
|
|
75
75
|
Wx::App.run { puts 'Hello world!' }
|
76
76
|
```
|
77
77
|
|
78
|
-
As you can there is no obligation to create an instance of the Wx::App class in wxRuby for
|
78
|
+
As you can see there is no obligation to create an instance of the Wx::App class in wxRuby for
|
79
79
|
(admittedly extremely) simple applications. Calling the #run class method with a block will suffice.<br>
|
80
80
|
The class method will create an instance of the generic Wx::App class under the hood and use the
|
81
81
|
provided block as the #on_init callback. As the code inside the block returns a false-type value (#puts
|
@@ -127,8 +127,8 @@ When creating #on_init/#on_exit methods it is important to understand that those
|
|
127
127
|
with wxWidgets itself). The base Wx::App class actually does not define these methods so it's also not needed (even not possible)
|
128
128
|
to call `super` in the implementation. The wxRuby application class implementation will call the wxWidget OnInit base implementation
|
129
129
|
itself and after successful completion check for the existence of an #on_init method (which could also be 'automagicallly'
|
130
|
-
created from a block passed to #run) and call that if available or terminate the application if not.
|
131
|
-
exit sequence
|
130
|
+
created from a block passed to #run) and call that if available or terminate the application if not. The
|
131
|
+
exit sequence of executions are similar but reversed (first a possible #on_exit method and than the wxWidgets base OnExit).
|
132
132
|
|
133
133
|
What remains though is that for a derived application class it is still not necessary to explicitly create a class instance.
|
134
134
|
Simply calling the #run class method will suffice.
|
@@ -76,7 +76,7 @@ As mentioned above the wxWidgets GUI framework resources will only be fully init
|
|
76
76
|
starts. Likewise the framework resources will be de-initialized (deleted) after `#on_exit` method ends which means that
|
77
77
|
your application should not attempt to access any of these resources (windows, fonts, colours etc.) after that moment.
|
78
78
|
|
79
|
-
Also, largely because of the way the wxWidgets framework is designed but also because of
|
79
|
+
Also, largely because of the way the wxWidgets framework is designed but also because of the way this meshes with Ruby
|
80
80
|
GC, there is no safe way to re-initialize the framework after an application instance ends it run. This means you
|
81
81
|
**cannot** safely attempt to start another application instance after a previous (first) one has ended.
|
82
82
|
|
@@ -120,7 +120,7 @@ therefor provides special support to ease handling the destruction of these. See
|
|
120
120
|
One of the trickier things to handle correctly in the kind of native extensions like wxRuby is maintaining object
|
121
121
|
identities i.e. keeping native instances synced with their Ruby wrapper counter parts.
|
122
122
|
|
123
|
-
Whenever a native extension is allowed to call back into Ruby space we encounter the problem
|
123
|
+
Whenever a native extension is allowed to call back into Ruby space we encounter the problem that we need to map any
|
124
124
|
native object data provided for the call to the right Ruby types and when necessary to the right Ruby instance (object
|
125
125
|
identity).
|
126
126
|
|
@@ -131,8 +131,8 @@ passing them on to Ruby space.
|
|
131
131
|
For a lot of other objects though it is essential to not only map to the right **most derived** class type but also to
|
132
132
|
the exact Ruby instance which was originally instantiated as wrapper for the native object if any exists (in case no
|
133
133
|
Ruby instance existed yet a new instance of the correct **most derived** class should be instantiated at that point).
|
134
|
-
The reason this is important is 1
|
135
|
-
reference other data and/or functionality related to that specific Ruby/native pair and 2
|
134
|
+
The reason this is important is **1.** because the Ruby instance may have been used to identify, link to or otherwise
|
135
|
+
reference other data and/or functionality related to that specific Ruby/native pair and **2.** the Ruby instance could
|
136
136
|
contain data elements (instance variables) related to that specific Ruby/native pair.<br>
|
137
137
|
In the case of wxRuby Window instance for example it is common to derive custom Window classes with custom behaviour and
|
138
138
|
corresponding instance variables that drive that behaviour. When an event handler or an overloaded native method is passed
|
@@ -155,11 +155,12 @@ There are however quite a lot of wrapped native objects in wxRuby for which *obj
|
|
155
155
|
object tracking has been disabled for their classes. This means these kind of classes/object should **not** be derived from
|
156
156
|
(if even possible and/or useful) to add functionality/information or their identity used as key to link other information.<br>
|
157
157
|
These classes include:
|
158
|
-
|
158
|
+
* classes considered POD types like Wx::Size, Wx::Point, Wx::RealPoint, Wx::Rect, Wx::GBSpan, Wx::GBPosition, Wx::BusyInfoFlags,
|
159
159
|
Wx::AboutDialogInfo
|
160
|
-
|
160
|
+
* final non-instantiatable classes like the Wx::DC (Device Context) class family, Wx::GraphicsContext, Wx::WindowsDisabler,
|
161
161
|
Wx::EventBlocker, Wx::BusyInfo
|
162
|
-
|
163
|
-
|
162
|
+
* classes with native singleton objects like Wx::Clipboard
|
163
|
+
* the reference counted GDI objects like Wx::Pen, Wx::Brush, Wx::Colour, Wx::Cursor, Wx::Bitmap, Wx::Icon and similar
|
164
|
+
reference counted objects like Wx::Font
|
164
165
|
|
165
166
|
The reference documentation will note untracked object classes.
|
@@ -15,7 +15,7 @@ your own Ruby application code.
|
|
15
15
|
|
16
16
|
Any exceptions raised from wxRuby wrapper code signal coding errors that need to be rectified.
|
17
17
|
|
18
|
-
As far as handling application code exceptions is concerned the same advice applies as for wxWidgets itself; do **
|
18
|
+
As far as handling application code exceptions is concerned the same advice applies as for wxWidgets itself; do **NOT**
|
19
19
|
let exceptions escape your event handlers meaning that if you can reasonably expect application code to raise exceptions
|
20
20
|
you should make sure to catch any such exceptions within the context of the event handler like:
|
21
21
|
|
@@ -12,9 +12,9 @@ device context object is destroyed.
|
|
12
12
|
For this reason the common practice in wxWidgets C++ code would be to create temporary DC objects on the
|
13
13
|
stack and draw on them while they are in scope (for several classes it is even strongly advised to never create
|
14
14
|
them any other way and to never keep objects alive out of scope). When leaving the scope these object would than be
|
15
|
-
automatically destroyed and
|
15
|
+
automatically destroyed and any buffered output flushed to the final target.
|
16
16
|
|
17
|
-
In Ruby this approach is impossible as Ruby is a purely dynamic language and does not **this kind** of scope bound
|
17
|
+
In Ruby this approach is impossible as Ruby is a purely dynamic language and does not support **this kind** of scope bound
|
18
18
|
life cycles. Any DC object created would have to be dynamically created and due to the properties of the GC driven
|
19
19
|
life cycles could well be kept alive beyond the scope of it's creation. This will not always cause problems but could
|
20
20
|
and does not really have an upside.
|
@@ -24,7 +24,7 @@ cannot be instantiated using `new`. Rather all `Wx::DC` derived classes provide
|
|
24
24
|
temporary dc objects that will be passed on to blocks given and will only exist for the duration of the execution of
|
25
25
|
the block. This will guarantee proper DC cleanup when leaving it's usage scope.
|
26
26
|
|
27
|
-
> Note that it is a **BAD** idea to think about storing the dc reference
|
27
|
+
> Note that it is a **BAD** idea to think about storing the dc reference provided to the block for later access!
|
28
28
|
|
29
29
|
A typical usage of a `::draw_on` method would be:
|
30
30
|
|
@@ -48,7 +48,7 @@ The `Wx::PaintDC` and `Wx::AutoBufferedPaintDC` classes provide `::draw_on` meth
|
|
48
48
|
this is mostly to be consistent.
|
49
49
|
|
50
50
|
In this case it is recommended to instead use the `Wx::Window#paint` or `Wx::Window#paint_buffered` methods as these
|
51
|
-
provide some optimizations with regard to automatically detecting
|
51
|
+
provide some optimizations with regard to automatically detecting if the methods are called inside `Wx::EVT_PAINT`
|
52
52
|
handlers (which should normally be the case) or not.
|
53
53
|
|
54
54
|
So the typical way to do buffered painting inside a windows `Wx::EVT_PAINT` handler would be something like:
|
data/lib/wx/doc/font.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
|
2
|
+
module Wx
|
3
|
+
class Font
|
4
|
+
|
5
|
+
# @overload find_or_create_font(point_size, family, style, weight, underline=false, facename='', encoding=Wx::FontEncoding::FONTENCODING_DEFAULT)
|
6
|
+
# Finds a font of the given specification in the global font list, or creates one and adds it to the list.
|
7
|
+
# @param [Integer] point_size Size in points. See {Wx::Font#set_point_size} for more info.
|
8
|
+
# @param [Wx::FontFamily] family The font family: a generic portable way of referring to fonts without specifying a facename.
|
9
|
+
# @param [Wx::FontStyle] style One of {Wx::FontStyle::FONTSTYLE_NORMAL}, {Wx::FontStyle::FONTSTYLE_SLANT} and {Wx::FontStyle::FONTSTYLE_ITALIC}.
|
10
|
+
# @param [Wx::FontWeight] weight Font weight, sometimes also referred to as font boldness. One of the {Wx::FontWeight} enumeration values.
|
11
|
+
# @param [Boolean] underline The value can be true or false.
|
12
|
+
# @param [String] facename An optional string specifying the face name to be used. If it is an empty string, a default face name will be chosen based on the family.
|
13
|
+
# @param [Wx::FontEncoding] encoding An encoding which may be one of the enumeration values of {Wx::FontEncoding}. If the specified encoding isn't available, no font is created (see also Font Encodings).
|
14
|
+
# @return [Wx::Font]
|
15
|
+
# @see Wx::Font#initialize
|
16
|
+
# @overload find_or_create_font(font_info)
|
17
|
+
# Finds a font of the given specification in the global font list, or creates one and adds it to the list.
|
18
|
+
# @param [Wx::FontInfo] font_info
|
19
|
+
# @return [Wx::Font]
|
20
|
+
def self.find_or_create_font(*args) end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
# In wxRuby this is simply an alias for the Font class.
|
25
|
+
TheFontList = Font
|
26
|
+
|
27
|
+
end
|
data/lib/wx/doc/functions.rb
CHANGED
@@ -11,32 +11,73 @@ module Wx
|
|
11
11
|
# @param lvl [Integer] logging level (like {Wx::LOG_Message})
|
12
12
|
# @param fmt [String] message (formatting) string
|
13
13
|
# @param args [Array<Object>] optional message arguments
|
14
|
-
# @
|
15
|
-
|
14
|
+
# @param filename [String] optional file name for log info
|
15
|
+
# @param line [Integer] optional line number for log info
|
16
|
+
# @param func [String] optional function name for log info
|
17
|
+
# @param component [String] optional component name for log info
|
18
|
+
# @return [void]
|
19
|
+
def self.log_generic(lvl, fmt, *args, filename: nil, line: 0, func: nil, component: nil) end
|
16
20
|
|
17
21
|
# Log a Wx low priority informational message to the current Wx log output
|
18
22
|
# @param fmt [String] message (formatting) string
|
19
23
|
# @param args [Array<Object>] optional message arguments
|
20
|
-
# @
|
21
|
-
|
24
|
+
# @param filename [String] optional file name for log info
|
25
|
+
# @param line [Integer] optional line number for log info
|
26
|
+
# @param func [String] optional function name for log info
|
27
|
+
# @param component [String] optional component name for log info
|
28
|
+
# @return [void]
|
29
|
+
def self.log_info(fmt, *args, filename: nil, line: 0, func: nil, component: nil) end
|
22
30
|
|
23
31
|
# Log a Wx Informational message to the current Wx log output
|
24
32
|
# @param fmt [String] message (formatting) string
|
25
33
|
# @param args [Array<Object>] optional message arguments
|
26
|
-
# @
|
27
|
-
|
34
|
+
# @param filename [String] optional file name for log info
|
35
|
+
# @param line [Integer] optional line number for log info
|
36
|
+
# @param func [String] optional function name for log info
|
37
|
+
# @param component [String] optional component name for log info
|
38
|
+
# @return [void]
|
39
|
+
def self.log_message(fmt, *args, filename: nil, line: 0, func: nil, component: nil) end
|
28
40
|
|
29
41
|
# Log a Wx Error message to the current Wx log output
|
30
42
|
# @param fmt [String] message (formatting) string
|
31
43
|
# @param args [Array<Object>] optional message arguments
|
32
|
-
# @
|
33
|
-
|
44
|
+
# @param filename [String] optional file name for log info
|
45
|
+
# @param line [Integer] optional line number for log info
|
46
|
+
# @param func [String] optional function name for log info
|
47
|
+
# @param component [String] optional component name for log info
|
48
|
+
# @return [void]
|
49
|
+
def self.log_error(fmt, *args, filename: nil, line: 0, func: nil, component: nil) end
|
34
50
|
|
35
51
|
# Log a Wx Warning message to the current Wx log output
|
36
52
|
# @param fmt [String] message (formatting) string
|
37
53
|
# @param args [Array<Object>] optional message arguments
|
38
|
-
# @
|
39
|
-
|
54
|
+
# @param filename [String] optional file name for log info
|
55
|
+
# @param line [Integer] optional line number for log info
|
56
|
+
# @param func [String] optional function name for log info
|
57
|
+
# @param component [String] optional component name for log info
|
58
|
+
# @return [void]
|
59
|
+
def self.log_warning(fmt, *args, filename: nil, line: 0, func: nil, component: nil) end
|
60
|
+
|
61
|
+
# Log a Wx verbose informational message to the current Wx log output
|
62
|
+
# (needs explicit activation to be shown)
|
63
|
+
# @param fmt [String] message (formatting) string
|
64
|
+
# @param args [Array<Object>] optional message arguments
|
65
|
+
# @param filename [String] optional file name for log info
|
66
|
+
# @param line [Integer] optional line number for log info
|
67
|
+
# @param func [String] optional function name for log info
|
68
|
+
# @param component [String] optional component name for log info
|
69
|
+
# @return [void]
|
70
|
+
def self.log_verbose(fmt, *args, filename: nil, line: 0, func: nil, component: nil) end
|
71
|
+
|
72
|
+
# Log a Wx debug message to the current Wx log output
|
73
|
+
# @param fmt [String] message (formatting) string
|
74
|
+
# @param args [Array<Object>] optional message arguments
|
75
|
+
# @param filename [String] optional file name for log info
|
76
|
+
# @param line [Integer] optional line number for log info
|
77
|
+
# @param func [String] optional function name for log info
|
78
|
+
# @param component [String] optional component name for log info
|
79
|
+
# @return [void]
|
80
|
+
def self.log_debug(fmt, *args, filename: nil, line: 0, func: nil, component: nil) end
|
40
81
|
|
41
82
|
# Log a Wx Status message - this is directed to the status bar of the
|
42
83
|
# specified Frame window, or the application main window if not specified.
|
@@ -51,19 +92,6 @@ module Wx
|
|
51
92
|
# @return [nil]
|
52
93
|
def self.log_status(fmt, *args) end
|
53
94
|
|
54
|
-
# Log a Wx verbose informational message to the current Wx log output
|
55
|
-
# (needs explicit activation to be shown)
|
56
|
-
# @param fmt [String] message (formatting) string
|
57
|
-
# @param args [Array<Object>] optional message arguments
|
58
|
-
# @return [nil]
|
59
|
-
def self.log_verbose(fmt, *args) end
|
60
|
-
|
61
|
-
# Log a Wx debug message to the current Wx log output
|
62
|
-
# @param fmt [String] message (formatting) string
|
63
|
-
# @param args [Array<Object>] optional message arguments
|
64
|
-
# @return [nil]
|
65
|
-
def self.log_debug(fmt, *args) end
|
66
|
-
|
67
95
|
# @!endgroup
|
68
96
|
|
69
97
|
# @!group Other class methods
|
data/lib/wx/doc/gc_dc.rb
CHANGED
data/lib/wx/doc/image.rb
CHANGED
@@ -11,23 +11,53 @@ module Wx
|
|
11
11
|
# @return [Array<String>]
|
12
12
|
def self.extensions; end
|
13
13
|
|
14
|
+
# Returns an array with the supported mime types of the available image handlers.
|
15
|
+
# @return [Array<String>]
|
16
|
+
def self.mime_types; end
|
17
|
+
|
14
18
|
# returns a Hash with all supported extensions per available BitmapType
|
15
19
|
# @return [Hash]
|
16
20
|
def self.handler_extensions; end
|
17
21
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
22
|
+
module Histogram
|
23
|
+
|
24
|
+
# Calculate an image histogram key from given RGB values.
|
25
|
+
# @param [Integer] r Red value
|
26
|
+
# @param [Integer] g Green value
|
27
|
+
# @param [Integer] b Blue value
|
28
|
+
# @return [Integer] key value
|
29
|
+
def make_key(r,g,b) end
|
30
|
+
|
31
|
+
# Find first colour that is not used in the image and has higher RGB values than RGB(r, g, b)
|
32
|
+
# @param [Integer] r Red value
|
33
|
+
# @param [Integer] g Green value
|
34
|
+
# @param [Integer] b Blue value
|
35
|
+
# @return [Array(Integer,Integer,Integer),nil] RGB values of first unused colour or nil if none found
|
36
|
+
def find_first_unused_colour(r=1, g=0, b=0) end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
# Computes the histogram of the image and fills a hash table, indexed
|
41
|
+
# with integer keys built as 0xRRGGBB, containing pairs (Array) of integer values.
|
42
|
+
# For each pair the first value is the index of the first pixel in the colour in the image
|
43
|
+
# and the second value the number of pixels having the colour in the image.
|
44
|
+
# The returned Hash object is extended with the {Wx::Image::Histogram} mixin.
|
45
|
+
# @return [Hash] hash object extended with {Wx::Image::Histogram}
|
46
|
+
def compute_histogram; end
|
30
47
|
|
31
48
|
end
|
32
49
|
|
50
|
+
# Searches for an art file with basename 'name' and creates an Image if found.
|
51
|
+
# Raises an ArgumentError if not found.
|
52
|
+
# Wx::ArtLocator::find_art is used to look up the art file using ::Kernel#caller_locations to
|
53
|
+
# determine the values for the 'art_path' and 'art_owner' arguments ('art_path' is set to the
|
54
|
+
# absolute path to the folder holding the caller's code and 'art_owner' to the basename of the
|
55
|
+
# caller's source file). The 'art_type' argument is set to <code>:icon</code>.
|
56
|
+
# @param [String,Symbol] name base name of art file
|
57
|
+
# @param [Wx::BitmapType,nil] bmp_type bitmap type for art file (nil means any supported type)
|
58
|
+
# @param [Integer] index Index of the image to load in the case that the image file contains multiple images. This is only used by GIF, ICO and TIFF handlers. The default value (-1) means "choose the default image" and is interpreted as the first image (index=0) by the GIF and TIFF handler and as the largest and most colourful one by the ICO handler.
|
59
|
+
# @return [Wx::Image]
|
60
|
+
# @see Wx::ArtLocator::find_art
|
61
|
+
def self.Image(name, bmp_type = nil, index=-1); end
|
62
|
+
|
33
63
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
|
2
|
+
class Wx::ListCtrl
|
3
|
+
|
4
|
+
include Enumerable
|
5
|
+
|
6
|
+
# Iterates all items in the list control passing each item (id) to the given block.
|
7
|
+
# @yieldparam [Integer] item
|
8
|
+
# @return [Object] result of last block iteration
|
9
|
+
def each(&block) end
|
10
|
+
|
11
|
+
# Iterates all selected items in the list control (like #get_next_item(item, Wx::LIST_NEXT_ALL, Wx::LIST_STATE_SELECTED))
|
12
|
+
# passing each item (id) to the given block.
|
13
|
+
# @yieldparam [Integer] item
|
14
|
+
# @return [Object] result of last block iteration
|
15
|
+
def each_selected(&block) end
|
16
|
+
|
17
|
+
# Returns array of selected items.
|
18
|
+
# @return [Array<Integer>] selected items
|
19
|
+
def get_selections; end
|
20
|
+
|
21
|
+
# Call this function to sort the items in the list control.
|
22
|
+
# The sorting method will call the given block repeatedly to compare two items from the list
|
23
|
+
# passing the <b>item data</b> for each item as well as the `data` argument given to the #sort_items method.
|
24
|
+
# The block should return 0 if the items are equal, negative value if the first item is less than the second
|
25
|
+
# one and positive value if the first one is greater than the second one.
|
26
|
+
# @param [Object] data user data to pass on to the sorting block
|
27
|
+
# @yieldparam [Object] item_data1 data for first item
|
28
|
+
# @yieldparam [Object] item_data2 data for second item
|
29
|
+
# @yieldparam [Object] data propagated data argument
|
30
|
+
def sort_items(data = nil, &block) end
|
31
|
+
|
32
|
+
end
|
data/lib/wx/doc/log.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
module Wx
|
3
|
+
|
4
|
+
class Log
|
5
|
+
|
6
|
+
# Sets the current component for log info to the given value before executing the
|
7
|
+
# given block and restores the previous component value after the block returns.
|
8
|
+
# @param [String] comp component value for log info
|
9
|
+
def self.for_component(comp, &block) end
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
class LogStderr
|
14
|
+
|
15
|
+
# Creates a new LogStderr for the given file handle.
|
16
|
+
# Possible values are 2 for `stderr` and 1 for `stdout`.
|
17
|
+
# @param [Integer] fh file stream handle
|
18
|
+
def initialize(fh = 2) end
|
19
|
+
end
|
20
|
+
|
21
|
+
class LogNull
|
22
|
+
|
23
|
+
# Suspends logging before executing the given block and restarts logging when the block returns.
|
24
|
+
def self.no_log(&block) end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
data/lib/wx/doc/pen.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
module Wx
|
3
|
+
|
4
|
+
class Pen
|
5
|
+
|
6
|
+
# Finds a pen with the specified attributes in the global list and returns it, else creates a new pen, adds it to the global pen list, and returns it.
|
7
|
+
# @param [Wx::Colour, String, Symbol] colour Colour of the pen.
|
8
|
+
# @param [Integer] width Width of the pen.
|
9
|
+
# @param [Wx::PenStyle] style Pen style. See {Wx::PenStyle} for a list of styles.
|
10
|
+
# @return [Wx::Pen]
|
11
|
+
def self.find_or_create_pen(colour, width=1, style=Wx::PenStyle::PENSTYLE_SOLID) end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
ThePenList = Wx::Pen
|
16
|
+
|
17
|
+
end
|
@@ -8,7 +8,7 @@ module Wx::PRT
|
|
8
8
|
# @param [Wx::PRT::PrintData] print_data print_data defining the print settings
|
9
9
|
# @yieldparam [Wx::PrinterDC] dc the PrinterDC instance to paint on
|
10
10
|
# @return [Object] result of the block
|
11
|
-
def self.draw_on(
|
11
|
+
def self.draw_on(print_data) end
|
12
12
|
|
13
13
|
end
|
14
14
|
|
@@ -19,7 +19,7 @@ module Wx::PRT
|
|
19
19
|
# @param [Wx::PRT::PrintData] print_data print_data defining the print settings
|
20
20
|
# @yieldparam [Wx::PostScriptDC] dc the PostScriptDC instance to paint on
|
21
21
|
# @return [Object] result of the block
|
22
|
-
def self.draw_on(
|
22
|
+
def self.draw_on(print_data) end
|
23
23
|
|
24
24
|
end
|
25
25
|
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
class Wx::RadioBox
|
3
|
+
|
4
|
+
# Enables od disables individual buttons.
|
5
|
+
# true if the item has been enabled or disabled or false if nothing was done because it already was in the requested state.
|
6
|
+
# @see Wx::Window#enable
|
7
|
+
# @param item [Integer] The zero-based position of the button to enable or disable.
|
8
|
+
# @param enable [true,false] true to enable, false to disable.
|
9
|
+
# @return [true,false]
|
10
|
+
def enable_item(item, enable=true) end
|
11
|
+
|
12
|
+
# Shows or hides individual buttons.
|
13
|
+
# true if the item has been shown or hidden or false if nothing was done because it already was in the requested state.
|
14
|
+
# @see Wx::Window#show
|
15
|
+
# @param item [Integer] The zero-based position of the button to show or hide.
|
16
|
+
# @param show [true,false] true to show, false to hide.
|
17
|
+
# @return [true,false]
|
18
|
+
def show_item(item, show=true) end
|
19
|
+
|
20
|
+
end
|
data/lib/wx/doc/scaled_dc.rb
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
class Wx::TextValidator
|
3
|
+
|
4
|
+
# @overload initialize(validator)
|
5
|
+
# Copy constructor.
|
6
|
+
# @param [Wx::TextValidator] validator validator to copy
|
7
|
+
# @overload initialize(style=Wx::FILTER_NONE)
|
8
|
+
# Constructor taking a style.
|
9
|
+
# @param [Integer] style One or more of the {Wx::TextValidatorStyle} styles. See #set_style.
|
10
|
+
def initialize(*args) end
|
11
|
+
|
12
|
+
end
|
data/lib/wx/doc/window.rb
CHANGED
@@ -15,4 +15,31 @@ class Wx::Window
|
|
15
15
|
# @return [Object] result from block
|
16
16
|
def paint_buffered; end
|
17
17
|
|
18
|
+
# Locks the window from updates while executing the given block.
|
19
|
+
# @param [Proc] block
|
20
|
+
def locked(&block); end
|
21
|
+
|
22
|
+
# Find the first child window with the given id recursively in the window hierarchy of this window.
|
23
|
+
#
|
24
|
+
# Window with the given id or nil if not found.
|
25
|
+
# @see Wx::Window.find_window_by_id
|
26
|
+
# @param id [Integer]
|
27
|
+
# @return [Wx::Window]
|
28
|
+
def find_window_by_id(id) end
|
29
|
+
|
30
|
+
# Find the first child window with the given label recursively in the window hierarchy of this window.
|
31
|
+
#
|
32
|
+
# Window with the given label or nil if not found.
|
33
|
+
# @see Wx::Window.find_window_by_label
|
34
|
+
# @param label [String]
|
35
|
+
# @return [Wx::Window]
|
36
|
+
def find_window_by_label(label) end
|
37
|
+
|
38
|
+
# Find the first child window with the given name (as given in a window constructor or {Wx::Window#create} function call) recursively in the window hierarchy of this window.
|
39
|
+
#
|
40
|
+
# Window with the given name or nil if not found.
|
41
|
+
# @param name [String]
|
42
|
+
# @return [Wx::Window]
|
43
|
+
def find_window_by_name(name) end
|
44
|
+
|
18
45
|
end
|