MutApp.h
gehe zur Dokumentation dieser Datei
00001 
00148 #ifndef __MUTAPP_H_INCLUDED__
00149 #define __MUTAPP_H_INCLUDED__
00150 
00152 // Name:        MutApp.h
00153 // Purpose:     Mutabor Application
00154 // Author:      R. Krauße
00155 // Modified by:
00156 // Created:     12.08.05
00157 // Copyright:   (c) R. Krauße
00158 // Licence:     wxWindows license
00160 
00161 //#include "Defs.h"
00162 //#include "wx/intl.h"
00163 #include "MutFrame.h"
00164 #include "MutDocManager.h"
00165 
00167 WX_DECLARE_HASH_MAP( wxFrame *,      // type of the keys
00168                      wxFrame *,    // type of the values
00169                      wxPointerHash,     // hasher
00170                      wxPointerEqual,   // key equality predicate
00171                      FrameHash); // name of the class
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         // Extend event processing to search the document manager's event table
00219         virtual bool ProcessEvent(wxEvent& event);
00220         
00222         // some compilers do not support overloading in event tables
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 

Erzeugt am Sun Aug 21 2011 10:51:54 für Mutabor von doxygen 1.7.4