Final tweaks for 2.1b1
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2914 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -50,6 +50,13 @@ class TestListCtrlPanel(wxPanel):
|
||||
EVT_LIST_ITEM_SELECTED(self, tID, self.OnItemSelected)
|
||||
EVT_LEFT_DCLICK(self.list, self.OnDoubleClick)
|
||||
EVT_COMMAND_RIGHT_CLICK(self.list, tID, self.OnRightClick)
|
||||
EVT_RIGHT_DOWN(self.list, self.OnRightDown)
|
||||
|
||||
|
||||
def OnRightDown(self, event):
|
||||
self.x = event.GetX()
|
||||
self.log.WriteText("x = %d\n" % self.x)
|
||||
event.Skip()
|
||||
|
||||
def OnItemSelected(self, event):
|
||||
self.currentItem = event.m_itemIndex
|
||||
@@ -58,9 +65,30 @@ class TestListCtrlPanel(wxPanel):
|
||||
def OnDoubleClick(self, event):
|
||||
self.log.WriteText("OnDoubleClick item %s\n" % self.list.GetItemText(self.currentItem))
|
||||
|
||||
|
||||
def OnRightClick(self, event):
|
||||
self.log.WriteText("OnRightClick %s\n" % self.list.GetItemText(self.currentItem))
|
||||
menu = wxPyMenu()
|
||||
tPopupID1 = 0
|
||||
tPopupID2 = 1
|
||||
tPopupID3 = 2
|
||||
menu.Append(tPopupID1, "One")
|
||||
menu.Append(tPopupID2, "Two")
|
||||
menu.Append(tPopupID3, "Three")
|
||||
EVT_MENU(self, tPopupID1, self.OnPopupOne)
|
||||
EVT_MENU(self, tPopupID2, self.OnPopupTwo)
|
||||
EVT_MENU(self, tPopupID3, self.OnPopupThree)
|
||||
pos = self.list.GetItemPosition(self.currentItem)
|
||||
self.PopupMenu(menu, self.x, pos.y)
|
||||
|
||||
def OnPopupOne(self, event):
|
||||
self.log.WriteText("Popup one\n")
|
||||
|
||||
def OnPopupTwo(self, event):
|
||||
self.log.WriteText("Popup two\n")
|
||||
|
||||
def OnPopupThree(self, event):
|
||||
self.log.WriteText("Popup three\n")
|
||||
|
||||
def OnSize(self, event):
|
||||
w,h = self.GetClientSizeTuple()
|
||||
@@ -69,6 +97,8 @@ class TestListCtrlPanel(wxPanel):
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
def runTest(frame, nb, log):
|
||||
|
Reference in New Issue
Block a user