gehe zur Dokumentation dieser Datei00001
00148 #ifndef __MUTAPP_H_INCLUDED__
00149 #define __MUTAPP_H_INCLUDED__
00150
00152
00153
00154
00155
00156
00157
00158
00160
00161
00162
00163 #include "MutFrame.h"
00164 #include "MutDocManager.h"
00165
00167 WX_DECLARE_HASH_MAP( wxFrame *,
00168 wxFrame *,
00169 wxPointerHash,
00170 wxPointerEqual,
00171 FrameHash);
00172
00173 #if wxUSE_PRINTING_ARCHITECTURE
00174
00175 extern wxPrintData *g_printData;
00176 extern wxPageSetupData *g_pageSetupData;
00177 #endif // wxUSE_PRINTING_ARCHITECTURE
00178
00179
00181
00185 class MutApp : public wxApp
00186 {
00187
00188 friend class AppAbout;
00189
00190 public:
00192 enum MenuType {
00193 ProgramMenu,
00194 EditorMenu,
00195 RouteMenu,
00196 };
00197
00199
00206 bool OnInit();
00207
00209 void OnInitCmdLine(wxCmdLineParser& parser);
00211 bool OnCmdLineParsed(wxCmdLineParser& parser);
00212 #ifdef __WIN32__
00213 void OnUnhandledException() { throw; }
00214 bool OnExceptionInMainLoop() { throw; }
00215 void OnFatalException() { throw; }
00216 #endif
00217
00218
00219 virtual bool ProcessEvent(wxEvent& event);
00220
00222
00223 void PassEventToDocManagerCMD(wxCommandEvent& event);
00224 void PassEventToDocManagerUPD(wxUpdateUIEvent& event);
00225
00227 void OnMRUFile(wxCommandEvent& event);
00228
00230 void CmAbout (wxCommandEvent& event);
00232 void CmSetup (wxCommandEvent& event);
00234 void CmFileNew (wxCommandEvent& event);
00236 void CmFileOpen (wxCommandEvent& event);
00238 void CmRoutes (wxCommandEvent& event);
00240 void CmRouteLoad(wxCommandEvent& event)
00241 {
00242 MutRouteWnd::CmRouteLoad(event);
00243 }
00244
00246 void CmRouteSave(wxCommandEvent& event)
00247 {
00248 MutRouteWnd::CmRouteSave(event);
00249 }
00250
00252 void CmRouteSaveAs(wxCommandEvent& event)
00253 {
00254 MutRouteWnd::CmRouteSaveAs(event);
00255 }
00256
00258 void CmHelp (wxCommandEvent& event);
00260
00263 void ShowHelp(int commandId);
00265 void CmQuit (wxCommandEvent& event);
00266 #ifdef DEBUG
00267
00268
00269 void CmCallExit(wxCommandEvent& event)
00270 {
00271 exit(0);
00272 }
00273 #endif
00274
00276
00280 MutFrame* CreateMainFrame(MenuType type, wxWindowID id = wxID_ANY);
00281
00283
00286 MutFrame* InitMainFrame(MenuType type, MutFrame * frame);
00287
00289
00295 void RegisterFrame(wxFrame * f);
00297
00301 void UnregisterFrame (wxFrame * f);
00302
00304
00317 static wxString GetResourceName(const wxString & file);
00318
00320
00322 virtual int OnExit();
00323
00324 #ifdef __WXMAC__
00325 virtual void MacOpenFile(const wxString &fileName);
00326
00327 #endif
00328
00330
00332 void SaveState();
00333
00335
00337 void RestoreState();
00338
00340
00342 static bool MustOpenFrame(MutFrame * frame)
00343 {
00344 if (frame) {
00345 if (frame->HasClient())
00346 return true;
00347 else return false;
00348 } else return true;
00349 }
00350
00352 const wxDocManager *GetDocumentManager() const { return &document_manager; }
00353
00355 wxDocManager *GetDocumentManager() { return &document_manager; }
00356
00357
00358 private:
00359
00361
00365 wxMenu * MakeFileMenu(wxMenuBar * menuBar, MenuType type);
00366
00368
00372 void MakeEditMenu(wxMenuBar * menuBar, MenuType type);
00373
00375
00378 void MakeLogicMenu(wxMenuBar * menuBar);
00379
00381
00384 void MakeRoutesMenu(wxMenuBar * menuBar);
00385
00387
00391 void MakeViewMenu(wxMenuBar * menuBar, MenuType type);
00392
00394
00397 void MakeSequencerMenu(wxMenuBar * menuBar);
00398
00400
00403 void MakeHelpMenu(wxMenuBar * menuBar);
00404
00405
00406 protected:
00407
00409 wxLocale m_locale;
00410
00412 mutabor::MutDocManager document_manager;
00413
00415 bool quitting;
00416
00417
00418 private:
00419 DECLARE_EVENT_TABLE()
00420 };
00421
00423
00427 class AppAbout : public wxDialog
00428 {
00429
00430 public:
00432
00435 AppAbout (wxWindow *parent=(wxWindow *) NULL, long style = 0);
00436 };
00437
00438
00439 DECLARE_APP(MutApp)
00440
00441
00442
00443 #endif // __MUTAPP_H_INCLUDED__
00444