Hello Lailton...
you need change the TGET CLASS, i'll explain you how to do
LOCATE:
#define EM_SETCUEBANNER 0x1501
ADD AFTER
LOCATE:
ADD AFTER
LOCATE (METHOD NEW):
ADD AFTER
::nTxtStyle = nOR( ETO_CLIPPED, ETO_OPAQUE )
LOCATE (METHOD REFEDINE):
ADD AFTER
::nTxtStyle = nOR( ETO_CLIPPED, ETO_OPAQUE )
LOCATE METHOD PAINT:
REPLACE WITH:
METHOD Paint() CLASS TGet
local aInfo := ::DispBegin()
local hOldFont
local nClrBtnTxt, nClrBtnPane
local nOldMode
nClrBtnTxt := ::nClrText
nClrBtnPane := ::nClrPane
if ::oBrush != nil
FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
else
CallWindowProc( ::nOldProc, ::hWnd, WM_ERASEBKGND, ::hDC, 0 )
endif
if IsWindowEnabled( ::hWnd )
CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )
else
if ::lDisColors
SetTextColor( ::hDC, GetSysColor( COLOR_GRAYTEXT ) )
SetBkColor( ::hDC, GetSysColor( COLOR_WINDOW ) )
nClrBtnPane := GetSysColor( COLOR_WINDOW )
else
if ValType( ::nClrTextDis ) == "B"
SetTextColor( ::hDC, Eval( ::nClrTextDis ) )
elseif ValType( ::nClrTextDis ) == "N"
if ::nClrTextDis >= 0
SetTextColor( ::hDC, ::nClrTextDis )
nClrBtnTxt := ::nClrTextDis
else
SetTextColor( ::hDC, ::nClrText )
endif
endif
if ValType( ::nClrPaneDis ) == "B"
SetBkColor( ::hDC, Eval( ::nClrPaneDis ) )
elseif ValType( ::nClrPaneDis ) == "N"
if ::nClrPaneDis >= 0
SetBkColor( ::hDC, ::nClrPaneDis )
nClrBtnPane := ::nClrPaneDis
else
SetBkColor( ::hDC, ::nClrPane )
endif
endif
endif
if ::oFont != nil
hOldFont = SelectObject( ::hDC, ::oFont:hFont )
endif
nOldMode = SetBkMode( ::hDC, TRANSPARENT )
do case
case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_CENTER )
SetTextAlign( ::hDC, TA_CENTER )
if ::lSpinner
ExtTextOut( ::hDC, 1, ( ::nWidth() - 3 - GetSysMetrics( SM_CYHSCROLL ) ) / 2,;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ), ::nTxtStyle )
else
ExtTextOut( ::hDC, 1, ( ::nWidth() - 3 ) / 2,;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ), ::nTxtStyle )
endif
case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_RIGHT )
SetTextAlign( ::hDC, TA_RIGHT )
if ::lSpinner
ExtTextOut( ::hDC, 1, ::nWidth() - 7 - GetSysMetrics( SM_CYHSCROLL ),;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ), ::nTxtStyle )
else
if ValType( ::bAction ) == "B"
ExtTextOut( ::hDC, 1, ::nWidth() - 7 - ::nHeight,;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ), ::nTxtStyle )
else
ExtTextOut( ::hDC, 1, ::nWidth() - 7 ,;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ), ::nTxtStyle )
endif
endif
otherwise
SetTextAlign( ::hDC, TA_LEFT )
ExtTextOut( ::hDC, 1, 2,;
{ 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ), ::nTxtStyle )
endcase
if ::oFont != nil
SelectObject( ::hDC, hOldFont )
endif
SetBkMode( ::hDC, nOldMode )
endif
if ValType( ::bPainted ) == "B"
Eval( ::bPainted, ::hDC, ::cPS, Self )
endif
// button
if ::oBtn != nil .and. ::lBtnTransparent
::oBtn:SetColor( nClrBtnTxt, nClrBtnPane )
endif
::DispEnd( aInfo )
return 1
PRG SAMPLE
http://www.sitasoft.com/fivewin/test/getfill.zip
#include "fivewin.ch"
function main()
local odlg, oget, cVar:="This a TGET Gradient Test",ogetb, cVarb:=space(50)
define dialog odlg SIZE 600, 600
@ 5, 10 get oGet var cVar of odlg pixel size 120, 10 color CLR_WHITE when( ! empty( cVarb ) )
@ 20, 10 get cVarb of odlg pixel size 120, 10 color CLR_WHITE
@ 35, 10 get cVar of odlg pixel size 120, 10 color CLR_WHITE
@ 50, 10 get cVarb of odlg pixel size 120, 10 noborder color CLR_WHITE
@ 65, 10 get cVar of odlg pixel size 120, 10 noborder color CLR_WHITE
@ 80, 10 get cVarb of odlg pixel size 120, 10 noborder color CLR_WHITE
@ 95, 10 get cVar of odlg pixel size 120, 10 noborder color CLR_WHITE
@ 110, 10 get cVarb of odlg pixel size 120, 10 noborder color CLR_WHITE
@ 125,10 say "this a test" of odlg pixel
oGet:lDisColors = .f.
oGet:nClrTextDis = CLR_BLACK
activate dialog odlg centered on init( GradGet( Self ) )
return nil
function GradGet( _oDlg )
local oControl
local aColors := { { 0.4, nRGB( 75, 144, 223 ), nRGB( 41, 85, 145 ) },;
{ 0.6, nRGB( 24, 61, 118 ), nRGB( 50, 95, 158 ) } }
local hBmp, n
local oBrush
for n = 1 to Len(_oDlg:aControls)
oControl:= _oDlg:aControls[ n ]
if oControl:ClassName() == "TGET"
oControl:lTransparent = .T.
oControl:nTxtStyle = 4
hBmp = GradientBmp( oControl, oControl:nWidth, oControl:nHeight, aColors )
oBrush = TBrush():New( )
oBrush:hBrush = CreatePatternBrush( hBmp )
oControl:SetBrush( oBrush )
DeleteObject( hBmp )
endif
next
return Nil
function GradientBmp( oWnd, nWidth, nHeight, aColors )
local hDC, hBmp, hBmpOld
local aRect := GetClientRect( oWnd:hWnd )
default nHeight := aRect[ 3 ] , nWidth := aRect[ 4 ]
hDC = CreateCompatibleDC( oWnd:GetDC() )
hBmp = CreateCompatibleBitMap( oWnd:hDC, nWidth, nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, nHeight, nWidth, aColors )
SelectObject( hDC, hBmpOld )
DeleteDC( hDC )
DeleteObject( hBmpOld )
oWnd:ReleaseDC()
return hBmp
