![]() |
Problem in status bar scroll control |
Post Reply ![]() |
Author | |
vijaymahajan ![]() Groupie ![]() ![]() Joined: 16 June 2008 Status: Offline Points: 92 |
![]() ![]() ![]() ![]() ![]() Posted: 21 July 2008 at 4:33am |
Hello,
We have already purchased your library,we have the login password also,Only activation is to be done.
Anyway,
I have created a slider control on a status bar.
i write ON_NOTIFY() event handler for it. we have our zoomIn() and ZoomOut() functions.I just have to map the slider left-right movement to these functions.
Can i check the left and right movement of slider in ON_NOTIFY() event?
or is it compulsary to write the OnScroll() method for it?
I tried as follows in the ON_NOTIFY() event,But it wasnt working.
NMXTPSCROLL* pNMScroll = (NMXTPSCROLL*)pNMHDR;CXTPStatusBarSliderPane* pPane = DYNAMIC_DOWNCAST(CXTPStatusBarSliderPane, pNMScroll->pSender); if (!pPane)return;if (pNMScroll->nSBCode == SB_LINERIGHT) AfxGetMainWnd()->SendMessage(WM_COMMAND, ID_ZOOM_IN,0); if(pNMScroll->nSBCode == SB_LINERIGHT)AfxGetMainWnd()->SendMessage(WM_COMMAND, ID_ZOOM_OUT,0); |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi, Copy code from RibbonView:
ON_NOTIFY(XTP_SBN_SCROLL, ID_INDICATOR_ZOOMSLIDER, OnZoomSliderScroll)
void CRibbonSampleView::OnZoomSliderScroll(NMHDR* pNMHDR, LRESULT* pResult) { NMXTPSCROLL* pNMScroll = (NMXTPSCROLL*)pNMHDR; CXTPStatusBarSliderPane* pPane = DYNAMIC_DOWNCAST(CXTPStatusBarSliderPane, pNMScroll->pSender); if (!pPane) return; int nZoom = m_nZoom;
switch (pNMScroll->nSBCode)
{ case SB_TOP: nZoom = 10; break; case SB_BOTTOM: nZoom = 500; break; case SB_LINEUP: nZoom = max(((nZoom / 10) - 1) * 10, 10); break;
case SB_LINEDOWN: nZoom = min(((nZoom / 10) + 1) * 10, 500); break; case SB_THUMBTRACK: nZoom = PosToZoom(pNMScroll->nPos); if (nZoom > 90 && nZoom < 150) nZoom = 100; break;
case SB_PAGEUP: nZoom = max(nZoom - 10, 10); break;
case SB_PAGEDOWN: nZoom = min(nZoom + 10, 500); break; } if (nZoom == m_nZoom)
return; m_nZoom = nZoom;
pPane->SetPos(ZoomToPos(nZoom)); CXTPStatusBar* pStatusBar = pPane->GetStatusBar();
CXTPStatusBarPane* pPaneZoomIndicator = pStatusBar->FindPane(ID_INDICATOR_ZOOM); CString strZoom;
strZoom.Format(_T("%i%%"), m_nZoom); pPaneZoomIndicator->SetText(strZoom); SendMessage(EM_SETZOOM, m_nZoom, 100);
}
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |