File: newworkspacebasedlg.cpp

package info (click to toggle)
codelite 12.0+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 95,112 kB
  • sloc: cpp: 424,040; ansic: 18,284; php: 9,569; lex: 4,186; yacc: 2,820; python: 2,294; sh: 312; makefile: 51; xml: 13
file content (140 lines) | stat: -rw-r--r-- 6,501 bytes parent folder | download | duplicates (2)
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
137
138
139
140
//////////////////////////////////////////////////////////////////////
// This file was auto-generated by codelite's wxCrafter Plugin
// wxCrafter project file: new_workspace_dlg.wxcp
// Do not modify this file by hand!
//////////////////////////////////////////////////////////////////////

#include "newworkspacebasedlg.h"


// Declare the bitmap loading function
extern void wxCE428InitBitmapResources();

static bool bBitmapLoaded = false;


NewWorkspaceBase::NewWorkspaceBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
    : wxDialog(parent, id, title, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxCE428InitBitmapResources();
        bBitmapLoaded = true;
    }
    
    wxBoxSizer* bSizer1 = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(bSizer1);
    
    m_panelWorkspace = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(400,-1), wxTAB_TRAVERSAL);
    
    bSizer1->Add(m_panelWorkspace, 1, wxALL|wxEXPAND, 5);
    
    wxBoxSizer* bSizer2 = new wxBoxSizer(wxVERTICAL);
    m_panelWorkspace->SetSizer(bSizer2);
    
    wxFlexGridSizer* flexGridSizer9 = new wxFlexGridSizer(0, 2, 0, 0);
    flexGridSizer9->SetFlexibleDirection( wxBOTH );
    flexGridSizer9->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
    flexGridSizer9->AddGrowableCol(1);
    
    bSizer2->Add(flexGridSizer9, 0, wxALL|wxEXPAND, 5);
    
    m_staticText1 = new wxStaticText(m_panelWorkspace, wxID_ANY, _("Workspace Name:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    flexGridSizer9->Add(m_staticText1, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    m_textCtrlWorkspaceName = new wxTextCtrl(m_panelWorkspace, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
    m_textCtrlWorkspaceName->SetFocus();
    #if wxVERSION_NUMBER >= 3000
    m_textCtrlWorkspaceName->SetHint(wxT(""));
    #endif
    
    flexGridSizer9->Add(m_textCtrlWorkspaceName, 0, wxALL|wxEXPAND, 5);
    
    m_staticText3 = new wxStaticText(m_panelWorkspace, wxID_ANY, _("Workspace Path:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    flexGridSizer9->Add(m_staticText3, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    wxBoxSizer* bSizer3 = new wxBoxSizer(wxHORIZONTAL);
    
    flexGridSizer9->Add(bSizer3, 0, wxEXPAND, 5);
    
    wxArrayString m_comboBoxPathArr;
    m_comboBoxPath = new wxComboBox(m_panelWorkspace, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), m_comboBoxPathArr, 0);
    #if wxVERSION_NUMBER >= 3000
    m_comboBoxPath->SetHint(wxT(""));
    #endif
    
    bSizer3->Add(m_comboBoxPath, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5);
    
    m_buttonWorkspaceDirPicker = new wxButton(m_panelWorkspace, wxID_ANY, _("..."), wxDefaultPosition, wxSize(-1, -1), wxBU_EXACTFIT);
    m_buttonWorkspaceDirPicker->SetDefault();
    m_buttonWorkspaceDirPicker->SetToolTip(_("Browse for folder"));
    
    bSizer3->Add(m_buttonWorkspaceDirPicker, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
    
    wxStaticBoxSizer* sbSizer1 = new wxStaticBoxSizer( new wxStaticBox(m_panelWorkspace, wxID_ANY, _("Generated File:")), wxVERTICAL);
    
    bSizer2->Add(sbSizer1, 0, wxALL|wxEXPAND, 5);
    
    m_staticTextWorkspaceFileName = new wxStaticText(m_panelWorkspace, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
    
    sbSizer1->Add(m_staticTextWorkspaceFileName, 0, wxALL|wxEXPAND, 5);
    
    bSizer2->Add(0, 0, 1, wxALL, 5);
    
    m_checkBoxCreateSeparateDir = new wxCheckBox(m_panelWorkspace, wxID_ANY, _("Create the workspace under a separate directory"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_checkBoxCreateSeparateDir->SetValue(true);
    
    bSizer2->Add(m_checkBoxCreateSeparateDir, 0, wxALL|wxEXPAND, 5);
    
    m_stdBtnSizer2 = new wxStdDialogButtonSizer();
    
    bSizer2->Add(m_stdBtnSizer2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5);
    
    m_buttonOK = new wxButton(m_panelWorkspace, wxID_OK, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
    m_buttonOK->SetDefault();
    m_stdBtnSizer2->AddButton(m_buttonOK);
    
    m_buttonCancel = new wxButton(m_panelWorkspace, wxID_CANCEL, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
    m_stdBtnSizer2->AddButton(m_buttonCancel);
    m_stdBtnSizer2->Realize();
    
    SetName(wxT("NewWorkspaceBase"));
    SetSize(-1,-1);
    if (GetSizer()) {
         GetSizer()->Fit(this);
    }
    if(GetParent()) {
        CentreOnParent();
    } else {
        CentreOnScreen();
    }
#if wxVERSION_NUMBER >= 2900
    if(!wxPersistenceManager::Get().Find(this)) {
        wxPersistenceManager::Get().RegisterAndRestore(this);
    } else {
        wxPersistenceManager::Get().Restore(this);
    }
#endif
    // Connect events
    m_textCtrlWorkspaceName->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(NewWorkspaceBase::OnWorkspacePathUpdated), NULL, this);
    m_comboBoxPath->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(NewWorkspaceBase::OnWorkspacePathUpdated), NULL, this);
    m_buttonWorkspaceDirPicker->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(NewWorkspaceBase::OnWorkspaceDirPicker), NULL, this);
    m_checkBoxCreateSeparateDir->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(NewWorkspaceBase::OnWorkspacePathUpdated), NULL, this);
    m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(NewWorkspaceBase::OnButtonCreate), NULL, this);
    m_buttonOK->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(NewWorkspaceBase::OnOKUI), NULL, this);
    
}

NewWorkspaceBase::~NewWorkspaceBase()
{
    m_textCtrlWorkspaceName->Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(NewWorkspaceBase::OnWorkspacePathUpdated), NULL, this);
    m_comboBoxPath->Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(NewWorkspaceBase::OnWorkspacePathUpdated), NULL, this);
    m_buttonWorkspaceDirPicker->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(NewWorkspaceBase::OnWorkspaceDirPicker), NULL, this);
    m_checkBoxCreateSeparateDir->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(NewWorkspaceBase::OnWorkspacePathUpdated), NULL, this);
    m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(NewWorkspaceBase::OnButtonCreate), NULL, this);
    m_buttonOK->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(NewWorkspaceBase::OnOKUI), NULL, this);
    
}