]>
Commit | Line | Data |
---|---|---|
0106a226 RR |
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 | ||
be5a51fb | 10 | // Include wxWidgets' headers |
0106a226 RR |
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 | ||
a0760bd3 RR |
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 | ||
0106a226 RR |
37 | //---------------------------------------------------------------------------- |
38 | // MyFrame | |
39 | //---------------------------------------------------------------------------- | |
40 | ||
41 | class MyFrame: public wxFrame | |
42 | { | |
43 | public: | |
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 ); | |
925e9792 | 49 | |
0106a226 RR |
50 | private: |
51 | void CreateMyMenuBar(); | |
925e9792 | 52 | |
0106a226 | 53 | private: |
6a4e5f03 RR |
54 | wxTextCtrl *m_text; |
55 | wxString m_filename; | |
56 | wxArrayString m_history; | |
925e9792 | 57 | |
0106a226 RR |
58 | private: |
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 ); | |
925e9792 | 65 | |
a0760bd3 RR |
66 | void OnCopy( wxCommandEvent &event ); |
67 | void OnCut( wxCommandEvent &event ); | |
68 | void OnPaste( wxCommandEvent &event ); | |
69 | void OnDelete( wxCommandEvent &event ); | |
925e9792 | 70 | |
6a4e5f03 | 71 | void OnLastFiles( wxCommandEvent &event ); |
925e9792 | 72 | |
6a4e5f03 RR |
73 | void MakeHistory(); |
74 | void AddToHistory( const wxString &fname ); | |
925e9792 | 75 | |
a0760bd3 RR |
76 | bool Save(); |
77 | bool Discard(); | |
925e9792 | 78 | |
6a4e5f03 | 79 | void OnUpdateUI( wxUpdateUIEvent &event ); |
0106a226 | 80 | void OnCloseWindow( wxCloseEvent &event ); |
925e9792 | 81 | |
0106a226 RR |
82 | private: |
83 | DECLARE_EVENT_TABLE() | |
84 | }; | |
85 | ||
86 | //---------------------------------------------------------------------------- | |
87 | // MyApp | |
88 | //---------------------------------------------------------------------------- | |
89 | ||
90 | class MyApp: public wxApp | |
91 | { | |
92 | public: | |
925e9792 WS |
93 | MyApp(){}; |
94 | ||
0106a226 RR |
95 | virtual bool OnInit(); |
96 | virtual int OnExit(); | |
97 | }; | |
98 | ||
99 | #endif |