2002-04-07 10:50:00 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wxedit.h
|
|
|
|
// Author: Robert Roebling
|
2006-01-26 14:06:06 -05:00
|
|
|
// RCS-ID: $Id$
|
2002-04-07 10:50:00 -04:00
|
|
|
// Created: 04/07/02
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __wxedit_H__
|
|
|
|
#define __wxedit_H__
|
|
|
|
|
2004-05-25 07:20:37 -04:00
|
|
|
// Include wxWidgets' headers
|
2002-04-07 10:50:00 -04:00
|
|
|
|
|
|
|
#ifndef WX_PRECOMP
|
2006-01-26 14:06:06 -05:00
|
|
|
#include "wx/wx.h"
|
2002-04-07 10:50:00 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// constants
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#define ID_ABOUT 100
|
|
|
|
|
|
|
|
#define ID_NEW 200
|
|
|
|
#define ID_OPEN 201
|
|
|
|
#define ID_SAVE 202
|
|
|
|
#define ID_SAVEAS 203
|
|
|
|
#define ID_QUIT 204
|
|
|
|
|
2002-04-08 17:48:29 -04:00
|
|
|
#define ID_COPY 300
|
|
|
|
#define ID_CUT 301
|
|
|
|
#define ID_PASTE 302
|
|
|
|
#define ID_DELETE 303
|
|
|
|
|
|
|
|
#define ID_LAST_1 401
|
|
|
|
#define ID_LAST_2 402
|
|
|
|
#define ID_LAST_3 403
|
|
|
|
|
2002-04-07 10:50:00 -04:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// MyFrame
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class MyFrame: public wxFrame
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// constructors and destructors
|
|
|
|
MyFrame( wxWindow *parent, wxWindowID id, const wxString &title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE );
|
2004-10-06 16:54:57 -04:00
|
|
|
|
2002-04-07 10:50:00 -04:00
|
|
|
private:
|
|
|
|
void CreateMyMenuBar();
|
2004-10-06 16:54:57 -04:00
|
|
|
|
2002-04-07 10:50:00 -04:00
|
|
|
private:
|
2002-04-10 12:01:39 -04:00
|
|
|
wxTextCtrl *m_text;
|
|
|
|
wxString m_filename;
|
|
|
|
wxArrayString m_history;
|
2004-10-06 16:54:57 -04:00
|
|
|
|
2002-04-07 10:50:00 -04:00
|
|
|
private:
|
|
|
|
void OnAbout( wxCommandEvent &event );
|
|
|
|
void OnNew( wxCommandEvent &event );
|
|
|
|
void OnOpen( wxCommandEvent &event );
|
|
|
|
void OnSave( wxCommandEvent &event );
|
|
|
|
void OnSaveAs( wxCommandEvent &event );
|
|
|
|
void OnQuit( wxCommandEvent &event );
|
2004-10-06 16:54:57 -04:00
|
|
|
|
2002-04-08 17:48:29 -04:00
|
|
|
void OnCopy( wxCommandEvent &event );
|
|
|
|
void OnCut( wxCommandEvent &event );
|
|
|
|
void OnPaste( wxCommandEvent &event );
|
|
|
|
void OnDelete( wxCommandEvent &event );
|
2004-10-06 16:54:57 -04:00
|
|
|
|
2002-04-10 12:01:39 -04:00
|
|
|
void OnLastFiles( wxCommandEvent &event );
|
2004-10-06 16:54:57 -04:00
|
|
|
|
2002-04-10 12:01:39 -04:00
|
|
|
void MakeHistory();
|
|
|
|
void AddToHistory( const wxString &fname );
|
2004-10-06 16:54:57 -04:00
|
|
|
|
2002-04-08 17:48:29 -04:00
|
|
|
bool Save();
|
|
|
|
bool Discard();
|
2004-10-06 16:54:57 -04:00
|
|
|
|
2002-04-10 12:01:39 -04:00
|
|
|
void OnUpdateUI( wxUpdateUIEvent &event );
|
2002-04-07 10:50:00 -04:00
|
|
|
void OnCloseWindow( wxCloseEvent &event );
|
2004-10-06 16:54:57 -04:00
|
|
|
|
2002-04-07 10:50:00 -04:00
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// MyApp
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class MyApp: public wxApp
|
|
|
|
{
|
|
|
|
public:
|
2004-10-06 16:54:57 -04:00
|
|
|
MyApp(){};
|
|
|
|
|
2002-04-07 10:50:00 -04:00
|
|
|
virtual bool OnInit();
|
|
|
|
virtual int OnExit();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|