diff --git a/ZRCola.sln b/ZRCola.sln index 458522a..bbf0d75 100644 --- a/ZRCola.sln +++ b/ZRCola.sln @@ -7,6 +7,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtend", "lib\wxExtend\build\wxExtend.vcxproj", "{A3A36689-AC35-4026-93DA-A3BA0C0E767C}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CFEBC17E-C840-4507-BDE6-1EF5B52DDCC5}" + ProjectSection(SolutionItems) = preProject + include\ZRCola.h = include\ZRCola.h + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 diff --git a/ZRCola/ZRCola.vcxproj b/ZRCola/ZRCola.vcxproj index 7fd2f83..9234d47 100644 --- a/ZRCola/ZRCola.vcxproj +++ b/ZRCola/ZRCola.vcxproj @@ -85,7 +85,6 @@ - @@ -95,6 +94,12 @@ {a3a36689-ac35-4026-93da-a3ba0c0e767c} + + + + + + diff --git a/ZRCola/ZRCola.vcxproj.filters b/ZRCola/ZRCola.vcxproj.filters index cfe83aa..e6ca11b 100644 --- a/ZRCola/ZRCola.vcxproj.filters +++ b/ZRCola/ZRCola.vcxproj.filters @@ -32,9 +32,6 @@ Header Files - - Header Files - Header Files @@ -42,4 +39,14 @@ Header Files + + + Resource Files + + + + + Resource Files + + \ No newline at end of file diff --git a/ZRCola/res/ZRCola.rc b/ZRCola/res/ZRCola.rc new file mode 100644 index 0000000..b61e1ad Binary files /dev/null and b/ZRCola/res/ZRCola.rc differ diff --git a/ZRCola/res/send.ico b/ZRCola/res/send.ico new file mode 100644 index 0000000..92c6b8e Binary files /dev/null and b/ZRCola/res/send.ico differ diff --git a/ZRCola/stdafx.h b/ZRCola/stdafx.h index ae6486f..b023d9e 100644 --- a/ZRCola/stdafx.h +++ b/ZRCola/stdafx.h @@ -23,6 +23,7 @@ #include "zrcolaapp.h" #include "zrcolaframe.h" +#include #include #include #include diff --git a/ZRCola/zrcolaapp.cpp b/ZRCola/zrcolaapp.cpp index de64fe6..cc620cb 100644 --- a/ZRCola/zrcolaapp.cpp +++ b/ZRCola/zrcolaapp.cpp @@ -32,8 +32,16 @@ bool ZRColaApp::OnInit() if (!wxAppEx::OnInit()) return false; - ZRColaFrame *frame = new ZRColaFrame(); - frame->Show(); + if (wxLocale::IsAvailable(wxLANGUAGE_SLOVENIAN)) + wxVERIFY(m_locale.AddCatalog(wxT("ZRCola"))); + + wxZRColaFrame* mainFrame = new wxZRColaFrame(); + if (!mainFrame->Create()) { + delete mainFrame; + return false; + } + + mainFrame->Show(); return true; } diff --git a/ZRCola/zrcolaapp.h b/ZRCola/zrcolaapp.h index 695a19a..cfd39c3 100644 --- a/ZRCola/zrcolaapp.h +++ b/ZRCola/zrcolaapp.h @@ -28,5 +28,11 @@ class ZRColaApp : public wxAppEx { public: + /// + /// Called when application initializes. + /// + /// \returns + /// - true if initialization succeeded + /// - false otherwise virtual bool OnInit(); }; diff --git a/ZRCola/zrcolaframe.cpp b/ZRCola/zrcolaframe.cpp index 622a478..67179e1 100644 --- a/ZRCola/zrcolaframe.cpp +++ b/ZRCola/zrcolaframe.cpp @@ -21,40 +21,61 @@ ////////////////////////////////////////////////////////////////////////// -// ZRColaFrame +// wxZRColaFrame ////////////////////////////////////////////////////////////////////////// -wxBEGIN_EVENT_TABLE(ZRColaFrame, wxAppBarFrame) - EVT_MENU(wxID_EXIT, ZRColaFrame::OnExit) - EVT_MENU(wxID_ABOUT, ZRColaFrame::OnAbout) +wxBEGIN_EVENT_TABLE(wxZRColaFrame, wxAppBarFrame) + EVT_MENU(wxID_ABOUT, wxZRColaFrame::OnAbout) wxEND_EVENT_TABLE() -ZRColaFrame::ZRColaFrame() : wxAppBarFrame(NULL, wxID_ANY, _("ZRCola"), wxABS_FLOAT, wxABF_ALLOWFLOAT | wxABF_ALLOWDOCKHORIZONTAL | wxABF_ALLOWSIZING | wxABF_HIDETASKBARTABWHENDOCKED, wxDefaultPosition, wxSize(400, 100)) +wxZRColaFrame::wxZRColaFrame() : wxAppBarFrame() { - wxBoxSizer* bSizer1; - bSizer1 = new wxBoxSizer( wxHORIZONTAL ); +} - m_preview = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_CENTRE|wxTE_MULTILINE|wxTE_WORDWRAP ); - m_preview->SetFont( wxFont( 20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("00 ZRCola") ) ); - bSizer1->Add( m_preview, 1, wxEXPAND, 5 ); - m_btnSend = new wxButton( this, wxID_ANY, wxT("&Send"), wxDefaultPosition, wxDefaultSize, 0 ); - m_btnSend->SetDefault(); - bSizer1->Add( m_btnSend, 0, wxEXPAND, 5 ); +bool wxZRColaFrame::Create() +{ + wxImage::AddHandler(new wxICOHandler); - SetSizer( bSizer1 ); + wxCHECK(wxAppBarFrame::Create(NULL, wxID_ANY, _("ZRCola"), wxABS_FLOAT, wxABF_ALLOWFLOAT | wxABF_ALLOWDOCKHORIZONTAL | wxABF_ALLOWSIZING | wxABF_HIDETASKBARTABWHENDOCKED, wxDefaultPosition, wxSize(400, 100)), false); + + wxFont fontZRCola(20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("00 ZRCola")); + + wxCHECK(m_preview.Create(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE), false); + m_preview.Wrap(-1); + m_preview.SetFont(fontZRCola); + + wxCHECK(m_composer.Create(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_CENTRE|wxTE_MULTILINE), false); + m_composer.SetFont(fontZRCola); + + wxBoxSizer + //*boxH = new wxBoxSizer(wxHORIZONTAL), + *boxV = new wxBoxSizer(wxVERTICAL); + + boxV->Add(&m_preview, 1, wxEXPAND, 5); + boxV->Add(&m_composer, 1, wxEXPAND, 5); + //boxH->Add(boxV, 1, wxEXPAND, 5); + + //m_toolBar.Create(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL); + //m_toolBar.AddTool(wxID_ABOUT, _("About"), wxBitmap(wxIcon(wxICON(send.ico)))); + //m_toolBar.AddTool(wxID_ABOUT, _("About"), wxBitmap(wxIcon(wxICON(send.ico)))); + //m_toolBar.AddTool(wxID_ABOUT, _("About"), wxBitmap(wxIcon(wxICON(send.ico)))); + //m_toolBar.AddTool(wxID_ABOUT, _("About"), wxBitmap(wxIcon(wxICON(send.ico)))); + //m_toolBar.Realize(); + //Connect(wxID_ABOUT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxZRColaFrame::OnAbout)); + + //boxH->Add(&m_toolBar, 0, wxEXPAND, 5); + + SetSizer(boxV); + //SetSizer(boxH); Layout(); + + return true; } -void ZRColaFrame::OnExit(wxCommandEvent& event) -{ - Close(true); -} - - -void ZRColaFrame::OnAbout(wxCommandEvent& event) +void wxZRColaFrame::OnAbout(wxCommandEvent& event) { wxMessageBox(wxString::Format(_("ZRCola v%s\nCopyright 2016 Amebis"), wxT(ZRCOLA_VERSION_STR)), _("About ZRCola"), wxOK | wxICON_INFORMATION); } diff --git a/ZRCola/zrcolaframe.h b/ZRCola/zrcolaframe.h index e82d02e..e8de08c 100644 --- a/ZRCola/zrcolaframe.h +++ b/ZRCola/zrcolaframe.h @@ -20,29 +20,26 @@ #pragma once #include -#include +#include #include +#include /// /// ZRCola main frame /// -class ZRColaFrame : public wxAppBarFrame +class wxZRColaFrame : public wxAppBarFrame { public: - ZRColaFrame(); + wxZRColaFrame(); + bool Create(); protected: - enum { - ID_Hello, - }; - - void OnExit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); - void OnHello(wxCommandEvent& event); wxDECLARE_EVENT_TABLE(); protected: - wxTextCtrl* m_preview; ///< Preview edit box - wxButton* m_btnSend; ///< Send button + wxStaticText m_preview; + wxTextCtrl m_composer; + wxToolBar m_toolBar; }; diff --git a/lib/wxExtend b/lib/wxExtend index a29c602..a6f470f 160000 --- a/lib/wxExtend +++ b/lib/wxExtend @@ -1 +1 @@ -Subproject commit a29c60295b6baa0519ef4c66e2d87b3536606284 +Subproject commit a6f470fd1e02ca11e98dca0af2c09f8d11797808