FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour a small problem with ribbon popup menu
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
a small problem with ribbon popup menu
Posted: Thu Aug 19, 2010 01: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


Code (fw): Select all Collapse
#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
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: a small problem with ribbon popup menu
Posted: Thu Aug 19, 2010 01:21 PM

Hello gkuhnert

we will check soon

thanks

Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: a small problem with ribbon popup menu
Posted: Thu Aug 19, 2010 03: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
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: a small problem with ribbon popup menu
Posted: Fri Aug 20, 2010 01:05 PM
Hello gkuhnert

this changes is required in trbtn.prg

comment all "else" after ::Activate

Code (fw): Select all Collapse
                           ::oPopup:Activate( ::nTop + ::nHeight(), ::nLeft, oWnd, .F. )
//                        else
                           oWnd:oPopup = nil
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: a small problem with ribbon popup menu
Posted: Thu Aug 26, 2010 09:28 AM

Daniel,

thanks, now it works fine!

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de

Continue the discussion