Number Increment control

Number Increment control

Postby Rick Lipkin » Tue Apr 24, 2012 1: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

Image
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Number Increment control

Postby MarcoBoschi » Tue Apr 24, 2012 2:39 pm

This?

Code: Select all  Expand view
#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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Number Increment control

Postby Rick Lipkin » Tue Apr 24, 2012 2:46 pm

Marco

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

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Number Increment control

Postby Armando » Tue Apr 24, 2012 3:40 pm

Rick:

Here you have a very single sample with resources

Code: Select all  Expand view

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
User avatar
Armando
 
Posts: 3218
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Number Increment control

Postby Rick Lipkin » Tue Apr 24, 2012 6: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Otto and 92 guests