ribbonbar windows 10
Posted: Wed Apr 26, 2017 9:27 am
Hola
Como puedo poner en una ribbonbar el estilo windows 10 ?
Saludos,
Gabriel
Como puedo poner en una ribbonbar el estilo windows 10 ?
Saludos,
Gabriel
www.FiveTechSoft.com
http://forums.fivetechsoft.com/
Code: Select all
METHOD LDblClick( nRow, nCol, nFlags ) CLASS TRibbonBar
if ValType( ::bLDblClickQ ) == "B" .and. ::lOverQ
Eval( ::bLDblClickQ, nRow, nCol, nFlags )
endif
if ValType( ::bLDblClick ) == "B"
Eval( ::bLDblClick, nRow, nCol, nFlags )
endif
return nil
Code: Select all
#include "FiveWin.ch"
#include "ribbon.ch"
function Main()
local oWnd
DEFINE WINDOW oWnd
BuildRibbonBar( oWnd )
ACTIVATE WINDOW oWnd
return nil
function BuildRibbonBar( oWnd )
local oRBar, oGr1_1, oGr2_1, oBtn1_1_1, oBtn2_1_1
DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "One", "Two", "Three" HEIGHT 134 TOPMARGIN 25
oRBar:bLDblClick = { || If( oRBar:nHeight > 27, oRBar:nHeight := 27, oRBar:nHeight := 129 ) }
ADD GROUP oGr1_1 RIBBON oRBar TO OPTION 1 PROMPT "new" WIDTH 201 GRADIANT { { 0.1, RGB( 218, 229, 243 ), RGB( 218, 229, 243 ) }, { 0.9, RGB( 199, 216, 237 ), RGB( 218, 229, 243 ) } }
@ 3, 3 ADD BUTTON oBtn1_1_1 PROMPT "new" GROUP oGr1_1 ACTION MsgInfo( "click" ) SIZE 80, 83 TOP
@ 3, 83 ADD BUTTON oBtn2_1_1 PROMPT "new" GROUP oGr1_1 ACTION MsgInfo( "click" ) SIZE 80, 83 TOP
ADD GROUP oGr2_1 RIBBON oRBar TO OPTION 1 PROMPT "new" WIDTH 201 GRADIANT { { 0.1, RGB( 218, 229, 243 ), RGB( 218, 229, 243 ) }, { 0.9, RGB( 199, 216, 237 ), RGB( 218, 229, 243 ) } }
return nil
Code: Select all
oRBar:bLDblClick = { || If( oRBar:nHeight > 27, oRBar:nHeight := 27, oRBar:nHeight := 129 ) }
Code: Select all
local aClrMenu1 := { { 0.5, RGB( 69, 124, 188 ), RGB( 41, 93, 171 ) }, ;
{ 0.5, RGB( 26, 64, 136 ), RGB( 56, 135, 191 ) } }
local aClrMenu2 := { { 0.5, RGB( 123, 178, 236 ), RGB( 71, 126, 205 ) }, ;
{ 0.5, RGB( 17, 78, 175 ), RGB( 128, 225, 255 ) } }
DEFINE WINDOW oWnd TITLE "RibbonBar Test " + FWVERSION FROM 1,1 to 600,600 PIXEL
DEFINE RIBBONBAR oRBar WINDOW oWnd ;
PROMPT "Configuración", "Ficheros", "Informes", "Ayudas" ;
HEIGHT 133 TOPMARGIN 25 2013
oRBar:nRoundBox := 0
oRBar:nSeparation( 1 )
// BackStage( oRBar )
oRBar:nLeftMargin = 75
oRBar:CalcPos()
oTBtn0 = TRBtn():New( 4, 0, 75, 20, "..\bitmaps\rbnmenu.bmp", { || oRBar:BackStage() /* oRBar:KeybMode() */ }, oRBar,;
,,,,,, .F., .T.,,,,,, "POPUP", oMenu,,,,,,,,,,,,, aClrMenu1, nRGB( 125, 172, 215 ),;
nRGB( 65, 106, 189 ), oRBar:nRoundBox, )
oTBtn0:aClrGradOver = { || aClrMenu2 }
oTBtn0:aClrGradBack = aClrMenu2
oTBtn0:bClrGradSubOver = { || aClrMenu2 }
Included in FWH 17.04Antonio Linares wrote:José Luis,
Modificando asi el Método LDblClick() en la Clase TRibbonBar y con el ejemplo que te pongo a continuación se consigue el efecto que comentas:Aqui tienes un ejemplo que se comporta como indicas:Code: Select all
METHOD LDblClick( nRow, nCol, nFlags ) CLASS TRibbonBar if ValType( ::bLDblClickQ ) == "B" .and. ::lOverQ Eval( ::bLDblClickQ, nRow, nCol, nFlags ) endif if ValType( ::bLDblClick ) == "B" Eval( ::bLDblClick, nRow, nCol, nFlags ) endif return nil
Este es el código en concreto que hace lo que has comentado:Code: Select all
#include "FiveWin.ch" #include "ribbon.ch" function Main() local oWnd DEFINE WINDOW oWnd BuildRibbonBar( oWnd ) ACTIVATE WINDOW oWnd return nil function BuildRibbonBar( oWnd ) local oRBar, oGr1_1, oGr2_1, oBtn1_1_1, oBtn2_1_1 DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "One", "Two", "Three" HEIGHT 134 TOPMARGIN 25 oRBar:bLDblClick = { || If( oRBar:nHeight > 27, oRBar:nHeight := 27, oRBar:nHeight := 129 ) } ADD GROUP oGr1_1 RIBBON oRBar TO OPTION 1 PROMPT "new" WIDTH 201 GRADIANT { { 0.1, RGB( 218, 229, 243 ), RGB( 218, 229, 243 ) }, { 0.9, RGB( 199, 216, 237 ), RGB( 218, 229, 243 ) } } @ 3, 3 ADD BUTTON oBtn1_1_1 PROMPT "new" GROUP oGr1_1 ACTION MsgInfo( "click" ) SIZE 80, 83 TOP @ 3, 83 ADD BUTTON oBtn2_1_1 PROMPT "new" GROUP oGr1_1 ACTION MsgInfo( "click" ) SIZE 80, 83 TOP ADD GROUP oGr2_1 RIBBON oRBar TO OPTION 1 PROMPT "new" WIDTH 201 GRADIANT { { 0.1, RGB( 218, 229, 243 ), RGB( 218, 229, 243 ) }, { 0.9, RGB( 199, 216, 237 ), RGB( 218, 229, 243 ) } } return nil
Code: Select all
oRBar:bLDblClick = { || If( oRBar:nHeight > 27, oRBar:nHeight := 27, oRBar:nHeight := 129 ) }