ShowMobile()
Syntax
ShowMobile(#Mobile, State [, #TargetMobile])Description
Changes the visibility of the specified mobile dialog or popover object.
Parameters
#Mobile The mobile object to show. It has to be a ContainerMobile() of type #PB_Mobile_Dialog or #PB_Mobile_PopOver. State The new visibility state value. If 'State' is 0, the mobile object will be hidden, else it will be shown. #TargetMobile The mobile object to use to display the PopOver. It has to be a ContainerMobile() of type #PB_Mobile_PopOver.
Return value
None.
Example
Enumeration
#Dialog
#Open
#Close
EndEnumeration
; Create the dialog content, will be only visible with ShowMobile()
;
If ContainerMobile(#Dialog, #PB_Mobile_Dialog, "padding:8px")
If ContainerMobile(#PB_Any, #PB_Mobile_Row, "padding:8px")
TextMobile(#PB_Any, "This is a dynamic dialog box", #PB_Mobile_Center)
CloseMobileContainer()
EndIf
If ContainerMobile(#PB_Any, #PB_Mobile_Row, "padding:8px")
ButtonMobile(#Close, "Close", #PB_Mobile_Center)
CloseMobileContainer()
EndIf
CloseMobileContainer()
EndIf
; Create the main page with a single button
;
If ContainerMobile(#PB_Any, #PB_Mobile_Page, "margin:8px")
ButtonMobile(#Open, "Open the dialog")
CloseMobileContainer()
EndIf
; Handle the events
;
Procedure MobileEvents()
Select EventMobile()
Case #Open
ShowMobile(#Dialog, #True)
Case #Close
ShowMobile(#Dialog, #False)
EndSelect
EndProcedure
BindEvent(#PB_Event_Mobile, @MobileEvents())
Example: PopOver example
Enumeration
#PopOver
#Button
#Close
EndEnumeration
; Create the dialog content, will be only visible with ShowMobile()
;
If ContainerMobile(#PopOver, #PB_Mobile_PopOver, "padding:8px")
If ContainerMobile(#PB_Any, #PB_Mobile_Row, "padding:8px")
TextMobile(#PB_Any, "This is a pop over box", #PB_Mobile_Center)
CloseMobileContainer()
EndIf
If ContainerMobile(#PB_Any, #PB_Mobile_Row, "padding:8px")
ButtonMobile(#Close, "Close", #PB_Mobile_Center)
CloseMobileContainer()
EndIf
CloseMobileContainer()
EndIf
; Create the main page with a single button
;
If ContainerMobile(#PB_Any, #PB_Mobile_Page, "margin:8px")
HtmlMobile("<br><br><br><br><br><br><br><br><br>") ; Give some space at top
ButtonMobile(#Button, "Open the popover")
CloseMobileContainer()
EndIf
; Handle the events
;
Procedure MobileEvents()
Select EventMobile()
Case #Button
ShowMobile(#PopOver, #True, #Button)
Case #Close
ShowMobile(#PopOver, #False)
EndSelect
EndProcedure
BindEvent(#PB_Event_Mobile, @MobileEvents())
See Also
GetMobileState()
Supported OS
All