SetColor and TFolder?

SetColor and TFolder?

Postby Horizon » Sat Nov 29, 2008 2:12 pm

Hi,

Is it possible to use set color TFolder class.

Code: Select all  Expand view
#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 & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Folder-Color

Postby ukoenig » Sat Nov 29, 2008 2:39 pm

Hello Horizon,

make it a bit different :

Sample : fill a DIALOG and FOLDER with GRADIENT
Code: Select all  Expand view

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby Horizon » Sat Nov 29, 2008 9:45 pm

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 & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Postby Horizon » Sat Nov 29, 2008 9:49 pm

Hi,

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

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Tab-colors

Postby ukoenig » Sat Nov 29, 2008 10:14 pm

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby joseluisysturiz » Sun Nov 30, 2008 3:17 am

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
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Postby RAMESHBABU » Sun Nov 30, 2008 3:58 am

Hello Horizon,

You are most welcome and thanks for your kind words.

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Postby hag » Sun Nov 30, 2008 8:15 pm

How would you set colors in tabs not folders?
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Postby Horizon » Mon Dec 01, 2008 1:14 pm

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 & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Tab-colors

Postby ukoenig » Mon Dec 01, 2008 4:18 pm

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 96 guests