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.
102 /// Global print data, to remember settings during the session.
103 wxPrintData m_printData
;
105 /// Global page setup data.
106 wxPageSetupDialogData m_pageSetupData
;
109 wxNotebook
* m_notebookWindow
;
111 /// The help controller object.
112 wxHelpControllerBase
* m_helpController
;
114 /// The help controller object (reference manual).
115 wxHelpControllerBase
* m_helpControllerReference
;
117 /// The file history.
118 wxFileHistory m_fileHistory
;
120 /// The configuration data.
121 ctSettings m_settings
;
123 /// The document manager.
124 wxDocManager
* m_docManager
;
127 DECLARE_EVENT_TABLE()
132 /////////////////////////////////////////////////
134 /////////////////////////////////////////////////
137 #define ctID_SAVE_SETUP_FILE 1001
138 #define ctID_SAVE_CONFIGURE_COMMAND 1002
142 #define ctID_ADD_ITEM 1030
143 #define ctID_ADD_ITEM_CHECKBOX 1031
144 #define ctID_ADD_ITEM_RADIOBUTTON 1032
145 #define ctID_ADD_ITEM_STRING 1033
146 #define ctID_ADD_ITEM_GROUP 1034
147 #define ctID_ADD_ITEM_CHECK_GROUP 1035
148 #define ctID_ADD_ITEM_RADIO_GROUP 1036
149 #define ctID_DELETE_ITEM 1037
150 #define ctID_RENAME_ITEM 1038
151 #define ctID_CUSTOM_PROPERTY 1039
152 #define ctID_ADD_CUSTOM_PROPERTY 1040
153 #define ctID_EDIT_CUSTOM_PROPERTY 1041
154 #define ctID_DELETE_CUSTOM_PROPERTY 1042
157 #define ctID_SETTINGS 1020
158 #define ctID_SHOW_TOOLBAR 1021
161 #define ctID_GOTO_WEBSITE 1050
162 #define ctID_ITEM_HELP 1051
163 #define ctID_REFERENCE_CONTENTS 1052
166 #define ctID_TASKBAR_EXIT_APP 1202
167 #define ctID_TASKBAR_SHOW_APP 1203
170 #define ctID_TREE_PASTE_BEFORE 1300
171 #define ctID_TREE_PASTE_AFTER 1301
172 #define ctID_TREE_PASTE_AS_CHILD 1302
173 #define ctID_TREE_COPY 1303
174 #define ctID_TREE_CUT 1304
176 /////////////////////////////////////////////////
177 // Window/control ids
178 /////////////////////////////////////////////////
181 #define ctID_SETTINGS_GENERAL 1500
183 // Regenerate setup.h/configure command
184 #define ctID_REGENERATE 1600
187 // _AP_WXCONFIGTOOL_H_