Usando RibbonBar Nativa de FWH y MDI. Ahí va un ejemplo

Usando RibbonBar Nativa de FWH y MDI. Ahí va un ejemplo

Postby Cgallegoa » Fri Sep 11, 2009 6:41 pm

Hola amigos,

Les dejo un ejemplo de la clase RibbonBar nativa de FWH. Espero les sirva.

Image

Code: Select all  Expand view
#include "fivewin.ch"
#include "ribbon.ch"


STATIC oWnd
STATIC oDlgRB[3]

function main()

   local oRBar
   local oMenu, oMenuWnd, oBrush1
   local oGr, oGr1, oGr2, oGr3, oGr4
   local oBtn,   oBtn1,  oBtn2,  oBtn3,  oBtn4, oBtn5
   local oBtn6,  oBtn7,  oBtn8,  oBtn9,  oBtn10
   local oBtn11, oBtn12, oBtn13, oBtn14, oBtn15
   local oBtn16, oBtn17, oBtn18, oBtn19, oBtn20
   local oBtn21, oBtn22, oBtn23, oBtn24, oBtn25
   local oBtn26, oBtn27, oBtn28, oBtn29, oBtn30
   local oBtn31, oBtn32, oBtn33, oBtn34, oBtn35
   LOCAL oSay1, oBmp, oFont1
   LOCAL oCursor

   menu oMenu 2007
   endmenu

   DEFINE FONT oFont1 NAME "Arial" SIZE 0,-30 // BOLD
   DEFINE CURSOR oCursor HAND
   DEFINE BRUSH oBrush1 COLOR nRGB(210,210,255) // ,nRGB(255,255,255)
   DEFINE WINDOW oWnd TITLE "RibbonBar Test " + FWVERSION from 1,1 to 600,600 pixel MDI MENU oMenu brush oBrush1

   DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "Tab 01", "Tab 02", "Tab 03";
         HEIGHT 130 TOPMARGIN 25

   ADD GROUP oGr  RIBBON oRBar TO OPTION 1 PROMPT "Clipboard" width 130 BITMAP "c:\fwh-908\bitmap\fivetech.BMP"

     @ 02, 05 ADD BUTTON oBtn2 GROUP oGr BITMAP "C:\FWH-908\bitmaps\cut16.BMP" ;
       SIZE 75, 20 PROMPT "Dialog 01"  MOSTLEFT round ;
       action ( Dialog01() )

     @ 24, 05 ADD BUTTON oBtn3 GROUP oGr BITMAP "C:\FWH-908\bitmaps\copy16.BMP" ;
       SIZE 75, 20 PROMPT "Dialog 02"  MOSTLEFT round ;
       action( Dialog02() )

     @ 46, 05 ADD BUTTON oBtn4 GROUP oGr BITMAP "C:\FWH-908\bitmaps\paste16.BMP" ;
       SIZE 75, 20 PROMPT "Dialog 03"  MOSTLEFT round ;
       action( Dialog03() )

   ADD GROUP oGr1 RIBBON oRBar TO OPTION 1 PROMPT "Font" WIDTH 205

     @ 10, 05 ADD BUTTON oBtn5 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\bold16.bmp" GROUPBUTTON FIRST SIZE 25, 20 ROUND ;
     ACTION( oBtn5:lSelected := !oBtn5:lSelected )

     @ 10, 30 ADD BUTTON oBtn6 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\italic16.bmp" GROUPBUTTON SIZE 25, 20 ROUND ;
        ACTION( oBtn6:lSelected := !oBtn6:lSelected )

     @ 10, 55 ADD BUTTON oBtn7 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\underline16.bmp" GROUPBUTTON SIZE 35, 20 ROUND Popup

     @ 10, 90 ADD BUTTON oBtn8 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\strikethru16.bmp" GROUPBUTTON SIZE 25, 20 ROUND;
        ACTION( oBtn8:lSelected := !oBtn8:lSelected )

     @ 10, 115 ADD BUTTON oBtn9 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\subindex16.bmp" GROUPBUTTON SIZE 25, 20 ROUND;
        ACTION( oBtn9:lSelected := !oBtn9:lSelected, oBtn10:lSelected := .f., oBtn10:Refresh() )

     @ 10, 140 ADD BUTTON oBtn10 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\superindex16.bmp" GROUPBUTTON SIZE 25, 20 ROUND ;
        ACTION( oBtn10:lSelected := !oBtn10:lSelected, oBtn9:lSelected := .f., oBtn9:Refresh() )

     @ 10, 165 ADD BUTTON oBtn11 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\casing16.bmp" GROUPBUTTON END SIZE 35, 20 ROUND POPUP

     @ 40, 05 ADD BUTTON oBtn11 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\hilight16.bmp" GROUPBUTTON FIRST SIZE 35, 20 ROUND POPUP

     @ 40, 40 ADD BUTTON oBtn12 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\fontcolor16.bmp" GROUPBUTTON END SIZE 35, 20 ROUND POPUP

     @ 40, 100 ADD BUTTON oBtn13 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\fontsizeincrease16.bmp" GROUPBUTTON FIRST SIZE 25, 20 ROUND

     @ 40, 125 ADD BUTTON oBtn14 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\fontsizedecrease16.bmp" GROUPBUTTON END SIZE 25, 20 ROUND

     @ 40, 175 ADD BUTTON oBtn16 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\style16.bmp" SIZE 25, 20 ROUND BORDER


   ADD GROUP oGr2 RIBBON oRBar TO OPTION 1 PROMPT "Exit" width 70 // BITMAP "c:\fwh-908\bitmap\fivetech.bmp"

     @ 15, 20 ADD BUTTON oBtn4 GROUP oGr2 BITMAP "C:\FWH-908\bitmaps\32x32\quit.BMP" ;
           SIZE 34,52 PROMPT "Exit" action( oWnd:End())

   SET MESSAGE OF oWnd TO "Testing FWH own Class RibbonBar" ;
      CENTERED CLOCK KEYBOARD 2007

   WndCenter(oWnd:hWnd)

   ACTIVATE WINDOW oWnd ON INIT Dialog01() // MAXIMIZED

   oRBar:End()

return nil




Procedure Dialog01()
   LOCAL aCoords:=GetCoors(oWnd:oWndClient), oBrush, oGet, cTxtGet:="Get in Dialog 01"
   LOCAL oFont1, oBmpAlpha
   LOCAL lEscapa:=.F.

   HideDlg( 1 )

   if ValType(oDlgRB[1]) <> "O"
      oBmpAlpha:=TImage():Define(, "c:\fwh-908\Bitmaps\AlphaBmp\World.bmp" )
      DEFINE FONT oFont1 NAME "Ms Sans Serif" SIZE 0,-8 BOLD
      DEFINE BRUSH oBrush FILE "c:\fwh-908\Bitmaps\BackGrnd\Stone.bmp"
      DEFINE DIALOG oDlgRB[1] FROM 0,0 TO 538,782 OF oWnd:oWndClient PIXEL // COLORS RGB(0,0,0),RGB(255,255,255)
         oDlgRB[1]:nStyle := nOR(WS_CHILD) // ,WS_THICKFRAME
         oDlgRB[1]:oBrush := oBrush
         oDlgRB[1]:lTransparent := .T.

      @ 20,20 SAY "Some text bla bla bla in DIALOG 01" OF oDlgRB[1] PIXEL COLOR nRGB(0,0,125) FONT oFont1

      @ 35,20 GET oGet VAR cTxtGet OF oDlgRB[1] PIXEL

      ACTIVATE DIALOG oDlgRB[1] NOWAIT ; //CENTERED
          ON INIT (oDlgRB[1]:Move(aCoords[1]+0,aCoords[2]+0,,,.T.));
          ON PAINT (ABPaint( hDC,335,200, oBmpAlpha:hBitmap, 255 ));
          VALID lEscapa
   else
      oDlgRB[1]:Show()
   endif
Return



Procedure Dialog02()
   LOCAL aCoords:=GetCoors(oWnd:oWndClient), oBrush, oGet, cTxtGet:="Get in Dialog 02"
   LOCAL oFont1, oBmpAlpha
   LOCAL lEscapa:=.F.

   HideDlg( 2 )

   if ValType(oDlgRB[2]) <> "O"
      oBmpAlpha:=TImage():Define(, "c:\fwh-908\Bitmaps\AlphaBmp\World.bmp" )
      DEFINE FONT oFont1 NAME "Ms Sans Serif" SIZE 0,-8 BOLD
      DEFINE BRUSH oBrush FILE "c:\fwh-908\Bitmaps\BackGrnd\Stone.bmp"
      DEFINE DIALOG oDlgRB[2] FROM 0,0 TO 538,782 OF oWnd:oWndClient PIXEL // COLORS RGB(0,0,0),RGB(255,255,255)
         oDlgRB[2]:nStyle := nOR(WS_CHILD) // ,WS_THICKFRAME
         oDlgRB[2]:oBrush := oBrush
         oDlgRB[2]:lTransparent := .T.

         @ 30,30 SAY "Some text bla bla bla in DIALOG 02" OF oDlgRB[2] PIXEL COLOR nRGB(0,0,125) FONT oFont1

         @ 45,30 GET oGet VAR cTxtGet OF oDlgRB[2] PIXEL

      ACTIVATE DIALOG oDlgRB[2] NOWAIT ; //CENTERED
          ON INIT (oDlgRB[2]:Move(aCoords[1]+0,aCoords[2]+0,,,.T.));
          ON PAINT (ABPaint( hDC,365,230, oBmpAlpha:hBitmap, 255 ));
          VALID lEscapa
   else
      oDlgRB[2]:Show()
   endif
Return




Procedure Dialog03()
   LOCAL aCoords:=GetCoors(oWnd:oWndClient), oBrush, oGet, cTxtGet:="Get in Dialog 03"
   LOCAL oFont1, oBmpAlpha
   LOCAL lEscapa:=.F.

   HideDlg( 3 )

   if ValType(oDlgRB[3]) <> "O"
      oBmpAlpha:=TImage():Define(, "c:\fwh-908\Bitmaps\AlphaBmp\World.bmp" )
      DEFINE FONT oFont1 NAME "Ms Sans Serif" SIZE 0,-8 BOLD
      DEFINE BRUSH oBrush FILE "c:\fwh-908\Bitmaps\BackGrnd\Stone.bmp"
      DEFINE DIALOG oDlgRB[3] FROM 0,0 TO 538,782 OF oWnd:oWndClient PIXEL // COLORS RGB(0,0,0),RGB(255,255,255)
         oDlgRB[3]:nStyle := nOR(WS_CHILD) // ,WS_THICKFRAME
         oDlgRB[3]:oBrush := oBrush
         oDlgRB[3]:lTransparent := .T.

         @ 40,40 SAY "Some text bla bla bla in DIALOG 03" OF oDlgRB[3] PIXEL COLOR nRGB(0,0,125) FONT oFont1

         @ 55,40 GET oGet VAR cTxtGet OF oDlgRB[3] PIXEL

      ACTIVATE DIALOG oDlgRB[3] NOWAIT ; //CENTERED
          ON INIT (oDlgRB[3]:Move(aCoords[1]+0,aCoords[2]+0,,,.T.));
          ON PAINT (ABPaint( hDC,395,260, oBmpAlpha:hBitmap, 255 ));
          VALID lEscapa
   else
      oDlgRB[3]:Show()
   endif
Return




Procedure HideDlg( nDlg )
   LOCAL i:=1
   for i:=1 TO Len(oDlgRB)
       if ValType(oDlgRB[i])=="O"
          oDlgRB[i]:Hide()
       endif
   next
Return

Saludos,

Carlos Gallego
Saludos,

Carlos Gallego

*** FWH-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 492
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

Re: Usando RibbonBar Nativa de FWH y MDI. Ahí va un ejemplo

Postby Daniel Garcia-Gil » Fri Sep 11, 2009 6:52 pm

Carlos...

Gracias por el ejemplo, se ve magnifico, le has tomado el punto a la clase
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Usando RibbonBar Nativa de FWH y MDI. Ahí va un ejemplo

Postby ruben Dario » Fri Sep 11, 2009 8:40 pm

Muy bueno el Ejemplo , a partir de que version FWH funciona..
Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com
User avatar
ruben Dario
 
Posts: 1069
Joined: Thu Sep 27, 2007 3:47 pm
Location: Colombia

Re: Usando RibbonBar Nativa de FWH y MDI. Ahí va un ejemplo

Postby Cgallegoa » Fri Sep 11, 2009 8:47 pm

Rubén Darío,

FWH-908

Saludos,

Carlos Gallego
Saludos,

Carlos Gallego

*** FWH-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 492
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

Re: Usando RibbonBar Nativa de FWH y MDI. Ahí va un ejemplo

Postby Antonio Linares » Fri Sep 11, 2009 11:14 pm

Carlos,

Con tu permiso lo incluimos como un ejemplo de uso de la Ribbon y diálogos no modales para FWH 9.09, gracias :-)
regards, saludos

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

Re: Usando RibbonBar Nativa de FWH y MDI. Ahí va un ejemplo

Postby Cgallegoa » Fri Sep 11, 2009 11:53 pm

Antonio,

Es un honor para mí.

Si gustas lo pulo un poco, incluyendo xBrowse.

Saludos,

Carlos Gallego
Saludos,

Carlos Gallego

*** FWH-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 492
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

Re: Usando RibbonBar Nativa de FWH y MDI. Ahí va un ejemplo

Postby Antonio Linares » Sat Sep 12, 2009 6:20 am

Carlos,

Claro que si, gracias! :-)
regards, saludos

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

Re: Usando RibbonBar Nativa de FWH y MDI. Ahí va un ejemplo

Postby AIDA » Tue Nov 03, 2009 4:34 am

Que bien se ve :D
Que es mejor que programar? creo que nada :)
Atropellada pero aqui ando :P

I love Fivewin

séʌǝɹ ןɐ ɐʇsǝ opunɯ ǝʇsǝ
User avatar
AIDA
 
Posts: 879
Joined: Fri Jan 12, 2007 8:35 pm

Re: Usando RibbonBar Nativa de FWH y MDI. Ahí va un ejemplo

Postby joseluisysturiz » Wed Nov 04, 2009 5:52 am

Super, quien dijo Visual Bichos...nada que envidiar.....? jejeje.
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Willi Quintana and 19 guests