News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Auto completion list is invisible in some situations

Started by oBFusCATed, May 21, 2014, 03:44:55 PM

Previous topic - Next topic

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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Teybeo


Alpha

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

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 {


@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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

oBFusCATed

Fixed in rev 11360...
The call tip has also been affected by this problem.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]