Add Color to a Group Frame

Add Color to a Group Frame

Postby Rick Lipkin » Mon Apr 06, 2015 10:11 pm

To All

How to I add Color to the Group Frame .. I can add color to the text .. but how can I make the frame stand out by defining it ( lets say ) White ??

I am also using the XPManifest if that makes any difference.

Here is my Group Code:
Code: Select all  Expand view

 REDEFINE GROUP oGrp1 ID 200 of oGrps
             oGrp1:SetFont( oFontB )
             oGrp1:nClrText := nRgb( 7,7,224 ) // blue
 

Image

Thanks
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Add Color to a Group Frame

Postby ukoenig » Tue Apr 07, 2015 9:33 am

Rick,

have a look at < TESTGROU.prg > in sample-folder.
I think it will answer You question.

( my first time after 2 weeks in hospital, visiting the forum )

Image

best regards
Uwe :)
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

Re: Add Color to a Group Frame

Postby Enrico Maria Giordano » Tue Apr 07, 2015 9:49 am

Uwe,

ukoenig wrote:( my first time after 2 weeks in hospital, visiting the forum )


Hope you have had a good recovery!

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Add Color to a Group Frame

Postby Rick Lipkin » Tue Apr 07, 2015 1:17 pm

Uwe

Unfortunately, I could not seem to adapt the code .. I made this change( added nClrPane ) , but the frame remained the same color with no change from my picture above :(

Hope you are feeling better !

Rick Lipkin
Code: Select all  Expand view

 REDEFINE GROUP oGrp1 ID 200 of oGrps
             oGrp1:SetFont( oFontB )
             oGrp1:nClrText := nRgb( 7,7,224 )     // blue
             oGrp1:nClrPane := nRgb( 255,255,255 ) // white
 


ps .. I am also using SetDlgGradient(), which automatically sets the TransParent logical.
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Add Color to a Group Frame

Postby Rick Lipkin » Tue Apr 07, 2015 5:49 pm

To All

Here is the sample code .. please note that the Group Frame is all washed out and I have not been able to find the right combination to add color to the frame .. This only seems to occur with the XpManifest linked in ..

Rick Lipkin

Code: Select all  Expand view

#include "FiveWin.ch"


Func Main()

local oDlg,oGrp1,oGrp2,oFontB

oFontB  := TFont():New("Ms Sans Serif",,-6,.F.,.T. ,,,,.F. )
SetDlgGradient( { { 0.01,9408399,14671839 },{ 0.01,14671839,9408399 } } )   // light grey

DEFINE DIALOG oDlg SIZE 300, 300

   @ 1, 1 GROUP oGrp1 TO 4, 12 PROMPT "First" OF oDlg
          oGrp1:SetFont( oFontB )
          oGrp1:nClrText := nRgb( 7,7,224 )     // blue
          oGrp1:nClrPane := nRgb( 255,255,255 ) // white


   @ 5, 1 GROUP oGrp2 TO 8, 12 PROMPT "Second" OF oDlg
          oGrp2:SetFont( oFontB )
          oGrp2:nClrText := nRgb( 255,255,255 ) // white
          oGrp2:nClrPane := nRgb( 255,255,255 ) // white

ACTIVATE DIALOG oDlg CENTERED

RELEASE FONT oFontB

Return(nil)
 


WindowsXP.Manifest
Code: Select all  Expand view

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    version="1.0.0.0"
    processorArchitecture="X86"
    name="FiveTech Software.FiveWin.32bits"
    type="win32"
/>
<description>Your application description here.</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="X86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>
 


XpLook.Rc
Code: Select all  Expand view

// Add this to your resources RC file

#ifdef __FLAT__
   1 24 ".\WindowsXP.Manifest"
#endif
 
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Add Color to a Group Frame

Postby Antonio Linares » Tue Apr 07, 2015 6:14 pm

Rick,

Please move these lines to the ON INIT clause of the dialog:

ACTIVATE DIALOG oDlg ;
ON INIT ( oGrp1:SetFont( oFontB ), oGrp1:nClrText := nRgb( 7,7,224 ), oGrp1:nClrPane := nRgb( 255,255,255 ) )

Better if you use Method SetColor():

ACTIVATE DIALOG oDlg ;
ON INIT ( oGrp1:SetFont( oFontB ), oGrp1:SetColor( nRgb( 7,7,224 ), nRgb( 255,255,255 ) ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Add Color to a Group Frame

Postby Antonio Linares » Tue Apr 07, 2015 6:14 pm

Dear Uwe,

Glad to know you are fine :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Add Color to a Group Frame

Postby Rick Lipkin » Tue Apr 07, 2015 7:12 pm

Antonio

I removed the oGrp1 lines and added your second INIT line to my above example .. and the frame stayed the same color .. only the text changed Blue on White :(

Again, this behavior seems to only happen with the XpManifest.

Rick Lipkin

Image
Last edited by Rick Lipkin on Tue Apr 07, 2015 7:14 pm, edited 1 time in total.
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Add Color to a Group Frame

Postby Antonio Linares » Tue Apr 07, 2015 7:13 pm

Rick,

Surely with the manifest we are not allowed to change its color
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Add Color to a Group Frame

Postby Rick Lipkin » Tue Apr 07, 2015 7:16 pm

Antonio

I agree .. you should be able to change the color .. Try my sample code and see if you get the same result .. with and without the XpManifest.

Thanks
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Add Color to a Group Frame

Postby Antonio Linares » Tue Apr 07, 2015 7:28 pm

Rick,

You may try to use a bitmap instead of a group

We can't change the painting on some standard controls when used with themes
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Add Color to a Group Frame

Postby Rick Lipkin » Tue Apr 07, 2015 7:30 pm

Antonio

You may try to use a bitmap instead of a group


Interesting Thought .. could I use a Pen (perhaps ) to outline a Box ? ( a bit awkward )

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Add Color to a Group Frame

Postby Antonio Linares » Tue Apr 07, 2015 8:25 pm

Rick,

Yes, the control TBitmap is a FWH own class so we have full control on it :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Add Color to a Group Frame

Postby Antonio Linares » Tue Apr 07, 2015 8:26 pm

Or TPanel too...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Add Color to a Group Frame

Postby Carlos Mora » Thu Apr 23, 2015 9:48 am

Hi Antonio,

I need help with sth i don't know what to do. I've been trying to do the group coloring using TPanel, and i thought i got it, but there is a big problem :( : cannot use the mouse over the area covered by the TPanel
Here is my code:

Code: Select all  Expand view

   Local nMargen:= ((ScreenWidth()-1280)/2)
   cLogin    := Space(20)
   cPassword := Space(20)

   DEFINE DIALOG oDlg STYLE nOr( WS_BORDER, WS_POPUP ) SIZE ScreenWidth(),ScreenHeight()-200 COLOR GRIS, 0xffffff

       @ 41, nMargen   SAY oSay PROMPT "Aplicacion" /* SIZE 100, 40 */  PIXEL FONT oFontB COLOR CLR_GREEN
       oSay:SetFont( oFontB )

       /* This is what's been replaced
       @ 60, nMargen GROUP  ;
              TO 215, nMargen + 200  ;
              OF oDlg  ;
             PIXEL TRANSPARENT ;
             COLOR CLR_GREEN
       */

       oPanel:= TPanel():New( 60, nMargen, 215, nMargen + 200, oDlg )
       oPanel:bPainted:= {|hDC, cPS| ;
            RoundBox( hDC, 0, 0, oPanel:nWidth-1, oPanel:nHeight-1, 8, 8, 0xaaaaaa, 1 ) ;
            }

      @ 80, nMargen + 40  SAY "Introduzca Usuario y Contraseña" PIXEL SIZE 100, 10

      @ 105, nMargen + 40  SAY "Usuario" SIZE 45, 10   PIXEL

      @ 117, nMargen + 40  GET cLogin    PIXEL SIZE 100, 14 ;
                    ACTION MsgInfo('Hola' ) ;
                    BITMAP "USER_16"

      @ 135, nMargen + 40  SAY "Password:" SIZE 45, 10 PIXEL

      @ 147, nMargen + 40  GET oGet var cPassword   PIXEL SIZE 100, 14 PASSWORD UPDATE ;
                    ACTION MsgInfo('Hola' ) ;
                    BITMAP "KEY_16"

      @ 175, nMargen + 40 BTNBMP  oBtnEntrar  SIZE 60, 20 PROMPT "Acceder" ACTION oDlg:End() /*When lok*/ update    LEFT   2007      RESOURCE "cog"

      @ 175, nMargen + 120 BTNBMP  oBtnSalir SIZE 60, 20 PROMPT "Salir"  action oDlg:End()    LEFT   2007         RESOURCE "cubes"


   ACTIVATE DIALOG oDlg CENTERED

 


The dialog is shown and everything looks fine, but it's impossible to click on any control. Also tried to put the TPanel after all controls, but in that case controls are hidden after the TPanel.

I'm sure it's a little thing, but i'm not able to get it.

May be I have to try with another control?

TIA
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
 
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 59 guests