-
-bool wxPGVariantToLongLong( const wxVariant& variant, wxLongLong_t* pResult )
-{
- if ( variant.IsNull() )
- return false;
-
- if ( wxPGIsVariantType(variant, long) )
- {
- *pResult = variant.GetLong();
- return true;
- }
-
- if ( typeid(*variant.GetData()) == typeid(wxPGVariantDataLongLong) )
- {
- *pResult = ((const wxPGVariantDataLongLong&)variant).GetValue().GetValue();
- return true;
- }
-
- return false;
-}
-
-// -----------------------------------------------------------------------
-
-bool wxPGVariantToULongLong( const wxVariant& variant, wxULongLong_t* pResult )
-{
- if ( variant.IsNull() )
- return false;
-
- if ( wxPGIsVariantType(variant, long) )
- {
- *pResult = (unsigned long)variant.GetLong();
- return true;
- }
-
- if ( typeid(*variant.GetData()) == typeid(wxPGVariantDataULongLong) )
- {
- *pResult = ((const wxPGVariantDataULongLong&)variant).GetValue().GetValue();
- return true;
- }
-
- return false;
-}
-
-// -----------------------------------------------------------------------
-
-bool wxPGVariantToDouble( const wxVariant& variant, double* pResult )
-{
- if ( variant.IsNull() )
- return false;
-
- if ( wxPGIsVariantType(variant, double) )
- {
- *pResult = variant.GetDouble();
- return true;
- }
-
- if ( wxPGIsVariantType(variant, long) )
- {
- *pResult = (double)variant.GetLong();
- return true;
- }
-
- if ( typeid(*variant.GetData()) == typeid(wxPGVariantDataLongLong) )
- {
- wxLongLong ll = ((const wxPGVariantDataLongLong&)variant).GetValue();
- *pResult = ll.ToDouble();
- return true;
- }
-
- if ( wxPGIsVariantType(variant, string) )
- if ( variant.GetString().ToDouble(pResult) )
- return true;
-
- return false;
-}
-
-// -----------------------------------------------------------------------
-// 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);
-}
-