Print Page | Close Window

problem in slider Appearance

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=11367
Printed Date: 01 March 2025 at 1:02am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: problem in slider Appearance
Posted By: vijaymahajan
Subject: problem in slider Appearance
Date Posted: 10 July 2008 at 1:39am
Hello,

CXTPRibbonGroup* pGroupColorCorrect = pTab->AddGroup(_T("ColorCorrectGroup"));CXTPControlScrollBar* pSliderBlurSharp = (CXTPControlScrollBar*)pGroupColorCorrect->Add(new CXTPControlScrollBar(), ID_SLIDER_BLUR_SHARP);pSliderBlurSharp->SetScrollBarStyle(xtpScrollStyleSlider);pSliderBlurSharp->SetRange(-75,75);pSliderBlurSharp->SetPos(50);//pSliderBlurSharp->SetFlags(xtpFlagNoMovable | xtpFlagSkipFocus); pSliderBlurSharp->SetFlags(xtpFlagSkipFocus); pSliderBlurSharp->SetWidth(150);pSliderBlurSharp->SetHeight(10);pSliderBlurSharp->SetTooltip(_T("Blur<--->Sharp"));

i created one slider using above code.But the sliding icon is not appearing on it.Please tell me what is the solution for this.you can see for first slider there is no sliding icon.

please give the solution for this problem.

Thanks And Regards,
Vijay.



Replies:
Posted By: Oleg
Date Posted: 10 July 2008 at 5:35am

its disabled.

 
You need enable it to add update handler for ID_SLIDER_BLUR_SHARP command or
 
pSliderBlurSharp->SetFlags(xtpFlagManualUpdate);
pSliderBlurSharp->SetEnabled(TRUE);


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: vijaymahajan
Date Posted: 10 July 2008 at 7:25am
Thanks a lot for your reply.Lot of my work was pending because of this.Thanks again.
 
But now one new problem i am facing,if i click on ' + ' sign,the moving tab on slider moves properly,but if i click on ' - ' sign the moving tab doesnt move anywhere.it directly moves to 0 position when i click on ' - ' sign.
I tried many combinations of setrange() function,but unfortunately nothing worked.
Please guide me why the slider tab not moving properly.
 
Thanks And Regards,
Vijay
 


Posted By: Oleg
Date Posted: 10 July 2008 at 8:57am
Hi,
 
Right. now its our issue. :(
Slider always use "0" as minimum. Please use range 0 - 150 instead and manually convert it (Value - 75) in Execute event.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Simon HB9DRV
Date Posted: 10 July 2008 at 11:20am
Originally posted by vijaymahajan vijaymahajan wrote:

 
Oleg, how can I create a slider with this appearance on a toolbar? I can't find any examples :-(


-------------
Simon HB9DRV


Posted By: Simon HB9DRV
Date Posted: 10 July 2008 at 11:25am
Originally posted by Simon HB9DRV Simon HB9DRV wrote:

Originally posted by vijaymahajan vijaymahajan wrote:

 
Oleg, how can I create a slider with this appearance on a toolbar? I can't find any examples :-(
 
SetScrollBarStyle(xtpScrollStyleSlider); !!!


-------------
Simon HB9DRV


Posted By: vijaymahajan
Date Posted: 10 July 2008 at 11:41pm

Hello,

if i handle the event of slider using ON_XTP_EXCECUTE(),then how can i check the SB_ENDSCROLL condition as i want to do something once the scroll ends.

Please guide me accordingly.
Thanks And Regards,
Vijay.


Posted By: Oleg
Date Posted: 11 July 2008 at 2:47am

with XTP_EXECUTE you can't...

 
Solution is override CXTPControlScrollBar and its void CXTPControlScrollBar::OnScroll(UINT nSBCode, UINT nPos) method and add own code.
 
 
Original code:
 

void CXTPControlScrollBar::OnScroll(UINT nSBCode, UINT nPos)
{
 int nCurPos = GetPos();
 switch (nSBCode)
 {
  case SB_TOP: nCurPos = m_nMin; break;
  case SB_BOTTOM: nCurPos = m_nMax; break;
  case SB_LINEUP: nCurPos = max(nCurPos - 1, m_nMin); break;
  case SB_LINEDOWN: nCurPos = min(nCurPos + 1, m_nMax); break;
  case SB_THUMBTRACK: nCurPos = nPos; break;
  case SB_PAGEUP: nCurPos = max(nCurPos - m_nMax / 10, m_nMin); break;
  case SB_PAGEDOWN: nCurPos = min(nCurPos + m_nMax / 10, m_nMax); break;
 }
 if (nCurPos == m_nPos)
  return;
 m_nPos = nCurPos;
 RedrawParent(FALSE);
 NotifySite(CBN_XTP_EXECUTE);
}


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net