GRADIENT and SAY on FOLDER Problem

GRADIENT and SAY on FOLDER Problem

Postby avista » 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: Select all  Expand view

#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
 
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: GRADIENT and SAY on FOLDER Problem

Postby ukoenig » Thu Sep 12, 2013 1:46 pm

Witout using < SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } ) >
and creating a FOLDER-gradient, it works fine :

Image

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

Image

Best Regards
Uwe :?:
Last edited by ukoenig on Fri Sep 13, 2013 9:05 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: GRADIENT and SAY on FOLDER Problem

Postby avista » Thu Sep 12, 2013 2: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,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: GRADIENT and SAY on FOLDER Problem

Postby ukoenig » Thu Sep 12, 2013 2:41 pm

The sample :

Code: Select all  Expand view

#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 :lol:
Last edited by ukoenig on Thu Sep 12, 2013 4:18 pm, 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: GRADIENT and SAY on FOLDER Problem

Postby karinha » Thu Sep 12, 2013 2:55 pm

Use SENSITIVE SAY (SSAY.PRG) it solves.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: GRADIENT and SAY on FOLDER Problem

Postby avista » Fri Sep 13, 2013 8: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,
Last edited by avista on Fri Sep 13, 2013 10:07 am, edited 1 time in total.
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: GRADIENT and SAY on FOLDER Problem

Postby ukoenig » Fri Sep 13, 2013 8:54 am

NO extra class needed, just move the folder to a EXTRA-function and call it ON INIT

Code: Select all  Expand view

#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 :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: GRADIENT and SAY on FOLDER Problem

Postby ukoenig » Fri Sep 13, 2013 8:55 am

NO extra class needed, just move the folder to a EXTRA-function and call it ON INIT

The result :

Image

Code: Select all  Expand view

#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 :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: GRADIENT and SAY on FOLDER Problem

Postby avista » 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,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: GRADIENT and SAY on FOLDER Problem

Postby James Bott » Fri Sep 13, 2013 2: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: GRADIENT and SAY on FOLDER Problem

Postby avista » Sat Sep 14, 2013 4: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,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: GRADIENT and SAY on FOLDER Problem

Postby Randal » Wed Jan 29, 2014 1: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
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 63 guests