Page 1 of 1

DCMXPUSHBUTTON With DCSUBMENU ... need to HIDE the SubMenu

Posted: Fri Mar 25, 2011 12:01 pm
by GeneB
I am using DCMXPUSHBUTTON with DCSUBMENU (Samples Group 6)

I can HIDE the MXPushButton, but since there is no HIDE in DCSUBMENU, the button for DCSUBMENU stays on the screen.
Is there a way to hide the DCSUBMENU button?

Re: DCMXPUSHBUTTON With DCSUBMENU ... need to HIDE the SubMenu

Posted: Sat Mar 26, 2011 6:04 am
by John Hohensee
Use WHEN {|| Something() }
If this returns a TRUE the menu works, otherwise it grayed and disabled.

Re: DCMXPUSHBUTTON With DCSUBMENU ... need to HIDE the SubMenu

Posted: Sat Mar 26, 2011 7:39 am
by GeneB
Thanks, but I would like to HIDE it.
With the main button hidden, a 'grayed' button with choices to 'nowhere' on the screen isn't right.

-=# GeneB

Re: DCMXPUSHBUTTON With DCSUBMENU ... need to HIDE the SubMenu

Posted: Sat Mar 26, 2011 9:09 am
by GeneB
I came up with a poor man's solution.

When the DCMXBUTTON is hidden:

disable the SUBMENU with WHEN
DCSAY over the top of the SUBMENU button
use a HIDE clause in the DCSAY to remove it when you want to see the SUBMENU

Not pretty, but whatever works and move on.

Re: DCMXPUSHBUTTON With DCSUBMENU ... need to HIDE the SubMenu

Posted: Sat Mar 26, 2011 9:48 am
by rdonnay
Why are you using DCMXPUSHBUTTON instead of DCPUSHBUTTONXP ?

I haven't supported DCMXPUSHBUTTON in a long time because I didn't write it.

Re: DCMXPUSHBUTTON With DCSUBMENU ... need to HIDE the SubMenu

Posted: Sat Mar 26, 2011 12:28 pm
by GeneB
I used it because I found it on Xdemo, Sample Group 6, MxPushButtons, and it is in the docmentation.

I liked it because I have a "Print" button on a screen, and the dropdown menu that this functioun has allows me to give a "print with details" and a "print without details" choice.

Is there another way to do this without DCMXPUSHBUTTON, and without having two print buttons on the screen?

Re: DCMXPUSHBUTTON With DCSUBMENU ... need to HIDE the SubMenu

Posted: Sun Mar 27, 2011 12:45 pm
by rdonnay
Is there another way to do this without DCMXPUSHBUTTON, and without having two print buttons on the screen?
DCPUSHBUTTONXP supports that functionality and more.

Run the sample program: \exp19\samples\buttonxp\buttonxp.exe

Re: DCMXPUSHBUTTON With DCSUBMENU ... need to HIDE the SubMenu

Posted: Sun Mar 27, 2011 9:30 pm
by GeneB
Wow, where did all that come from? I had no idea.
And I thought I was impressed with Express before I saw all this.
Now I'm blown away with the tools available.

Thanks Roger !!!