PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: gmundt on December 19, 2024, 08:58:33 AM

Title: MSGBOX Button Names
Post by: gmundt on December 19, 2024, 08:58:33 AM
I am trying to rename buttons on a msgbox command and cannot get it to populate.

def msg(165)="&Summary,&Detail,&Cancel"
msgbox "Test","Test","?,YESNOCANCEL",x$

Still shows Yes No and Cancel as the button options

msgbox "Test","Test","?,BTN1=Summary, BTN2=Detail, BTN3=Cancel,3",x$

Shows just an OK option.

Wondering if this option is available.
Title: Re: MSGBOX Button Names
Post by: James Zukowski on December 19, 2024, 09:25:21 AM
Yes, it is. I use it as needed.
Try taking the spaces out from between your options in your second example.
Also, if you want hotkeys, precede the hotkey character in the option with an ampersand.
Title: Re: MSGBOX Button Names
Post by: gmundt on December 19, 2024, 10:35:06 AM
I found the issue.  I had to turn on 'MX'

set_param 'MX'
def msg(156)="&Summary,&Detail,&Cancel"
msgbox "Test","Test","?,YESNOCANCEL",xx$
def msg(156)="&Yes,&No,&Cancel"
set_param 'MX'=0

That did the trick.

Thank you James
Title: Re: MSGBOX Button Names
Post by: Mike King on December 19, 2024, 03:39:40 PM
You should not need to change the default message text.  I tried the following on PxPlus V19 and it worked just fine:

->?prm('mx') ! Confirm MX is not set
 0

->msgbox "hello","world","?,Btn1=Help,Btn2=Me,Btn3=Please,3",x$

->?x$
BTN2

What version PxPlus are you using?
Title: Re: MSGBOX Button Names
Post by: martinp on December 19, 2024, 07:24:03 PM
The problem are the spaces in the MSGBOX, Remove them and it will work.

msgbox "Test","Test","?,BTN1=Summary, BTN2=Detail, BTN3=Cancel,3",x$
To

msgbox "Test","Test","?,BTN1=Summary,BTN2=Detail,BTN3=Cancel,3",x$