]> git.saurik.com Git - wxWidgets.git/blame_incremental - samples/mobile/wxedit/wxedit.h
Finally removes occurences of OnMenuCommand and closes bug #1164678
[wxWidgets.git] / samples / mobile / wxedit / wxedit.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: wxedit.h
3// Author: Robert Roebling
4// Created: 04/07/02
5/////////////////////////////////////////////////////////////////////////////
6
7#ifndef __wxedit_H__
8#define __wxedit_H__
9
10// Include wxWidgets' headers
11
12#ifndef WX_PRECOMP
13 #include <wx/wx.h>
14#endif
15
16//----------------------------------------------------------------------------
17// constants
18//----------------------------------------------------------------------------
19
20#define ID_ABOUT 100
21
22#define ID_NEW 200
23#define ID_OPEN 201
24#define ID_SAVE 202
25#define ID_SAVEAS 203
26#define ID_QUIT 204
27
28#define ID_COPY 300
29#define ID_CUT 301
30#define ID_PASTE 302
31#define ID_DELETE 303
32
33#define ID_LAST_1 401
34#define ID_LAST_2 402
35#define ID_LAST_3 403
36
37//----------------------------------------------------------------------------
38// MyFrame
39//----------------------------------------------------------------------------
40
41class MyFrame: public wxFrame
42{
43public:
44 // constructors and destructors
45 MyFrame( wxWindow *parent, wxWindowID id, const wxString &title,
46 const wxPoint& pos = wxDefaultPosition,
47 const wxSize& size = wxDefaultSize,
48 long style = wxDEFAULT_FRAME_STYLE );
49
50private:
51 void CreateMyMenuBar();
52
53private:
54 wxTextCtrl *m_text;
55 wxString m_filename;
56 wxArrayString m_history;
57
58private:
59 void OnAbout( wxCommandEvent &event );
60 void OnNew( wxCommandEvent &event );
61 void OnOpen( wxCommandEvent &event );
62 void OnSave( wxCommandEvent &event );
63 void OnSaveAs( wxCommandEvent &event );
64 void OnQuit( wxCommandEvent &event );
65
66 void OnCopy( wxCommandEvent &event );
67 void OnCut( wxCommandEvent &event );
68 void OnPaste( wxCommandEvent &event );
69 void OnDelete( wxCommandEvent &event );
70
71 void OnLastFiles( wxCommandEvent &event );
72
73 void MakeHistory();
74 void AddToHistory( const wxString &fname );
75
76 bool Save();
77 bool Discard();
78
79 void OnUpdateUI( wxUpdateUIEvent &event );
80 void OnCloseWindow( wxCloseEvent &event );
81
82private:
83 DECLARE_EVENT_TABLE()
84};
85
86//----------------------------------------------------------------------------
87// MyApp
88//----------------------------------------------------------------------------
89
90class MyApp: public wxApp
91{
92public:
93 MyApp(){};
94
95 virtual bool OnInit();
96 virtual int OnExit();
97};
98
99#endif