i finished the job on another Tool
for testing <Wnd> and <Dlg>-backgrounds in combination.
Windows : BMP, Brushes, Gradients, Clear-colors
Dialog : BMP, Brushes, Gradients, Clear-colors
Everything works perfect. I can show brushes and pictures.
There is just one little problem.
After solving this, i can put the tool in the forum for download.
A screenshot of the Final-Version :
When i define a new background for the main-window,
the new background is shown behind the dialog.
If i minimize and then maximize the dialog, the color
fills the main window and is shown correctly.
I think, there is something missing
I call this function from the 1. dialog-browser to change the window background :
- Code: Select all Expand view RUN
// Browser-colorselection
oLbx3:bLClicked := { | nRow, nCol | BR_START := oLbx3:nRowSel, ;
BR_COLOR1 := NEW_COLOR1(oWnd,oCOLOR1), ;
oBR_COLOR1:Refresh(), oCOLOR1:Refresh() }
//------ Color defines color 1 - 7 are for gradients ------------------------
FUNCTION NEW_COLOR1(oWnd,oCOLOR1)
BR_COLOR1 := 0
IF BR_POS = 1 // Schwarz
BR_COLOR1 := 0
oCOLOR1:SetColor( CLR_WHITE, 0 ) // control-bitmaps for color.
ENDIF
IF BR_POS = 2 // Weiß
BR_COLOR1 := 16777215
oCOLOR1:SetColor( CLR_WHITE, 16777215 )
ENDIF
IF BR_POS = 3 // Blau
BR_COLOR1 := 8388608
oCOLOR1:SetColor( CLR_WHITE, 8388608 )
ENDIF
IF BR_POS = 4 // grün
BR_COLOR1 := 32768
oCOLOR1:SetColor( CLR_WHITE, 32768 )
ENDIF
IF BR_POS = 5 // Rot
BR_COLOR1 := 128
oCOLOR1:SetColor( CLR_WHITE, 128 )
ENDIF
IF BR_POS = 6 // Gelb
BR_COLOR1 := 65535
oCOLOR1:SetColor( CLR_WHITE, 65535 )
ENDIF
IF BR_POS = 7 // Magenta
BR_COLOR1 := 8388736
oCOLOR1:SetColor( CLR_WHITE, 8388736 )
ENDIF
// brushes
IF BR_POS = 9
DEFINE BRUSH oBrush1 STYLE HORIZONTAL
ENDIF
IF BR_POS = 10
DEFINE BRUSH oBrush1 STYLE VERTICAL
ENDIF
IF BR_POS = 11
DEFINE BRUSH oBrush1 STYLE FDIAGONAL
ENDIF
IF BR_POS = 12
DEFINE BRUSH oBrush1 STYLE BDIAGONAL
ENDIF
IF BR_POS = 13
DEFINE BRUSH oBrush1 STYLE CROSS
ENDIF
IF BR_POS = 14
DEFINE BRUSH oBrush1 STYLE DIAGCROSS
ENDIF
IF BR_POS = 15
DEFINE BRUSH oBrush1 STYLE BORLAND
ENDIF
IF BR_POS = 16
DEFINE BRUSH oBrush1 STYLE TILED
ENDIF
// draw the gradient
// it works, but is shown behind the dialog
IF BR_POS < 8 // Colors for gradient
gradpaint1( hDC, oWnd )
oWnd:Refresh()
ENDIF
RETURN ( BR_COLOR1 )
// ------ Gradient-painting for the main-window ----
static func gradpaint1( hDC, oWnd )
local aGrad := { { nMOVE1, BR_COLOR1, BR_COLOR2 }, ;
{ nMOVE1, BR_COLOR2, BR_COLOR1 } }
IF BR_STYLE1 = 1
GradientFill( hDC, 0, 0, oWnd:nHeight, oWnd:nWidth, aGrad, .F. )
ELSE
GradientFill( hDC, 0, 0, oWnd:nHeight, oWnd:nWidth, aGrad, .T. )
ENDIF
RETURN NIL