xebK_F4 doesn't work correctly

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
obelix
Posts: 48
Joined: Tue Dec 03, 2013 7:44 am
Location: Villingen-Schwenningen, Black Forest, Germany

xebK_F4 doesn't work correctly

#1 Post by obelix »

Hi everybody,
In DCBROWSE I use the DCHOTKEY x_beK_F4 and it works
if I use in the same DCBROWSE the statement
case nEvent = xbeP_Keyboard .and. Upper(Chr(mp1)) = "S" in HANDLER Myhandler,
pushing the F4-key executes the xbeP_keyboard statement.
The other DCHOTKEYS F1, F2 and so on work correctly.
quiet old but still young and unskilled in express++

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: xebK_F4 doesn't work correctly

#2 Post by rdonnay »

I don't understand your question.

Can you show me some source code?
The eXpress train is coming - and it has more cars.

User avatar
obelix
Posts: 48
Joined: Tue Dec 03, 2013 7:44 am
Location: Villingen-Schwenningen, Black Forest, Germany

Re: xebK_F4 doesn't work correctly

#3 Post by obelix »

hi Roger,

in this DCBROWSE-Window, I want to be able to use the PUSHBUTTON CAPTION "F4 Projekt "...
that's ok
but also the DCHOTKEY CAPTION "F4 Projekt". That's ok as long as I don't use the line
case nEvent = xbeP_Keyboard .and. Upper(Chr(mp1)) = "S"
in function myhandler4
if I could adress the F4-key in myhandler4,it would even be better but i dont't noch the value of mp1

thanks


@ 3,2 DCBROWSE oBrowse EDIT xbeBRW_ItemSelected MODE DCGUI_BROWSE_EDITEXIT ; //PARENT oTabPage1
DATA cAlias SIZE wcol,wrow FONT feldfont
DCBROWSECOL FIELD &felder1 WIDTH 6 ; //felder[1] ;
HEADER feldub1 PARENT oBrowse
...
....
@ wrow+vv, 1+hv DCPUSHBUTTON CAPTION "F1 Hilfe" SIZE 12+i,1 FONT textfont1 ACTION {||hpshelp()}
@ wrow+vv, 16+hv+i*1 DCPUSHBUTTON CAPTION "F2 Vorgang" SIZE 12+i,1 FONT textfont1 ACTION {||w_order(1),oBrowse:RefreshAll()}
@ wrow+vv, 31+hv+i*2 DCPUSHBUTTON CAPTION "F3 Kurzname" SIZE 12+i,1 FONT textfont1 ACTION {||w_order(2),oBrowse:RefreshAll()}
@ wrow+vv, 46+hv+i*3 DCPUSHBUTTON CAPTION "F4 Projekt" SIZE 12+i,1 FONT textfont1 ACTION {||w_order(3),oBrowse:RefreshAll()}
...
...

DCHOTKEY xbeK_F1 ACTION {||hpshelp()} // 28
DCHOTKEY xbeK_F2 ACTION {||w_order(1),oBrowse:RefreshAll()} // -1
DCHOTKEY xbeK_F3 ACTION {||w_order(2),oBrowse:RefreshAll()} // -2
DCHOTKEY xbeK_F4 ACTION {||w_order(3),oBrowse:RefreshAll()} // -4
DCHOTKEY xbeK_F5 ACTION {||w_order(4),oBrowse:RefreshAll()} // -5

DCREAD GUI FIT TO lStatus TITLE cTitle OPTIONS GetOptions ENTEREXIT HANDLER MyHandler4 REFERENCE @oBrowse
RETURN lstatus


FUNCTION MyHandler4 (nEvent,mp1,mp2,oXbp,oDlg,GetList,oBrowse)

do case
case nEvent = xbeP_Keyboard .and. Upper(Chr(mp1)) = "S"
aufsuches()
obrowse:refreshall()
case nEvent = xbeP_Keyboard .and. mp1= 13 // Enter
return DCGUI_EXIT_OK
case nEvent = xbeP_Keyboard .and. mp1= 27 // ESC
esca=.t.
return DCGUI_EXIT_ABORT
endcase

RETURN DCGUI_NONE
quiet old but still young and unskilled in express++

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: xebK_F4 doesn't work correctly

#4 Post by rdonnay »

This anomoly is caused by the Chr() function.

Chr(xbeK_F4) returns "s"

You can fix this as follows:

Code: Select all

case nEvent = xbeP_Keyboard .and. Upper(Chr(mp1)) = "S" .and. mp1 # xbeK_F4
The eXpress train is coming - and it has more cars.

User avatar
obelix
Posts: 48
Joined: Tue Dec 03, 2013 7:44 am
Location: Villingen-Schwenningen, Black Forest, Germany

Re: xebK_F4 doesn't work correctly

#5 Post by obelix »

ok, it works.
thank you Roger
quiet old but still young and unskilled in express++

User avatar
Auge_Ohr
Posts: 1414
Joined: Wed Feb 24, 2010 3:44 pm

Re: xebK_F4 doesn't work correctly

#6 Post by Auge_Ohr »

instead of CHR()

Code: Select all

Upper(Chr(mp1)) = "S"
you can do same with ASC()

Code: Select all

CASE nEvent = xbeP_Keyboard .and. mp1 = ASC("s")
greetings by OHR
Jimmy

skiman
Posts: 1189
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: xebK_F4 doesn't work correctly

#7 Post by skiman »

Hi,

Better look at ACCELKEY parameter for the dcpushbutton. Now you have your code twice in you sources. With the accelerator key you don't need to do this.

Code: Select all

@ wrow+vv, 1+hv DCPUSHBUTTON CAPTION "F1 Hilfe" SIZE 12+i,1 FONT textfont1 ACTION {||hpshelp()} ACCELKEY  xbeK_F1
Best regards,

Chris.
www.aboservice.be

User avatar
obelix
Posts: 48
Joined: Tue Dec 03, 2013 7:44 am
Location: Villingen-Schwenningen, Black Forest, Germany

Re: xebK_F4 doesn't work correctly

#8 Post by obelix »

thank you for your suggestions. :D
the addition of «.and. mp1 # xbeK_Fx» is necessary for all Fx-key, but it works.
quiet old but still young and unskilled in express++

Post Reply