wxPropertyGrid
Public Member Functions | Protected Member Functions
wxSystemColourProperty Class Reference

Has dropdown list of wxWidgets system colours. More...

#include <advprops.h>

Inheritance diagram for wxSystemColourProperty:
wxEnumProperty wxBaseEnumProperty wxPGProperty

List of all members.

Public Member Functions

virtual wxString ColourToString (const wxColour &col, int index) const
 Override in derived class to customize how colours are printed as strings.
virtual wxColour GetColour (int index) const
 Default is to use wxSystemSettings::GetColour(index).
virtual int GetCustomColourIndex () const
 Returns index of entry that triggers colour picker dialog (default is last).
wxColourPropertyValue GetVal (const wxVariant *pVariant=NULL) const
virtual bool IntToValue (wxVariant &variant, int number, int argFlags=0) const
 Converts 'number' (including choice selection) into proper value 'variant'.
virtual void OnSetValue ()
 This virtual function is called after m_value has been set.
bool QueryColourFromUser (wxVariant &variant) const
 wxSystemColourProperty (const wxString &label=wxPG_LABEL, const wxString &name=wxPG_LABEL, const wxColourPropertyValue &value=wxColourPropertyValue())

Protected Member Functions

int ColToInd (const wxColour &colour) const
virtual wxVariant DoTranslateVal (wxColourPropertyValue &v) const
void Init (int type, const wxColour &colour)
wxVariant TranslateVal (wxColourPropertyValue &v) const
wxVariant TranslateVal (int type, const wxColour &colour) const
 wxSystemColourProperty (const wxString &label, const wxString &name, const wxChar **labels, const long *values, wxPGChoices *choicesCache, const wxColour &value)
 wxSystemColourProperty (const wxString &label, const wxString &name, const wxChar **labels, const long *values, wxPGChoices *choicesCache, const wxColourPropertyValue &value)

Detailed Description

Has dropdown list of wxWidgets system colours.

Value used is of wxColourPropertyValue type.


Member Function Documentation

virtual wxColour wxSystemColourProperty::GetColour ( int  index) const [virtual]

Default is to use wxSystemSettings::GetColour(index).

Override to use custom colour tables etc.

virtual bool wxSystemColourProperty::IntToValue ( wxVariant &  value,
int  number,
int  argFlags = 0 
) const [virtual]

Converts 'number' (including choice selection) into proper value 'variant'.

Returns true if new (different than m_value) value could be interpreted from the integer.

Parameters:
argFlagsIf wxPG_FULL_VALUE is set, returns complete, storable value instead of displayable
Remarks:
  • Default implementation may work correctly if used value type is int.
  • If property is not supposed to use choice or spinctrl or other editor with int-based value, it is not necessary to implement this method.
  • If property uses choice control, and displays a dialog on some choice items, then it is preferred to display that dialog in IntToValue instead of OnEvent.
  • 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 wxBaseEnumProperty.

virtual void wxSystemColourProperty::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 wxBaseEnumProperty.


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