From 7d93f9820fdf159cd28b9dd988793e0097649d83 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 10 Apr 2001 07:28:46 +0000 Subject: Calltip size fixing and listbox border tweaking. --- src/ScintillaBase.cxx | 75 +++++++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 35 deletions(-) (limited to 'src/ScintillaBase.cxx') diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index ee4f5615f..fd2bef184 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -36,22 +36,22 @@ ScintillaBase::ScintillaBase() { listType = 0; -#ifdef SCI_LEXER +#ifdef SCI_LEXER lexLanguage = SCLEX_CONTAINER; - for (int wl=0;wlInsertString(currentPos, list + lenEntered); SetEmptySelection(currentPos + strlen(list + lenEntered)); } - return; + return ; } } ac.Start(wMain, idAutoComplete, currentPos, lenEntered); PRectangle rcClient = GetClientRectangle(); - Point pt = LocationFromPosition(currentPos-lenEntered); + Point pt = LocationFromPosition(currentPos - lenEntered); int heightLB = 100; int widthLB = 100; @@ -202,8 +204,8 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) { } PRectangle rcac; rcac.left = pt.x - 5; - if (pt.y >= rcClient.bottom - heightLB && // Wont fit below. - pt.y >= (rcClient.bottom + rcClient.top) / 2) { // and there is more room above. + if (pt.y >= rcClient.bottom - heightLB && // Wont fit below. + pt.y >= (rcClient.bottom + rcClient.top) / 2) { // and there is more room above. rcac.top = pt.y - heightLB; if (rcac.top < 0) { heightLB += rcac.top; @@ -227,8 +229,8 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) { // Make an allowance for large strings in list rcList.left = pt.x - 5; rcList.right = rcList.left + widthLB; - if (pt.y >= rcClient.bottom - heightLB && // Wont fit below. - pt.y >= (rcClient.bottom + rcClient.top) / 2) { // and there is more room above. + if (pt.y >= rcClient.bottom - heightLB && // Wont fit below. + pt.y >= (rcClient.bottom + rcClient.top) / 2) { // and there is more room above. rcList.top = pt.y - heightAlloced; } else { rcList.top = pt.y + vs.lineHeight; @@ -238,7 +240,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) { ac.Show(); if (lenEntered != 0) { AutoCompleteMoveToCurrentWord(); - } + } } void ScintillaBase::AutoCompleteCancel() { @@ -280,7 +282,7 @@ void ScintillaBase::AutoCompleteCompleted(char fillUp/*='\0'*/) { ac.lb.GetValue(item, selected, sizeof(selected)); } ac.Cancel(); - + if (listType > 0) { userListSelected = selected; SCNotification scn; @@ -290,12 +292,12 @@ void ScintillaBase::AutoCompleteCompleted(char fillUp/*='\0'*/) { scn.lParam = 0; scn.text = userListSelected.c_str(); NotifyParent(scn); - return; + return ; } - + Position firstPos = ac.posStart - ac.startLen; if (currentPos < firstPos) - return; + return ; if (currentPos != firstPos) { pdoc->DeleteChars(firstPos, currentPos - firstPos); } @@ -349,7 +351,7 @@ void ScintillaBase::Colourise(int start, int end) { if (start > 0) styleStart = styler.StyleAt(start - 1); styler.SetCodePage(pdoc->dbcsCodePage); - + LexerModule::Colourise(start, len, styleStart, lexLanguage, keyWordLists, styler); styler.Flush(); } @@ -362,7 +364,7 @@ void ScintillaBase::NotifyStyleToNeeded(int endStyleNeeded) { int lineEndStyled = WndProc(SCI_LINEFROMPOSITION, endStyled, 0); endStyled = WndProc(SCI_POSITIONFROMLINE, lineEndStyled, 0); Colourise(endStyled, endStyleNeeded); - return; + return ; } #endif Editor::NotifyStyleToNeeded(endStyleNeeded); @@ -399,15 +401,15 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara case SCI_AUTOCSTOPS: ac.SetStopChars(reinterpret_cast(lParam)); break; - + case SCI_AUTOCSELECT: ac.Select(reinterpret_cast(lParam)); break; - + case SCI_AUTOCSETCANCELATSTART: ac.cancelAtStartPos = wParam; break; - + case SCI_AUTOCGETCANCELATSTART: return ac.cancelAtStartPos; @@ -421,14 +423,14 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara case SCI_AUTOCGETCHOOSESINGLE: return ac.chooseSingle; - + case SCI_AUTOCSETIGNORECASE: ac.ignoreCase = wParam; break; - + case SCI_AUTOCGETIGNORECASE: return ac.ignoreCase; - + case SCI_USERLISTSHOW: listType = wParam; AutoCompleteStart(0, reinterpret_cast(lParam)); @@ -437,9 +439,12 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara case SCI_CALLTIPSHOW: { AutoCompleteCancel(); if (!ct.wCallTip.Created()) { - PRectangle rc = ct.CallTipStart(currentPos, LocationFromPosition(wParam), + Point pt = LocationFromPosition(wParam); + pt.y += vs.lineHeight; + PRectangle rc = ct.CallTipStart(currentPos, pt, reinterpret_cast(lParam), - vs.styles[STYLE_DEFAULT].fontName, vs.styles[STYLE_DEFAULT].size); + vs.styles[STYLE_DEFAULT].fontName, + vs.styles[STYLE_DEFAULT].sizeZoomed); // If the call-tip window would be out of the client // space, adjust so it displays above the text. PRectangle rcClient = GetClientRectangle(); @@ -474,25 +479,25 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara ct.colourBG = Colour(wParam); InvalidateStyleRedraw(); break; - + #ifdef SCI_LEXER case SCI_SETLEXER: lexLanguage = wParam; break; - + case SCI_GETLEXER: return lexLanguage; - + case SCI_COLOURISE: Colourise(wParam, lParam); Redraw(); break; - + case SCI_SETPROPERTY: - props.Set(reinterpret_cast(wParam), - reinterpret_cast(lParam)); + props.Set(reinterpret_cast(wParam), + reinterpret_cast(lParam)); break; - + case SCI_SETKEYWORDS: if (wParam < numWordLists) { keyWordLists[wParam]->Clear(); -- cgit v1.2.3