+ def OnClickBox(self, evt):
+ box = self.boxes[evt.GetId()]
+ # Collapse/restore static box, change label
+ self.ShowGroup(box.gnum, not box.show)
+ if box.show: box.SetLabel('[+] ' + box.name)
+ else: box.SetLabel('[-] ' + box.name)
+ self.Layout()
+
+ # Drag
+ def OnRightClick(self, evt):
+ do = MyDataObject()
+ do.SetData(str(evt.GetId()))
+ bm = evt.GetEventObject().GetBitmapLabel()
+ if wx.Platform != '__WXMAC__':
+ icon = wx.EmptyIcon()
+ icon.CopyFromBitmap(bm)
+ dragSource = wx.DropSource(self, icon)
+ else: # on Mac DragSource requires cursor (but does not work anyway)
+ curs = wx.CursorFromImage(wx.ImageFromBitmap(bm))
+ dragSource = wx.DropSource(self, curs)
+ dragSource.SetData(do)
+ g.frame.SetStatusText('Release the mouse button over the test window')
+ dragSource.DoDragDrop()
+