FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour GRADIENT and SAY on FOLDER Problem
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
GRADIENT and SAY on FOLDER Problem
Posted: Thu Sep 12, 2013 12:31 PM
Hi,

I have problem with this
SAY objects on dialog are Ok
BUT SAY objects on FOLDER have some strange borders with different nuance colors

Plesse some sugestion

Best regards,

Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oDlg, oFont, oFld

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

   SET _3DLOOK ON

   DEFINE FONT oFont NAME "Arial" SIZE 0,-12 BOLD

   DEFINE DIALOG oDlg TITLE "Test Gradient and SAY on FOLDER" ;
      FROM 0,0 TO 420,350 PIXEL ;
      FONT oFont

   @  5, 5 FOLDER oFld PROMPT "Test1", "Test2", "Test3", "Test4" ;
           OF oDlg SIZE 160,110 PIXEL

   @   5,  5 SAY "Test1"                               OF oFld:aDialogs[1] PIXEL FONT oFont
   @  20,  5 SAY "Test2 Test2"                         OF oFld:aDialogs[1] PIXEL FONT oFont
   @  35,  5 SAY "Test3 Test3 Test3"                   OF oFld:aDialogs[1] PIXEL FONT oFont
   @  50,  5 SAY "Test4 Test4 Test4 Test4"             OF oFld:aDialogs[1] PIXEL FONT oFont
   @  65,  5 SAY "Test5 Test5 Test5 Test5 Test5"       OF oFld:aDialogs[1] PIXEL FONT oFont
   @  80,  5 SAY "Test6 Test6 Test6 Test6 Test6 Test6" OF oFld:aDialogs[1] PIXEL FONT oFont

   @ 125,  5 SAY "Test1"                               OF oDlg PIXEL FONT oFont
   @ 140,  5 SAY "Test2 Test2"                         OF oDlg PIXEL FONT oFont
   @ 155,  5 SAY "Test3 Test3 Test3"                   OF oDlg PIXEL FONT oFont
   @ 170,  5 SAY "Test4 Test4 Test4 Test4"             OF oDlg PIXEL FONT oFont
   @ 185,  5 SAY "Test5 Test5 Test5 Test5 Test5"       OF oDlg PIXEL FONT oFont
   @ 200,  5 SAY "Test6 Test6 Test6 Test6 Test6 Test6" OF oDlg PIXEL FONT oFont

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT  oFont

return nil
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: GRADIENT and SAY on FOLDER Problem
Posted: Thu Sep 12, 2013 01:46 PM
Witout using < SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } ) >
and creating a FOLDER-gradient, it works fine :



with defined Dlg- and folder-gradient using < GradientFill( ... >



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: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: GRADIENT and SAY on FOLDER Problem
Posted: Thu Sep 12, 2013 02:26 PM

ukoenig

Thanks for reply

Now i am not sure what to do at all ...
probably to remove SetDlgGradient()
and manualy add gradient to all dialogs folders ... etc ... :(

Regards,

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: GRADIENT and SAY on FOLDER Problem
Posted: Thu Sep 12, 2013 02:41 PM
The sample :

Code (fw): Select all Collapse
#include "FiveWin.ch"

FUNCTION Main()

local oDlg, oFont, oFld, oFSay[12], aColors

// SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } )
aColors := { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } 

SET _3DLOOK ON

DEFINE FONT oFont NAME "Arial" SIZE 0,-12 BOLD

DEFINE DIALOG oDlg TITLE "Test Gradient and SAY on FOLDER" ;
FROM 0,0 TO 420,350 PIXEL ;
FONT oFont // TRANSPARENT 

@  5, 5 FOLDER oFld PROMPT "Test1", "Test2", "Test3", "Test4" ;
           OF oDlg SIZE 160,110 PIXEL

@   5,  5  SAY oFSay[1]  PROMPT "Test1"                               OF oFld:aDialogs[1] PIXEL FONT oFont
@  20,  5 SAY oFSay[2]  PROMPT  "Test2 Test2"                         OF oFld:aDialogs[1] PIXEL FONT oFont
@  35,  5 SAY oFSay[3]  PROMPT  "Test3 Test3 Test3"                   OF oFld:aDialogs[1] PIXEL FONT oFont
@  50,  5 SAY oFSay[4]  PROMPT  "Test4 Test4 Test4 Test4"             OF oFld:aDialogs[1] PIXEL FONT oFont
@  65,  5 SAY oFSay[5]  PROMPT  "Test5 Test5 Test5 Test5 Test5"       OF oFld:aDialogs[1] PIXEL FONT oFont
@  80,  5 SAY oFSay[6]  PROMPT  "Test6 Test6 Test6 Test6 Test6 Test6" OF oFld:aDialogs[1] PIXEL FONT oFont

SETFOLDGRAD( oFld )

@ 125,  5 SAY oFSay[7]  PROMPT "Test1"                               OF oDlg PIXEL FONT oFont
@ 140,  5 SAY oFSay[8]  PROMPT "Test2 Test2"                         OF oDlg PIXEL FONT oFont
@ 155,  5 SAY oFSay[9]  PROMPT "Test3 Test3 Test3"                   OF oDlg PIXEL FONT oFont
@ 170,  5 SAY oFSay[10]  PROMPT "Test4 Test4 Test4 Test4"             OF oDlg PIXEL FONT oFont
@ 185,  5 SAY oFSay[11]  PROMPT "Test5 Test5 Test5 Test5 Test5"       OF oDlg PIXEL FONT oFont
@ 200,  5 SAY oFSay[12]  PROMPT "Test6 Test6 Test6 Test6 Test6 Test6" OF oDlg PIXEL FONT oFont

I := 1
FOR I := 1 TO 12
    oFSay[I]:lTransparent := .T.
NEXT

ACTIVATE DIALOG oDlg CENTERED ;
ON INIT GradBrush( oDlg, aColors, .T. ) 

RELEASE FONT  oFont

return nil
 
// --------

FUNCTION SetFoldGrad( oFolder )

LOCAL aGradiate := ARRAY(10), aBrushes := ARRAY(LEN(oFolder:aDialogs))

aGradiate[1]  := { {1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) }, {1, RGB( 237, 242, 248 ),  RGB( 199, 216, 237 ) } }
aGradiate[2]  := { {1, CLR_WHITE, nRGB( 222, 214, 225 ) }, {1, nRGB( 222, 214, 225 ),  CLR_WHITE } }
aGradiate[3]  := { {1, CLR_WHITE, nRGB( 219, 240, 200 ) }, {1, nRGB( 219, 240, 200 ),  CLR_WHITE } }
aGradiate[4]  := { {1, CLR_WHITE, nRGB( 248, 226, 250 ) }, {1, nRGB( 248, 226, 250 ),  CLR_WHITE } }
aGradiate[5]  := { {1, CLR_WHITE, nRGB( 233, 235, 218 ) }, {1, nRGB( 233, 235, 218 ),  CLR_WHITE } }
aGradiate[6]  := { {1, CLR_WHITE, nRGB( 224, 252, 254 ) }, {1, nRGB( 224, 252, 254 ),  CLR_WHITE } }
aGradiate[7]  := { {1, CLR_WHITE, nRGB( 235, 224, 199 ) }, {1, nRGB( 235, 224, 199 ),  CLR_WHITE } }
aGradiate[8]  := { {1, CLR_WHITE, nRGB( 237, 255, 221 ) }, {1, nRGB( 237, 255, 221 ),  CLR_WHITE } }
aGradiate[9]  := { {1, CLR_WHITE, nRGB( 255, 249, 215 ) }, {1, nRGB( 255, 249, 215 ),  CLR_WHITE } }
aGradiate[10] := { {1, CLR_WHITE, nRGB( 247, 234, 219 ) }, {1, nRGB( 247, 234, 219 ),  CLR_WHITE } }

FOR n = 1 TO LEN(aBrushes)
    DEFINE BRUSH aBrushes[n] GRADIENT aGradiate[n]
    oFolder:aDialogs[n]:SetBrush(aBrushes[n])
NEXT

RETURN nil

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

FUNCTION GradBrush( oDlg, aColors, lPos )
local hDC, hBmp, hBmpOld, oBrush

if Empty( oDlg:oBrush:hBitmap )
      hDC = CreateCompatibleDC( oDlg:GetDC() )
      hBmp = CreateCompatibleBitMap( oDlg:hDC, oDlg:nWidth, oDlg:nHeight )
      hBmpOld = SelectObject( hDC, hBmp )
      GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aColors, lPos )
      DeleteObject( oDlg:oBrush:hBrush )
      oDlg:oBrush:hBitmap = hBmp
      oDlg:oBrush:hBrush = CreatePatternBrush( hBmp ) 
      SelectObject( hDC, hBmpOld )
      oDlg:ReleaseDC()
endif   

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: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: GRADIENT and SAY on FOLDER Problem
Posted: Thu Sep 12, 2013 02:55 PM

Use SENSITIVE SAY (SSAY.PRG) it solves.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: GRADIENT and SAY on FOLDER Problem
Posted: Fri Sep 13, 2013 08:26 AM
Uwe
The sample :

Thanks ... your sample work nice
But the problem is with bigger applications with many dialogs, folders ... etc
It is risky to implement this way

karinha
Use SENSITIVE SAY (SSAY.PRG) it solves.

In which version is added SSAY class ... i dont have it

SetDlgGradient() ????
"To Use Or Not To Use" Question is now

I like to know ANTONIOS opinion ?

Best regards,
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: GRADIENT and SAY on FOLDER Problem
Posted: Fri Sep 13, 2013 08:54 AM
NO extra class needed, just move the folder to a EXTRA-function and call it ON INIT

Code (fw): Select all Collapse
#include "FiveWin.ch"

static oWnd, oDlg1, cPath, cPath1, oBar, oBrush, oCursorHand
static oGrp1, oSay1, oRadio1, oCheck1, oGrp2, oGrp3, oGrp4, oGrp5, oTitle1, oCheck2, lCheck2 := .T.

FUNCTION Main()

local oDlg, oFont, oFld, oDSay[6], aColors

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

SET _3DLOOK ON

DEFINE FONT oFont NAME "Arial" SIZE 0,-12 BOLD

DEFINE DIALOG oDlg TITLE "Test Gradient and SAY on FOLDER" ;
FROM 0,0 TO 420,350 PIXEL ;
FONT oFont

// MOVE FOLDER to ON INIT !!!
// ---------------------------------------------
//@  5, 5 FOLDER oFld PROMPT "Test1", "Test2", "Test3", "Test4" ;
//           OF oDlg SIZE 160,110 PIXEL

//@   5,  5  SAY oFSay[1]  PROMPT "Test1"                               OF oFld:aDialogs[1] PIXEL FONT oFont
//@  20,  5 SAY oFSay[2]  PROMPT  "Test2 Test2"                         OF oFld:aDialogs[1] PIXEL FONT oFont
//@  35,  5 SAY oFSay[3]  PROMPT  "Test3 Test3 Test3"                   OF oFld:aDialogs[1] PIXEL FONT oFont
//@  50,  5 SAY oFSay[4]  PROMPT  "Test4 Test4 Test4 Test4"             OF oFld:aDialogs[1] PIXEL FONT oFont
//@  65,  5 SAY oFSay[5]  PROMPT  "Test5 Test5 Test5 Test5 Test5"       OF oFld:aDialogs[1] PIXEL FONT oFont
//@  80,  5 SAY oFSay[6]  PROMPT  "Test6 Test6 Test6 Test6 Test6 Test6" OF oFld:aDialogs[1] PIXEL FONT oFont

@ 125,  5 SAY oDSay[1]  PROMPT "Test1"                               OF oDlg PIXEL FONT oFont
@ 140,  5 SAY oDSay[2]  PROMPT "Test2 Test2"                         OF oDlg PIXEL FONT oFont
@ 155,  5 SAY oDSay[3]  PROMPT "Test3 Test3 Test3"                   OF oDlg PIXEL FONT oFont
@ 170,  5 SAY oDSay[4]  PROMPT "Test4 Test4 Test4 Test4"             OF oDlg PIXEL FONT oFont
@ 185,  5 SAY oDSay[5]  PROMPT "Test5 Test5 Test5 Test5 Test5"       OF oDlg PIXEL FONT oFont
@ 200,  5 SAY oDSay[6]  PROMPT "Test6 Test6 Test6 Test6 Test6 Test6" OF oDlg PIXEL FONT oFont

I := 1
FOR I := 1 TO 6
    oDSay[I]:lTransparent := .T.
NEXT

ACTIVATE DIALOG oDlg CENTERED ;
ON INIT SHOW_FLD( oDlg, oFont )

RELEASE FONT  oFont

RETURN NIL
 
// -------------------------------

FUNCTION SHOW_FLD( oDlg, oFont )
LOCAL oFld, oFSay[6]

@  10, 10 FOLDER oFld PROMPT "Test1", "Test2", "Test3", "Test4" ;
           OF oDlg SIZE 300, 210 PIXEL 
oFld:lTransparent := .T.
@    10,  5  SAY oFSay[1]  PROMPT "Test1"                               OF oFld:aDialogs[1] PIXEL FONT oFont
@    40,  5 SAY oFSay[2]  PROMPT  "Test2 Test2"                         OF oFld:aDialogs[1] PIXEL FONT oFont
@    70,  5 SAY oFSay[3]  PROMPT  "Test3 Test3 Test3"                   OF oFld:aDialogs[1] PIXEL FONT oFont
@  100,  5 SAY oFSay[4]  PROMPT  "Test4 Test4 Test4 Test4"             OF oFld:aDialogs[1] PIXEL FONT oFont
@  130,  5 SAY oFSay[5]  PROMPT  "Test5 Test5 Test5 Test5 Test5"       OF oFld:aDialogs[1] PIXEL FONT oFont
@  160,  5 SAY oFSay[6]  PROMPT  "Test6 Test6 Test6 Test6 Test6 Test6" OF oFld:aDialogs[1] PIXEL FONT oFont

I := 1
FOR I := 1 TO 6
    oFSay[I]:lTransparent := .T.
NEXT

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: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: GRADIENT and SAY on FOLDER Problem
Posted: Fri Sep 13, 2013 08:55 AM
NO extra class needed, just move the folder to a EXTRA-function and call it ON INIT

The result :



Code (fw): Select all Collapse
#include "FiveWin.ch"

FUNCTION Main()

local oDlg, oFont, oDSay[6]

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

SET _3DLOOK ON

DEFINE FONT oFont NAME "Arial" SIZE 0,-12 BOLD

DEFINE DIALOG oDlg TITLE "Test Gradient and SAY on FOLDER" ;
FROM 0,0 TO 420,350 PIXEL ;
FONT oFont

// MOVE FOLDER to function < SHOW_FLD( oDlg, oFont ) > and call ON INIT !!!
// -----------------------------------------------------------------------------------------
//@  5, 5 FOLDER oFld PROMPT "Test1", "Test2", "Test3", "Test4" ;
//           OF oDlg SIZE 160,110 PIXEL

//@   5,  5  SAY oFSay[1]  PROMPT "Test1"                               OF oFld:aDialogs[1] PIXEL FONT oFont
//@  20,  5 SAY oFSay[2]  PROMPT  "Test2 Test2"                         OF oFld:aDialogs[1] PIXEL FONT oFont
//@  35,  5 SAY oFSay[3]  PROMPT  "Test3 Test3 Test3"                   OF oFld:aDialogs[1] PIXEL FONT oFont
//@  50,  5 SAY oFSay[4]  PROMPT  "Test4 Test4 Test4 Test4"             OF oFld:aDialogs[1] PIXEL FONT oFont
//@  65,  5 SAY oFSay[5]  PROMPT  "Test5 Test5 Test5 Test5 Test5"       OF oFld:aDialogs[1] PIXEL FONT oFont
//@  80,  5 SAY oFSay[6]  PROMPT  "Test6 Test6 Test6 Test6 Test6 Test6" OF oFld:aDialogs[1] PIXEL FONT oFont

@ 125,  5 SAY oDSay[1]  PROMPT "Test1"                               OF oDlg PIXEL FONT oFont
@ 140,  5 SAY oDSay[2]  PROMPT "Test2 Test2"                         OF oDlg PIXEL FONT oFont
@ 155,  5 SAY oDSay[3]  PROMPT "Test3 Test3 Test3"                   OF oDlg PIXEL FONT oFont
@ 170,  5 SAY oDSay[4]  PROMPT "Test4 Test4 Test4 Test4"             OF oDlg PIXEL FONT oFont
@ 185,  5 SAY oDSay[5]  PROMPT "Test5 Test5 Test5 Test5 Test5"       OF oDlg PIXEL FONT oFont
@ 200,  5 SAY oDSay[6]  PROMPT "Test6 Test6 Test6 Test6 Test6 Test6" OF oDlg PIXEL FONT oFont

I := 1
FOR I := 1 TO 6
    oDSay[I]:lTransparent := .T.
NEXT

ACTIVATE DIALOG oDlg CENTERED ;
ON INIT SHOW_FLD( oDlg, oFont )

RELEASE FONT  oFont

RETURN NIL
 
// -------------------------------

FUNCTION SHOW_FLD( oDlg, oFont )
LOCAL oFld, oFSay[6]

@  10, 10 FOLDER oFld PROMPT "Test1", "Test2", "Test3", "Test4" ;
           OF oDlg SIZE 300, 210 PIXEL 
oFld:lTransparent := .T.

@    10,  5  SAY oFSay[1]  PROMPT "Test1"                               OF oFld:aDialogs[1] PIXEL FONT oFont
@    40,  5 SAY oFSay[2]  PROMPT  "Test2 Test2"                         OF oFld:aDialogs[1] PIXEL FONT oFont
@    70,  5 SAY oFSay[3]  PROMPT  "Test3 Test3 Test3"                   OF oFld:aDialogs[1] PIXEL FONT oFont
@  100,  5 SAY oFSay[4]  PROMPT  "Test4 Test4 Test4 Test4"             OF oFld:aDialogs[1] PIXEL FONT oFont
@  130,  5 SAY oFSay[5]  PROMPT  "Test5 Test5 Test5 Test5 Test5"       OF oFld:aDialogs[1] PIXEL FONT oFont
@  160,  5 SAY oFSay[6]  PROMPT  "Test6 Test6 Test6 Test6 Test6 Test6" OF oFld:aDialogs[1] PIXEL FONT oFont

I := 1
FOR I := 1 TO 6
    oFSay[I]:lTransparent := .T.
NEXT

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: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: GRADIENT and SAY on FOLDER Problem
Posted: Fri Sep 13, 2013 12:00 PM

Uwe

Your sample work perfect ...
But i have more than 100 dialogs with folders on them
It is risky to change logic to all of it , but i will probably try that with copy of the program

Thanks verry mush again for your reply

Best regards,

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: GRADIENT and SAY on FOLDER Problem
Posted: Fri Sep 13, 2013 02:41 PM

As I have mentioned before, most, if not all, of these problems would go away if all controls were transparent by default. I can't think of any instance where we would want a control that wasn't transparent. This would have to be a basic change in FW. I think a simple change to the TControl class would do it.

If you want to test this theory, change this line in the TControl class definition:

DATA lTransparent INIT .F.

Change to:

DATA lTransparent INIT .T.

If you test it, please report your results.

Does anyone see a downside to making this happen? Other comments?

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: GRADIENT and SAY on FOLDER Problem
Posted: Sat Sep 14, 2013 04:06 PM

James
I have try ...
The same result ...not good
Probably SAY objects on FOLDER and FOLDEREX must be defined in EXTRA-function and call it ON INIT
It is evidently in Uwe samples
(with Say objects on dialog is ok)
Ihope ANTONIO will say something more about this.

Regards,

Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM
Re: GRADIENT and SAY on FOLDER Problem
Posted: Wed Jan 29, 2014 01:47 PM

Avista:

Did anyone ever find a solution to this problem? Static text is not displayed properly on a folder when using SetDlgGradient.

I'm using FWH 13.2 and xHarbour.

Thanks,
Randal Ferguson

Continue the discussion