toplevel.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:6k
- /*
- * ===========================================================================
- * PRODUCTION $Log: toplevel.hpp,v $
- * PRODUCTION Revision 1000.0 2003/10/31 20:46:35 gouriano
- * PRODUCTION PRODUCTION: IMPORTED [ORIGINAL] Dev-tree R1.6
- * PRODUCTION
- * ===========================================================================
- */
- #ifndef GUI_WIDGETS_TOPLEVEL___TOPLEVEL__HPP
- #define GUI_WIDGETS_TOPLEVEL___TOPLEVEL__HPP
- /* $Id: toplevel.hpp,v 1000.0 2003/10/31 20:46:35 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: Mike DiCuccio
- *
- * File Description:
- * CTopLevel -- base class for MDI parent window
- */
- #include <corelib/ncbistd.hpp>
- #include <FL/Fl_Double_Window.H>
- #include "child.hpp"
- #include <vector>
- class Fl_Pixmap;
- BEGIN_NCBI_SCOPE
- class CChildFrame;
- class CIconTray;
- //
- // class CTopLevel is the main top-level widget.
- //
- class NCBI_GUIWIDGETS_TOPLEVEL_EXPORT CTopLevel : public Fl_Double_Window
- {
- public:
- // ctors/dtor
- CTopLevel(int x, int y, int wid, int ht, const char* label = NULL);
- ~CTopLevel();
- // Explicitly add a child to the top-level widget.
- void AddChild(CChild* c);
- // FLTK hook: general event processing
- int handle(int event);
- // FLTK hook: resize the top-level
- void resize(int x, int y, int w, int h);
- // Force all windows to cascade. This uses the current window rendering
- // order for layout.
- void Cascade(void);
- // Force all windows to tile across the available space. This uses the
- // current window rendering order for layout.
- void Tile(void);
- //
- // static look-and-feel accessors
- //
- // box type (= border) for system buttons
- static Fl_Boxtype GetSysButtonBox(void);
- static void SetSysButtonBox(Fl_Boxtype box);
- // background color for system buttons
- static Fl_Color GetSysButtonColor(void);
- static void SetSysButtonColor(Fl_Color color);
- // title bar color when selected
- static Fl_Color GetSelectedColor(void);
- static void SetSelectedColor(Fl_Color color);
- // title font type (default = helvetica bold)
- static Fl_Font GetTitleFont(void);
- static void SetTitleFont(Fl_Font font);
- // text color for title
- static Fl_Color GetTitleColor(void);
- static void SetTitleColor(Fl_Color color);
- // size of title text (in pixels)
- static int GetTitleSize(void);
- static void SetTitleSize(int size);
- // bitmask of Fl_Align styles for title. FL_ALIGN_INSIDE is implicit
- static int GetTitleAlign(void);
- static void SetTitleAlign(int align);
- private:
- // We keep an explicit vector of our children, separate from FLTK's array
- typedef vector<CChildFrame*> TChildren;
- TChildren m_Children;
- // The currently selected child
- CChildFrame* m_Selected;
- // our icon tray
- CIconTray* m_IconTray;
- // doodads for window decoration
- Fl_Pixmap* m_MinimizeXPM;
- Fl_Pixmap* m_MaximizeXPM;
- Fl_Pixmap* m_CloseXPM;
- // Positions for proper child window placement.
- int m_LastChildX;
- int m_LastChildY;
- // callbacks for our system buttons and events
- static void x_StaticCB_Close (Fl_Widget*, void*);
- static void x_StaticCB_Maximize(Fl_Widget*, void*);
- static void x_StaticCB_Minimize(Fl_Widget*, void*);
- void x_Close (void);
- void x_Maximize(void);
- void x_Minimize(void);
- // set the currently selected window
- void x_SetSelected(CChildFrame* frame);
- };
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: toplevel.hpp,v $
- * Revision 1000.0 2003/10/31 20:46:35 gouriano
- * PRODUCTION: IMPORTED [ORIGINAL] Dev-tree R1.6
- *
- * Revision 1.6 2003/09/29 15:20:09 dicuccio
- * Deprecated gui/scope.hpp. Merged gui/core/types.hpp into gui/types.hpp
- *
- * Revision 1.5 2003/09/16 14:37:15 dicuccio
- * Cleaned up and clarified export specifiers - added a new specifier for each
- * library
- *
- * Revision 1.4 2003/03/17 15:53:29 dicuccio
- * Added Win32 export specifier
- *
- * Revision 1.3 2003/03/17 14:59:22 dicuccio
- * Lots of clean-ups. Added more explicit destruction pathway to support
- * integration into Genome Workbench.
- *
- * Revision 1.2 2003/03/07 18:15:28 dicuccio
- * Added missing accessors
- *
- * Revision 1.1 2003/03/07 17:50:59 dicuccio
- * Initial revision
- *
- * ===========================================================================
- */
- #endif // GUI_WIDGETS_TOPLEVEL___TOPLEVEL__HPP