XBROWSE edit_listbox

XBROWSE edit_listbox

Postby byte-one » Tue May 28, 2019 10:03 am

How to simulate the VK_RETURN to leave programmatically the listbox?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: XBROWSE edit_listbox

Postby Marc Venken » Tue May 28, 2019 10:35 am

Code: Select all  Expand view  RUN


// 1
 :bKeyChar      := { |nKey| If( nKey == VK_RETURN, ;
             ( nSelect := PRD->veld, oDlg:End() ), nil ) }


// 2

:bKeyDown   := { |k| If( k == VK_RETURN,( oDlg1:end() ),;
                           if (K == VK_DELETE, Del_row(oBrw),nil )) }

// 3

oBrwK:bKeyDown := {|nKey| MyKey(nKey,oBrwK,oDlgK) }

Function MyKey(nKey,oGrid,oDlg)
Do case
  case nKey==VK_RETURN
    if msgYesNo("Wenst U deze klant te gebruiken")
      oDbfinfo:klantcode = klant->klant_nr
      oDbfinfo:firma = klant->naam_1
      oDlg:End()
    endif
// here your function of modify record
//case nKey==VK_INSERT
// here your function of add record
//case nKey==VK_DELETE
// here your function of delete record
//case nKey==VK_ESCAPE
//OTHERWISE
//IF nKey >= 96 .AND. nKey <= 105
// here your function of search record
//ELSEIF HB_ISSTRING(CHR(nKey))
// here your function of search record
//ENDIF
EndCase
 
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1446
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: XBROWSE edit_listbox

Postby byte-one » Tue May 28, 2019 11:30 am

Thanks Marc, but i will not end the dialog i will only after a keystroke leave the xbrowse-cell with the listbox and go to the next cell.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: XBROWSE edit_listbox

Postby Marc Venken » Tue May 28, 2019 12:19 pm

oBrw:goright() in place of the end ?
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1446
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: XBROWSE edit_listbox

Postby byte-one » Tue May 28, 2019 1:19 pm

In this case the :bOnPostEdit from this cell are not evaluated. In normal we leave the listbox-cell with pressing "Enter". I will virtual press "enter" from program. My question with other words: What method are called after pressing "Enter"?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi, Surasak and 29 guests