Page 1 of 1

Spinner Question

Posted: Wed Aug 16, 2006 2:12 pm
by Jeff Barnes
Hi Everybody,

How can I have a spinner increase/decrease by 0.5 instead of 1


Thanks,

Jeff

Posted: Wed Aug 16, 2006 2:30 pm
by Antonio Linares
Jeff,

Search for these lines in source\classes\tget.prg and change the 1 into 0.5:

Code: Select all

      If nDirection > 0
         nValue += 1 / ( 10 ^ nDec )
      else
         nValue -= 1 / ( 10 ^ nDec )
      Endif

Posted: Wed Aug 16, 2006 3:18 pm
by Jeff Barnes
Thanks for the quick reply Antonio but that will not solve my probelm.

I use 4 different spinners, only one of them needs to adjust by 0.5 the rest of them need to adjust by 1


Jeff

Posted: Wed Aug 16, 2006 3:58 pm
by Enrico Maria Giordano
This is a working sample:

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL oGet, nVar := 1

    DEFINE DIALOG oDlg

    @ 1, 1 GET oGet VAR nVar;
           PICTURE "99.9";
           SPINNER

    oGet:oVScroll:bGoUp = { || If( GetFocus() != oGet:hWnd, oGet:SetFocus(), ),;
                               nVar += 0.5,;
                               oGet:Refresh() }

    oGet:oVScroll:bGoDown = { || If( GetFocus() != oGet:hWnd, oGet:SetFocus(), ),;
                                 nVar -= 0.5,;
                                 oGet:Refresh() }

    @ 3, 1 BUTTON "&Close";
           ACTION oDlg:End()

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL
EMG

Posted: Wed Aug 16, 2006 5:23 pm
by Antonio Linares
Enrico,

You are right. Thanks! :-)

Posted: Fri Aug 18, 2006 1:58 pm
by Jeff Barnes
Thanks Enrico,

That's exactly what I needed.

Jeff