Ribbon with transparent say

Ribbon with transparent say

Postby reinaldocrespo » Sat Feb 14, 2015 5:26 pm

Hi everyone;

I'm probably forgetting something as I can't seem to be able to place a transparent say on a oRibbon group. Can someone help?

Here is sample code for testing:

Code: Select all  Expand view  RUN

#include "fivewin.ch"
#include "ribbon.ch"

FUNCTION MAIN()
   LOCAL oWnd, oRibbon, oGroup
   

   DEFINE WINDOW oWnd
   
   DEFINE RIBBONBAR oRibbon ;
            PROMPTS "Option 1","Option 2", "Option 3" ;
                 OF oWnd ;
             HEIGHT 90 ;
          TOPMARGIN 20 //;
          //ON CHANGE ::ChangeRibbonBarOption( ::oRibbon:nOption ) OPTION _STARTRIBBONOPTION


   ADD GROUP oGroup RIBBON oRibbon TO OPTION 2 PROMPT "Filter" width 370
   oGroup:ltransparent := .T.
   
   @08, 060 SAY "From" SIZE 40, 18 OF oGroup PIXEL TRANSPARENT RIGHT
   
   ACTIVATE WINDOW oWnd

   
RETURN NIL

 


Thank you.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: Ribbon with transparent say

Postby Rick Lipkin » Mon Feb 16, 2015 2:56 pm

Reinaldo

I have never used a Ribbon bar but here is how I define my transparent Says .. I usually define a SetDlgGradient at the top of my program. SetDlgGradient() globally defines the transparent flag in your program as well as creating a nice color scheme for your program. You can define multiple color schemes with this function.

Hope this will work for you!
Rick Lipkin

Code: Select all  Expand view  RUN


//-----------------------------
Function Main()

Local oFontB,oSay1

LightGreyGrad()
oFontB := TFont():New("Ms Sans Serif",,-6,.F.,.T. ,,,,.F. )
...
...

// now your controls will globally be set for transparent without you adding the 'transparent' clause
// here is how I define a say from resources

REDEFINE SAY oSay1 PROMPT "Customer Invoices" ID 128 OF oGroup UPDATE
oSay1:SetFont( oFontB )
oSay1:SetColor(nRgb(7,7,224)) // blue

// translated without resources .. not tested
@08, 060 SAY oSay1 PROMPT "From" SIZE 40, 18 of oGroup  UPDATE



//------------------
Func LightGreyGrad()

SetDlgGradient( { { .50, nRGB( 216, 216, 216 ), nRGB( 255, 255, 255 ) } } )
Return(nil)

//-----------------
Func StandardGrad()

SetDlgGradient( { { .50, nRGB( 236, 233, 216 ), nRGB( 255, 255, 255 ) } } )
Return(nil)

//--------------------
Func DarkGreyGrad()

SetDlgGradient( { { 0.87, 16777215, 11513775 },{ 0.87,11513775, 16777215 }})
Return(nil)

//--------------------
Func SolidGrey()

SetDlgGradient( { { .50, nRGB( 233, 233, 233 ), nRGB( 233, 233, 233 ) } } )
Return(nil)

//--------------------
Func SolidChoral()

SetDlgGradient( { { .50, nRGB( 171, 129, 151 ), nRGB( 171, 129, 151 ) } } )  // choral
Return(nil)
 
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Ribbon with transparent say

Postby Daniel Garcia-Gil » Mon Feb 16, 2015 6:30 pm

Hello Reinaldo

you can use RBBTN like a SAY inside a RIBBON's GROUP

Code: Select all  Expand view  RUN
@08, 060 ADD BUTTON PROMPT "From" SIZE 40, 18 OF oGroup SAYBUTTON TRANSPARENT
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Ribbon with transparent say

Postby reinaldocrespo » Mon Feb 16, 2015 6:58 pm

SetDlgGradient() globally defines the transparent flag in your program as well as creating a nice color scheme for your program. You can define multiple color schemes with this function.


I did not know about these global settings. Thank you very much, Rick.

@08, 060 SAY "From" SIZE 40, 18 OF oGroup PIXEL TRANSPARENT RIGHT


¡Bárbaro!

Gracias, Daniel.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 26 guests