wxPropertyGridInterface docs cleanup and fixes, removed some rarely needed member functions with simple workarounds
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -462,13 +462,6 @@ public:
|
||||
return p->GetValueImage();
|
||||
}
|
||||
|
||||
/** Returns property's position under its parent. */
|
||||
unsigned int GetPropertyIndex( wxPGPropArg id )
|
||||
{
|
||||
wxPG_PROP_ARG_CALL_PROLOG_RETVAL(INT_MAX)
|
||||
return p->GetIndexInParent();
|
||||
}
|
||||
|
||||
/** Returns label of a property. */
|
||||
const wxString& GetPropertyLabel( wxPGPropArg id )
|
||||
{
|
||||
@@ -477,10 +470,9 @@ public:
|
||||
}
|
||||
|
||||
/** Returns name of a property, by which it is globally accessible. */
|
||||
wxString GetPropertyName( wxPGPropArg id )
|
||||
wxString GetPropertyName( wxPGProperty* property )
|
||||
{
|
||||
wxPG_PROP_ARG_CALL_PROLOG_RETVAL(m_emptyString)
|
||||
return p->GetName();
|
||||
return property->GetName();
|
||||
}
|
||||
|
||||
/** Returns parent item of a property. */
|
||||
@@ -524,7 +516,6 @@ public:
|
||||
#endif
|
||||
bool GetPropertyValueAsBool( wxPGPropArg id ) const;
|
||||
double GetPropertyValueAsDouble( wxPGPropArg id ) const;
|
||||
void* GetPropertyValueAsVoidPtr( wxPGPropArg id ) const;
|
||||
|
||||
#define wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(TYPENAME, DEFVAL) \
|
||||
wxPG_PROP_ARG_CALL_PROLOG_RETVAL(DEFVAL) \
|
||||
@@ -549,22 +540,6 @@ public:
|
||||
return value.GetArrayString();
|
||||
}
|
||||
|
||||
wxPoint GetPropertyValueAsPoint( wxPGPropArg id ) const
|
||||
{
|
||||
wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL("wxPoint", wxPoint())
|
||||
wxPoint pt;
|
||||
pt << value;
|
||||
return pt;
|
||||
}
|
||||
|
||||
wxSize GetPropertyValueAsSize( wxPGPropArg id ) const
|
||||
{
|
||||
wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL("wxSize", wxSize())
|
||||
wxSize sz;
|
||||
sz << value;
|
||||
return sz;
|
||||
}
|
||||
|
||||
wxLongLong_t GetPropertyValueAsLongLong( wxPGPropArg id ) const
|
||||
{
|
||||
wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL_WFALLBACK("wxLongLong",
|
||||
@@ -619,12 +594,6 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
wxString GetPropertyValueType( wxPGPropArg id )
|
||||
{
|
||||
wxPG_PROP_ARG_CALL_PROLOG_RETVAL(m_emptyString)
|
||||
return p->GetValueType();
|
||||
}
|
||||
|
||||
/** Returns currently selected property. */
|
||||
wxPGProperty* GetSelection() const
|
||||
{
|
||||
@@ -1147,20 +1116,6 @@ public:
|
||||
SetPropVal( id, v );
|
||||
}
|
||||
|
||||
/** Sets value (wxPoint&) of a property.
|
||||
*/
|
||||
void SetPropertyValue( wxPGPropArg id, const wxPoint& value )
|
||||
{
|
||||
wxVariant v = WXVARIANT(value);
|
||||
SetPropVal( id, v );
|
||||
}
|
||||
/** Sets value (wxSize&) of a property.
|
||||
*/
|
||||
void SetPropertyValue( wxPGPropArg id, const wxSize& value )
|
||||
{
|
||||
wxVariant v = WXVARIANT(value);
|
||||
SetPropVal( id, v );
|
||||
}
|
||||
/** Sets value (wxLongLong&) of a property.
|
||||
*/
|
||||
void SetPropertyValue( wxPGPropArg id, wxLongLong_t value )
|
||||
|
@@ -158,7 +158,7 @@ wxPG_EX_HIDE_PAGE_BUTTONS = 0x01000000
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/** wxPropertyGrid Validation Failure Behavior Flags
|
||||
/** @section propgrid_vfbflags wxPropertyGrid Validation Failure Behavior Flags
|
||||
@{
|
||||
*/
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -820,7 +820,7 @@ void FormMain::OnMove( wxMoveEvent& event )
|
||||
|
||||
id = m_pPropGridManager->GetPropertyByName( wxT("Position") );
|
||||
if ( id )
|
||||
m_pPropGridManager->SetPropertyValue( id, wxPoint(x,y) );
|
||||
m_pPropGridManager->SetPropertyValue( id, WXVARIANT(wxPoint(x,y)) );
|
||||
|
||||
// Should always call event.Skip() in frame's MoveEvent handler
|
||||
event.Skip();
|
||||
@@ -858,7 +858,7 @@ void FormMain::OnResize( wxSizeEvent& event )
|
||||
|
||||
id = m_pPropGridManager->GetPropertyByName ( wxT("Size") );
|
||||
if ( id )
|
||||
m_pPropGridManager->SetPropertyValue( id, wxSize(w,h) );
|
||||
m_pPropGridManager->SetPropertyValue( id, WXVARIANT(wxSize(w,h)) );
|
||||
|
||||
// Should always call event.Skip() in frame's SizeEvent handler
|
||||
event.Skip();
|
||||
@@ -1567,7 +1567,6 @@ void FormMain::PopulateWithExamples ()
|
||||
pg->Append( new wxSizeProperty( wxT("SizeProperty"), wxT("Size"), GetSize() ) );
|
||||
pg->Append( new wxPointProperty( wxT("PointProperty"), wxT("Position"), GetPosition() ) );
|
||||
|
||||
|
||||
// UInt samples
|
||||
pg->Append( new wxUIntProperty( wxT("UIntProperty"), wxPG_LABEL, wxULongLong(wxULL(0xFEEEFEEEFEEE))));
|
||||
pg->SetPropertyAttribute( wxT("UIntProperty"), wxPG_UINT_PREFIX, wxPG_PREFIX_NONE );
|
||||
@@ -2267,7 +2266,7 @@ void FormMain::OnInsertPropClick( wxCommandEvent& WXUNUSED(event) )
|
||||
GenerateUniquePropertyLabel( m_pPropGridManager, propLabel );
|
||||
|
||||
m_pPropGridManager->Insert( m_pPropGridManager->GetPropertyParent(id),
|
||||
m_pPropGridManager->GetPropertyIndex(id),
|
||||
id->GetIndexInParent(),
|
||||
new wxStringProperty(propLabel) );
|
||||
|
||||
}
|
||||
@@ -2334,9 +2333,8 @@ void FormMain::OnInsertCatClick( wxCommandEvent& WXUNUSED(event) )
|
||||
GenerateUniquePropertyLabel( m_pPropGridManager, propLabel );
|
||||
|
||||
m_pPropGridManager->Insert( m_pPropGridManager->GetPropertyParent(id),
|
||||
m_pPropGridManager->GetPropertyIndex(id),
|
||||
id->GetIndexInParent(),
|
||||
new wxPropertyCategory (propLabel) );
|
||||
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
@@ -759,8 +759,8 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
||||
wxColour emptyCol;
|
||||
pgman->SetPropertyValue(wxT("ColourProperty"),emptyCol);
|
||||
pgman->SetPropertyValue(wxT("ColourProperty"),(wxObject*)wxBLACK);
|
||||
pgman->SetPropertyValue(wxT("Size"),wxSize(150,150));
|
||||
pgman->SetPropertyValue(wxT("Position"),wxPoint(150,150));
|
||||
pgman->SetPropertyValue(wxT("Size"),WXVARIANT(wxSize(150,150)));
|
||||
pgman->SetPropertyValue(wxT("Position"),WXVARIANT(wxPoint(150,150)));
|
||||
pgman->SetPropertyValue(wxT("MultiChoiceProperty"),test_arrint_1);
|
||||
#if wxUSE_DATETIME
|
||||
pgman->SetPropertyValue(wxT("DateProperty"),dt1);
|
||||
@@ -785,9 +785,9 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
||||
col << pgman->GetPropertyValue(wxT("ColourProperty"));
|
||||
if ( col != *wxBLACK )
|
||||
RT_FAILURE();
|
||||
if ( pg->GetPropertyValueAsSize(wxT("Size")) != wxSize(150,150) )
|
||||
if ( wxSizeRefFromVariant(pg->GetPropertyValue(wxT("Size"))) != wxSize(150,150) )
|
||||
RT_FAILURE();
|
||||
if ( pg->GetPropertyValueAsPoint(wxT("Position")) != wxPoint(150,150) )
|
||||
if ( wxPointRefFromVariant(pg->GetPropertyValue(wxT("Position"))) != wxPoint(150,150) )
|
||||
RT_FAILURE();
|
||||
if ( !(pg->GetPropertyValueAsArrayInt(wxT("MultiChoiceProperty")) == test_arrint_1) )
|
||||
RT_FAILURE();
|
||||
@@ -807,8 +807,8 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
||||
pg->SetPropertyValue(wxT("EnumProperty"),80);
|
||||
pg->SetPropertyValue(wxT("ArrayStringProperty"),test_arrstr_2);
|
||||
pg->SetPropertyValue(wxT("ColourProperty"),(wxObject*)wxWHITE);
|
||||
pg->SetPropertyValue(wxT("Size"),wxSize(300,300));
|
||||
pg->SetPropertyValue(wxT("Position"),wxPoint(300,300));
|
||||
pg->SetPropertyValue(wxT("Size"),WXVARIANT(wxSize(300,300)));
|
||||
pg->SetPropertyValue(wxT("Position"),WXVARIANT(wxPoint(300,300)));
|
||||
pg->SetPropertyValue(wxT("MultiChoiceProperty"),test_arrint_2);
|
||||
#if wxUSE_DATETIME
|
||||
pg->SetPropertyValue(wxT("DateProperty"),dt2);
|
||||
@@ -833,9 +833,9 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
||||
col << pgman->GetPropertyValue(wxT("ColourProperty"));
|
||||
if ( col != *wxWHITE )
|
||||
RT_FAILURE();
|
||||
if ( pgman->GetPropertyValueAsSize(wxT("Size")) != wxSize(300,300) )
|
||||
if ( wxSizeRefFromVariant(pgman->GetPropertyValue(wxT("Size"))) != wxSize(300,300) )
|
||||
RT_FAILURE();
|
||||
if ( pgman->GetPropertyValueAsPoint(wxT("Position")) != wxPoint(300,300) )
|
||||
if ( wxPointRefFromVariant(pgman->GetPropertyValue(wxT("Position"))) != wxPoint(300,300) )
|
||||
RT_FAILURE();
|
||||
if ( !(pgman->GetPropertyValueAsArrayInt(wxT("MultiChoiceProperty")) == test_arrint_2) )
|
||||
RT_FAILURE();
|
||||
|
@@ -824,7 +824,6 @@ bool wxPropertyGridInterface::GetPropertyValueAsBool( wxPGPropArg id ) const
|
||||
|
||||
IMPLEMENT_GET_VALUE(long,long,Long,0)
|
||||
IMPLEMENT_GET_VALUE(double,double,Double,0.0)
|
||||
IMPLEMENT_GET_VALUE(void,void*,VoidPtr,NULL)
|
||||
|
||||
bool wxPropertyGridInterface::IsPropertyExpanded( wxPGPropArg id ) const
|
||||
{
|
||||
|
Reference in New Issue
Block a user