wxFileProperty Class Reference

Like wxLongStringProperty, but the button triggers file selector instead. More...

#include <props.h>

Inheritance diagram for wxFileProperty:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual wxValidator * DoGetValidator () const
virtual wxPGEditorDialogAdapterGetEditorDialog () const
virtual wxString GetValueAsString (int argFlags) const
virtual void OnSetValue ()
virtual bool StringToValue (wxVariant &variant, const wxString &text, int argFlags=0) const
 wxFileProperty (const wxString &label=wxPG_LABEL, const wxString &name=wxPG_LABEL, const wxString &value=wxEmptyString)
virtual ~wxFileProperty ()

Static Public Member Functions

static wxValidator * GetClassValidator ()

Protected Attributes

wxString m_basePath
wxString m_dlgTitle
wxFileName m_filename
int m_indFilter
wxString m_initialPath
wxString m_wildcard

Friends

class wxPGFileDialogAdapter

Detailed Description

Like wxLongStringProperty, but the button triggers file selector instead.

Supported special attributes:

Definition at line 754 of file props.h.


Constructor & Destructor Documentation

wxFileProperty::wxFileProperty ( const wxString &  label = wxPG_LABEL,
const wxString &  name = wxPG_LABEL,
const wxString &  value = wxEmptyString 
)
virtual wxFileProperty::~wxFileProperty (  )  [virtual]

Member Function Documentation

virtual wxValidator* wxFileProperty::DoGetValidator (  )  const [virtual]

Returns pointer to the wxValidator that should be used with the editor of this property (NULL 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):

        wxValidator* wxMyPropertyClass::DoGetValidator () const
        {
            WX_PG_DOGETVALIDATOR_ENTRY()

            wxMyValidator* validator = new wxMyValidator(...);

            ... prepare validator...

            WX_PG_DOGETVALIDATOR_EXIT(validator)
        }
Remarks:
You can get common filename validator by returning wxFileProperty::GetClassValidator(). wxDirProperty, for example, uses it.

Reimplemented from wxPGProperty.

static wxValidator* wxFileProperty::GetClassValidator (  )  [static]
virtual wxPGEditorDialogAdapter* wxFileProperty::GetEditorDialog (  )  const [virtual]

Returns instance of a new wxPGEditorDialogAdapter instance, which is used when user presses the (optional) button next to the editor control;

Default implementation returns NULL (ie. no action is generated when button is pressed).

Reimplemented from wxPGProperty.

virtual wxString wxFileProperty::GetValueAsString ( int  argFlags  )  const [virtual]

Returns text representation of property's value. Generally this function should not be called from the application code. Instead, call GetValueString().

Parameters:
argFlags If wxPG_FULL_VALUE is set, returns complete, storable string value instead of displayable. If wxPG_EDITABLE_VALUE is set, returns string value that must be editable in textctrl. If wxPG_COMPOSITE_FRAGMENT is set, returns text that is appropriate to display as a part of composite property string value.
Remarks:
  • Default implementation returns string composed from text representations of child properties.
  • Implementations are never called with m_value being null variant (ie. unspecified value), so you don't need to check for that. Naturally this means that unspecified value is always displayed as an empty string.
See also:
GetValueString()

Reimplemented from wxPGProperty.

virtual void wxFileProperty::OnSetValue (  )  [virtual]

This virtual function is called after m_value has been set.

Remarks:
  • If m_value was set to Null variant (ie. unspecified value), OnSetValue() will not be called.
  • m_value may be of any variant type. Typically properties internally support only one variant type, and as such OnSetValue() provides a good opportunity to convert supported values into internal type.
  • Default implementation does nothing.

Reimplemented from wxPGProperty.

virtual bool wxFileProperty::StringToValue ( wxVariant &  variant,
const wxString &  text,
int  argFlags = 0 
) const [virtual]

Converts 'text' into proper value 'variant'. Returns true if new (different than m_value) value could be interpreted from the text.

Parameters:
argFlags If wxPG_FULL_VALUE is set, returns complete, storable value instead of displayable one (they may be different). If wxPG_COMPOSITE_FRAGMENT is set, text is interpreted as a part of composite property string value (as generated by GetValueAsString() called with this same flag).
Remarks:
  • Default implementation converts semicolon delimited tokens into child values. Only works for properties with children.
  • You might want to take into account that m_value is Null variant if property value is unspecified (which is usually only case if you explicitly enabled that sort behavior).

Reimplemented from wxPGProperty.


Friends And Related Function Documentation

friend class wxPGFileDialogAdapter [friend]

Definition at line 756 of file props.h.


Member Data Documentation

wxString wxFileProperty::m_basePath [protected]

Definition at line 777 of file props.h.

wxString wxFileProperty::m_dlgTitle [protected]

Definition at line 779 of file props.h.

wxFileName wxFileProperty::m_filename [protected]

Definition at line 780 of file props.h.

int wxFileProperty::m_indFilter [protected]

Definition at line 781 of file props.h.

wxString wxFileProperty::m_initialPath [protected]

Definition at line 778 of file props.h.

wxString wxFileProperty::m_wildcard [protected]

Definition at line 776 of file props.h.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


wxpropgrid
Author(s): Jaakko Salli
autogenerated on Fri Jan 11 09:34:06 2013