Position of Assist parameter info improved

git-svn-id: svn://ultimatepp.org/upp/trunk@1068 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-04-17 15:50:58 +00:00
parent aefe136968
commit 6c33a9dccf
3 changed files with 9 additions and 3 deletions

View file

@ -518,7 +518,7 @@ void AssistEditor::AssistInsert()
int n = Paste(ToUnicode(txt, CHARSET_WIN1250));
if(!thisback && f.kind >= FUNCTION && f.kind <= INLINEFRIEND) {
SetCursor(GetCursor() - 1);
StartParamInfo(f);
StartParamInfo(f, cl);
int x = f.natural.ReverseFind('(');
if(x >= 0 && f.natural[x + 1] == ')')
SetCursor(GetCursor() + 1);

View file

@ -4,6 +4,7 @@ void AssistEditor::SyncParamInfo()
{
String qtf;
int mpar = INT_MAX;
int pos = 0;
for(int q = 0; q < PARAMN; q++) {
ParamInfo& m = param[q];
int i = GetCursorLine();
@ -20,6 +21,7 @@ void AssistEditor::SyncParamInfo()
if(par < mpar) {
qtf = "[A1 " + DecoratedItem(m.item.name, m.item, m.item.natural, pari);
mpar = par;
pos = m.pos;
}
break;
}
@ -46,6 +48,8 @@ void AssistEditor::SyncParamInfo()
if(y < GetWorkArea().top)
y = r.bottom;
r = RectC(r.left, y, min(param_info.GetWidth(), cx) + 8, h + 6);
r.OffsetHorz(GetColumnLine(pos).x * GetFontSize().cx);
r.OffsetHorz(min(GetWorkArea().right - r.right, 0));
if(param_qtf != qtf || r != param_info.GetRect()) {
param_qtf = qtf;
if(IsNull(qtf)) {
@ -60,7 +64,7 @@ void AssistEditor::SyncParamInfo()
}
}
void AssistEditor::StartParamInfo(const CppItem& m)
void AssistEditor::StartParamInfo(const CppItem& m, int pos)
{
int x = GetCursor();
ParamInfo& f = param[parami];
@ -68,6 +72,7 @@ void AssistEditor::StartParamInfo(const CppItem& m)
f.test = GetWLine(f.line).Mid(0, x);
f.item = m;
f.editfile = theide->editfile;
f.pos = pos;
SyncParamInfo();
parami = (parami + 1) % PARAMN;
}

View file

@ -317,6 +317,7 @@ struct AssistEditor : CodeEditor {
String param_qtf;
struct ParamInfo {
int line;
int pos;
WString test;
CppItem item;
String editfile;
@ -336,7 +337,7 @@ struct AssistEditor : CodeEditor {
bool InCode();
void SyncParamInfo();
void StartParamInfo(const CppItem& m);
void StartParamInfo(const CppItem& m, int pos);
void Complete();
void Abbr();