]>
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 
   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
 
  75         wxLogError(wxT("Unable to create tooltip window")); 
  78     wxColour                        
vColor( wxT("YELLOW") ); 
  79     lColor 
= (LONG
)vColor
.GetPixel(); 
  80     ::WinSetPresParam( m_hWnd
 
  85     strcpy(zFont
, "8.Helv"); 
  86     ::WinSetPresParam( m_hWnd
 
  91 } // end of wxToolTip::Create 
  93 void wxToolTip::DisplayToolTipWindow( 
  98     LONG                            lY 
= rPoint
.y 
- 30; 
 102     lWidth 
= m_sText
.Length() * 8; 
 104     ::WinSetWindowPos( m_hWnd
 
 110                       ,SWP_MOVE 
| SWP_SIZE 
| SWP_SHOW
 
 112 } // end of wxToolTip::DisplayToolTipWindow 
 114 void wxToolTip::HideToolTipWindow() 
 116     ::WinShowWindow(m_hWnd
, FALSE
); 
 117 } // end of wxToolTip::HideToolTipWindow 
 119 void wxToolTip::SetTip( 
 120   const wxString
&                   rsTip
 
 127     ::WinQueryWindowPos(m_hWnd
, &vSwp
); 
 129     lWidth 
= rsTip
.Length() * 8; 
 131     ::WinSetWindowPos( m_hWnd
 
 137                       ,SWP_MOVE 
| SWP_SIZE 
| SWP_SHOW
 
 139 } // end of wxToolTip::SetTip 
 141 #endif // wxUSE_TOOLTIPS