Ok Now I explain you :
I wish add % percentual math control to msgcalc (it there is on msgcalc but I wish add different calculation)
I wish add calculation, incremental and decremental I need it to calculate Tax on a price
First I first I made a function to change the size of dialog called allarge(oDlg,ntipo)
nTipo can be 1 to second dlg size and 2 to return to first size
when I have the msgcalc I have :
when I call the percentual I have : (it call allarge(oDlg,1) and made subdialog
on this subdialog I insert some controls
Tipo := 1
PorCien := 0
@ 0.2, 2 SAY cPercentual OF SuboDlg SIZE 200,40 FONT oFont TRANSPARENT
@ 1.4,2 GET oGetNum VAR Porcien PICTURE "99.99" SPINNER OF SuboDlg SIZE 40,4
@ 4, 2 RADIO oRad VAR Tipo OF SuboDlg ;
PROMPT cCalculate, cIncremental ,cDecremental SIZE 100,12
@ 5,8 BUTTON obtnok PROMPT "OK" OF SuboDlg ;
FONT oFont SIZE 40, 10 ACTION ( SuboDlg:end( IDOK ) )//,lSave:=.t. ) oGetNum:nHeight:=21.4
if the user press OK the procedure must make a calculation :
if SuboDlg:nresult == IDOK
DO CASE
CASE Tipo == 1
Display := ( nMemo ) * ( PorCien / 100 )
CASE Tipo == 2
Display := (nMemo ) * ( 1 + ( PorCien / 100 ) )
CASE Tipo == 3
Display := ( nMemo ) / ( 1 + ( PorCien / 100 ) )
ENDCASE
nMemo := Display
oGet:cText( Space(18)+Transform( nMemo , cPict ))
oDlg:Update() // update the msgcalc dialog
Endif
Allarge(oDlg,1) // return to first size dialog
return NIL
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com