Skip to content

Commit 03267cc

Browse files
committed
rev. 20250416104640
1 parent 0a6607e commit 03267cc

4 files changed

Lines changed: 19 additions & 36 deletions

File tree

CLEANING.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# Удаляем файлы с расширениями .bak, .sln, .vcxproj и другие
4+
for f in *.bak *.sln *.vcxproj *.vcxproj.user makefile.gcc Makefile linux_app *-autosave.pjd *.rc; do
5+
if [ -f "$f" ]; then
6+
rm -f "$f"
7+
fi
8+
done
9+
10+
# Удаляем директории, если они существуют
11+
for d in Debug MinGWUnicodeDebug MinGWUnicodeRelease Release; do
12+
if [ -d "$d" ]; then
13+
rm -rf "$d"
14+
fi
15+
done
16+
17+
echo "Cleaning of project configurations is completed."

DISTR/config.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
[Paths]
2-
CompilerFolder=D:\\Development\\RedPanda-CPP\\mingw64
32
WxWidgetsFolder=D:\\Development\\RedPanda-CPP\\wxWidgets
43
DevFile=D:\\Temp\\RPCPP_wxWidgets_Choice\\RPCPP_wxWidgets_Choice.dev

Source.cpp

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,8 @@ class MyFrame : public wxFrame {
2020
wxBoxSizer* panelSizer = new wxBoxSizer(wxVERTICAL);
2121

2222
// Поля для путей
23-
wxBoxSizer* compilerSizer = new wxBoxSizer(wxHORIZONTAL);
24-
compilerLabel = new wxStaticText(panel, wxID_ANY, wxT("Компилятор:"));
25-
compilerText = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(400, -1), wxTE_READONLY);
26-
compilerButton = new wxButton(panel, wxID_ANY, wxT("Выбрать..."), wxDefaultPosition, wxSize(100, -1));
27-
compilerSizer->Add(compilerLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
28-
compilerSizer->Add(compilerText, 1, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5); // Пропорция 1 для растяжки
29-
compilerSizer->Add(compilerButton, 0, wxALIGN_CENTER_VERTICAL);
30-
panelSizer->Add(compilerSizer, 0, wxEXPAND | wxALL, 5); // Добавлен wxEXPAND
31-
3223
wxBoxSizer* wxWidgetsSizer = new wxBoxSizer(wxHORIZONTAL);
33-
wxWidgetsLabel = new wxStaticText(panel, wxID_ANY, wxT("wxWidgets:"));
24+
wxWidgetsLabel = new wxStaticText(panel, wxID_ANY, wxT("Путь к wxWidgets:"));
3425
wxWidgetsText = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(400, -1), wxTE_READONLY);
3526
wxWidgetsButton = new wxButton(panel, wxID_ANY, wxT("Выбрать..."), wxDefaultPosition, wxSize(100, -1));
3627
wxWidgetsSizer->Add(wxWidgetsLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
@@ -60,17 +51,13 @@ class MyFrame : public wxFrame {
6051
LoadConfig();
6152

6253
// Привязка событий
63-
compilerButton->Bind(wxEVT_BUTTON, &MyFrame::OnSelectCompilerFolder, this);
6454
wxWidgetsButton->Bind(wxEVT_BUTTON, &MyFrame::OnSelectWxWidgetsFolder, this);
6555
devFileButton->Bind(wxEVT_BUTTON, &MyFrame::OnSelectDevFile, this);
6656
updateButton->Bind(wxEVT_BUTTON, &MyFrame::OnUpdateDevFile, this);
6757
}
6858

6959
private:
7060
wxString CONFIG_FILE; // Член класса
71-
wxStaticText* compilerLabel;
72-
wxTextCtrl* compilerText;
73-
wxButton* compilerButton;
7461
wxStaticText* wxWidgetsLabel;
7562
wxTextCtrl* wxWidgetsText;
7663
wxButton* wxWidgetsButton;
@@ -81,11 +68,8 @@ class MyFrame : public wxFrame {
8168

8269
void LoadConfig() {
8370
wxFileConfig config(wxEmptyString, wxEmptyString, CONFIG_FILE);
84-
wxString compilerFolder, wxWidgetsFolder, devFile;
71+
wxString wxWidgetsFolder, devFile;
8572

86-
if (config.Read(wxT("Paths/CompilerFolder"), &compilerFolder) && wxFileName::DirExists(compilerFolder)) {
87-
compilerText->SetValue(compilerFolder);
88-
}
8973
if (config.Read(wxT("Paths/WxWidgetsFolder"), &wxWidgetsFolder) && wxFileName::DirExists(wxWidgetsFolder)) {
9074
wxWidgetsText->SetValue(wxWidgetsFolder);
9175
}
@@ -96,20 +80,11 @@ class MyFrame : public wxFrame {
9680

9781
void SaveConfig() {
9882
wxFileConfig config(wxEmptyString, wxEmptyString, CONFIG_FILE);
99-
config.Write(wxT("Paths/CompilerFolder"), compilerText->GetValue());
10083
config.Write(wxT("Paths/WxWidgetsFolder"), wxWidgetsText->GetValue());
10184
config.Write(wxT("Paths/DevFile"), devFileText->GetValue());
10285
config.Flush();
10386
}
10487

105-
void OnSelectCompilerFolder(wxCommandEvent& event) {
106-
wxDirDialog dlg(this, wxT("Выберите папку с компилятором"), compilerText->GetValue(),
107-
wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST);
108-
if (dlg.ShowModal() == wxID_OK) {
109-
compilerText->SetValue(dlg.GetPath());
110-
}
111-
}
112-
11388
void OnSelectWxWidgetsFolder(wxCommandEvent& event) {
11489
wxDirDialog dlg(this, wxT("Выберите папку с wxWidgets"), wxWidgetsText->GetValue(),
11590
wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST);
@@ -131,10 +106,6 @@ class MyFrame : public wxFrame {
131106

132107
void OnUpdateDevFile(wxCommandEvent& event) {
133108
// Проверка заполненности полей
134-
if (compilerText->GetValue().IsEmpty()) {
135-
wxMessageBox(wxT("Пожалуйста, выберите папку компилятора."), wxT("Ошибка"), wxOK | wxICON_ERROR);
136-
return;
137-
}
138109
if (wxWidgetsText->GetValue().IsEmpty()) {
139110
wxMessageBox(wxT("Пожалуйста, выберите папку wxWidgets."), wxT("Ошибка"), wxOK | wxICON_ERROR);
140111
return;
@@ -145,10 +116,6 @@ class MyFrame : public wxFrame {
145116
}
146117

147118
// Проверка существования путей
148-
if (!wxFileName::DirExists(compilerText->GetValue())) {
149-
wxMessageBox(wxT("Папка компилятора не существует."), wxT("Ошибка"), wxOK | wxICON_ERROR);
150-
return;
151-
}
152119
if (!wxFileName::DirExists(wxWidgetsText->GetValue())) {
153120
wxMessageBox(wxT("Папка wxWidgets не существует."), wxT("Ошибка"), wxOK | wxICON_ERROR);
154121
return;

screenshot.png

-4.45 KB
Loading

0 commit comments

Comments
 (0)