forked from eranif/codelite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodeformatterdlgbase.cpp
More file actions
138 lines (106 loc) · 5.89 KB
/
Copy pathcodeformatterdlgbase.cpp
File metadata and controls
138 lines (106 loc) · 5.89 KB
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
//////////////////////////////////////////////////////////////////////
// This file was auto-generated by codelite's wxCrafter Plugin
// wxCrafter project file: codeformatterdlg.wxcp
// Do not modify this file by hand!
//////////////////////////////////////////////////////////////////////
#include "codeformatterdlgbase.h"
// Declare the bitmap loading function
extern void wxCrafterGgLOZbInitBitmapResources();
namespace
{
// return the wxBORDER_SIMPLE that matches the current application theme
wxBorder get_border_simple_theme_aware_bit()
{
#if wxVERSION_NUMBER >= 3300 && defined(__WXMSW__)
return wxSystemSettings::GetAppearance().IsDark() ? wxBORDER_SIMPLE : wxBORDER_DEFAULT;
#else
return wxBORDER_DEFAULT;
#endif
} // DoGetBorderSimpleBit
bool bBitmapLoaded = false;
} // namespace
CodeFormatterBaseDlg::CodeFormatterBaseDlg(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);
wxCrafterGgLOZbInitBitmapResources();
bBitmapLoaded = true;
}
wxBoxSizer* bSizerMain = new wxBoxSizer(wxVERTICAL);
this->SetSizer(bSizerMain);
m_mainPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxTAB_TRAVERSAL);
bSizerMain->Add(m_mainPanel, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));
wxBoxSizer* boxSizer359 = new wxBoxSizer(wxVERTICAL);
m_mainPanel->SetSizer(boxSizer359);
wxFlexGridSizer* flexGridSizer389 = new wxFlexGridSizer(0, 3, 0, 0);
flexGridSizer389->SetFlexibleDirection(wxBOTH);
flexGridSizer389->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
flexGridSizer389->AddGrowableCol(1);
flexGridSizer389->AddGrowableRow(0);
boxSizer359->Add(flexGridSizer389, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));
m_dvListCtrl =
new clThemedOrderedListCtrl(m_mainPanel, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_mainPanel, wxSize(150, -1)),
wxDV_NO_HEADER | wxDV_ROW_LINES | wxDV_SINGLE);
flexGridSizer389->Add(m_dvListCtrl, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));
m_dvListCtrl->AppendTextColumn(_("name"), wxDATAVIEW_CELL_INERT, WXC_FROM_DIP(-2), wxALIGN_LEFT, 0);
boxSizerFormatter = new wxBoxSizer(wxVERTICAL);
flexGridSizer389->Add(boxSizerFormatter, 1, wxEXPAND, WXC_FROM_DIP(5));
wxBoxSizer* boxSizer390 = new wxBoxSizer(wxVERTICAL);
flexGridSizer389->Add(boxSizer390, 0, wxEXPAND, WXC_FROM_DIP(5));
m_button_new =
new wxButton(m_mainPanel, wxID_NEW, _("&New"), wxDefaultPosition, wxDLG_UNIT(m_mainPanel, wxSize(-1, -1)), 0);
boxSizer390->Add(m_button_new, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));
m_button_delete = new wxButton(m_mainPanel, wxID_DELETE, _("&Delete"), wxDefaultPosition,
wxDLG_UNIT(m_mainPanel, wxSize(-1, -1)), 0);
boxSizer390->Add(m_button_delete, 0, wxALL, WXC_FROM_DIP(5));
m_staticLine392 = new wxStaticLine(m_mainPanel, wxID_ANY, wxDefaultPosition,
wxDLG_UNIT(m_mainPanel, wxSize(-1, -1)), wxLI_HORIZONTAL);
boxSizer390->Add(m_staticLine392, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));
m_button_revert = new wxButton(m_mainPanel, wxID_REVERT, _("Defaults"), wxDefaultPosition,
wxDLG_UNIT(m_mainPanel, wxSize(-1, -1)), 0);
m_button_revert->SetToolTip(_("Revert all changes and load factory defaults"));
boxSizer390->Add(m_button_revert, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));
wxBoxSizer* boxSizer371 = new wxBoxSizer(wxHORIZONTAL);
boxSizer359->Add(boxSizer371, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(5));
m_button_ok =
new wxButton(m_mainPanel, wxID_OK, _("&OK"), wxDefaultPosition, wxDLG_UNIT(m_mainPanel, wxSize(-1, -1)), 0);
m_button_ok->SetDefault();
boxSizer371->Add(m_button_ok, 0, wxALL, WXC_FROM_DIP(5));
m_button_cancel = new wxButton(m_mainPanel, wxID_CANCEL, _("Cancel"), wxDefaultPosition,
wxDLG_UNIT(m_mainPanel, wxSize(-1, -1)), 0);
boxSizer371->Add(m_button_cancel, 0, wxALL, WXC_FROM_DIP(5));
SetName(wxT("CodeFormatterBaseDlg"));
SetSize(wxDLG_UNIT(this, wxSize(-1, -1)));
if (GetSizer()) {
GetSizer()->Fit(this);
}
if (GetParent()) {
CentreOnParent(wxBOTH);
} else {
CentreOnScreen(wxBOTH);
}
if (!wxPersistenceManager::Get().Find(this)) {
wxPersistenceManager::Get().RegisterAndRestore(this);
} else {
wxPersistenceManager::Get().Restore(this);
}
// Connect events
m_dvListCtrl->Bind(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, &CodeFormatterBaseDlg::OnSelectionChanged, this);
m_button_new->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &CodeFormatterBaseDlg::OnNew, this);
m_button_delete->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &CodeFormatterBaseDlg::OnDelete, this);
m_button_delete->Bind(wxEVT_UPDATE_UI, &CodeFormatterBaseDlg::OnDeleteUI, this);
m_button_revert->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &CodeFormatterBaseDlg::OnRevert, this);
m_button_ok->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &CodeFormatterBaseDlg::OnOK, this);
}
CodeFormatterBaseDlg::~CodeFormatterBaseDlg()
{
m_dvListCtrl->Unbind(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, &CodeFormatterBaseDlg::OnSelectionChanged, this);
m_button_new->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &CodeFormatterBaseDlg::OnNew, this);
m_button_delete->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &CodeFormatterBaseDlg::OnDelete, this);
m_button_delete->Unbind(wxEVT_UPDATE_UI, &CodeFormatterBaseDlg::OnDeleteUI, this);
m_button_revert->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &CodeFormatterBaseDlg::OnRevert, this);
m_button_ok->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &CodeFormatterBaseDlg::OnOK, this);
}