Page 1 of 1

Problem with RibbonBar / FWH2102

Posted: Mon May 17, 2021 5:05 pm
by vilian
Dear Friends,
I'm having a problem with RibbonBar and last FWH version. I made a little sample to show this(Pls see code bellow). IF I click on the menu of Test1 button and choose the option, Create1() is run twice. Do you know why ?

Code: Select all | Expand


#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()

    local oGr1, oMnu
    local oBtn

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

    ADD GROUP oGr1 RIBBON oRB TO OPTION 1 PROMPT "Group1" WIDTH 140

    MENU oMnu POPUP 2007
         MenuAddItem("Test 1","Test 1",.F.,,,,,,{|| Create1()},,,.F.,,,.F.,.F.,.f. )
    ENDMENU

    @ 5,5 ADD BUTTON oBtn PROMPT "Window 1" BITMAP "" GROUP oGr1 POPUP MENU oMnu ROUND SIZE 63,65

    SetWndDefault( oRb )

return nil

function Create1()
local oWndChild
   DEFINE WINDOW oWndChild MDICHILD OF oWnd
   ACTIVATE WINDOW oWndChild
return nil

 

Re: Problem with RibbonBar / FWH2102

Posted: Mon May 17, 2021 5:34 pm
by cnavarro
Dear Vilian
Please try with this

Code: Select all | Expand


         MenuAddItem("Test 1","Test 1",.F.,, {|| Create1()},,,,,,,.F.,,,.F.,.F.,.f. )
 

Re: Problem with RibbonBar / FWH2102

Posted: Mon May 17, 2021 5:54 pm
by vilian
Thank you ;)

Re: Problem with RibbonBar / FWH2102

Posted: Mon May 17, 2021 6:02 pm
by cnavarro
Parameter 5 is bAction and parameter 9 is bBlock

Re: Problem with RibbonBar / FWH2102

Posted: Mon May 17, 2021 6:50 pm
by vilian
What is the differenc between them ?