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: 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