Page 1 of 1

TGet():New() and :bUp/:bDown

PostPosted: Sat Feb 25, 2023 10:35 am
by Natter
Hi,

Creating a numeric GET control via the syntax TGet():New().
In it I need to specify a block of code :bUp and :bDown. How to do it ?

Re: TGet():New() and :bUp/:bDown

PostPosted: Sat Feb 25, 2023 12:33 pm
by cmsoft
Fijate si así te puede servir
Code: Select all  Expand view
#include "FiveWin.ch"
 
function Main()        
 
   local oDlg,oGet      
   local nVal := 0

   DEFINE DIALOG oDlg TITLE "Test"        
   oGet := TGet():New( 1, 1, {|| nVal}, oDlg, 40, 12, "999", ,;
               , , , , , ,;
               , ,, ,,,;
               , ,, ,;
               .f., {|| nVal++}, {|| nVal--}, 0, 20, , , ,;
               , , , ,,, ;
               {'..\bitmaps\minus.bmp','..\bitmaps\plus.bmp'})  
   ACTIVATE DIALOG oDlg CENTERED  
return nil

Re: TGet():New() and :bUp/:bDown

PostPosted: Sat Feb 25, 2023 1:57 pm
by Natter
Thank you for your help ! Everything works. However, I am interested in the option with spinner.
In this case, nothing works :(