Hi Everybody,
How can I have a spinner increase/decrease by 0.5 instead of 1
Thanks,
Jeff
Spinner Question
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Jeff,
Search for these lines in source\classes\tget.prg and change the 1 into 0.5:
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
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
This is a working sample:
EMG
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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact: