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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_GL___TOOLTIP_WND__HPP
2 #define GUI_WIDGETS_GL___TOOLTIP_WND__HPP
3 
4 /* $Id: tooltip_wnd.hpp 22678 2010-12-10 17:44:07Z katargir $
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:
30  */
31 
32 #include <corelib/ncbistd.hpp>
33 
34 /*!
35  * Includes
36  */
37 
38 ////@begin includes
39 ////@end includes
40 
41 #include <wx/frame.h>
42 
43 class wxStaticText;
44 
46 
47 /*!
48  * Forward declarations
49  */
50 
51 ////@begin forward declarations
52 class CTooltipWnd;
53 ////@end forward declarations
54 
55 class CTooltip;
56 
57 /*!
58  * Control identifiers
59  */
60 
61 ////@begin control identifiers
62  //wxNO_BORDER|wxTAB_TRAVERSAL
63 // FRAME_TOOL_WINDOW keeps it from taking focus. Without that calling Raise() on the ur-parent
64 // of the gl window was the only way to keep focus on MAC (but that causes a flash).
65 #define SYMBOL_CTOOLTIPWND_STYLE wxFRAME_TOOL_WINDOW|wxFRAME_FLOAT_ON_PARENT|wxFRAME_NO_TASKBAR
66 #define SYMBOL_CTOOLTIPWND_IDNAME ID_CTOOLTIPWND
67 #define SYMBOL_CTOOLTIPWND_SIZE wxSize(0, 0)
68 #define SYMBOL_CTOOLTIPWND_POSITION wxDefaultPosition
69 ////@end control identifiers
70 
71 /*!
72  * CTooltipWnd class declaration
73  */
74 
75 class CTooltipWnd: public wxFrame
76 {
77  DECLARE_DYNAMIC_CLASS( CTooltipWnd )
78  DECLARE_EVENT_TABLE()
79 
80 public:
81  /// Constructors
82  CTooltipWnd();
83  CTooltipWnd(CTooltip* tooltip);
84 
85  /// Creation
86  bool Create(wxWindow* parent,
87  wxWindowID id = ID_CTOOLTIPWND,
88  const wxString& title = wxEmptyString,
89  const wxPoint& pos = SYMBOL_CTOOLTIPWND_POSITION,
90  const wxSize& size = SYMBOL_CTOOLTIPWND_SIZE,
91  long style = SYMBOL_CTOOLTIPWND_STYLE);
92 
93  /// Destructor
94  ~CTooltipWnd();
95 
96  /// Initialises member variables
97  void Init();
98 
99  /// Creates the controls and sizers
100  void CreateControls();
101 
102 ////@begin CTooltipWnd event handler declarations
103 
104  /// All mouse events event handler for ID_CTOOLTIPWND
105  void OnMouse( wxMouseEvent& event );
106 
107 ////@end CTooltipWnd event handler declarations
108 
109 ////@begin CTooltipWnd member function declarations
110 
111  wxString GetTooltipText() const { return m_TooltipText ; }
112  void SetTooltipText(wxString value) { m_TooltipText = value ; }
113 
114  /// Retrieves bitmap resources
115  wxBitmap GetBitmapResource( const wxString& name );
116 
117  /// Retrieves icon resources
118  wxIcon GetIconResource( const wxString& name );
119 ////@end CTooltipWnd member function declarations
120 
121  /// Should we show tooltips?
122  static bool ShowToolTips();
123 
124 ////@begin CTooltipWnd member variables
125  wxStaticText* m_TooltipCtrl;
126 private:
127  wxString m_TooltipText;
128  /// Control identifiers
129  enum {
130  ID_CTOOLTIPWND = 10000,
131  ID_PANEL1 = 10002
132  };
133 ////@end CTooltipWnd member variables
134 
136 };
137 
139 
140 #endif // GUI_WIDGETS_GL___TOOLTIP_WND__HPP
wxStaticText * m_TooltipCtrl
void Init()
Initialises member variables.
void CreateControls()
Creates the controls and sizers.
~CTooltipWnd()
Destructor.
CTooltip * m_Tooltip
wxString GetTooltipText() const
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void SetTooltipText(wxString value)
void OnMouse(wxMouseEvent &event)
All mouse events event handler for ID_CTOOLTIPWND.
bool Create(wxWindow *parent, wxWindowID id=ID_CTOOLTIPWND, const wxString &title=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(0, 0), long style=wxFRAME_TOOL_WINDOW|wxFRAME_FLOAT_ON_PARENT|wxFRAME_NO_TASKBAR)
Creation.
Definition: tooltip_wnd.cpp:83
wxString m_TooltipText
CTooltipWnd()
Constructors.
Definition: tooltip_wnd.cpp:69
static bool ShowToolTips()
Should we show tooltips?
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
#define SYMBOL_CTOOLTIPWND_POSITION
Definition: tooltip_wnd.hpp:68
#define SYMBOL_CTOOLTIPWND_SIZE
Definition: tooltip_wnd.hpp:67
#define SYMBOL_CTOOLTIPWND_STYLE
Definition: tooltip_wnd.hpp:65
Modified on Fri Sep 20 14:57:02 2024 by modify_doxy.py rev. 669887