Changeset 24022 in webkit
- Timestamp:
- Jul 5, 2007 1:16:06 PM (17 years ago)
- Location:
- trunk/WebKit/win
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/win/ChangeLog
r24000 r24022 1 2007-07-05 Adam Roben <aroben@apple.com> 2 3 Fix Bug 14143: Tooltips not displayed on Windows 4 http://bugs.webkit.org/show_bug.cgi?id=14143 5 <rdar://problem/4719799> 6 7 Reviewed by Oliver. 8 9 * WebChromeClient.cpp: 10 (WebChromeClient::setToolTip): Call up to WebView. 11 * WebView.cpp: 12 (WebView::WebView): Initialize m_toolTipHwnd member. 13 (WebView::initWithFrame): Set up the tool tip window. 14 (initCommonControls): Added. 15 (WebView::initializeToolTipWindow): Added. 16 (WebView::setToolTip): Set the tool tip text and enable/disable the 17 tool tip. 18 * WebView.h: Added/updated declarations. 19 1 20 2007-07-04 Adam Roben <aroben@apple.com> 2 21 -
trunk/WebKit/win/WebChromeClient.cpp
r24000 r24022 439 439 } 440 440 441 void WebChromeClient::setToolTip(const String&) 442 { 443 } 441 void WebChromeClient::setToolTip(const String& toolTip) 442 { 443 m_webView->setToolTip(toolTip); 444 } -
trunk/WebKit/win/WebView.cpp
r23999 r24022 102 102 const int WM_VISTA_MOUSEHWHEEL = 0x020E; 103 103 104 static const int maxToolTipWidth = 250; 105 104 106 static ATOM registerWebView(); 105 107 static LRESULT CALLBACK WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); … … 133 135 , m_smartInsertDeleteEnabled(false) 134 136 , m_didClose(false) 137 , m_toolTipHwnd(0) 135 138 { 136 139 KJS::Collector::registerAsMainThread(); … … 1734 1737 1735 1738 initializeCacheSizesIfNecessary(); 1739 initializeToolTipWindow(); 1736 1740 1737 1741 // Update WebCore with preferences. These values will either come from an archived WebPreferences, … … 1762 1766 } 1763 1767 1768 static bool initCommonControls() 1769 { 1770 static bool haveInitialized = false; 1771 if (haveInitialized) 1772 return true; 1773 1774 INITCOMMONCONTROLSEX init; 1775 init.dwSize = sizeof(init); 1776 init.dwICC = ICC_TREEVIEW_CLASSES; 1777 haveInitialized = !!::InitCommonControlsEx(&init); 1778 return haveInitialized; 1779 } 1780 1781 void WebView::initializeToolTipWindow() 1782 { 1783 if (!initCommonControls()) 1784 return; 1785 1786 m_toolTipHwnd = CreateWindowEx(0, TOOLTIPS_CLASS, 0, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, 1787 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 1788 m_viewWindow, 0, 0, 0); 1789 if (!m_toolTipHwnd) 1790 return; 1791 1792 TOOLINFO info = {0}; 1793 info.cbSize = sizeof(info); 1794 info.uFlags = TTF_IDISHWND | TTF_SUBCLASS ; 1795 info.uId = reinterpret_cast<UINT_PTR>(m_viewWindow); 1796 1797 ::SendMessage(m_toolTipHwnd, TTM_ADDTOOL, 0, reinterpret_cast<LPARAM>(&info)); 1798 ::SendMessage(m_toolTipHwnd, TTM_SETMAXTIPWIDTH, 0, maxToolTipWidth); 1799 1800 ::SetWindowPos(m_toolTipHwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); 1801 } 1802 1803 void WebView::setToolTip(const String& toolTip) 1804 { 1805 if (!m_toolTipHwnd) 1806 return; 1807 1808 if (toolTip == m_toolTip) 1809 return; 1810 1811 m_toolTip = toolTip; 1812 1813 if (!m_toolTip.isEmpty()) { 1814 TOOLINFO info = {0}; 1815 info.cbSize = sizeof(info); 1816 info.uFlags = TTF_IDISHWND; 1817 info.uId = reinterpret_cast<UINT_PTR>(m_viewWindow); 1818 info.lpszText = _wcsdup(m_toolTip.charactersWithNullTermination()); 1819 ::SendMessage(m_toolTipHwnd, TTM_UPDATETIPTEXT, 0, reinterpret_cast<LPARAM>(&info)); 1820 } 1821 1822 ::SendMessage(m_toolTipHwnd, TTM_ACTIVATE, !m_toolTip.isEmpty(), 0); 1823 } 1764 1824 1765 1825 HRESULT STDMETHODCALLTYPE WebView::setUIDelegate( -
trunk/WebKit/win/WebView.h
r23677 r24022 653 653 bool isPainting() const { return m_paintCount > 0; } 654 654 655 void setToolTip(const WebCore::String&); 656 655 657 protected: 656 658 static bool allowSiteSpecificHacks() { return s_allowSiteSpecificHacks; } … … 658 660 bool continuousCheckingAllowed(); 659 661 void initializeCacheSizesIfNecessary(); 662 void initializeToolTipWindow(); 660 663 661 664 ULONG m_refCount; … … 699 702 bool m_didClose; 700 703 704 HWND m_toolTipHwnd; 705 WebCore::String m_toolTip; 706 701 707 static bool s_allowSiteSpecificHacks; 702 708 };
Note: See TracChangeset
for help on using the changeset viewer.