[1] I see cursor blinking in every stcs on (OSX10.6.8, Python2.7,
wxPython2.9.13.1)
[2] below event not working on (Linux 11.10 32bit, wxPython2.9) but
it's working (Linux 11.10 32bit, wxPython2.8) and (OSX10.6.8,
Python2.7, wxPython2.9.13.1)
[3] below code is not working in order to move between stcs. because
there is a button.
def OnKeyDown(self, event):
if not (event.ControlDown() and event.GetKeyCode() ==
wx.WXK_TAB):
event.Skip()
return
flag = wx.NavigationKeyEvent.IsForward
if event.ShiftDown():
flag = 0
self.Navigate(flag)
so I am not sure how to move the cursor by arrow key.
def OnKeyPressed(self, event):
curStc = event.GetEventObject()
# print curStc.GetCurrentLine()
# privious = None
if curStc.GetCurrentLine() == 0:
allitems = [w.GetWindow() for w in
self.GetGrandParent().Autosizer.GetChildren() if w.GetWindow() is not
None]
# useNextone = False
for item in allitems:
if isinstance(item, wx.stc.StyledTextCtrl):
if curStc == item:
previous.SetFocus()
# useNextone = True
break
# elif useNextone == False:
# curStc.SetFocus()
else:
previous = item
# useNextone = False
event.Skip()
[1] I see cursor blinking in every stcs on (OSX10.6.8, Python2.7,
wxPython2.9.13.1)
wxOSX-cocoa is not sending the EVT_KILL_FOCUS events[1], so the STC does not get the signal to stop flashing the caret. As a workaround you could catch the focus event (EVT_SET_FOCUS) for all widgets and in the handler call the SetSTCFocus(False) method for all other STCs. That will do the same thing that the STC would do internally in its kill focus handler.
[2] below event not working on (Linux 11.10 32bit, wxPython2.9) but
it's working (Linux 11.10 32bit, wxPython2.8) and (OSX10.6.8,
Python2.7, wxPython2.9.13.1)
The wheel events are probably being ignored if they were not sent to the window originally receiving them. You could try changing the event object so it looks like its intended target is the parent window, or make a new wheel event object for it. Or you could just call the parent's scrolling related functions yourself instead of (re)sending an event.
[3] below code is not working in order to move between stcs. because
there is a button.
As I said before if you don't want to do normal navigation then don't use the Navigate method and just call the target STC's SetFocus method to move the focus there.