本文整理汇总了C++中GetThumbRect函数的典型用法代码示例。如果您正苦于以下问题:C++ GetThumbRect函数的具体用法?C++ GetThumbRect怎么用?C++ GetThumbRect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetThumbRect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetThumbRect
void CPlayerSeekBar::SetPosInternal(__int64 pos)
{
if(m_pos == pos) return;
CRect before = GetThumbRect();
m_pos = min(max(pos, m_start), m_stop);
m_posreal = pos;
CRect after = GetThumbRect();
if(before != after) InvalidateRect(before | after);
}
示例2: PopupMessageDialog
void ThumbInfo::OnLButtonUp()
{
RECT rcMiranda;
RECT rcThumb;
RECT rcOverlap;
if (!bMouseMoved && fcOpt.bUseSingleClick && bMouseIn)
PopupMessageDialog();
if (bMouseDown) {
bMouseDown = FALSE;
SetCursor(LoadCursor(nullptr, IDC_ARROW));
// Check whether we shoud remove the window
GetWindowRect(hwndMiranda, &rcMiranda);
GetThumbRect(&rcThumb);
if (IntersectRect(&rcOverlap, &rcMiranda, &rcThumb)) {
if (IsWindowVisible(hwndMiranda)) {
DeleteContactPos();
thumbList.RemoveThumb(this);
}
}
}
SaveContactsPos();
}
示例3: GetThumbRect
void CUIVerticalLayout::DoPostPaint(cairo_t *cr, const CUIRect& rcPaint)
{
if( (m_uButtonState & UISTATE_CAPTURED) != 0 && !m_bImmMode ) {
RECT rcSeparator = GetThumbRect(true);
CUIRender::DrawColor(cr, rcSeparator, 0xAA000000);
}
}
示例4: OnSetThumbBitmap
LRESULT OnSetThumbBitmap(HWND hwnd, WORD nID, Slider_Info *pInfo)
{
HBITMAP hbm = LoadBitmap(GetInstance(), MAKEINTRESOURCE(nID));
if (hbm == NULL)
{
return FALSE;
}
BITMAP bm;
GetObject(hbm, sizeof(BITMAP), &bm);
pInfo->pxThumbSize.cx = bm.bmWidth;
pInfo->pxThumbSize.cy = bm.bmHeight;
if (pInfo->hbmThumb)
{
DeleteObject(pInfo->hbmThumb);
}
pInfo->hbmThumb = hbm;
GetThumbRect(hwnd, pInfo);
return TRUE;
}
示例5: GetThumbRect
void CSliderUI::PaintStatusImage(HDC hDC)
{
CProgressUI::PaintStatusImage(hDC);
RECT rcThumb = GetThumbRect();
rcThumb.left -= m_rcItem.left;
rcThumb.top -= m_rcItem.top;
rcThumb.right -= m_rcItem.left;
rcThumb.bottom -= m_rcItem.top;
if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
m_diThumbPushed.rcDestOffset = rcThumb;
if( DrawImage(hDC, m_diThumbPushed) ) return;
}
else if( (m_uButtonState & UISTATE_HOT) != 0 ) {
m_diThumbHot.rcDestOffset = rcThumb;
if( DrawImage(hDC, m_diThumbHot) ) return;
}else if( (m_uButtonState & UISTATE_DISABLED) != 0 ) {
m_diThumbDisabled.rcDestOffset = rcThumb;
if( DrawImage(hDC, m_diThumbDisabled) ) return;
}
m_diThumb.rcDestOffset = rcThumb;
if( DrawImage(hDC, m_diThumb) ) return;
}
示例6: dc
void HSliderCtrl::OnPaint()
{
CPaintDC dc(this);
//获取位置
CRect rect;
GetClientRect(&rect);
//建双缓冲
CImage imgBuffer;
CDC dcBuffer;
imgBuffer.Create(rect.Width(), rect.Height(), 24);
dcBuffer.Attach(imgBuffer.GetDC());
if (!m_imgBk.IsNull())
{
m_imgBk.TransparentBlt(dcBuffer.GetSafeHdc(),0,0,rect.Width(),rect.Height(),
0,0,m_imgBk.GetWidth(),m_imgBk.GetHeight()/5,RGB(255,0,255));
CRect thuRect;
GetThumbRect(&thuRect);
m_imgBk.TransparentBlt(dcBuffer.GetSafeHdc(),thuRect.left,thuRect.top,thuRect.Width(),thuRect.Height(),
0,0+m_imgBk.GetHeight()/5*(m_byThuState+2),11,m_imgBk.GetHeight()/5,RGB(255,0,255));
m_imgBk.TransparentBlt(dcBuffer.GetSafeHdc(),0,0,thuRect.left,rect.Height(),
0,0+m_imgBk.GetHeight()/5,thuRect.left,m_imgBk.GetHeight()/5,RGB(255,0,255));
}
//清除缓冲
dc.BitBlt(0, 0, rect.Width(), rect.Height(), &dcBuffer, 0, 0, SRCCOPY);
dcBuffer.Detach();
imgBuffer.ReleaseDC();
}
示例7: GetThumbRect
BOOL CSkinItemSlider::GetThumbImgRect(RECT& thumbRect)
{
CImageBase * pImgThumb = m_pThumbNormalImage;
RECT tempRect;
GetThumbRect(tempRect);
int nThumbWidth = tempRect.right - tempRect.left;
int nThumbHeight = tempRect.bottom - tempRect.top;
int nTemp = (pImgThumb->Width() - nThumbWidth)/2;
thumbRect.left = tempRect.left - nTemp - 2;//奇怪,怎么会偏差了两个象素。。。难道是图片的问题
if (thumbRect.left < 0)
{
thumbRect.left = 0;
}
nTemp = (pImgThumb->Height() - nThumbHeight)/2;
thumbRect.top = tempRect.top - nTemp;
if (thumbRect.top < 0)
{
thumbRect.top = 0;
}
thumbRect.right = thumbRect.left + pImgThumb->Width();
thumbRect.bottom = thumbRect.top + pImgThumb->Height();
return TRUE;
}
示例8: GetThumbRect
//*****************************************************************************************
void CBCGPSliderCtrl::OnMouseMove(UINT nFlags, CPoint point)
{
BOOL bIsThumbHighligted = m_bIsThumbHighligted;
CRect rectThumb;
GetThumbRect (rectThumb);
m_bIsThumbHighligted = rectThumb.PtInRect (point);
CSliderCtrl::OnMouseMove(nFlags, point);
if (bIsThumbHighligted != m_bIsThumbHighligted)
{
RedrawWindow ();
}
if (!m_bTracked)
{
m_bTracked = TRUE;
TRACKMOUSEEVENT trackmouseevent;
trackmouseevent.cbSize = sizeof(trackmouseevent);
trackmouseevent.dwFlags = TME_LEAVE;
trackmouseevent.hwndTrack = GetSafeHwnd();
trackmouseevent.dwHoverTime = HOVER_DEFAULT;
::BCGPTrackMouse (&trackmouseevent);
}
}
示例9: GetThumbRect
void ZSlider::PaintStatusImage(ZRenerder* hDC)
{
ZProgress::PaintStatusImage(hDC);
RECT rcThumb = GetThumbRect();
rcThumb.left -= m_rcItem.left;
rcThumb.top -= m_rcItem.top;
rcThumb.right -= m_rcItem.left;
rcThumb.bottom -= m_rcItem.top;
if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
if( !m_sThumbPushedImage.IsEmpty() ) {
m_sImageModify.Empty();
m_sImageModify.Format("dest='%d,%d,%d,%d'", rcThumb.left, rcThumb.top, rcThumb.right, rcThumb.bottom);
if( !DrawImage(hDC, (const char*)m_sThumbPushedImage, (const char*)m_sImageModify) ) m_sThumbPushedImage.Empty();
else return;
}
}
else if( (m_uButtonState & UISTATE_HOT) != 0 ) {
if( !m_sThumbHotImage.IsEmpty() ) {
m_sImageModify.Empty();
m_sImageModify.Format("dest='%d,%d,%d,%d'", rcThumb.left, rcThumb.top, rcThumb.right, rcThumb.bottom);
if( !DrawImage(hDC, (const char*)m_sThumbHotImage, (const char*)m_sImageModify) ) m_sThumbHotImage.Empty();
else return;
}
}
if( !m_sThumbImage.IsEmpty() ) {
m_sImageModify.Empty();
m_sImageModify.Format("dest='%d,%d,%d,%d'", rcThumb.left, rcThumb.top, rcThumb.right, rcThumb.bottom);
if( !DrawImage(hDC, (const char*)m_sThumbImage, (const char*)m_sImageModify) ) m_sThumbImage.Empty();
else return;
}
}
示例10: GetThumbRect
void CHorizontalLayoutUI::DoPostPaint(HDC hDC, const RECT& rcPaint)
{
if( (m_uButtonState & UISTATE_CAPTURED) != 0 && !m_bImmMode ) {
RECT rcSeparator = GetThumbRect(true);
CRenderEngine::DrawColor(hDC, rcSeparator, 0xAA000000);
}
}
示例11: GetThumbRect
void CSliderUI::PaintStatusImage(HDC hDC)
{
CProgressUI::PaintStatusImage(hDC);
RECT rcThumb = GetThumbRect();
rcThumb.left -= m_rcItem.left;
rcThumb.top -= m_rcItem.top;
rcThumb.right -= m_rcItem.left;
rcThumb.bottom -= m_rcItem.top;
if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
if( !m_sThumbPushedImage.IsEmpty() ) {
m_sImageModify.Empty();
m_sImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), rcThumb.left, rcThumb.top, rcThumb.right, rcThumb.bottom);
if( !DrawImage(hDC, (LPCTSTR)m_sThumbPushedImage, (LPCTSTR)m_sImageModify) ) m_sThumbPushedImage.Empty();
else return;
}
}
else if( (m_uButtonState & UISTATE_HOT) != 0 ) {
if( !m_sThumbHotImage.IsEmpty() ) {
m_sImageModify.Empty();
m_sImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), rcThumb.left, rcThumb.top, rcThumb.right, rcThumb.bottom);
if( !DrawImage(hDC, (LPCTSTR)m_sThumbHotImage, (LPCTSTR)m_sImageModify) ) m_sThumbHotImage.Empty();
else return;
}
}
if( !m_sThumbImage.IsEmpty() ) {
m_sImageModify.Empty();
m_sImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), rcThumb.left, rcThumb.top, rcThumb.right, rcThumb.bottom);
if( !DrawImage(hDC, (LPCTSTR)m_sThumbImage, (LPCTSTR)m_sImageModify) ) m_sThumbImage.Empty();
else return;
}
}
示例12: GetThumbRect
void CListHeaderItemUI::Event(TEventUI& event)
{
if( event.Type == UIEVENT_BUTTONDOWN && IsEnabled() )
{
RECT rcSeparator = GetThumbRect(m_rcItem);
if( ::PtInRect(&rcSeparator, event.ptMouse) ) {
m_uDragState |= UISTATE_CAPTURED;
ptLastMouse = event.ptMouse;
m_pManager->SendNotify(this, _T("headerdragging"));
}
else {
m_pManager->SendNotify(this, _T("headerclick"));
}
}
if( event.Type == UIEVENT_BUTTONUP )
{
if( (m_uDragState & UISTATE_CAPTURED) != 0 ) {
m_uDragState &= ~UISTATE_CAPTURED;
m_pManager->SendNotify(this, _T("headerdragged"));
m_pManager->UpdateLayout();
}
}
if( event.Type == UIEVENT_MOUSEMOVE )
{
if( (m_uDragState & UISTATE_CAPTURED) != 0 ) {
RECT rc = m_rcItem;
rc.right -= ptLastMouse.x - event.ptMouse.x;
const int MIN_DRAGSIZE = 40;
if( rc.right - rc.left > MIN_DRAGSIZE ) {
m_rcItem = rc;
m_cxWidth = rc.right - rc.left;
ptLastMouse = event.ptMouse;
m_pParent->Invalidate();
}
}
}
if( event.Type == UIEVENT_SETCURSOR )
{
RECT rcSeparator = GetThumbRect(m_rcItem);
if( IsEnabled() && ::PtInRect(&rcSeparator, event.ptMouse) ) {
::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZEWE)));
return;
}
}
CControlUI::Event(event);
}
示例13: ClientToScreen
void ThumbInfo::OnMouseMove(int nX, int nY)
{
// Position thumb
if (bMouseDown) {
POINT ptNew = { nX, nY };
ClientToScreen(hwnd, &ptNew);
int dX = ptNew.x - ptOld.x;
int dY = ptNew.y - ptOld.y;
if (dX || dY) {
bMouseMoved = TRUE;
nLeft += dX;
nTop += dY;
PositionThumb(nLeft, nTop);
}
ptOld = ptNew;
}
else SetCursor(LoadCursor(nullptr, IDC_ARROW));
// Update selection status
if (!pThumbMouseIn) {
SetTimer(hwnd, TIMERID_LEAVE_T, 10, nullptr);
pThumbMouseIn = this;
ThumbSelect(TRUE);
}
if (bEnableTip && fcOpt.bShowTip && !bMouseDown) {
WORD tmpTimeIn;
POINT pt;
RECT rc;
GetCursorPos(&pt);
GetThumbRect(&rc);
if (!PtInRect(&rc, pt)) {
KillTip();
return;
}
if (fTipTimerActive && abs(pt.x - ptTipSt.x) < 5 && abs(pt.y - ptTipSt.x) < 5)
return;
ptTipSt = pt;
if (fTipTimerActive)
KillTimer(hwnd, TIMERID_HOVER_T);
if (fTipActive)
return;
tmpTimeIn = (fcOpt.TimeIn > 0) ? fcOpt.TimeIn : CallService(MS_CLC_GETINFOTIPHOVERTIME, 0, 0);
SetTimer(hwnd, TIMERID_HOVER_T, tmpTimeIn, nullptr);
fTipTimerActive = TRUE;
}
}
示例14: GetThumbRect
CRect CPlayerSeekBar::GetInnerThumbRect()
{
CRect r = GetThumbRect();
bool fEnabled = m_fEnabled && m_start < m_stop;
r.DeflateRect(3, fEnabled ? 5 : 4, 3, fEnabled ? 5 : 4);
return(r);
}
示例15: GetThumbRect
VOID GUIScrollbar::Update()
{
RECT trt;
GetThumbRect( &trt );
Image3DTranslate( &m_Data.img3DThumb,
static_cast< FLOAT >( m_Data.ptBackPosition.x + trt.left + m_Data.img3DThumb.vecScale.x * 0.5f ),
static_cast< FLOAT >( m_Data.ptBackPosition.y + trt.top + m_Data.img3DThumb.vecScale.y * 0.5f ),
0.0f );
m_bLKeyUp = TRUE;
}