diff --git a/unittests/test_ribbon_buttonbar.py b/unittests/test_ribbon_buttonbar.py index b5f0e20b..d4d0bdc6 100644 --- a/unittests/test_ribbon_buttonbar.py +++ b/unittests/test_ribbon_buttonbar.py @@ -26,6 +26,12 @@ class ribbon_buttonbar_Tests(wtc.WidgetTestCase): bmp = wx.Bitmap(16,16) b = bb.AddButton(100, "label", bmp, "help string") + with self.assertRaises(AttributeError): + bb.SetItemClientData + + with self.assertRaises(AttributeError): + bb.GetItemClientData + def test_ribbon_buttonbar4(self): evt = wx.ribbon.RibbonButtonBarEvent() diff --git a/unittests/test_ribbon_gallery.py b/unittests/test_ribbon_gallery.py index 96f209d8..46985899 100644 --- a/unittests/test_ribbon_gallery.py +++ b/unittests/test_ribbon_gallery.py @@ -12,6 +12,59 @@ class ribbon_gallery_Tests(wtc.WidgetTestCase): wx.ribbon.RIBBON_GALLERY_BUTTON_ACTIVE wx.ribbon.RIBBON_GALLERY_BUTTON_DISABLED + wx.ribbon.wxEVT_RIBBONGALLERY_HOVER_CHANGED + wx.ribbon.wxEVT_RIBBONGALLERY_SELECTED + wx.ribbon.wxEVT_RIBBONGALLERY_CLICKED + + wx.ribbon.EVT_RIBBONGALLERY_HOVER_CHANGED + wx.ribbon.EVT_RIBBONGALLERY_SELECTED + wx.ribbon.EVT_RIBBONGALLERY_CLICKED + + + def test_ribbon_gallery2(self): + evt = wx.ribbon.RibbonGalleryEvent() + + + def test_ribbon_gallery3(self): + ribbon = wx.ribbon.RibbonBar(self.frame) + g = wx.ribbon.RibbonGallery() + g.Create(ribbon) + + + def test_ribbon_gallery4(self): + ribbon = wx.ribbon.RibbonBar(self.frame) + g = wx.ribbon.RibbonGallery(ribbon) + item = g.Append(wx.Bitmap(16,16), 101) + assert isinstance(item, wx.ribbon.RibbonGalleryItem) + + + def test_ribbon_gallery5(self): + ribbon = wx.ribbon.RibbonBar(self.frame) + g = wx.ribbon.RibbonGallery(ribbon) + with self.assertRaises(AttributeError): + g.SetItemClientData + + with self.assertRaises(AttributeError): + g.GetItemClientData + + + @unittest.skip('because') + def test_ribbon_gallery6(self): + ribbon = wx.ribbon.RibbonBar(self.frame) + g = wx.ribbon.RibbonGallery(ribbon) + + class _Data(object): + def __init__(self, **kw): + self.__dict__.update(kw) + + data_in = _Data(a=1, b=2, c=3) + item = g.Append(wx.Bitmap(16,16), 102, data_in) + #data_out = g.GetItemClientObject(item) + #self.assertTrue(data_out is data_in) + + + + #--------------------------------------------------------------------------- diff --git a/unittests/test_ribbon_panel.py b/unittests/test_ribbon_panel.py index 8b8e82c4..b10294a4 100644 --- a/unittests/test_ribbon_panel.py +++ b/unittests/test_ribbon_panel.py @@ -24,12 +24,14 @@ class ribbon_panel_Tests(wtc.WidgetTestCase): def test_ribbon_panel3(self): + bar = wx.ribbon.RibbonBar(self.frame) p = wx.ribbon.RibbonPanel() - p.Create(self.frame) + p.Create(bar) def test_ribbon_panel4(self): - p = wx.ribbon.RibbonPanel(self.frame) + bar = wx.ribbon.RibbonBar(self.frame) + p = wx.ribbon.RibbonPanel(bar) p.GetMinimisedIcon() p.HasExtButton()