FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Pintado de Ribbon
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Pintado de Ribbon
Posted: Tue Nov 12, 2013 04:15 PM
Carlos
No veo donde puede estar el problema
El siguiente ejemplo me sigue funcionando OK
Pruebalo cambiando el BITMAP y seguimos investigando

Code (fw): Select all Collapse
 #INCLUDE 'Fivewin.ch'
 #include "Constant.ch"
 #INCLUDE 'Ribbon.ch'
 #include 'colores.ch'
 
 STATIC OWNDMAIN, oFont , oFuenteL, oFuenteM, oFuenteS, oWnd
 
Procedure Main()
   LOCAL oBrush , oBmpTit, oRbn
   Local oMenu  := Nil

if Login()
   DEFINE BRUSH oBrush COLOR METRO_WINDOW

   DEFINE FONT oFuenteL  NAME "Segoe UI Light"   SIZE 0, -30
   DEFINE FONT oFuenteM  NAME "Segoe UI Light"   SIZE 0, -17
   DEFINE FONT oFuenteS  NAME "Segoe UI Light"   SIZE 0, -14

                       
  DEFINE WINDOW oWnd MDI  BRUSH oBrush TITLE 'Prueba' STYLE nOr( WS_POPUP, WS_BORDER )
   

   oWnd:oMenu:end()

   oRbn := MainMenu( oWnd )
   ACTIVATE WINDOW oWnd MAXIMIZED ON INIT (SetParent( oRbn:hWnd, oWnd:hWnd ))

endif


RETURN

//----------------------------------------------------------------------------//
Function MainMenu() 


   local  oRbnBar, oGr1,oTBtn1, oTBtn2,oTBtn3,oGr2,oGr3
   local  oBtn, oBtn1, oBtn2, oBtn3, oBtn4, oBtn5, oBtn6, oBtn7, oBtn8
   local  oBackStage
   local option
   local oMtr,nAct
   local aDB := {}

   DEFINE RIBBONBAR oRbnBar WINDOW oWnd:oClient PROMPT "Principal" ;
                HEIGHT 127 TOPMARGIN 25 2013 //Apariencia del 2013

   oRbnBar:nClrPaneRB       = METRO_WINDOW

  
   ADD group oGr1 RIBBON oRbnBar to Option 1 PROMPT "Maestros" WIDTH 805 //;
   oGr1:nClrTxt   := METRO_APPWORKSPACE
   oGr1:SetFont(oFuenteS)


      @ 5,5   ADD BUTTON oBtn1 PROMPT "SubSec"    GROUP oGr1 BITMAP ".\..\Res\Back48.bmp"    SIZE 75,75 ACTION Mantegen("MAESUBSEC",aDB,.T.,{},{})
      oBtn1:SetFont(oFuenteS)

      @ 5,85  ADD BUTTON oBtn PROMPT "CLegal"    GROUP oGr1 BITMAP ".\..\Res\Back48.bmp"    ROUND SIZE 75,75 ACTION Mantegen("MAECONLEG",aDB,.T.,{},{})
      oBtn:SetFont(oFuenteS)

      @ 5,165 ADD BUTTON oBtn PROMPT "CInterno"  GROUP oGr1 BITMAP ".\..\Res\Back48.bmp"   ROUND SIZE 75,75 ACTION  Mantegen("MAECONINT",aDB,.T.,{},{})
      oBtn:SetFont(oFuenteS)

      @ 5,245 ADD BUTTON oBtn PROMPT "Provincia" GROUP oGr1 BITMAP ".\..\Res\Back48.bmp"    ROUND SIZE 75,75 ACTION  Mantegen("MAEPROVIN",aDB,.T.,{},{})
      oBtn:SetFont(oFuenteS)

      @ 5,325 ADD BUTTON oBtn PROMPT "Paises"    GROUP oGr1 BITMAP ".\..\Res\Back48.bmp"    ROUND SIZE 75,75 ACTION  Mantegen("MAEPAIS",aDB,.T.,{},{})
      oBtn:SetFont(oFuenteS)

      @ 5,405 ADD BUTTON oBtn PROMPT "Poblacion" GROUP oGr1 BITMAP ".\..\Res\Back48.bmp" ROUND SIZE 75,75 ACTION  Mantegen("MAEPOBLAC",aDB,.T.,{},{})
      oBtn:SetFont(oFuenteS)

   ADD group oGr2 RIBBON oRbnBar to Option 1 PROMPT "Internos" WIDTH 100

      @ 5,15   ADD BUTTON oBtn PROMPT "Datos Pers." GROUP oGr2 BITMAP "trabaja" ROUND SIZE 75,75 ACTION Mantegen ("DATPER",aDB,.F.,{},{})
      oGr2:SetFont(oFuenteS)
      oBtn:SetFont(oFuenteS)

   ADD group oGr3 RIBBON oRbnBar to Option 1 PROMPT "Externos" WIDTH 100

      @ 5,15   ADD BUTTON oBtn PROMPT "Datos Pers." GROUP oGr3 BITMAP "exter"   ROUND SIZE 75,75 ACTION oWnd:End() //Mantegen ("INFTRAEXT",aDB,.F.,{},{})
      oGr3:SetFont(oFuenteS)
      oBtn:SetFont(oFuenteS)

 return oRbnBar

Function Mantegen( cData )
RETURN MsgInfo(cData )

Function Login()
Local oDlg, oBtn, oBtn1
Local lSw   := .T.
DEFINE DIALOG oDlg 

@ 1,1 FLATBTN oBtn  SIZE 40, 40 PROMPT "No Valida" OF oDlg ACTION ( lSw := .F., oDlg:End() )
@ 1,50 FLATBTN oBtn1 SIZE 40, 40 PROMPT "Asi Vale" OF oDlg ACTION ( oDlg:End() )
ACTIVATE DIALOG oDlg CENTERED

Return lSw
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: 989
Joined: Thu Nov 24, 2005 03:01 PM
Re: Pintado de Ribbon
Posted: Wed Nov 13, 2013 11:27 AM

Hola Cristobal,

hemos decidido no usar Ribbon con un MDI, porque aunque el SetParent() nos funcionase, no es seguro usar una solución que no sabemos cuando va a dejar de funcionar, no podemos fiarnos de eso.
Mil gracias por las molestias que te tomas, es una actitud loable. Vas a tener que venir a Torrejón a por las cañas ;)

Un abrazo

Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"

Continue the discussion