]>
git.saurik.com Git - wxWidgets.git/blob - src/os2/tooltip.cpp
38d58abce4ab8c6ede411b4d19d832edc253ab6e
   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 license 
  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
; 
  63     m_hWnd 
= ::WinCreateWindow( HWND_DESKTOP
 
  75         wxLogError("Unable to create tooltip window"); 
  77     vColor
.InitFromName("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() * 13; 
 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