Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Problem in status bar scroll control
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem in status bar scroll control

 Post Reply Post Reply
Author
Message
vijaymahajan View Drop Down
Groupie
Groupie
Avatar

Joined: 16 June 2008
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote vijaymahajan Quote  Post ReplyReply Direct Link To This Post Topic: Problem in status bar scroll control
    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);

 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 21 July 2008 at 1:10pm

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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.