Tuto WINDEV 25

Part 4: Full application with data 145 Remark The assisted code input (also called "completion") is going to help you: as soon as you type the opening bracket "(", a drop-down list proposes the name of all existing windows found in the project. Simply select the name of the window with the keyboard or mouse. If the window name is not displayed in the list, it means that this window was not saved beforehand. 5.  Let’s take a look at this WLanguage code: Open is used to open the "WIN_Product_form" window. This function was already presented in the first part of this tutorial. 6. Save the modifications by clicking among the quick access buttons. 7. Close the code window (click X at the top right corner of code editor). We are now going to modify the "WIN_Product_form" window to display the selected product in the Table control. ▶ Open the "WIN_Product_form" window in the editor: click the corresponding button in the open documents bar. ▶ To display the product data: 1. Display the events associated with the window: • Perform a right mouse click in the area found beside the window (called "Home area"). • Select "Code" from the popup menu that is displayed. • The code editor appears. The WLanguage events associated with the window are displayed. 2. Enter the following WLanguage code in the event "End of initialization of WIN_Product_form": // Assigns the content of items to the controls FileToScreen() FileToScreen is used to display in the controls the data found in the data file, for the current record. In our case, the current record will be the record selected in the Table control of "WIN_ Menu" window. 3. Close the code window. 4. Save the window (Ctrl + S). ▶ Display the "WIN_Menu" window in the editor: click the corresponding button in the open documents bar. ▶ Run the window test ( among the quick access buttons). • In the list of products, click one of the products with the mouse. • Click the "Modify" button. • The detailed product window is displayed. ▶ Close the different test windows using the "X" at the top right of the windows.

RkJQdWJsaXNoZXIy NDQ0OA==