Test wx.ListBox.HitTest
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -20,6 +20,8 @@ class TestPanel(wx.Panel):
|
|||||||
lb.SetSelection(0)
|
lb.SetSelection(0)
|
||||||
self.lb = lb
|
self.lb = lb
|
||||||
|
|
||||||
|
lb.Bind(wx.EVT_RIGHT_DOWN, self.OnDoHitTest)
|
||||||
|
|
||||||
pos = lb.GetPosition().x + lb.GetSize().width + 25
|
pos = lb.GetPosition().x + lb.GetSize().width + 25
|
||||||
btn = wx.Button(self, -1, "Test SetString", (pos, 50))
|
btn = wx.Button(self, -1, "Test SetString", (pos, 50))
|
||||||
self.Bind(wx.EVT_BUTTON, self.OnTestButton, btn)
|
self.Bind(wx.EVT_BUTTON, self.OnTestButton, btn)
|
||||||
@@ -40,6 +42,10 @@ class TestPanel(wx.Panel):
|
|||||||
def OnTestButton(self, evt):
|
def OnTestButton(self, evt):
|
||||||
self.lb.SetString(4, "FUBAR")
|
self.lb.SetString(4, "FUBAR")
|
||||||
|
|
||||||
|
def OnDoHitTest(self, evt):
|
||||||
|
item = self.lb.HitTest(evt.GetPosition())
|
||||||
|
self.log.write("HitTest: %d\n" % item)
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
def runTest(frame, nb, log):
|
def runTest(frame, nb, log):
|
||||||
|
Reference in New Issue
Block a user