Moved wxPGChoices m_choices member from various property classes to base wxPGProperty. This allows any property to have choices without subclassing and therefore work with Choice and ComboBox editors. Also removed redundant choice manipulation functions from wxPropertyGridinterface (ie. now use ones in wxPGProperty).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55740 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2008-09-19 16:57:33 +00:00
parent 57306cd4fd
commit 939d936402
15 changed files with 643 additions and 934 deletions

View File

@@ -221,38 +221,7 @@ wxPGProperty* wxPGPropArgCls::GetPtr( wxPropertyGridInterface* iface ) const
}
// -----------------------------------------------------------------------
// Choice related methods
// -----------------------------------------------------------------------
void wxPropertyGridInterface::AddPropertyChoice( wxPGPropArg id,
const wxString& label,
int value )
{
wxPG_PROP_ARG_CALL_PROLOG()
p->InsertChoice(label,-1,value);
}
void wxPropertyGridInterface::InsertPropertyChoice( wxPGPropArg id,
const wxString& label,
int index,
int value )
{
wxPG_PROP_ARG_CALL_PROLOG()
p->InsertChoice(label,index,value);
}
void wxPropertyGridInterface::DeletePropertyChoice( wxPGPropArg id,
int index )
{
wxPG_PROP_ARG_CALL_PROLOG()
p->DeleteChoice(index);
}
// wxPropertyGridInterface
// -----------------------------------------------------------------------
void wxPropertyGridInterface::RefreshGrid( wxPropertyGridPageState* state )
@@ -646,25 +615,6 @@ void wxPropertyGridInterface::SetBoolChoices( const wxString& trueChoice,
// -----------------------------------------------------------------------
wxPGChoices gs_emptyChoices;
wxPGChoices& wxPropertyGridInterface::GetPropertyChoices( wxPGPropArg id )
{
wxPG_PROP_ARG_CALL_PROLOG_RETVAL(gs_emptyChoices)
wxPGChoiceInfo ci;
ci.m_choices = (wxPGChoices*) NULL;
p->GetChoiceInfo(&ci);
if ( !ci.m_choices )
return gs_emptyChoices;
return *ci.m_choices;
}
// -----------------------------------------------------------------------
wxPGProperty* wxPropertyGridInterface::DoGetPropertyByName( const wxString& name ) const
{
return m_pState->BaseGetPropertyByName(name);