forked from eranif/codelite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgizmos_base.cpp
136 lines (99 loc) · 5.98 KB
/
gizmos_base.cpp
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
//////////////////////////////////////////////////////////////////////
// This file was auto-generated by codelite's wxCrafter Plugin
// wxCrafter project file: gizmos.wxcp
// Do not modify this file by hand!
//////////////////////////////////////////////////////////////////////
#include "gizmos_base.h"
// Declare the bitmap loading function
extern void wxC8028InitBitmapResources();
static bool bBitmapLoaded = false;
PluginWizardBase::PluginWizardBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxBitmap& bmp, const wxPoint& pos, long style)
{
if ( !bBitmapLoaded ) {
// We need to initialise the default bitmap handler
wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
wxC8028InitBitmapResources();
bBitmapLoaded = true;
}
Create(parent, id, title, wxXmlResource::Get()->LoadBitmap(wxT("plugin")), pos, style);
m_wizardPage1 = new wxWizardPageSimple(this, NULL, NULL, wxNullBitmap);
m_pages.push_back(m_wizardPage1);
wxBoxSizer* boxSizer10 = new wxBoxSizer(wxVERTICAL);
m_wizardPage1->SetSizer(boxSizer10);
wxFlexGridSizer* flexGridSizer12 = new wxFlexGridSizer(0, 2, 0, 0);
flexGridSizer12->SetFlexibleDirection( wxBOTH );
flexGridSizer12->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
flexGridSizer12->AddGrowableCol(1);
boxSizer10->Add(flexGridSizer12, 1, wxALL|wxEXPAND, 5);
m_staticText14 = new wxStaticText(m_wizardPage1, wxID_ANY, _("Plugin name:"), wxDefaultPosition, wxSize(-1,-1), 0);
flexGridSizer12->Add(m_staticText14, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
m_textCtrlName = new wxTextCtrl(m_wizardPage1, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
m_textCtrlName->SetToolTip(_("Set the plugin name.\nThe name should be a valid C++ variable name"));
m_textCtrlName->SetFocus();
#if wxVERSION_NUMBER >= 3000
m_textCtrlName->SetHint(wxT(""));
#endif
flexGridSizer12->Add(m_textCtrlName, 0, wxALL|wxEXPAND, 5);
m_staticText18 = new wxStaticText(m_wizardPage1, wxID_ANY, _("Description:"), wxDefaultPosition, wxSize(-1,-1), 0);
flexGridSizer12->Add(m_staticText18, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
m_textCtrlDescription = new wxTextCtrl(m_wizardPage1, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
m_textCtrlDescription->SetToolTip(_("Provide the plugin a short description"));
#if wxVERSION_NUMBER >= 3000
m_textCtrlDescription->SetHint(wxT(""));
#endif
flexGridSizer12->Add(m_textCtrlDescription, 0, wxALL|wxEXPAND, 5);
m_wizardPage2 = new wxWizardPageSimple(this, NULL, NULL, wxNullBitmap);
m_pages.push_back(m_wizardPage2);
if (m_pages.size() > 1) {
for(size_t i=1; i<m_pages.size(); i++) {
wxWizardPageSimple::Chain(m_pages.at(i-1), m_pages.at(i));
}
}
GetPageAreaSizer()->Add(m_pages.at(0));
wxBoxSizer* boxSizer22 = new wxBoxSizer(wxVERTICAL);
m_wizardPage2->SetSizer(boxSizer22);
wxFlexGridSizer* flexGridSizer24 = new wxFlexGridSizer(0, 2, 0, 0);
flexGridSizer24->SetFlexibleDirection( wxBOTH );
flexGridSizer24->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
flexGridSizer24->AddGrowableCol(1);
boxSizer22->Add(flexGridSizer24, 1, wxALL|wxEXPAND, 5);
m_staticText42 = new wxStaticText(m_wizardPage2, wxID_ANY, _("codelite root dir:"), wxDefaultPosition, wxSize(-1,-1), 0);
flexGridSizer24->Add(m_staticText42, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
m_dirPickerCodeliteDir = new wxDirPickerCtrl(m_wizardPage2, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxSize(-1,-1), wxDIRP_DEFAULT_STYLE|wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST);
m_dirPickerCodeliteDir->SetToolTip(_("Select the location of codelite's source tree"));
flexGridSizer24->Add(m_dirPickerCodeliteDir, 0, wxALL|wxEXPAND, 5);
m_staticText26 = new wxStaticText(m_wizardPage2, wxID_ANY, _("Project path:"), wxDefaultPosition, wxSize(-1,-1), 0);
flexGridSizer24->Add(m_staticText26, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
m_dirPickerPluginPath = new wxDirPickerCtrl(m_wizardPage2, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxSize(350,-1), wxDIRP_DEFAULT_STYLE|wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST);
m_dirPickerPluginPath->SetToolTip(_("Select the plugin project path"));
flexGridSizer24->Add(m_dirPickerPluginPath, 0, wxALL|wxEXPAND, 5);
flexGridSizer24->Add(0, 0, 1, wxALL, 5);
m_textCtrlPreview = new wxTextCtrl(m_wizardPage2, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), wxTE_READONLY);
#if wxVERSION_NUMBER >= 3000
m_textCtrlPreview->SetHint(wxT(""));
#endif
flexGridSizer24->Add(m_textCtrlPreview, 0, wxALL|wxEXPAND, 5);
SetName(wxT("PluginWizardBase"));
SetSizeHints(-1,-1);
if ( GetSizer() ) {
GetSizer()->Fit(this);
}
CentreOnParent(wxBOTH);
#if wxVERSION_NUMBER >= 2900
if(!wxPersistenceManager::Get().Find(this)) {
wxPersistenceManager::Get().RegisterAndRestore(this);
} else {
wxPersistenceManager::Get().Restore(this);
}
#endif
// Connect events
this->Connect(wxEVT_WIZARD_PAGE_CHANGING, wxWizardEventHandler(PluginWizardBase::OnPageChanging), NULL, this);
this->Connect(wxEVT_WIZARD_FINISHED, wxWizardEventHandler(PluginWizardBase::OnFinish), NULL, this);
m_dirPickerPluginPath->Connect(wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler(PluginWizardBase::OnProjectPathChanged), NULL, this);
}
PluginWizardBase::~PluginWizardBase()
{
this->Disconnect(wxEVT_WIZARD_PAGE_CHANGING, wxWizardEventHandler(PluginWizardBase::OnPageChanging), NULL, this);
this->Disconnect(wxEVT_WIZARD_FINISHED, wxWizardEventHandler(PluginWizardBase::OnFinish), NULL, this);
m_dirPickerPluginPath->Disconnect(wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler(PluginWizardBase::OnProjectPathChanged), NULL, this);
}