#include "fivewin.ch"
#include "Image.ch"
FUNCTION main()
LOCAL oDlg, oIcon, oBrush, oGroup, oRadio, oCheckBox, oSay, oGet, oButton
LOCAL cTest := "Hello world! ", nValue := 2, lValue := .F., oImage
DEFINE ICON oIcon FILE "..\icons\fivewin.ico"
//DEFINE BRUSH oBrush
oBrush := TBrushX():New (100,160,CLR_WHITE,nRgb(152,194,152), .t.,.f.) // <------
// Take care that the dimension of the bitmap has the same size as the dialog
DEFINE DIALOG oDlg TITLE "I am a DialogBox" BRUSH oBrush ;
ICON oIcon TRANSPARENT
@ 4.25,.25 IMAGE oImage SIZE 20, 20 OF oDlg NOBORDER
oImage:LoadImage( "gradtest", )
@ 0.25,0.75 GROUP oGroup TO 4,21.80 PROMPT "Test Group" OF oDlg ;
COLOR CLR_BLUE TRANSPARENT
@ 0.75,2.00 SAY oSay PROMPT "Enter your Name:" OF oDlg SIZE 7,12 ;
COLOR CLR_BLUE
@ 0.90,7.50 GET cTest OF oDlg SIZE 40,12
@ 1.75,0.95 RADIO oRadio VAR nValue ;
ITEMS "&One", "&Two", "T&hree" _3D SIZE 50, 12 ;
OF oDlg ON CHANGE MsgBeep() COLOR CLR_RED
@ 3.35,10.00 CHECKBOX oCheckBox VAR lValue PROMPT "&ClickMe" SIZE 100, 12 ;
OF oDlg ;
ON CHANGE oCheckBox:SetText( "New Text" ) COLOR CLR_BLUE
@ 3.35,5.00 BUTTON "&Ok" SIZE 35, 12 ;
ACTION MsgInfo( "Any action here!" ) DEFAULT
@ 3.35,16.00 BUTTON "&Cancel" SIZE 35, 12 ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED ;
VALID MsgYesNo( "Do you want to end ?" )
RETURN nil
ACTIVATE DIALOG oDlg CENTERED ON INIT (oBrush:nHeight := oDlg:nHeight,oBrush:nWidth:=oDlg:nWidth) ;
VALID MsgYesNo( "Do you want to end ?" )
DEFINE BRUSH oBrush
//oBrush := TBrushX():New (100,160,CLR_WHITE,nRgb(152,194,152), .t.,.f.) // <------
// Take care that the dimension of the bitmap has the same size as the dialog
DEFINE DIALOG oDlg TITLE "I am a DialogBox" BRUSH oBrush
ACTIVATE DIALOG oDlg CENTERED ON INIT (oBrush := TBrushX():New (oDlg:nWidth,oDlg:nHeight,CLR_WHITE,nRgb(152,194,152), .t.,.f.),;
oDlg:SetColor (,,oBrush), oDlg:Refresh() )
#include "FiveWin.ch"
function Main()
local oDlg, oCbx1, lValue1 := .T., oCbx2, lValue2 := .T., oCbx3, lValue3 := .T.
local oRadMenu, nValue := 1
DEFINE DIALOG oDlg TITLE "Test"
@ 1, 2 CHECKBOX oCbx1 VAR lValue1 COLOR "W+/B"
oCbx1:lTransparent = .T.
@ 2, 2 CHECKBOX oCbx2 VAR lValue2 COLOR "W+/B"
oCbx2:lTransparent = .T.
@ 3, 2 CHECKBOX oCbx3 VAR lValue3 COLOR "W+/B"
oCbx3:lTransparent = .T.
@ 1.3, 9 RADIO oRadMenu VAR nValue ITEMS "One", "Two", "Three" SIZE 80, 13 COLOR "GR+/B"
AEval( oRadMenu:aItems, { | oRad | oRad:lTransparent := .T. } )
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT GradientBrush( oDlg, { { 0.4, nRGB( 75, 144, 223 ), nRGB( 41, 85, 145 ) },;
{ 0.6, nRGB( 24, 61, 118 ), nRGB( 50, 95, 158 ) } } )
return nil
function GradientBrush( oDlg, aColors )
local hDC, hBmp, hBmpOld
if Empty( oDlg:oBrush:hBitmap )
hDC = CreateCompatibleDC( oDlg:GetDC() )
hBmp = CreateCompatibleBitMap( oDlg:hDC, oDlg:nWidth, oDlg:nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aColors )
oDlg:oBrush:hBitmap = hBmp
oDlg:oBrush:hBrush = CreatePatternBrush( hBmp )
SelectObject( hDC, hBmpOld )
oDlg:ReleaseDC()
endif
return nil
#include "FiveWin.ch"
function Main()
local oWnd
DEFINE WINDOW oWnd
@ 1.6, 17 BUTTON "First" SIZE 70, 25 ACTION First()
@ 3.6, 17 BUTTON "Another" SIZE 70, 25 ACTION Another()
ACTIVATE WINDOW oWnd
return nil
function First()
local oDlg, oBrush
local oCbx1, lValue1 := .T., oCbx2, lValue2 := .T., oCbx3, lValue3 := .T.
local oRadMenu, nValue := 1
DEFINE BRUSH oBrush COLOR CLR_WHITE
DEFINE DIALOG oDlg TITLE "Test" BRUSH oBrush
@ 1, 2 CHECKBOX oCbx1 VAR lValue1 COLOR "W+/B"
oCbx1:lTransparent = .T.
@ 2, 2 CHECKBOX oCbx2 VAR lValue2 COLOR "W+/B"
oCbx2:lTransparent = .T.
@ 3, 2 CHECKBOX oCbx3 VAR lValue3 COLOR "W+/B"
oCbx3:lTransparent = .T.
@ 1.3, 9 RADIO oRadMenu VAR nValue ITEMS "One", "Two", "Three" SIZE 30, 13 COLOR "GR+/B"
AEval( oRadMenu:aItems, { | oRad | oRad:lTransparent := .T. } )
@ 1.6, 17 BUTTON "Another" ACTION Another()
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT GradientBrush( oDlg, { { 0.4, nRGB( 75, 144, 223 ), nRGB( 41, 85, 145 ) },;
{ 0.6, nRGB( 24, 61, 118 ), nRGB( 50, 95, 158 ) } } )
return nil
function Another()
local oDlg
DEFINE DIALOG oDlg
ACTIVATE DIALOG oDlg CENTERED
return nil
function GradientBrush( oDlg, aColors )
local hDC, hBmp, hBmpOld, oBrush
if Empty( oDlg:oBrush:hBitmap )
hDC = CreateCompatibleDC( oDlg:GetDC() )
hBmp = CreateCompatibleBitMap( oDlg:hDC, oDlg:nWidth, oDlg:nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aColors )
DeleteObject( oDlg:oBrush:hBrush )
oDlg:oBrush:hBitmap = hBmp
oDlg:oBrush:hBrush = CreatePatternBrush( hBmp )
SelectObject( hDC, hBmpOld )
oDlg:ReleaseDC()
endif
return nil
function GradientBrush( oDlg, aColors )
local hDC, hBmp, hBmpOld, oBrush
if Empty( oDlg:oBrush:hBitmap )
hDC = CreateCompatibleDC( oDlg:GetDC() )
hBmp = CreateCompatibleBitMap( oDlg:hDC, oDlg:nWidth, oDlg:nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aColors )
DeleteObject( oDlg:oBrush:hBrush )
oDlg:oBrush:hBitmap = hBmp
oDlg:oBrush:hBrush = CreatePatternBrush( hBmp )
SelectObject( hDC, hBmpOld )
DeleteDC( hDC )
oDlg:ReleaseDC()
endif
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 41 guests