[[Property:title|Tutorial Step 6]]
[[Property:weight|5]]
[[Property:uuid|90d557e1-c4a6-e6ff-ff19-95a44c99f0ae]]
This sample builds on tutorial [[Tutorial Step 5|step 5]] by preventing the loss of the drawing when Windows re-draws the client area of the [[ref:libraries/wel/reference/wel_frame_window_chart|WEL_FRAME_WINDOW]] . The output is shown below:
[[Image:step6|step6]]
==Compiling==
* Launch EiffelStudio.
* Click '''Add project'''
* Browse to ''$ISE_EIFFEL\examples\wel\tutorial\step6\''.
* Choose ''tutorial_step6.ecf''
* Choose the location where the project will be compiled, by default the same directory containing the configuration file.
* Click '''OK'''.
==Running==
After launching the sample, you will see a [[ref:libraries/wel/reference/wel_frame_window_chart|WEL_FRAME_WINDOW]] displayed. By holding down the left mouse button, and moving the mouse (Within the client area of the window), you will be able to draw on the client are of the window. If you press the right mouse button, a [[ref:libraries/wel/reference/wel_modal_dialog_chart|WEL_MODAL_DIALOG]] will pop up which allows you to enter the thickness of the line that is drawn. If you re-size the window, then the drawing will be re-drawn.
==Under the Hood==
This system uses a redefined on_paint to re-draw the contents of the window. A LINKED_LIST
of LINES
is used to store all the lines that have been drawn and during on_paint
, this list is traversed in order to re-draw each line.
This sample contains the following classes:
* TUTORIAL_STEP6
* MAIN_WINDOW
* LINE_THICKNESS_DIALOG_CHART
* APPLICATION_IDS
* POINT
* LINE