xBrowse EDIT_GET_BUTTON

xBrowse EDIT_GET_BUTTON

Postby ralph » Tue Nov 20, 2012 7:06 pm

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  Expand view

    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  Expand view

    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 24.07, xHb123_10193, MySQL 5.5, BCC 7.3
User avatar
ralph
 
Posts: 79
Joined: Fri Nov 18, 2005 11:15 pm
Location: Lima - PERU

Re: xBrowse EDIT_GET_BUTTON

Postby ralph » Tue Nov 20, 2012 7:35 pm

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 24.07, xHb123_10193, MySQL 5.5, BCC 7.3
User avatar
ralph
 
Posts: 79
Joined: Fri Nov 18, 2005 11:15 pm
Location: Lima - PERU

Re: xBrowse EDIT_GET_BUTTON

Postby nageswaragunupudi » Mon Nov 26, 2012 1:17 pm

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
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse EDIT_GET_BUTTON

Postby reinaldocrespo » Mon Nov 26, 2012 9:23 pm

Ralph;

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

Code: Select all  Expand view

WITH OBJECT ::oBrw

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



Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 115 guests