Tuto WINDEV Mobile 25
Part 5: Android and iOS: Developing an application 125 2. Replace the WLanguage code of the "Click" event with the following WLanguage code: // Local variable sPhoto is string // Start the selection sPhoto = AlbumPicker(albumImage) IF sPhoto <> "" THEN IMG_Photo = sPhoto END In this WLanguage code, AlbumPicker is used to retrieve the selected photo from the photo album. 3. Save the modifications by clicking among the quick access buttons. 4. Close the code window (click X at the top right corner of code editor). Managing the bar code of product Caution! This paragraph requires a device equipped with a camera. Otherwise, you will not be able to test its use. Furthermore, this paragraph requires the application to be installed on the device because it is using hardware resources that are not accessible in Simulation mode. Overview The "Product" data file contains a "Bar_Code" item. This item is used to store the value of a bar code. Some devices (especially the ones equipped with a camera) can scan a bar code to retrieve its value. The bar code will be managed via the device camera and by a specific WLanguage function. Implementation ▶ To create a Button control to manage bar codes: 1. Display (if necessary) the "WIN_Product_form" window in the editor. 2. Add a Button control in the window: • On the "Creation" pane, in the "Usual controls" group, click . • The control shape appears under the mouse. • Create the control next to the "Bar code" control (resize the edit control if necessary). 3. Open the Button control description window (double-click the control): • Give a name to the control: "BTN_Bar_Code". • Clear the control caption. • Select an image of bar code in the image catalog (type the "Code" keyword for example). 4. Validate the description window. 5. In the editor, reduce the control size.
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==