+#---------------------------------------------------------------------------
+
+class TestListCtrlPanel(wxPanel):
+ def __init__(self, parent, log):
+ wxPanel.__init__(self, parent, -1)
+
+ self.log = log
+ tID = 1101
+
+ self.il = wxImageList(16, 16)
+ idx1 = self.il.Add(wxNoRefBitmap('bitmaps/smiles.bmp', wxBITMAP_TYPE_BMP))
+
+ self.list = wxListCtrl(self, tID, wxDefaultPosition, wxDefaultSize,
+ wxLC_REPORT|wxSUNKEN_BORDER)
+ self.list.SetImageList(self.il, wxIMAGE_LIST_SMALL)
+
+ #self.list.SetToolTip(wxToolTip("This is a ToolTip!"))
+ #wxToolTip_Enable(true)
+
+ self.list.InsertColumn(0, "Column 0")
+ self.list.InsertColumn(1, "Column 1")
+ self.list.InsertColumn(2, "One More Column (2)")
+ for x in range(50):
+ self.list.InsertImageStringItem(x, "This is item %d" % x, idx1)
+ self.list.SetStringItem(x, 1, "Col 1, item %d" % x)
+ self.list.SetStringItem(x, 2, "item %d in column 2" % x)
+
+ self.list.SetColumnWidth(0, wxLIST_AUTOSIZE)
+ self.list.SetColumnWidth(1, wxLIST_AUTOSIZE)
+ self.list.SetColumnWidth(2, wxLIST_AUTOSIZE)
+
+
+ def OnSize(self, event):
+ w,h = self.GetClientSizeTuple()
+ self.list.SetDimensions(0, 0, w, h)
+
+
+
+
+class TestListCtrl(wxFrame):
+ def __init__(self, parent, log):
+ wxFrame.__init__(self, parent, -1, 'Test ListCtrl',
+ wxDefaultPosition, wxSize(250, 300))
+
+ p = TestListCtrlPanel(self, log)
+
+