#18 Autocompletion for wxStringProperty

open-later
None
5
2009-03-08
2009-02-16
No

Greetings,
this refers to wxPropertyGrid 1.4.4 on wxMSW 2.8.9.

I've successfully added autocompletion to wxPGTextCtrlEditor by means of a new attribute "AutoComplete" of type wxArrayString.

Sorry for not providing a unified diff, but this is quite simple. Add the following near the end of wxPGTextCtrlEditor::CreateControls in editors.cpp:

wxVariant a = property->GetAttribute(wxT("AutoComplete"));
if (!a.IsNull())
{
wxASSERT(a.GetType() == wxT("arrstring"));
static_cast<wxTextCtrl*>(wnd)->AutoComplete(a.GetArrayString());
}

It misses guards against wxUSE_OLE && (WINVER >= 0x0500) not being defined, though.
This assumes a patched wxTextCtrl supporting the AutoComplete method, as I've done on my wxMSW 2.8.9, backporting it from 2.9. I've sent the backport to wx-dev@lists.wxwidgets.org, please let me know if you need it too.

Hope this helps,
Salvo

Discussion

  • Jaakko Salli

    Jaakko Salli - 2009-03-08

    Added in wxWidgets SVN trunk now. I will see about adding this in wxPG 1.4 later on.

     
  • Jaakko Salli

    Jaakko Salli - 2009-03-08
    • assigned_to: nobody --> jmsalli
    • status: open --> open-later
     

Log in to post a comment.