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: wxschecklistbox.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/wxschecklistbox.cpp $
23
#include <wx/defs.h> // to have wxUSE_CHECKLISTBOX defined in the checklst.h header
24
#include <wx/checklst.h>
25
#include "wxschecklistbox.h"
29
wxsRegisterItem<wxsCheckListBox> Reg(_T("CheckListBox"),wxsTWidget,_T("Standard"),50);
31
WXS_ST_BEGIN(wxsCheckListBoxStyles,_T(""))
32
WXS_ST_CATEGORY("wxCheckListBox")
37
WXS_ST(wxLB_ALWAYS_SB)
38
WXS_ST(wxLB_NEEDED_SB)
44
WXS_EV_BEGIN(wxsCheckListBoxEvents)
45
WXS_EVI(EVT_CHECKLISTBOX,wxEVT_COMMAND_CHECKLISTBOX_TOGGLED,wxCommandEvent,Toggled)
49
wxsCheckListBox::wxsCheckListBox(wxsItemResData* Data):
53
wxsCheckListBoxEvents,
54
wxsCheckListBoxStyles)
58
void wxsCheckListBox::OnBuildCreatingCode()
60
switch ( GetLanguage() )
64
AddHeader(_T("<wx/checklst.h>"),GetInfo().ClassName,hfInPCH);
65
Codef(_T("%C(%W, %I, %P, %S, 0, 0, %T, %V, %N);\n"));
67
for ( size_t i = 0; i < ArrayChoices.GetCount(); ++i )
71
Codef( _T("%ACheck("));
73
Codef( _T("%AAppend(%t)"), ArrayChoices[i].c_str());
80
BuildSetupWindowCode();
86
wxsCodeMarks::Unknown(_T("wxsCheckListBox::OnBuildCreatingCode"),GetLanguage());
92
wxObject* wxsCheckListBox::OnBuildPreview(wxWindow* Parent,long Flags)
94
wxCheckListBox* Preview = new wxCheckListBox(Parent,GetId(),Pos(Parent),Size(Parent),0,0,Style());
95
for ( size_t i = 0; i < ArrayChoices.GetCount(); ++i )
97
int Val = Preview->Append(ArrayChoices[i]);
103
return SetupWindow(Preview,Flags);
106
void wxsCheckListBox::OnEnumWidgetProperties(long Flags)
108
WXS_ARRAYSTRINGCHECK(wxsCheckListBox,ArrayChoices,ArrayChecks,_("Choices"),_T("content"),_T("item"));