From 2bfb6cffd86cb771918dde12e10704384d534714 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 27 Jul 2016 16:16:29 -0300 Subject: Projeto base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nenhum código implementado ainda. --- Project/main.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Project/main.cpp (limited to 'Project/main.cpp') diff --git a/Project/main.cpp b/Project/main.cpp new file mode 100644 index 0000000..81dccbc --- /dev/null +++ b/Project/main.cpp @@ -0,0 +1,25 @@ +#include +#include +#include "MainFrame.h" +#include + +// Define the MainApp +class MainApp : public wxApp +{ +public: + MainApp() {} + virtual ~MainApp() {} + + virtual bool OnInit() { + // Add the common image handlers + wxImage::AddHandler( new wxPNGHandler ); + wxImage::AddHandler( new wxJPEGHandler ); + + MainFrame *mainFrame = new MainFrame(NULL); + SetTopWindow(mainFrame); + return GetTopWindow()->Show(); + } +}; + +DECLARE_APP(MainApp) +IMPLEMENT_APP(MainApp) -- cgit From d1b893e6757270b0f246a7657d7b6701dcea3b87 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 27 Jul 2016 23:41:41 -0300 Subject: Main frame under construction Ribbon bar icons done, all controllers set, does nothing --- Project/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Project/main.cpp') diff --git a/Project/main.cpp b/Project/main.cpp index 81dccbc..5953806 100644 --- a/Project/main.cpp +++ b/Project/main.cpp @@ -1,8 +1,9 @@ #include #include -#include "MainFrame.h" #include +#include "MainFrame.h" + // Define the MainApp class MainApp : public wxApp { -- cgit From 3a246308dcd76f70a1b6c3e6b08f0d597b255dba Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Sat, 30 Jul 2016 00:29:03 -0300 Subject: Adding the basics graphics elements The base is done, bus under contruction --- Project/main.cpp | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) (limited to 'Project/main.cpp') diff --git a/Project/main.cpp b/Project/main.cpp index 5953806..106ca82 100644 --- a/Project/main.cpp +++ b/Project/main.cpp @@ -1,24 +1,49 @@ #include #include #include +#include #include "MainFrame.h" // Define the MainApp class MainApp : public wxApp { -public: + public: MainApp() {} virtual ~MainApp() {} + void LoadCatalogs(wxLocale* locale) + { + locale->Init( + locale->GetSystemLanguage(), + wxLOCALE_DONT_LOAD_DEFAULT); // captura as propriedades locais do computador (idioma, numeração, etc...) - virtual bool OnInit() { - // Add the common image handlers - wxImage::AddHandler( new wxPNGHandler ); - wxImage::AddHandler( new wxJPEGHandler ); + wxString langPath = wxStandardPaths::Get().GetExecutablePath(); + // remove o nome do executável + for(int i = langPath.size(); i >= 0; i--) { + if(langPath[i] == '/' || langPath[i] == '\\') { + langPath.Truncate(i + 1); + break; + } + } + langPath += wxT("data\\lang"); - MainFrame *mainFrame = new MainFrame(NULL); - SetTopWindow(mainFrame); - return GetTopWindow()->Show(); + locale->AddCatalogLookupPathPrefix(langPath); + // Carregar catálogos de tradução + locale->AddCatalog(wxT("pt_BR"), wxLANGUAGE_PORTUGUESE_BRAZILIAN); + } + + virtual bool OnInit() + { + // Add the common image handlers + wxImage::AddHandler(new wxPNGHandler); + wxImage::AddHandler(new wxJPEGHandler); + + wxLocale* locale = new wxLocale(); + LoadCatalogs(locale); + + MainFrame* mainFrame = new MainFrame(NULL, locale); + SetTopWindow(mainFrame); + return GetTopWindow()->Show(); } }; -- cgit