2
* This file is part of wxSmith plugin for Code::Blocks Studio
3
* Copyright (C) 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: wxsMultiChoiceDialog.cpp 4504 2007-10-02 21:52:30Z byo $
20
* $HeadURL: svn+ssh://byo@svn.berlios.de/svnroot/repos/codeblocks/trunk/src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsMultiChoiceDialog.cpp $
23
#include "wxsmultichoicedialog.h"
24
#include "../wxsitemresdata.h"
25
#include <wx/choicdlg.h>
29
wxsRegisterItem<wxsMultiChoiceDialog> Reg(_T("MultiChoiceDialog"),wxsTTool,_T("Dialogs"),50,false);
31
WXS_ST_BEGIN(wxsMultiChoiceDialogStyles,_T("wxCHOICEDLG_STYLE"))
32
WXS_ST_CATEGORY("wxMultiChoiceDialog")
33
WXS_ST(wxCHOICEDLG_STYLE)
41
wxsMultiChoiceDialog::wxsMultiChoiceDialog(wxsItemResData* Data):
42
wxsTool(Data,&Reg.Info,0,wxsMultiChoiceDialogStyles)
44
m_Message = _("Select items");
47
void wxsMultiChoiceDialog::OnBuildCreatingCode()
49
switch ( GetLanguage() )
53
AddHeader(_T("<wx/choicdlg.h>"),GetInfo().ClassName,hfInPCH);
56
if ( m_Content.GetCount() > 0 )
58
ChoicesName = GetCoderContext()->GetUniqueName(_T("__wxMultiChoiceDialogChoices"));
59
Codef(_T("wxString %s[%d] = \n{\n"),ChoicesName.c_str(),(int)m_Content.GetCount());
60
for ( size_t i = 0; i < m_Content.GetCount(); ++i )
62
Codef(_T("\t%t%s\n"),m_Content[i].c_str(),((i!=m_Content.GetCount()-1)?_T(","):_T("")));
67
Codef(_T("%C(%W, %t, %t, %d, %s, %T, %P);\n"),
70
(int)m_Content.GetCount(),
71
(m_Content.IsEmpty()?_T("0"):ChoicesName.c_str()));
73
BuildSetupWindowCode();
79
wxsCodeMarks::Unknown(_T("wxsMultiChoiceDialog::OnBuildCreatingCode"),GetLanguage());
84
void wxsMultiChoiceDialog::OnEnumToolProperties(long Flags)
86
WXS_SHORT_STRING(wxsMultiChoiceDialog,m_Message,_("Message"),_T("message"),_T(""),false);
87
WXS_SHORT_STRING(wxsMultiChoiceDialog,m_Caption,_("Caption"),_T("caption"),_T(""),false);
88
WXS_ARRAYSTRING (wxsMultiChoiceDialog,m_Content,_("Items"), _T("content"),_T("item"));