WINDEV Concepts

26 Part 1: Main concepts 8 Window templates WINDEV allows you to create window templates. These templates contain the graphic elements and code common to all the windows in your application. Changes made to a window template are automatically applied to all the windows that use the template. Window templates allow you to keep the style book defined for an application. Using window templates in your applications allows you to: • create windows more easily. • set the layout of the windows. • easily update the application style book. A window template is as easy to create as a window. To create a window from a template, select "Based on a template". By default, all changes made to the template are applied to the windows that use it. However, it is possible to define particular cases in a specific window by overriding the template elements. For more details, see the online help. 9 Events associated with windows 9.1 Default events The following events appear by default in the WINDEV code editor: • Global declarations : Declaration of variables global to the window. • End of initialization : Executed when opening the window, before the code for gaining focus. The initialization event of the window controls is executed after this code. • Request for refreshing the display : Used to group the code for updating the window controls: contents of controls, state (visible, grayed out...), text to refresh, etc, ... This event is started upon request by the following functions: • RequestRefreshUI : Executes the event at the end of the current event (asynchronous execution). • ExecuteRefreshUI : Executes the event immediately. • Close a child window : Run when closing a child window opened from the current window. • Closing : Executed when closing the window. Remark: resuming the input in one of the window controls in this code prevents the window from closing. • Set the Value property (internal windows only) Executed when a value is assigned to the Value property in the Internal Window control. • Get the Value property (internal windows only) Executed when the Value property is used in read mode in the Internal Window control. 9.2 Optional events Several optional events can be added. Simply: 1. Click "Add other events to" at the bottom of the list of events displayed in the code editor. 2. The optional events window appears. 3. Select the optional event(s) to add and validate. 4. The selected events are automatically added after the default events. You can manage, for example: • gain and loss of focus, • changes in one of the window controls, • window size changes, • mouse hover over the window, • left mouse button down, up, double click, • right mouse button down, up, double click, • mouse wheel, etc.

RkJQdWJsaXNoZXIy NDQ0OA==