X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2197ec8012f27d18355d28ed91d2cff200c7b9cf..a188ac2988b6fedeead7a809124b8eaa2290c020:/src/propgrid/editors.cpp diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 07df5fb839..2c1518147d 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -841,6 +841,10 @@ wxWindow* wxPGChoiceEditor::CreateControlsBase( wxPropertyGrid* propGrid, int odcbFlags = extraStyle | wxBORDER_NONE | wxTE_PROCESS_ENTER; + if ( (property->GetFlags() & wxPG_PROP_USE_DCC) && + (property->IsKindOf(CLASSINFO(wxBoolProperty)) ) ) + odcbFlags |= wxODCB_DCLICK_CYCLES; + // // If common value specified, use appropriate index unsigned int cmnVals = property->GetDisplayedCommonValueCount(); @@ -1633,12 +1637,12 @@ wxWindow* wxPropertyGrid::GenerateEditorTextCtrl( const wxPoint& pos, int maxLen ) { wxWindowID id = wxPG_SUBID1; - wxPGProperty* selected = m_selected; - wxASSERT(selected); + wxPGProperty* prop = m_selected; + wxASSERT(prop); int tcFlags = wxTE_PROCESS_ENTER | extraStyle; - if ( selected->HasFlag(wxPG_PROP_READONLY) ) + if ( prop->HasFlag(wxPG_PROP_READONLY) ) tcFlags |= wxTE_READONLY; wxPoint p(pos.x,pos.y); @@ -1675,14 +1679,12 @@ wxWindow* wxPropertyGrid::GenerateEditorTextCtrl( const wxPoint& pos, SetupTextCtrlValue(value); tc->Create(ctrlParent,id,value, p, s,tcFlags); - wxWindow* ed = tc; - // Center the control vertically if ( !hasSpecialSize ) - FixPosForTextCtrl(ed); + FixPosForTextCtrl(tc); #ifdef __WXMSW__ - ed->Show(); + tc->Show(); if ( secondary ) secondary->Show(); #endif @@ -1691,7 +1693,14 @@ wxWindow* wxPropertyGrid::GenerateEditorTextCtrl( const wxPoint& pos, if ( maxLen > 0 ) tc->SetMaxLength( maxLen ); - return (wxWindow*) ed; + wxVariant attrVal = prop->GetAttribute(wxPG_ATTR_AUTOCOMPLETE); + if ( !attrVal.IsNull() ) + { + wxASSERT(attrVal.GetType() == wxS("arrstring")); + tc->AutoComplete(attrVal.GetArrayString()); + } + + return tc; } // ----------------------------------------------------------------------- @@ -1872,11 +1881,10 @@ void wxPGMultiButton::Add( const wxBitmap& bitmap, int id ) { id = GenId(id); wxSize sz = GetSize(); - wxButton* button = new wxBitmapButton( this, id, bitmap, wxPoint(sz.x, 0), wxSize(sz.y, sz.y) ); - m_buttons.push_back(button); - int bw = button->GetSize().x; - SetSize(wxSize(sz.x+bw,sz.y)); - m_buttonsWidth += bw; + wxButton* button = new wxBitmapButton( this, id, bitmap, + wxPoint(sz.x, 0), + wxSize(sz.y, sz.y) ); + DoAddButton( button, sz ); } #endif @@ -1884,7 +1892,14 @@ void wxPGMultiButton::Add( const wxString& label, int id ) { id = GenId(id); wxSize sz = GetSize(); - wxButton* button = new wxButton( this, id, label, wxPoint(sz.x, 0), wxSize(sz.y, sz.y) ); + wxButton* button = new wxButton( this, id, label, wxPoint(sz.x, 0), + wxSize(sz.y, sz.y) ); + DoAddButton( button, sz ); +} + +void wxPGMultiButton::DoAddButton( wxWindow* button, + const wxSize& sz ) +{ m_buttons.push_back(button); int bw = button->GetSize().x; SetSize(wxSize(sz.x+bw,sz.y));