FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Number Increment control
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Number Increment control
Posted: Tue Apr 24, 2012 01:54 PM
To All

Is there a control I can use to increment a number in a get like in this picure ?

Thanks
Rick Lipkin

Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Number Increment control
Posted: Tue Apr 24, 2012 02:39 PM
This?

Code (fw): Select all Collapse
#include "fivewin.ch"

FUNCTION MAIN()
LOCAL oDlg

LOCAL nMin := 1
LOCAL nMax := 9

LOCAL oGet, nGet := 1

DEFINE DIALOG oDlg



@ 1 , 1 GET oGet VAR nGet OF oDlg                                   ;
                 PICTURE "9"                                       ;
                 SPINNER                                            ;
                 ON UP    cambiaspin( oGet , -1 , nMin , nMax   ) ;
                 ON DOWN  cambiaspin( oGet , +1 , nMin , nMax ) ;
                 VALID ( nGet >= nMin .AND. nGet <= nMax  )


ACTIVATE DIALOG oDlg CENTER

RETURN NIL

FUNCTION CAMBIASPIN( oGet , nStep , nMin , nMax )
LOCAL nRitorna := oget:varget()
LOCAL nOriginal := nRitorna

nRitorna := nRitorna + nStep
IF nRitorna >= nMin .AND. nRitorna <= nMax
  oGet:varput( nRitorna)
  oGet:refresh()
ENDIF
RETURN NIL
Marco Boschi
info@marcoboschi.it
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Number Increment control
Posted: Tue Apr 24, 2012 02:46 PM

Marco

YES .. thank you .. never used this control before..

Rick Lipkin

Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Number Increment control
Posted: Tue Apr 24, 2012 03:40 PM
Rick:

Here you have a very single sample with resources

Code (fw): Select all Collapse
REDEFINE GET aGets[09] VAR nCopies ID 202 OF oDlg UPDATE;
    PICTURE "99" SPINNER MIN 1 MAX 10


In the resources put VERT SCROLLBAR to YES on the GET control.

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Number Increment control
Posted: Tue Apr 24, 2012 06:11 PM

Armando

Thank you .. I was using resources and the tip on the vertical scroll bar was the key to make the spinner work.

Rick

Continue the discussion