1
/** \file wxsimagetreeproperty.h
3
* This file is part of wxSmith plugin for Code::Blocks Studio
4
* Copyright (C) 2010 Gary Harris
6
* wxSmith is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 3 of the License, or
9
* (at your option) any later version.
11
* wxSmith is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with wxSmith. If not, see <http://www.gnu.org/licenses/>.
19
* This code was taken from the wxSmithImage plug-in, copyright Ron Collins
20
* and released under the GPL.
24
#ifndef WXSIMAGETREEPROPERTY_H
25
#define WXSIMAGETREEPROPERTY_H
27
#include "../../properties/wxscustomeditorproperty.h"
29
/** \brief Property for wxArrayString class
31
* \note This property doesn't take any default value.
32
* By default array is cleared.
34
class wxsImageTreeProperty: public wxsCustomEditorProperty
39
* \param PGName name of property in Property Grid
40
* \param DataName name of property in data stuctures
41
* \param DataSubName name of name applied for each array element
42
* \param Offset offset of value (returned from wxsOFFSET macro)
44
wxsImageTreeProperty(const wxString& PGName,const wxString& DataName,const wxString& DataSubName,long Offset,int Priority=100);
46
/** \brief Returning type name */
47
virtual const wxString GetTypeName() { return _T("wxArrayString"); }
49
/** \brief Showing editor for this property */
50
virtual bool ShowEditor(wxsPropertyContainer* Object);
54
virtual bool XmlRead(wxsPropertyContainer* Object,TiXmlElement* Element);
55
virtual bool XmlWrite(wxsPropertyContainer* Object,TiXmlElement* Element);
56
virtual bool PropStreamRead(wxsPropertyContainer* Object,wxsPropertyStream* Stream);
57
virtual bool PropStreamWrite(wxsPropertyContainer* Object,wxsPropertyStream* Stream);
58
virtual wxString GetStr(wxsPropertyContainer* Object);
66
/** \addtogroup ext_properties_macros
69
/** \brief Macro automatically declaring wxArrayString property
70
* \param ClassName name of class holding this property
71
* \param VarName name of variable inside class
72
* \param PGName name used in property grid
73
* \param DataName name used in Xml / Data Streams
74
* \param DataSubName name for subelement used in Xml / Data Streams
76
#define WXS_IMAGETREE(ClassName,VarName,PGName,DataName) \
77
{ static wxsImageTreeProperty _Property(PGName,DataName,_("item"),wxsOFFSET(ClassName,VarName)); \
78
Property(_Property); }
80
/** \brief Macro automatically declaring wxArrayString property with custom priority
81
* \param ClassName name of class holding this property
82
* \param VarName name of variable inside class
83
* \param PGName name used in property grid
84
* \param DataName name used in Xml / Data Streams
85
* \param DataSubName name for subelement used in Xml / Data Streams
86
* \param Priority priority of property
88
#define WXS_IMAGETREE_P(ClassName,VarName,PGName,DataName,Priority) \
89
{ static wxsImageTreeProperty _Property(PGName,DataName,_("item"),wxsOFFSET(ClassName,VarName),Priority); \
90
Property(_Property); }