I've started a thread on the problems with autocompletion on the wxdev list
here if anyone wants to join in.
But I guess none of those changes proposed there will help with with getting codeblocks to work with wxWidgets 3.1.2. In order to do that, somehow the old popup behavior has to be restored in codeblocks itself - at least until 3.1.3. Looking over the codeblocks sources, I think the easiest way to do that is to define a popup class in src/sdk/wxscintilla/src/PlatWX.cpp between
#if wxUSE_POPUPWIN //-----------------------------------
#include "wx/popupwin.h"
and
// A popup window to place the wxSCIListBox upon
class wxSCIListBoxWin : public wxPopupWindow
Here's the a cut and paste of the old popupwindow code with a few minor modifications:
#ifdef __WXMSW__
#include "wx/msw/private.h" // for GetDesktopWindow()
class wxNonActivatingPopupWindow : public wxPopupWindowBase
{
public:
wxNonActivatingPopupWindow() { }
wxNonActivatingPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE)
{ (void)Create(parent, flags); }
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
virtual void SetFocus() wxOVERRIDE;
virtual bool Show(bool show = true) wxOVERRIDE;
// return the style to be used for the popup windows
virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle) const wxOVERRIDE;
// get the HWND to be used as parent of this window with CreateWindow()
virtual WXHWND MSWGetParent() const wxOVERRIDE;
};
bool wxNonActivatingPopupWindow::Create(wxWindow *parent, int flags)
{
// popup windows are created hidden by default
Hide();
return wxPopupWindowBase::Create(parent) &&
wxWindow::Create(parent, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
flags | wxPOPUP_WINDOW);
}
WXDWORD wxNonActivatingPopupWindow::MSWGetStyle(long flags, WXDWORD *exstyle) const
{
// we only honour the border flags, the others don't make sense for us
WXDWORD style = wxWindow::MSWGetStyle(flags & wxBORDER_MASK, exstyle);
if ( exstyle )
{
// a popup window floats on top of everything
*exstyle |= WS_EX_TOPMOST | WS_EX_TOOLWINDOW;
}
return style;
}
WXHWND wxNonActivatingPopupWindow::MSWGetParent() const
{
// we must be a child of the desktop to be able to extend beyond the parent
// window client area (like the comboboxes drop downs do)
//
// NB: alternative implementation would be to use WS_POPUP instead of
// WS_CHILD but then showing a popup would deactivate the parent which
// is ugly and working around this, although possible, is even more
// ugly
return (WXHWND)::GetDesktopWindow();
}
void wxNonActivatingPopupWindow::SetFocus()
{
// Focusing on a popup window does not work on MSW unless WS_POPUP style is
// set (which is never the case currently, see the note in MSWGetParent()).
// We do not even want to try to set the focus, as it returns an error from
// SetFocus() on recent Windows versions (since Vista) and the resulting
// debug message is annoying.
}
bool wxNonActivatingPopupWindow::Show(bool show)
{
if ( !wxWindowMSW::Show(show) )
return false;
if ( show )
{
// raise to top of z order
if (!::SetWindowPos((HWND)GetHWND(), HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE))
{
wxLogLastError(wxT("SetWindowPos"));
}
// and set it as the foreground window so the mouse can be captured
::SetForegroundWindow((HWND)GetHWND());
}
return true;
}
// temporarily define wxPopupWindow to be the new class
#define wxPopupWindow wxNonActivatingPopupWindow
#endif //__WXMSW__
The class can obviously be renames as needed. I've tested this with wxSTC, but I don't know how to compile codeblocks to see if it works there too.