1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// copyright : (C) 2008 by Eran Ifrah
// file name : pluginwizard_page1.cpp
//
// -------------------------------------------------------------------------
// A
// _____ _ _ _ _
// / __ \ | | | | (_) |
// | / \/ ___ __| | ___| | _| |_ ___
// | | / _ \ / _ |/ _ \ | | | __/ _ )
// | \__/\ (_) | (_| | __/ |___| | || __/
// \____/\___/ \__,_|\___\_____/_|\__\___|
//
// F i l e
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 26 2007)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "pluginwizard_page1.h"
#include "wx/msgdlg.h"
///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE(PluginWizardPage1, wxWizardPageSimple)
EVT_WIZARD_PAGE_CHANGING(wxID_ANY, PluginWizardPage1::OnValidate)
END_EVENT_TABLE()
PluginWizardPage1::PluginWizardPage1( wxWizard* parent)
: wxWizardPageSimple(parent)
{
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer( wxVERTICAL );
m_staticText5 = new wxStaticText( this, wxID_ANY, wxT("General Information:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText5->Wrap( -1 );
bSizer1->Add( m_staticText5, 0, wxALL, 5 );
m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizer1->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
m_staticText1 = new wxStaticText( this, wxID_ANY, wxT("Plugin Name:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 );
bSizer1->Add( m_staticText1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_textCtrlPluginName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizer1->Add( m_textCtrlPluginName, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticText3 = new wxStaticText( this, wxID_ANY, wxT("Description:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
bSizer1->Add( m_staticText3, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_textCtrlDescription = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizer1->Add( m_textCtrlDescription, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
this->SetSizer( bSizer1 );
this->Layout();
}
void PluginWizardPage1::OnValidate(wxWizardEvent &event)
{
wxString name = GetName();
name = name.Trim().Trim(false);
//we dont accept empty plugin names
if(name.IsEmpty()){
wxMessageBox(_("Missing plugin name"), wxT("CodeLite"), wxOK | wxICON_WARNING);
event.Veto();
return;
}
//a valid name must contains only
//[A-Za-z_]
if(name.find_first_not_of(wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_")) != wxString::npos){
wxMessageBox(_("Invalid characters in plugin name\nonly [A-Za-z_] are allowed"), wxT("CodeLite"), wxOK | wxICON_WARNING);
event.Veto();
return;
}
event.Skip();
}
|