mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-15 17:20:07 +01:00
Merge pull request #935 from RobinD42/fix-issue918
Added wx.Treebook.GetTreeCtrl and wx.Choicebook.GetChoiceCtrl
(cherry picked from commit f85818a25d)
This commit is contained in:
@@ -67,6 +67,7 @@ Changes in this release include the following:
|
||||
|
||||
* Fix the object ownership transfer for wx.Menu.Insert() (#931)
|
||||
|
||||
* Added wx.Treebook.GetTreeCtrl and wx.Choicebook.GetChoiceCtrl. (#918)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -38,6 +38,11 @@ def run():
|
||||
tools.fixWindowClass(c)
|
||||
tools.fixBookctrlClass(c)
|
||||
|
||||
c.addCppMethod('wxChoice*', 'GetChoiceCtrl', '()',
|
||||
doc="Returns the choice control used for selecting pages.",
|
||||
body="return(self->GetChoiceCtrl());")
|
||||
|
||||
|
||||
module.addPyCode("""\
|
||||
EVT_CHOICEBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_CHOICEBOOK_PAGE_CHANGED, 1 )
|
||||
EVT_CHOICEBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_CHOICEBOOK_PAGE_CHANGING, 1 )
|
||||
|
||||
@@ -38,6 +38,10 @@ def run():
|
||||
tools.fixWindowClass(c)
|
||||
tools.fixBookctrlClass(c)
|
||||
|
||||
c.addCppMethod('wxTreeCtrl*', 'GetTreeCtrl', '()',
|
||||
doc="Returns the tree control used for selecting pages.",
|
||||
body="return(self->GetTreeCtrl());")
|
||||
|
||||
module.addPyCode("""\
|
||||
EVT_TREEBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_TREEBOOK_PAGE_CHANGED, 1 )
|
||||
EVT_TREEBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_TREEBOOK_PAGE_CHANGING, 1)
|
||||
|
||||
@@ -31,6 +31,14 @@ class choicebk_Tests(wtc.WidgetTestCase):
|
||||
book.AddPage(wx.Panel(book), 'two')
|
||||
|
||||
|
||||
def test_choicebk4(self):
|
||||
book = wx.Choicebook(self.frame)
|
||||
book.AddPage(wx.Panel(book), 'one')
|
||||
book.AddPage(wx.Panel(book), 'two')
|
||||
|
||||
choice = book.GetChoiceCtrl()
|
||||
assert isinstance(choice, wx.Choice)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -30,6 +30,16 @@ class treebook_Tests(wtc.WidgetTestCase):
|
||||
book.AddSubPage(wx.Panel(book), 'three')
|
||||
|
||||
|
||||
def test_treebook4(self):
|
||||
book = wx.Treebook(self.frame)
|
||||
book.AddPage(wx.Panel(book), 'one')
|
||||
book.AddPage(wx.Panel(book), 'two')
|
||||
book.AddSubPage(wx.Panel(book), 'three')
|
||||
|
||||
tree = book.GetTreeCtrl()
|
||||
assert isinstance(tree, wx.TreeCtrl)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user