xBrowse EDIT_GET_BUTTON

Post Reply
User avatar
ralph
Posts: 63
Joined: Fri Nov 18, 2005 11:15 pm
Location: Lima - PERU

xBrowse EDIT_GET_BUTTON

Post by ralph »

Dear Antonio / Mr. Rao.

the clause EDIT_GET_BUTTON has little documentation and i need your help (Fwh 1202)

This is my code to define a column:

Code: Select all

    REDEFINE XBROWSE oBrwDeta ID 301 OF oFld:aDialogs[2] ALIAS "TMPD"
 ....

    nx := len(oBrwDeta:aCols)
    oBrwDeta:aCols[ nx ]:nEditType   := EDIT_GET_BUTTON
    oBrwDeta:aCols[ nx ]:bEditBlock  := { | r,c,o | o:value := PickPrd(o:value) }
    oBrwDeta:aCols[ nx ]:bOnPostEdit := { | oCol, xVal, nKey | If( RecCount() == 0, ;
                                        ( tmpd->(DbAppend()), oBrw:Refresh() ),), If( nKey == VK_RETURN, TMPD->CODPRD := xVal,),;
                                        oBrwDeta:RefreshCurrent()}

 
The question is: Is there a way to assign a firekey to call my function in :bEditBlock ?
example:

Code: Select all

    oBrwDeta:aCols[ nx ]:bToolTip     := {|| oBrwDeta:aCols[ nx ]:cToolTip := "Press F2 to call list" }
 
When you are doing an invoice with many items, the user is more alike to use the keyboard instead of clicking in the small button with the mouse.

I would apreciate much if you send a small sample

Thanks for your reply

Ralph
Ralph del Castillo
Lima PERU
Fwh 17.09, xHb123_10193, MySQL 5.5, BCC 7.3
User avatar
ralph
Posts: 63
Joined: Fri Nov 18, 2005 11:15 pm
Location: Lima - PERU

Re: xBrowse EDIT_GET_BUTTON

Post by ralph »

One more thing (i think it is a bug):

When the user enter the data directly with the keyboard in the editable column, the :bOnPostEdit is evaluated.
But, when clicking the small button and : bEditBlock is evaluated returning a value, the :bOnPostEdit is NOT evaluated.

Thank for you answer.

Ralph
Ralph del Castillo
Lima PERU
Fwh 17.09, xHb123_10193, MySQL 5.5, BCC 7.3
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse EDIT_GET_BUTTON

Post by nageswaragunupudi »

bEditBlock should return the new value, if the value is changed or NIL if the value is not to be changed.

This line:
oBrwDeta:aCols[ nx ]:bEditBlock := { | r,c,o | o:value := PickPrd(o:value) }

should be re-written as :
oBrwDeta:aCols[ nx ]:bEditBlock := { | r,c,o | PickPrd(o:value) }

PickPrd(...) function should return the new value if edited or NIL if no change is required.

Let me assure you that there is no bug and this works correctly.
Regards

G. N. Rao.
Hyderabad, India
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: xBrowse EDIT_GET_BUTTON

Post by reinaldocrespo »

Ralph;

As for the F2 to open a list, you could try to implement in :bKeyDown, as in:

Code: Select all

WITH OBJECT ::oBrw

      :bKeyDown := {|nKey| isControl := GetKeyState( VK_CONTROL ),;
                  IF( nKey == VK_F2, EVAL( bOpen ),;
...
 

Reinaldo.
Post Reply