wxruby3 0.9.0.pre.beta.14 → 0.9.0.pre.rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/wxruby3/include/wxruby-runtime.h +1 -0
- data/ext/wxruby3/swig/memory_management.i +6 -10
- data/ext/wxruby3/swig/wx.i +17 -6
- 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/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/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/rakelib/install.rb +3 -1
- data/rakelib/lib/core/mapping.rb +5 -5
- data/rakelib/lib/core/spec.rb +7 -3
- data/rakelib/lib/core/spec_helper.rb +9 -1
- data/rakelib/lib/director/accelerator.rb +1 -1
- data/rakelib/lib/director/app.rb +25 -3
- data/rakelib/lib/director/art_provider.rb +5 -1
- data/rakelib/lib/director/aui_pane_info.rb +1 -1
- data/rakelib/lib/director/aui_tab_ctrl.rb +1 -1
- data/rakelib/lib/director/bitmap.rb +2 -1
- data/rakelib/lib/director/bitmap_combobox.rb +32 -0
- data/rakelib/lib/director/brush.rb +1 -0
- data/rakelib/lib/director/busy_info.rb +1 -1
- data/rakelib/lib/director/choice.rb +1 -0
- data/rakelib/lib/director/clipboard.rb +1 -1
- data/rakelib/lib/director/colour.rb +1 -0
- data/rakelib/lib/director/colour_picker_ctrl.rb +1 -1
- data/rakelib/lib/director/combobox.rb +1 -2
- data/rakelib/lib/director/ctrl_with_items.rb +3 -0
- data/rakelib/lib/director/cursor.rb +1 -0
- data/rakelib/lib/director/data_object.rb +5 -7
- data/rakelib/lib/director/dc.rb +5 -1
- data/rakelib/lib/director/defs.rb +3 -0
- data/rakelib/lib/director/derived_dc.rb +278 -27
- data/rakelib/lib/director/dialog.rb +4 -1
- data/rakelib/lib/director/dir_picker_ctrl.rb +1 -1
- data/rakelib/lib/director/event.rb +3 -3
- data/rakelib/lib/director/event_blocker.rb +41 -0
- data/rakelib/lib/director/event_filter.rb +20 -0
- data/rakelib/lib/director/event_handler.rb +29 -2
- data/rakelib/lib/director/file_picker_ctrl.rb +1 -1
- data/rakelib/lib/director/find_replace_data.rb +1 -0
- data/rakelib/lib/director/font.rb +2 -1
- data/rakelib/lib/director/font_data.rb +1 -0
- data/rakelib/lib/director/font_picker_ctrl.rb +1 -1
- data/rakelib/lib/director/gdi_object.rb +1 -0
- data/rakelib/lib/director/graphics_context.rb +6 -6
- data/rakelib/lib/director/grid_table_message.rb +1 -1
- data/rakelib/lib/director/html_cell.rb +1 -1
- data/rakelib/lib/director/html_data_object.rb +5 -7
- data/rakelib/lib/director/html_listbox.rb +65 -1
- data/rakelib/lib/director/icon.rb +2 -0
- data/rakelib/lib/director/listbox.rb +1 -0
- data/rakelib/lib/director/locale.rb +2 -1
- data/rakelib/lib/director/palette.rb +1 -0
- data/rakelib/lib/director/pen.rb +2 -1
- data/rakelib/lib/director/pgproperties.rb +1 -1
- data/rakelib/lib/director/pgproperty.rb +1 -1
- data/rakelib/lib/director/pgvalidation_info.rb +1 -1
- data/rakelib/lib/director/platform_info.rb +1 -1
- data/rakelib/lib/director/print_data.rb +1 -1
- data/rakelib/lib/director/property_grid_interface.rb +1 -1
- data/rakelib/lib/director/property_grid_page_state.rb +1 -1
- data/rakelib/lib/director/region.rb +1 -0
- data/rakelib/lib/director/ribbon_art_provider.rb +1 -1
- data/rakelib/lib/director/richtext_buffer_data_object.rb +5 -7
- data/rakelib/lib/director/richtext_header_footer_data.rb +1 -1
- data/rakelib/lib/director/searchctrl.rb +24 -0
- data/rakelib/lib/director/sizer.rb +2 -2
- data/rakelib/lib/director/styled_text_ctrl.rb +2 -0
- data/rakelib/lib/director/text_entry.rb +2 -2
- data/rakelib/lib/director/tree_ctrl.rb +6 -3
- data/rakelib/lib/director/uiaction_simulator.rb +20 -0
- data/rakelib/lib/director/variant.rb +1 -1
- data/rakelib/lib/director/vlistbox.rb +25 -0
- data/rakelib/lib/director/window.rb +0 -6
- data/rakelib/lib/director/with_images.rb +1 -1
- data/rakelib/lib/director/xml_node.rb +1 -1
- data/rakelib/lib/extractor/function.rb +5 -3
- data/rakelib/lib/generate/doc/about_dialog_info.yaml +46 -0
- data/rakelib/lib/generate/doc/accelerator.yaml +21 -0
- data/rakelib/lib/generate/doc/art_provider.yaml +35 -0
- data/rakelib/lib/generate/doc/bitmap.yaml +37 -0
- data/rakelib/lib/generate/doc/box_sizer.yaml +15 -0
- data/rakelib/lib/generate/doc/busy_info.yaml +74 -0
- data/rakelib/lib/generate/doc/client_dc.yaml +19 -0
- data/rakelib/lib/generate/doc/clipboard.yaml +43 -0
- data/rakelib/lib/generate/doc/collapsible_pane.yaml +21 -0
- data/rakelib/lib/generate/doc/colour_dialog.yaml +32 -0
- data/rakelib/lib/generate/doc/control.yaml +46 -0
- data/rakelib/lib/generate/doc/cursor.yaml +40 -0
- data/rakelib/lib/generate/doc/data_object.yaml +55 -0
- data/rakelib/lib/generate/doc/dc.yaml +14 -0
- data/rakelib/lib/generate/doc/dialog.yaml +36 -0
- data/rakelib/lib/generate/doc/dir_dialog.yaml +25 -0
- data/rakelib/lib/generate/doc/events.yaml +152 -0
- data/rakelib/lib/generate/doc/evt_handler.yaml +63 -0
- data/rakelib/lib/generate/doc.rb +76 -13
- data/rakelib/lib/generate/interface.rb +11 -0
- data/rakelib/lib/specs/interfaces.rb +5 -4
- data/rakelib/lib/swig_runner.rb +3 -3
- data/rakelib/lib/typemap/common.rb +15 -3
- data/rakelib/lib/util/string.rb +1 -0
- 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 +56 -4
- data/samples/drawing/tn_svgtest.png +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
:wxEvtHandler.QueueEvent:
|
|
3
|
+
:detail:
|
|
4
|
+
:pre:
|
|
5
|
+
:programlisting:
|
|
6
|
+
- :pattern: !ruby/regexp /.*/
|
|
7
|
+
:replace: ''
|
|
8
|
+
:post:
|
|
9
|
+
- :pattern: !ruby/regexp /This\s+implies\s+that\s+the\s+event\s+should\s+be\s+allocated\s+on\s+the\s+heap\s+and/
|
|
10
|
+
:subst: 'This implies'
|
|
11
|
+
- :pattern: !ruby/regexp /\{Wx::EvtHandler#queue_event\}.*For\s+example:/
|
|
12
|
+
:subst: ''
|
|
13
|
+
- :pattern: !ruby/regexp /Note.*problem:/
|
|
14
|
+
:subst: ''
|
|
15
|
+
:wxEvtHandler.SetNextHandler:
|
|
16
|
+
:detail:
|
|
17
|
+
:pre:
|
|
18
|
+
:programlisting:
|
|
19
|
+
- :pattern: !ruby/regexp /.*/
|
|
20
|
+
:replace: |
|
|
21
|
+
|
|
22
|
+
```ruby
|
|
23
|
+
handlerA.set_next_handler(handlerB)
|
|
24
|
+
handlerB.set_previous_handler(handlerA)
|
|
25
|
+
```
|
|
26
|
+
:wxEvtHandler.TryBefore:
|
|
27
|
+
:detail:
|
|
28
|
+
:pre:
|
|
29
|
+
:programlisting:
|
|
30
|
+
- :pattern: !ruby/regexp /.*/
|
|
31
|
+
:replace: |
|
|
32
|
+
|
|
33
|
+
```ruby
|
|
34
|
+
class MyClass < BaseClass # inheriting from Wx::EvtHandler
|
|
35
|
+
...
|
|
36
|
+
protected
|
|
37
|
+
def try_before(event)
|
|
38
|
+
if my_pre_process(event)
|
|
39
|
+
return true
|
|
40
|
+
|
|
41
|
+
super
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
```
|
|
45
|
+
:wxEvtHandler.TryAfter:
|
|
46
|
+
:detail:
|
|
47
|
+
:pre:
|
|
48
|
+
:programlisting:
|
|
49
|
+
- :pattern: !ruby/regexp /.*/
|
|
50
|
+
:replace: |
|
|
51
|
+
|
|
52
|
+
```ruby
|
|
53
|
+
class MyClass < BaseClass # inheriting from Wx::EvtHandler
|
|
54
|
+
...
|
|
55
|
+
protected
|
|
56
|
+
def try_after(event)
|
|
57
|
+
if super
|
|
58
|
+
return true
|
|
59
|
+
|
|
60
|
+
my_post_process(event)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
```
|
data/rakelib/lib/generate/doc.rb
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
###
|
|
5
5
|
|
|
6
6
|
require 'set'
|
|
7
|
+
require 'yaml'
|
|
7
8
|
|
|
8
9
|
require_relative './base'
|
|
9
10
|
require_relative './analyzer'
|
|
@@ -152,6 +153,7 @@ module WXRuby3
|
|
|
152
153
|
text.gsub!('@remarks', '')
|
|
153
154
|
text.gsub!(/@see.*\n/, '')
|
|
154
155
|
text.gsub!('@ref', '')
|
|
156
|
+
text.gsub!(/(\W|\A)nullptr(\W|\Z)/, '\1nil\2')
|
|
155
157
|
unless no_ref?
|
|
156
158
|
# auto create references for any ids explicitly declared such
|
|
157
159
|
text.gsub!(/\W?(wx\w+(::\w+)?(\(.*\))?)/) do |s|
|
|
@@ -167,6 +169,7 @@ module WXRuby3
|
|
|
167
169
|
end
|
|
168
170
|
end
|
|
169
171
|
end
|
|
172
|
+
text.gsub!(/WX(K_[A-Z]+)/) { "{Wx::#{$1}}"}
|
|
170
173
|
end
|
|
171
174
|
if event_section?
|
|
172
175
|
case text
|
|
@@ -214,7 +217,7 @@ module WXRuby3
|
|
|
214
217
|
|
|
215
218
|
def programlisting_to_doc(node)
|
|
216
219
|
no_idents do
|
|
217
|
-
"\n
|
|
220
|
+
"\n```\n #{node_to_doc(node).split("\n").join("\n ")}\n```\n"
|
|
218
221
|
end
|
|
219
222
|
end
|
|
220
223
|
|
|
@@ -405,7 +408,8 @@ module WXRuby3
|
|
|
405
408
|
|
|
406
409
|
def node_to_doc(xmlnode)
|
|
407
410
|
xmlnode.children.inject('') do |docstr, node|
|
|
408
|
-
|
|
411
|
+
node = preprocess_node(node)
|
|
412
|
+
docstr << (node.is_a?(Nokogiri::XML::Node) ? self.__send__("#{node.name}_to_doc", node) : node.to_s)
|
|
409
413
|
end
|
|
410
414
|
end
|
|
411
415
|
|
|
@@ -421,9 +425,9 @@ module WXRuby3
|
|
|
421
425
|
para = node_to_doc(node)
|
|
422
426
|
# loose specific notes paragraphs
|
|
423
427
|
case para
|
|
424
|
-
when /\A(\<b\>)?wxPerl Note:/,
|
|
425
|
-
/\A\s*Library:/,
|
|
426
|
-
/\A\s*Include\s+file:/
|
|
428
|
+
when /\A(\<(b)\>)?(wxPerl|\{Wx::Perl\}) Note:/, # wxPerl note
|
|
429
|
+
/\A\s*Library:/, # Library note
|
|
430
|
+
/\A\s*Include\s+file:/ # Include file note
|
|
427
431
|
''
|
|
428
432
|
else
|
|
429
433
|
para.sub!(/Include\s+file:\s+\#include\s+\<[^>]+\>\s*\Z/, '')
|
|
@@ -475,6 +479,24 @@ module WXRuby3
|
|
|
475
479
|
end
|
|
476
480
|
end
|
|
477
481
|
|
|
482
|
+
def preprocess_node(node)
|
|
483
|
+
if @item_doc_ovr[:pre] && @item_doc_ovr[:pre][node.name.to_sym]
|
|
484
|
+
@item_doc_ovr[:pre][node.name.to_sym].each do |ovr|
|
|
485
|
+
if ovr[:replace]
|
|
486
|
+
return ovr[:replace] if ovr[:pattern] =~ node.inner_html
|
|
487
|
+
elsif ovr[:subst]
|
|
488
|
+
if ovr[:global]
|
|
489
|
+
node.inner_html = node.inner_html.gsub(ovr[:pattern], ovr[:subst])
|
|
490
|
+
else
|
|
491
|
+
node.inner_html = node.inner_html.sub(ovr[:pattern], ovr[:subst])
|
|
492
|
+
end
|
|
493
|
+
end
|
|
494
|
+
end
|
|
495
|
+
end
|
|
496
|
+
node
|
|
497
|
+
end
|
|
498
|
+
private :preprocess_node
|
|
499
|
+
|
|
478
500
|
def method_missing(mtd, *args, &block)
|
|
479
501
|
if /\A\w+_to_doc\Z/ =~ mtd.to_s && args.size==1
|
|
480
502
|
node_to_doc(*args)
|
|
@@ -487,6 +509,15 @@ module WXRuby3
|
|
|
487
509
|
|
|
488
510
|
def initialize(director)
|
|
489
511
|
@director = director
|
|
512
|
+
@doc_overrides = if File.exist?(doc_override_file = File.join(__dir__, 'doc', underscore(name)+ '.yaml'))
|
|
513
|
+
if ::Psych::VERSION >= '3.1.0'
|
|
514
|
+
::Psych.safe_load(File.read(doc_override_file), permitted_classes: [::Regexp, ::Symbol])
|
|
515
|
+
else
|
|
516
|
+
::Psych.safe_load(File.read(doc_override_file), [::Regexp, ::Symbol])
|
|
517
|
+
end
|
|
518
|
+
else
|
|
519
|
+
{}
|
|
520
|
+
end
|
|
490
521
|
@classdef = nil
|
|
491
522
|
@see_list = []
|
|
492
523
|
end
|
|
@@ -503,15 +534,44 @@ module WXRuby3
|
|
|
503
534
|
end
|
|
504
535
|
end
|
|
505
536
|
|
|
506
|
-
def to_doc(xmlnode_or_set)
|
|
537
|
+
def to_doc(xmlnode_or_set, item: nil, desc: :brief)
|
|
507
538
|
return '' unless xmlnode_or_set
|
|
508
539
|
@see_list.clear
|
|
540
|
+
@item_doc_ovr = if item
|
|
541
|
+
item_key = if item.is_a?(Extractor::BaseDef)
|
|
542
|
+
if item.is_a?(Extractor::ClassDef) || @classdef.nil?
|
|
543
|
+
item.name
|
|
544
|
+
else
|
|
545
|
+
"#{@classdef.name}.#{item.name}"
|
|
546
|
+
end
|
|
547
|
+
else
|
|
548
|
+
@classdef ? "#{@classdef.name}.#{item}" : item.to_s
|
|
549
|
+
end
|
|
550
|
+
item_key = item_key.to_sym
|
|
551
|
+
@doc_overrides[item_key] ? @doc_overrides[item_key][desc] || {} : {}
|
|
552
|
+
else
|
|
553
|
+
{}
|
|
554
|
+
end
|
|
509
555
|
doc = if Nokogiri::XML::NodeSet === xmlnode_or_set
|
|
510
|
-
xmlnode_or_set.inject('')
|
|
556
|
+
xmlnode_or_set.inject('') do |s, n|
|
|
557
|
+
n = preprocess_node(n)
|
|
558
|
+
s << (n.is_a?(Nokogiri::XML::Node) ? node_to_doc(n) : n.to_s)
|
|
559
|
+
end
|
|
511
560
|
else
|
|
512
|
-
|
|
561
|
+
xmlnode_or_set = preprocess_node(xmlnode_or_set)
|
|
562
|
+
xmlnode_or_set.is_a?(Nokogiri::XML::Node) ? node_to_doc(xmlnode_or_set) : xmlnode_or_set.to_s
|
|
513
563
|
end
|
|
514
564
|
event_section(false)
|
|
565
|
+
if @item_doc_ovr.has_key?(:post)
|
|
566
|
+
@item_doc_ovr[:post].each do |ovr|
|
|
567
|
+
if ovr[:global]
|
|
568
|
+
doc.gsub!(ovr[:pattern], ovr[:subst])
|
|
569
|
+
else
|
|
570
|
+
doc.sub!(ovr[:pattern], ovr[:subst])
|
|
571
|
+
end
|
|
572
|
+
end
|
|
573
|
+
end
|
|
574
|
+
doc.sub!(/\<b\>\{Wx::Perl.*/, '')
|
|
515
575
|
doc.strip!
|
|
516
576
|
# reduce triple(or more) newlines to max 2
|
|
517
577
|
doc << "\n" # always end with a NL without following whitespace
|
|
@@ -562,7 +622,7 @@ module WXRuby3
|
|
|
562
622
|
protected
|
|
563
623
|
|
|
564
624
|
def get_constant_doc(const)
|
|
565
|
-
@xml_trans.to_doc(const.brief_doc)
|
|
625
|
+
@xml_trans.to_doc(const.brief_doc, item: const)
|
|
566
626
|
end
|
|
567
627
|
|
|
568
628
|
def gen_constant_value(val)
|
|
@@ -589,9 +649,9 @@ module WXRuby3
|
|
|
589
649
|
end
|
|
590
650
|
|
|
591
651
|
def get_enum_doc(enumdef)
|
|
592
|
-
doc = @xml_trans.to_doc(enumdef.brief_doc)
|
|
652
|
+
doc = @xml_trans.to_doc(enumdef.brief_doc, item: enumdef)
|
|
593
653
|
doc << "\n" if enumdef.detailed_doc
|
|
594
|
-
doc << @xml_trans.to_doc(enumdef.detailed_doc) if enumdef.detailed_doc
|
|
654
|
+
doc << @xml_trans.to_doc(enumdef.detailed_doc, item: enumdef, desc: :detail) if enumdef.detailed_doc
|
|
595
655
|
doc
|
|
596
656
|
end
|
|
597
657
|
|
|
@@ -681,8 +741,8 @@ module WXRuby3
|
|
|
681
741
|
end
|
|
682
742
|
|
|
683
743
|
def get_class_doc(cls)
|
|
684
|
-
doc = @xml_trans.to_doc(cls.brief_doc)
|
|
685
|
-
doc << @xml_trans.to_doc(cls.detailed_doc) if cls.detailed_doc
|
|
744
|
+
doc = @xml_trans.to_doc(cls.brief_doc, item: cls)
|
|
745
|
+
doc << @xml_trans.to_doc(cls.detailed_doc, item: cls, desc: :detail) if cls.detailed_doc
|
|
686
746
|
doc
|
|
687
747
|
end
|
|
688
748
|
|
|
@@ -792,6 +852,7 @@ module WXRuby3
|
|
|
792
852
|
fdoc.doc.puts "\n@note In wxRuby this is a mixin module instead of a (base) class."
|
|
793
853
|
fdoc.puts "module #{clsnm}"
|
|
794
854
|
else
|
|
855
|
+
fdoc.doc.puts "\n@note This class is <b>untracked</b> and should not be derived from nor instances extended!" unless is_tracked?(item)
|
|
795
856
|
basecls = ifspec.classdef_name(base_class(item, doc: true))
|
|
796
857
|
fdoc.puts "class #{clsnm} < #{basecls ? basecls.sub(/\Awx/, '') : '::Object'}"
|
|
797
858
|
end
|
|
@@ -820,6 +881,8 @@ module WXRuby3
|
|
|
820
881
|
const_name = rb_constant_name(e.name)
|
|
821
882
|
if xref_table.has_key?(const_name)
|
|
822
883
|
gen_constant_doc(fdoc, const_name, xref_table[const_name], get_constant_doc(e))
|
|
884
|
+
elsif xref_table.has_key?(e.name)
|
|
885
|
+
gen_constant_doc(fdoc, e.name, xref_table[e.name], get_constant_doc(e))
|
|
823
886
|
end
|
|
824
887
|
end
|
|
825
888
|
else
|
|
@@ -86,6 +86,11 @@ module WXRuby3
|
|
|
86
86
|
Data_Get_Struct(obj, void, vptr);
|
|
87
87
|
wx_#{underscore(rb_name)}_convert_fn fn_cvt = it->second;
|
|
88
88
|
*ptr = (*fn_cvt)(vptr);
|
|
89
|
+
if (!ptr)
|
|
90
|
+
{
|
|
91
|
+
rb_raise(rb_eArgError,
|
|
92
|
+
"#{rb_name} object already deleted.");
|
|
93
|
+
}
|
|
89
94
|
return SWIG_OK;
|
|
90
95
|
}
|
|
91
96
|
}
|
|
@@ -202,6 +207,12 @@ module WXRuby3
|
|
|
202
207
|
fout.puts
|
|
203
208
|
fout.puts swig_code
|
|
204
209
|
end
|
|
210
|
+
unless explicit_concretes.empty?
|
|
211
|
+
fout.puts
|
|
212
|
+
explicit_concretes.each do |cls|
|
|
213
|
+
fout.puts %Q{%feature("notabstract") #{cls};}
|
|
214
|
+
end
|
|
215
|
+
end
|
|
205
216
|
unless included_mixins.empty?
|
|
206
217
|
fout.puts
|
|
207
218
|
included_mixins.each_pair do |cls, module_names|
|
|
@@ -16,21 +16,20 @@ module WXRuby3
|
|
|
16
16
|
Director.Spec(pkg, 'wxEvent')
|
|
17
17
|
Director.Spec(pkg, 'wxEvtHandler')
|
|
18
18
|
Director.Spec(pkg, 'wxEvents')
|
|
19
|
+
Director.Spec(pkg, 'wxEventFilter')
|
|
19
20
|
Director.Spec(pkg, 'wxApp')
|
|
20
21
|
Director.Spec(pkg, 'wxDC')
|
|
21
22
|
Director.Spec(pkg, 'wxWindowDC', director: Director::DerivedDC)
|
|
22
23
|
Director.Spec(pkg, 'wxClientDC', director: Director::DerivedDC)
|
|
23
24
|
Director.Spec(pkg, 'wxPaintDC', director: Director::DerivedDC)
|
|
24
25
|
Director.Spec(pkg, 'wxMemoryDC', director: Director::DerivedDC)
|
|
25
|
-
Director.Spec(pkg, 'wxBufferedDC', director: Director::DerivedDC)
|
|
26
|
-
Director.Spec(pkg, 'wxBufferedPaintDC', director: Director::DerivedDC)
|
|
27
|
-
Director.Spec(pkg, 'wxAutoBufferedPaintDC', director: Director::DerivedDC)
|
|
28
26
|
Director.Spec(pkg, 'wxMirrorDC', director: Director::DerivedDC)
|
|
29
27
|
Director.Spec(pkg, 'wxScreenDC', director: Director::DerivedDC)
|
|
30
28
|
Director.Spec(pkg, 'wxSVGFileDC', director: Director::DerivedDC, requirements: %w[wxUSE_SVG])
|
|
31
29
|
Director.Spec(pkg, 'wxGCDC', director: Director::DerivedDC, requirements: %w[wxUSE_GRAPHICS_CONTEXT])
|
|
32
30
|
Director.Spec(pkg, 'wxScaledDC', director: Director::DerivedDC)
|
|
33
31
|
Director.Spec(pkg, 'wxWindow')
|
|
32
|
+
Director.Spec(pkg, 'wxEventBlocker')
|
|
34
33
|
Director.Spec(pkg, 'wxNonOwnedWindow', director: Director::Window)
|
|
35
34
|
Director.Spec(pkg, 'wxPopupWindow')
|
|
36
35
|
Director.Spec(pkg, 'wxTopLevelWindow')
|
|
@@ -71,6 +70,7 @@ module WXRuby3
|
|
|
71
70
|
Director.Spec(pkg, 'wxToggleButton')
|
|
72
71
|
Director.Spec(pkg, 'wxControlWithItems')
|
|
73
72
|
Director.Spec(pkg, 'wxComboBox')
|
|
73
|
+
Director.Spec(pkg, 'wxBitmapComboBox')
|
|
74
74
|
Director.Spec(pkg, 'wxRadioBox')
|
|
75
75
|
Director.Spec(pkg, 'wxPanel')
|
|
76
76
|
Director.Spec(pkg, 'wxWithImages')
|
|
@@ -81,6 +81,7 @@ module WXRuby3
|
|
|
81
81
|
Director.Spec(pkg, 'wxListBox')
|
|
82
82
|
Director.Spec(pkg, 'wxChoice')
|
|
83
83
|
Director.Spec(pkg, 'wxStaticBox')
|
|
84
|
+
Director.Spec(pkg, 'wxSearchCtrl')
|
|
84
85
|
Director.Spec(pkg, 'wxCollapsiblePane', requirements: %w[wxUSE_COLLPANE])
|
|
85
86
|
Director.Spec(pkg, 'wxCollapsiblePaneEvent', requirements: %w[wxUSE_COLLPANE])
|
|
86
87
|
Director.Spec(pkg, 'wxStaticLine', director: Director::Window)
|
|
@@ -126,7 +127,6 @@ module WXRuby3
|
|
|
126
127
|
Director.Spec(pkg, 'wxListbook', director: Director::BookCtrls, requirements: Director.AnyOf(%w[wxUSE_LISTBOOK]))
|
|
127
128
|
Director.Spec(pkg, 'wxTreebook', director: Director::BookCtrls, requirements: Director.AnyOf(%w[wxUSE_TREEBOOK]))
|
|
128
129
|
Director.Spec(pkg, 'wxSimplebook', director: Director::BookCtrls, requirements: Director.AnyOf(%w[wxUSE_AUI wxUSE_NOTEBOOK wxUSE_LISTBOOK wxUSE_CHOICEBOOK wxUSE_TOOLBOOK wxUSE_TREEBOOK]))
|
|
129
|
-
Director.Spec(pkg, 'wxColourData', requirements: %w[wxUSE_COLOURDLG])
|
|
130
130
|
Director.Spec(pkg, 'wxColourDialog', director: Director::Dialog, requirements: %w[wxUSE_COLOURDLG])
|
|
131
131
|
Director.Spec(pkg, 'wxColourPickerEvent', director: Director::Event, requirements: %w[wxUSE_COLOURPICKERCTRL wxUSE_COLOURDLG])
|
|
132
132
|
Director.Spec(pkg, 'wxColourPickerCtrl', requirements: %w[wxUSE_COLOURPICKERCTRL wxUSE_COLOURDLG])
|
|
@@ -199,6 +199,7 @@ module WXRuby3
|
|
|
199
199
|
Director.Spec(pkg, 'wxVariant', requirements: %w[wxUSE_VARIANT])
|
|
200
200
|
Director.Spec(pkg, 'wxPlatformInfo')
|
|
201
201
|
Director.Spec(pkg, 'wxSplashScreen', requirements: %w[wxUSE_SPLASH])
|
|
202
|
+
Director.Spec(pkg, 'wxUIActionSimulator', requirements: %w[wxUSE_UIACTIONSIMULATOR])
|
|
202
203
|
}
|
|
203
204
|
|
|
204
205
|
Director.Package('Wx::PRT', 'wxUSE_PRINTING_ARCHITECTURE') do |pkg|
|
data/rakelib/lib/swig_runner.rb
CHANGED
|
@@ -211,7 +211,7 @@ module WXRuby3
|
|
|
211
211
|
update_source do |line|
|
|
212
212
|
case line
|
|
213
213
|
# defined method names
|
|
214
|
-
when /(rb_define_method|rb_define_module_function|rb_define_protected_method).*("[_a-zA-Z0-9]*")/
|
|
214
|
+
when /(rb_define_method|rb_define_module_function|rb_define_protected_method).*("[_a-zA-Z0-9]*[=\?\!]?")/
|
|
215
215
|
name = $2
|
|
216
216
|
unless name == '"THE_APP"'
|
|
217
217
|
line[name] = '"%s"' % rb_method_name(name[1..-2])
|
|
@@ -222,7 +222,7 @@ module WXRuby3
|
|
|
222
222
|
line['rb_funcall'] = 'wxRuby_Funcall'
|
|
223
223
|
line[name] = '"%s"' % rb_method_name(name[1..-2])
|
|
224
224
|
# defined alias methods (original method name)
|
|
225
|
-
when /rb_define_alias\s*\(.*"[_a-zA-Z0-9]+[=\?]?".*("[_a-zA-Z0-9]*")/
|
|
225
|
+
when /rb_define_alias\s*\(.*"[_a-zA-Z0-9]+[=\?]?".*("[_a-zA-Z0-9]*[=\?\!]?")/
|
|
226
226
|
name = $1
|
|
227
227
|
line[name] = '"%s"' % rb_method_name(name[1..-2])
|
|
228
228
|
# defined class names
|
|
@@ -234,7 +234,7 @@ module WXRuby3
|
|
|
234
234
|
name = $1
|
|
235
235
|
line[name] = '"%s"' % rb_wx_name(name[1..-2])
|
|
236
236
|
# defined class/global methods
|
|
237
|
-
when /rb_define_singleton_method.*("[_a-zA-Z0-9]*")/
|
|
237
|
+
when /rb_define_singleton_method.*("[_a-zA-Z0-9]*[=\?\!]?")/
|
|
238
238
|
name = $1
|
|
239
239
|
no_wx_name = name[1..-2].sub(/\Awx_?/i, '')
|
|
240
240
|
if no_wx_name == no_wx_name.upcase
|
|
@@ -528,6 +528,15 @@ module WXRuby3
|
|
|
528
528
|
VALUE klass = rb_const_get(wxRuby_Core(), rb_intern(class_name));
|
|
529
529
|
return rb_obj_is_kind_of(obj, klass);
|
|
530
530
|
}
|
|
531
|
+
static swig_type_info * wx_BitmapBundleSwigType()
|
|
532
|
+
{
|
|
533
|
+
static swig_type_info* swigtype = 0;
|
|
534
|
+
if (!swigtype)
|
|
535
|
+
{
|
|
536
|
+
swigtype = wxRuby_GetSwigTypeForClassName("BitmapBundle");
|
|
537
|
+
}
|
|
538
|
+
return swigtype;
|
|
539
|
+
}
|
|
531
540
|
__CODE
|
|
532
541
|
map_in from: 'Wx::BitmapBundle,Wx::Bitmap,Wx::Icon,Wx::Image',
|
|
533
542
|
temp: 'wxBitmapBundle tmpBundle', code: <<~__CODE
|
|
@@ -565,6 +574,9 @@ module WXRuby3
|
|
|
565
574
|
}
|
|
566
575
|
}
|
|
567
576
|
__CODE
|
|
577
|
+
map_out to: 'Wx::BitmapBundle', code: <<~__CODE
|
|
578
|
+
$result = SWIG_NewPointerObj((new wxBitmapBundle(*static_cast< const wxBitmapBundle* >($1))), wx_BitmapBundleSwigType(), SWIG_POINTER_OWN);
|
|
579
|
+
__CODE
|
|
568
580
|
map_typecheck precedence: 2000, code: <<~__CODE
|
|
569
581
|
$1 = (NIL_P($input) ||
|
|
570
582
|
(TYPE($input) == T_DATA &&
|
|
@@ -579,10 +591,10 @@ module WXRuby3
|
|
|
579
591
|
# output typemaps for common reference counted objects like wxPen, wxBrush,
|
|
580
592
|
# making sure to ALWAYS create managed copies
|
|
581
593
|
# (wxColour and wxFont are handled in separate typemaps above)
|
|
582
|
-
%w[
|
|
583
|
-
map "const #{klass}&", "const #{klass}*" do
|
|
594
|
+
%w[Pen Brush Bitmap Icon Cursor IconBundle Palette FontData].each do |klass|
|
|
595
|
+
map "const wx#{klass}&", "const wx#{klass}*", as: "Wx::#{klass}" do
|
|
584
596
|
map_out code: <<~__CODE
|
|
585
|
-
$result = SWIG_NewPointerObj((new #{klass}(*static_cast< const #{klass}* >($1))),
|
|
597
|
+
$result = SWIG_NewPointerObj((new wx#{klass}(*static_cast< const wx#{klass}* >($1))), SWIGTYPE_p_wx#{klass}, SWIG_POINTER_OWN);
|
|
586
598
|
__CODE
|
|
587
599
|
end
|
|
588
600
|
end
|
data/rakelib/lib/util/string.rb
CHANGED
|
@@ -20,7 +20,11 @@ module YARD # rubocop:disable Style/Documentation
|
|
|
20
20
|
def resolve_links(text)
|
|
21
21
|
html = Nokogiri::HTML.fragment(text)
|
|
22
22
|
html.css("a[href]").each do |link|
|
|
23
|
-
|
|
23
|
+
begin
|
|
24
|
+
href = URI(link["href"])
|
|
25
|
+
rescue
|
|
26
|
+
return super(text)
|
|
27
|
+
end
|
|
24
28
|
|
|
25
29
|
if href.relative? && options.files
|
|
26
30
|
fnames = options.files.map(&:filename)
|
|
@@ -242,10 +242,11 @@ class TestPanel < Wx::Panel
|
|
|
242
242
|
|
|
243
243
|
|
|
244
244
|
def clear_bmp(bmp)
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
245
|
+
Wx::MemoryDC.draw_on do |dc|
|
|
246
|
+
dc.select_object(bmp)
|
|
247
|
+
dc.set_background(Wx::WHITE_BRUSH)
|
|
248
|
+
dc.clear
|
|
249
|
+
end
|
|
249
250
|
end
|
|
250
251
|
end
|
|
251
252
|
|
|
@@ -117,8 +117,8 @@ class MyComboBox < ComboBox
|
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
def onChar(event)
|
|
120
|
-
log_message("MyComboBox::OnChar")
|
|
121
|
-
if event.
|
|
120
|
+
log_message("MyComboBox::OnChar : [#{event.get_unicode_key ? event.get_unicode_key.ord : 0}]")
|
|
121
|
+
if event.get_unicode_key == ?w
|
|
122
122
|
log_message("MyComboBox: 'w' will be ignored.")
|
|
123
123
|
else
|
|
124
124
|
event.skip()
|