]>
Commit | Line | Data |
---|---|---|
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 | #if defined(__GNUG__) && !defined(__APPLE__) | |
11 | #pragma interface "wxedit.cpp" | |
12 | #endif | |
13 | ||
14 | // Include wxWindows' headers | |
15 | ||
16 | #ifndef WX_PRECOMP | |
17 | #include <wx/wx.h> | |
18 | #endif | |
19 | ||
20 | //---------------------------------------------------------------------------- | |
21 | // constants | |
22 | //---------------------------------------------------------------------------- | |
23 | ||
24 | #define ID_ABOUT 100 | |
25 | ||
26 | #define ID_NEW 200 | |
27 | #define ID_OPEN 201 | |
28 | #define ID_SAVE 202 | |
29 | #define ID_SAVEAS 203 | |
30 | #define ID_QUIT 204 | |
31 | ||
32 | #define ID_COPY 300 | |
33 | #define ID_CUT 301 | |
34 | #define ID_PASTE 302 | |
35 | #define ID_DELETE 303 | |
36 | ||
37 | #define ID_LAST_1 401 | |
38 | #define ID_LAST_2 402 | |
39 | #define ID_LAST_3 403 | |
40 | ||
41 | //---------------------------------------------------------------------------- | |
42 | // MyFrame | |
43 | //---------------------------------------------------------------------------- | |
44 | ||
45 | class MyFrame: public wxFrame | |
46 | { | |
47 | public: | |
48 | // constructors and destructors | |
49 | MyFrame( wxWindow *parent, wxWindowID id, const wxString &title, | |
50 | const wxPoint& pos = wxDefaultPosition, | |
51 | const wxSize& size = wxDefaultSize, | |
52 | long style = wxDEFAULT_FRAME_STYLE ); | |
53 | ||
54 | private: | |
55 | void CreateMyMenuBar(); | |
56 | ||
57 | private: | |
58 | wxTextCtrl *m_text; | |
59 | wxString m_filename; | |
60 | wxArrayString m_history; | |
61 | ||
62 | private: | |
63 | void OnAbout( wxCommandEvent &event ); | |
64 | void OnNew( wxCommandEvent &event ); | |
65 | void OnOpen( wxCommandEvent &event ); | |
66 | void OnSave( wxCommandEvent &event ); | |
67 | void OnSaveAs( wxCommandEvent &event ); | |
68 | void OnQuit( wxCommandEvent &event ); | |
69 | ||
70 | void OnCopy( wxCommandEvent &event ); | |
71 | void OnCut( wxCommandEvent &event ); | |
72 | void OnPaste( wxCommandEvent &event ); | |
73 | void OnDelete( wxCommandEvent &event ); | |
74 | ||
75 | void OnLastFiles( wxCommandEvent &event ); | |
76 | ||
77 | void MakeHistory(); | |
78 | void AddToHistory( const wxString &fname ); | |
79 | ||
80 | bool Save(); | |
81 | bool Discard(); | |
82 | ||
83 | void OnUpdateUI( wxUpdateUIEvent &event ); | |
84 | void OnCloseWindow( wxCloseEvent &event ); | |
85 | ||
86 | private: | |
87 | DECLARE_EVENT_TABLE() | |
88 | }; | |
89 | ||
90 | //---------------------------------------------------------------------------- | |
91 | // MyApp | |
92 | //---------------------------------------------------------------------------- | |
93 | ||
94 | class MyApp: public wxApp | |
95 | { | |
96 | public: | |
97 | MyApp(); | |
98 | ||
99 | virtual bool OnInit(); | |
100 | virtual int OnExit(); | |
101 | }; | |
102 | ||
103 | #endif |