Page 1 of 1
Char "&" is not shown as CAPTION with DCPUSHBUTTON
Posted: Wed Aug 10, 2016 9:57 am
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 "&"?
Re: Char "&" is not shown as CAPTION with DCPUSHBUTTON
Posted: Wed Aug 10, 2016 10:37 am
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 (107.75 KiB) Viewed 14592 times
Re: Char "&" is not shown as CAPTION with DCPUSHBUTTON
Posted: Wed Aug 10, 2016 11:36 am
by rdonnay
If you want to see an ampersand in the caption, you need to use a double ampersand.
DCPUSHBUTTON CAPTION 'Larry && Mike'
Re: Char "&" is not shown as CAPTION with DCPUSHBUTTON
Posted: Wed Aug 10, 2016 4:12 pm
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 ";" ?
Re: Char "&" is not shown as CAPTION with DCPUSHBUTTON
Posted: Thu Aug 11, 2016 9:31 am
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
Re: Char "&" is not shown as CAPTION with DCPUSHBUTTON
Posted: Fri Aug 12, 2016 9:01 am
by Leon Berger
Perfect, thank you Roger
Do you include this change in the next release?
Re: Char "&" is not shown as CAPTION with DCPUSHBUTTON
Posted: Sat Aug 13, 2016 5:07 pm
by rdonnay
Do you include this change in the next release?
YES!!!