Difference between revisions of "Event order/de"
(Translation) |
|||
Line 7: | Line 7: | ||
==Lazarus Dokumentation== | ==Lazarus Dokumentation== | ||
− | Das [[Lazarus_Tutorial#Event_Actions | + | Das [[Lazarus_Tutorial#Event_Actions]] hat ein paar Informationen darüber, welches Ereignis was macht. |
== [[TForm|Forms]] == | == [[TForm|Forms]] == |
Revision as of 22:09, 15 May 2014
│
Deutsch (de) │
English (en) │
suomi (fi) │
Übersicht
Lazarus stellt verschiedene Ereignisse (engl. Events) zur Verfügung um Dinge die zur Laufzeit Ihrer Anwendung auftreten können, zu handhaben (in denen Sie Ihre eigenen Operationen einfügen können). Ein solches Ereignis kann ein Buttonklick eines Nutzers, eine Eingabe in ein Textfeld, das Drücken einer Taste und noch vieles andere sein.
Es gibt daher eine Menge von möglichen Ereignissen um vielen verschiedenen Szenarien gerecht zu werden. Jemand, der Lazarus oder Delphi noch nicht kennt, kann auch schnell ein falsches Ereignis wählen.
Lazarus Dokumentation
Das Lazarus_Tutorial#Event_Actions hat ein paar Informationen darüber, welches Ereignis was macht.
Forms
Typical event order for forms is:
OnCreate => OnShow => OnActivate => OnPaint => OnResize => OnPaint => ... OnCloseQuery => OnClose => OnDeactivate => OnHide => OnDestroy
Form.OnCreate
This is the equivalent to the class constructor in forms. Use this to initialize form-level variables etc. The form is not yet shown at this time.
Form.OnShow
When the form is shown (e.g. when loading the form or setting its .Visible
property to true), this event is fired - just before the form is visible. This allows you to modify the visual appearance of controls (e.g. disable certain controls) without flickering.
Form.OnActivate
Fired once after Form.OnCreate.
Form.OnDestroy
The equivalent to a class destructor in forms. Use this to clean up/free variables.
General controls
These events apply to various controls. Please use the Object Inspector to check if it is available for the control you're currently using.
OnEditingDone
The OnEditingDone event for controls can act like the Validate event in other programming languages: it indicates the user is done changing the control and intends to keep that value. The program can now check the control content for correctness, show error messages, update database fields, etc.
Hinweis: As soon as you click outside the control (even on a control that cannot receive focus) OnEditingDone is triggered.
Applicable Delphi information
Because the implementation of events in Lazarus and Delphi is similar, a lot of Delphi-related documentation is applicable to Lazarus with minor modifications.
Delphi documentation is often handy. You can search for the actual control you want to know more about to get a list of its events.
If you want to know about the order in which events fire on a form, this article from about.com can be useful.