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: wxsbutton.cpp 4850 2008-01-29 21:45:49Z byo $
20
* $HeadURL: svn://svn.berlios.de/codeblocks/tags/8.02/src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsbutton.cpp $
23
#include "wxsbutton.h"
27
wxsRegisterItem<wxsButton> Reg(_T("Button"),wxsTWidget,_T("Standard"),90);
29
WXS_ST_BEGIN(wxsButtonStyles,_T(""))
30
WXS_ST_CATEGORY("wxButton")
39
WXS_EV_BEGIN(wxsButtonEvents)
40
WXS_EVI(EVT_BUTTON,wxEVT_COMMAND_BUTTON_CLICKED,wxCommandEvent,Click)
44
wxsButton::wxsButton(wxsItemResData* Data):
54
void wxsButton::OnBuildCreatingCode()
56
switch ( GetLanguage() )
60
AddHeader(_T("<wx/button.h>"),GetInfo().ClassName,hfInPCH);
61
Codef(_T("%C(%W, %I, %t, %P, %S, %T, %V, %N);\n"),Label.c_str());
62
if ( IsDefault ) Codef( _T("%ASetDefault();\n"));
63
BuildSetupWindowCode();
69
wxsCodeMarks::Unknown(_T("wxsButton::OnBuildCreatingCode"),GetLanguage());
74
wxObject* wxsButton::OnBuildPreview(wxWindow* Parent,long Flags)
76
wxButton* Preview = new wxButton(Parent,GetId(),Label,Pos(Parent),Size(Parent),Style());
77
if ( IsDefault ) Preview->SetDefault();
78
return SetupWindow(Preview,Flags);
81
void wxsButton::OnEnumWidgetProperties(long Flags)
83
WXS_STRING(wxsButton,Label,_("Label"),_T("label"),_T(""),false)
84
WXS_BOOL(wxsButton,IsDefault,_("Is default"),_T("default"),false)