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