You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating property grid item with name pgiActive10 and label Active generated source looks like: pgiActive10 = pgpType1->Append( new wxIntProperty( wxT("Active"), wxT("Active") ) );
This makes impossible to create property grid items with same label under different categories.
I see the issue, wxFB takes a shortcut and uses the label for both properties, which causes the error in your use case.
I don't think it is a good idea to use the widget name for the name property though, the widget name is more like an implementation detail and should not be used as part of an application data model. Also, the widget name must be a valid identifier in the generated code, so this limits what characters you may use for it.
A better approach would be to add a new property for this value so that the user can specify the value directly. This is a bit tricky because the most fitting name is already used, also it would be nice to keep the default of using the label if this value is not specified.
Agree. Creating dedicated name property would be the best solution.
Even better is to add kind of unique integer identifier to find required wxPGProperty e.g when processing OnPropertyGridChanged or add separate OnChange event for wxPGProperty, but so far it's not supported by wxWidgets so nothing wxFB can really do about it
When creating property grid item with name pgiActive10 and label Active generated source looks like:
pgiActive10 = pgpType1->Append( new wxIntProperty( wxT("Active"), wxT("Active") ) );
This makes impossible to create property grid items with same label under different categories.
It's better be:
pgiActive10 = pgpType1->Append( new wxIntProperty( wxT("Active"), wxT("pgiActive10") ) );
Looks like it's enough to change propGridItem template in plugins\additional\xml\data.cppcode to:
<templates class="propGridItem"> <template name="declaration">wxPGProperty* $name;</template> <template name="construction"> #ifequal $type "Category" @{ $name = #parent $name->Append( new wxPropertyCategory( $label, wxT("$name") ) ); @} #ifnotequal $type "Category" @{ $name = #parent $name->Append( new wx${type}Property( $label, wxT("$name") ) ); #ifnotnull $help @{ #nl #parent $name->SetPropertyHelpString( $name, $help ); @} @} </template> </templates>
The text was updated successfully, but these errors were encountered: