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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ_GRAPHIC___LEGEND_ITEMD_GLYPH__HPP
2 #define GUI_WIDGETS_SEQ_GRAPHIC___LEGEND_ITEMD_GLYPH__HPP
3 
4 /*
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: Andrei shkeda
30  *
31  * File Description:
32  */
33 
36 
38 
39 
40 
42 {
43 public:
44  virtual ~ILegendHost() {}
45  /// notifies the host about changes of the track.
46  virtual void LH_OnItemDblClick(const string& source_name) = 0;
47  /// notifies the host about changes of the track.
48  virtual void LH_OnItemRightClick(const string& source_name) = 0;
49 
50 };
51 
52 ///////////////////////////////////////////////////////////////////////////////
53 ///
54 
56 {
57 public:
58  CLegendItemGlyph(const string& source_name, const string& label, const string& id,
59  const CRgbaColor& legend_color, const CRgbaColor& text_color);
60 
61  void SetHost(ILegendHost* host);
62  void SetConfig(const CSeqGraphicConfig& config);
63 
64  /// @name CSeqGlyph virtual methods.
65  virtual bool OnLeftDblClick (const TModelPoint &);
66  virtual bool OnContextMenu(wxContextMenuEvent&);
67  virtual void GetHTMLActiveAreas (TAreaVector* p_ares) const;
68  virtual bool IsClickable() const;
69  ///@}
70 
71 protected:
72  virtual void x_Draw() const;
73  virtual void x_UpdateBoundingBox();
74 private:
76  string m_SourceName;
77  string m_Label;
78  string m_Id;
83 };
84 
85 ///////////////////////////////////////////////////////////////////////////////
86 /// CLegendItemGlyph inline methods
87 
88 inline
90 {
91  m_LHost = host;
92 }
93 
94 inline
96 {
98 }
99 
100 
101 inline
103 {
104  return true;
105 }
106 
107 inline
109 {
110 }
111 
112 
114 
115 /* @} */
116 
117 #endif // GUI_WIDGETS_SEQ_GRAPHIC___LEGEND_ITEMD_GLYPH__HPP
ILegendHost * m_LHost
CConstRef< CSeqGraphicConfig > m_gConfig
void SetConfig(const CSeqGraphicConfig &config)
void SetHost(ILegendHost *host)
CLegendItemGlyph inline methods.
virtual bool IsClickable() const
Query if this glyph is clickable.
virtual void x_UpdateBoundingBox()
Update the bounding box assuming children's sizes are fixed if any.
class CRgbaColor provides a simple abstraction for managing colors.
Definition: rgba_color.hpp:58
class CSeqGlyph defines an interface that wraps a rectilinear abstract object.
Definition: seq_glyph.hpp:82
vector< CHTMLActiveArea > TAreaVector
Definition: seq_glyph.hpp:84
virtual void LH_OnItemDblClick(const string &source_name)=0
notifies the host about changes of the track.
virtual void LH_OnItemRightClick(const string &source_name)=0
notifies the host about changes of the track.
virtual ~ILegendHost()
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:1439
#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_SEQGRAPHIC_EXPORT
Definition: gui_export.h:536
static const char label[]
Modified on Fri May 24 14:58:11 2024 by modify_doxy.py rev. 669887