Call tips implemented

Originally committed to SVN as r682.
This commit is contained in:
Rodrigo Braz Monteiro 2007-01-02 18:15:17 +00:00
parent 893955d773
commit 3ec34573a8
2 changed files with 6 additions and 1 deletions

View file

@ -125,6 +125,7 @@ SubsTextEditCtrl::SubsTextEditCtrl(wxWindow* parent, wxWindowID id, const wxStri
delim = _T(" .,;:!?¿¡-(){}[]\"/\\"); delim = _T(" .,;:!?¿¡-(){}[]\"/\\");
// Prototypes for call tips // Prototypes for call tips
tipProtoN = -1;
proto.Add(_T("move(x1,y1,x2,y2)")); proto.Add(_T("move(x1,y1,x2,y2)"));
proto.Add(_T("move(x1,y1,x2,y2,startTime,endTime)")); proto.Add(_T("move(x1,y1,x2,y2,startTime,endTime)"));
proto.Add(_T("fn;FontName")); proto.Add(_T("fn;FontName"));
@ -515,6 +516,7 @@ void SubsTextEditCtrl::UpdateCallTip() {
wxString useProto; wxString useProto;
wxString cleanProto; wxString cleanProto;
wxString protoName; wxString protoName;
int protoN;
bool semiProto = false; bool semiProto = false;
for (unsigned int i=0;i<proto.Count();i++) { for (unsigned int i=0;i<proto.Count();i++) {
// Get prototype name // Get prototype name
@ -542,6 +544,7 @@ void SubsTextEditCtrl::UpdateCallTip() {
if (proto[i].Freq(_T(',')) >= tagCommas) { if (proto[i].Freq(_T(',')) >= tagCommas) {
// Found // Found
useProto = proto[i]; useProto = proto[i];
protoN = i;
break; break;
} }
} }
@ -580,7 +583,8 @@ void SubsTextEditCtrl::UpdateCallTip() {
} }
// Show calltip // Show calltip
CallTipShow(pos,cleanProto); if (!CallTipActive() || tipProtoN != protoN) CallTipShow(GetUnicodePosition(tagStart),cleanProto);
tipProtoN = protoN;
CallTipSetHighlight(highStart,highEnd); CallTipSetHighlight(highStart,highEnd);
} }

View file

@ -64,6 +64,7 @@ private:
int currentWordPos; int currentWordPos;
wxArrayString proto; wxArrayString proto;
int tipProtoN;
void OnMouseEvent(wxMouseEvent &event); void OnMouseEvent(wxMouseEvent &event);