I am stuck a little with replacing the tree pane in AUI demo with a
CheckListCtrl
Evthg works fine but I do not know how to access/ return a dict/ a
variable to my AuiFrame clas from where I am calling CheckListCtrl.
What I do:
I added the CheckListCtr class following the demo to my application
My main application frame is an AuiFrame. there I am calling
CheckListCtrl. All works fine.
I bound an event OnCheckItem to when an item is checked whick triggers
some database stuff and creates a dictionary.
I now want to return this dict to my AuiFrame since I want to create a
new notebook tab d�from it (remember: I am using AUi demo as a basis).
How can I do that?
ThanX
class CheckListCtrl(wx.ListCtrl, CheckListCtrlMixin):
def __init__(self, parent):
wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT)
CheckListCtrlMixin.__init__(self)
self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated)
def OnItemActivated(self, evt):
self.ToggleItem(evt.m_itemIndex)
def OnCheckItem(self, index, flag):
if flag:
# ... do some database stuff and get a dictionary as result
# based on AUI demo ....
class AuiFrame(wx.Frame):
def __init__(self, parent, id=wx.ID_ANY, title="OKI OPO Tool", pos=
wx.DefaultPosition,
size=(800,600),
style=wx.DEFAULT_FRAME_STYLE|wx.SUNKEN_BORDER, log=None):
wx.Frame.__init__(self, parent, id, title, pos, size, style)
self._mgr = aui.AuiManager()
# tell AuiManager to manage this frame
self._mgr.SetManagedWindow(self)
auiframeinstance = self
# set frame icon
#self.SetIcon(images.Mondrian.GetIcon())
iconfile=art_image.icon.GetIcon()
self.SetIcon(iconfile)
# maximize the window
self.Maximize(1)
### .............. etc ...
def CreateProductsCheckListCtrl(self):
list = CheckListCtrl(self)
sizer = wx.BoxSizer()
sizer.Add(list,0, wx.EXPAND)
sizer.Add(btn,0,wx.EXPAND )
self.SetSizer(sizer)
list.InsertColumn(0, "Modell)
#### ... etc