void TooltipManagerWin::OnMouse(UINT u_msg, WPARAM w_param, LPARAM l_param) { gfx::Point mouse_pos(l_param); if(u_msg>=WM_NCMOUSEMOVE && u_msg<=WM_NCXBUTTONDBLCLK) { // NC message coordinates are in screen coordinates. POINT temp = mouse_pos.ToPOINT(); ::MapWindowPoints(HWND_DESKTOP, GetParent(), &temp, 1); mouse_pos.SetPoint(temp.x, temp.y); } if(u_msg!=WM_MOUSEMOVE || last_mouse_pos_!=mouse_pos) { last_mouse_pos_ = mouse_pos; HideKeyboardTooltip(); UpdateTooltip(mouse_pos); } // Forward the message onto the tooltip. MSG msg; msg.hwnd = GetParent(); msg.message = u_msg; msg.wParam = w_param; msg.lParam = l_param; SendMessage(tooltip_hwnd_, TTM_RELAYEVENT, 0, (LPARAM)&msg); }
void TooltipManagerWin::TooltipTextChanged(View* view) { if(view == last_tooltip_view_) { UpdateTooltip(last_mouse_pos_); } }
void CPlayerSeekBar::OnMouseMove(UINT nFlags, CPoint point) { if (GetCapture() == this && (nFlags & MK_LBUTTON)) { MoveThumb(point); VERIFY(SetTimer(TIMER_HOVER_CAPTURED, HOVER_CAPTURED_TIMEOUT, nullptr)); } if (AfxGetAppSettings().fUseTimeTooltip) { UpdateTooltip(point); } }
/////////////////////////////////////////////////////////////////////////////////// // class CDocStructRecord implementation /////////////////////////////////////////////////////////////////////////////////// CDocStructRecord::CDocStructRecord(CDocumentStructure* pContainer, void* pvData, bool bIsExpanded, int nCurrentLayout, UINT nImageIndex, bool bEdtiOnDblClick) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); m_pContainer = pContainer; m_pvData = pvData; m_bIsExpanded = bIsExpanded; m_nCurrentLayout = nCurrentLayout; m_pItemText = (CDocStructRecordItem*)AddItem(new CDocStructRecordItem(pContainer->GetName(m_pvData), pContainer->GetType(m_pvData), bEdtiOnDblClick)); UpdateTooltip(); m_pItemText->m_nImageIndex = nImageIndex; }
void Applet::UpdateLanguage() { // 1. get main thread ID of currently active application // 2. get language of this thread // 3. compare to currently displayed language // 4. if not the same: update language, tooltip and initiate redraw DWORD threadId = GetCurrentActiveThread(); LCID currentLang = GetLocaleId(threadId); if (currentLang != displayLang) { displayLang = currentLang; UpdateLabel(displayLang); UpdateTooltip(displayLang); // UpdateGUI(); DrawAlphaBlend(); } }
nsresult TaskbarPreview::UpdateTaskbarProperties() { nsresult rv = UpdateTooltip(); // If we are the active preview and our window is the active window, restore // our active state - otherwise some other non-preview window is now active // and should be displayed as so. if (sActivePreview == this) { if (mWnd == ::GetActiveWindow()) { nsresult rvActive = ShowActive(PR_TRUE); if (NS_FAILED(rvActive)) rv = rvActive; } else { sActivePreview = nsnull; } } return rv; }
QNodeItem::QNodeItem(QTransferFunctionItem* pTransferFunctionItem, QNode* pNode) : QGraphicsEllipseItem(pTransferFunctionItem), m_pTransferFunctionItem(pTransferFunctionItem), m_pNode(pNode), m_Cursor(), m_LastPos(), m_CachePen(), m_CacheBrush(), m_SuspendUpdate(false) { // Styling setBrush(QNodeItem::m_BrushNormal); setPen(QNodeItem::m_PenNormal); // Make item movable setFlag(QGraphicsItem::ItemIsMovable); setFlag(QGraphicsItem::ItemSendsGeometryChanges); setFlag(QGraphicsItem::ItemIsSelectable); // Tooltip UpdateTooltip(); setParentItem(m_pTransferFunctionItem); };
NS_IMETHODIMP TaskbarPreview::SetTooltip(const nsAString &aTooltip) { mTooltip = aTooltip; return CanMakeTaskbarCalls() ? UpdateTooltip() : NS_OK; }