void FWwiseEventDragDropOp::SetCanDrop(bool InCanDrop) { CanDrop = InCanDrop; SetTooltipText(); if( InCanDrop ) { MouseCursor = EMouseCursor::GrabHandClosed; SetToolTip(GetTooltipText(), NULL); } else { MouseCursor = EMouseCursor::SlashedCircle; SetToolTip(GetTooltipText(), FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.Error"))); } }
void COXToolTipCtrl::DisplayToolTip(CPoint& pt, BOOL bExtended /*= FALSE*/) { ASSERT(::IsWindow(m_hWnd)); if (!m_bActivated || !m_pCurrentToolTip) return; m_bExtended = bExtended; CString str = GetTooltipText(m_pCurrentToolTip); if (str.IsEmpty()) return; //Calculate the width and height of the box dynamically CRect rect = GetBoundsRect(str, m_pCurrentToolTip->nWidth); rect = CalculateInfoBoxRect(pt, m_pCurrentToolTip, rect); ShowWindow(SW_HIDE); SetWindowPos(NULL, rect.left, rect.top, rect.Width(), rect.Height(), SWP_SHOWWINDOW|SWP_NOCOPYBITS|SWP_NOACTIVATE|SWP_NOZORDER); // ModifyStyle(0, WS_VISIBLE); // ShowWindow(SW_SHOWNA); }
FText UK2Node_EnumLiteral::GetNodeTitle(ENodeTitleType::Type TitleType) const { if (CachedTooltip.IsOutOfDate()) { return GetTooltipText(); } return CachedTooltip; }
DWORD TooltipFindFormat(void) { DWORD dwInfoTooltip = 0; char tip[LEN_TOOLTIP]; // Tooltipのテキストをレジストリから読み込む GetMyRegStrEx("Tooltip", "Tooltip", tip, sizeof(tip), "", gConfigNo); //ファイル指定であった場合 if(tip[0] == 'f' && tip[1] == 'i' && tip[2] == 'l' && tip[3] == 'e' && tip[4] == ':') { //Pathを切り出す memmove( tip, tip + 5, (size_t)((strchr(tip,'\0')-1)-tip)); if(!GetTooltipText(tip)){ strcpy(tip, "ファイル取得失敗"); } } dwInfoTooltip |= FindFormat(tip); // Tooltipのテキストをレジストリから読み込む GetMyRegStrEx("Tooltip", "Tooltip2", tip, sizeof(tip), "", gConfigNo); //ファイル指定であった場合 if(tip[0] == 'f' && tip[1] == 'i' && tip[2] == 'l' && tip[3] == 'e' && tip[4] == ':') { //Pathを切り出す memmove( tip, tip + 5, (size_t)((strchr(tip,'\0')-1)-tip)); if(!GetTooltipText(tip)){ strcpy(tip, "ファイル取得失敗"); } } dwInfoTooltip |= FindFormat(tip); // Tooltipのテキストをレジストリから読み込む GetMyRegStrEx("Tooltip", "Tooltip3", tip, sizeof(tip), "", gConfigNo); //ファイル指定であった場合 if(tip[0] == 'f' && tip[1] == 'i' && tip[2] == 'l' && tip[3] == 'e' && tip[4] == ':') { //Pathを切り出す memmove( tip, tip + 5, (size_t)((strchr(tip,'\0')-1)-tip)); if(!GetTooltipText(tip)){ strcpy(tip, "ファイル取得失敗"); } } dwInfoTooltip |= FindFormat(tip); GetMyRegStrEx("", "TipTitle", tip, sizeof(tip), "", gConfigNo); dwInfoTooltip |= FindFormat(tip); return dwInfoTooltip; }
bool ImageView::GetTooltipText(const gfx::Point& p, string16* tooltip) { if(tooltip_text_.empty()) { return false; } *tooltip = GetTooltipText(); return true; }
void CProgressCtrlX::UpdateTooltipText(int nPos) { if (m_wndToolTip.GetSafeHwnd () == NULL) return; CDrawInfo info; // retrieve current position and range info.nCurPos = nPos; CProgress::GetRange(info.nLower, info.nUpper); info.dwStyle = m_fToolTipFormat; CString sText = FormatText(info, GetTooltipText(), CalcPos(info)); if (!sText.IsEmpty()) m_wndToolTip.UpdateTipText(sText, this); }
BOOL COXCoolComboBox::SubclassEditCtrl() { ASSERT(::IsWindow(GetSafeHwnd())); HWND hWnd; GetDlgItem(IDW_OXCOMBOEDIT,&hWnd); if(hWnd!=NULL) { m_edit.SetCombo(this); if(!m_edit.SubclassWindow(hWnd)) return FALSE; CString sTooltipText; if(GetTooltipText(sTooltipText)) VERIFY(m_edit.SetTooltipText(sTooltipText)); } return TRUE; }
BOOL COXCoolComboBox::SubclassListBoxCtrl() { ASSERT(::IsWindow(GetSafeHwnd())); if(GetStyle()&CBS_OWNERDRAWFIXED || GetStyle()&CBS_OWNERDRAWVARIABLE) return TRUE; HWND hWnd; GetDlgItem(IDW_OXCOMBOLISTBOX,&hWnd); if(hWnd!=NULL) { if(!m_listBox.SubclassWindow(hWnd)) return FALSE; CString sTooltipText; if(GetTooltipText(sTooltipText)) VERIFY(m_listBox.SetTooltipText(sTooltipText)); } return TRUE; }
// This message is handle to get the HWND of the listbox of the combobox // as there is no otherway to get it(refer to Q65881, Q131845 in Knowledge Base) HBRUSH COXCoolComboBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hBrush = CComboBox::OnCtlColor(pDC, pWnd, nCtlColor); // Handle only if the type of control is Listbox only if((nCtlColor == CTLCOLOR_LISTBOX) && !(GetStyle()&CBS_OWNERDRAWFIXED || GetStyle()&CBS_OWNERDRAWVARIABLE)) { if(!::IsWindow(m_listBox.GetSafeHwnd())) { if(m_listBox.SubclassWindow(pWnd->GetSafeHwnd())) { CString sTooltipText; if(GetTooltipText(sTooltipText)) VERIFY(m_listBox.SetTooltipText(sTooltipText)); m_listBox.RedrawWindow(NULL,NULL,RDW_INVALIDATE|RDW_FRAME); } } } return hBrush; }
/*------------------------------------------------ ツールチップの表示内容取得 --------------------------------------------------*/ static void TooltipUpdateText(void) { const static char * const aszRegEntry[3] = { "Tooltip", "Tooltip2", "Tooltip3", }; SYSTEMTIME t; int beat100; char fmt[LEN_TOOLTIP], s[LEN_TOOLTIP], tiptitle[300], tipt[300], ini_key[10]; DWORD dw; RECT rcClock; int clLen, mPos; BOOL bTooltip2, bTooltip3, bTooltipTate; bTooltipUpdated = TRUE; bTooltip2 = GetMyRegLongEx("Tooltip", "Tip2Use", FALSE, gConfigNo); if (bTooltip2) { bTooltip3 = GetMyRegLongEx("Tooltip", "Tip3Use", FALSE, gConfigNo); bTooltipTate = GetMyRegLongEx("Tooltip", "TipTateFlg", FALSE, gConfigNo); GetWindowRect(hwndClock, &rcClock); dw = GetMessagePos(); if (bTooltipTate) { clLen = rcClock.bottom - rcClock.top; mPos = GET_Y_LPARAM(dw) - rcClock.top; } else { clLen = rcClock.right - rcClock.left; mPos = GET_X_LPARAM(dw) - rcClock.left; } if (bTooltip3) { if ( mPos > (2*clLen/3) ) iTooltipSelected = 2; if ( mPos <= (2*clLen/3) && mPos >= (clLen/3) ) iTooltipSelected = 1; if ( mPos < (clLen/3) ) iTooltipSelected = 0; } else { if ( mPos > (clLen/2) ) iTooltipSelected = 1; if ( mPos <= (clLen/2) ) iTooltipSelected = 0; } } else { iTooltipSelected = 0; } strcpy(ini_key, aszRegEntry[iTooltipSelected]); GetMyRegStrEx("Tooltip", ini_key, fmt, sizeof(fmt), "", gConfigNo); if(fmt[0] == 'f' && fmt[1] == 'i' && fmt[2] == 'l' && fmt[3] == 'e' && fmt[4] == ':') { memmove( fmt, fmt + 5, (size_t)((strchr(fmt,'\0')-1)-fmt)); if(!GetTooltipText(fmt)){ strcpy(fmt, "ファイル取得失敗"); } } if(fmt[0] == 0) { strcpy(fmt, "TClock <%LDATE%>"); } GetDisplayTime(&t, &beat100); MakeFormat(s, &t, beat100, fmt); strcpy(formatTooltip, s); //635@p5 GetMyRegStrEx("", "TipTitle", tiptitle, 300, "", gConfigNo); if(tiptitle[0] != 0) { MakeFormat(tipt, &t, beat100, tiptitle); strcpy(titleTooltip, tipt); } else { titleTooltip[0] = 0; } }
FText UK2Node_CastByteToEnum::GetNodeTitle(ENodeTitleType::Type TitleType) const { return GetTooltipText(); }
void COXToolTipCtrl::GetText(CString& str, CWnd* pWnd, UINT nIDTool /*=0*/) { COXToolTipInfo* pToolInfo = GetToolInfoPtr(pWnd, nIDTool); if (pToolInfo) str = GetTooltipText(pToolInfo); }
// --- In : // --- Out : // --- Returns : // --- Effect : Draws the tooltip - called in response to a WM_PAINT message void COXToolTipCtrl::OnPaint() { if (!m_pCurrentToolTip) return; CString str = GetTooltipText(m_pCurrentToolTip); if (str.IsEmpty()) return; CPaintDC dc(this); // Device context for painting CRect rect; GetClientRect(rect); CBrush Brush, *pOldBrush; if (m_pCurrentToolTip->clrBackColor == CLR_DEFAULT) Brush.CreateSolidBrush(GetSysColor(COLOR_INFOBK)); else Brush.CreateSolidBrush(m_pCurrentToolTip->clrBackColor); pOldBrush = dc.SelectObject(&Brush); if (m_pCurrentToolTip->clrTextColor == CLR_DEFAULT) dc.SetTextColor(GetSysColor(COLOR_INFOTEXT)); else dc.SetTextColor(m_pCurrentToolTip->clrTextColor); CFont *pOldFont = dc.SelectObject(&m_Font); // Draw Border dc.FillRect(&rect, &Brush); dc.SelectStockObject(NULL_BRUSH); dc.SelectStockObject(BLACK_PEN); dc.Rectangle(rect); // Draw Text dc.SetBkMode(TRANSPARENT); rect.DeflateRect(m_rectMargin); dc.DrawText(str, rect, m_dwTextStyle); if (m_bHasExtendedText) { TEXTMETRIC tm; dc.GetTextMetrics(&tm); int nYMargin = max(tm.tmExternalLeading + tm.tmInternalLeading, tm.tmDescent); int nXMargin = tm.tmAveCharWidth / 2; CSize size = dc.GetTextExtent(m_szArrowSpace); if ((size.cy & 1)) size.cy--; CPoint pt[4]; if (m_bExtended) { pt[0] = CPoint(rect.left + size.cx - nXMargin, rect.top + nYMargin); pt[1] = CPoint(rect.left, rect.top + size.cy/2); pt[2] = CPoint(rect.left + size.cx - nXMargin, rect.top + size.cy - nYMargin); pt[3] = pt[0]; } else { pt[0] = CPoint(rect.right - size.cx + nXMargin, rect.top + nYMargin); pt[1] = CPoint(rect.right, rect.top + size.cy/2); pt[2] = CPoint(rect.right - size.cx + nXMargin, rect.top + size.cy - nYMargin); pt[3] = pt[0]; } dc.SelectStockObject(BLACK_BRUSH); dc.Polygon(pt, 4); } // Cleanup dc.SelectObject(pOldBrush); dc.SelectObject(pOldFont); }