workspace.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:5k
- /*
- * ===========================================================================
- * PRODUCTION $Log: workspace.hpp,v $
- * PRODUCTION Revision 1000.1 2004/06/01 19:53:56 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.3
- * PRODUCTION
- * ===========================================================================
- */
- #ifndef GUI_WIDGETS_WORKSPACE___WORKSPACE_HPP
- #define GUI_WIDGETS_WORKSPACE___WORKSPACE_HPP
- /* $Id: workspace.hpp,v 1000.1 2004/06/01 19:53:56 gouriano Exp $
- * ===========================================================================
- *
- * PUBLIC DOMAIN NOTICE
- * National Center for Biotechnology Information
- *
- * This software/database is a "United States Government Work" under the
- * terms of the United States Copyright Act. It was written as part of
- * the author's official duties as a United States Government employee and
- * thus cannot be copyrighted. This software/database is freely available
- * to the public for use. The National Library of Medicine and the U.S.
- * Government have not placed any restriction on its use or reproduction.
- *
- * Although all reasonable efforts have been taken to ensure the accuracy
- * and reliability of the software and data, the NLM and the U.S.
- * Government do not and cannot warrant the performance or results that
- * may be obtained by using this software or data. The NLM and the U.S.
- * Government disclaim all warranties, express or implied, including
- * warranties of performance, merchantability or fitness for any particular
- * purpose.
- *
- * Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Authors: Andrey Yazhuk
- *
- * File Description:
- *
- */
- #include <corelib/ncbistl.hpp>
- #include <corelib/ncbistd.hpp>
- #include <gui/widgets/workspace/window_manager.hpp>
- #include <gui/widgets/fl/tree_browser.hpp>
- #include <gui/widgets/fl/splitter.hpp>
- #include <gui/widgets/fl/menu_window.hpp>
- #include <FL/Fl_Group.H>
- BEGIN_NCBI_SCOPE
- ///////////////////////////////////////////////////////////////////////////////
- /// CClientBrowser
- class NCBI_GUIWIDGETS_WORKSPACE_EXPORT CClientBrowser : public CTreeBrowser
- {
- public:
- CClientBrowser(int x, int y, int w, int h);
- void AddClient(IWMClient* client);
- void Update(CWindowManager& manager);
- void GetSelectedClients(vector<IWMClient*>& clients);
- protected:
- typedef map<IWMClient*, Node*> TClientToNodeMap;
- TClientToNodeMap m_ClientToNode;
- };
- ///////////////////////////////////////////////////////////////////////////////
- /// CWorkspace
- /// EWorkspaceCommands - defintions of the commands supported by CWorkspace.
- enum EWorkspaceCommands {
- eCmdNewClient = 5500,
- eCmdNewClientInTab,
- eCmdActivateClient,
- eCmdDockClient,
- eCmdUndockClient,
- eCmdHideClient,
- eCmdMaximizeClient,
- eCmdMinimizeClient,
- eCmdRestoreClient
- };
- /// CWorkspace - top-level GUI component for workspace-type applications.
- ///
- /// CWorkspace represents a GUI component playing role of desktop, top-level frame
- /// and window manager for applications supporting multiple documents and views.
- class NCBI_GUIWIDGETS_WORKSPACE_EXPORT CWorkspace : public Fl_Group,
- public CCommandTarget,
- public IWindowManagerObserver,
- public IFrameWindowClient
- {
- public:
- CWorkspace(int x, int y, int w, int h, const char* label = 0);
- virtual ~CWorkspace();
- /// @name IWindowManagerObserver implementation
- /// @{
- virtual void OnClientChanged(IWMClient* client);
- /// @}
- /// @name IFrameWindowClient implementation
- /// @{
- virtual void SetFrameWindow(CFrameWindow* frame);
- virtual const CMenuItem* GetMenu() const;
- /// @}
- // command handlers
- void OnNewClient();
- void OnNewClientInTab();
- void OnActivateClient();
- void OnDockClient();
- void OnUndockClient();
- void OnHideClient();
- void OnMaximizeClient();
- void OnMinimizeClient();
- void OnRestoreClient();
-
- protected:
- DECLARE_CMD_MAP();
-
- typedef vector<IWMClient*> TClients;
-
- void x_DoFrameClientCmd(CWindowManager::EFrameCmd cmd);
- public:
- CMenuItem* m_MenuRoot;
- //CMenuBar1* m_pMenuBar;
- CSplitter* m_pRootSplitter;
- CSplitter* m_pLeftSplitter;
- CClientBrowser* m_pClientBrowser;
- CWindowManager* m_WindowManager;
- CFrameWindow* m_FrameWindow;
- int m_ClientsCount;
- };
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: workspace.hpp,v $
- * Revision 1000.1 2004/06/01 19:53:56 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.3
- *
- * Revision 1.3 2004/05/20 12:24:55 dicuccio
- * Added export specifiers
- *
- * Revision 1.2 2004/05/07 14:24:35 yazhuk
- * Implemented IFrameWindowClient interface; refactoring
- *
- * Revision 1.1 2004/02/04 19:39:35 yazhuk
- * Initial revision
- *
- * ===========================================================================
- */
- #endif // GUI_WIDGETS_WORKSPACE___WORKSPACE_HPP