a small problem with ribbon popup menu

a small problem with ribbon popup menu

Postby gkuhnert » Thu Aug 19, 2010 1:09 pm

Hi,

following problem occurs when working with the ribbon-menu:
If you click on a button and a popup menu opens, then you click somewhere else, the menu closes. That's all right. But if you click on the button again, nothing happens. Only if you click once again, the popup will appear again.

So:
1. Click the ribbon-button
2. When the popup-menu opens, click somewhere else (for example where the red cross is)
3. Click the ribbon-button again
=> the popup won't open
Image

Code: Select all  Expand view
#include "FiveWin.ch"
#INCLUDE "ribbon.CH"

static oWnd, oRb

//----------------------------------------------------------------------------//

function Main()

   DEFINE WINDOW oWnd FROM 1, 1 To 42, 105 ;
      TITLE "This is a MDI enviroment" MDI VSCROLL

   oWnd:oMenu:End()

   oWnd:bInit := {|| ribbon_menu() }

   ACTIVATE WINDOW oWnd

return nil

FUNCTION Ribbon_Menu(cWindow)

    local oGr1, oGr2
    local oBackBtn, oBtn[4], oPopup
    local oBackstage
    local aClrMenu1 := { { 0.5, RGB( 69, 124, 188 ), RGB( 41, 93, 171 ) }, { 0.5, RGB( 26, 64, 136 ), RGB( 56, 135, 191 ) } }
    local aClrMenu2 := { { 0.5, RGB( 123, 178, 236 ), RGB( 71, 126, 205 ) }, { 0.5, RGB( 17, 78, 175 ), RGB( 128, 225, 255 ) } }

    default cWindow := ""

    if oRb != nil
       oRb:End()
       oRB = nil
    endif


    MENU oPopup POPUP 2007
        MENUITEM "Action 1" ACTION MsgInfo("Action 1")
        MENUITEM "Action 2" ACTION MsgInfo("Action 2")
        SEPARATOR
        MENUITEM "Action 3" ACTION MsgInfo("Action 3")
    ENDMENU

    oRb := TRibbonBar():New(oWnd, {"Folder 1","Folder 2"}, ,, oWnd:nWidth, 125, 26 )
    oRb:nLeftMargin = 85
    oRb:CalcPos()

   oBackBtn = TRBtn():New( 4, 0, 70, 20, "./../bitmaps/rbnmenu.bmp", { || oRB:Backstage() }, oRB,;
        ,,,,,, .T., .T.,,,,,, /*"POPUP"*/ , oBackstage,,,,,,,,,,,,, aClrMenu1, nRGB( 125, 172, 215 ),;
      nRGB( 65, 106, 189 ) )

    ADD GROUP oGr1 RIBBON oRB TO OPTION 1 PROMPT "Group1" WIDTH 70
          @ 5,5 ADD BUTTON oBtn[3] PROMPT "Menu"    BITMAP "./../bitmaps/bottom1.bmp" GROUP oGr1 ROUND SIZE 63,65 POPUP MENU oPopup


    DEFINE BACKSTAGE oBackstage MAINWIDTH 800
    DEFINE BSSELECT OF oBackstage PROMPT "Test1" ACTION Msginfo("Test1")
    DEFINE BSSELECT OF oBackstage PROMPT "Test2" ACTION Msginfo("Test2")
    SET BACKSTAGE oBackstage TO oRb

return nil
 
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: a small problem with ribbon popup menu

Postby Daniel Garcia-Gil » Thu Aug 19, 2010 1:21 pm

Hello gkuhnert

we will check soon

thanks
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: a small problem with ribbon popup menu

Postby Silvio » Thu Aug 19, 2010 3:31 pm

Daniel , I saw also I this problem when I created the ribbonDesigner ... there is a bug on trbtn class , but the I forget to say you it
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: a small problem with ribbon popup menu

Postby Daniel Garcia-Gil » Fri Aug 20, 2010 1:05 pm

Hello gkuhnert

this changes is required in trbtn.prg

comment all "else" after ::oPopup:Activate

Code: Select all  Expand view

                           ::oPopup:Activate( ::nTop + ::nHeight(), ::nLeft, oWnd, .F. )
//                        else
                           oWnd:oPopup = nil  
 
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: a small problem with ribbon popup menu

Postby gkuhnert » Thu Aug 26, 2010 9:28 am

Daniel,

thanks, now it works fine!
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 71 guests