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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_OBJUTILS___TOOL_TIP_INFO_HPP
2 #define GUI_WIDGETS_OBJUTILS___TOOL_TIP_INFO_HPP
3  /* ===========================================================================
4  *
5  * PUBLIC DOMAIN NOTICE
6  * National Center for Biotechnology Information
7  *
8  * This software/database is a "United States Government Work" under the
9  * terms of the United States Copyright Act. It was written as part of
10  * the author's official duties as a United States Government employee and
11  * thus cannot be copyrighted. This software/database is freely available
12  * to the public for use. The National Library of Medicine and the U.S.
13  * Government have not placed any restriction on its use or reproduction.
14  *
15  * Although all reasonable efforts have been taken to ensure the accuracy
16  * and reliability of the software and data, the NLM and the U.S.
17  * Government do not and cannot warrant the performance or results that
18  * may be obtained by using this software or data. The NLM and the U.S.
19  * Government disclaim all warranties, express or implied, including
20  * warranties of performance, merchantability or fitness for any particular
21  * purpose.
22  *
23  * Please cite the author in any work or product based on this material.
24  *
25  * ===========================================================================
26  *
27  * Authors: Bob Falk
28  *
29  * File Description:
30  * CToolTipInfo is a simple container class used to hold information that can
31  * can be used to configure the display of a tooltip including text, title text
32  * and what buttons to display.
33  */
34 
35 #include <corelib/ncbistl.hpp>
36 
37 #include <gui/gui_export.h>
38 
39 
41 
42 /** Contents of a single tool tip including display text and an ID
43  that will indicate which underlying visual element the tip is
44  attached to.
45 */
47 {
48 public:
49 
50  /// Any combination of available buttons can be displayed by or-ing
51  /// the desired options together, or choos eAllOptions for all buttons.
53  ePin = 0x01,
54  eSearch = 0x02,
55  eMagnify = 0x04,
56  eInfo = 0x08,
57  eAllOptions = ePin | eSearch | eMagnify | eInfo
58  };
59 
60  /// Ctor allows override of button options
61  CTooltipInfo(int opt=eAllOptions) : m_ID(""), m_Options(opt) {}
62 
63  /// Set/get display text
64  void SetTipText(const std::string& tip_text) { m_Text = tip_text; }
65  std::string GetTipText() const { return m_Text; }
66 
67  /// Set/get display text
68  void SetTitleText(const std::string& title_text) { m_Title = title_text; }
69  std::string GetTitleText() const { return m_Title; }
70 
71  /// Set/get id that identifies the underlying element
72  void SetTipID(std::string id) { m_ID = id; }
73  std::string GetTipID() const { return m_ID; }
74 
75  /// Set/get options that determine which buttons are displayed
76  void SetToolTipOptions(int opt) { m_Options = opt; }
77  int GetToolTipOptions() const { return m_Options; }
78 
79 protected:
83 
84  int m_Options;
85 };
86 
88 
89 #endif //GUI_WIDGETS_OBJUTILS___TOOL_TIP_INFO_HPP
Contents of a single tool tip including display text and an ID that will indicate which underlying vi...
EToolTipOptions
Any combination of available buttons can be displayed by or-ing the desired options together,...
void SetToolTipOptions(int opt)
Set/get options that determine which buttons are displayed.
std::string m_ID
void SetTitleText(const std::string &title_text)
Set/get display text.
int GetToolTipOptions() const
std::string m_Title
std::string GetTipText() const
std::string GetTitleText() const
std::string m_Text
std::string GetTipID() const
CTooltipInfo(int opt=eAllOptions)
Ctor allows override of button options.
void SetTipText(const std::string &tip_text)
Set/get display text.
void SetTipID(std::string id)
Set/get id that identifies the underlying element.
string
Definition: cgiapp.hpp:687
#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_GUIOBJUTILS_EXPORT
Definition: gui_export.h:512
Defines to provide correct exporting from DLLs in Windows.
The NCBI C++/STL use hints.
Modified on Sat Feb 24 07:46:08 2024 by modify_doxy.py rev. 669887