本文整理汇总了C++中GetThumbRect函数的典型用法代码示例。如果您正苦于以下问题:C++ GetThumbRect函数的具体用法?C++ GetThumbRect怎么用?C++ GetThumbRect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetThumbRect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:Fluffiest,项目名称:splayer,代码行数:11,代码来源:PlayerSeekBar.cpp
示例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();
}
开发者ID:tweimer,项目名称:miranda-ng,代码行数:27,代码来源:thumbs.cpp
示例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);
}
}
开发者ID:asdlei00,项目名称:gtkduilib,代码行数:7,代码来源:UIVerticalLayout.cpp
示例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;
}
开发者ID:AbdoSalem95,项目名称:WindowsSDK7-Samples,代码行数:26,代码来源:Slider.cpp
示例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;
}
开发者ID:839687571,项目名称:duilib,代码行数:25,代码来源:UISlider.cpp
示例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();
}
开发者ID:paulcn,项目名称:openxp,代码行数:29,代码来源:HSliderCtrl.cpp
示例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;
}
开发者ID:mengskysama,项目名称:V8,代码行数:26,代码来源:SkinItemSlider.cpp
示例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);
}
}
开发者ID:iclosure,项目名称:jframework,代码行数:29,代码来源:BCGPSliderCtrl.cpp
示例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;
}
}
开发者ID:zentelfong,项目名称:ZuiLib,代码行数:33,代码来源:ZSlider.cpp
示例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);
}
}
开发者ID:2php,项目名称:duilib,代码行数:7,代码来源:UIHorizontalLayout.cpp
示例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;
}
}
开发者ID:ECNU-ZR,项目名称:physwf-c-lab,代码行数:33,代码来源:UISlider.cpp
示例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);
}
开发者ID:0buffer,项目名称:DirectUI,代码行数:46,代码来源:UIList.cpp
示例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;
}
}
开发者ID:tweimer,项目名称:miranda-ng,代码行数:58,代码来源:thumbs.cpp
示例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);
}
开发者ID:Fluffiest,项目名称:mpc-hc,代码行数:9,代码来源:PlayerSeekBar.cpp
示例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;
}
开发者ID:yoonhada,项目名称:nlinelast,代码行数:11,代码来源:GUIScrollbar.cpp
示例16: GetThumbRect
void HSliderCtrl::OnLButtonDown(UINT nFlags, CPoint point)
{
CRect thuRect;
GetThumbRect(&thuRect);
if (thuRect.PtInRect(point))
{
m_byThuState = THUME_DOWN;
Invalidate();
}
CSliderCtrl::OnLButtonDown(nFlags, point);
}
开发者ID:paulcn,项目名称:openxp,代码行数:11,代码来源:HSliderCtrl.cpp
示例17: OnLButtonDown
void CPlayerSeekBar::OnLButtonDown(UINT nFlags, CPoint point)
{
if(m_fEnabled && (GetChannelRect() | GetThumbRect()).PtInRect(point))
{
SetCapture();
MoveThumb(point);
GetParent()->PostMessage(WM_HSCROLL, MAKEWPARAM((short)m_pos, SB_THUMBPOSITION), (LPARAM)m_hWnd);
}
CDialogBar::OnLButtonDown(nFlags, point);
}
开发者ID:Fluffiest,项目名称:mpc-hc,代码行数:11,代码来源:PlayerSeekBar.cpp
示例18: SetSliderPosition
void SetSliderPosition(HWND hwnd, LONG pos, Slider_Info *pInfo)
{
// Invalidate the old thumb rect
InvalidateRect(hwnd, &pInfo->rcThumb, FALSE);
pInfo->posThumb = pos;
GetThumbRect(hwnd, pInfo);
// Invalidate the new thumb rect
InvalidateRect(hwnd, &pInfo->rcThumb, FALSE);
}
开发者ID:AbdoSalem95,项目名称:WindowsSDK7-Samples,代码行数:12,代码来源:Slider.cpp
示例19: CDC
void CPlayerSeekBar::CreateThumb(bool bEnabled, CDC& parentDC)
{
auto& pThumb = bEnabled ? m_pEnabledThumb : m_pDisabledThumb;
pThumb = std::unique_ptr<CDC>(new CDC());
if (pThumb->CreateCompatibleDC(&parentDC)) {
COLORREF
white = GetSysColor(COLOR_WINDOW),
shadow = GetSysColor(COLOR_3DSHADOW),
light = GetSysColor(COLOR_3DHILIGHT),
bkg = GetSysColor(COLOR_BTNFACE);
CRect r(GetThumbRect());
r.MoveToXY(0, 0);
CRect ri(GetInnerThumbRect(bEnabled, r));
CBitmap bmp;
VERIFY(bmp.CreateCompatibleBitmap(&parentDC, r.Width(), r.Height()));
VERIFY(pThumb->SelectObject(bmp));
pThumb->Draw3dRect(&r, light, 0);
r.DeflateRect(0, 0, 1, 1);
pThumb->Draw3dRect(&r, light, shadow);
r.DeflateRect(1, 1, 1, 1);
CBrush b(bkg);
pThumb->FrameRect(&r, &b);
r.DeflateRect(0, 1, 0, 1);
pThumb->FrameRect(&r, &b);
r.DeflateRect(1, 1, 0, 0);
pThumb->Draw3dRect(&r, shadow, bkg);
if (bEnabled) {
r.DeflateRect(1, 1, 1, 2);
CPen whitePen(PS_INSIDEFRAME, 1, white);
CPen* old = pThumb->SelectObject(&whitePen);
pThumb->MoveTo(r.left, r.top);
pThumb->LineTo(r.right, r.top);
pThumb->MoveTo(r.left, r.bottom);
pThumb->LineTo(r.right, r.bottom);
pThumb->SelectObject(old);
pThumb->SetPixel(r.CenterPoint().x, r.top, 0);
pThumb->SetPixel(r.CenterPoint().x, r.bottom, 0);
}
} else {
ASSERT(FALSE);
}
}
开发者ID:n0bleINtP,项目名称:mpc-hc,代码行数:50,代码来源:PlayerSeekBar.cpp
示例20: newThumbRect
void CPlayerSeekBar::SyncThumbToVideo(REFERENCE_TIME rtPos)
{
m_rtPos = rtPos;
if (m_bHasDuration) {
CRect newThumbRect(GetThumbRect());
bool bSetTaskbar = (rtPos <= 0);
if (newThumbRect != m_lastThumbRect) {
bSetTaskbar = true;
InvalidateRect(newThumbRect | m_lastThumbRect);
}
if (bSetTaskbar && AfxGetAppSettings().fUseWin7TaskBar && m_pMainFrame->m_pTaskbarList) {
VERIFY(S_OK == m_pMainFrame->m_pTaskbarList->SetProgressValue(m_pMainFrame->m_hWnd, max(m_rtPos, 1), m_rtStop));
}
}
}
开发者ID:Rogerlin2013,项目名称:mpc-hc,代码行数:15,代码来源:PlayerSeekBar.cpp
注:本文中的GetThumbRect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论