xBrowse editing

xBrowse editing

Postby byte-one » Fri Jan 18, 2008 11:08 pm

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.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Postby ShumingWang » Sat Jan 19, 2008 12:37 am

Change xbrowse.prg xbrwocol :nEditType data into data block type
Change
if oCol:nEditType>0
into if(VALTYPE(oCol:nEditType)=="B",EVAL(oCol:nEditType),VAL(cvaltochar(oCol:nEditType))) > 0

Then your prg ocol:nedittype:={||mycondition()}


Shuming Wang
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby Antonio Linares » Sat Jan 19, 2008 6:13 am

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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby byte-one » Sat Jan 19, 2008 9:18 am

Thanks, both ways are possible!

For the second problem I wrote is no solution?

Also the picture z.B. "@E ##.#" from numeric data only in editing-mode is active. In normal mode this picture is not active.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Postby Antonio Linares » Sat Jan 19, 2008 7:15 pm

Günther,

> the picture z.B. "@E ##.#"

Have you tried it using Transform() ? Does Transform() properly use it ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby byte-one » Sun Jan 20, 2008 11:11 am

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")}!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Postby nageswaragunupudi » Sun Jan 20, 2008 2:09 pm

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:
Code: Select all  Expand view  RUN
     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

This fix works till release of the fix by FWH in the next version.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Antonio Linares » Sun Jan 20, 2008 5:10 pm

Günther,

We are actually out of our offices until next tuesday.

Please follow Nageswararao advise. We will review it as soon as we are back next tuesday.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: xBrowse editing

Postby nageswaragunupudi » Tue Jan 22, 2008 7:43 am

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?

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.

the picture z.B. "@E ##.#"

In my tests I found that the picture clause is working in both edits and normal display.
This is my test code
Code: Select all  Expand view  RUN
   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

I am using FWH 8.01, xHarbour 1.1.0, bcc55.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Silvio » Tue Jan 22, 2008 9:46 am

Is tjhere a function to edit a record in vertical as th eold tedit of Super35 lib ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Antonio Linares » Tue Jan 22, 2008 10:05 am

Silvio,

We implemented it in FiveMac using this code:
Code: Select all  Expand view  RUN
METHOD SetEdit() CLASS TWBrowse

   ::bLogicLen = { || RecCount() * ( FCount() + 1 ) }
   ::cAlias = "_EDIT"

   ::Refresh()

return nil   

Code: Select all  Expand view  RUN
   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  Expand view  RUN
   @ 48, 20 LISTBOX oBrw FIELDS "", "" HEADERS "FieldName", "Value" ;
      OF oWnd SIZE 672, 363 ALIAS Alias()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: wilsongamboa and 43 guests