MutFrame.h
gehe zur Dokumentation dieser Datei
00001 
00136 #ifndef MUTFRAME_H
00137 #define MUTFRAME_H
00138 
00139 #include "Global.h"
00140 #include "MutChild.h"
00141 #include "MutEditFile.h"
00142 #include "MutRouteWnd.h"
00143 #include "wx/aui/aui.h"
00144 #include "wx/toolbar.h"
00145 #include "wx/docview.h"
00146 
00148 
00151 namespace mutaborGUI {
00152         class MutView; // see MutView.h
00153         class MutDocument; // see MutDocument.h
00154 }
00155 
00156 using mutaborGUI::MutView;
00157 using mutaborGUI::MutDocument;
00158 
00159 class MutFrame : public wxDocChildFrame
00160 {
00161 
00162 public:
00164 
00167         MutFrame(wxFrame *parent, const wxWindowID id, const wxString& title,
00168                  const wxPoint& pos, const wxSize& size,
00169                  const long style);
00170 
00171         MutFrame(MutDocument *doc,
00172                  MutView *v,
00173                  wxFrame *frame,
00174                  wxWindowID id,
00175                  const wxString& title,
00176                  const wxPoint& pos = wxDefaultPosition,
00177                  const wxSize& size = wxDefaultSize,
00178                  long type = wxDEFAULT_FRAME_STYLE,
00179                  const wxString& name = wxT("Mutabor frame"));
00180 
00181 
00183         virtual ~MutFrame();
00184 
00185 #if wxUSE_TOOLBAR
00186 
00187 
00190         void InitToolBar(wxToolBar* toolBar);
00191 
00192 #endif
00193 
00195 
00198         void PassEventToEditor(wxCommandEvent &event);
00199 
00201 
00205         void EventPassOn(wxCommandEvent& event);
00206 
00208 
00210         void OnClose(wxCloseEvent& event);
00211 
00213 
00214         void OnPaint(wxPaintEvent& event);
00215 
00217 
00218         void CmFileNew(wxCommandEvent& WXUNUSED(event));
00219 
00221         void CmFileOpen(wxCommandEvent& WXUNUSED(event));
00222 
00224         bool OpenFile(wxString path, bool newfile=false);
00225 
00227         bool SetClient (wxWindow * win, const wxString &title);
00228 
00231 
00232         void CmDoActivate(wxCommandEvent& event);
00233 
00234         void RaiseLogic(wxCommandEvent& event);
00235 
00236         wxMenuItem* ClearMenuItem(int id);
00237 
00238         void ClearSubMenu(wxMenuItem * item);
00239 
00240         void DoStop();
00241 
00242         void CmStop(wxCommandEvent& WXUNUSED(event));
00243 
00244         void CmPanic(wxCommandEvent& WXUNUSED(event));
00245 
00246         void CeExecute(wxUpdateUIEvent& event);
00247 
00248         void CeActivate(wxUpdateUIEvent& event);
00249 
00250         void CeStop(wxUpdateUIEvent& event);
00251 
00252         void CmRoutes(wxCommandEvent& event);
00253 
00254         void CmToggleKey(wxCommandEvent& WXUNUSED(event));
00255 
00256         void CmToggleTS(wxCommandEvent& WXUNUSED(event));
00257 
00258         void CmToggleAct(wxCommandEvent& WXUNUSED(event));
00259 
00260         void CmToggleOWM(wxCommandEvent& WXUNUSED(event));
00261 
00262         void CmToggleCAW(wxCommandEvent& WXUNUSED(event));
00263 
00264         void CeToggleKey(wxUpdateUIEvent& event);
00265 
00266         void CeToggleTS(wxUpdateUIEvent& event);
00267 
00268         void CeToggleAct(wxUpdateUIEvent& event);
00269 
00270         void CeToggleOWM(wxUpdateUIEvent& event);
00271 
00272         void CeToggleCAW(wxUpdateUIEvent& event);
00273 
00274         // Recorder-Knˆpfe
00275         void CmInDevStop(wxCommandEvent& WXUNUSED(event));
00276 
00277         void CmInDevPlay(wxCommandEvent& WXUNUSED(event));
00278 
00279         void CmInDevPause(wxCommandEvent& WXUNUSED(event));
00280 
00281         void StopInDev();
00282 
00283         void CeInDevStop(wxUpdateUIEvent& event);
00284 
00285         void CeInDevPlay(wxUpdateUIEvent& event);
00286 
00287         void CeInDevPause(wxUpdateUIEvent& event);
00288 
00289         void CmSetTitle(wxCommandEvent& event);
00290 
00292         void UpdateUI(wxCommandEvent& WXUNUSED(event));
00293 
00294         //      void OnIdle(wxIdleEvent& WXUNUSED(event));
00295 
00296         //    void OnActivate(wxActivateEvent& event);
00297         void OnEraseBackground(wxEraseEvent& event);
00298 
00299         void OnSize(wxSizeEvent& event);
00300 
00301         wxAuiDockArt* GetDockArt();
00302 
00303         void WindowSize(MutChild *win);
00304 
00305         void SaveState();
00306 
00307         void RestoreState();
00308 
00309         void LogicWinOpen(int box);
00310 
00311         void ToggleTextBox(WinKind kind);
00312 
00313         void TextBoxOpen(WinKind kind, int box);
00314 
00315         void CmSelectBox();
00316 
00317         void CmCloseChild();
00318 
00319         void CloseAll(WinKind kind);
00320 
00321         void SetStatus(int WXUNUSED(imgNr))
00322         {
00323                 //StatusGadget->SelectImage(curStatusImg = imgNr, true);
00324         }
00325 
00326         wxRect DetermineFrameSize ();
00327 
00329         bool HasClient()
00330         {
00331                 return (bool) client;
00332         }
00333 
00334         void UpdateBoxMenu();
00335         bool RaiseTheFrame();
00336 
00337         static void repaint_route()
00338         {
00339                 MutFrame * routewin = dynamic_cast<MutFrame *>(FindWindowById(WK_ROUTE));
00340 
00341                 if (routewin) {
00342                         MutRouteWnd * route = dynamic_cast<MutRouteWnd *> (routewin->client);
00343 
00344                         if (route) route->Refresh();
00345                 }
00346         }
00347 
00348         void SetFileMenu(wxMenu * f) { filemenu = f; }
00349         void SetEditMenu(wxMenu * e) { editmenu = e; }
00350 private:
00351 
00352         wxMenu * editmenu;
00353         wxMenu * filemenu;
00354         
00355         void CloseClientWindow(wxWindow * w)
00356         {
00357                 wxASSERT(w);
00358                 if (!w) return;
00359 
00360                 w->Disable();
00361                 auimanager.ClosePane(auimanager.GetPane(w));
00362                 DEBUGLOG(other, _T("Detaching pane."));
00363                 auimanager.DetachPane(w);
00364                 auimanager.Update();
00365 
00366                 DEBUGLOG(other, _T("Closing window."));
00367                 w->Close(); // win should be invalid now.
00368         }
00369 
00370         int curStatusImg;
00371 
00372         wxAuiManager auimanager;
00373 
00374         wxWindow *keywindows[MAX_BOX];
00375         wxWindow *tswindows[MAX_BOX];
00376         wxWindow *actionwindows[MAX_BOX];
00377 
00378         wxWindow *client;
00379 
00380         static MutFrame * ActiveWindow;
00381 
00382         static int boxCommandIds[MAX_BOX];
00383 
00384         DECLARE_EVENT_TABLE()
00385 };
00386 
00387 // globals
00388 
00389 extern bool asTS;
00390 
00391 extern bool SaveEditor;
00392 
00393 extern bool UseColorBars;
00394 
00395 extern bool OWM; // One Window Mode
00396 
00397 extern bool CAW; // Common Action Window
00398 
00399 extern bool LogicOn;
00400 
00401 extern int curBox;
00402 
00404 extern bool BoxUsed[MAX_BOX];
00405 
00407 void CheckBoxesUsed();
00408 
00409 extern wxString CompiledFile;
00410 
00411 extern wxString curLogic[MAX_BOX];
00412 
00413 extern wxString curTS[MAX_BOX];
00414 
00415 extern int curTaste[MAX_BOX][2];
00416 
00417 extern bool TextBoxWanted[][3];
00418 
00419 #endif

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