Problem with RibbonBar / FWH2102

Post Reply
User avatar
vilian
Posts: 985
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Problem with RibbonBar / FWH2102

Post 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

 
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
cnavarro
Posts: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: Problem with RibbonBar / FWH2102

Post by cnavarro »

Dear Vilian
Please try with this

Code: Select all | Expand


         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
vilian
Posts: 985
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: Problem with RibbonBar / FWH2102

Post by vilian »

Thank you ;)
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
cnavarro
Posts: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: Problem with RibbonBar / FWH2102

Post by cnavarro »

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
vilian
Posts: 985
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: Problem with RibbonBar / FWH2102

Post by vilian »

What is the differenc between them ?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Post Reply