IonicWind Software

IWBasic => GUI Central => Topic started by: dossic on September 17, 2008, 09:25:27 AM

Title: set increment in spinner (Buddy) control
Post by: dossic on September 17, 2008, 09:25:27 AM
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