mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-09 13:30:08 +01:00
Add a new wxDataViewItem ctor accepting an integer value.
Apparently sip used to auto-convert from int to void* but it doesn't anymore. Fixes #15135 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73781 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -75,6 +75,11 @@ def run():
|
||||
#-----------------------------------------------------------------
|
||||
c = module.find('wxDataViewItem')
|
||||
assert isinstance(c, etgtools.ClassDef)
|
||||
|
||||
c.addCppCtor('(wxIntPtr id)', """\
|
||||
return new wxDataViewItem((void*)id);
|
||||
""")
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
@@ -88,6 +93,7 @@ def run():
|
||||
""")
|
||||
c.addAutoProperties()
|
||||
|
||||
|
||||
module.addItem(
|
||||
tools.wxArrayWrapperTemplate('wxDataViewItemArray', 'wxDataViewItem', module))
|
||||
module.addPyCode("NullDataViewItem = DataViewItem()")
|
||||
|
||||
@@ -35,6 +35,13 @@ class dataview_Tests(wtc.WidgetTestCase):
|
||||
self.assertFalse(dv.NullDataViewItem)
|
||||
|
||||
|
||||
def test_dataviewItem6(self):
|
||||
dvi1 = dv.DataViewItem(111)
|
||||
dvi2 = dv.DataViewItem(222)
|
||||
self.assertTrue(int(dvi1.GetID()) == 111)
|
||||
self.assertTrue(int(dvi2.ID) == 222)
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
def test_dataviewItemAttr1(self):
|
||||
a = dv.DataViewItemAttr()
|
||||
|
||||
Reference in New Issue
Block a user