Press on the image to return to the main documentation page.
TS-Toast
List of types:
CToast
CToast
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.
Events:
None
Members:
CloseNow
As
String
Initialize
(
Activity
As
ActivityWrapper
,
Module
As
Object
,
Act_H
As
Int
,
Act_W
As
Int
)
As
String
IsInitialized
As
Boolean
SetAutoClose
(
Tautoclose
As
String
)
As
String
SetBackgroundColor
(
Tbackcolor
As
Long
)
As
String
SetImage
(
Timage
As
String
)
As
String
SetPosition
(
TpercentDownVertical
As
Int
,
TpercentAcrossHorizontal
As
Int
)
As
String
SetSound
(
pDura
As
Int
,
pFreq
As
Int
)
As
String
SetSoundOn
(
Tsound
As
Boolean
)
As
String
SetTextColor
(
Tcolor
As
Long
)
As
String
SetTextSize
(
txtsize
As
Int
)
As
String
SetTypeFace
(
TypeF
As
TypefaceWrapper
)
As
String
TMS2pan
As
PanelWrapper
ToastMessageShow2
(
Tmessage
As
String
,
Tseconds
As
Int
,
TpercentDownVertical
As
Int
,
TpercentAcrossHorizontal
As
Int
,
Timage
As
String
,
Tcolor
As
Long
,
Tbackcolor
As
Long
,
Ttextsize
As
Int
,
Tautoclose
As
Boolean
,
Tsound
As
Boolean
)
As
String
ToastShow
(
Tmessage
As
String
,
Tseconds
As
Int
)
As
String
TTime
As
Timer
Members description:
CloseNow
As
String
Closes the Toast Message right away
Initialize
(
Activity
As
ActivityWrapper
,
Module
As
Object
,
Act_H
As
Int
,
Act_W
As
Int
)
As
String
Initializes the CToast object
Activity - Pass reference to the Activity: Pass Activity
Module - The calling Module Name: Pass Me
Act_H - Is the Activity Height: Pass Activity.Height
Act_W - Is the Activity Width: Pass Activity.Width
IsInitialized
As
Boolean
Tests whether the object has been initialized.
SetAutoClose
(
Tautoclose
As
String
)
As
String
Use to set the autoclose feature of the ToastShow
NOTE: Only works with ToastShow(), must be called
after Initialize.
Pass True for autoclose and False for user Tap
SetBackgroundColor
(
Tbackcolor
As
Long
)
As
String
Use to set the Background color for the ToastShow
NOTE: Only works with ToastShow(), must be called
after Initialize.
Example: Colors.Gray
SetImage
(
Timage
As
String
)
As
String
Use to set the background image for the ToastShow
NOTE: Only works with ToastShow(), must be called
after Initialize. Can be any image .png or .jpg,
also works for 9 Patch .png images
Pass "" to turn off background Image
SetPosition
(
TpercentDownVertical
As
Int
,
TpercentAcrossHorizontal
As
Int
)
As
String
Use to set the position of the ToastShow message
NOTE: Only works with ToastShow(), must be called
after Initialize. Must be passed as Int, Example:
10 = 10% down from top, 50 = 50% and puts places the
Toast in the middle of the screen
To center the Toast message call:
SetPosition(50, 50)
SetSound
(
pDura
As
Int
,
pFreq
As
Int
)
As
String
Use to set the duration and frequency of the sound
SetSoundOn() must be set to True or you will not hear
the sound.
Pass Duration as Int between: 10 - 1000
Pass Frequency as Int between: 500 - 3500
SetSoundOn
(
Tsound
As
Boolean
)
As
String
Creates a beep when Toast displays
Passing False turns sound beep off
Passing True turns sound beep on
SetTextColor
(
Tcolor
As
Long
)
As
String
Use to set the Text color for the ToastShow
NOTE: Only works with ToastShow(), must be called
after Initialize.
Example: Colors.White
SetTextSize
(
txtsize
As
Int
)
As
String
SetTypeFace
(
TypeF
As
TypefaceWrapper
)
As
String
TMS2pan
As
PanelWrapper
ToastMessageShow2
(
Tmessage
As
String
,
Tseconds
As
Int
,
TpercentDownVertical
As
Int
,
TpercentAcrossHorizontal
As
Int
,
Timage
As
String
,
Tcolor
As
Long
,
Tbackcolor
As
Long
,
Ttextsize
As
Int
,
Tautoclose
As
Boolean
,
Tsound
As
Boolean
)
As
String
Tmessage = The text you want to show in the toast message
Tseconds = The number of seconds you want the toast to show
TpercentDownVertical = Vertical center of message on screen. Example: 20 is 20 percent down
TpercentAcrossHorizontal = Horizontal center of message on screen. Example: 50 is 50 percent across
Timage = Image you want to use as the background of toast message. Must be in the assets folder
Tcolor = Color of the text words
Tbackcolor = Background color of toast message if no image is used
Ttextsize = the size you want the toast message text to be
Tautoclose = True to close after Tseconds, False stays on screen until you Tap message
Tsound = True for sound, False for no sound
ToastShow
(
Tmessage
As
String
,
Tseconds
As
Int
)
As
String
Used to call a default Toast Message without having to pass all parameters. To set parameters each
see ToastMessageShow2()
TTime
As
Timer
Top