Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
* Name: PW4Main.h
* Author: ()
* Created: 2018-09-16
* Copyright: ()
* License:
**************************************************************/
#ifndef PW4MAIN_H
#define PW4MAIN_H
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "PW4App.h"
public:
~PW4Frame();
private:
enum
{
idMenuQuit = 1000,
ID_TextBox,
idMenuOpen,
idMenuSave,
idMenuAbout
};
wxTextCtrl *textControl;
wxFileDialog* openDialog;
wxFileDialog* saveDialog;
DECLARE_EVENT_TABLE()
};
#endif // PW4MAIN_H
/***************************************************************
* Name: PW4Main.cpp
* Author: ()
* Created: 2018-09-16
* Copyright: ()
* License:
**************************************************************/
#ifdef WX_PRECOMP
#include "wx_pch.h"
#endif
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__
#include "PW4Main.h"
//helper functions
enum wxbuildinfoformat {
short_f, long_f };
{
wxString wxbuild(wxVERSION_STRING);
if (format == long_f )
#if defined(__WXMSW__)
#elif defined(__WXMAC__)
#elif defined(__UNIX__)
#endif
#if wxUSE_UNICODE
#else
#endif // wxUSE_UNICODE
return wxbuild;
BEGIN_EVENT_TABLE(PW4Frame, wxFrame)
EVT_CLOSE(PW4Frame::OnClose)
EVT_MENU(idMenuQuit, PW4Frame::OnQuit)
EVT_MENU(idMenuAbout, PW4Frame::OnAbout)
EVT_MENU(idMenuOpen, PW4Frame::OnOpen)
END_EVENT_TABLE()
#if wxUSE_MENUS
mbar->Append(fileMenu, _("&File"));
mbar->Append(helpMenu, _("&Help"));
SetMenuBar(mbar);
#endif // wxUSE_MENUS
#if wxUSE_STATUSBAR
// create a status bar with some information about the used wxWidgets version
CreateStatusBar(2);
SetStatusText(wxbuildinfo(short_f), 1);
#endif // wxUSE_STATUSBAR
PW4Frame::~PW4Frame()
Destroy();
Destroy();
{
wxFileDialog *openDialog = new wxFileDialog(this, wxT("Choose a file"), wxT(""), wxT(""),
wxFD_OPEN );
if(response == wxID_OK)
this->textControl->LoadFile(openDialog->GetPath());