1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wxconfigtool.h
3 // Purpose: Generic application class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _AP_WXCONFIGTOOL_H_
13 #define _AP_WXCONFIGTOOL_H_
16 #pragma interface "wxconfigtool.cpp"
19 #include "wx/docview.h"
23 #include "wx/msw/helpchm.h"
25 #include "wx/html/helpctrl.h"
28 #include "appsettings.h"
31 class ctConfigToolDoc
;
34 * \brief The application class.
35 * The application class controls initialisation,
36 * cleanup and other application-wide issues.
39 class ctApp
: public wxApp
50 /// Returns the application directory.
51 wxString
GetAppDir() const { return m_appDir
; }
53 /// Prepends the current app program directory to the name.
54 wxString
GetFullAppPath(const wxString
& filename
) const;
56 /// Returns an object containing the application settings.
57 ctSettings
& GetSettings() { return m_settings
; }
59 /// Returns the file history object.
60 wxFileHistory
& GetFileHistory() { return m_fileHistory
; }
62 /// Returns the notebook window.
63 wxNotebook
* GetNotebookWindow() { return m_notebookWindow
; }
65 /// Returns TRUE if the application should show tooltips.
66 virtual bool UsingTooltips();
68 /// Returns the help controller object for the manual.
69 wxHelpControllerBase
& GetHelpController() { return *m_helpController
; }
71 /// Returns the help controller object for the wxWindows reference manual.
72 wxHelpControllerBase
& GetReferenceHelpController() { return *m_helpControllerReference
; }
74 /// Returns the document manager object.
75 wxDocManager
* GetDocManager() const { return m_docManager
; }
77 /// Returns the main frame.
78 ctMainFrame
* GetMainFrame();
82 /// Called on application initialisation.
85 /// Called on application exit.
88 /// Loads config info from the registry or a file.
89 virtual bool LoadConfig();
91 /// Saves config info to the registry or a file.
92 virtual bool SaveConfig();
94 /// The help controller needs to be cleared before wxWindows
96 void ClearHelpControllers() ;
99 /// The application directory.
103 wxNotebook
* m_notebookWindow
;
105 /// The help controller object.
106 wxHelpControllerBase
* m_helpController
;
108 /// The help controller object (reference manual).
109 wxHelpControllerBase
* m_helpControllerReference
;
111 /// The file history.
112 wxFileHistory m_fileHistory
;
114 /// The configuration data.
115 ctSettings m_settings
;
117 /// The document manager.
118 wxDocManager
* m_docManager
;
121 DECLARE_EVENT_TABLE()
126 /////////////////////////////////////////////////
128 /////////////////////////////////////////////////
131 #define ctID_SAVE_SETUP_FILE 1001
132 #define ctID_SAVE_CONFIGURE_COMMAND 1002
136 #define ctID_ADD_ITEM 1030
137 #define ctID_ADD_ITEM_CHECKBOX 1031
138 #define ctID_ADD_ITEM_RADIOBUTTON 1032
139 #define ctID_ADD_ITEM_STRING 1033
140 #define ctID_ADD_ITEM_GROUP 1034
141 #define ctID_ADD_ITEM_CHECK_GROUP 1035
142 #define ctID_ADD_ITEM_RADIO_GROUP 1036
143 #define ctID_DELETE_ITEM 1037
144 #define ctID_RENAME_ITEM 1038
145 #define ctID_CUSTOM_PROPERTY 1039
146 #define ctID_ADD_CUSTOM_PROPERTY 1040
147 #define ctID_EDIT_CUSTOM_PROPERTY 1041
148 #define ctID_DELETE_CUSTOM_PROPERTY 1042
151 #define ctID_SETTINGS 1020
152 #define ctID_SHOW_TOOLBAR 1021
155 #define ctID_GOTO_WEBSITE 1050
156 #define ctID_ITEM_HELP 1051
157 #define ctID_REFERENCE_CONTENTS 1052
160 #define ctID_TASKBAR_EXIT_APP 1202
161 #define ctID_TASKBAR_SHOW_APP 1203
164 #define ctID_TREE_PASTE_BEFORE 1300
165 #define ctID_TREE_PASTE_AFTER 1301
166 #define ctID_TREE_PASTE_AS_CHILD 1302
167 #define ctID_TREE_COPY 1303
168 #define ctID_TREE_CUT 1304
170 /////////////////////////////////////////////////
171 // Window/control ids
172 /////////////////////////////////////////////////
175 #define ctID_SETTINGS_GENERAL 1500
177 // Regenerate setup.h/configure command
178 #define ctID_REGENERATE 1600
181 // _AP_WXCONFIGTOOL_H_