Trbutton action menu

Trbutton action menu

Postby Massimo Linossi » Tue Jul 13, 2010 6:49 am

Hi to all.
I found a little problem in the trbutton action with a popup menu. When you click the first time
the button the popup menu is shown. But for closing it you must click outside of the menu.
Is possible to change this way of acting clicking again on the button and closing it ?
This is the code that make this. Is there a way of knowing if the popup menu is open
and then making the close of the object instead of activating the menu ?
Thanks a lot.
Massimo.

case ::nTypeButton == TYPE_SPLITPOPUP
if nRow >= ::nPopupMargin .or. !lAction
oWnd := ::oWnd
oWnd:NcMouseMove() // close the tooltip
if ! ::opopup:Active()
oWnd:oPopup = ::oPopup
::oPopup:Activate( ::nTop + ::nHeight(), ::nLeft, oWnd, .f. )
oWnd:oPopup = nil
else
::Opopup:End()
endif

::Refresh()
else
::click()
endif
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: Trbutton action menu

Postby James Bott » Tue Jul 13, 2010 1:02 pm

Massimo,

But for closing it you must click outside of the menu.


I believe that is standard Windows behavior, but I am not familiar with TRButton. Is that part of the ribbonbar?

If changes are to be made, they should be optional and it should default to standard Windows behavior.

I recommend using standard Windows behavior whenever possible.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Trbutton action menu

Postby Massimo Linossi » Tue Jul 13, 2010 1:23 pm

Hi James.
Yes, it is part of the Ribbonbar. I was looking inside the classes to see if there is a possibility to
change this behavior.
I'm starting to convert a program that is using the Canalfive menu. With this class if you click one
time on the button the popup menu appears, and when you click it again the menu is closing.
I don't use the new Windows, and I don't know if the Office programs, that use the new interface
have this behavior.
Also on the Imac, the first click on a menu section open the popup menu, and the second click close it.
Thanks a lot.
Massimo.
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: Trbutton action menu

Postby James Bott » Tue Jul 13, 2010 2:00 pm

Massimo,

Hopefully, someone with the new MS Office can tell us what the standard behavior is.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Trbutton action menu

Postby Massimo Linossi » Thu Jul 15, 2010 7:23 am

Hi James. I made the test on Office 2010 and the behavior is the same of the Apple menu.
If you click on a menu button, the first time the popup menu appears, the second time the popup menu
is closed. I've noticed also that when you have the popup menu opened, if you move the cursor on the tab
or on another button, the menu is not closing. In office the menu is opened only when the cursor is over it.
If you move the cursor on another button or on another tab, the menu is closed.
Thanks.
Massimo.
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: Trbutton action menu

Postby James Bott » Fri Jul 16, 2010 12:13 pm

Massimo,

Thanks for testing it.

Antonio,

Have you seen his description above about how the ribbonbar works with MS Office? It would be nice if FW's ribbonbar worked the same way.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Trbutton action menu

Postby Antonio Linares » Fri Jul 16, 2010 2:09 pm

Massimo, James,

Yes, you are right, we should change that behavior. We are trying to do it now.

We are checking with IsWindowVisible( ::oPopup:hMenu ) to see if that way we can implement it.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Trbutton action menu

Postby Massimo Linossi » Fri Jul 16, 2010 2:15 pm

Thanks Antonio.
I wait for a possible solution.
Thanks to James too for the interest in this topic.
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: Trbutton action menu

Postby Antonio Linares » Fri Jul 16, 2010 11:11 pm

Massimo,

Ok, I think we already have a valid solution :-)

Image

Image

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Trbutton action menu

Postby Massimo Linossi » Sat Jul 17, 2010 6:47 am

Hi Antonio.
Thanks so much. Now is working perfectly. :D :D :D
Have a nice weekend.
Massimo.
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: Trbutton action menu

Postby Antonio Linares » Sat Jul 17, 2010 9:51 am

good :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 72 guests

cron