Tuto WINDEV 25
60 Part 2: The WLanguage basics Creating the window ▶ Create a new blank window: 1. Click among the quick access buttons. The window for creating a new element is displayed: click "Window" then "Window". The window creation wizard starts. 2. Select "Blank" and the "Phoenix" skin template. 3. Validate. The window is automatically created in the editor. The window for saving an element is displayed. 4. Specify the window title: "Conditional statements". The window name ("WIN_Conditional_ statements") is automatically proposed. 5. Click "OK" to validate the information shown in the save window. Creating the window controls for the conditional IF statement Two controls must be created: • a Check Box control used to display (or not) the "Close" button. • a "Close" Button control to close the window. ▶ To create the Check Box control: 1. On the "Creation" pane, in the "Usual controls" group, click "Check box" then click the position where the control will be created in the window (at the top of window for example). 2. Click the control that was just created: the "Option 1" caption becomes editable. 3. Type the option caption: "Make the closing button visible". 4. Press Enter to validate the input. ▶ The option caption is truncated in the editor. To display the control properly: 1. Select the control. 2. In the popup menu (right click), select "Adapt the size". 3. The control is immediately enlarged and the caption is entirely displayed. ▶ To create the "Close" Button control: 1. On the "Creation" pane, in the "Usual controls" group, click . 2. Click the location where the control will be created (for example, on the right of Check Box control). 3. Click the control that was just created. The text displayed in the control becomes editable. Type the caption: "Close". 4. Press Enter to validate the input. ▶ This Button control is used to close the window. We are going to type the corresponding WLanguage code: 1. Select the "Close" Button control. 2. Press F2: the code editor displays the events associated with the control. 3. Write the following WLanguage code in the "Click BTN_Close" event: Close() Close is used to close the current window. 4. Close the code window (click X at the top right corner of code editor).
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==