Work continues...

This commit is contained in:
Simon Rozman 2016-02-06 09:27:56 +01:00
parent 4f93132ee1
commit 61cb61c90c
11 changed files with 89 additions and 39 deletions

View File

@ -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

View File

@ -85,7 +85,6 @@
<ClCompile Include="zrcolaframe.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\ZRCola.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="zrcolaapp.h" />
<ClInclude Include="zrcolaframe.h" />
@ -95,6 +94,12 @@
<Project>{a3a36689-ac35-4026-93da-a3ba0c0e767c}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="res\send.ico" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\ZRCola.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@ -32,9 +32,6 @@
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\ZRCola.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zrcolaapp.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -42,4 +39,14 @@
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="res\send.ico">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\ZRCola.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

BIN
ZRCola/res/ZRCola.rc Normal file

Binary file not shown.

BIN
ZRCola/res/send.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -23,6 +23,7 @@
#include "zrcolaapp.h"
#include "zrcolaframe.h"
#include <wx/font.h>
#include <wx/msgdlg.h>
#include <wx/sizer.h>
#include <wxex/common.h>

View File

@ -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;
}

View File

@ -28,5 +28,11 @@
class ZRColaApp : public wxAppEx
{
public:
///
/// Called when application initializes.
///
/// \returns
/// - true if initialization succeeded
/// - false otherwise
virtual bool OnInit();
};

View File

@ -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);
}

View File

@ -20,29 +20,26 @@
#pragma once
#include <wxex/appbar.h>
#include <wx/button.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/toolbar.h>
///
/// 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;
};

@ -1 +1 @@
Subproject commit a29c60295b6baa0519ef4c66e2d87b3536606284
Subproject commit a6f470fd1e02ca11e98dca0af2c09f8d11797808