Code: Select all
Dim Shared fAllowChartLine As BOOLEAN
'--------------------------------------------------------------------------------
Function FORMMAIN_COMMANDCHARTLINE_BN_CLICKED ( _
ControlIndex As Integer, _ ' index in Control Array
hWndForm As hWnd, _ ' handle of Form
hWndControl As hWnd, _ ' handle of Control
idButtonControl As Integer _ ' identifier of button
) As Integer
fAllowChartLine = True
FF_Control_Redraw HWND_FORMMAIN_PICTURECHARTLINE
End Function
'--------------------------------------------------------------------------------
Function FORMMAIN_PICTURECHARTLINE_WM_PAINT ( _
ControlIndex As Integer, _ ' index in Control Array
hWndForm As hWnd, _ ' handle of Form
hWndControl As hWnd _ ' handle of Control
) As Integer
' fAllowChartLine is a global variable flag that enables/disables the
' painting of the ChartLine graph
If fAllowChartLine Then
Draw_Axes(HWND_FORMMAIN_PICTURECHARTLINE, -3, -30, 3, 30, _
"y = x^2 und y = x^3, x = -3 bis +3, y = -30 bis + 30")
Chart_Line(HWND_FORMMAIN_PICTURECHARTLINE, y(), BGR_Blue)
Chart_Line(HWND_FORMMAIN_PICTURECHARTLINE, z(), BGR_Red)
' Because we have painted the control ourselves then we don't want
' Windows to continue on with the painting process and erasing what
' we have just painted. Simply validate the dirty rectangle.
ValidateRect hWndControl, ByVal 0
End If
End Function