xBrowse editing
xBrowse editing
Hello,
is there a way for xBrowse to edit one column in an row and in another row editing from the same column is not allowed? There is no bWhen or so!?
Any ideas?
Also the picture z.B. "@E ##.#" from numeric data only in editing-mode is active. In normal mode this picture is not active.
is there a way for xBrowse to edit one column in an row and in another row editing from the same column is not allowed? There is no bWhen or so!?
Any ideas?
Also the picture z.B. "@E ##.#" from numeric data only in editing-mode is active. In normal mode this picture is not active.
-
- Posts: 454
- Joined: Sun Oct 30, 2005 6:37 am
- Location: Guangzhou(Canton),China
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Günther,
Instead of modifying the class, you can use <oBrowse>:bChanged to change the edit style based on some conditions:
http://fivetechsoft.com/forums/viewtopic.php?t=9576
Instead of modifying the class, you can use <oBrowse>:bChanged to change the edit style based on some conditions:
http://fivetechsoft.com/forums/viewtopic.php?t=9576
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Can I use to show the numeric value in the xBrowse transform(value,"picture") and the returned value transfer with val() return to numeric?
Also I found, that the oBrw:bChange with keybord are ok, with the mouse it is evaluated when I change the row and change the cell always twice! Please try oBrw:bChange := {||msginfo("change")}!
Also I found, that the oBrw:bChange with keybord are ok, with the mouse it is evaluated when I change the row and change the cell always twice! Please try oBrw:bChange := {||msginfo("change")}!
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
1) The codeblock bChange is evaluated twice in the LButtonDown method. Lines 2202 to 2204 ( source 8.01 ) can be removed or commented out.
2) Also bChange is evaluated even if the mouse click does not result in change of row. It would be nice if bChange is evaluated only if the row has changed. This can be implemented in many ways, but one suggested method ( using already declared locals ) is to replace lines 2177 to 2187 as below:
This fix works till release of the fix by FWH in the next version.
2) Also bChange is evaluated even if the mouse click does not result in change of row. It would be nice if bChange is evaluated only if the row has changed. This can be implemented in many ways, but one suggested method ( using already declared locals ) is to replace lines 2177 to 2187 as below:
Code: Select all
nTmp := 0
if nRowPos > 0
Eval( ::bSkip, nTmp := ( nRowPos - ::nRowSel ) )
::nRowSel := nRowPos
endif
if nColPos > 0
::nColSel := nColPos
endif
if nTmp != 0 .and. ::bChange != nil
Eval( ::bChange, Self )
endif
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: xBrowse editing
I too feel the need for bWhen block. We may decide if the column is to be edited or not depending on the other values. We can not always manage it with bChange. I too join to request Mr Antonio to provide bWhen for edits.byte-one wrote:Hello,
is there a way for xBrowse to edit one column in an row and in another row editing from the same column is not allowed? There is no bWhen or so!?
Any ideas?
In my tests I found that the picture clause is working in both edits and normal display.the picture z.B. "@E ##.#"
This is my test code
Code: Select all
oCol:cHeader := "Value"
oCol:bStrData := { || Transform( aData[ oBrw:nArrayAt ][ 2 ], cPic ) }
oCol:bEditValue := { || aData[ oBrw:nArrayAt ][ 2 ] }
oCol:cEditPicture := cPic
oCol:nEditType := 1
oCol:bOnPostEdit := { | oCol, nVal, nKey | if( nKey == 13, aData[ oBrw:nArrayAt ][ 2] := nVal, ) }
oCol:nDataStrAlign := oCol:nHeadStrAlign := AL_RIGHT
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Silvio,
We implemented it in FiveMac using this code:
We implemented it in FiveMac using this code:
Code: Select all
METHOD SetEdit() CLASS TWBrowse
::bLogicLen = { || RecCount() * ( FCount() + 1 ) }
::cAlias = "_EDIT"
::Refresh()
return nil
Code: Select all
do case
case ::cAlias == "_EDIT"
DbGoTop()
DbSkip( Int( nRow / ( FCount() + 1 ) ) )
nField = ( nRow + 1 ) % ( FCount() + 1 )
return If( nField == 0, If( nCol == 0, "-------------", "-------------------------------------" ),;
If( nCol == 0, FieldName( nField ), cValToChar( FieldGet( nField ) ) ) )
Code: Select all
@ 48, 20 LISTBOX oBrw FIELDS "", "" HEADERS "FieldName", "Value" ;
OF oWnd SIZE 672, 363 ALIAS Alias()