FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour BackGround Painting (SOLVED)
Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM

BackGround Painting (SOLVED)

Posted: Sun Feb 24, 2013 03:04 AM
Hi all,
I have the following problem when using tFolderX:

Check Boxes & Group Boxes:


I use SetDlgGradient()...

Anyone knows of a way to fix this...???

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Re: BackGround Painting

Posted: Sun Feb 24, 2013 11:10 AM
Hello Bayron,

using a folder is different. You can download a working sample.
Folder-Brush, Color, Gradient and image.
Please remember : changing the radio- and Checkbox-textcolor from black to defined,
only works without XPMANIFEST

Download ( different backgrounds ) :
http://www.pflegeplus.com/fw_downloads/testfld1.zip

Different backgrounds for each folderpage :



Using :
SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } )
will ignore the different background-selections and the folder will be transparent
( shows gradient from dialog )
To test it, disable the brushdefine ON INIT and enable SetDlgGradient !!!!

Download ( using XPMANIFEST : black textcolor for Radios and checkboxes ) :
http://www.pflegeplus.com/fw_downloads/testfld2.zip

SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } )

REDEFINE FOLDEREX oFld ID 110 PROMPT "Page 1", "Page 2", "Page 3", "Page 4";
BITMAPS "new", "new", "new", "new";
DIALOGS "sub1", "sub2", "sub1", "sub2" ;
ROUND 5

// Disable the red lines from sample !
// F_BACKGRD( oFld, 550, 300 ) // no! needed

oFld:lTransparent := .T.
oFld:nFolderHeight := 30
oFld:nSeparator := 10
oFld:bClrText := {| o, n | 128 }
oFld:oFont := oFont

// each Folderpage is defined in a extra function
( to keep the main-dialog small in size )


PAGE1( oFld)
PAGE2( oFld)
PAGE3( oFld)
PAGE4( oFld)

ACTIVATE DIALOG oDlg CENTERED ;
ON INIT DLG_BACK( oDlg, 2, .T., 16038911, 16777215, 0.5, "Marble.bmp", "Backgrd-jpg" ) ;
VALID MsgYesNo( "Do you want to end?" )

without XPMANIFEST ( RED textcolor selected )



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: 883
Joined: Thu Dec 24, 2009 12:46 AM

Re: BackGround Painting

Posted: Mon Feb 25, 2013 06:44 AM

Hi Uwe,

Your sample works perfectly...
But for some reason It does not work for me in my main program...
I have done everything from:
changing the manifest file
changing my code
Saving my .res file to .rc and check that everything is the same

Tomorrow I will reconstruct everything from scratch using your sample as base...
But I wonder if you can explain the reason why this happens when using the XPMANIFEST...????

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Re: BackGround Painting

Posted: Mon Feb 25, 2013 09:51 AM

Hello Bayron,

It is the reason, I show complete working samples, not just a few lines,
to get a overview, how it works together.
There are 2 !!! samples.
One sample uses my functions WITH XPManifest but NOT using => SetDlgGradient( {...
The second works as well without my functions.
XPManifest only belongs to the Radio- and checkbox textcolors not to work in sample 2.
You can seperate the text from radios and checkboxes, if You need a different textcolor.

Best 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.
Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM

Re: BackGround Painting

Posted: Tue Feb 26, 2013 04:35 AM

Thanks Uwe,
I really appreciate the effort you made to provide me with this sample...
I'm sure I will solve the problem with this samples...
But right now I am doing a complete rewrite of my application, and it will take me some time...

Thank you again...

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Re: BackGround Painting

Posted: Tue Feb 26, 2013 11:03 AM
Remember SetDlgGradient is GLOBAL !!!

Define a extra dialog-style using global SetDlgGradient



FUNCTION MAIN()
local oDlg1, oBtn1, oBtn2

SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } )

DEFINE DIALOG oDlg1 FROM 50, 50 TO 300, 400 ;
TITLE "Dialog using SetDlgGradient" PIXEL TRANSPARENT

@ 35, 40 BUTTON oBtn1 PROMPT "&Next" SIZE 40, 20 OF oDlg1 PIXEL ;
ACTION DIALOG2()

@ 35, 100 BUTTON oBtn2 PROMPT "&Quit" SIZE 40, 20 OF oDlg1 PIXEL ;
ACTION oDlg1:End()

ACTIVATE DIALOG oDlg1 ;
ON INIT oDlg1:Move(50, 50)

RETURN NIL

// -----------------------------

FUNCTION DIALOG2()
local oDlg2, oBtn1, oBtn2

SetDlgGradient() // Disabled

DEFINE DIALOG oDlg2 FROM 50, 50 TO 300, 400 ;
TITLE "A EXTRA Dialog-background" PIXEL TRANSPARENT

@ 35, 40 BUTTON oBtn1 PROMPT "&Next" SIZE 40, 20 OF oDlg2 PIXEL ;
ACTION ( SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } ), ;
DIALOG3() )

@ 35, 100 BUTTON oBtn2 PROMPT "&Quit" SIZE 40, 20 OF oDlg2 PIXEL ;
ACTION oDlg2:End()

ACTIVATE DIALOG oDlg2 ;
ON INIT ( DLG_BACK( oDlg2, .T., 16038911, 16777215, 0.5 ), ;
oDlg2:Move( 150,150 ) )

// Enable
SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } )

RETURN NIL

// -----------------------------

FUNCTION DIALOG3()
local oDlg3, oBtn1

DEFINE DIALOG oDlg3 FROM 150, 150 TO 400, 600 ;
TITLE "Back to => SetDlgGradient" PIXEL TRANSPARENT

@ 35, 60 BUTTON oBtn1 PROMPT "&Quit" SIZE 40, 20 OF oDlg3 PIXEL ;
ACTION oDlg3:End()

ACTIVATE DIALOG oDlg3 ;
ON INIT oDlg3:Move(250, 250)

RETURN NIL

// --------

FUNCTION DLG_BACK( oWnd, lDirect, nColor1, nColor2, nMove )
local oBrush

aGrad := { { nMove, nColor1, nColor2 }, { nMove, nColor2, nColor1 } }
hDC = CreateCompatibleDC( oWnd:GetDC() )
hBmp = CreateCompatibleBitMap( oWnd:hDC, oWnd:nWidth, oWnd:nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, oWnd:nHeight, oWnd:nWidth, aGrad, lDirect ) // .T. = Vertical
DeleteObject( oWnd:hBrush )
oBrush := TBrush():New( ,,,, hBmp )
oBrush:Cargo := aGrad
SelectObject( hDC, hBmpOld )
ReleaseDC(hDC)

oWnd:SetBrush( oBrush )
oBrush:End()

RETURN( NIL )

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: 883
Joined: Thu Dec 24, 2009 12:46 AM

Re: BackGround Painting

Posted: Tue Feb 26, 2013 11:26 AM

Uwe thanks for all your explanations...
Right now I am thinking on going back to individual painting of dialogs, because of the problems I have with SetDlgGradient(), specifically with folders...

I'll see what I come up with....

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: BackGround Painting

Posted: Tue Feb 26, 2013 12:32 PM

this problem is old...
We have allready modified this error (Tgroup class) two year ago but perhaps Linares not included the modifications on future package

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: BackGround Painting

Posted: Tue Feb 26, 2013 01:30 PM
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM

Re: BackGround Painting

Posted: Tue Feb 26, 2013 02:00 PM

Otto, BRAVO!

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: BackGround Painting

Posted: Tue Feb 26, 2013 02:31 PM

Otto,
Ich kann nicht lachen, ich habe zahnschmerzen !!!!!!!!
so viele Fabeln sechs Fall eine Frau? Nur Frauen erzählen viele Geschichten

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM

Re: BackGround Painting

Posted: Tue Feb 26, 2013 07:35 PM

Your teeth? It 's all your head that does not "run ok".

Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: BackGround Painting

Posted: Tue Feb 26, 2013 09:24 PM

Dear Otto,
Why are you always trying to write nonsense?

You are always trying to offend me constantly ...

The problem with this class (tgroup) has been corrected by Emg long time ago

but as so often mistakes are not saved and we have to recompile the object classes along

with those changed as was the case for so long with the class rpreview

or with the class msgbar or msgitem.

But you continue to offend me not knowing what the real problem

But what you are trying to get by in this way ?

Dear Massimo
with you do not speak anymore after all the crap you wrote to me in private when you told me to be older than me and you told me that " I was a sperm" when you was born
this is a technical forum, or you think it's just a place to offend me constantly ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM

Re: BackGround Painting

Posted: Wed Feb 27, 2013 07:43 AM
Bayron,

have a look at these changes in TGroup.prg.

http://forums.fivetechsupport.com/viewtopic.php?f=3&t=22940&hilit=tgroup

For me everything is working fine, even the transparent groupheader.
kind regards

Stefan
Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM

Re: BackGround Painting

Posted: Wed Feb 27, 2013 01:07 PM
Thanks Stefan,

This way the problem with the painting of the groups was fixed for me...

I also solved the problem with the checkboxes removing this function from my project:

Code (fw): Select all Collapse
//FUNCTION IsAppThemed()
//RETURN .f.

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Continue the discussion