2
* This file is part of wxSmith plugin for Code::Blocks Studio
3
* Copyright (C) 2006-2007 Bartlomiej Swiecki
5
* wxSmith is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 3 of the License, or
8
* (at your option) any later version.
10
* wxSmith is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with wxSmith. If not, see <http://www.gnu.org/licenses/>.
19
* $Id: wxsfontproperty.h 10025 2014-11-06 09:23:37Z jenslody $
20
* $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-16.xx/src/plugins/contrib/wxSmith/wxwidgets/properties/wxsfontproperty.h $
23
#ifndef WXSFONTPROPERTY_H
24
#define WXSFONTPROPERTY_H
26
#include "../../properties/wxsproperties.h"
27
#include "../wxscodercontext.h"
29
/** \brief Structure holding font configuration */
46
bool HasUnderlined : 1;
50
bool HasRelativeSize : 1;
52
/** \brief Function building font from font data */
55
/** \brief Function generating code which will build font object with specified name
56
* \return Code building font or empty string if font is default
58
wxString BuildFontCode(const wxString& FontName,wxsCoderContext* Context);
60
/** \brief Ctor - initializes all values to default ones */
63
Style(wxFONTSTYLE_NORMAL),
64
Weight(wxFONTWEIGHT_NORMAL),
66
Family(wxFONTFAMILY_DEFAULT),
75
HasRelativeSize(false)
80
/** \brief Property for editing font properties
82
class wxsFontProperty: public wxsCustomEditorProperty
87
* \param PGName name of property in Property Grid
88
* \param DataName name of property in data stuctures
89
* \param Offset offset of wxsFontData structure (returned from wxsOFFSET macro)
90
* \param Priority priority of this property
93
const wxString& PGName,
94
const wxString& DataName,
98
/** \brief Returning type name */
99
virtual const wxString GetTypeName() { return _T("wxFont"); }
101
/** \brief Showing editor for this property */
102
virtual bool ShowEditor(wxsPropertyContainer* Object);
106
virtual bool XmlRead(wxsPropertyContainer* Object,TiXmlElement* Element);
107
virtual bool XmlWrite(wxsPropertyContainer* Object,TiXmlElement* Element);
108
virtual bool PropStreamRead(wxsPropertyContainer* Object,wxsPropertyStream* Stream);
109
virtual bool PropStreamWrite(wxsPropertyContainer* Object,wxsPropertyStream* Stream);
110
virtual wxString GetStr(wxsPropertyContainer* Object);
117
/** \addtogroup ext_properties_macros
120
/** \brief Macro automatically declaring font property
121
* \param ClassName name of class holding this property
122
* \param VarName name of wxsFontData variable inside class
123
* \param PGName name used in property grid
124
* \param DataName name used in Xml / Data Streams
126
#define WXS_FONT(ClassName,VarName,PGName,DataName) \
127
{ static wxsFontProperty _Property(PGName,DataName,wxsOFFSET(ClassName,VarName)); \
128
Property(_Property); }
130
/** \brief Macro automatically declaring font property
131
* \param ClassName name of class holding this property
132
* \param VarName name of wxsFontData variable inside class
133
* \param PGName name used in property grid
134
* \param DataName name used in Xml / Data Streams
135
* \param Priority priority of this property
137
#define WXS_FONT_P(ClassName,VarName,PGName,DataName,Priority) \
138
{ static wxsFontProperty _Property(PGName,DataName,wxsOFFSET(ClassName,VarName),Priority); \
139
Property(_Property); }