Tuto WINDEV 25
Part 4: Full application with data 225 ▶ Test the window and its menu options by clicking among the quick access buttons. ▶ We are now going to modify this menu by adding an option used to exit from the application. 1. In the editor, select the "Menu" option. 2. In the popup menu (right mouse click), select "Transform to expand a sub-menu". 3. In the input area that is displayed, type "Exit". 4. We are going to associate this menu option with the "Alt + F4" shortcut: • Select the "Exit" option. • In the popup menu (right mouse click), select "Option description". • In the "General" tab, in the "Keyboard shortcut" area, select "F4" and check "Alt". • Validate. 5. Display the WLanguage code of the option and write the following WLanguage code in the event "Selecting the menu": // Asks the user whether he wants to exit from the application IF YesNo(No, "Exit from the application?") = Yes THEN // End of application EndProgram() END Let’s take a look at this WLanguage code: • YesNo is used to establish a dialog with the user by asking him a question. The user can give an answer to the question via 2 buttons: yes or no. • EndProgram (called if the user clicks "Yes") is used to end the application. ▶ Run the window test by clicking among the quick access buttons.
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==