Page 1 of 1

Classe TOutLook2003 como 2007

Posted: Tue Mar 30, 2010 7:53 am
by pcordonet
Hola a todo el mundo.

Seria posible, modificar la classe TOutLook2003, con los colores de 2007 ?

Muchas gracias.

Re: Classe TOutLook2003 como 2007

Posted: Tue Mar 30, 2010 9:36 am
by Antonio Linares
Pedro,

Al inicio del código fuente de la clase TOutLook2003 estan estas líneas:

Code: Select all

#define LIGHTBLUE    nRGB(  89, 135, 214 )
#define DARKBLUE     nRGB(   3,  56, 147 )
#define LIGHTORANGE1 nRGB( 250, 227, 143 )
#define DARKORANGE1  nRGB( 238, 152, 25 )
#define LIGHTCYAN    nRGB( 203, 225, 252 )
#define DARKCYAN     nRGB( 125, 165, 224 )
#define LIGHTORANGE2 nRGB( 255, 255, 220 )
#define DARKORANGE2  nRGB( 247, 192, 91 )
 
Sólo tienes que modificar esos valores numéricos y recompilar outl2003.prg y enlazarlo como si fuese un PRG más de tu aplicación

Re: Classe TOutLook2003 como 2007

Posted: Tue Mar 30, 2010 4:36 pm
by pcordonet
Muchas gracias Antonio, ya esta resuelto.

Re: Classe TOutLook2003 como 2007

Posted: Wed Mar 31, 2010 10:45 am
by mgsoft
Hola:

¿Cuál son esos valores?.

Muchas gracias

Re: Classe TOutLook2003 como 2007

Posted: Wed Mar 31, 2010 11:10 am
by pcordonet
No solo he modificado valores sino que he modificado la clase con una propiedad l2007.
También he cambiado Gradient por gradientfull.

No esta perfecto pero da el pego.

_ me he mirado la clase "TRBtn"

en la Cabecera añadir

Code: Select all

#include "Colors.ch"

// Colors Office 2007
#define BLUEBOX0     RGB( 141, 178, 227 )      
#define BLUEBOX1     RGB( 197, 210, 223 )
#define BLUEBOX2     RGB( 237, 242, 248 )
#define BLUE0        RGB( 218, 229, 243 )      
#define BLUE1        RGB( 199, 216, 237 )      
#define BLUE2        RGB( 194, 217, 240 )      
#define BLUE3        RGB( 191, 219, 255 )

 
En las propiedades de la Clase (TOutLook2003)

Code: Select all

    DATA  l2007  INIT .F.
 

En el Metodo (METHOD Paint() CLASS TOutLook2003)
Declarar variable

Code: Select all

Local aGrad
 
Donde

Code: Select all

Gradient( ::hDC, { nTop, 0, nTop + 7, ::nWidth() }, DARKBLUE, LIGHTBLUE, .T. )            
 
Reemplazar por

Code: Select all

If ::l2007
   aGrad         := { {0.3, BLUE0, BLUE0 }, { 0.7, BLUE1, BLUE0 } }
   GradientFill( ::hDC, nTop , 0, nTop + 7, ::nWidth() , aGrad )
Else   
   Gradient( ::hDC, { nTop, 0, nTop + 7, ::nWidth() }, DARKBLUE, LIGHTBLUE, .T. )            
EndIf
 
En las propiedades de la clase TOutLook2003Group

Code: Select all

   DATA   l2007     INIT .F.
 
En el método (METHOD Paint( lOver ) CLASS TOutLook2003Group)
Declarar variables

Code: Select all

local aGrad,aGradHigh,aGradOver
 
Donde

Code: Select all

   Gradient( hDC := oCon:GetDC(), { nTop, 0, nTop + 30, oCon:nWidth() },;
             If( lOver, If( ::lSelected, ::nClrEnd, LIGHTORANGE2 ), ::nClrStart ),;
             If( lOver, If( ::lSelected, ::nClrStart, DARKORANGE2 ), ::nClrEnd ), .T. )            
 
Reemplazar por

Code: Select all

If ::l2007
    aGrad         := { {0.3, BLUE0, BLUE0 }, { 0.7, BLUE1, BLUE0 } }
    aGradHigh     := { {1/3, nRGB( 253,212,168 ), nRGB( 251,178,99 ) }, {2/3, nRGB( 250,157,52 ), nRGB( 252,234,163 ) } }
    aGradOver     := { {1 , nRGB( 255,215,84), nRGB( 255, 253, 222 ) } }
    GradientFill( hDC := oCon:GetDC() , nTop, 0, nTop + 30, oCon:nWidth() , If( lOver, aGradOver , If( ::lSelected , aGradHigh , aGrad) ) )
Else
    Gradient( hDC := oCon:GetDC(), { nTop, 0, nTop + 30, oCon:nWidth() },;
             If( lOver, If( ::lSelected, ::nClrEnd, LIGHTORANGE2 ), ::nClrStart ),;
             If( lOver, If( ::lSelected, ::nClrStart, DARKORANGE2 ), ::nClrEnd ), .T. )            
EndIf
 

Espero que también te funcione mas o menos bien.

Gracias.
Pere

Re: Classe TOutLook2003 como 2007

Posted: Mon Apr 05, 2010 6:57 am
by Antonio Linares
Pere,

Puedes poner una imagen aqui de como ha quedado ? :-)

Usa www.imageshack.us

Re: Classe TOutLook2003 como 2007

Posted: Tue Apr 06, 2010 9:03 am
by pcordonet
Hola Antonio,

Aquí tienes una imagen de como ha quedado.


Image

a ver si te parece bien.
Gracias.

Re: Classe TOutLook2003 como 2007

Posted: Wed Apr 07, 2010 7:24 am
by Antonio Linares
Pere,

Gracias por poner la imagen,

si, se ve bien :-)

Re: Classe TOutLook2003 como 2007

Posted: Wed Apr 07, 2010 9:45 am
by mgsoft
Antonio:

¿Y por qué los botones look 2007 no se ven como el azul de esa foto?.

gracias :D

Re: Classe TOutLook2003 como 2007

Posted: Mon Jun 07, 2010 5:05 am
by AIDA
Muy interesante :)