FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Checkbox and Radio are not transparent!?
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Checkbox and Radio are not transparent!?
Posted: Sun Nov 02, 2008 12:32 AM

Ramesh,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Checkbox and Radio are not transparent!?
Posted: Sun Nov 02, 2008 03:39 AM

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

Posts: 1279
Joined: Mon Feb 06, 2006 04:28 PM
Checkbox and Radio are not transparent!?
Posted: Sun Nov 02, 2008 03:24 PM

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

"Los errores en programación, siempre están entre la silla, el teclado y la IA!!"
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
Checkbox and Radio are not transparent!?
Posted: Sun Nov 02, 2008 05:06 PM

Hello Anser Bhai,

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

Regards

  • Ramesh babu P
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
Checkbox and Radio are not transparent!?
Posted: Sun Nov 02, 2008 05:12 PM

Mr.Murugosa,

Please check your inbox.

  • Ramesh babu P
Posts: 1279
Joined: Mon Feb 06, 2006 04:28 PM
Checkbox and Radio are not transparent!?
Posted: Sun Nov 02, 2008 05:53 PM
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

"Los errores en programación, siempre están entre la silla, el teclado y la IA!!"
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Checkbox and Radio are not transparent!?
Posted: Sun Nov 02, 2008 07:18 PM

Dear Ramesh,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
Checkbox and Radio are not transparent!?
Posted: Mon Nov 03, 2008 02:12 AM
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
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Checkbox and Radio are not transparent!?
Posted: Mon Nov 03, 2008 04:52 AM

Thankyou Ramesh Bhai,

Regards

Anser

Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Checkbox and Radio are not transparent!?
Posted: Mon Nov 03, 2008 09:17 AM

Dear Ramesh,

could you send me your solution, too.

Thanks

kind regards

Stefan
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Checkbox and Radio are not transparent!?
Posted: Mon Nov 03, 2008 09:20 AM

Ramesh,

I just found the download link :oops:

Thanks

kind regards

Stefan
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Checkbox and Radio are not transparent!?
Posted: Mon Nov 03, 2008 09:35 AM

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
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Checkbox and Radio are not transparent!?
Posted: Mon Nov 03, 2008 10:18 AM

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 & MSVC 2022 & FWH 23.06
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Checkbox and Radio are not transparent!?
Posted: Mon Nov 03, 2008 11:43 AM
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.


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
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Checkbox and Radio are not transparent!?
Posted: Mon Nov 03, 2008 12:23 PM
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:
...
oBrushX := TBrushX():New ( ... )

DEFINE DIALOG ... BRUSH oBrushX


and the class:
// ============================================================================
// 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