Checkbox and Radio are not transparent!?

User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Ramesh,

Could you please resend it to me as a ZIP file renamed as ZOP ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Post by anserkk »

Dear Ramesh,

I have not rcvd u'r mail in my Gmail id as said. If u attached a zip file then gmail blocks the mail. Request u to either rename the zip extention or u may send it to my hotmail id anserkk@hotmail.com

Regards

Anser
User avatar
jose_murugosa
Posts: 943
Joined: Mon Feb 06, 2006 4:28 pm
Location: Uruguay
Contact:

Post by jose_murugosa »

Dear Ramesh,

Thanks for your contribution, could you please send me the code to jmurugosa (at) gmail.com, I really need of your solution.

Thanks in advance.
Saludos/Regards,
José Murugosa
FWH + Harbour + Bcc7. Una seda!
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Post by RAMESHBABU »

Hello Anser Bhai,

Could be please provide an alternate e-mail. I got the mail bounced back.

Regards

- Ramesh babu P
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Post by RAMESHBABU »

Mr.Murugosa,

Please check your inbox.

- Ramesh babu P
User avatar
jose_murugosa
Posts: 943
Joined: Mon Feb 06, 2006 4:28 pm
Location: Uruguay
Contact:

Post by jose_murugosa »

RAMESHBABU wrote:Mr.Murugosa,

Please check your inbox.

- Ramesh babu P
Thanks Ramesh, but I didn´t recieve the mail, If you are sending a zip file or rar file, please rename it as .zzz or .rrr so I can recieve it.

Thanks again for your kind help
Saludos/Regards,
José Murugosa
FWH + Harbour + Bcc7. Una seda!
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Dear Ramesh,

I have not received it, probably due to the same reasons as Jose explains.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Post by RAMESHBABU »

Mr.Antonio, Jose and Anser

I am extremely sorry for the inconvenience. Here is the link to download.

http://www.aksharasoft.com/gradtest.zip

- Ramesh Babu P
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Post by anserkk »

Thankyou Ramesh Bhai,

Regards

Anser
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Post by StefanHaupt »

Dear Ramesh,

could you send me your solution, too.

Thanks
kind regards
Stefan
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Post by StefanHaupt »

Ramesh,

I just found the download link :oops:

Thanks
kind regards
Stefan
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Ramesh,

Ok, so basically what you do is to create a bitmap from the painted gradient and then use the bitmap for a brush.

We could implement a method to automatically do it, without having to use any external tool :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Post by Horizon »

Hi Ramesh,

Thank you for sending gradtest.zip.

If I am not wrong, The function in prg uses the external EXE files. BMPtoJPG and NCONVERT.

Can you also provide these files if it is possible?. I try find them from net. but i think different versions can not works like your function wanted.
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Post by byte-one »

Hello All!
I found a solution for this problem. Not very elegant, but usable. This could functioning on all OS.
Antonio, this should inserted in dialog-class! The real size of a redefined dialog is only to see, when activated.

Code: Select all

DEFINE DIALOG oDlg........
.
dlg_brush(oDlg,CLR_BLUE,CLR_HBLUE)
.
ACTIVATE oDlg

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

function dlg_brush(oDlg,nColorTop,nColorBottom)

	local oDlg_temp,oBr,nWidth,nHeight,cRes := "",cFile:= "back.bmp"
	DEFAULT nColorTop := nRGB( 219, 230, 244 ) , nColorBottom := nRGB( 207, 221, 239 )

if !empty(oDlg)

	cRes := oDlg:cResName

        if !empty(cRes)
		cFile:= cRes+"_back.bmp"
		DEFINE DIALOG oDlg_temp RESOURCE cRes
		ACTIVATE DIALOG oDlg_temp ;
		ON INIT ;
		(oDlg_temp:hide(),;
		nHeight := oDlg_temp:nHeight(),;
		nWidth := 1,; //oDlg_temp:nWidth(),;
		oDlg_temp:end())

        else

		nHeight := oDlg:nBottom
                                nWidth := 1

        endif

		DEFINE DIALOG oDlg_temp FROM 0,0 TO nHeight,nWidth PIXEL STYLE nOr(WS_POPUP,4)
		ACTIVATE DIALOG oDlg_temp ;
		ON PAINT ;
		(GradientFill( oDlg_temp:hDC, 0, 0, oDlg_temp:nHeight(), oDlg_temp:nWidth(), {{ 1,nColorTop,nColorBottom}} ),;
		oDlg_temp:SaveToBmp(cFile),;
		oDlg_temp:end())

		if file( cFile )
			DEFINE BRUSH oBr FILE cFile
			oDlg:oBrush := oBr
			ferase( cFile )
		endif

endif

return NIL

//-------------------------------------------------------------
Regards,
Günther
---------------------------------
office@byte-one.com
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Post by StefanHaupt »

Hi all,

some time ago I enhanced the TBrush class, you can use like the original one. It creates brushes with a gradient on the fly.

I hope, it´s helpful.

Usage:

Code: Select all

...
oBrushX := TBrushX():New ( ... )

DEFINE DIALOG ... BRUSH oBrushX
and the class:

Code: Select all

// ============================================================================
// CLASS TBrushX Version  May 2008
// Authors: Stefan Haupt
//          Silvio Falconi
// you can freely use this class, please don´t remove these lines
//============================================================================
// Erweiterte TBrush-Class für Brushes mit Gradient
// (Enhanced brush class to create brushes with a gradient)
// Parameter
//       nColorFrom  : Startfarbe bzw. Array {Startfarbe, Endfarbe} für oberen Gradient
//                     startcolor or array with start- endcolor for upper gradient
//       nColorTo    : Endfarbe bzw. Array {Startfarbe, Endfarbe} für unteren Gradient
//                     endcolor or array with start- endcolor for lower gradient
//       lVGrad      : .t. für vertikal, .f. für horizontal
//                     .t. for vertical, .f. for horizontal
//       l2007       : Office-Look mit 2 Gradienten 
//                     Look2007 with 2 gradients
//-----------------------------------------------------------------------------
#include "Fivewin.ch"

CLASS TBrushX FROM TBrush

      METHOD New( nColor, nColor2, lVGrad ) //CONSTRUCTOR
ENDCLASS


  METHOD New( nWidth, nHeight, nColorFrom, nColorTo, lVGrad, l2007 ) CLASS TBrushX

    ::lSystem   = .f.

    ::hBitmap := CreateExtBrush (nWidth, nHeight, nColorFrom, nColorTo, lVGrad, l2007 )
    ::hBrush = If( ::hBitmap != 0, CreatePatternBrush( ::hBitmap ), )
    ::nCount := 1
    AAdd( ::aBrushes, Self )

return Self


//-----------------------------------------------------------------//
FUNCTION CreateExtBrush ( nWidth, nHeight, nColorFrom, nColorTo, lVGrad, l2007 )

LOCAL hDC     := CreateDC( "DISPLAY",0,0,0 )
LOCAL hDCMem  := CreateCompatibleDC( hDC )
LOCAL hBmp    := CreateCompatibleBitmap( hDC, nWidth, nHeight )
LOCAL hOldBmp := SelectObject( hDCMem, hBmp )
LOCAL aRC0    := {0,0,nHeight/2,nWidth}
LOCAL aRC     := {nHeight/2,0,nHeight,nWidth}
LOCAL nClrUpperFrom, nClrLowerFrom, nClrUpperTo, nClrLowerTo


DEFAULT lVGrad   := .t.            // vertikaler Gradient (vertical gradient)
DEFAULT nColorTo := nColorFrom     //
DEFAULT l2007    := .t.            // Office-Look mit 2 Gradienten (Look2007 with 2 gradients)

  IF Valtype (nColorFrom) == "A"
    nClrUpperFrom := nColorFrom[1]
    nClrUpperTo   := nColorFrom[2]
  ELSE
    nClrUpperFrom := nColorFrom
    nClrUpperTo   := nColorFrom
  ENDIF

  IF Valtype (nColorTo) == "A"
    nClrLowerFrom := nColorTo[1]
    nClrLowerTo   := nColorTo[2]
  ELSE
    nClrLowerFrom := nColorTo
    nClrLowerTo   := nColorTo
  ENDIF

  IF l2007
    lVGrad := .t.
    Gradient( hDCMem, {aRC0[1],aRC0[2],aRC0[3]+2,aRC0[4]}, nClrUpperFrom, nClrUpperTo, lVGrad )
    Gradient( hDCMem, {aRC[1],aRC[2],aRC[3]+2,aRC[4]}, nClrLowerFrom, nClrLowerTo, lVGrad )
  ELSE
     Gradient( hDCMem, {0,0,nHeight,nWidth}, nClrUpperFrom, nClrLowerTo, lVGrad )
  ENDIF

SelectObject( hDCMem, hOldBmp )
DeleteDC( hDCMem )
DeleteDC( hDC )

RETURN (hBmp)


//-------------------------------------------------------------------//
DLL32 FUNCTION CREATECOMPATIBLEBITMAP( hDC AS LONG,;
                                              nWidth AS LONG,;
                                              nHeight AS LONG) AS LONG;
      PASCAL FROM "CreateCompatibleBitmap" LIB "gdi32.dll"
kind regards
Stefan
Post Reply