May 09, 2024, 06:07:21 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


set increment in spinner (Buddy) control

Started by dossic, September 17, 2008, 09:25:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dossic

I needed to change the increment in buddy (spinner) controls.  I wrote a short subroutine, it may be useful for some of us.
regards   Carlo

TYPE UDACCEL
   DEF nSec1 As INT
   DEF nInc1 As INT
ENDTYPE
DEF aAccels as POINTER

CONST WM_USER = 0x400
CONST UDM_SETACCEL =           (WM_USER+107)

sub SetSpinnerIncrement(parent:DIALOG,id:UINT,inc:INT)
   'set Increment as "inc" variable
   aAccels=NEW(UDACCEL,1)
   #<UDACCEL>aAccels.nSec1 = 300    'time in ms between autochange
   #<UDACCEL>aAccels.nInc1 = inc
   a = SENDMESSAGE parent,UDM_SETACCEL,1,aAccels,id
endsub