// Author: Jaakko Salli
// Modified by:
// Created: 2004-09-25
-// RCS-ID: $Id:
+// RCS-ID: $Id$
// Copyright: (c) Jaakko Salli
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Additional Value Type Handlers
//
#ifndef SWIG
-bool WXDLLIMPEXP_PROPGRID operator==(const wxFont&, const wxFont&);
-
bool WXDLLIMPEXP_PROPGRID
operator==(const wxArrayInt& array1, const wxArrayInt& array2);
#endif
wxColour m_colour;
wxColourPropertyValue()
+ : wxObject()
{
m_type = 0;
}
}
wxColourPropertyValue( const wxColourPropertyValue& v )
+ : wxObject()
{
m_type = v.m_type;
m_colour = v.m_colour;
}
wxColourPropertyValue( const wxColour& colour )
+ : wxObject()
{
m_type = wxPG_COLOUR_CUSTOM;
m_colour = colour;
}
wxColourPropertyValue( wxUint32 type )
+ : wxObject()
{
m_type = type;
}
wxColourPropertyValue( wxUint32 type, const wxColour& colour )
+ : wxObject()
{
Init( type, colour );
}
#ifndef SWIG
void operator=(const wxColourPropertyValue& cpv)
{
- Init( cpv.m_type, cpv.m_colour );
+ if (this != &cpv)
+ Init( cpv.m_type, cpv.m_colour );
}
private:
#endif
#ifndef SWIG
- #define wxPG_EMPTY_CPV (*((wxColourPropertyValue*)NULL))
+ #define wxPG_EMPTY_CPV (*(NULL))
#define wxPG_NORMAL_FONT (*wxNORMAL_FONT)
#else
#define wxPG_EMPTY_CPV wxCPV_wxPG_EMPTY
const wxFont& value = wxFont());
virtual ~wxFontProperty();
virtual void OnSetValue();
- virtual wxString GetValueAsString( int argFlags = 0 ) const;
+ virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const;
virtual bool OnEvent( wxPropertyGrid* propgrid,
wxWindow* primary, wxEvent& event );
virtual void ChildChanged( wxVariant& thisValue,
*/
virtual int GetCustomColourIndex() const;
- virtual wxString GetValueAsString( int argFlags = 0 ) const;
+ virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const;
virtual bool StringToValue( wxVariant& variant,
const wxString& text,
int argFlags = 0 ) const;
// -----------------------------------------------------------------------
-WX_PG_DECLARE_CUSTOM_COLOUR_PROPERTY_USES_WXCOLOUR_WITH_DECL(
- wxColourProperty, class WXDLLIMPEXP_PROPGRID)
+class WXDLLIMPEXP_PROPGRID wxColourProperty : public wxSystemColourProperty
+{
+ WX_PG_DECLARE_PROPERTY_CLASS(wxColourProperty)
+public:
+ wxColourProperty( const wxString& label = wxPG_LABEL,
+ const wxString& name = wxPG_LABEL,
+ const wxColour& value = *wxWHITE );
+ virtual ~wxColourProperty();
-// Exclude classes from wxPython bindings
-#ifndef SWIG
+ virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const;
+ virtual wxColour GetColour( int index ) const;
+
+protected:
+ virtual wxVariant DoTranslateVal( wxColourPropertyValue& v ) const;
+
+private:
+ void Init( wxColour colour );
+};
// -----------------------------------------------------------------------
+// Exclude classes from wxPython bindings
+#ifndef SWIG
+
/** @class wxCursorProperty
@ingroup classes
Property representing wxCursor.
virtual ~wxMultiChoiceProperty();
virtual void OnSetValue();
- virtual wxString GetValueAsString( int flags = 0 ) const;
+ virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const;
virtual bool StringToValue(wxVariant& variant,
const wxString& text,
int argFlags = 0) const;
protected:
- void GenerateValueAsString();
+ void GenerateValueAsString( wxVariant& value, wxString* target ) const;
// Returns translation of values into string indices.
wxArrayInt GetValueAsIndices() const;
<b>Supported special attributes:</b>
- "DateFormat": Determines displayed date format.
- "PickerStyle": Determines window style used with wxDatePickerCtrl.
- Default is wxDP_DEFAULT | wxDP_SHOWCENTURY.
+ Default is wxDP_DEFAULT | wxDP_SHOWCENTURY. Using wxDP_ALLOWNONE
+ enables additional support for unspecified property value.
*/
class WXDLLIMPEXP_PROPGRID wxDateProperty : public wxPGProperty
{
const wxDateTime& value = wxDateTime() );
virtual ~wxDateProperty();
- virtual wxString GetValueAsString( int flags = 0 ) const;
+ virtual void OnSetValue();
+ virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const;
virtual bool StringToValue(wxVariant& variant,
const wxString& text,
int argFlags = 0) const;
// used for event handling here.
class WXDLLIMPEXP_PROPGRID wxPGSpinCtrlEditor : public wxPGTextCtrlEditor
{
- WX_PG_DECLARE_EDITOR_CLASS(wxPGSpinCtrlEditor)
+ DECLARE_DYNAMIC_CLASS(wxPGSpinCtrlEditor)
public:
virtual ~wxPGSpinCtrlEditor();
- // See below for short explanations of what these are suppposed to do.
- wxPG_DECLARE_CREATECONTROLS
-
+ wxString GetName() const;
+ virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid,
+ wxPGProperty* property,
+ const wxPoint& pos,
+ const wxSize& size) const;
virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property,
wxWindow* wnd, wxEvent& event ) const;