Work continues
This commit is contained in:
parent
341961ee5b
commit
7bfe74fcb6
@ -23,6 +23,6 @@
|
||||
#include "zrcolaapp.h"
|
||||
#include "zrcolaframe.h"
|
||||
|
||||
#include <wx/menu.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wxex/common.h>
|
||||
|
@ -32,7 +32,8 @@ bool ZRColaApp::OnInit()
|
||||
if (!wxAppEx::OnInit())
|
||||
return false;
|
||||
|
||||
ZRColaFrame *frame = new ZRColaFrame(_("Hello World"), wxPoint(50, 50), wxSize(450, 340));
|
||||
frame->Show(true);
|
||||
ZRColaFrame *frame = new ZRColaFrame();
|
||||
frame->Show();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -24,30 +24,27 @@
|
||||
// ZRColaFrame
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxBEGIN_EVENT_TABLE(ZRColaFrame, wxAppBar)
|
||||
EVT_MENU(ZRColaFrame::ID_Hello, ZRColaFrame::OnHello)
|
||||
EVT_MENU(wxID_EXIT, ZRColaFrame::OnExit)
|
||||
EVT_MENU(wxID_ABOUT, ZRColaFrame::OnAbout)
|
||||
wxBEGIN_EVENT_TABLE(ZRColaFrame, wxAppBarFrame)
|
||||
EVT_MENU(wxID_EXIT, ZRColaFrame::OnExit)
|
||||
EVT_MENU(wxID_ABOUT, ZRColaFrame::OnAbout)
|
||||
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;
|
||||
menuFile->Append(ZRColaFrame::ID_Hello, _("&Hello...\tCtrl+H"), _("Help string shown in status bar for this menu item"));
|
||||
menuFile->AppendSeparator();
|
||||
menuFile->Append(wxID_EXIT);
|
||||
wxBoxSizer* bSizer1;
|
||||
bSizer1 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxMenu *menuHelp = new wxMenu;
|
||||
menuHelp->Append(wxID_ABOUT);
|
||||
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 );
|
||||
|
||||
wxMenuBar *menuBar = new wxMenuBar;
|
||||
menuBar->Append(menuFile, _("&File"));
|
||||
menuBar->Append(menuHelp, _("&Help"));
|
||||
SetMenuBar(menuBar);
|
||||
m_btnSend = new wxButton( this, wxID_ANY, wxT("&Send"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_btnSend->SetDefault();
|
||||
bSizer1->Add( m_btnSend, 0, wxEXPAND, 5 );
|
||||
|
||||
//CreateStatusBar();
|
||||
//SetStatusText(_("Welcome to wxWidgets!"));
|
||||
SetSizer( bSizer1 );
|
||||
Layout();
|
||||
}
|
||||
|
||||
|
||||
@ -59,11 +56,5 @@ void ZRColaFrame::OnExit(wxCommandEvent& event)
|
||||
|
||||
void ZRColaFrame::OnAbout(wxCommandEvent& event)
|
||||
{
|
||||
wxMessageBox(_("This is a wxWidgets' Hello world sample"), _("About Hello World"), wxOK | wxICON_INFORMATION);
|
||||
}
|
||||
|
||||
|
||||
void ZRColaFrame::OnHello(wxCommandEvent& event)
|
||||
{
|
||||
wxLogMessage(_("Hello world from wxWidgets!"));
|
||||
wxMessageBox(wxString::Format(_("ZRCola v%s\nCopyright 2016 Amebis"), wxT(ZRCOLA_VERSION_STR)), _("About ZRCola"), wxOK | wxICON_INFORMATION);
|
||||
}
|
||||
|
@ -20,23 +20,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <wxex/appbar.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/textctrl.h>
|
||||
|
||||
|
||||
///
|
||||
/// ZRCola main frame
|
||||
///
|
||||
class ZRColaFrame : public wxAppBar
|
||||
class ZRColaFrame : public wxAppBarFrame
|
||||
{
|
||||
public:
|
||||
ZRColaFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
|
||||
|
||||
enum {
|
||||
ID_Hello = 1
|
||||
};
|
||||
ZRColaFrame();
|
||||
|
||||
protected:
|
||||
void OnHello(wxCommandEvent& event);
|
||||
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
|
||||
};
|
||||
|
@ -18,3 +18,5 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define ZRCOLA_VERSION_STR "2.0-alpha"
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit f14e5948a59e93ae30173666eb8884f84fa8bb64
|
||||
Subproject commit a29c60295b6baa0519ef4c66e2d87b3536606284
|
Loading…
x
Reference in New Issue
Block a user