Greetings,
I am working with an EditableListBox and I was wondering if anyone knows if it is possible to get an update on the Item String and it's index when ever the Up or Down arrows are clicked on?
This is what I have so far (I think I'm doing it right):
def onFocusQ(self, event):
self.currentItem = event.m_itemIndex
print self.list_1.GetItemText(self.currentItem)
# TODO: notify the map list of the items new index
event.Skip()
def onChangeRowQ_up(self, event):
print "Change Row up"
# TODO: call the onFocusQ method ???
# OR get the new index value ???
event.Skip()
def onChangeRowQ_dn(self, event):
print "Change Row down"
# TODO: call the onFocusQ method ???
# OR get the new index value ???
event.Skip()
def onDeleteQuestions(self, event):
# Works fine
self.currentItem = event.m_itemIndex
print self.list_1.GetItemText(self.currentItem)
event.Skip()
What I would like to do is have the onChangeRowQ functions call the onFocusQ function (currently any mouse or keyboard actions call it, this is not what I want to happen), so I guess the question is how do I fake the event for onFocusQ?
Scott
···
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.5.7 - Release Date: 3/1/2005
"self.list_1.GetItemText(self.currentItem)" this returns the text
"self.currentItem + 1" and this returns the CURRENT index (if I removed the +/- 1 it returns where it WAS. Strange, but it works and I am happy.
Scott
Scott Mallory wrote:
···
Greetings,
I am working with an EditableListBox and I was wondering if anyone knows if it is possible to get an update on the Item String and it's index when ever the Up or Down arrows are clicked on?
This is what I have so far (I think I'm doing it right):
def onFocusQ(self, event):
self.currentItem = event.m_itemIndex
print self.list_1.GetItemText(self.currentItem)
# TODO: notify the map list of the items new index
event.Skip()
def onChangeRowQ_up(self, event):
print "Change Row up"
# TODO: call the onFocusQ method ???
# OR get the new index value ???
event.Skip()
def onChangeRowQ_dn(self, event):
print "Change Row down"
# TODO: call the onFocusQ method ???
# OR get the new index value ???
event.Skip()
def onDeleteQuestions(self, event):
# Works fine
self.currentItem = event.m_itemIndex
print self.list_1.GetItemText(self.currentItem)
event.Skip()
What I would like to do is have the onChangeRowQ functions call the onFocusQ function (currently any mouse or keyboard actions call it, this is not what I want to happen), so I guess the question is how do I fake the event for onFocusQ?
Scott
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.5.7 - Release Date: 3/1/2005
Greetings,
I am working with an EditableListBox and I was wondering if anyone knows if it is possible to get an update on the Item String and it's index when ever the Up or Down arrows are clicked on?
This is what I have so far (I think I'm doing it right):
def onFocusQ(self, event):
self.currentItem = event.m_itemIndex
print self.list_1.GetItemText(self.currentItem)
# TODO: notify the map list of the items new index
event.Skip()
def onChangeRowQ_up(self, event):
print "Change Row up"
# TODO: call the onFocusQ method ???
# OR get the new index value ???
event.Skip()
def onChangeRowQ_dn(self, event):
print "Change Row down"
# TODO: call the onFocusQ method ???
# OR get the new index value ???
event.Skip()
def onDeleteQuestions(self, event):
# Works fine
self.currentItem = event.m_itemIndex
print self.list_1.GetItemText(self.currentItem)
event.Skip()
What I would like to do is have the onChangeRowQ functions call the onFocusQ function (currently any mouse or keyboard actions call it, this is not what I want to happen), so I guess the question is how do I fake the event for onFocusQ?
Don't. Create a new function that takes the item and whatever else you need as parameters and call it from both onFocusQ and the onChangeRow functions.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!