Problem with RibbonBar / FWH2102

Problem with RibbonBar / FWH2102

Postby vilian » Mon May 17, 2021 5:05 pm

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

    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

 
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 920
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Problem with RibbonBar / FWH2102

Postby cnavarro » Mon May 17, 2021 5:34 pm

Dear Vilian
Please try with this
Code: Select all  Expand view

         MenuAddItem("Test 1","Test 1",.F.,, {|| Create1()},,,,,,,.F.,,,.F.,.F.,.f. )
 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6504
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with RibbonBar / FWH2102

Postby vilian » Mon May 17, 2021 5:54 pm

Thank you ;)
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 920
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Problem with RibbonBar / FWH2102

Postby cnavarro » Mon May 17, 2021 6:02 pm

Parameter 5 is bAction and parameter 9 is bBlock
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6504
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with RibbonBar / FWH2102

Postby vilian » Mon May 17, 2021 6:50 pm

What is the differenc between them ?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 920
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests