home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wxos2233.zip / wxOS2-2_3_3.zip / wxWindows-2.3.3 / contrib / include / wx / fl / frmview.h < prev    next >
C/C++ Source or Header  |  2002-09-08  |  3KB  |  149 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name:        frmview.h
  3. // Purpose:     wxFrameView and wxFrameManager classes.
  4. // Author:      Aleksandras Gluchovas
  5. // Modified by:
  6. // Created:     02/01/99
  7. // RCS-ID:      $Id: frmview.h,v 1.3 2002/09/07 12:10:19 GD Exp $
  8. // Copyright:   (c) Aleksandras Gluchovas
  9. // Licence:     wxWindows licence
  10. /////////////////////////////////////////////////////////////////////////////
  11.  
  12. #ifndef __FRMVIEW_G__
  13. #define __FRMVIEW_G__
  14.  
  15. #if defined(__GNUG__) && !defined(__APPLE__)
  16.     #pragma interface "frmview.h"
  17. #endif
  18.  
  19. #include "wx/module.h"
  20.  
  21. #if 0
  22. #include "wx/fl/objstore.h"
  23. #endif
  24.  
  25. class wxObjectStorage;
  26.  
  27. #include "wx/fl/controlbar.h"
  28.  
  29. class wxFrameManager;
  30.  
  31. /*
  32. It is not clear what this class does. It is not used elsewhere in FL.
  33. */
  34.  
  35. class wxFrameView : public wxEvtHandler
  36. {
  37. protected:
  38.     wxStringList    mTopMenus;
  39.     wxFrameLayout*  mpLayout;
  40.     wxFrameManager* mpFrameMgr;
  41.     bool            mDoToolUpdates;
  42.  
  43.     friend class wxFrameManager;
  44.     friend class wxFrameViewSerializer;
  45.  
  46. protected:
  47.     void OnIdle( wxIdleEvent& event);
  48.  
  49. public:
  50.     wxFrameView();
  51.     ~wxFrameView();
  52.  
  53.     virtual void Activate();
  54.     virtual void Deactivate();
  55.  
  56.     wxFrame* GetParentFrame();
  57.     wxWindow* GetClientWindow();
  58.  
  59.     wxFrameManager& GetFrameManager();
  60.  
  61.     void RegisterMenu( const wxString& topMenuName );
  62.  
  63.     void CreateLayout();
  64.     wxFrameLayout* GetLayout();
  65.     void SetLayout( wxFrameLayout* pLayout );
  66.     void SetToolUpdates( bool doToolUpdates = TRUE );
  67.  
  68.  
  69.     // hooks for specific frame-views
  70.  
  71.     virtual void OnInit() {}
  72.  
  73.     virtual void OnSerialize( wxObjectStorage& store ) {}
  74.     virtual void OnActiveate() {}
  75.     virtual void OnDeactivate() {}
  76.  
  77.     // imp. is mandatory
  78.     virtual void OnRecreate() {}
  79.     virtual void OnInitMenus() {}
  80.  
  81.     DECLARE_EVENT_TABLE()
  82. };
  83.  
  84. class wxFrame;
  85.  
  86. /*
  87. It is not clear what this class does. It is not used elsewhere in FL.
  88. */
  89.  
  90. class wxFrameManager : wxObject
  91. {
  92. protected:
  93.     wxList       mViews;
  94.     wxWindow*    mpFrameWnd;
  95.     int          mActiveViewNo;
  96.     wxWindow*    mpClientWnd;
  97.  
  98. #if 0
  99.     wxObjectStorage mStore;
  100. #endif
  101.  
  102.     wxString        mSettingsFile;
  103.  
  104. protected:
  105.     void DoSerialize( wxObjectStorage& store );
  106.     void DestroyViews();
  107.     int GetViewNo( wxFrameView* pView );
  108.     void EnableMenusForView( wxFrameView* pView, bool enable );
  109.     void SyncAllMenus();
  110.  
  111. public:
  112.     wxFrameManager();
  113.     ~wxFrameManager();
  114.  
  115.     // if file name is empty, views are are not saved/loaded
  116.  
  117.     virtual void Init( wxWindow* pMainFrame, const wxString& settingsFile = "" );
  118.  
  119.     // synonyms
  120.     wxFrame* GetParentFrame();
  121.     wxWindow* GetParentWindow();
  122.  
  123.     int GetActiveViewNo();
  124.     wxFrameView* GetActiveView();
  125.     wxNode* GetActiveViewNode();
  126.  
  127.     wxFrameView* GetView( int viewNo );
  128.  
  129.     void SetClinetWindow( wxWindow* pFrameClient ); 
  130.     wxWindow* GetClientWindow();
  131.  
  132.     void AddView( wxFrameView* pFrmView );
  133.     void RemoveView( wxFrameView* pFrmView );
  134.  
  135.     void ActivateView( int viewNo );
  136.     void ActivateView( wxFrameView* pFrmView );
  137.     void DeactivateCurrentView();
  138.  
  139.     wxObjectStorage& GetObjectStore();
  140.  
  141.     void SaveViewsNow();
  142.     bool ReloadViews();
  143.  
  144.     bool ViewsAreLoaded();
  145. };
  146.  
  147. #endif /* __FRMVIEW_G__ */
  148.  
  149.