FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with RibbonBar / FWH2102
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Problem with RibbonBar / FWH2102
Posted: Mon May 17, 2021 05: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 (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()

    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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Problem with RibbonBar / FWH2102
Posted: Mon May 17, 2021 05:34 PM
Dear Vilian
Please try with this
Code (fw): Select all Collapse
         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
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Problem with RibbonBar / FWH2102
Posted: Mon May 17, 2021 05:54 PM

Thank you ;)

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Problem with RibbonBar / FWH2102
Posted: Mon May 17, 2021 06: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
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Problem with RibbonBar / FWH2102
Posted: Mon May 17, 2021 06:50 PM

What is the differenc between them ?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil

Continue the discussion