More STC fixes. The demo now shows Calltips and AtuoComplete

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7315 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2000-04-29 05:18:40 +00:00
parent 6e96414894
commit 2442422672
4 changed files with 25 additions and 8 deletions

View File

@@ -118,6 +118,21 @@ class PythonSTC(wxStyledTextCtrl):
self.StyleSetSpec(34, "fore:#FFFFFF,back:#0000FF,bold")
self.StyleSetSpec(35, "fore:#000000,back:#FF0000,bold")
EVT_KEY_UP(self, self.OnKeyPressed)
def OnKeyPressed(self, event):
key = event.KeyCode()
if key == 32 and event.ControlDown():
pos = self.GetCurrentPos()
# Tips
if event.ShiftDown():
self.CallTipSetBackground("yellow")
self.CallTipShow(pos, 'param1, param2')
# Code completion
else:
self.AutoCompShow('I love wxPython a b c')
def OnUpdateUI(self, evt):
@@ -148,8 +163,10 @@ class PythonSTC(wxStyledTextCtrl):
self.BraceBadlight(braceAtCaret)
else:
self.BraceHighlight(braceAtCaret, braceOpposite)
self.SetCurrentPosition(braceOpposite)
self.SetCurrentPosition(caretPos)
#pt = self.PointFromPosition(braceOpposite)
#self.Refresh(true, wxRect(pt.x, pt.y, 5,5))
#print pt
#self.Refresh(false)
def OnMarginClick(self, evt):

View File

@@ -162,7 +162,7 @@ FINAL=1
# #*#*#*#*#* Comment this out to allow upload...
return
##return
logSeparator("Uploading to website...")
do('python c:\\utils\\sendwxp.py %s' % destName)
@@ -175,7 +175,7 @@ FINAL=1
logSeparator("Finished!!!")
finally:
## os.system("list " + logfile)
os.system("list " + logfile)
pass

View File

@@ -67,8 +67,8 @@ def EVT_STC_DOUBLECLICK(win, id, fn):
def EVT_STC_MODIFIED(win, id, fn):
win.Connect(id, -1, wxEVT_STC_MODIFIED, fn)
def EVT_STC_CMDKEY(win, id, fn):
win.Connect(id, -1, wxEVT_STC_CMDKEY, fn)
def EVT_STC_KEY(win, id, fn):
win.Connect(id, -1, wxEVT_STC_KEY, fn)
def EVT_STC_MACRORECORD(win, id, fn):
win.Connect(id, -1, wxEVT_STC_MACRORECORD, fn)

View File

@@ -62,8 +62,8 @@ def EVT_STC_DOUBLECLICK(win, id, fn):
def EVT_STC_MODIFIED(win, id, fn):
win.Connect(id, -1, wxEVT_STC_MODIFIED, fn)
def EVT_STC_CMDKEY(win, id, fn):
win.Connect(id, -1, wxEVT_STC_CMDKEY, fn)
def EVT_STC_KEY(win, id, fn):
win.Connect(id, -1, wxEVT_STC_KEY, fn)
def EVT_STC_MACRORECORD(win, id, fn):
win.Connect(id, -1, wxEVT_STC_MACRORECORD, fn)