~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/plugins/classwizard/classwizarddlg.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
3
3
 * http://www.gnu.org/licenses/gpl-3.0.html
4
4
 *
5
 
 * $Revision: 4909 $
6
 
 * $Id: classwizarddlg.cpp 4909 2008-02-27 13:15:26Z mortenmacfly $
7
 
 * $HeadURL: svn://svn.berlios.de/codeblocks/tags/8.02/src/plugins/classwizard/classwizarddlg.cpp $
 
5
 * $Revision: 6104 $
 
6
 * $Id: classwizarddlg.cpp 6104 2010-01-23 12:56:12Z mortenmacfly $
 
7
 * $HeadURL: svn+ssh://jenslody@svn.berlios.de/svnroot/repos/codeblocks/trunk/src/plugins/classwizard/classwizarddlg.cpp $
8
8
 */
9
9
 
10
10
#include <sdk.h>
11
11
#ifndef CB_PRECOMP
12
 
#include <wx/arrstr.h>
13
 
#include <wx/checkbox.h>
14
 
#include <wx/combobox.h>
15
 
#include <wx/event.h>
16
 
#include <wx/file.h>
17
 
#include <wx/filename.h>
18
 
#include <wx/intl.h>
19
 
#include <wx/textctrl.h>
20
 
#include <wx/xrc/xmlres.h>
21
 
#include "cbeditor.h"
22
 
#include "cbproject.h"
23
 
#include "configmanager.h"
24
 
#include "editormanager.h"
25
 
#include "globals.h"
26
 
#include "manager.h"
27
 
#include "macrosmanager.h"
28
 
#include "projectmanager.h"
 
12
  #include <wx/checkbox.h>
 
13
  #include <wx/combobox.h>
 
14
  #include <wx/event.h>
 
15
  #include <wx/file.h>
 
16
  #include <wx/filename.h>
 
17
  #include <wx/intl.h>
 
18
  #include <wx/textctrl.h>
 
19
  #include <wx/xrc/xmlres.h>
 
20
 
 
21
  #include "cbeditor.h"
 
22
  #include "cbproject.h"
 
23
  #include "configmanager.h"
 
24
  #include "editormanager.h"
 
25
  #include "globals.h"
 
26
  #include "manager.h"
 
27
  #include "macrosmanager.h"
 
28
  #include "projectmanager.h"
29
29
#endif
30
30
#include "cbstyledtextctrl.h"
31
31
 
32
 
#include "classwizarddlg.h"
33
32
#include <wx/tokenzr.h>
34
33
#include <wx/dirdlg.h>
35
 
 
36
 
namespace {
37
 
 
38
 
 
39
 
void ForceDirectory(const wxFileName & filename)
40
 
{
41
 
    wxFileName parentname(filename);
42
 
    parentname.RemoveLastDir();
43
 
 
44
 
    if (filename != parentname)
45
 
        ForceDirectory(parentname);
46
 
 
47
 
    if (!wxDirExists(filename.GetPath()))
48
 
        wxMkdir(filename.GetPath());
49
 
}
50
 
 
51
 
}// namespace
52
 
 
53
 
BEGIN_EVENT_TABLE(ClassWizardDlg, wxDialog)
54
 
    EVT_UPDATE_UI(-1, ClassWizardDlg::OnUpdateUI)
55
 
    EVT_TEXT(XRCID("txtName"), ClassWizardDlg::OnNameChange)
56
 
    EVT_TEXT(XRCID("txtInheritance"), ClassWizardDlg::OnAncestorChange)
57
 
    EVT_BUTTON(XRCID("btnCommonDir"), ClassWizardDlg::OnCommonDirClick)
58
 
    EVT_CHECKBOX(XRCID("chkLowerCase"), ClassWizardDlg::OnLowerCaseClick)
59
 
    EVT_BUTTON(XRCID("btnIncludeDir"), ClassWizardDlg::OnIncludeDirClick)
60
 
    EVT_BUTTON(XRCID("btnImplDir"), ClassWizardDlg::OnImplDirClick)
61
 
    EVT_TEXT(XRCID("txtHeader"), ClassWizardDlg::OnHeaderChange)
62
 
    EVT_BUTTON(XRCID("wxID_OK"), ClassWizardDlg::OnOKClick)
63
 
    EVT_BUTTON(XRCID("wxID_CANCEL"), ClassWizardDlg::OnCancelClick)
 
34
#include "classwizarddlg.h"
 
35
 
 
36
BEGIN_EVENT_TABLE(ClassWizardDlg, wxScrollingDialog)
 
37
    EVT_UPDATE_UI(-1,                          ClassWizardDlg::OnUpdateUI)
 
38
    EVT_TEXT     (XRCID("txtName"),            ClassWizardDlg::OnNameChange)
 
39
    EVT_TEXT     (XRCID("txtInheritance"),     ClassWizardDlg::OnAncestorChange)
 
40
    EVT_BUTTON   (XRCID("btnAddMemberVar"),    ClassWizardDlg::OnAddMemberVar)
 
41
    EVT_BUTTON   (XRCID("btnRemoveMemberVar"), ClassWizardDlg::OnRemoveMemberVar)
 
42
    EVT_BUTTON   (XRCID("btnCommonDir"),       ClassWizardDlg::OnCommonDirClick)
 
43
    EVT_CHECKBOX (XRCID("chkLowerCase"),       ClassWizardDlg::OnLowerCaseClick)
 
44
    EVT_BUTTON   (XRCID("btnIncludeDir"),      ClassWizardDlg::OnIncludeDirClick)
 
45
    EVT_BUTTON   (XRCID("btnImplDir"),         ClassWizardDlg::OnImplDirClick)
 
46
    EVT_TEXT     (XRCID("txtHeader"),          ClassWizardDlg::OnHeaderChange)
 
47
    EVT_BUTTON   (XRCID("wxID_OK"),            ClassWizardDlg::OnOKClick)
 
48
    EVT_BUTTON   (XRCID("wxID_CANCEL"),        ClassWizardDlg::OnCancelClick)
64
49
END_EVENT_TABLE()
65
50
 
 
51
// ---------
 
52
// livecycle
 
53
// ---------
 
54
 
66
55
ClassWizardDlg::ClassWizardDlg(wxWindow* parent)
67
56
{
68
 
    wxXmlResource::Get()->LoadDialog(this, parent, _T("dlgNewClass"));
 
57
    wxXmlResource::Get()->LoadObject(this, parent, _T("dlgNewClass"),_T("wxScrollingDialog"));
69
58
 
70
59
    ProjectManager* prjMan = Manager::Get()->GetProjectManager();
71
60
    cbProject* prj = prjMan->GetActiveProject();
88
77
    ConfigManager *cfg = Manager::Get()->GetConfigManager(_T("classwizard"));
89
78
    if (cfg)
90
79
    {
91
 
        XRCCTRL(*this, "chkCommonDir", wxCheckBox)->SetValue(cfg->ReadBool(_T("common_dir")));
92
 
        XRCCTRL(*this, "chkLowerCase", wxCheckBox)->SetValue(cfg->ReadBool(_T("lower_case")));
 
80
        XRCCTRL(*this, "chkDocumentation", wxCheckBox)->SetValue(cfg->ReadBool(_T("documentation")));
 
81
        XRCCTRL(*this, "chkCommonDir",     wxCheckBox)->SetValue(cfg->ReadBool(_T("common_dir")));
 
82
        XRCCTRL(*this, "chkLowerCase",     wxCheckBox)->SetValue(cfg->ReadBool(_T("lower_case")));
93
83
    }
94
84
}
95
85
 
99
89
    ConfigManager *cfg = Manager::Get()->GetConfigManager(_T("classwizard"));
100
90
    if (cfg)
101
91
    {
102
 
        cfg->Write(_T("common_dir"), (bool) XRCCTRL(*this, "chkCommonDir", wxCheckBox)->GetValue());
103
 
        cfg->Write(_T("lower_case"), (bool) XRCCTRL(*this, "chkLowerCase", wxCheckBox)->GetValue());
 
92
        cfg->Write(_T("documentation"), (bool) XRCCTRL(*this, "chkDocumentation", wxCheckBox)->GetValue());
 
93
        cfg->Write(_T("common_dir"),    (bool) XRCCTRL(*this, "chkCommonDir",     wxCheckBox)->GetValue());
 
94
        cfg->Write(_T("lower_case"),    (bool) XRCCTRL(*this, "chkLowerCase",     wxCheckBox)->GetValue());
104
95
    }
105
96
}
106
97
 
107
 
void ClassWizardDlg::DoGuardBlock()
108
 
{
109
 
    m_Header = XRCCTRL(*this, "txtHeader", wxTextCtrl)->GetValue();
110
 
    wxString GuardWord = m_Header;
111
 
    GuardWord.MakeUpper();
112
 
    while (GuardWord.Replace(_T("."), _T("_")))
113
 
        ;
114
 
    while (GuardWord.Replace(_T("/"), _T("_")))
115
 
        ;
116
 
    while (GuardWord.Replace(_T("\\"), _T("_")))
117
 
        ;
118
 
    XRCCTRL(*this, "txtGuardBlock", wxTextCtrl)->SetValue(GuardWord);
119
 
}
120
 
 
121
 
void ClassWizardDlg::DoFileNames()
122
 
{
123
 
    wxString name = XRCCTRL(*this, "txtName", wxTextCtrl)->GetValue();
124
 
    if (XRCCTRL(*this, "chkLowerCase", wxCheckBox)->GetValue())
125
 
        name.MakeLower();
126
 
 
127
 
    while (name.Replace(_T("::"), _T("/")))
128
 
        ;
129
 
 
130
 
    XRCCTRL(*this, "txtHeader", wxTextCtrl)->SetValue(name + _T(".h"));
131
 
    XRCCTRL(*this, "txtImplementation", wxTextCtrl)->SetValue(name + _T(".cpp"));
132
 
    XRCCTRL(*this, "txtHeaderInclude", wxTextCtrl)->SetValue(_T("\"") + name + _T(".h\""));
133
 
}
134
 
 
 
98
// ------
135
99
// events
 
100
// ------
136
101
 
137
102
void ClassWizardDlg::OnUpdateUI(wxUpdateUIEvent& WXUNUSED(event))
138
103
{
139
104
    bool inherits = XRCCTRL(*this, "chkInherits", wxCheckBox)->GetValue();
140
 
    XRCCTRL(*this, "txtInheritance", wxTextCtrl)->Enable(inherits);
 
105
    XRCCTRL(*this, "txtInheritance",         wxTextCtrl)->Enable(inherits);
141
106
    XRCCTRL(*this, "txtInheritanceFilename", wxTextCtrl)->Enable(inherits);
142
 
    XRCCTRL(*this, "cmbInheritanceScope", wxComboBox)->Enable(inherits);
 
107
    XRCCTRL(*this, "cmbInheritanceScope",    wxComboBox)->Enable(inherits);
143
108
 
144
109
    bool hasdestructor = XRCCTRL(*this, "chkHasDestructor", wxCheckBox)->GetValue();
145
110
    XRCCTRL(*this, "chkVirtualDestructor", wxCheckBox)->Enable(hasdestructor);
146
111
 
 
112
    bool memvars = (XRCCTRL(*this, "lstMemberVars", wxListBox)->GetCount()>0);
 
113
    XRCCTRL(*this, "btnRemoveMemberVar", wxButton)->Enable(memvars);
 
114
 
147
115
    bool genimpl = XRCCTRL(*this, "chkImplementation", wxCheckBox)->GetValue();
148
116
    XRCCTRL(*this, "txtImplementation", wxTextCtrl)->Enable(genimpl);
149
 
    XRCCTRL(*this, "txtHeaderInclude", wxTextCtrl)->Enable(genimpl);
 
117
    XRCCTRL(*this, "txtHeaderInclude",  wxTextCtrl)->Enable(genimpl);
150
118
 
151
119
    bool commonDir = XRCCTRL(*this, "chkCommonDir", wxCheckBox)->GetValue();
152
 
    XRCCTRL(*this, "txtImplDir", wxTextCtrl)->Enable(genimpl && !commonDir);
153
 
    XRCCTRL(*this, "btnImplDir", wxButton)->Enable(genimpl && !commonDir);
 
120
    XRCCTRL(*this, "txtImplDir",    wxTextCtrl)->Enable(genimpl && !commonDir);
 
121
    XRCCTRL(*this, "btnImplDir",    wxButton)->Enable(genimpl && !commonDir);
154
122
    XRCCTRL(*this, "txtIncludeDir", wxTextCtrl)->Enable(!commonDir);
155
123
    XRCCTRL(*this, "btnIncludeDir", wxButton)->Enable(!commonDir);
156
 
    XRCCTRL(*this, "txtCommonDir", wxTextCtrl)->Enable(commonDir);
157
 
    XRCCTRL(*this, "btnCommonDir", wxButton)->Enable(commonDir);
 
124
    XRCCTRL(*this, "txtCommonDir",  wxTextCtrl)->Enable(commonDir);
 
125
    XRCCTRL(*this, "btnCommonDir",  wxButton)->Enable(commonDir);
158
126
 
159
127
    bool genguard = XRCCTRL(*this, "chkGuardBlock", wxCheckBox)->GetValue();
160
128
    XRCCTRL(*this, "txtGuardBlock", wxTextCtrl)->Enable(genguard);
180
148
    DoGuardBlock();
181
149
}
182
150
 
 
151
void ClassWizardDlg::OnAddMemberVar(wxCommandEvent& event)
 
152
{
 
153
    wxString member = XRCCTRL(*this, "txtMemberVar",    wxTextCtrl)->GetValue();
 
154
    bool     getter = XRCCTRL(*this, "chkGetter",       wxCheckBox)->GetValue();
 
155
    bool     setter = XRCCTRL(*this, "chkSetter",       wxCheckBox)->GetValue();
 
156
 
 
157
    bool     noprfx = XRCCTRL(*this, "chkRemovePrefix", wxCheckBox)->GetValue();
 
158
    wxString prefix = XRCCTRL(*this, "txtPrefix",       wxTextCtrl)->GetValue();
 
159
 
 
160
    // Valid strings are f.ex.: unsigned int foo, wxString bar, ...
 
161
    wxString memtyp = member.BeforeLast(_T(' ')).Trim();
 
162
    wxString memvar = member.AfterLast(_T(' ')).Trim();
 
163
 
 
164
    if (memtyp.IsEmpty())
 
165
    {
 
166
        cbMessageBox(_T("Please specify a valid variable type to continue."),
 
167
                     _T("Error"), wxOK | wxICON_ERROR);
 
168
        return;
 
169
    }
 
170
 
 
171
    if (memvar.IsEmpty())
 
172
    {
 
173
        cbMessageBox(_T("Please specify a valid variable name to continue."),
 
174
                     _T("Error"), wxOK | wxICON_ERROR);
 
175
        return;
 
176
    }
 
177
 
 
178
    std::vector<MemberVar>::iterator it = m_MemberVars.begin();
 
179
    while( it != m_MemberVars.end() )
 
180
    {
 
181
        if (DoMemVarRepr((*it).Typ, (*it).Var) == DoMemVarRepr(memtyp, memvar))
 
182
        {
 
183
            cbMessageBox(_T("This variable does already exist."),
 
184
                         _T("Error"), wxOK | wxICON_ERROR);
 
185
            return;
 
186
        }
 
187
        it++;
 
188
    }
 
189
 
 
190
    wxString method = ( (noprfx && memvar.StartsWith(prefix)) ?
 
191
                        memvar.Right(memvar.Length()-prefix.Length()) :
 
192
                        memvar );
 
193
 
 
194
    MemberVar mv;
 
195
    mv.Typ = memtyp;
 
196
    mv.Var = memvar;
 
197
    if (getter) mv.Get = _T("Get") + method; else mv.Get = wxEmptyString;
 
198
    if (setter) mv.Set = _T("Set") + method; else mv.Set = wxEmptyString;
 
199
    m_MemberVars.push_back(mv);
 
200
 
 
201
    XRCCTRL(*this, "lstMemberVars", wxListBox)->Append(DoMemVarRepr(memtyp, memvar));
 
202
}
 
203
 
 
204
void ClassWizardDlg::OnRemoveMemberVar(wxCommandEvent& event)
 
205
{
 
206
    wxString selection = XRCCTRL(*this, "lstMemberVars", wxListBox)->GetStringSelection();
 
207
    if (selection.IsEmpty())
 
208
    {
 
209
        cbMessageBox(_T("Please select a variable to remove."),
 
210
                     _T("Error"), wxOK | wxICON_ERROR);
 
211
        return;
 
212
    }
 
213
 
 
214
    std::vector<MemberVar>::iterator it = m_MemberVars.begin();
 
215
    while( it != m_MemberVars.end() )
 
216
    {
 
217
        if (DoMemVarRepr((*it).Typ, (*it).Var) == selection)
 
218
        {
 
219
            m_MemberVars.erase(it);
 
220
            break; // end while loop
 
221
        }
 
222
        it++;
 
223
    }
 
224
 
 
225
    // Re-create the list box entries
 
226
    XRCCTRL(*this, "lstMemberVars", wxListBox)->Clear();
 
227
    it = m_MemberVars.begin();
 
228
    while( it != m_MemberVars.end() )
 
229
    {
 
230
        XRCCTRL(*this, "lstMemberVars", wxListBox)->Append(DoMemVarRepr((*it).Typ, (*it).Var));
 
231
        it++;
 
232
    }
 
233
}
 
234
 
183
235
void ClassWizardDlg::OnCommonDirClick(wxCommandEvent& WXUNUSED(event))
184
236
{
185
237
    wxString path = XRCCTRL(*this, "txtCommonDir", wxTextCtrl)->GetValue();
226
278
 
227
279
void ClassWizardDlg::OnOKClick(wxCommandEvent& WXUNUSED(event))
228
280
{
229
 
    // set some variable for easy reference
230
 
    wxString Name = XRCCTRL(*this, "txtName", wxTextCtrl)->GetValue();
231
 
    if (Name.IsEmpty())
 
281
    // Reset
 
282
    m_Header         = XRCCTRL(*this, "txtHeader", wxTextCtrl)->GetValue();
 
283
    m_Implementation = XRCCTRL(*this, "txtImplementation", wxTextCtrl)->GetValue();
 
284
 
 
285
    // obtain variable for easy reference
 
286
    m_Name      = XRCCTRL(*this, "txtName", wxTextCtrl)->GetValue();
 
287
    m_Arguments = XRCCTRL(*this, "txtArguments", wxTextCtrl)->GetValue();
 
288
    // Error check
 
289
    if (m_Name.IsEmpty())
232
290
    {
233
291
        cbMessageBox(_T("Please specify a class name to continue."),
234
292
                     _T("Error"), wxOK | wxICON_ERROR);
235
293
        return;
236
294
    }
237
 
    wxArrayString NameSpaces;
238
 
    wxStringTokenizer tkz(Name, _T("::"));
239
 
    Name = wxEmptyString;
 
295
    // Extract namespaces from class name
 
296
    wxStringTokenizer tkz(m_Name, _T("::"));
 
297
    m_Name = wxEmptyString;
240
298
    while ( tkz.HasMoreTokens() )
241
299
    {
242
 
        if (!Name.IsEmpty())
 
300
        // Store the old "class name" as (another) namespace
 
301
        if (!m_Name.IsEmpty())
243
302
        {
244
 
            NameSpaces.Add(Name);
 
303
            m_NameSpaces.Add(m_Name);
245
304
        }
246
 
        Name = tkz.GetNextToken();
247
 
    }
248
 
 
249
 
    wxString includeDir;
250
 
    wxString implDir;
251
 
 
252
 
    bool CommonDir = XRCCTRL(*this, "chkCommonDir", wxCheckBox)->GetValue();
253
 
    if (CommonDir)
254
 
    {
255
 
        includeDir = XRCCTRL(*this, "txtCommonDir", wxTextCtrl)->GetValue();
256
 
        implDir = XRCCTRL(*this, "txtCommonDir", wxTextCtrl)->GetValue();
257
 
    }
258
 
    else
259
 
    {
260
 
        includeDir = XRCCTRL(*this, "txtIncludeDir", wxTextCtrl)->GetValue();
261
 
        implDir = XRCCTRL(*this, "txtImplDir", wxTextCtrl)->GetValue();
262
 
    }
263
 
    //wxSetWorkingDirectory(baseDir);
264
 
    wxString Constructor = XRCCTRL(*this, "txtConstructor", wxTextCtrl)->GetValue();
265
 
    bool VirtualDestructor = XRCCTRL(*this, "chkVirtualDestructor", wxCheckBox)->GetValue();
266
 
    bool HasDestructor = XRCCTRL(*this, "chkHasDestructor", wxCheckBox)->GetValue();
267
 
    if (!HasDestructor)
268
 
    {
269
 
        VirtualDestructor = false;
270
 
    }
271
 
 
272
 
    wxString Ancestor = XRCCTRL(*this, "txtInheritance", wxTextCtrl)->GetValue();
273
 
    wxString AncestorFilename = XRCCTRL(*this, "txtInheritanceFilename", wxTextCtrl)->GetValue();
274
 
    wxString AncestorScope = XRCCTRL(*this, "cmbInheritanceScope", wxComboBox)->GetValue();
275
 
    bool Inherits = XRCCTRL(*this, "chkInherits", wxCheckBox)->GetValue() && !Ancestor.IsEmpty();
276
 
 
277
 
    m_Header = XRCCTRL(*this, "txtHeader", wxTextCtrl)->GetValue();
278
 
    m_Implementation = XRCCTRL(*this, "txtImplementation", wxTextCtrl)->GetValue();
279
 
    wxString headerInclude = XRCCTRL(*this, "txtHeaderInclude", wxTextCtrl)->GetValue();
280
 
    bool GenerateImplementation = XRCCTRL(*this, "chkImplementation", wxCheckBox)->GetValue();
281
 
    bool GuardBlock = XRCCTRL(*this, "chkGuardBlock", wxCheckBox)->GetValue();
282
 
    wxString GuardWord = XRCCTRL(*this, "txtGuardBlock", wxTextCtrl)->GetValue();
283
 
    if (GuardWord.IsEmpty())
284
 
    {
285
 
        DoGuardBlock();
286
 
    }
 
305
        // Stor the new "class name" as true class name
 
306
        m_Name = tkz.GetNextToken();
 
307
    }
 
308
 
 
309
    m_HasDestructor     = XRCCTRL(*this, "chkHasDestructor", wxCheckBox)->GetValue();
 
310
    m_VirtualDestructor = XRCCTRL(*this, "chkVirtualDestructor", wxCheckBox)->GetValue();
 
311
    m_HasCopyCtor       = XRCCTRL(*this, "chkHasCopyCtor", wxCheckBox)->GetValue();
 
312
    m_HasAssignmentOp   = XRCCTRL(*this, "chkHasAssignmentOp", wxCheckBox)->GetValue();
 
313
    if (!m_HasDestructor)
 
314
    {
 
315
        m_VirtualDestructor = false; // Fix error
 
316
    }
 
317
 
 
318
    m_Inherits         = XRCCTRL(*this, "chkInherits", wxCheckBox)->GetValue();
 
319
    m_Ancestor         = XRCCTRL(*this, "txtInheritance", wxTextCtrl)->GetValue();
 
320
    m_AncestorFilename = XRCCTRL(*this, "txtInheritanceFilename", wxTextCtrl)->GetValue();
 
321
    m_AncestorScope    = XRCCTRL(*this, "cmbInheritanceScope", wxComboBox)->GetValue();
 
322
    if (m_Ancestor.IsEmpty())
 
323
    {
 
324
        m_Inherits = false; // Fix error
 
325
    }
 
326
 
 
327
    m_Documentation = XRCCTRL(*this, "chkDocumentation", wxCheckBox)->GetValue();
 
328
 
 
329
    m_CommonDir = XRCCTRL(*this, "chkCommonDir", wxCheckBox)->GetValue();
 
330
    if (m_CommonDir)
 
331
    {
 
332
        m_IncludeDir = XRCCTRL(*this, "txtCommonDir", wxTextCtrl)->GetValue();
 
333
        m_ImplDir    = XRCCTRL(*this, "txtCommonDir", wxTextCtrl)->GetValue();
 
334
    }
 
335
    else
 
336
    {
 
337
        m_IncludeDir = XRCCTRL(*this, "txtIncludeDir", wxTextCtrl)->GetValue();
 
338
        m_ImplDir    = XRCCTRL(*this, "txtImplDir", wxTextCtrl)->GetValue();
 
339
    }
 
340
 
 
341
    m_GuardBlock = XRCCTRL(*this, "chkGuardBlock", wxCheckBox)->GetValue();
 
342
    m_GuardWord  = XRCCTRL(*this, "txtGuardBlock", wxTextCtrl)->GetValue();
 
343
    if (m_GuardWord.IsEmpty())
 
344
    {
 
345
        m_GuardBlock = false; // Fix error
 
346
    }
 
347
 
 
348
    m_GenerateImplementation = XRCCTRL(*this, "chkImplementation", wxCheckBox)->GetValue();
 
349
    m_HeaderInclude          = XRCCTRL(*this, "txtHeaderInclude", wxTextCtrl)->GetValue();
 
350
 
 
351
    // Common stuff
 
352
    bool usestabs = Manager::Get()->GetConfigManager(_T("editor"))->ReadBool(_T("/use_tab"),    false);
 
353
    int  tabsize  = Manager::Get()->GetConfigManager(_T("editor"))->ReadInt(_T("/tab_size"),    4);
 
354
    int  eolmode  = Manager::Get()->GetConfigManager(_T("editor"))->ReadInt(_T("/eol/eolmode"), 0);
 
355
 
 
356
    m_TabStr = usestabs ? wxString(_T("\t")) : wxString(_T(' '), tabsize);
 
357
    if (eolmode == 2)
 
358
    {
 
359
        m_EolStr = _T("\n");
 
360
    }
 
361
    else if (eolmode == 1)
 
362
    {
 
363
        m_EolStr = _T("\r");
 
364
    }
 
365
    else
 
366
    {
 
367
        m_EolStr = _T("\r\n");
 
368
    }
 
369
 
 
370
    // actual file creation starts here
 
371
    bool success = DoHeader();
 
372
    if (success)
 
373
    {
 
374
        if (m_GenerateImplementation)
 
375
            success = DoImpl();
 
376
    }
 
377
 
 
378
    if (success)
 
379
        EndModal(wxID_OK);
 
380
}
 
381
 
 
382
void ClassWizardDlg::OnCancelClick(wxCommandEvent& WXUNUSED(event))
 
383
{
 
384
    EndModal(wxID_CANCEL);
 
385
}
 
386
 
 
387
// -------
 
388
// methods
 
389
// -------
 
390
 
 
391
bool ClassWizardDlg::DoHeader()
 
392
{
 
393
    // Create the header file
287
394
    wxFileName headerFname(UnixFilename(m_Header));
288
 
    wxFileName implementationFname(UnixFilename(m_Implementation));
289
 
    headerFname.MakeAbsolute(includeDir);
290
 
    implementationFname.MakeAbsolute(implDir);
291
 
 
292
 
    bool usestabs = Manager::Get()->GetConfigManager(_T("editor"))->ReadBool(_T("/use_tab"), false);
293
 
    int tabsize = Manager::Get()->GetConfigManager(_T("editor"))->ReadInt(_T("/tab_size"), 4);
294
 
    int eolmode = Manager::Get()->GetConfigManager(_T("editor"))->ReadInt(_T("/eol/eolmode"), 0);
295
 
 
296
 
    ForceDirectory(headerFname);
 
395
    headerFname.MakeAbsolute(m_IncludeDir);
 
396
    DoForceDirectory(headerFname);
 
397
 
 
398
    // Create a new editor/file (probably based on a template setup by the user)
297
399
    cbEditor* new_ed = Manager::Get()->GetEditorManager()->New(headerFname.GetFullPath());
298
400
    if (!new_ed)
299
401
    {
300
 
        cbMessageBox(_T("Class wizard can't continue. Possibly the Header file name is invalid.\n"
 
402
        cbMessageBox(_T("Class wizard can't continue.\n"
 
403
                        "Possibly the header file name is invalid.\n"
301
404
                        "Please check the entered file name."),
302
405
                     _T("Error"), wxICON_ERROR);
303
 
        return;
 
406
        return false;
304
407
    }
 
408
 
 
409
    // Obtain the buffer of the new file and replace any macros that might exist
305
410
    wxString buffer = new_ed->GetControl()->GetText();
306
411
    Manager::Get()->GetMacrosManager()->ReplaceMacros(buffer);
307
412
 
308
 
    wxString tabstr = usestabs ? wxString(_T("\t")) : wxString(_T(' '),tabsize);
309
 
    wxString eolstr;
310
 
    if (eolmode == 2)
311
 
    {
312
 
        eolstr = _T("\n");
313
 
    }
314
 
    else if (eolmode == 1)
315
 
    {
316
 
        eolstr = _T("\r");
317
 
    }
318
 
    else
319
 
    {
320
 
        eolstr = _T("\r\n");
321
 
    }
322
 
 
323
 
    // actual creation starts here
324
413
    // let's start with the header file
325
 
    if (GuardBlock)
326
 
    {
327
 
        buffer << _T("#ifndef ") << GuardWord << eolstr;
328
 
        buffer << _T("#define ") << GuardWord << eolstr;
329
 
        buffer << eolstr;
330
 
    }
331
 
 
332
 
    if (!AncestorFilename.IsEmpty() && !AncestorFilename.IsSameAs(_T("<>")))
333
 
    {
334
 
        buffer << _T("#include ") << AncestorFilename << eolstr;
335
 
        buffer << eolstr;
336
 
    }
337
 
 
338
 
    for (unsigned int i=0; i<NameSpaces.GetCount(); ++i)
339
 
    {
340
 
        buffer << _T("namespace ") << NameSpaces[i] << _T(" {") << eolstr;
341
 
    }
342
 
    buffer << eolstr;
343
 
 
344
 
 
345
 
    buffer << _T("class ") << Name;
346
 
    if (Inherits)
347
 
    {
348
 
        buffer << _T(" : ") << AncestorScope << _T(" ") << Ancestor;
349
 
    }
350
 
    buffer << eolstr;
351
 
    buffer << _T("{") << eolstr;
352
 
    buffer << tabstr << _T("public:") << eolstr;
353
 
    buffer << tabstr << tabstr << Name << _T("(") << Constructor << _T(")");
354
 
    buffer << (!GenerateImplementation ? _T(" {}") : _T(";")) << eolstr;
355
 
 
356
 
    if (HasDestructor)
357
 
    {
358
 
        buffer << tabstr << tabstr;
359
 
        if (VirtualDestructor)
 
414
    if (m_GuardBlock)
 
415
    {
 
416
        buffer << _T("#ifndef ") << m_GuardWord << m_EolStr;
 
417
        buffer << _T("#define ") << m_GuardWord << m_EolStr;
 
418
        buffer << m_EolStr;
 
419
    }
 
420
 
 
421
    if (!m_AncestorFilename.IsEmpty() && !m_AncestorFilename.IsSameAs(_T("<>")))
 
422
    {
 
423
        buffer << _T("#include ") << m_AncestorFilename << m_EolStr;
 
424
        buffer << m_EolStr;
 
425
    }
 
426
 
 
427
    for (unsigned int i=0; i<m_NameSpaces.GetCount(); ++i)
 
428
    {
 
429
        buffer << _T("namespace ") << m_NameSpaces[i] << _T(" {") << m_EolStr;
 
430
    }
 
431
    buffer << m_EolStr;
 
432
 
 
433
    // Begin of class
 
434
    buffer << _T("class ") << m_Name;
 
435
    if (m_Inherits)
 
436
    {
 
437
        buffer << _T(" : ") << m_AncestorScope << _T(" ") << m_Ancestor;
 
438
    }
 
439
    buffer << m_EolStr;
 
440
    buffer << _T("{") << m_EolStr;
 
441
 
 
442
    // focus: public
 
443
    buffer << m_TabStr << _T("public:") << m_EolStr;
 
444
 
 
445
    // ctor
 
446
    if (m_Documentation)
 
447
    {
 
448
        buffer << m_TabStr << m_TabStr << _T("/** Default constructor */") << m_EolStr;
 
449
    }
 
450
    buffer << m_TabStr << m_TabStr << m_Name << _T("(") << m_Arguments << _T(")")
 
451
           << (!m_GenerateImplementation ? _T(" {}") : _T(";")) << m_EolStr;
 
452
 
 
453
    if (m_HasDestructor)
 
454
    {
 
455
        if (m_Documentation)
 
456
        {
 
457
            buffer << m_TabStr << m_TabStr << _T("/** Default destructor */") << m_EolStr;
 
458
        }
 
459
        buffer << m_TabStr << m_TabStr;
 
460
        if (m_VirtualDestructor)
360
461
        {
361
462
            buffer << _T("virtual ");
362
463
        }
363
 
        buffer << _T('~') << Name << _T("()");
364
 
        buffer << (!GenerateImplementation ? _T(" {}") : _T(";")) << eolstr;
365
 
    }
366
 
    buffer << tabstr << _T("protected:") << eolstr;
367
 
    buffer << tabstr << _T("private:") << eolstr;
368
 
    buffer << _T("};") << eolstr;
369
 
 
370
 
    if (NameSpaces.GetCount())
371
 
    {
372
 
        buffer << eolstr;
373
 
        for (int i=NameSpaces.GetCount(); i>0; --i)
374
 
        {
375
 
            buffer << _T("} // namespace ") << NameSpaces[i-1] << eolstr;
376
 
        }
377
 
    }
378
 
 
379
 
    if (GuardBlock)
380
 
    {
381
 
        buffer << eolstr;
382
 
        buffer << _T("#endif // ") << GuardWord << eolstr;
 
464
        buffer << _T('~') << m_Name << _T("()");
 
465
        buffer << (!m_GenerateImplementation ? _T(" {}") : _T(";")) << m_EolStr;
 
466
    }
 
467
 
 
468
    if (m_HasCopyCtor)
 
469
    {
 
470
        if (m_Documentation)
 
471
        {
 
472
            buffer << m_TabStr << m_TabStr
 
473
                   << _T("/** Copy constructor") << m_EolStr;
 
474
            buffer << m_TabStr << m_TabStr
 
475
                   << _T(" *  \\param other Object to copy from") << m_EolStr;
 
476
            buffer << m_TabStr << m_TabStr
 
477
                   << _T(" */") << m_EolStr;
 
478
        }
 
479
        buffer << m_TabStr << m_TabStr;
 
480
        buffer << m_Name << _T("(const ") << m_Name << _T("& other)");
 
481
        buffer << (!m_GenerateImplementation ? _T(" {}") : _T(";")) << m_EolStr;
 
482
    }
 
483
 
 
484
    if (m_HasAssignmentOp)
 
485
    {
 
486
        if (m_Documentation)
 
487
        {
 
488
            buffer << m_TabStr << m_TabStr
 
489
                   << _T("/** Assignment operator") << m_EolStr;
 
490
            buffer << m_TabStr << m_TabStr
 
491
                   << _T(" *  \\param other Object to assign from") << m_EolStr;
 
492
            buffer << m_TabStr << m_TabStr
 
493
                   << _T(" *  \\return A reference to this") << m_EolStr;
 
494
            buffer << m_TabStr << m_TabStr
 
495
                   << _T(" */") << m_EolStr;
 
496
        }
 
497
        buffer << m_TabStr << m_TabStr;
 
498
        buffer << m_Name << _T("& ") << _T("operator=(const ") << m_Name << _T("& other)");
 
499
        buffer << (!m_GenerateImplementation ? _T(" { return *this; }") : _T(";")) << m_EolStr;
 
500
    }
 
501
 
 
502
    std::vector<MemberVar>::iterator it = m_MemberVars.begin();
 
503
    while( it != m_MemberVars.end() )
 
504
    {
 
505
        if (!(*it).Get.IsEmpty())
 
506
        {
 
507
            if (m_Documentation)
 
508
            {
 
509
                buffer << m_TabStr << m_TabStr
 
510
                       << _T("/** Access ") << (*it).Var << m_EolStr;
 
511
                buffer << m_TabStr << m_TabStr
 
512
                       << _T(" * \\return The current value of ") << (*it).Var << m_EolStr;
 
513
                buffer << m_TabStr << m_TabStr
 
514
                       << _T(" */") << m_EolStr;
 
515
            }
 
516
            buffer << m_TabStr << m_TabStr << (*it).Typ << _T(" ") << (*it).Get
 
517
                   << _T("() { return ") << (*it).Var << _T("; }") << m_EolStr;
 
518
        }
 
519
        if (!(*it).Set.IsEmpty())
 
520
        {
 
521
            if (m_Documentation)
 
522
            {
 
523
                buffer << m_TabStr << m_TabStr
 
524
                       << _T("/** Set ") << (*it).Var << m_EolStr;
 
525
                buffer << m_TabStr << m_TabStr
 
526
                       << _T(" * \\param val New value to set") << m_EolStr;
 
527
                buffer << m_TabStr << m_TabStr
 
528
                       << _T(" */") << m_EolStr;
 
529
            }
 
530
            buffer << m_TabStr << m_TabStr << _T("void ") << (*it).Set << _T("(")
 
531
                   << (*it).Typ << _T(" val) { ") << (*it).Var << _T(" = val; }") << m_EolStr;
 
532
        }
 
533
        it++;
 
534
    }
 
535
 
 
536
    // focus: protected
 
537
    buffer << m_TabStr << _T("protected:") << m_EolStr;
 
538
    // focus: private
 
539
    buffer << m_TabStr << _T("private:") << m_EolStr;
 
540
 
 
541
    it = m_MemberVars.begin();
 
542
    while( it != m_MemberVars.end() )
 
543
    {
 
544
        buffer << m_TabStr << m_TabStr
 
545
               << (*it).Typ << _T(" ") << (*it).Var << _T(";");
 
546
        if (m_Documentation)
 
547
        {
 
548
            buffer << _T(" //!< Member variable \"") << (*it).Var << _T("\"");
 
549
        }
 
550
        buffer << m_EolStr;
 
551
        it++;
 
552
    }
 
553
 
 
554
    // End of class
 
555
    buffer << _T("};") << m_EolStr;
 
556
 
 
557
    if (m_NameSpaces.GetCount())
 
558
    {
 
559
        buffer << m_EolStr;
 
560
        for (int i=m_NameSpaces.GetCount(); i>0; --i)
 
561
        {
 
562
            buffer << _T("} // namespace ") << m_NameSpaces[i-1] << m_EolStr;
 
563
        }
 
564
    }
 
565
 
 
566
    if (m_GuardBlock)
 
567
    {
 
568
        buffer << m_EolStr;
 
569
        buffer << _T("#endif // ") << m_GuardWord << m_EolStr;
383
570
    }
384
571
 
385
572
    new_ed->GetControl()->SetText(buffer);
388
575
        wxString msg;
389
576
        msg.Printf(_("Could not save header file %s.\nAborting..."), headerFname.GetFullPath().c_str());
390
577
        cbMessageBox(msg, _("Error"), wxICON_ERROR);
391
 
        return;
392
 
    }
393
 
 
394
 
    if (!GenerateImplementation)
395
 
    {
396
 
        m_Header = headerFname.GetFullPath();
397
 
        m_Implementation = wxEmptyString;
398
 
        EndModal(wxID_OK);
399
 
        return;
400
 
    }
401
 
 
402
 
    // now the implementation file
403
 
    ForceDirectory(implementationFname);
404
 
    new_ed = Manager::Get()->GetEditorManager()->New(implementationFname.GetFullPath());
 
578
        return false;
 
579
    }
 
580
 
 
581
    m_Header = headerFname.GetFullPath();
 
582
 
 
583
    return true;
 
584
}
 
585
 
 
586
bool ClassWizardDlg::DoImpl()
 
587
{
 
588
    // Create the implementation file
 
589
    wxFileName implementationFname(UnixFilename(m_Implementation));
 
590
    implementationFname.MakeAbsolute(m_ImplDir);
 
591
    DoForceDirectory(implementationFname);
 
592
 
 
593
    // Create a new editor/file (probably based on a template setup by the user)
 
594
    cbEditor* new_ed = Manager::Get()->GetEditorManager()->New(implementationFname.GetFullPath());
405
595
    if (!new_ed)
406
596
    {
407
 
        cbMessageBox(_T("Class wizard can't continue. Possibly the Implementation file name is invalid.\n"
 
597
        cbMessageBox(_T("Class wizard can't continue.\n"
 
598
                        "Possibly the implementation file name is invalid.\n"
408
599
                        "Please check the entered file name."),
409
600
                     _T("Error"), wxICON_ERROR);
410
 
        return;
 
601
        return false;
411
602
    }
412
 
    buffer = new_ed->GetControl()->GetText();
 
603
 
 
604
    // Obtain the buffer of the new file and replace any macros that might exist
 
605
    wxString buffer = new_ed->GetControl()->GetText();
413
606
    Manager::Get()->GetMacrosManager()->ReplaceMacros(buffer);
414
607
 
415
 
    buffer << _T("#include ") << headerInclude << eolstr;
 
608
    buffer << _T("#include ") << m_HeaderInclude << m_EolStr;
416
609
 
417
 
    if (NameSpaces.GetCount())
 
610
    if (m_NameSpaces.GetCount())
418
611
    {
419
 
        buffer << eolstr;
420
 
        for (unsigned int i=0; i<NameSpaces.GetCount(); ++i)
 
612
        buffer << m_EolStr;
 
613
        for (unsigned int i=0; i<m_NameSpaces.GetCount(); ++i)
421
614
        {
422
 
            buffer << _T("namespace ") << NameSpaces[i] << _T(" {") << eolstr;
 
615
            buffer << _T("namespace ") << m_NameSpaces[i] << _T(" {") << m_EolStr;
423
616
        }
424
617
    }
425
618
 
426
 
    buffer << eolstr;
427
 
    buffer << Name << _T("::") << Name << _T("(") << Constructor << _T(")") << eolstr;
428
 
    buffer << _T("{") << eolstr;
429
 
    buffer << tabstr << _T("//ctor") << eolstr;
430
 
    buffer << _T("}") << eolstr;
431
 
 
432
 
    if (HasDestructor)
433
 
    {
434
 
        buffer << eolstr;
435
 
        buffer << Name << _T("::~") << Name << _T("()") << eolstr;
436
 
        buffer << _T("{") << eolstr;
437
 
        buffer << tabstr << _T("//dtor") << eolstr;
438
 
        buffer << _T("}") << eolstr;
439
 
    }
440
 
 
441
 
    if (NameSpaces.GetCount())
442
 
    {
443
 
        buffer << eolstr;
444
 
        for (int i=NameSpaces.GetCount(); i>0; --i)
 
619
    buffer << m_EolStr;
 
620
    buffer << m_Name << _T("::") << m_Name << _T("(") << m_Arguments << _T(")") << m_EolStr;
 
621
    buffer << _T("{") << m_EolStr;
 
622
    buffer << m_TabStr << _T("//ctor") << m_EolStr;
 
623
    buffer << _T("}") << m_EolStr;
 
624
 
 
625
    if (m_HasDestructor)
 
626
    {
 
627
        buffer << m_EolStr;
 
628
        buffer << m_Name << _T("::~") << m_Name << _T("()") << m_EolStr;
 
629
        buffer << _T("{") << m_EolStr;
 
630
        buffer << m_TabStr << _T("//dtor") << m_EolStr;
 
631
        buffer << _T("}") << m_EolStr;
 
632
    }
 
633
 
 
634
    if (m_HasCopyCtor)
 
635
    {
 
636
        buffer << m_EolStr;
 
637
        buffer << m_Name << _T("::") << m_Name << _T("(const ") << m_Name << _T("& other)") << m_EolStr;;
 
638
        buffer << _T("{") << m_EolStr;
 
639
        buffer << m_TabStr << _T("//copy ctor") << m_EolStr;
 
640
        buffer << _T("}") << m_EolStr;
 
641
    }
 
642
 
 
643
    if (m_HasAssignmentOp)
 
644
    {
 
645
        buffer << m_EolStr;
 
646
        buffer << m_Name << _T("& ") << m_Name << _T("::operator=(const ") << m_Name << _T("& rhs)") << m_EolStr;;
 
647
        buffer << _T("{") << m_EolStr;
 
648
        buffer << m_TabStr << _T("if (this == &rhs) return *this; // handle self assignment") << m_EolStr;
 
649
        buffer << m_TabStr << _T("//assignment operator") << m_EolStr;
 
650
        buffer << m_TabStr << _T("return *this;") << m_EolStr;
 
651
        buffer << _T("}") << m_EolStr;
 
652
    }
 
653
 
 
654
    if (m_NameSpaces.GetCount())
 
655
    {
 
656
        buffer << m_EolStr;
 
657
        for (int i=m_NameSpaces.GetCount(); i>0; --i)
445
658
        {
446
 
            buffer << _T("} // namespace ") << NameSpaces[i-1] << eolstr;
 
659
            buffer << _T("} // namespace ") << m_NameSpaces[i-1] << m_EolStr;
447
660
        }
448
661
    }
449
662
 
453
666
        wxString msg;
454
667
        msg.Printf(_("Could not save implementation file %s.\nAborting..."), implementationFname.GetFullPath().c_str());
455
668
        cbMessageBox(msg, _("Error"), wxICON_ERROR);
456
 
        return;
 
669
        return false;
457
670
    }
458
 
    m_Header = headerFname.GetFullPath();
 
671
 
459
672
    m_Implementation = implementationFname.GetFullPath();
460
673
 
461
 
    EndModal(wxID_OK);
462
 
}
463
 
 
464
 
void ClassWizardDlg::OnCancelClick(wxCommandEvent& WXUNUSED(event))
465
 
{
466
 
    EndModal(wxID_CANCEL);
 
674
    return true;
 
675
}
 
676
 
 
677
void ClassWizardDlg::DoGuardBlock()
 
678
{
 
679
    m_Header = XRCCTRL(*this, "txtHeader", wxTextCtrl)->GetValue();
 
680
    wxString GuardWord = m_Header;
 
681
    GuardWord.MakeUpper();
 
682
    while (GuardWord.Replace(_T("."), _T("_")))
 
683
        ;
 
684
    while (GuardWord.Replace(_T("/"), _T("_")))
 
685
        ;
 
686
    while (GuardWord.Replace(_T("\\"), _T("_")))
 
687
        ;
 
688
    XRCCTRL(*this, "txtGuardBlock", wxTextCtrl)->SetValue(GuardWord);
 
689
}
 
690
 
 
691
void ClassWizardDlg::DoFileNames()
 
692
{
 
693
    wxString name = XRCCTRL(*this, "txtName", wxTextCtrl)->GetValue();
 
694
    if (XRCCTRL(*this, "chkLowerCase", wxCheckBox)->GetValue())
 
695
        name.MakeLower();
 
696
 
 
697
    while (name.Replace(_T("::"), _T("/")))
 
698
        ;
 
699
 
 
700
    XRCCTRL(*this, "txtHeader", wxTextCtrl)->SetValue(name + _T(".h"));
 
701
    XRCCTRL(*this, "txtImplementation", wxTextCtrl)->SetValue(name + _T(".cpp"));
 
702
    XRCCTRL(*this, "txtHeaderInclude", wxTextCtrl)->SetValue(_T("\"") + name + _T(".h\""));
 
703
}
 
704
 
 
705
void ClassWizardDlg::DoForceDirectory(const wxFileName & filename)
 
706
{
 
707
    wxFileName parentname(filename);
 
708
    parentname.RemoveLastDir();
 
709
 
 
710
    if (filename != parentname)
 
711
        DoForceDirectory(parentname);
 
712
 
 
713
    if (!wxDirExists(filename.GetPath()))
 
714
        wxMkdir(filename.GetPath());
 
715
}
 
716
 
 
717
wxString ClassWizardDlg::DoMemVarRepr(const wxString & typ, const wxString & var)
 
718
{
 
719
    return (_T("[") + typ + _T("] : ") + var);
467
720
}