void XGToolbarView::OutlineButton(long index) { XRect r; char c; Point where; char buffer[256]; if (index == fOverTool) return; XGDraw draw(this); if (fOverTool != -1) { /* * Unoutline always */ r = CalcButton(fOverTool); draw.Draw3DRect(r,KXGEBackFrame); XGToolTip::CloseTip(); } /* * Determine if I should outline here */ if (index != -1) { c = fStatus.GetChar(index); r = CalcButton(index); if (c == kEnable) { draw.Draw3DRect(r,KXGEOutset); } where.h = r.right; where.v = r.bottom; GetItemHelp(index,buffer); XGToolTip::OpenTip(this,where,buffer); } fOverTool = index; }
void CEHelpPopup::ShowItemHelp(int wID /* = 0*/, HWND hCtrl, POINT MousePos) { wchar_t szHint[2000]; if (!GetItemHelp(wID, hCtrl, szHint, countof(szHint))) return; if (!*szHint) return; if (!mh_Popup || !IsWindow(mh_Popup)) { if (!mp_DpiAware) mp_DpiAware = new CDpiForDialog(); // (CreateDialog) SafeDelete(mp_Dlg); mp_Dlg = CDynDialog::ShowDialog(IDD_HELP, ghOpWnd, helpProc, (LPARAM)this); mh_Popup = mp_Dlg ? mp_Dlg->mh_Dlg : NULL; if (!mh_Popup) { DisplayLastError(L"Can't create help text dialog", GetLastError()); return; } SetWindowPos(mh_Popup, HWND_TOPMOST, MousePos.x + 10, MousePos.y + 20, 0, 0, SWP_NOSIZE|SWP_NOACTIVATE); } if (mh_Popup && IsWindow(mh_Popup)) { if (!IsWindowVisible(mh_Popup)) ShowWindow(mh_Popup, SW_SHOWNA); //SetForegroundWindow(mh_Popup); SetDlgItemText(mh_Popup, IDC_HELP_DESCR, szHint); return; } }