test_client.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:5k
- /*
- * ===========================================================================
- * PRODUCTION $Log: test_client.hpp,v $
- * PRODUCTION Revision 1000.1 2004/06/01 19:53:39 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.4
- * PRODUCTION
- * ===========================================================================
- */
- #ifndef GUI_WIDGETS_WORKSPACE___TEST_CLIENT_HPP
- #define GUI_WIDGETS_WORKSPACE___TEST_CLIENT_HPP
- /* $Id: test_client.hpp,v 1000.1 2004/06/01 19:53:39 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/ncbistd.hpp>
- #include <gui/widgets/workspace/wm_client.hpp>
- #include <gui/opengl/glcanvas2d.hpp>
- #include <gui/opengl/glpane.hpp>
- #include <gui/opengl/glbitmapfont.hpp>
- #include <gui/opengl/glhelpers.hpp>
- #include <gui/opengl/glcolor.hpp>
- #include <gui/utils/command.hpp>
- #include <FL/Fl_Box.H>
- BEGIN_NCBI_SCOPE
- enum TTestClientCommands {
- eCmdTest = 700,
- eCmdTest1,
- eCmdTest2,
- eCmdTest3
- };
- ////////////////////////////////////////////////////////////////////////////////
- /// CFLTestClient
- /// It can be instantiated to show different behavior depending on type parameter.
- /// type = {1, 2, 3}
- class NCBI_GUIWIDGETS_WORKSPACE_EXPORT CFLTestClient : public Fl_Box,
- public IWMClient,
- public CCommandTarget
- {
- public:
- CFLTestClient(int type, const char* slabel);
- virtual ~CFLTestClient();
- virtual int handle(int event);
- /// @name IWMClient implementation
- /// @{
- virtual string GetLabel(void) const;
- virtual const CMenuItem* GetMenu(void) const { return m_MenuRoot; }
- /// @}
- /// @name Command handling
- /// @{
- DECLARE_CMD_MAP()
- void OnTest(TCmdID cmd);
- void OnUpdateTest(ICmdUI* pCmdUI);
- /// @}
- protected:
- string m_Label, m_StateLabel;
- int m_Type;
- CMenuItem* m_MenuRoot;
- };
- ////////////////////////////////////////////////////////////////////////////////
- /// CFLTestClient
- /// It can be instantiated to show different behavior depending on type parameter.
- /// type = {1, 2, 3}
- class NCBI_GUIWIDGETS_WORKSPACE_EXPORT CGLTestClient : public CGlCanvas2d,
- public IWMClient,
- public CCommandTarget
- {
- public:
- CGLTestClient(int type, const char* slabel);
- virtual ~CGLTestClient();
-
- virtual void draw(void);
- virtual int handle(int event);
- /// @name IWMClient implementation
- /// @{
- virtual string GetLabel(void) const;
- virtual const CMenuItem* GetMenu(void) const { return m_MenuRoot; }
- /// @}
- /// @name Command handling
- /// @{
- DECLARE_CMD_MAP()
- void OnTest(TCmdID cmd);
- void OnUpdateTest(ICmdUI* pCmdUI);
- /// @}
- protected:
- string m_Label, m_StateLabel;
- int m_Type;
- CMenuItem* m_MenuRoot;
- Fl_Color m_Color;
- CGlBitmapFont m_Font;
- };
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: test_client.hpp,v $
- * Revision 1000.1 2004/06/01 19:53:39 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.4
- *
- * Revision 1.4 2004/05/20 13:59:52 dicuccio
- * Added export specifiers
- *
- * Revision 1.3 2004/05/13 17:32:14 yazhuk
- * Extended CGLClient to support command handling
- *
- * Revision 1.2 2004/05/07 14:22:57 yazhuk
- * Extended CLTestClient to implement IWMClient and support command handling
- *
- * Revision 1.1 2004/02/04 19:40:27 yazhuk
- * Initial revision
- *
- * ===========================================================================
- */
- #endif // GUI_WIDGETS_WORKSPACE___TEST_CLIENT_HPP