1
/**************************************************************************//**
2
* \file wxslinearmeter.h
6
* This file is part of wxSmithKWIC.
8
* wxSmithKWIC - an add-on for wxSmith, Code::Blocks' GUI editor. \n
9
* Copyright (C) 2010 Gary Harris.
11
* wxSmithKWIC is free software: you can redistribute it and/or modify
12
* it under the terms of the KWIC License
13
* the Free Software Foundation, either version 3 of the License, or
14
* (at your option) any later version.
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* KWIC License for more details.
21
* You should have received a copy of the KWIC License along with this
22
* program. If not, see <http://www.koansoftware.com/kwic/kwic-license.htm>.
24
*****************************************************************************/
25
#ifndef WXSLINEARMETER_H
26
#define WXSLINEARMETER_H
28
#include "wxwidgets/wxswidget.h"
31
class wxsLinearMeter : public wxsWidget
34
wxsLinearMeter(wxsItemResData* Data);
35
virtual ~wxsLinearMeter();
38
virtual void OnBuildCreatingCode();
39
virtual wxObject* OnBuildPreview(wxWindow* Parent,long Flags);
40
virtual void OnEnumWidgetProperties(long Flags);
42
long m_iValue; //!< The meter's initial value.
43
long m_iRangeMin; //!< The meter's minimum range value.
44
long m_iRangeMax; //!< The meter's maximum range value.
45
bool m_bHorizontal; //!< The meter's orientation, horizontal or vertical.
46
bool m_bShowVal; //!< Whether to show the current value.
47
bool m_bShowLimits; //!< Whether to show the limit values.
48
wxsColourData m_cdActiveBarColour; //!< The meter's bar colour.
49
wxsColourData m_cdPassiveBarColour; //!< The meter's background colour.
50
wxsColourData m_cdBorderColour; //!< The meter's border colour.
51
wxsColourData m_cdLimitTextColour; //!< The colour that the limit value have.
52
wxsColourData m_cdValueTextColour; //!< The meter's text colour.
53
wxsColourData m_cdTagColour; //!< The meter's tag colour.
54
wxsFontData m_fnt; //!< The meter's display font.
56
// Dynamic properties.
57
/*! \brief Tag value enum.
60
wxPGId id; //!< Tag property ID.
61
int val; //!< Tag value.
63
WX_DEFINE_ARRAY(TagDesc*, TagArray);
65
TagArray m_arrTags; //!< Array of tag description structs.
66
wxPGId m_TagCountId; //!< The ID of the tag count property.
68
void OnAddExtraProperties(wxsPropertyGridManager* Grid);
69
void OnExtraPropertyChanged(wxsPropertyGridManager* Grid,wxPGId id);
70
bool OnXmlRead(TiXmlElement* Element,bool IsXRC,bool IsExtra);
71
bool OnXmlWrite(TiXmlElement* Element,bool IsXRC,bool IsExtra);
72
void InsertPropertyForTag(wxsPropertyGridManager* Grid,int Position);
73
bool HandleChangeInTag(wxsPropertyGridManager* Grid,wxPGId id,int Position);
76
#endif // WXSLINEARMETER_H