]> git.saurik.com Git - wxWidgets.git/blob - utils/configtool/src/wxconfigtool.h
Applied patch [ 1232933 ] [WinCE] wxDateTime incorrect reading
[wxWidgets.git] / utils / configtool / src / wxconfigtool.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wxconfigtool.h
3 // Purpose: Generic application class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 2002-09-04
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence:
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _AP_WXCONFIGTOOL_H_
13 #define _AP_WXCONFIGTOOL_H_
14
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "wxconfigtool.cpp"
17 #endif
18
19 #include "wx/docview.h"
20 #include "wx/help.h"
21 #include "wx/app.h"
22
23 #ifdef __WXMSW__
24 #include "wx/msw/helpchm.h"
25 #else
26 #include "wx/html/helpctrl.h"
27 #endif
28
29 #include "appsettings.h"
30
31 class ctMainFrame;
32 class ctConfigToolDoc;
33
34 /*!
35 * \brief The application class.
36 * The application class controls initialisation,
37 * cleanup and other application-wide issues.
38 */
39
40 class ctApp: public wxApp
41 {
42 public:
43 /// Constructor.
44 ctApp();
45
46 /// Destructor.
47 ~ctApp(){};
48
49 // Accessors
50
51 /// Returns the application directory.
52 wxString GetAppDir() const { return m_appDir; }
53
54 /// Prepends the current app program directory to the name.
55 wxString GetFullAppPath(const wxString& filename) const;
56
57 /// Returns an object containing the application settings.
58 ctSettings& GetSettings() { return m_settings; }
59
60 /// Returns the file history object.
61 wxFileHistory& GetFileHistory() { return m_fileHistory; }
62
63 /// Returns the notebook window.
64 wxNotebook* GetNotebookWindow() { return m_notebookWindow; }
65
66 /// Returns true if the application should show tooltips.
67 virtual bool UsingTooltips();
68
69 /// Returns the help controller object for the manual.
70 wxHelpControllerBase& GetHelpController() { return *m_helpController; }
71
72 /// Returns the help controller object for the wxWidgets reference manual.
73 wxHelpControllerBase& GetReferenceHelpController() { return *m_helpControllerReference; }
74
75 /// Returns the document manager object.
76 wxDocManager* GetDocManager() const { return m_docManager; }
77
78 /// Returns the main frame.
79 ctMainFrame* GetMainFrame();
80
81 // Operations
82
83 /// Called on application initialisation.
84 bool OnInit(void);
85
86 /// Called on application exit.
87 int OnExit(void);
88
89 /// Loads config info from the registry or a file.
90 virtual bool LoadConfig();
91
92 /// Saves config info to the registry or a file.
93 virtual bool SaveConfig();
94
95 /// The help controller needs to be cleared before wxWidgets
96 /// cleanup happens.
97 void ClearHelpControllers() ;
98
99 protected:
100 /// The application directory.
101 wxString m_appDir;
102
103 /// Notebook window.
104 wxNotebook* m_notebookWindow;
105
106 /// The help controller object.
107 wxHelpControllerBase* m_helpController;
108
109 /// The help controller object (reference manual).
110 wxHelpControllerBase* m_helpControllerReference;
111
112 /// The file history.
113 wxFileHistory m_fileHistory;
114
115 /// The configuration data.
116 ctSettings m_settings;
117
118 /// The document manager.
119 wxDocManager* m_docManager;
120
121 public:
122 DECLARE_EVENT_TABLE()
123 };
124
125 DECLARE_APP(ctApp)
126
127 /////////////////////////////////////////////////
128 // Menu ids
129 /////////////////////////////////////////////////
130
131 // File menu ids
132 #define ctID_SAVE_SETUP_FILE 1001
133 #define ctID_SAVE_CONFIGURE_COMMAND 1002
134 #define ctID_GO 1003
135
136 // Edit menu ids
137 #define ctID_ADD_ITEM 1030
138 #define ctID_ADD_ITEM_CHECKBOX 1031
139 #define ctID_ADD_ITEM_RADIOBUTTON 1032
140 #define ctID_ADD_ITEM_STRING 1033
141 #define ctID_ADD_ITEM_GROUP 1034
142 #define ctID_ADD_ITEM_CHECK_GROUP 1035
143 #define ctID_ADD_ITEM_RADIO_GROUP 1036
144 #define ctID_DELETE_ITEM 1037
145 #define ctID_RENAME_ITEM 1038
146 #define ctID_CUSTOM_PROPERTY 1039
147 #define ctID_ADD_CUSTOM_PROPERTY 1040
148 #define ctID_EDIT_CUSTOM_PROPERTY 1041
149 #define ctID_DELETE_CUSTOM_PROPERTY 1042
150
151 // View menu ids
152 #define ctID_SETTINGS 1020
153 #define ctID_SHOW_TOOLBAR 1021
154
155 // Help menu ids
156 #define ctID_GOTO_WEBSITE 1050
157 #define ctID_ITEM_HELP 1051
158 #define ctID_REFERENCE_CONTENTS 1052
159
160 // Taskbar menu ids
161 #define ctID_TASKBAR_EXIT_APP 1202
162 #define ctID_TASKBAR_SHOW_APP 1203
163
164 // Tree context menu
165 #define ctID_TREE_PASTE_BEFORE 1300
166 #define ctID_TREE_PASTE_AFTER 1301
167 #define ctID_TREE_PASTE_AS_CHILD 1302
168 #define ctID_TREE_COPY 1303
169 #define ctID_TREE_CUT 1304
170
171 /////////////////////////////////////////////////
172 // Window/control ids
173 /////////////////////////////////////////////////
174
175 // Settings dialogs
176 #define ctID_SETTINGS_GENERAL 1500
177
178 // Regenerate setup.h/configure command
179 #define ctID_REGENERATE 1600
180
181 #endif
182 // _AP_WXCONFIGTOOL_H_
183