NCBI C++ ToolKit
alnmulti_header.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef __GUI_WIDGETS_ALNMULTI___ALNMULTI_HEADER__HPP
2 #define __GUI_WIDGETS_ALNMULTI___ALNMULTI_HEADER__HPP
3 
4 /* $Id: alnmulti_header.hpp 31702 2014-11-06 19:57:35Z falkrb $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Andrey Yazhuk
30  *
31  * File Description:
32  *
33  */
34 
35 #include <gui/opengl/gldlist.hpp>
36 
37 #include <gui/opengl/glpane.hpp>
39 
42 
44 
45 
47 
48 
49 ////////////////////////////////////////////////////////////////////////////////
50 /// IAlnMultiHeaderContext
52 {
53 public:
55 
56  /// SColumn describes a single column
57  struct SColumn {
58  string m_Name;
59  int m_Pos; /// horizontal position in viewport
60  int m_Width; /// width in pixels
61  int m_UserData; /// can be used to identify column
62  bool m_Visible;
64 
65  SColumn();
66  inline int VisibleWidth() const { return m_Visible ? m_Width : 0; }
67  inline int Right() const { return m_Pos + (m_Visible ? m_Width - 1 : 0); }
68  };
69 
71 
72  virtual int GetColumnsCount() const = 0;
73  virtual const SColumn& GetColumn(int index) const = 0;
74  virtual int GetColumnIndexByX(int x) const = 0;
75  virtual int GetResizableColumnIndex() const = 0;
76 };
77 
78 ////////////////////////////////////////////////////////////////////////////////
79 /// CAlnMultiHeader
81  : public CRenderableImpl
82 {
83 public:
86 
87  class CStyle
88  {
89  public:
93 
95 
96  CStyle();
97  };
98 
100  ~CAlnMultiHeader();
101 
102  virtual void SetContext(IAlnMultiHeaderContext* context);
103 
104  /// @name IRenderable implementation
105  /// @{
106  virtual void Render(CGlPane& pane);
107 
108  virtual TVPPoint PreferredSize();
109 
110  virtual bool NeedTooltip(CGlPane& pane, int vp_x, int vp_y);
111  virtual string GetTooltip();
112  /// @}
113 
114  virtual void RenderColumnHeader(int index, const TVPRect& rc);
115 
116  const CStyle& GetStyle() const;
117  CStyle& GetStyle();
118  void SetStyle(const CStyle& style);
119 
120 protected:
121  void x_RenderBox(const TVPRect& rc);
122 
123 protected:
126 
129 };
130 
131 ////////////////////////////////////////////////////////////////////////////////
132 /// CAlnMultiHeaderStyle
133 
135 
136 #endif // __GUI_WIDGETS_ALNMULTI___ALNMULTI_HEADER__HPP
CAlnMultiHeader.
IAlnMultiHeaderContext::SColumn TColumn
IAlnMultiHeaderContext TContext
class CGlPane
Definition: glpane.hpp:62
CRenderableImpl.
Definition: irenderable.hpp:82
class CRgbaColor provides a simple abstraction for managing colors.
Definition: rgba_color.hpp:58
IAlnMultiHeaderContext.
virtual int GetColumnIndexByX(int x) const =0
virtual int GetColumnsCount() const =0
virtual int GetResizableColumnIndex() const =0
IAlnExplorer::ESortState TSortState
virtual const SColumn & GetColumn(int index) const =0
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUIWIDGETS_ALNMULTIPLE_EXPORT
Definition: gui_export.h:520
SColumn describes a single column.
int m_Width
horizontal position in viewport
bool m_Visible
can be used to identify column
static CS_CONTEXT * context
Definition: will_convert.c:21
Modified on Sat Jun 01 11:58:54 2024 by modify_doxy.py rev. 669887