IonicWind Software

IWBasic => General Questions => Topic started by: Brian on November 28, 2010, 07:40:06 AM

Title: UpDown Control
Post by: Brian on November 28, 2010, 07:40:06 AM
Aaargh! I've just spent about 2 hours trying to get this UpDown control to work

CONTROL win,@EDIT,"",566,310,50,26,0x50812000,16
CONTROLEX win,"msctls_updown32","",566,310,40,26,UDS_AUTOBUDDY|UDS_SETBUDDYINT|UDS_ALIGNRIGHT|UDS_ARROWKEYS,0,17

SENDMESSAGE win,UDM_SETRANGE32,30,90,16
SENDMESSAGE win,UDM_SETBUDDY,60,0,16

All I want is the range to be from 30 to 90, and then pre-set the edit box buddy to 60

What am I doing wrong?

Brian
Title: Re: UpDown Control
Post by: Egil on November 28, 2010, 08:07:33 AM
Never done such thing myself, but why not try the spinner control? (part of the contraol pack that comes with EB).

Good luck!

Egil
Title: Re: UpDown Control
Post by: LarryMc on November 28, 2010, 08:41:36 AM
you're trying to set the range of the edit control:
SENDMESSAGE win,UDM_SETRANGE32,30,90,16

You need to set the range of the spinner:
SENDMESSAGE win,UDM_SETRANGE32,30,90,17

LarryMc
Title: Re: UpDown Control
Post by: Brian on November 28, 2010, 08:45:41 AM
Larry, that's got it. Now why didn't I see that?

Next is how to set the spinner to 60 to show in the edit control

Thanks again,

Brian

Edit: I've got it - I had the wrong ID number again. Right code is:

CONTROL win,@EDIT,"",566,310,50,26,0x50812000,16
CONTROLEX win,"msctls_updown32","",566,310,40,26,UDS_AUTOBUDDY|UDS_SETBUDDYINT|UDS_ALIGNRIGHT|UDS_ARROWKEYS,0,17
SENDMESSAGE win,UDM_SETRANGE32,30,90,17
SENDMESSAGE win,UDM_SETPOS32,0,60,17
Title: Re: UpDown Control
Post by: LarryMc on November 28, 2010, 09:52:04 AM
Egil is right about using the control pak to accomplish what you are doing.
It just makes it a little more straightforward.

LarryMc
Title: Re: UpDown Control
Post by: Brian on November 28, 2010, 10:38:02 AM
Larry,

You know, I just plumb forgot about the Control Pak, but we're cooking now!

I have another problem. I have a main window, and I need to open a second
window to print data generated by the first window. When I close the second
window, a lot of the first window's controls and text disappears!

What's going on there?

Brian
Title: Re: UpDown Control
Post by: LarryMc on November 28, 2010, 02:17:05 PM
Sapero will probably have a more professional answer but without seeing any code I would say invalidate the main window immediately after closing the second window.

or showwindow  with a 0 then with a 1

or it might mean the second window needs the clipchildren flag.

LarryMc