Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

Auto completion list is invisible in some situations

(1/1)

oBFusCATed:
Very annoying issue if I'm typing at the bottom of the editor window and the Logs'n'others is hidden.

Steps to reproduce:
1. Maximize C::B
2. Hide Logs'n'others
3. Open a text file that can fill the full screen
4. Go to the last line
5. Show the autocompletion list

The result is that the autocompletion list is displayed below my cursor and it is almost fully invisible.

Teybeo:
+1 very annoying

Alpha:
This is caused by a screen vs. client coordinate issue.  The following patches this (but might break other assumptions? ... needs more testing).

--- Code: ---diff --git a/src/sdk/wxscintilla/src/PlatWX.cpp b/src/sdk/wxscintilla/src/PlatWX.cpp
index ac8d839..a9f4a8a 100644
--- a/src/sdk/wxscintilla/src/PlatWX.cpp
+++ b/src/sdk/wxscintilla/src/PlatWX.cpp
@@ -761,7 +761,7 @@ bool Window::HasFocus()
 PRectangle Window::GetPosition()
 {
     if (! wid) return PRectangle();
-    wxRect rc(GETWIN(wid)->GetPosition(), GETWIN(wid)->GetSize());
+    wxRect rc(GETWIN(wid)->GetScreenPosition(), GETWIN(wid)->GetSize());
     return PRectangleFromwxRect(rc);
 }
 
diff --git a/src/sdk/wxscintilla/src/scintilla/src/ScintillaBase.cxx b/src/sdk/wxscintilla/src/scintilla/src/ScintillaBase.cxx
index cf87a50..9890fbd 100644
--- a/src/sdk/wxscintilla/src/scintilla/src/ScintillaBase.cxx
+++ b/src/sdk/wxscintilla/src/scintilla/src/ScintillaBase.cxx
@@ -300,7 +300,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
        // Make an allowance for large strings in list
        rcList.left = pt.x - ac.lb->CaretFromEdge();
        rcList.right = rcList.left + widthLB;
-       if (((pt.y + vs.lineHeight) >= (rcPopupBounds.bottom - heightAlloced)) &&  // Wont fit below.
+       if (((pt.y + wMain.GetPosition().top + vs.lineHeight) >= (rcPopupBounds.bottom - heightAlloced)) &&  // Wont fit below.
                ((pt.y + vs.lineHeight / 2) >= (rcPopupBounds.bottom + rcPopupBounds.top) / 2)) { // and there is more room above.
                rcList.top = pt.y - heightAlloced;
        } else {

--- End code ---

@devs: From what I can tell, Window::GetPosition() currently has an incorrect implementation, and will (always?) return top left corner as (0, 0).  Thoughts?

oBFusCATed:
Probably you should ask in the wx-dev mailing list, there you'll get better advice, also you can contribute this patch to the wx project.

oBFusCATed:
Fixed in rev 11360...
The call tip has also been affected by this problem.

Navigation

[0] Message Index

Go to full version