~efargaspro/+junk/codeblocks-16.01-release

« back to all changes in this revision

Viewing changes to src/plugins/contrib/wxSmith/wxwidgets/properties/wxsimagetreeproperty.h

  • Committer: damienlmoore at gmail
  • Date: 2016-02-02 02:43:22 UTC
  • Revision ID: damienlmoore@gmail.com-20160202024322-yql5qmtbwdyamdwd
Code::BlocksĀ 16.01

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** \file wxsimagetreeproperty.h
 
2
*
 
3
* This file is part of wxSmith plugin for Code::Blocks Studio
 
4
* Copyright (C) 2010 Gary Harris
 
5
*
 
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.
 
10
*
 
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.
 
15
*
 
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/>.
 
18
*
 
19
* This code was taken from the wxSmithImage plug-in, copyright Ron Collins
 
20
* and released under the GPL.
 
21
*
 
22
*/
 
23
 
 
24
#ifndef WXSIMAGETREEPROPERTY_H
 
25
#define WXSIMAGETREEPROPERTY_H
 
26
 
 
27
#include "../../properties/wxscustomeditorproperty.h"
 
28
 
 
29
/** \brief Property for wxArrayString class
 
30
 *
 
31
 * \note This property doesn't take any default value.
 
32
 *       By default array is cleared.
 
33
 */
 
34
class wxsImageTreeProperty: public wxsCustomEditorProperty
 
35
{
 
36
    public:
 
37
 
 
38
        /** \brief Ctor
 
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)
 
43
         */
 
44
        wxsImageTreeProperty(const wxString& PGName,const wxString& DataName,const wxString& DataSubName,long Offset,int Priority=100);
 
45
 
 
46
        /** \brief Returning type name */
 
47
        virtual const wxString GetTypeName() { return _T("wxArrayString"); }
 
48
 
 
49
        /** \brief Showing editor for this property */
 
50
        virtual bool ShowEditor(wxsPropertyContainer* Object);
 
51
 
 
52
    protected:
 
53
 
 
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);
 
59
 
 
60
    private:
 
61
        long Offset;
 
62
        wxString DataSubName;
 
63
        wxString DataName;
 
64
};
 
65
 
 
66
/** \addtogroup ext_properties_macros
 
67
 *  \{ */
 
68
 
 
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
 
75
 */
 
76
#define WXS_IMAGETREE(ClassName,VarName,PGName,DataName) \
 
77
    { static wxsImageTreeProperty _Property(PGName,DataName,_("item"),wxsOFFSET(ClassName,VarName)); \
 
78
      Property(_Property); }
 
79
 
 
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
 
87
 */
 
88
#define WXS_IMAGETREE_P(ClassName,VarName,PGName,DataName,Priority) \
 
89
    { static wxsImageTreeProperty _Property(PGName,DataName,_("item"),wxsOFFSET(ClassName,VarName),Priority); \
 
90
      Property(_Property); }
 
91
 
 
92
/** \} */
 
93
 
 
94
#endif