1
/** \file wxscolourpickerctrl.cpp
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/>.
21
#include "wxscolourpickerctrl.h"
23
#include <wx/clrpicker.h>
27
wxsRegisterItem<wxsColourPickerCtrl> Reg(_T("ColourPickerCtrl"), wxsTWidget, _T("Advanced"), 140);
29
WXS_ST_BEGIN(wxsColourPickerCtrlStyles, _T(""))
30
WXS_ST_CATEGORY("wxColourPickerCtrl")
31
WXS_ST(wxCLRP_SHOW_LABEL)
32
WXS_ST(wxCLRP_USE_TEXTCTRL)
36
WXS_EV_BEGIN(wxsColourPickerCtrlEvents)
37
WXS_EVI(EVT_COLOURPICKER_CHANGED, wxEVT_COMMAND_COLOURPICKER_CHANGED, wxColourPickerEvent, ColourChanged)
43
* \param Data wxsItemResData* The control's resource data.
46
wxsColourPickerCtrl::wxsColourPickerCtrl(wxsItemResData* Data):
50
wxsColourPickerCtrlEvents,
51
wxsColourPickerCtrlStyles),
55
/*! \brief Create the initial control.
60
void wxsColourPickerCtrl::OnBuildCreatingCode()
62
switch ( GetLanguage() )
66
AddHeader(_T("<wx/clrpicker.h>"),GetInfo().ClassName,0);
68
wxString ss = m_cdColour.BuildCode(GetCoderContext());
69
Codef(_T("%C(%W, %I, %s, %P, %S, %T, %V, %N);\n"), ss.wx_str());
71
BuildSetupWindowCode();
77
wxsCodeMarks::Unknown(_T("wxsColourPickerCtrl::OnBuildCreatingCode"),GetLanguage());
82
/*! \brief Build the control preview.
84
* \param parent wxWindow* The parent window.
85
* \param flags long The control flags.
86
* \return wxObject* The constructed control.
89
wxObject* wxsColourPickerCtrl::OnBuildPreview(wxWindow* Parent,long Flags)
91
wxColourPickerCtrl* Preview;
92
wxColour clr = m_cdColour.GetColour();
94
Preview = new wxColourPickerCtrl(Parent, GetId(), clr, Pos(Parent), Size(Parent), Style());
97
Preview = new wxColourPickerCtrl(Parent, GetId(), *wxBLACK, Pos(Parent), Size(Parent), Style());
99
return SetupWindow(Preview,Flags);
102
/*! \brief Enumerate the control's properties.
104
* \param flags long The control flags.
108
void wxsColourPickerCtrl::OnEnumWidgetProperties(long Flags)
110
WXS_COLOUR(wxsColourPickerCtrl, m_cdColour, _("Colour"), _T("colour"));