-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (31 loc) · 1.05 KB
/
main.cpp
File metadata and controls
36 lines (31 loc) · 1.05 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
/////////////////////////////////////////////////////////////////////////////
// Name: main.cpp
// Purpose: Main application file
// Author: Jan Buchholz
// Created: 2025-11-12
/////////////////////////////////////////////////////////////////////////////
#include <wx/wx.h>
#include <wx/stdpaths.h>
#include "mainwindow.h"
class MyApp final : public wxApp {
public:
bool OnInit() override;
wxLocale m_locale;
};
bool MyApp::OnInit() {
auto lang = static_cast<wxLanguage>(wxLocale::GetSystemLanguage());
if (lang >= wxLANGUAGE_GERMAN && lang <= wxLANGUAGE_GERMAN_SWISS)
{
if (m_locale.Init(lang, wxLOCALE_LOAD_DEFAULT)) {
wxStandardPaths& stdPaths = wxStandardPaths::Get();
wxLocale::AddCatalogLookupPathPrefix(stdPaths.GetResourcesDir());
m_locale.AddCatalog("wxTranslate_DE");
}
}
wxImage::AddHandler(new wxPNGHandler());
auto* wnd = new MainWindow();
wnd->Show(true);
wnd->m_appSettings->loadPreferences();
return true;
}
wxIMPLEMENT_APP(MyApp);