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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "wxconfigtool.cpp"
19 #include "wx/docview.h"
24 #include "wx/msw/helpchm.h"
26 #include "wx/html/helpctrl.h"
29 #include "appsettings.h"
32 class ctConfigToolDoc
;
35 * \brief The application class.
36 * The application class controls initialisation,
37 * cleanup and other application-wide issues.
40 class ctApp
: public wxApp
51 /// Returns the application directory.
52 wxString
GetAppDir() const { return m_appDir
; }
54 /// Prepends the current app program directory to the name.
55 wxString
GetFullAppPath(const wxString
& filename
) const;
57 /// Returns an object containing the application settings.
58 ctSettings
& GetSettings() { return m_settings
; }
60 /// Returns the file history object.
61 wxFileHistory
& GetFileHistory() { return m_fileHistory
; }
63 /// Returns the notebook window.
64 wxNotebook
* GetNotebookWindow() { return m_notebookWindow
; }
66 /// Returns true if the application should show tooltips.
67 virtual bool UsingTooltips();
69 /// Returns the help controller object for the manual.
70 wxHelpControllerBase
& GetHelpController() { return *m_helpController
; }
72 /// Returns the help controller object for the wxWidgets reference manual.
73 wxHelpControllerBase
& GetReferenceHelpController() { return *m_helpControllerReference
; }
75 /// Returns the document manager object.
76 wxDocManager
* GetDocManager() const { return m_docManager
; }
78 /// Returns the main frame.
79 ctMainFrame
* GetMainFrame();
83 /// Called on application initialisation.
86 /// Called on application exit.
89 /// Loads config info from the registry or a file.
90 virtual bool LoadConfig();
92 /// Saves config info to the registry or a file.
93 virtual bool SaveConfig();
95 /// The help controller needs to be cleared before wxWidgets
97 void ClearHelpControllers() ;
100 /// The application directory.
104 wxNotebook
* m_notebookWindow
;
106 /// The help controller object.
107 wxHelpControllerBase
* m_helpController
;
109 /// The help controller object (reference manual).
110 wxHelpControllerBase
* m_helpControllerReference
;
112 /// The file history.
113 wxFileHistory m_fileHistory
;
115 /// The configuration data.
116 ctSettings m_settings
;
118 /// The document manager.
119 wxDocManager
* m_docManager
;
122 DECLARE_EVENT_TABLE()
127 /////////////////////////////////////////////////
129 /////////////////////////////////////////////////
132 #define ctID_SAVE_SETUP_FILE 1001
133 #define ctID_SAVE_CONFIGURE_COMMAND 1002
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
152 #define ctID_SETTINGS 1020
153 #define ctID_SHOW_TOOLBAR 1021
156 #define ctID_GOTO_WEBSITE 1050
157 #define ctID_ITEM_HELP 1051
158 #define ctID_REFERENCE_CONTENTS 1052
161 #define ctID_TASKBAR_EXIT_APP 1202
162 #define ctID_TASKBAR_SHOW_APP 1203
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
171 /////////////////////////////////////////////////
172 // Window/control ids
173 /////////////////////////////////////////////////
176 #define ctID_SETTINGS_GENERAL 1500
178 // Regenerate setup.h/configure command
179 #define ctID_REGENERATE 1600
182 // _AP_WXCONFIGTOOL_H_