on a xbrowse I use
:nEditTypes := EDIT_GET
the user can insert numbers But I wish the use can insert only number of two digit from 1 to 90
How I can resolve ?
Edit cell on xbrowse
- Silvio.Falconi
- Posts: 7104
- Joined: Thu Oct 18, 2012 7:17 pm
Edit cell on xbrowse
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
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
Re: Edit cell on xbrowse
Puedes usar bEditValid
Code: Select all | Expand
:bEditValid := {| oGet | if(oGet:value > 0 .and. oGet:value < 91,.t.,(MsgInfo("Solo 0 a 90"),.f.)) }
- Silvio.Falconi
- Posts: 7104
- Joined: Thu Oct 18, 2012 7:17 pm
Re: Edit cell on xbrowse
cmsoft wrote:Puedes usar bEditValidCode: Select all | Expand
:bEditValid := {| oGet | if(oGet:value > 0 .and. oGet:value < 91,.t.,(MsgInfo("Solo 0 a 90"),.f.)) }
Not Work
I made
@ 80, 10 XBROWSE oBrw SIZE 455,oDlg:nBottom-200 PIXEL OF oDlg ;
DATASOURCE aData AUTOCOLS CELL LINES NOBORDER FASTEDIT
SetupBrowseMatrix(oBrw)
oBrw:RecSelShowKeyNo()
oBrw:CreateFromCode()
static function SetupBrowseMatrix( oBrw )
WITH OBJECT oBrw
// :RecSelShowKeyNo()
AEval( :aCols, { |o,i| o:cHeader := LTrim( Str( i, 2 ) ) } )
:bEditValid := {| oGet | if(oGet:value > 0 .and. oGet:value < 91,.t.,(MsgInfo("Solo 0 a 90"),.f.)) }
:nEditTypes := EDIT_GET
:nWidths := 24
:lDrawBorder := .t.
....
END
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
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
- Silvio.Falconi
- Posts: 7104
- Joined: Thu Oct 18, 2012 7:17 pm
Re: Edit cell on xbrowse
perhaps ...
But it must erase the edit
Code: Select all | Expand
For n=1 to len(oBrw:aCols)
oBrw:aCols[n]:bEditValid := {| oGet | if(oGet:value >= 0 .and. oGet:value < 91,.t.,;
(MsgInfo("Solo da 0 a 90"),.f.)) }
END
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
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
Re: Edit cell on xbrowse
bEditValid es un metodo de la clase TXBrwColumn no de la clase TXBrowse
Debes ponerlo a cada columna que desees
Debes ponerlo a cada columna que desees
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Edit cell on xbrowse
Please try this alternativeBut it must erase the edit
Code: Select all | Expand
#include "fivewin.ch"
function Main()
local aData := Array( 10, 10 )
AEval( aData, { |aRow| AFill( aRow, 0 ) } )
XBROWSER aData FASTEDIT SHOW RECID SETUP ( ;
oBrw:bEditValues := { |x,o| If( x == nil, o:oBrw:aRow[ o:nCreationOrder ], ;
If( x >= 0 .and. x < 91, o:oBrw:aRow[ o:nCreationOrder ] := x, nil ) ) }, ;
oBrw:cEditPictures := "@Z 99" ;
)
return nil
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India