Phoenix Logo

phoenix_title wx.propgrid.DirProperty

Like wx.propgrid.LongStringProperty, but the button triggers dir selector instead.

Supported special attributes:

  • “DialogMessage”: Sets specific message in the dir selector.

class_hierarchy Class Hierarchy

Inheritance diagram for class DirProperty:

method_summary Methods Summary

__init__  
DoGetValidator Returns pointer to the wx.Validator that should be used with the editor of this property (None for no validator).
DoSetAttribute Reimplement this member function to add special handling for attributes of this property.
OnButtonClick  

api Class API



class wx.propgrid.DirProperty(LongStringProperty)

Possible constructors:

DirProperty(name=PG_LABEL, label=PG_LABEL, value="")

Like LongStringProperty, but the button triggers dir selector instead.


Methods



__init__(self, name=PG_LABEL, label=PG_LABEL, value="")
Parameters:
  • name (string) –
  • label (string) –
  • value (string) –


DoGetValidator(self)

Returns pointer to the wx.Validator that should be used with the editor of this property (None for no validator).

Setting validator explicitly via SetPropertyValidator will override this.

In most situations, code like this should work well (macros are used to maintain one actual validator instance, so on the second call the function exits within the first macro):

class MyPropertyClass(wx.propgrid.DirProperty):
    ...
    def DoGetValidator(self):
        validator = MyValidator(...)

        ... prepare validator...

        return validator
Return type:Validator

Note

You can get common filename validator by returning wx.propgrid.FileProperty.GetClassValidator . wx.propgrid.DirProperty, for example, uses it.



DoSetAttribute(self, name, value)

Reimplement this member function to add special handling for attributes of this property.

Parameters:
  • name (string) –
  • value (PGVariant) –
Return type:

bool

Returns:

Return False to have the attribute automatically stored in m_attributes. Default implementation simply does that and nothing else.

Note

To actually set property attribute values from the application, use wx.propgrid.PGProperty.SetAttribute instead.



OnButtonClick(self, propGrid, value)
Parameters:
Return type:

tuple

Returns:

( bool, value )