-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
38 lines (30 loc) · 1.24 KB
/
main.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
#include "main.h"
#include "tsnsoft.xpm" // Подключаем иконку
#include <locale>
#include <wx/intl.h>
// initialize the application
IMPLEMENT_APP(MainApp);
////////////////////////////////////////////////////////////////////////////////
// application class implementation
////////////////////////////////////////////////////////////////////////////////
bool MainApp::OnInit() {
SetTopWindow(new MainFrame(NULL));
GetTopWindow()->Show(); // Отображаем окно
GetTopWindow()->Center(); // Центрируем окно
return true;
}
////////////////////////////////////////////////////////////////////////////////
// main application frame implementation
////////////////////////////////////////////////////////////////////////////////
MainFrame::MainFrame(wxWindow* parent)
: MainFrameBase(parent) {
wxInitAllImageHandlers();
this->SetIcon(wxIcon(tsnsoft_xpm)); // Устанавливаем иконку для формы
std::srand(std::time(nullptr)); // Инициализация генератора случайных чисел
}
MainFrame::~MainFrame() {
}
// ЭТО НАША РЕАЛИЗАЦИЯ ОБРАБОТЧИКА ЗАКРЫТИЯ ФОРМЫ!
void MainFrame::OnCloseFrame(wxCloseEvent& event) {
Destroy();
}