Spinner Question

Spinner Question

Postby Jeff Barnes » Wed Aug 16, 2006 2:12 pm

Hi Everybody,

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


Thanks,

Jeff
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Postby Antonio Linares » Wed Aug 16, 2006 2:30 pm

Jeff,

Search for these lines in source\classes\tget.prg and change the 1 into 0.5:
Code: Select all  Expand view  RUN
      If nDirection > 0
         nValue += 1 / ( 10 ^ nDec )
      else
         nValue -= 1 / ( 10 ^ nDec )
      Endif
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42120
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Jeff Barnes » Wed Aug 16, 2006 3:18 pm

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
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Postby Enrico Maria Giordano » Wed Aug 16, 2006 3:58 pm

This is a working sample:

Code: Select all  Expand view  RUN
#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
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Wed Aug 16, 2006 5:23 pm

Enrico,

You are right. Thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42120
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Jeff Barnes » Fri Aug 18, 2006 1:58 pm

Thanks Enrico,

That's exactly what I needed.

Jeff
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 60 guests