1
/** \file wxssinglechoicedialog.cpp
3
* This file is part of wxSmith plugin for Code::Blocks Studio
4
* Copyright (C) 2007 Bartlomiej Swiecki
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/>.
20
* $Id: wxssinglechoicedialog.cpp 8335 2012-09-03 07:43:04Z ollydbg $
21
* $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-16.xx/src/plugins/contrib/wxSmith/wxwidgets/defitems/wxssinglechoicedialog.cpp $
24
#include "wxssinglechoicedialog.h"
25
#include "../wxsitemresdata.h"
26
#include <wx/choicdlg.h>
30
wxsRegisterItem<wxsSingleChoiceDialog> Reg(_T("SingleChoiceDialog"),wxsTTool,_T("Dialogs"),70,false);
32
WXS_ST_BEGIN(wxsSingleChoiceDialogStyles,_T("wxCHOICEDLG_STYLE"))
33
WXS_ST_CATEGORY("wxSingleChoiceDialog")
34
WXS_ST(wxCHOICEDLG_STYLE)
42
wxsSingleChoiceDialog::wxsSingleChoiceDialog(wxsItemResData* Data):
43
wxsTool(Data,&Reg.Info,0,wxsSingleChoiceDialogStyles)
45
m_Message = _("Select items");
48
void wxsSingleChoiceDialog::OnBuildCreatingCode()
50
switch ( GetLanguage() )
54
AddHeader(_T("<wx/choicdlg.h>"),GetInfo().ClassName,hfInPCH);
57
if ( m_Content.GetCount() > 0 )
59
ChoicesName = GetCoderContext()->GetUniqueName(_T("__wxSingleChoiceDialogChoices"));
60
Codef(_T("wxString %s[%d] = \n{\n"),ChoicesName.wx_str(),(int)m_Content.GetCount());
61
for ( size_t i = 0; i < m_Content.GetCount(); ++i )
63
Codef(_T("\t%t%s\n"),m_Content[i].wx_str(),((i!=m_Content.GetCount()-1)?_T(","):_T("")));
68
Codef(_T("%C(%W, %t, %t, %d, %s, 0, %T, %P);\n"),
71
(int)m_Content.GetCount(),
72
(m_Content.IsEmpty()?_T("0"):ChoicesName.wx_str()));
74
BuildSetupWindowCode();
80
wxsCodeMarks::Unknown(_T("wxsSingleChoiceDialog::OnBuildCreatingCode"),GetLanguage());
85
void wxsSingleChoiceDialog::OnEnumToolProperties(long Flags)
87
WXS_SHORT_STRING(wxsSingleChoiceDialog,m_Message,_("Message"),_T("message"),_T(""),false);
88
WXS_SHORT_STRING(wxsSingleChoiceDialog,m_Caption,_("Caption"),_T("caption"),_T(""),false);
89
WXS_ARRAYSTRING (wxsSingleChoiceDialog,m_Content,_("Items"), _T("content"),_T("item"));