Friends.
I need to make a solid color brush that has a fixed size in the footer no matter the size of the window, is this possible?
Thanks
#include "fivewin.ch"
function Main()
local oWnd
local nBrushHt := 80
local nBrushClr := CLR_HGRAY
DEFINE WINDOW oWnd TITLE "FOOTER BRUSH"
oWnd:bPainted := <|hDC|
local aRect := GetClientRect( oWnd:hWnd )
local hBrush := CreateSolidBrush( nBrushClr )
aRect[ 1 ] := aRect[ 3 ] - nBrushHt
FillRect( hDC, aRect, hBrush )
DeleteObject( hBrush )
return nil
>
ACTIVATE WINDOW oWnd
return nil
ctoas wrote:Resolved with tPanel
Thank you for your help
local oDlg, aRect, oFooterBrush, nBrushHt := 80
DEFINE BRUSH oFooterBrush COLOR CLR_HGREEN
DEFINE DIALOG oDlg SIZE 500,400 PIXEL
ACTIVATE DIALOG oDlg CENTERED ON PAINT ;
( aRect := GetClientRect( oDlg:hWnd ), ;
aRect[ 1 ] := aRect[ 3 ] - nBrushHt, ;
FillRect( hDC, aRect, oFooterBrush:hBrush ) ;
)
RELEASE BRUSH oFooterBrush
What I want to do would be custom warning, error and etc messages
like this in the image,
in this case I tested the know example but where the brush
does not accept anything over transparent.
...
...
@ 250, 150 TITLE oTitle3 size 460, 60 of oWnd TRANSPARENT NOBORDER
@ 8, 100 TITLETEXT OF oTitle3 TEXT FWVERSION FONT oFont1 brush oBrush4 3D SHADOW TOPRIGHT
@ 2, 30 TITLEIMG OF oTitle3 BITMAP "..\bitmaps\32X32\keys.bmp" SIZE 50, 50 REFLEX TRANSPARENT ;
ACTION MsgInfo( "Keys" )
oWnd:bPainted := < |hDC|
DRAWBORDER( oWnd, oTitle3 )
RETURN NIL
>
...
...
// -----------
FUNCTION DRAWBORDER( oWnd, oTitle3 )
LOCAL oGraphics := Graphics():New( oWnd:hDC )
LOCAL nRed := nRGBRed( 255 ) // red
LOCAL nGreen := nRGBGreen( 255 )
LOCAL nBlue := nRGBBlue( 255 )
LOCAL oPen := Pen():New( 255, nRed, nGreen, nBlue, 5, .T.) // nTransparency, nRed, nGreen, nBlue
oGraphics:DrawRoundRect( oPen, , oTitle3:nLeft, oTitle3:nTop, oTitle3:nWidth, oTitle3:nHeight, 30 )
oGraphics:Destroy()
oPen:Destroy()
RETURN NIL
#include "fivewin.ch"
function Main()
local oDlg, oFont, oSay, oBtn
local cMsg := "Message"
local aColor := { 0x91ffff, 0x4bb7fe }
DEFINE FONT oFont NAME "VERDANA" SIZE 0,-30
DEFINE DIALOG oDlg SIZE 500,200 PIXEL TRUEPIXEL COLOR CLR_WHITE, 1 STYLE WS_POPUP
oDlg:nSeeThroClr := 1
@ 00,120 SAY oSay PROMPT cMsg SIZE 350,100 PIXEL OF oDlg CENTER VCENTER ;
FONT oFont COLOR CLR_HRED, aColor[ 1 ]
@ 140,350 BTNBMP oBtn BITMAP "c:\fwh\bitmaps\32x32\yes.bmp" SIZE 40,40 PIXEL ;
OF oDlg FLAT NOBORDER ACTION oDlg:End()
oBtn:bClrGrad := { || { { 1, aColor[ 2 ], aColor[ 2 ] } } }
ACTIVATE DIALOG oDlg CENTERED ON PAINT DlgPaint( hDC, oDlg, aColor )
RELEASE FONT oFont
return nil
static function DlgPaint( hDC, oDlg, aColor )
local hWnd := oDlg:hWnd
local aRect := GetClientRect( hWnd )
local nTop := aRect[ 1 ]
local nBottom := aRect[ 3 ]
local nHt := 80
local hRgn := CreateRoundRectRgn( aRect, 80, 80 )
local hBrush
SelectClipRgn( hDC, hRgn )
hBrush := CreateSolidBrush( aColor[ 1 ] )
aRect[ 3 ] := nBottom - nHt
FillRect( hDC, aRect, hBrush )
DeleteObject( hBrush )
hBrush := CreateSolidBrush( aColor[ 2 ] )
aRect[ 1 ] := aRect[ 3 ]
aRect[ 3 ] := nBottom
FillRect( hDC, aRect, hBrush )
DeleteObject( hBrush )
SelectClipRgn( hDC )
DeleteObject( hRgn )
FW_DrawImage( hDC, "c:\fwh\bitmaps\alphabmp\ichat.bmp", { 90,50,154,114 } )
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 98 guests