Work continues

This commit is contained in:
Simon Rozman 2016-02-05 15:24:18 +01:00
parent 341961ee5b
commit 7bfe74fcb6
6 changed files with 35 additions and 35 deletions

View File

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

View File

@ -32,7 +32,8 @@ bool ZRColaApp::OnInit()
if (!wxAppEx::OnInit()) if (!wxAppEx::OnInit())
return false; return false;
ZRColaFrame *frame = new ZRColaFrame(_("Hello World"), wxPoint(50, 50), wxSize(450, 340)); ZRColaFrame *frame = new ZRColaFrame();
frame->Show(true); frame->Show();
return true; return true;
} }

View File

@ -24,30 +24,27 @@
// ZRColaFrame // ZRColaFrame
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
wxBEGIN_EVENT_TABLE(ZRColaFrame, wxAppBar) wxBEGIN_EVENT_TABLE(ZRColaFrame, wxAppBarFrame)
EVT_MENU(ZRColaFrame::ID_Hello, ZRColaFrame::OnHello) EVT_MENU(wxID_EXIT, ZRColaFrame::OnExit)
EVT_MENU(wxID_EXIT, ZRColaFrame::OnExit) EVT_MENU(wxID_ABOUT, ZRColaFrame::OnAbout)
EVT_MENU(wxID_ABOUT, ZRColaFrame::OnAbout)
wxEND_EVENT_TABLE() wxEND_EVENT_TABLE()
ZRColaFrame::ZRColaFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxAppBar(NULL, wxID_ANY, title, wxSTATE_FLOAT, wxFLAG_ALLOWFLOAT | wxFLAG_ALLOWDOCKHORIZONTAL | wxFLAG_ALLOWSIZING | wxFLAG_HIDETASKBARTABWHENDOCKED, pos, size) ZRColaFrame::ZRColaFrame() : wxAppBarFrame(NULL, wxID_ANY, _("ZRCola"), wxABS_FLOAT, wxABF_ALLOWFLOAT | wxABF_ALLOWDOCKHORIZONTAL | wxABF_ALLOWSIZING | wxABF_HIDETASKBARTABWHENDOCKED, wxDefaultPosition, wxSize(400, 100))
{ {
wxMenu *menuFile = new wxMenu; wxBoxSizer* bSizer1;
menuFile->Append(ZRColaFrame::ID_Hello, _("&Hello...\tCtrl+H"), _("Help string shown in status bar for this menu item")); bSizer1 = new wxBoxSizer( wxHORIZONTAL );
menuFile->AppendSeparator();
menuFile->Append(wxID_EXIT);
wxMenu *menuHelp = new wxMenu; m_preview = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_CENTRE|wxTE_MULTILINE|wxTE_WORDWRAP );
menuHelp->Append(wxID_ABOUT); m_preview->SetFont( wxFont( 20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("00 ZRCola") ) );
bSizer1->Add( m_preview, 1, wxEXPAND, 5 );
wxMenuBar *menuBar = new wxMenuBar; m_btnSend = new wxButton( this, wxID_ANY, wxT("&Send"), wxDefaultPosition, wxDefaultSize, 0 );
menuBar->Append(menuFile, _("&File")); m_btnSend->SetDefault();
menuBar->Append(menuHelp, _("&Help")); bSizer1->Add( m_btnSend, 0, wxEXPAND, 5 );
SetMenuBar(menuBar);
//CreateStatusBar(); SetSizer( bSizer1 );
//SetStatusText(_("Welcome to wxWidgets!")); Layout();
} }
@ -59,11 +56,5 @@ void ZRColaFrame::OnExit(wxCommandEvent& event)
void ZRColaFrame::OnAbout(wxCommandEvent& event) void ZRColaFrame::OnAbout(wxCommandEvent& event)
{ {
wxMessageBox(_("This is a wxWidgets' Hello world sample"), _("About Hello World"), wxOK | wxICON_INFORMATION); wxMessageBox(wxString::Format(_("ZRCola v%s\nCopyright 2016 Amebis"), wxT(ZRCOLA_VERSION_STR)), _("About ZRCola"), wxOK | wxICON_INFORMATION);
}
void ZRColaFrame::OnHello(wxCommandEvent& event)
{
wxLogMessage(_("Hello world from wxWidgets!"));
} }

View File

@ -20,23 +20,29 @@
#pragma once #pragma once
#include <wxex/appbar.h> #include <wxex/appbar.h>
#include <wx/button.h>
#include <wx/textctrl.h>
/// ///
/// ZRCola main frame /// ZRCola main frame
/// ///
class ZRColaFrame : public wxAppBar class ZRColaFrame : public wxAppBarFrame
{ {
public: public:
ZRColaFrame(const wxString& title, const wxPoint& pos, const wxSize& size); ZRColaFrame();
enum {
ID_Hello = 1
};
protected: protected:
void OnHello(wxCommandEvent& event); enum {
ID_Hello,
};
void OnExit(wxCommandEvent& event); void OnExit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event); void OnAbout(wxCommandEvent& event);
void OnHello(wxCommandEvent& event);
wxDECLARE_EVENT_TABLE(); wxDECLARE_EVENT_TABLE();
protected:
wxTextCtrl* m_preview; ///< Preview edit box
wxButton* m_btnSend; ///< Send button
}; };

View File

@ -18,3 +18,5 @@
*/ */
#pragma once #pragma once
#define ZRCOLA_VERSION_STR "2.0-alpha"

@ -1 +1 @@
Subproject commit f14e5948a59e93ae30173666eb8884f84fa8bb64 Subproject commit a29c60295b6baa0519ef4c66e2d87b3536606284