9 possible combinations between dialog- and graph :
// Dialog ( values for function-call )
// --------------------------------------
nDStyle := 2 // 1 = color / 2 = Gradient / 3 = Brush / 4 = Image
nDColorF :=
16765559
nDColorB := LightColor( 175, nDColorF )
nDTxtColor := 255
nDGradpos := 0
LDDirect := .T.
cDBrush :=
"Marble.bmp"
cDImage := "Picture3.jpg"
// Graph adjusted to dialog background
// -------------------------------------------
oGraph:nType := 1
oGraph:nMaxVal := 2000
oGraph:nClrBack :=
16765559 // Background color
oGraph:l3D := .T.
oGraph:nDegrade := 2 // 0 = Color / 1 = Grad Horiz. / 2 = Grad vert.
Select one of the background-styles
//oGraph:cBitmap := "Color" // Dialog nDStyle = 1
//oGraph:cBitmap := "Gradient" // Dialog nDStyle = 2
//oGraph:cBitmap :=
"Marble.bmp" // Dialog nDStyle = 3
Color
// Dialog
// ----------
nDStyle :=
1
// Graph
// ----------
oGraph:nDegrade :=
0 // 0 = Color / 1 = Grad Horiz. / 2 = Grad vert.
oGraph:cBitmap :=
"Color"
Brush
// Dialog
// ----------
nDStyle :=
3
// Graph
// ----------
oGraph:nDegrade :=
0 // 0 = Color / 1 = Grad Horiz. / 2 = Grad vert.
oGraph:cBitmap :=
"Marble.bmp"
Gradient
Still have to check the graph-gradient-height !!!
// Dialog
// ----------
nDStyle :=
2
// Graph
// ----------
oGraph:nDegrade :=
0 // 0 = Color / 1 = Grad Horiz. / 2 = Grad vert.
oGraph:cBitmap :=
"Gradient"
Style change
The first graph-background-tests :
// Back area
//
IF ! Empty( ::cBitmap ) .OR. ( Empty( ::oPrn ) .AND. ::nType != GRAPH_TYPE_PIE )
IF UPPER ( ::cBitmap ) = "COLOR"
//MsgAlert( "Color" )
hBru := CreateSolidBrush( ::nClrBack )
hOld := SelectObject( ::hDC, hBru )
FillRect( ::hDC, { 0, 0, ::nHeight, ::nWidth }, hBru )
SelectObject( ::hDC, hOld )
DeleteObject( hBru )
ELSEIF UPPER ( ::cBitmap ) = "GRADIENT"
//MsgAlert( "Gradient" )
hBru := GradientBrush( ::hDC, 0, 0, ::nHeight, ::nWidth, ;
{ { 0, LightColor( 175, ::nClrBack ), ::nClrBack } }, .T. )
hOld := SelectObject( ::hDC, hBru )
FillRect( ::hDC,{ 0, 0, ::nHeight, ::nWidth }, hBru )
SelectObject( ::hDC, hOld )
DeleteObject( hBru )
ELSEIF File( ::cBitmap )
DEFINE BITMAP oNewbrush FILENAME ::cBitmap
nHeight := oNewbrush:nHeight
nWidth := oNewbrush:nWidth
IF ::nWidth > 0
DO WHILE nRow < ::nHeight
nCol = 0
DO WHILE nCol < ::nWidth
PalBmpDraw( ::hDC, nRow, nCol, oNewbrush:hBitmap )
nCol += nHeight
ENDDO
nRow += nWidth
ENDDO
ENDIF
oNewbrush:End()
ENDIF
ENDIF