FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Spinner Question
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Spinner Question
Posted: Wed Aug 16, 2006 02:12 PM

Hi Everybody,

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

Thanks,

Jeff

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Spinner Question
Posted: Wed Aug 16, 2006 02:30 PM
Jeff,

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

Antonio Linares
www.fivetechsoft.com
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Spinner Question
Posted: Wed Aug 16, 2006 03: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

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Spinner Question
Posted: Wed Aug 16, 2006 03:58 PM
This is a working sample:

#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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Spinner Question
Posted: Wed Aug 16, 2006 05:23 PM

Enrico,

You are right. Thanks! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Spinner Question
Posted: Fri Aug 18, 2006 01:58 PM

Thanks Enrico,

That's exactly what I needed.

Jeff

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)

Continue the discussion