Page 1 of 1

using xbek_ keys in dcpushbutton and dchotkey

Posted: Mon Dec 09, 2013 4:07 am
by obelix
hi everybody,
i want to use the xbek_enter key to close a dcbrowse-window after having finished a codeblock in a pushbutton without returning to the dcbrowse-window
@ x, y DCPUSHBUTTON CAPTION "New Record" SIZE 12i,1 FONT textfont1;
ACTION {||p_newrec(),oBrowse:RefreshAll(),???()}
and DCHOTKEY xbeK_ENTER ACTION {||???()}
without using ADDBUTTONS

Ist ist possible to use dchotkey with xbek_ key for the alphabet keys (A,a...Z,z) including the additional characters (äöü*)
(ascii 33-254). I can't find a value in appevent.ch or somewhere else. 8-) 8-)

Re: using xbek_ keys in dcpushbutton and dchotkey

Posted: Mon Dec 09, 2013 8:33 am
by rdonnay
Your question is confusing.

When you say you want to close a Browse window, what does that mean?
Is this another window that is running in another thread?
Are you saying that you want to close the current window?
You mention that you want it to act on the xbeK_ENTER key, but then you also want it to act on all other keys.

Please clarify what you want to do?

Re: using xbek_ keys in dcpushbutton and dchotkey

Posted: Tue Dec 10, 2013 3:10 am
by obelix
I'm asking for two solutions:
1. I want to leave the current DCBROWSE - Windows and go back to the parent window by using DCHOTKEY xbek_ENTER but I don't know the codeblock I`ve to write in the ACTION parameter. Additionally I want to use a DCPUSHBUTTON, because I cannot add another font, if I use ADDBUTTONS.

2. I want to use character keys to trigger an action in a DCBROWSE-Window (in order to simualte the user function in dbedit())

Re: using xbek_ keys in dcpushbutton and dchotkey

Posted: Tue Dec 10, 2013 5:54 am
by Tom
2. I want to use character keys to trigger an action in a DCBROWSE-Window (in order to simualte the user function in dbedit())

Code: Select all

@ x,y DCBROWSE oBrowse ...

* more code

DCREAD GUI ... HANDLER MyHandler REFERENCE @oBrowse

FUNCTION MyHandler (nEvent,mp1,mp2,oXbp,oDlg,GetList,oBrowse)
IF nEvent = xbeP_Keyboard .and. Upper(Chr(mp1)) = "A"
  * do something reflecting character "A" was typed, f.i. search for the next record beginning with "A" 

ELSIF ...

ENDIF
RETURN DCGUI_NONE
and so on

Re: using xbek_ keys in dcpushbutton and dchotkey

Posted: Tue Dec 10, 2013 7:43 am
by obelix
Thank you Tom, that's what I was looking for. :P