]>
git.saurik.com Git - wxWidgets.git/blob - src/os2/tooltip.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: msw/tooltip.cpp
3 // Purpose: wxToolTip class implementation for MSW
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #include "wx/wxprec.h"
28 #include "wx/tooltip.h"
29 #include "wx/os2/private.h"
31 // ----------------------------------------------------------------------------
33 // ----------------------------------------------------------------------------
35 // ----------------------------------------------------------------------------
37 // ----------------------------------------------------------------------------
46 } // end of wxToolTip::wxToolTip
48 wxToolTip::~wxToolTip()
51 ::WinDestroyWindow(m_hWnd
);
52 } // end of wxToolTip::~wxToolTip
54 void wxToolTip::Create(
58 ULONG lStyle
= ES_READONLY
| ES_MARGIN
| ES_CENTER
;
62 m_hWnd
= ::WinCreateWindow( HWND_DESKTOP
74 wxLogError(_T("Unable to create tooltip window"));
76 wxColour
vColor( wxT("YELLOW") );
77 lColor
= (LONG
)vColor
.GetPixel();
78 ::WinSetPresParam( m_hWnd
83 strcpy(zFont
, "8.Helv");
84 ::WinSetPresParam( m_hWnd
89 } // end of wxToolTip::Create
91 void wxToolTip::DisplayToolTipWindow(
96 LONG lY
= rPoint
.y
- 30;
100 lWidth
= m_sText
.Length() * 8;
102 ::WinSetWindowPos( m_hWnd
108 ,SWP_MOVE
| SWP_SIZE
| SWP_SHOW
110 } // end of wxToolTip::DisplayToolTipWindow
112 void wxToolTip::HideToolTipWindow()
114 ::WinShowWindow(m_hWnd
, FALSE
);
115 } // end of wxToolTip::HideToolTipWindow
117 void wxToolTip::SetTip(
118 const wxString
& rsTip
125 ::WinQueryWindowPos(m_hWnd
, &vSwp
);
127 lWidth
= rsTip
.Length() * 8;
129 ::WinSetWindowPos( m_hWnd
135 ,SWP_MOVE
| SWP_SIZE
| SWP_SHOW
137 } // end of wxToolTip::SetTip
139 #endif // wxUSE_TOOLTIPS