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.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/INSTALL.md +73 -22
  3. data/README.md +40 -8
  4. data/assets/hello_button-macos.png +0 -0
  5. data/assets/hello_button-msw.png +0 -0
  6. data/assets/hello_button_clicked-macos.png +0 -0
  7. data/assets/hello_button_clicked-msw.png +0 -0
  8. data/assets/hello_button_clicked_combi.png +0 -0
  9. data/assets/hello_world-macos.png +0 -0
  10. data/assets/hello_world-msw.png +0 -0
  11. data/assets/hello_world_combi.png +0 -0
  12. data/ext/wxruby3/swig/wx.i +2 -0
  13. data/lib/wx/core/brush.rb +6 -0
  14. data/lib/wx/core/event_loop.rb +7 -0
  15. data/lib/wx/core/evthandler.rb +12 -2
  16. data/lib/wx/core/font.rb +22 -14
  17. data/lib/wx/core/helpprovider.rb +2 -2
  18. data/lib/wx/core/image.rb +33 -0
  19. data/lib/wx/core/listctrl.rb +17 -13
  20. data/lib/wx/core/log.rb +90 -0
  21. data/lib/wx/core/menu.rb +5 -0
  22. data/lib/wx/core/pen.rb +6 -0
  23. data/lib/wx/core/window.rb +28 -1
  24. data/lib/wx/doc/app.rb +40 -0
  25. data/lib/wx/doc/bitmap.rb +11 -15
  26. data/lib/wx/doc/brush.rb +17 -0
  27. data/lib/wx/doc/event_loop.rb +7 -0
  28. data/lib/wx/doc/extra/00_starting.md +6 -6
  29. data/lib/wx/doc/extra/02_lifecycles.md +9 -8
  30. data/lib/wx/doc/extra/09_exceptions.md +1 -1
  31. data/lib/wx/doc/extra/11_drawing_and_dc.md +4 -4
  32. data/lib/wx/doc/font.rb +27 -0
  33. data/lib/wx/doc/functions.rb +51 -23
  34. data/lib/wx/doc/gc_dc.rb +1 -1
  35. data/lib/wx/doc/image.rb +42 -12
  36. data/lib/wx/doc/list_ctrl.rb +32 -0
  37. data/lib/wx/doc/log.rb +28 -0
  38. data/lib/wx/doc/pen.rb +17 -0
  39. data/lib/wx/doc/prt/printer_dc.rb +2 -2
  40. data/lib/wx/doc/radio_box.rb +20 -0
  41. data/lib/wx/doc/scaled_dc.rb +1 -1
  42. data/lib/wx/doc/text_validator.rb +12 -0
  43. data/lib/wx/doc/window.rb +27 -0
  44. data/lib/wx/keyword_defs.rb +77 -76
  45. data/lib/wx/prt/keyword_defs.rb +5 -1
  46. data/lib/wx/version.rb +1 -1
  47. data/rakelib/install.rb +17 -6
  48. data/rakelib/lib/config/linux.rb +4 -2
  49. data/rakelib/lib/config/macosx.rb +120 -1
  50. data/rakelib/lib/config/mingw.rb +6 -1
  51. data/rakelib/lib/config/unixish.rb +26 -11
  52. data/rakelib/lib/config.rb +15 -6
  53. data/rakelib/lib/core/mapping.rb +15 -10
  54. data/rakelib/lib/core/package.rb +4 -1
  55. data/rakelib/lib/core/spec.rb +23 -12
  56. data/rakelib/lib/core/spec_helper.rb +6 -0
  57. data/rakelib/lib/director/app.rb +30 -1
  58. data/rakelib/lib/director/aui_toolbar.rb +41 -0
  59. data/rakelib/lib/director/brush.rb +10 -1
  60. data/rakelib/lib/director/combobox.rb +1 -1
  61. data/rakelib/lib/director/context_help_button.rb +23 -0
  62. data/rakelib/lib/director/dialog.rb +33 -2
  63. data/rakelib/lib/director/event_loop.rb +26 -0
  64. data/rakelib/lib/director/font.rb +12 -3
  65. data/rakelib/lib/director/functions.rb +44 -48
  66. data/rakelib/lib/director/help_provider.rb +8 -10
  67. data/rakelib/lib/director/hyperlink_event.rb +22 -0
  68. data/rakelib/lib/director/image.rb +32 -0
  69. data/rakelib/lib/director/list_ctrl.rb +3 -2
  70. data/rakelib/lib/director/log.rb +64 -4
  71. data/rakelib/lib/director/menu.rb +0 -3
  72. data/rakelib/lib/director/menu_bar.rb +3 -0
  73. data/rakelib/lib/director/pen.rb +10 -1
  74. data/rakelib/lib/director/popup_window.rb +18 -0
  75. data/rakelib/lib/director/radio_box.rb +15 -4
  76. data/rakelib/lib/director/searchctrl.rb +2 -1
  77. data/rakelib/lib/director/static_box.rb +1 -1
  78. data/rakelib/lib/director/styled_text_ctrl.rb +1 -1
  79. data/rakelib/lib/director/text_entry.rb +30 -0
  80. data/rakelib/lib/director/text_validator.rb +8 -2
  81. data/rakelib/lib/director/textctrl.rb +1 -1
  82. data/rakelib/lib/director/variant.rb +17 -4
  83. data/rakelib/lib/director/window.rb +37 -1
  84. data/rakelib/lib/extractor/function.rb +7 -7
  85. data/rakelib/lib/extractor/variable.rb +6 -6
  86. data/rakelib/lib/generate/doc/aui_manager.yaml +21 -0
  87. data/rakelib/lib/generate/doc/context_help_button.yaml +16 -0
  88. data/rakelib/lib/generate/doc/event_blocker.yaml +27 -0
  89. data/rakelib/lib/generate/doc/event_filter.yaml +47 -0
  90. data/rakelib/lib/generate/doc/file_dialog.yaml +68 -0
  91. data/rakelib/lib/generate/doc/font.yaml +29 -0
  92. data/rakelib/lib/generate/doc/frame.yaml +23 -0
  93. data/rakelib/lib/generate/doc/fs_file.yaml +11 -0
  94. data/rakelib/lib/generate/doc/gdi_common.yaml +36 -0
  95. data/rakelib/lib/generate/doc/graphics_context.yaml +34 -0
  96. data/rakelib/lib/generate/doc/gui_event_loop.yaml +12 -0
  97. data/rakelib/lib/generate/doc/help_controller.yaml +24 -0
  98. data/rakelib/lib/generate/doc/icon.yaml +11 -0
  99. data/rakelib/lib/generate/doc/image.yaml +87 -0
  100. data/rakelib/lib/generate/doc/keyboard_state.yaml +19 -0
  101. data/rakelib/lib/generate/doc/list_ctrl.yaml +77 -0
  102. data/rakelib/lib/generate/doc/locale.yaml +12 -0
  103. data/rakelib/lib/generate/doc/log.yaml +86 -0
  104. data/rakelib/lib/generate/doc/mdi_frame.yaml +12 -0
  105. data/rakelib/lib/generate/doc/memory_dc.yaml +42 -0
  106. data/rakelib/lib/generate/doc/menu.yaml +17 -0
  107. data/rakelib/lib/generate/doc/menu_item.yaml +43 -0
  108. data/rakelib/lib/generate/doc/message_dialog.yaml +36 -0
  109. data/rakelib/lib/generate/doc/non_owned_window.yaml +14 -0
  110. data/rakelib/lib/generate/doc/notebook.yaml +18 -0
  111. data/rakelib/lib/generate/doc/pen.yaml +11 -0
  112. data/rakelib/lib/generate/doc/picker_base.yaml +19 -0
  113. data/rakelib/lib/generate/doc/platform_info.yaml +15 -0
  114. data/rakelib/lib/generate/doc/property_sheet_dialog.yaml +26 -0
  115. data/rakelib/lib/generate/doc/scroll_bar.yaml +11 -0
  116. data/rakelib/lib/generate/doc/scrolled_canvas.yaml +37 -0
  117. data/rakelib/lib/generate/doc/scrolled_control.yaml +37 -0
  118. data/rakelib/lib/generate/doc/scrolled_window.yaml +37 -0
  119. data/rakelib/lib/generate/doc/sizer.yaml +69 -0
  120. data/rakelib/lib/generate/doc/splash_screen.yaml +18 -0
  121. data/rakelib/lib/generate/doc/static_box.yaml +52 -0
  122. data/rakelib/lib/generate/doc/static_box_sizer.yaml +22 -0
  123. data/rakelib/lib/generate/doc/svg_file_dc.yaml +11 -0
  124. data/rakelib/lib/generate/doc/text_ctrl.yaml +19 -0
  125. data/rakelib/lib/generate/doc/text_entry.yaml +42 -0
  126. data/rakelib/lib/generate/doc/text_entry_dialog.yaml +17 -0
  127. data/rakelib/lib/generate/doc/timer_event.yaml +28 -0
  128. data/rakelib/lib/generate/doc/tool_bar.yaml +35 -0
  129. data/rakelib/lib/generate/doc/top_level_window.yaml +23 -0
  130. data/rakelib/lib/generate/doc/validator.yaml +12 -0
  131. data/rakelib/lib/generate/doc/variant.yaml +29 -0
  132. data/rakelib/lib/generate/doc/window.yaml +249 -0
  133. data/rakelib/lib/generate/doc/wizard_page_simple.yaml +14 -0
  134. data/rakelib/lib/generate/doc/xml_node.yaml +7 -0
  135. data/rakelib/lib/generate/doc/xml_resource.yaml +27 -0
  136. data/rakelib/lib/generate/doc.rb +36 -2
  137. data/rakelib/lib/generate/interface.rb +11 -10
  138. data/rakelib/lib/specs/interfaces.rb +5 -1
  139. data/rakelib/lib/swig_runner.rb +37 -0
  140. data/samples/aui/aui.rb +432 -363
  141. data/samples/propgrid/propgrid.rb +3 -0
  142. data/samples/sampler/editor.rb +33 -25
  143. data/samples/sampler/sample.rb +2 -2
  144. data/samples/sampler/stc_editor.rb +4 -2
  145. data/tests/lib/item_container_tests.rb +82 -0
  146. data/tests/lib/text_entry_tests.rb +80 -0
  147. data/tests/lib/wxapp_runner.rb +12 -0
  148. data/tests/lib/wxframe_runner.rb +89 -4
  149. data/tests/test_art.rb +9 -0
  150. data/tests/test_box_sizer.rb +161 -0
  151. data/tests/test_ext_controls.rb +28 -0
  152. data/tests/test_font.rb +239 -0
  153. data/tests/test_grid_sizer.rb +148 -0
  154. data/tests/test_intl.rb +5 -1
  155. data/tests/test_list_ctrl.rb +53 -0
  156. data/tests/test_log.rb +163 -0
  157. data/tests/test_std_controls.rb +321 -37
  158. data/tests/test_timer.rb +95 -0
  159. data/tests/test_window.rb +340 -0
  160. 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
- class Bitmap
12
-
13
- # Searches for an art file with basename 'name' and creates a Bitmap if found.
14
- # Raises an ArgumentError if not found.
15
- # Wx::ArtLocator::find_art is used to look up the art file using ::Kernel#caller_locations to
16
- # determine the values for the 'art_path' and 'art_owner' arguments ('art_path' is set to the
17
- # absolute path to the folder holding the caller's code and 'art_owner' to the basename of the
18
- # caller's source file). The 'art_type' argument is set to <code>:icon</code>.
19
- # @param [String,Symbol] name base name of art file
20
- # @param [Wx::BitmapType,nil] bmp_type bitmap type for art file (nil means any supported type)
21
- # @return [Wx::Bitmap]
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
@@ -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
@@ -0,0 +1,7 @@
1
+
2
+ module Wx
3
+
4
+ # In wxRuby simply an alias for GUIEventLoop.
5
+ EventLoop = GUIEventLoop
6
+
7
+ 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. As wxWidgets also has stable releases for Mac OSX and Linux QT platforms
23
- it should not be to hard to support these. Contributions to achieve this are appreciated.
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. For the
131
- exit sequence to executions are similar but reversed (first a possible #on_exit method and than the wxWidgets base OnExit).
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 that way this meshes with Ruby
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 the we need to map any
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. 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
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
- - classes considered POD types like Wx::Size, Wx::Point, Wx::RealPoint, Wx::Rect, Wx::GBSpan, Wx::GBPosition, Wx::BusyInfoFlags,
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
- - final non-instantiatable classes like the Wx::DC (Device Context) class family, Wx::GraphicsContext, Wx::WindowsDisabler,
160
+ * final non-instantiatable classes like the Wx::DC (Device Context) class family, Wx::GraphicsContext, Wx::WindowsDisabler,
161
161
  Wx::EventBlocker, Wx::BusyInfo
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
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 **not**
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 the any buffered output flushed to the final target.
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 provide to the block for later access!
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 is the methods are called inside `Wx::EVT_PAINT`
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:
@@ -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
@@ -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
- # @return [nil]
15
- def self.log_generic(lvl, fmt, *args) end
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
- # @return [nil]
21
- def self.log_info(fmt, *args) end
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
- # @return [nil]
27
- def self.log_message(fmt, *args) end
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
- # @return [nil]
33
- def self.log_error(fmt, *args) end
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
- # @return [nil]
39
- def self.log_warning(fmt, *args) end
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
@@ -1,5 +1,5 @@
1
1
 
2
- class Wx
2
+ module Wx
3
3
 
4
4
  class GCDC < Wx::DC
5
5
 
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
- # Searches for an art file with basename 'name' and creates an Image if found.
19
- # Raises an ArgumentError if not found.
20
- # Wx::ArtLocator::find_art is used to look up the art file using ::Kernel#caller_locations to
21
- # determine the values for the 'art_path' and 'art_owner' arguments ('art_path' is set to the
22
- # absolute path to the folder holding the caller's code and 'art_owner' to the basename of the
23
- # caller's source file). The 'art_type' argument is set to <code>:icon</code>.
24
- # @param [String,Symbol] name base name of art file
25
- # @param [Wx::BitmapType,nil] bmp_type bitmap type for art file (nil means any supported type)
26
- # @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.
27
- # @return [Wx::Image]
28
- # @see Wx::ArtLocator::find_art
29
- def self.Image(name, bmp_type = nil, index=-1); end
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(win) end
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(win) end
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
@@ -1,5 +1,5 @@
1
1
 
2
- class Wx
2
+ module Wx
3
3
 
4
4
  class ScaledDC < Wx::DC
5
5
 
@@ -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