BackGround Painting (SOLVED)

BackGround Painting (SOLVED)

Postby Bayron » Sun Feb 24, 2013 3:04 am

Hi all,
I have the following problem when using tFolderX:

Check Boxes & Group Boxes:
Image

I use SetDlgGradient()...

Anyone knows of a way to fix this...???
Last edited by Bayron on Wed Feb 27, 2013 2:47 pm, edited 1 time in total.
=====>

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

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: BackGround Painting

Postby ukoenig » 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 :

Image

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 )

Image

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

Re: BackGround Painting

Postby Bayron » Mon Feb 25, 2013 6: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
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: BackGround Painting

Postby ukoenig » Mon Feb 25, 2013 9: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: BackGround Painting

Postby Bayron » Tue Feb 26, 2013 4: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
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: BackGround Painting

Postby ukoenig » Tue Feb 26, 2013 11:03 am

Remember SetDlgGradient is GLOBAL !!!

Define a extra dialog-style using global SetDlgGradient

Image

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:oBrush:hBrush )
oBrush := TBrush():New( ,,,, hBmp )
oBrush:Cargo := aGrad
SelectObject( hDC, hBmpOld )
ReleaseDC(hDC)

oWnd:SetBrush( oBrush )
oBrush:End()

RETURN( NIL )

Best Regards
Uwe :lol:
Last edited by ukoenig on Tue Feb 26, 2013 11:34 am, edited 1 time in total.
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: BackGround Painting

Postby Bayron » 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
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: BackGround Painting

Postby Silvio.Falconi » 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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: BackGround Painting

Postby Otto » Tue Feb 26, 2013 1:30 pm

********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: BackGround Painting

Postby byte-one » Tue Feb 26, 2013 2:00 pm

Otto, BRAVO!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: BackGround Painting

Postby Silvio.Falconi » Tue Feb 26, 2013 2: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: BackGround Painting

Postby Massimo Linossi » Tue Feb 26, 2013 7:35 pm

Your teeth? It 's all your head that does not "run ok".
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: BackGround Painting

Postby Silvio.Falconi » Tue Feb 26, 2013 9: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: BackGround Painting

Postby StefanHaupt » Wed Feb 27, 2013 7: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
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: BackGround Painting

Postby Bayron » Wed Feb 27, 2013 1: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: Select all  Expand view
//FUNCTION IsAppThemed()
//RETURN .f.
 
=====>

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

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 47 guests