![]() |
Negative range for the slider control |
Post Reply ![]() |
Author | |
dennisV ![]() Senior Member ![]() ![]() Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
![]() ![]() ![]() ![]() ![]() Posted: 19 August 2008 at 6:17pm |
Hello all,
I can't seem to be able to set a negative range on the property grid slider control. For example, if I want the slider to be from -100 to +100, how can I do that? In the PropertyGrid sample, I've tried doing this (for the "Spin and Slider" item), of course checking that underlying slider window actually exists first: ->GetSliderCtrl()->SetRange(-100, 100); but that doesn't work. It produces a slider that has a correct range, but when you try to slide it (or use the up/down buttons) to go below 0, it just stops (halfway in this example, so the range is actually set correctly, I presume). Can you please advise on how to solve this? Thanks, Dennis |
|
// W7 64 Ultimate SP1
// VS 2008 // CodeJock 16.2.3 (MFC) |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Use SetMin method of CXTPPropertyGridInplaceSlider.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
dennisV ![]() Senior Member ![]() ![]() Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
![]() ![]() ![]() ![]() ![]() |
I tried SetMin() first and it doesn't work either :(
|
|
// W7 64 Ultimate SP1
// VS 2008 // CodeJock 16.2.3 (MFC) |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Its because you have also Spin with wrong range:
Here modification in sample to make it work:
pItem = pButtons->AddChildItem(new CXTPPropertyGridItemNumber(_T("Spin And Slider"), 60));
CXTPPropertyGridInplaceSlider* pSlider = pItem->AddSliderControl(); pSlider->SetMin(-100); //pItem->AddSpinButton(); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
dennisV ![]() Senior Member ![]() ![]() Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
![]() ![]() ![]() ![]() ![]() |
Hi, Yes, it works without a spin button, but how can I make it work with a spin button as well? Thanks! Dennis |
|
// W7 64 Ultimate SP1
// VS 2008 // CodeJock 16.2.3 (MFC) |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Obviously in that case you need set minimum range for spin too:
CXTPPropertyGridInplaceSpinButton* pSpin = pItem->AddSpinButton();
pSpin->SetMin(-100); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
dennisV ![]() Senior Member ![]() ![]() Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
![]() ![]() ![]() ![]() ![]() |
Yes, that's my stupidity - I had exactly the same piece of code as you have above, but I named the button *pButton, which already appeared before that (referencing a different class) and that didn't have a SetMin() method. Oh well... ![]() |
|
// W7 64 Ultimate SP1
// VS 2008 // CodeJock 16.2.3 (MFC) |
|
![]() |
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 |