|
|
|
|
|
WinRefreshVisible (Function) In french: FenRafraîchissementVisible Modifies or returns the visibility state of the refresh bar in a window. This function can be used when the window supports the "Pull-to-refresh" option. To enable this option in a window: - Open the window description.
- In the "Details" tab, in the "Other parameters" area, check "Pull to refresh".
- Validate.
// "Refresh data" event of the window // ------------------------------------------------------------- // Check the display of selection bar because the refresh of // window data will be performed in a secondary thread. // Otherwise, the refresh bar would be automatically hidden at the // end of the execution of the event. WinRefreshVisible(WIN_Products, True) // Refreshes the window data in a secondary thread ThreadExecute("threadUpdWindow", threadNormal, ProcThreadUpdWin)
//---------------------------------------------------- // Procedure for updating the window data PROCÉDURE ProcThreadUpdWin() // Run an HTTP request HTTPRequest(...) // Goes back to the main thread to display the request content in the window ExecuteMainThread(ProcUpdUI, HTTPGetResult()) END
// --------------------------------------------------- // Procedure for refreshing the window interface PROCÉDURE ProcUpdUI(sData is string) // Process the data received // ... // The data is updated, hide the refresh bar WinRefreshVisible(WIN_Products, False) END
Syntax
Changing the state of the refresh bar Hide the details
WinRefreshVisible(<Window> , <Visible>)
<Window>: Window name Name of window to use. <Visible>: Boolean - True to display the refresh bar,
- False to hide it.
Getting the state of the refresh bar Hide the details
<Result> = WinRefreshVisible(<Window>)
<Result>: Boolean - True if the refresh bar is displayed,
- False if the refresh bar is hidden.
<Window>: Window name Name of window to use. Remarks - During a "Pull to refresh", the refresh bar corresponds to the area displayed at the top of window during the data refresh.
- WinRefreshVisible is used for example to check the display of refresh bar when the data found in the window is refreshed in a secondary thread. This prevents the application from freezing (the example uses this method).
- When the refresh bar is shown by WinRefreshVisible, the "Pull to refresh" event of the window is not executed.
Remark: You can force the execution of this event by using ExecuteProcess with the trtPullToRefresh constant. - To hide the refresh bar, WinRefreshVisible(False) must be called as many times as WinRefreshVisible(True) was run.
Component: wd300android.aar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|