File: tabgroupbasedlgs.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 (216 lines) | stat: -rw-r--r-- 9,526 bytes parent folder | download
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
//////////////////////////////////////////////////////////////////////
// This file was auto-generated by codelite's wxCrafter Plugin
// wxCrafter project file: tabgroupbasedlgs.wxcp
// Do not modify this file by hand!
//////////////////////////////////////////////////////////////////////

#include "tabgroupbasedlgs.h"


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

static bool bBitmapLoaded = false;


LoadTabGroupBaseDlg::LoadTabGroupBaseDlg(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);
        wxCrafterVGyK6QInitBitmapResources();
        bBitmapLoaded = true;
    }
    
    wxBoxSizer* mainsizer = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(mainsizer);
    
    wxBoxSizer* bSizer2 = new wxBoxSizer(wxVERTICAL);
    
    mainsizer->Add(bSizer2, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5));
    
    wxBoxSizer* bSizer3 = new wxBoxSizer(wxHORIZONTAL);
    
    bSizer2->Add(bSizer3, 0, wxEXPAND, WXC_FROM_DIP(5));
    
    m_staticText1 = new wxStaticText(this, wxID_ANY, _("Select a tab group, or browse for one"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    
    bSizer3->Add(m_staticText1, 1, wxALL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));
    
    m_buttonBrowse = new wxButton(this, wxID_ANY, _("..."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_buttonBrowse->SetToolTip(_("Click to search for other groups"));
    
    bSizer3->Add(m_buttonBrowse, 0, wxALL, WXC_FROM_DIP(5));
    
    wxArrayString m_listBoxArr;
    m_listBox = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), m_listBoxArr, 0);
    m_listBox->SetToolTip(_("Double-click to choose one of these groups"));
    
    bSizer2->Add(m_listBox, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5));
    m_listBox->SetMinSize(wxSize(450,100));
    
    m_replaceCheck = new wxCheckBox(this, wxID_ANY, _("Replace current tabs"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_replaceCheck->SetValue(false);
    m_replaceCheck->SetToolTip(_("By default, the tabs of this group will be added to the current tabs. Tick this to replace the current tabs instead."));
    
    bSizer2->Add(m_replaceCheck, 0, wxALL, WXC_FROM_DIP(5));
    
    wxBoxSizer* bSizer11 = new wxBoxSizer(wxHORIZONTAL);
    
    bSizer2->Add(bSizer11, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(5));
    
    m_button6 = new wxButton(this, wxID_OK, _("&Ok"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_button6->SetDefault();
    
    bSizer11->Add(m_button6, 0, wxALL, WXC_FROM_DIP(5));
    
    m_button5 = new wxButton(this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    
    bSizer11->Add(m_button5, 0, wxALL, WXC_FROM_DIP(5));
    
    SetName(wxT("LoadTabGroupBaseDlg"));
    SetSize(-1,-1);
    if (GetSizer()) {
         GetSizer()->Fit(this);
    }
    if(GetParent()) {
        CentreOnParent(wxBOTH);
    } else {
        CentreOnScreen(wxBOTH);
    }
#if wxVERSION_NUMBER >= 2900
    if(!wxPersistenceManager::Get().Find(this)) {
        wxPersistenceManager::Get().RegisterAndRestore(this);
    } else {
        wxPersistenceManager::Get().Restore(this);
    }
#endif
    // Connect events
    m_buttonBrowse->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(LoadTabGroupBaseDlg::OnBrowse), NULL, this);
    m_listBox->Connect(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler(LoadTabGroupBaseDlg::OnItemActivated), NULL, this);
    
}

LoadTabGroupBaseDlg::~LoadTabGroupBaseDlg()
{
    m_buttonBrowse->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(LoadTabGroupBaseDlg::OnBrowse), NULL, this);
    m_listBox->Disconnect(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler(LoadTabGroupBaseDlg::OnItemActivated), NULL, this);
    
}

SaveTabGroupBaseDlg::SaveTabGroupBaseDlg(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);
        wxCrafterVGyK6QInitBitmapResources();
        bBitmapLoaded = true;
    }
    
    wxBoxSizer* mainsizer = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(mainsizer);
    
    wxBoxSizer* bSizer1 = new wxBoxSizer(wxVERTICAL);
    
    mainsizer->Add(bSizer1, 1, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, WXC_FROM_DIP(5));
    
    m_staticText1 = new wxStaticText(this, wxID_ANY, _("Select which tabs you want to be in the group"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    
    bSizer1->Add(m_staticText1, 0, wxALL, WXC_FROM_DIP(5));
    
    wxBoxSizer* bSizer3 = new wxBoxSizer(wxHORIZONTAL);
    
    bSizer1->Add(bSizer3, 1, wxALL|wxEXPAND, WXC_FROM_DIP(0));
    
    wxArrayString m_ListTabsArr;
    m_ListTabs = new wxCheckListBox(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), m_ListTabsArr, 0);
    
    bSizer3->Add(m_ListTabs, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5));
    m_ListTabs->SetMinSize(wxSize(400,-1));
    
    wxBoxSizer* bSizer13 = new wxBoxSizer(wxVERTICAL);
    
    bSizer3->Add(bSizer13, 0, wxALL, WXC_FROM_DIP(5));
    
    m_buttonCheckAll = new wxButton(this, wxID_ANY, _("Check All"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_buttonCheckAll->SetToolTip(_("Click to select all items"));
    
    bSizer13->Add(m_buttonCheckAll, 0, wxALL, WXC_FROM_DIP(5));
    
    m_buttonClearAll = new wxButton(this, wxID_ANY, _("Clear All"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_buttonClearAll->SetToolTip(_("Click to clear all items"));
    
    bSizer13->Add(m_buttonClearAll, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(5));
    
    wxBoxSizer* bSizer10 = new wxBoxSizer(wxVERTICAL);
    
    bSizer1->Add(bSizer10, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5));
    
    m_staticText4 = new wxStaticText(this, wxID_ANY, _("Choose a name for the group:"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    
    bSizer10->Add(m_staticText4, 0, wxALL|wxALIGN_LEFT, WXC_FROM_DIP(5));
    
    m_textName = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    #if wxVERSION_NUMBER >= 3000
    m_textName->SetHint(wxT(""));
    #endif
    
    bSizer10->Add(m_textName, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5));
    
    wxArrayString m_radioBoxWorkspaceOrGlobalArr;
    m_radioBoxWorkspaceOrGlobalArr.Add(_("Workspace"));
    m_radioBoxWorkspaceOrGlobalArr.Add(_("Global"));
    m_radioBoxWorkspaceOrGlobal = new wxRadioBox(this, wxID_ANY, _("Save in the current Workspace, or Globally"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), m_radioBoxWorkspaceOrGlobalArr, 1, wxRA_SPECIFY_ROWS);
    m_radioBoxWorkspaceOrGlobal->SetToolTip(_("Tabgroups are usually specific to a single workspace. However if you want to use one in multiple workspaces, or when a workspace is not open, save it globally."));
    m_radioBoxWorkspaceOrGlobal->SetSelection(0);
    
    bSizer10->Add(m_radioBoxWorkspaceOrGlobal, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5));
    
    wxBoxSizer* bSizer11 = new wxBoxSizer(wxHORIZONTAL);
    
    bSizer1->Add(bSizer11, 0, wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(5));
    
    m_button6 = new wxButton(this, wxID_OK, _("&Ok"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_button6->SetDefault();
    
    bSizer11->Add(m_button6, 0, wxALL, WXC_FROM_DIP(5));
    
    m_button5 = new wxButton(this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    
    bSizer11->Add(m_button5, 0, wxALL, WXC_FROM_DIP(5));
    
    SetName(wxT("SaveTabGroupBaseDlg"));
    SetSize(-1,-1);
    if (GetSizer()) {
         GetSizer()->Fit(this);
    }
    if(GetParent()) {
        CentreOnParent(wxBOTH);
    } else {
        CentreOnScreen(wxBOTH);
    }
#if wxVERSION_NUMBER >= 2900
    if(!wxPersistenceManager::Get().Find(this)) {
        wxPersistenceManager::Get().RegisterAndRestore(this);
    } else {
        wxPersistenceManager::Get().Restore(this);
    }
#endif
    // Connect events
    m_buttonCheckAll->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SaveTabGroupBaseDlg::OnCheckAll), NULL, this);
    m_buttonCheckAll->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SaveTabGroupBaseDlg::OnCheckAllUpdateUI), NULL, this);
    m_buttonClearAll->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SaveTabGroupBaseDlg::OnClearAll), NULL, this);
    m_buttonClearAll->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SaveTabGroupBaseDlg::OnClearAllUpdateUI), NULL, this);
    
}

SaveTabGroupBaseDlg::~SaveTabGroupBaseDlg()
{
    m_buttonCheckAll->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SaveTabGroupBaseDlg::OnCheckAll), NULL, this);
    m_buttonCheckAll->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SaveTabGroupBaseDlg::OnCheckAllUpdateUI), NULL, this);
    m_buttonClearAll->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SaveTabGroupBaseDlg::OnClearAll), NULL, this);
    m_buttonClearAll->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SaveTabGroupBaseDlg::OnClearAllUpdateUI), NULL, this);
    
}