SetColor and TFolder?

Post Reply
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

SetColor and TFolder?

Post 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 
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Folder-Color

Post 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
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Post 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
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Post by Horizon »

Hi,

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

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Tab-colors

Post by ukoenig »

Hello Hakan,
have a look at :

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

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
joseluisysturiz
Posts: 2024
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela
Contact:

Post 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
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Post by RAMESHBABU »

Hello Horizon,

You are most welcome and thanks for your kind words.

- Ramesh Babu P
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Post by hag »

How would you set colors in tabs not folders?
Thank you
Harvey
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Post 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,
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Tab-colors

Post 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:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
Post Reply