Page 1 of 1

SetColor and TFolder?

Posted: Sat Nov 29, 2008 2:12 pm
by Horizon
Hi,

Is it possible to use set color TFolder class.

Code: Select all

#include "FiveWin.ch" 

function Main() 

   local oFnt, oFnt2, oDlg, oFld, oGrp, oGrp1 
    
   DEFINE FONT oFnt NAME "Verdana" SIZE 0, -16 BOLD 

   DEFINE FONT oFnt2 NAME "Arial" SIZE 0, -10 
    
   DEFINE DIALOG oDlg SIZE 400, 300 FONT oFnt TRANSPARENT
   
   @ 0.5, 1 FOLDER oFld OF oDlg SIZE 188, 138 ; 
      PROMPTS "One", "Two", "Three" 
      
   @ 1, 1 GROUP oGrp TO 5, 15 PROMPT "Test" OF oFld:aDialogs[ 1 ] FONT oFnt2 

   @ 5, 1 BUTTON "font" OF oFld:aDialogs[ 1 ] ACTION oGrp:SelFont() 
      
   ACTIVATE DIALOG oDlg CENTERED ON INIT (oDlg:SetColor(,9425383),oFld:SetColor(,9425383))

return nil 

Folder-Color

Posted: Sat Nov 29, 2008 2:39 pm
by ukoenig
Hello Horizon,

make it a bit different :

Sample : fill a DIALOG and FOLDER with GRADIENT

Code: Select all


DEFINE DIALOG oDlg RESOURCE "MainDlg" TITLE  "Dialog" FONT ProgFont

REDEFINE FOLDER oFld ID 110 OF oDlg ; 
PROMPTS "  &Page 1 ", "  &Page 2 "  ;
DIALOGS "Page1","Page2" FONT oProgFont 

FOLDER_1(oDlg,oFld)
FOLDER_2(oDlg,oFld)

ACTIVATE DIALOG oDlg CENTERED ;
ON PAINT ( Gradpaint0( hDC, oDlg ), SetDialogsGradient( oFld ) ) ;
ON INIT ( oDlg:Move( 30 , 10, oDlg:nWidth, oDlg:nHeight, .f. ) 

RETURN ( NIL )

// --------- Gradient in FOLDER -------------------

FUNCTION SetDialogsGradient( oFld ) 
LOCAL n, oDlg 
    
for n = 1 to Len( oFld:aDialogs ) 
      oDlg = oFld:aDialogs[ n ]                                      
      oDlg:bPainted = { | hDC | GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, { { 0.50, 12609872, 16045947 } } ) } 
next    

RETURN NIL    

// -------- Gradient in DIALOG ---------------------------------

static func Gradpaint0( hDC, oDlg )
local aGrad1

aGrad1 := { { 0.50, 16054371, 8388608 },{ 0.50, 8388608, 16054371 } }
GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aGrad1, .T. )

RETURN NIL

Posted: Sat Nov 29, 2008 9:45 pm
by Horizon
Thank you Uwe,

Your code works perfectly, but I use WindowsXP.Manifest. In this case transparent does not work.

I have searched the forum. I found the below thread from Ramesh. I have changed the TFolder class like Ramesh changed in TControl class. It work perfectly.

Thank you Ramesh,


http://forums.fivetechsoft.com/viewtopic.php?t=4807

Posted: Sat Nov 29, 2008 9:49 pm
by Horizon
Hi,

Just one question. Is it possible to change color of Tabs Caption?

Tab-colors

Posted: Sat Nov 29, 2008 10:14 pm
by ukoenig
Hello Hakan,
have a look at :

http://forums.fivetechsoft.com/viewtopi ... lored+tabs

Regards
Uwe :lol:

Posted: Sun Nov 30, 2008 3:17 am
by joseluisysturiz
Nose si es esto lo que quieres....saludos... :shock:
*oFldArti:aDialogs[2]:SetColor( ,rgb(255, 255, 200)) // PONER COLOR A UNA PESTAÑA DE FOLDER

Posted: Sun Nov 30, 2008 3:58 am
by RAMESHBABU
Hello Horizon,

You are most welcome and thanks for your kind words.

- Ramesh Babu P

Posted: Sun Nov 30, 2008 8:15 pm
by hag
How would you set colors in tabs not folders?

Posted: Mon Dec 01, 2008 1:14 pm
by Horizon
hag wrote:How would you set colors in tabs not folders?
I could not. Is there anybody who changed the tabs color?

Thanks,

Tab-colors

Posted: Mon Dec 01, 2008 4:18 pm
by ukoenig
Hallo Horizon,

It is just a test, because i don't need it.
I think with some changes in Tfolder it seems,
it is possible to define extra colors for the tabs.
You need two color-eareas : one for tabs and another one for data.
It is not completed for the moment ( missing transparent for tab-background-area )
There has still a activate-color needed like in this sample, the
2. tab-color ( green ) has change to white after the 2. Page has the focus.
Maybe another idea from somebody else ?

Image

Regards
Uwe :lol: