]>
git.saurik.com Git - wxWidgets.git/blob - src/os2/tooltip.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/os2/tooltip.cpp
3 // Purpose: wxToolTip class implementation for MSW
4 // Author: David Webster
7 // Copyright: (c) David Webster
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 #include "wx/wxprec.h"
27 #include "wx/tooltip.h"
28 #include "wx/os2/private.h"
30 // ----------------------------------------------------------------------------
32 // ----------------------------------------------------------------------------
34 // ----------------------------------------------------------------------------
36 // ----------------------------------------------------------------------------
45 } // end of wxToolTip::wxToolTip
47 wxToolTip::~wxToolTip()
50 ::WinDestroyWindow(m_hWnd
);
51 } // end of wxToolTip::~wxToolTip
53 void wxToolTip::Create(
57 ULONG lStyle
= ES_READONLY
| ES_MARGIN
| ES_CENTER
;
61 m_hWnd
= ::WinCreateWindow( HWND_DESKTOP
74 wxLogError(wxT("Unable to create tooltip window"));
77 wxColour
vColor( wxT("YELLOW") );
78 lColor
= (LONG
)vColor
.GetPixel();
79 ::WinSetPresParam( m_hWnd
84 strcpy(zFont
, "8.Helv");
85 ::WinSetPresParam( m_hWnd
90 } // end of wxToolTip::Create
92 void wxToolTip::DisplayToolTipWindow(
97 LONG lY
= rPoint
.y
- 30;
101 lWidth
= m_sText
.Length() * 8;
103 ::WinSetWindowPos( m_hWnd
109 ,SWP_MOVE
| SWP_SIZE
| SWP_SHOW
111 } // end of wxToolTip::DisplayToolTipWindow
113 void wxToolTip::HideToolTipWindow()
115 ::WinShowWindow(m_hWnd
, FALSE
);
116 } // end of wxToolTip::HideToolTipWindow
118 void wxToolTip::SetTip(
119 const wxString
& rsTip
126 ::WinQueryWindowPos(m_hWnd
, &vSwp
);
128 lWidth
= rsTip
.Length() * 8;
130 ::WinSetWindowPos( m_hWnd
136 ,SWP_MOVE
| SWP_SIZE
| SWP_SHOW
138 } // end of wxToolTip::SetTip
140 #endif // wxUSE_TOOLTIPS