Char "&" is not shown as CAPTION with DCPUSHBUTTON

This forum is for eXpress++ general support.
Post Reply
Message
Author
Leon Berger
Posts: 36
Joined: Thu Jan 28, 2010 2:30 pm

Char "&" is not shown as CAPTION with DCPUSHBUTTON

#1 Post by Leon Berger »

I have a problem with DCPUSHBUTTON and the char "&". The caption "&" is not shown on the button.

Code: Select all

@  50,450 DCPUSHBUTTON CAPTION {||iif( lCaps,"&","6") } FONT cFont SIZE 80,80 PIXEL ;

Code: Select all

@  50,450 DCPUSHBUTTON CAPTION {||iif( lCaps,chr(38),"6") } FONT cFont SIZE 80,80 PIXEL ;
Is there a solution to show the char "&"?
Best regards
Leon

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

Re: Char "&" is not shown as CAPTION with DCPUSHBUTTON

#2 Post by Auge_Ohr »

Leon Berger wrote:I have a problem with DCPUSHBUTTON and the char "&". The caption "&" is not shown on the button.
Is there a solution to show the char "&"?
do you have Ampersand "underscore" when using any Menu ?

Windows default is disable so so need to enable it under "easy Access" -> Keyboard
here a Picture, sorry German
Ampersand.jpg
Ampersand.jpg (107.75 KiB) Viewed 12070 times
greetings by OHR
Jimmy

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

Re: Char "&" is not shown as CAPTION with DCPUSHBUTTON

#3 Post by rdonnay »

If you want to see an ampersand in the caption, you need to use a double ampersand.

DCPUSHBUTTON CAPTION 'Larry && Mike'
The eXpress train is coming - and it has more cars.

Leon Berger
Posts: 36
Joined: Thu Jan 28, 2010 2:30 pm

Re: Char "&" is not shown as CAPTION with DCPUSHBUTTON

#4 Post by Leon Berger »

rdonnay wrote:If you want to see an ampersand in the caption, you need to use a double ampersand.

DCPUSHBUTTON CAPTION 'Larry && Mike'
Thank you Roger :-)

And what about the char ";" ? This is the char for a new line. Is it possible to use CAPTION like ";" ?
Best regards
Leon

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

Re: Char "&" is not shown as CAPTION with DCPUSHBUTTON

#5 Post by rdonnay »

And what about the char ";" ? This is the char for a new line. Is it possible to use CAPTION like ";" ?
I hadn't thought about that. It appears that you need that character for your touch keyboard.
This will require a change to the source code in _DCXBUTT.PRG. With the below change you will be able to use a double semi-colon to represent the character.

Line 1193

WAS:

Code: Select all

  IF Valtype(cCaption) == 'C' .AND. (';' $ cCaption .OR. Chr(13) $ cCaption)
    cCaption := DC_TokenArray(cCaption,';'+Chr(13))
  ENDIF
IS:

Code: Select all

  IF Valtype(cCaption) == 'C'
   IF  ';;' $ cCaption
     cCaption := Strtran(cCaption,';;',';')
   ELSEIF ';' $ cCaption .OR. Chr(13) $ cCaption
     cCaption := DC_TokenArray(cCaption,';'+Chr(13))
   ENDIF
  ENDIF
The eXpress train is coming - and it has more cars.

Leon Berger
Posts: 36
Joined: Thu Jan 28, 2010 2:30 pm

Re: Char "&" is not shown as CAPTION with DCPUSHBUTTON

#6 Post by Leon Berger »

Perfect, thank you Roger :-)

Image

Do you include this change in the next release?
Best regards
Leon

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

Re: Char "&" is not shown as CAPTION with DCPUSHBUTTON

#7 Post by rdonnay »

Do you include this change in the next release?
YES!!!
The eXpress train is coming - and it has more cars.

Post Reply