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_
15 #include "wx/docview.h"
20 #include "wx/msw/helpchm.h"
22 #include "wx/html/helpctrl.h"
25 #include "appsettings.h"
28 class ctConfigToolDoc
;
31 * \brief The application class.
32 * The application class controls initialisation,
33 * cleanup and other application-wide issues.
36 class ctApp
: public wxApp
47 /// Returns the application directory.
48 wxString
GetAppDir() const { return m_appDir
; }
50 /// Prepends the current app program directory to the name.
51 wxString
GetFullAppPath(const wxString
& filename
) const;
53 /// Returns an object containing the application settings.
54 ctSettings
& GetSettings() { return m_settings
; }
56 /// Returns the file history object.
57 wxFileHistory
& GetFileHistory() { return m_fileHistory
; }
59 /// Returns the notebook window.
60 wxNotebook
* GetNotebookWindow() { return m_notebookWindow
; }
62 /// Returns true if the application should show tooltips.
63 virtual bool UsingTooltips();
65 /// Returns the help controller object for the manual.
66 wxHelpControllerBase
& GetHelpController() { return *m_helpController
; }
68 /// Returns the help controller object for the wxWidgets reference manual.
69 wxHelpControllerBase
& GetReferenceHelpController() { return *m_helpControllerReference
; }
71 /// Returns the document manager object.
72 wxDocManager
* GetDocManager() const { return m_docManager
; }
74 /// Returns the main frame.
75 ctMainFrame
* GetMainFrame();
79 /// Called on application initialisation.
82 /// Called on application exit.
85 /// Loads config info from the registry or a file.
86 virtual bool LoadConfig();
88 /// Saves config info to the registry or a file.
89 virtual bool SaveConfig();
91 /// The help controller needs to be cleared before wxWidgets
93 void ClearHelpControllers() ;
96 /// The application directory.
100 wxNotebook
* m_notebookWindow
;
102 /// The help controller object.
103 wxHelpControllerBase
* m_helpController
;
105 /// The help controller object (reference manual).
106 wxHelpControllerBase
* m_helpControllerReference
;
108 /// The file history.
109 wxFileHistory m_fileHistory
;
111 /// The configuration data.
112 ctSettings m_settings
;
114 /// The document manager.
115 wxDocManager
* m_docManager
;
118 DECLARE_EVENT_TABLE()
123 /////////////////////////////////////////////////
125 /////////////////////////////////////////////////
128 #define ctID_SAVE_SETUP_FILE 1001
129 #define ctID_SAVE_CONFIGURE_COMMAND 1002
133 #define ctID_ADD_ITEM 1030
134 #define ctID_ADD_ITEM_CHECKBOX 1031
135 #define ctID_ADD_ITEM_RADIOBUTTON 1032
136 #define ctID_ADD_ITEM_STRING 1033
137 #define ctID_ADD_ITEM_GROUP 1034
138 #define ctID_ADD_ITEM_CHECK_GROUP 1035
139 #define ctID_ADD_ITEM_RADIO_GROUP 1036
140 #define ctID_DELETE_ITEM 1037
141 #define ctID_RENAME_ITEM 1038
142 #define ctID_CUSTOM_PROPERTY 1039
143 #define ctID_ADD_CUSTOM_PROPERTY 1040
144 #define ctID_EDIT_CUSTOM_PROPERTY 1041
145 #define ctID_DELETE_CUSTOM_PROPERTY 1042
148 #define ctID_SETTINGS 1020
149 #define ctID_SHOW_TOOLBAR 1021
152 #define ctID_GOTO_WEBSITE 1050
153 #define ctID_ITEM_HELP 1051
154 #define ctID_REFERENCE_CONTENTS 1052
157 #define ctID_TASKBAR_EXIT_APP 1202
158 #define ctID_TASKBAR_SHOW_APP 1203
161 #define ctID_TREE_PASTE_BEFORE 1300
162 #define ctID_TREE_PASTE_AFTER 1301
163 #define ctID_TREE_PASTE_AS_CHILD 1302
164 #define ctID_TREE_COPY 1303
165 #define ctID_TREE_CUT 1304
167 /////////////////////////////////////////////////
168 // Window/control ids
169 /////////////////////////////////////////////////
172 #define ctID_SETTINGS_GENERAL 1500
174 // Regenerate setup.h/configure command
175 #define ctID_REGENERATE 1600
178 // _AP_WXCONFIGTOOL_H_