mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2026-04-05 17:49:26 +02:00
Author:halw
Date:2008-12-24T03:37:43.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@145 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -3,20 +3,20 @@
|
||||
[[Property:uuid|356b5211-f710-6509-3609-8d717ff425f7]]
|
||||
Each WEL library component implements a set of routines for processing the most common messages that a component receives. For example, looking at [[ref:libraries/wel/reference/wel_frame_window_chart|WEL_FRAME_WINDOW]] , you will see that there are many features which begin `on_'. Each of these features enable the user to know when a specific event has occurred, and to perform the appropriate processing as a result of this event. Most of the time, you will only be interested in a small subset of these, necessary to your program. For example, below is the code for on_paint:
|
||||
<code>
|
||||
on_paint (paint_dc: WEL_PAINT_DC; invalid_rect: WEL_RECT) is
|
||||
--Draw a centered text
|
||||
do
|
||||
end
|
||||
on_paint (paint_dc: WEL_PAINT_DC; invalid_rect: WEL_RECT)
|
||||
--Draw a centered text
|
||||
do
|
||||
end
|
||||
</code>
|
||||
|
||||
|
||||
An on_paint message corresponds to the Wm_paint message generated by Windows whenever it needs to re-paint a window, and if you look at the feature, you can see that the arguments are a [[ref:libraries/wel/reference/wel_paint_dc_chart|WEL_PAINT_DC]] and a[[ref:libraries/wel/reference/wel_rect_chart| WEL_RECT]] . which are relevant to this message. By redefining this feature (and others as required), your code will be able to respond appropriately to windows events.
|
||||
{{note|. See [[Tutorial Step 2|step2]] in the [[WEL Tutorial|tutorial]] for a simple demonstration involving the re-definition of <eiffel>on_left_button_down</eiffel>. }}
|
||||
{{note|See [[Tutorial Step 2|step2]] in the [[WEL Tutorial|tutorial]] for a simple demonstration involving the re-definition of <eiffel>on_left_button_down</eiffel>. }}
|
||||
|
||||
|
||||
For different messages received by a control, the arguments will differ (sometimes there are none), but those arguments will always be relevant to the message. For example, on_menu_command from [[ref:libraries/wel/reference/wel_composite_window_chart|WEL_COMPOSITE_WINDOW]] has an <eiffel>INTEGER</eiffel> as an argument, the value of which is a unique menu identifier. <br/>
|
||||
|
||||
{{note|. Not all windows events have a corresponding `on_' message hook defined in WEL. If you wish to process a Windows message that does not correspond to one of the available features, you will need to redefine process_message. <br/>
|
||||
{{note|Not all windows events have a corresponding "<code>on_</code>" message hook defined in WEL. If you wish to process a Windows message that does not correspond to one of the available features, you will need to redefine <code>process_message</code>.
|
||||
}}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user