|
-
April 1st, 1999, 09:54 AM
#1
CSpinButtonCtrl's can they be trusted?
I have many problems with this seemingly inocent little fella!
The function GetPos() and SetPos() return 16bits out ie actual iPos + 65536.
The iPos icrement is unreliable when compared to the iDelta value.
And the iDelta value is arse about face ie when you click down it is +1 and when you click up it is -1.
Does anyone else ever have these problems?
Simon Pettman
Research Engineer
Goodmans Loudspeakers Ltd
[email protected]
-
April 1st, 1999, 10:23 AM
#2
Re: CSpinButtonCtrl's can they be trusted?
The position values returned from GetPos and SetPos are stored in the low-order word. The high-order word is nonzero if an error occured, else it is zero. The control returns an error if there is no buddy window or if the caption specifies an invalid or out-of-range value. To retrieve the position you would have to use the LOWORD() macro.
Hope this helps,
Gary Kirkham
-
April 8th, 1999, 12:37 PM
#3
Re: CSpinButtonCtrl's can they be trusted?
As far as the fact that they spin arse backwards, this is what I always do in my dialog's OnInitDialog( ):
// Typical brain-dead Microsoft product spins reversed by default.
static_cast<CSpinButtonCtrl*> (GetDlgItem(IDC_SPIN_MAXMERGE))->SetRange(1, UD_MAXVAL);
HTH.
LA Leonard - Definitive Solutions, Inc.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|