Page 1 of 5

Checkbox and Radio are not transparent!?

Posted: Wed Oct 29, 2008 4:49 pm
by byte-one
On Dialogs with clausula TRANSPARENT and gradient-background the text from this controls are not transparent! Any solution?

Posted: Wed Oct 29, 2008 7:11 pm
by Antonio Linares
Günther,

Please review fwh\samples\TestTrn1.prg

Image

Posted: Wed Oct 29, 2008 10:00 pm
by byte-one
Antonio, I am using not a bitmap as background!
I use as background:

Code: Select all

...ON PAINT gradientfill(oDlg:hDC,0,0,oDlg:nHeight(),oDlg:nWidth(),{{1,CLR_WHITE,CLR_RED}})

Radio and Checkbox on Gradient

Posted: Wed Oct 29, 2008 10:45 pm
by ukoenig
Hello Günther,

My test with Dialog-gradient-background : not transparent.

Image

Regards
Uwe :lol:

Posted: Wed Oct 29, 2008 10:47 pm
by byte-one
Uwe, thats not transparent!?
And also the SAYS with clausula UPDATE are not transparent, when the text are updated!

Transparent

Posted: Wed Oct 29, 2008 10:58 pm
by ukoenig
Hello Günther,

All tests in Dialog and Folder :

Dialog and Folder with Gradient :
Folder is OK.

Image

Regards
Uwe :lol:

Posted: Thu Oct 30, 2008 12:33 am
by Antonio Linares
Günther,

>
I am using not a bitmap as background!
I use as background: ... gradientfill()
>

Then the transparent clause does not work

We have previously commented this issue on these forums. It is a Windows limitation:

http://forums.fivetechsoft.com/viewtopic.php?t=12117

Transparent in Dialog

Posted: Thu Oct 30, 2008 12:42 pm
by ukoenig
Hello,

I did some tests with Dialog and Transparent :
The 2. Dialog captured the gradient from Dialog 1.
Checkbox and Radio are transparent.

Image

Regards
Uwe :lol:

Posted: Thu Oct 30, 2008 12:53 pm
by byte-one
Uwe, please show me the source!

Posted: Thu Oct 30, 2008 1:00 pm
by Antonio Linares
Uwe,

I guess you are using a NULL brush, so there is no background brush and the one from the main dialog is seen

Posted: Thu Oct 30, 2008 1:55 pm
by byte-one
Antonio, is it possible to create a bmp from the gradientfill() function? The gradient colors for the background are from user and i will paint the dialog with this colors.

Transparent

Posted: Thu Oct 30, 2008 2:18 pm
by ukoenig
Antonio,
Another test. The Test-Dialog-gradient is complete different to the others.
The Dialog uses the normal Gradient-function as background.

sample 1
Image

sample 2
Image

Image - test
Image

Code: Select all


// ---------- PREVIEW  -------------------------------------

FUNCTION NEW_SOURCE(oWnd1)
LOCAL oDlg5, oBtn50, oBtn51, oBtn52, oBtn53, oTITLE30

DEFINE DIALOG oDlg5 RESOURCE "Test" OF oWnd TITLE  "Windows- / Dialog-Test and Source" FONT oProgFont

REDEFINE BUTTONBMP oBtn50  ID 50 OF oDlg5 ;
ACTION ( TEST_TRANS ( oDlg5 ) ) ;
BITMAP "Notes" PROMPT "    Dialog-Test" TEXTRIGHT
oBtn50:cToolTip =  { "Show" + CRLF + ;
                                  "BMP-Transparent","BMP", 1, CLR_BLACK, 14089979 } 


REDEFINE BUTTONBMP oBtn51  ID 40 OF oDlg5 ;
ACTION ( BITMAP_DAT ( oDlg5 ) ) ;
BITMAP "Notes" PROMPT "     BMP-View" TEXTRIGHT
oBtn51:cToolTip =  { "Show" + CRLF + ;
                                  "Background-BMP","BMP", 1, CLR_BLACK, 14089979 } 


REDEFINE BUTTONBMP oBtn52  ID 30 OF oDlg5 ;
ACTION ( SOURCE_DAT ( oDlg5 ) ) ;
BITMAP "Notes" PROMPT "     Source" TEXTRIGHT
oBtn52:cToolTip =  { "Show" + CRLF + ;
                                  "Background-Source","Source", 1, CLR_BLACK, 14089979 } 


REDEFINE BUTTONBMP oBtn53  ID 20 OF oDlg5 ;
ACTION ( oDlg5:End() ) ;
BITMAP "Quit" PROMPT " Exit" TEXTRIGHT
oBtn53:cToolTip =  { "Close" + CRLF + ;
                                  "the Dialog","Background-Test", 1, CLR_BLACK, 14089979 } 

ACTIVATE DIALOG oDlg5 CENTERED ;
ON INIT NEW_COLOR3a(oDlg5) ;
ON PAINT(  IIF( CLR_POS2 = 1, gradpaint2( hDC, oDlg5 ), NIL ), ;
                    IIF( BR_POS3 = 17, SHOW_PIC2( oDlg5 ), NIL ) )

oWnd1:End()

RETURN(  NIL )

//-------  BMP to Copy Gradient if needed ----------------------------//

FUNCTION BITMAP_DAT(oDlg5)
LOCAL oDlg6

DEFINE DIALOG oDlg6 RESOURCE "Bitmap" OF oDlg5 TITLE  "BMP-Gradient" FONT oProgFont

ACTIVATE DIALOG oDlg6 CENTERED ;
ON PAINT gradpaint2( hDC, oDlg6 ) ;

RETURN( NIL )

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

Function TEST_TRANS(oDlg5)
Local oDlg6, oBrush, oCbx, oRad, nVal := 1, lVal := .T.

DEFINE BRUSH oBrush FILE "Logo1.bmp"

DEFINE DIALOG oDlg6 RESOURCE "TestBMP" OF oDlg5 BRUSH oBrush TRANSPARENT ;
TITLE  "Transparent-Dialog-Test ( Gradient or Brush )" FONT oProgFont

REDEFINE RADIO oRad VAR nVal ID 10 OF oDlg6
   
REDEFINE CHECKBOX oCbx VAR lVal ID 20 OF oDlg6

// selection
// -----------
// CLR_POS2 = 1  Gradient
// CLR_POS2 = 17  Brush

ACTIVATE DIALOG oDlg6 CENTERED ;
ON PAINT(  IIF( CLR_POS2 = 1, gradpaint2( hDC, oDlg6 ), NIL ), ;
                    IIF( BR_POS3 = 17, SHOW_PIC2( oDlg6 ), NIL ) )

RETURN NIL 

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

static func gradpaint2( hDC, oDlg )

// Color-Vars
// ------------
local aGrad1 := { { nMOVE2, BR_COLOR3, BR_COLOR4 }, ;
                            { nMOVE2, BR_COLOR4, BR_COLOR3 } }

// Style Hor. or Vert.
// ---------------------
IF BR_STYLE2 = 1
	GradientFill( hDC,  0, 0, oDlg:nHeight, oDlg:nWidth, aGrad1, .T. )
ELSE
	GradientFill( hDC,  0, 0, oDlg:nHeight, oDlg:nWidth, aGrad1, .F. )
ENDIF

RETURN NIL

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

FUNCTION  SHOW_PIC2( oDlg5 )
LOCAL oImage2
LOCAL aRect := GETCLIENTRECT( oDlg5:hWnd )

cNEWLOGO := ALLTRIM(cLOGO2)

IF BR_TYP2 = "B"  // Brush-select
   IF ! Empty( cNEWLOGO ) .and. File( "&cNEWLOGO" )
      DEFINE BRUSH oImage2 FILE "&cNEWLOGO"
      SET BRUSH OF oDlg5 TO oImage2
   ELSE
      MsgAlert("No file selected !","Attention" )
   ENDIF
ENDIF
IF BR_TYP2 = "I" // Image-select
   IF ! Empty( cNEWLOGO ) .and. File( "&cNEWLOGO" )
      @ 0, 0 IMAGE oImage2 SIZE aRect[4], aRect[3] OF oDlg5  ADJUST
      oImage2:LoadBmp( "&cNEWLOGO" )
   ELSE
      MsgAlert("No file selected !","Attention" )
   ENDIF
ENDIF

RETURN( NIL )

Regards
Uwe :lol:

Posted: Thu Oct 30, 2008 7:30 pm
by Antonio Linares
Uwe,

Please run your tests in XP and see what you get

Or, are you using XP with a different theme ?

Posted: Thu Oct 30, 2008 7:33 pm
by Antonio Linares
Günther,

You can use oDlg:SaveToBmp( cBmpFileName )

Transparent on Dialog

Posted: Thu Oct 30, 2008 7:45 pm
by ukoenig
Antonio,

the tests i'have done with VISTA.

I tested with XP and Windows2000

Result :

XP : Radio and SAY is transparent. Checkbox not.

Windows2000 : only SAY is transparent.

Is there a solution for XP, maybe to get the checkbox working as well ?

I still have a question about the text :
For the new release of the tool, to create the background for windows and
Dialog, i added some new functions.
There is a preview for RADIO, CHECKBOX and SAY added.
As well, there is a new small dialog, to create a gradient
and then to cut and save the gradient as Bitmap to use as background ( with adjust ).
I have to test, what happens, using a bitmap ( not the gradient-function ).
Is it possible, to change the textcolor of RADIO, CHECKBOX and SAY at runtime ?

Image

Regards
Uwe :lol: