FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Add Color to a Group Frame
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Add Color to a Group Frame
Posted: 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 (fw): Select all Collapse
 REDEFINE GROUP oGrp1 ID 200 of oGrps
             oGrp1:SetFont( oFontB )
             oGrp1:nClrText := nRgb( 7,7,224 ) // blue



Thanks
Rick Lipkin
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Add Color to a Group Frame
Posted: Tue Apr 07, 2015 09: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 )



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.
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Add Color to a Group Frame
Posted: Tue Apr 07, 2015 09:49 AM
Uwe,

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


Hope you have had a good recovery!

EMG
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Add Color to a Group Frame
Posted: Tue Apr 07, 2015 01: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 (fw): Select all Collapse
 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.
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Add Color to a Group Frame
Posted: Tue Apr 07, 2015 05: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 (fw): Select all Collapse
#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 (fw): Select all Collapse
<?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 (fw): Select all Collapse
// Add this to your resources RC file

#ifdef __FLAT__
   1 24 ".\WindowsXP.Manifest"
#endif
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Add Color to a Group Frame
Posted: Tue Apr 07, 2015 06: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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Add Color to a Group Frame
Posted: Tue Apr 07, 2015 06:14 PM

Dear Uwe,

Glad to know you are fine :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Add Color to a Group Frame
Posted: Tue Apr 07, 2015 07: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

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Add Color to a Group Frame
Posted: Tue Apr 07, 2015 07:13 PM

Rick,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Add Color to a Group Frame
Posted: Tue Apr 07, 2015 07: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

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Add Color to a Group Frame
Posted: Tue Apr 07, 2015 07: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
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Add Color to a Group Frame
Posted: Tue Apr 07, 2015 07: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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Add Color to a Group Frame
Posted: Tue Apr 07, 2015 08: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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Add Color to a Group Frame
Posted: Tue Apr 07, 2015 08:26 PM

Or TPanel too...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 989
Joined: Thu Nov 24, 2005 03:01 PM
Re: Add Color to a Group Frame
Posted: Thu Apr 23, 2015 09: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 (fw): Select all Collapse
   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"