RibbonBar in a MDI example

RibbonBar in a MDI example

Postby Antonio Linares » Wed Mar 03, 2010 7:04 pm

This example shows how to use a RibbonBar in a MDI windows frame:
Code: Select all  Expand view
#include "FiveWin.ch"
#include "ribbon.ch"

function Main()

   local oWnd, oRBar, oGrp1, oBtn1, oGrp2, oGrp3

   DEFINE WINDOW oWnd MDI
   
   DEFINE RIBBONBAR oRBar OF oWnd PROMPT "Configuración", "Ficheros", "Informes", "Ayudas" HEIGHT 133 TOPMARGIN 25

   ADD GROUP oGrp1 RIBBON oRBar TO OPTION 1 PROMPT "One" WIDTH 130
   
   @ 2,5 ADD BUTTON oBtn1 PROMPT "New" BITMAP "new.bmp" GROUP oGrp1 ACTION NewChild( oWnd ) ;
      ROUND SIZE 50, 83

   ADD GROUP oGrp2 RIBBON oRBar TO OPTION 1 PROMPT "Two" WIDTH 130
   ADD GROUP oGrp3 RIBBON oRBar TO OPTION 1 PROMPT "Three" WIDTH 130

   SET MSGBAR OF oWnd 2007

   ACTIVATE WINDOW oWnd

return nil

function NewChild( oWnd )

   local oWndChild
   
   DEFINE WINDOW oWndChild OF oWnd MDICHILD ;
      COLORS 0, nRGB( nRandom( 150, 255 ), nRandom( 150, 255 ), nRandom( 150, 255 ) )

   oWndChild:Maximize()

return nil
 

Image
You can download the example from here:
http://www.mediafire.com/?jw0ywmz1m3n
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: RibbonBar in a MDI example

Postby Antonio Linares » Wed Mar 03, 2010 7:27 pm

If you don't want to use the pulldown menu, as the ribbon should not be used with a menu, simply add:
Code: Select all  Expand view

   DEFINE WINDOW oWnd MDI
   
   oWnd:oMenu:End()

   ...
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: RibbonBar in a MDI example

Postby Silvio » Thu Mar 04, 2010 12:31 pm

work perfectly also on windows xp prof and seven
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 78 guests

cron