wxruby3 0.9.0.pre.beta.14 → 0.9.0.pre.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/README.md +47 -4
- data/assets/hello_button.png +0 -0
- data/assets/hello_button_clicked.png +0 -0
- data/assets/hello_world.png +0 -0
- data/assets/repo-social-preview.png +0 -0
- data/ext/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
data/rakelib/lib/director/app.rb
CHANGED
@@ -12,8 +12,8 @@ module WXRuby3
|
|
12
12
|
class App < EvtHandler
|
13
13
|
|
14
14
|
def setup
|
15
|
-
spec.items << 'wxAppConsole'
|
16
|
-
spec.fold_bases('wxApp' => 'wxAppConsole')
|
15
|
+
spec.items << 'wxAppConsole' << 'wxEventFilter'
|
16
|
+
spec.fold_bases('wxApp' => 'wxAppConsole', 'wxAppConsole' => 'wxEventFilter')
|
17
17
|
spec.override_inheritance_chain('wxApp', %w[wxEvtHandler wxObject])
|
18
18
|
spec.ignore %w{
|
19
19
|
wxApp.ProcessMessage
|
@@ -78,6 +78,7 @@ module WXRuby3
|
|
78
78
|
spec.no_proxy %w{
|
79
79
|
wxApp::GetDisplayMode
|
80
80
|
wxApp::GetTopWindow
|
81
|
+
wxApp::OnAssertFailure
|
81
82
|
}
|
82
83
|
spec.include %w{
|
83
84
|
wx/init.h
|
@@ -340,7 +341,28 @@ module WXRuby3
|
|
340
341
|
// actually implemented in ruby in classes/app.rb
|
341
342
|
virtual void OnAssertFailure(const wxChar *file, int line, const wxChar *func, const wxChar *cond, const wxChar *msg)
|
342
343
|
{
|
343
|
-
|
344
|
+
VALUE rb_app = SWIG_RubyInstanceFor(this);
|
345
|
+
if (rb_during_gc() || NIL_P(rb_app))
|
346
|
+
{
|
347
|
+
std::wcout << file << "(" << line << "): ASSERT " << cond
|
348
|
+
<< (NIL_P(rb_app) ? " fired without THE_APP in " : " fired during GC phase in ")
|
349
|
+
<< func << "() with message [" << msg << "]" << std::endl;
|
350
|
+
}
|
351
|
+
else
|
352
|
+
{
|
353
|
+
VALUE obj0 = Qnil ;
|
354
|
+
VALUE obj1 = Qnil ;
|
355
|
+
VALUE obj2 = Qnil ;
|
356
|
+
VALUE obj3 = Qnil ;
|
357
|
+
VALUE obj4 = Qnil ;
|
358
|
+
|
359
|
+
obj0 = rb_str_new2((const char *)wxString(file).utf8_str());
|
360
|
+
obj1 = INT2NUM(line);
|
361
|
+
obj2 = rb_str_new2((const char *)wxString(func).utf8_str());
|
362
|
+
obj3 = rb_str_new2((const char *)wxString(cond).utf8_str());
|
363
|
+
obj4 = rb_str_new2((const char *)wxString(msg).utf8_str());
|
364
|
+
(void)wxRuby_Funcall(rb_app, rb_intern("on_assert_failure"), 5,obj0,obj1,obj2,obj3,obj4);
|
365
|
+
}
|
344
366
|
}
|
345
367
|
|
346
368
|
void _wxRuby_Cleanup()
|
@@ -15,7 +15,11 @@ module WXRuby3
|
|
15
15
|
spec.use_class_implementation('wxArtProvider', 'wxRubyArtProvider')
|
16
16
|
spec.ignore('wxArtProvider::Insert') # deprecated and problematic
|
17
17
|
spec.ignore('wxArtProvider::Remove') # problematic as adding disowns the art provider, use Delete
|
18
|
-
|
18
|
+
# regard protected methods
|
19
|
+
spec.regard 'wxArtProvider::DoGetSizeHint',
|
20
|
+
'wxArtProvider::CreateBitmap',
|
21
|
+
'wxArtProvider::CreateBitmapBundle',
|
22
|
+
'wxArtProvider::CreateIconBundle'
|
19
23
|
spec.include('wx/artprov.h')
|
20
24
|
spec.add_swig_code <<~__HEREDOC
|
21
25
|
// ArtId and ArtClient are basically just strings ...
|
@@ -16,7 +16,7 @@ module WXRuby3
|
|
16
16
|
super
|
17
17
|
# now replace items because wxAuiTabCtrl is actually not documented (!!!)
|
18
18
|
spec.items.replace %w[wxAuiTabContainerButton]
|
19
|
-
spec.
|
19
|
+
spec.gc_as_untracked 'wxAuiTabContainerButton'
|
20
20
|
spec.no_proxy %w[wxAuiTabCtrl wxAuiTabContainerButton]
|
21
21
|
spec.swig_import %w[swig/classes/include/wxObject.h swig/classes/include/wxEvtHandler.h swig/classes/include/wxWindow.h swig/classes/include/wxControl.h]
|
22
22
|
# cannot use #add_extend_code because we do not have an actual parsed XML item
|
@@ -0,0 +1,32 @@
|
|
1
|
+
###
|
2
|
+
# wxRuby3 wxWidgets interface director
|
3
|
+
# Copyright (c) M.J.N. Corino, The Netherlands
|
4
|
+
###
|
5
|
+
|
6
|
+
require_relative './ctrl_with_items'
|
7
|
+
|
8
|
+
module WXRuby3
|
9
|
+
|
10
|
+
class Director
|
11
|
+
|
12
|
+
class BitmapComboBox < ControlWithItems
|
13
|
+
|
14
|
+
def setup
|
15
|
+
super
|
16
|
+
setup_ctrl_with_items('wxBitmapComboBox')
|
17
|
+
spec.override_inheritance_chain('wxBitmapComboBox',
|
18
|
+
%w[wxComboBox
|
19
|
+
wxControlWithItems
|
20
|
+
wxControl
|
21
|
+
wxWindow
|
22
|
+
wxEvtHandler
|
23
|
+
wxObject])
|
24
|
+
spec.ignore 'wxBitmapComboBox::Insert(const wxString &, const wxBitmap &, unsigned int, wxClientData *)',
|
25
|
+
'wxBitmapComboBox::Append(const wxString &, const wxBitmap &, wxClientData *)'
|
26
|
+
end
|
27
|
+
|
28
|
+
end # class BitmapComboBox
|
29
|
+
|
30
|
+
end # class Director
|
31
|
+
|
32
|
+
end # module WXRuby3
|
@@ -12,6 +12,7 @@ module WXRuby3
|
|
12
12
|
def setup
|
13
13
|
super
|
14
14
|
spec.disable_proxies
|
15
|
+
spec.gc_as_untracked 'wxBrush'
|
15
16
|
# all but the default ctor require a running App
|
16
17
|
spec.require_app 'wxBrush::wxBrush(const wxColour &colour, wxBrushStyle style)',
|
17
18
|
'wxBrush::wxBrush(const wxBitmap &stippleBitmap)',
|
@@ -13,7 +13,7 @@ module WXRuby3
|
|
13
13
|
super
|
14
14
|
spec.items << 'wxBusyInfoFlags'
|
15
15
|
spec.disable_proxies
|
16
|
-
spec.
|
16
|
+
spec.gc_as_untracked 'wxBusyInfo', 'wxBusyInfoFlags'
|
17
17
|
# again C++ type guards do not work with Ruby
|
18
18
|
# need to Rubify this
|
19
19
|
spec.make_abstract 'wxBusyInfo'
|
@@ -23,6 +23,7 @@ module WXRuby3
|
|
23
23
|
# redundant with good typemaps
|
24
24
|
spec.ignore('wxChoice::wxChoice(wxWindow *,wxWindowID,const wxPoint &,const wxSize &,int,const wxString[],long,const wxValidator &,const wxString &)')
|
25
25
|
spec.ignore('wxChoice::Create(wxWindow *,wxWindowID,const wxPoint &,const wxSize &,int,const wxString[],long,const wxValidator &,const wxString &)')
|
26
|
+
spec.ignore('wxChoice::IsSorted') # provided by ControlWithItems
|
26
27
|
end
|
27
28
|
|
28
29
|
end # class Choice
|
@@ -13,7 +13,7 @@ module WXRuby3
|
|
13
13
|
|
14
14
|
def setup
|
15
15
|
super
|
16
|
-
spec.
|
16
|
+
spec.gc_as_untracked # don't even track Clipboard objects
|
17
17
|
# there is no need or support for clipboard derivatives
|
18
18
|
# not least because wxRuby only ever allows a single global clipboard
|
19
19
|
spec.disable_proxies
|
@@ -13,7 +13,7 @@ module WXRuby3
|
|
13
13
|
|
14
14
|
def setup
|
15
15
|
super
|
16
|
-
spec.
|
16
|
+
spec.make_concrete 'wxColourPickerCtrl'
|
17
17
|
spec.do_not_generate(:variables, :defines, :enums, :functions) # with ColourPickerEvent
|
18
18
|
end
|
19
19
|
end # class ColourPickerCtrl
|
@@ -22,8 +22,7 @@ module WXRuby3
|
|
22
22
|
wxWindow
|
23
23
|
wxEvtHandler
|
24
24
|
wxObject])
|
25
|
-
spec.ignore(
|
26
|
-
wxComboBox::IsEmpty])
|
25
|
+
spec.ignore('wxComboBox::IsEmpty') # ambiguous ControlWithItems<>TextEntry
|
27
26
|
spec.rename_for_ruby(
|
28
27
|
'SetTextSelectionRange' => 'wxComboBox::SetSelection(long, long)',
|
29
28
|
'GetTextSelectionRange' => 'wxComboBox::GetSelection(long *, long *) const')
|
@@ -47,6 +47,9 @@ module WXRuby3
|
|
47
47
|
'wxItemContainer::Append(const wxArrayString &, void **)',
|
48
48
|
'wxItemContainer::Insert(const wxArrayString &, unsigned int, void **)',
|
49
49
|
'wxItemContainer::Set(const wxArrayString &, void **)'], ignore_doc: false)
|
50
|
+
# add undocumented method
|
51
|
+
spec.extend_interface 'wxControlWithItems',
|
52
|
+
'bool IsSorted() const'
|
50
53
|
# for doc only
|
51
54
|
spec.map 'void** clientData' => 'Array', swig: false do
|
52
55
|
map_in code: ''
|
@@ -10,6 +10,7 @@ module WXRuby3
|
|
10
10
|
class Cursor < Director
|
11
11
|
|
12
12
|
def setup
|
13
|
+
spec.gc_as_untracked 'wxCursor'
|
13
14
|
# all but the default ctor require a running App
|
14
15
|
spec.require_app 'wxCursor::wxCursor(const wxString &, wxBitmapType, int, int)',
|
15
16
|
'wxCursor::wxCursor(wxStockCursor)',
|
@@ -44,13 +44,11 @@ module WXRuby3
|
|
44
44
|
spec.ignore 'wxTextDataObject::GetAllFormats'
|
45
45
|
|
46
46
|
%w[wxDataObjectComposite wxBitmapDataObject wxFileDataObject wxTextDataObject wxImageDataObject wxURLDataObject].each do |kls|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
%feature("notabstract") #{kls};
|
53
|
-
__HEREDOC
|
47
|
+
# SWIG gets confused and doesn't realise that various virtual methods
|
48
|
+
# from wxDataObject are implemented fully in these subclasses, and so,
|
49
|
+
# believing it to be abstract doesn't provide an allocator for this
|
50
|
+
# class. This overrides this.
|
51
|
+
spec.make_concrete kls
|
54
52
|
end
|
55
53
|
|
56
54
|
# Once a DataObject has been added, it belongs to the wxDataObjectComposite object,
|
data/rakelib/lib/director/dc.rb
CHANGED
@@ -13,8 +13,12 @@ module WXRuby3
|
|
13
13
|
|
14
14
|
def setup
|
15
15
|
super
|
16
|
+
# it's not safe to track DC objects as these are often created on the stack in C++
|
17
|
+
# before being passed to Ruby methods
|
18
|
+
# as we cannot capture their deletion in anyway this would leave the tracked items
|
19
|
+
# registered and reused when future stack allocated DC's happen to have the same address
|
20
|
+
spec.gc_as_untracked
|
16
21
|
spec.ignore [
|
17
|
-
'wxDC::StartPage',
|
18
22
|
'wxDC::GetPartialTextExtents',
|
19
23
|
'wxDC::DrawLines(const wxPointList *,wxCoord,wxCoord)',
|
20
24
|
'wxDC::DrawPolygon(const wxPointList *,wxCoord,wxCoord,wxPolygonFillMode)',
|