Difference between revisions of "Application"
From GiderosMobile
(added application scale constants) |
|||
(9 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
<!-- GIDEROSOBJ:Application --> | <!-- GIDEROSOBJ:Application --> | ||
− | '''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/> | + | '''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]][[File:Platform linux.png]]<br/> |
'''Available since:''' Gideros 2011.6<br/> | '''Available since:''' Gideros 2011.6<br/> | ||
'''Inherits from:''' [[Object|Object]]<br/> | '''Inherits from:''' [[Object|Object]]<br/> | ||
=== Description === | === Description === | ||
− | The Application class contains the common functions that are available to the current application. There is a global variable ''application'' of type Application to access these functions. | + | The Application class contains the common functions that are available to the current application. |
+ | |||
+ | There is a global variable '''''application''''' of type Application to access these functions. | ||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== Methods === | === Methods === | ||
− | [[Application:canOpenUrl]] ''tests if it is possible to open provided url''<br/><!--GIDEROSMTD:Application:canOpenUrl(url) tests if it is possible to open provided url --> | + | [[Application:applyStyles]] ''applies pending style changes immediately''<br/><!--GIDEROSMTD:Application:applyStyles() applies pending style changes immediately--> |
+ | [[Application:canOpenUrl]] ''tests if it is possible to open provided url''<br/><!--GIDEROSMTD:Application:canOpenUrl(url) tests if it is possible to open provided url--> | ||
[[Application:checkPermission]] ''checks android permission''<br/><!--GIDEROSMTD:Application:checkPermission(permission) checks android permission--> | [[Application:checkPermission]] ''checks android permission''<br/><!--GIDEROSMTD:Application:checkPermission(permission) checks android permission--> | ||
[[Application:configureFrustum]] ''configures the projection for 3D perspective''<br/><!--GIDEROSMTD:Application:configureFrustum(fov,farplane) configures the projection for 3D perspective--> | [[Application:configureFrustum]] ''configures the projection for 3D perspective''<br/><!--GIDEROSMTD:Application:configureFrustum(fov,farplane) configures the projection for 3D perspective--> | ||
+ | [[Application:enableDrawInfo]] ''shows or hides Gideros info layer''<br/><!--GIDEROSMTD:Application:enableDrawInfo(color) shows or hides Gideros info layer--> | ||
+ | [[Application:enableOnDemandDraw]] ''enable or disable on-demand rendering''<br/><!--GIDEROSMTD:Application:enableOnDemandDraw(enable) enable or disable on-demand rendering--> | ||
[[Application:exit]] ''terminates the application''<br/><!--GIDEROSMTD:Application:exit() terminates the application--> | [[Application:exit]] ''terminates the application''<br/><!--GIDEROSMTD:Application:exit() terminates the application--> | ||
[[Application:get]] ''returns state of desktop setting''<br/><!--GIDEROSMTD:Application:get(setting) returns state of desktop setting--> | [[Application:get]] ''returns state of desktop setting''<br/><!--GIDEROSMTD:Application:get(setting) returns state of desktop setting--> | ||
Line 25: | Line 30: | ||
[[Application:getDeviceWidth]] ''returns the physical width of the device''<br/><!--GIDEROSMTD:Application:getDeviceWidth() returns the physical width of the device in pixels--> | [[Application:getDeviceWidth]] ''returns the physical width of the device''<br/><!--GIDEROSMTD:Application:getDeviceWidth() returns the physical width of the device in pixels--> | ||
[[Application:getDeviceInfo]] ''returns information about device''<br/><!--GIDEROSMTD:Application:getDeviceInfo() returns information about device--> | [[Application:getDeviceInfo]] ''returns information about device''<br/><!--GIDEROSMTD:Application:getDeviceInfo() returns information about device--> | ||
+ | [[Application:getDeviceName]] ''returns the device name''<br/><!--GIDEROSMTD:Application:getDeviceName() returns the device name--> | ||
[[Application:getDeviceOrientation]] ''gets the device orientation''<br/><!--GIDEROSMTD:Application:getDeviceOrientation() gets the device orientation--> | [[Application:getDeviceOrientation]] ''gets the device orientation''<br/><!--GIDEROSMTD:Application:getDeviceOrientation() gets the device orientation--> | ||
[[Application:getDeviceSafeArea]] ''returns the safe display area bounds''<br/><!--GIDEROSMTD:Application:getDeviceSafeArea(logical) returns the safe display area bounds--> | [[Application:getDeviceSafeArea]] ''returns the safe display area bounds''<br/><!--GIDEROSMTD:Application:getDeviceSafeArea(logical) returns the safe display area bounds--> | ||
Line 38: | Line 44: | ||
[[Application:getLogicalTranslateX]] ''returns the translation of automatic screen scaling on the x-axis''<br/><!--GIDEROSMTD:Application:getLogicalTranslateX() returns the translation of automatic screen scaling on the x-axis--> | [[Application:getLogicalTranslateX]] ''returns the translation of automatic screen scaling on the x-axis''<br/><!--GIDEROSMTD:Application:getLogicalTranslateX() returns the translation of automatic screen scaling on the x-axis--> | ||
[[Application:getLogicalTranslateY]] ''returns the translation of automatic screen scaling on the y-axis''<br/><!--GIDEROSMTD:Application:getLogicalTranslateY() returns the translation of automatic screen scaling on the y-axis--> | [[Application:getLogicalTranslateY]] ''returns the translation of automatic screen scaling on the y-axis''<br/><!--GIDEROSMTD:Application:getLogicalTranslateY() returns the translation of automatic screen scaling on the y-axis--> | ||
+ | [[Application:getNativePath]] ''returns the system path for a given resource''<br/><!--GIDEROSMTD:Application:getNativePath(path) returns the system path for a given resource--> | ||
[[Application:getOrientation]] ''returns the orientation of the application''<br/><!--GIDEROSMTD:Application:getOrientation() returns the orientation of the application--> | [[Application:getOrientation]] ''returns the orientation of the application''<br/><!--GIDEROSMTD:Application:getOrientation() returns the orientation of the application--> | ||
+ | [[Application:getProjectProperties]] ''returns the project properties'' '''new'''<br/><!--GIDEROSMTD:Application:getProjectProperties() returns the project properties--> | ||
[[Application:getScaleMode]] ''returns the automatic scale mode of the application''<br/><!--GIDEROSMTD:Application:getScaleMode() returns the automatic scale mode of the application--> | [[Application:getScaleMode]] ''returns the automatic scale mode of the application''<br/><!--GIDEROSMTD:Application:getScaleMode() returns the automatic scale mode of the application--> | ||
[[Application:getScreenDensity]] ''returns the screen density in pixels per inch''<br/><!--GIDEROSMTD:Application:getScreenDensity() returns the screen density in pixels per inch--> | [[Application:getScreenDensity]] ''returns the screen density in pixels per inch''<br/><!--GIDEROSMTD:Application:getScreenDensity() returns the screen density in pixels per inch--> | ||
Line 48: | Line 56: | ||
[[Application:setBackgroundColor]] ''sets the background color''<br/><!--GIDEROSMTD:Application:setBackgroundColor(color) sets the background color in hexadecimal format--> | [[Application:setBackgroundColor]] ''sets the background color''<br/><!--GIDEROSMTD:Application:setBackgroundColor(color) sets the background color in hexadecimal format--> | ||
[[Application:setClipboard]] ''stores data to the clipboard''<br/><!--GIDEROSMTD:Application:setClipboard(string) stores data to the clipboard--> | [[Application:setClipboard]] ''stores data to the clipboard''<br/><!--GIDEROSMTD:Application:setClipboard(string) stores data to the clipboard--> | ||
+ | [[Application:setEventMerging]] ''allows merging of touch/mouse move events''<br/><!--GIDEROSMTD:Application:setEventMerging(bool) allows merging of touch/mouse move events--> | ||
[[Application:setFps]] ''sets the frame rate of the application''<br/><!--GIDEROSMTD:Application:setFps(fps) sets the frame rate of the application--> | [[Application:setFps]] ''sets the frame rate of the application''<br/><!--GIDEROSMTD:Application:setFps(fps) sets the frame rate of the application--> | ||
[[Application:setFullScreen]] ''full screen or window mode''<br/><!--GIDEROSMTD:Application:setFullScreen(fullscreen) full screen or window mode--> | [[Application:setFullScreen]] ''full screen or window mode''<br/><!--GIDEROSMTD:Application:setFullScreen(fullscreen) full screen or window mode--> | ||
Line 55: | Line 64: | ||
[[Application:setOrientation]] ''sets the orientation of the application''<br/><!--GIDEROSMTD:Application:setOrientation(orientation) sets the orientation of the application--> | [[Application:setOrientation]] ''sets the orientation of the application''<br/><!--GIDEROSMTD:Application:setOrientation(orientation) sets the orientation of the application--> | ||
[[Application:setScaleMode]] ''sets the automatic scale mode of the application''<br/><!--GIDEROSMTD:Application:setScaleMode(scaleMode) sets the automatic scale mode of the application--> | [[Application:setScaleMode]] ''sets the automatic scale mode of the application''<br/><!--GIDEROSMTD:Application:setScaleMode(scaleMode) sets the automatic scale mode of the application--> | ||
+ | [[Application:setTextInput]] ''sets the IME of the android keyboard''<br/><!--GIDEROSMTD:Application:setTextInput(type,buffer,selstart,selend,label,actionLabel,hintText) sets the IME of the android keyboard--> | ||
[[Application:setWindowSize]] ''sets desktop window to a specific size''<br/><!--GIDEROSMTD:Application:setWindowSize(width,height) sets desktop window to a specific size--> | [[Application:setWindowSize]] ''sets desktop window to a specific size''<br/><!--GIDEROSMTD:Application:setWindowSize(width,height) sets desktop window to a specific size--> | ||
[[Application:vibrate]] ''vibrates the device''<br/><!--GIDEROSMTD:Application:vibrate(ms) vibrates the device--> | [[Application:vibrate]] ''vibrates the device''<br/><!--GIDEROSMTD:Application:vibrate(ms) vibrates the device--> | ||
Line 60: | Line 70: | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== Events === | === Events === | ||
− | [[ | + | [[Event.APPLICATION_START]]<br/> |
− | [[ | + | [[Event.APPLICATION_RESIZE]]<br/> |
− | [[ | + | [[Event.APPLICATION_SUSPEND]]<br/> |
− | [[ | + | [[Event.APPLICATION_EXIT]]<br/> |
− | [[Event.APPLICATION_RESUME | + | [[Event.APPLICATION_RESUME]]<br/> |
+ | [[Event.APPLICATION_PERMISSION]] '''new'''<br/> | ||
=== Constants === | === Constants === | ||
[[Application.CONSTANTS|Application.LANDSCAPE_LEFT]]<br/><!--GIDEROSCST:Application.LANDSCAPE_LEFT landscapeLeft--> | [[Application.CONSTANTS|Application.LANDSCAPE_LEFT]]<br/><!--GIDEROSCST:Application.LANDSCAPE_LEFT landscapeLeft--> | ||
Line 79: | Line 90: | ||
[[Application.CONSTANTS|Application.PIXEL_PERFECT]]<br/><!--GIDEROSCST:Application.PIXEL_PERFECT pixelPerfect--> | [[Application.CONSTANTS|Application.PIXEL_PERFECT]]<br/><!--GIDEROSCST:Application.PIXEL_PERFECT pixelPerfect--> | ||
[[Application.CONSTANTS|Application.STRETCH]]<br/><!--GIDEROSCST:Application.STRETCH stretch--> | [[Application.CONSTANTS|Application.STRETCH]]<br/><!--GIDEROSCST:Application.STRETCH stretch--> | ||
+ | |||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_CLASS_NONE]]<br/><!--GIDEROSCST:Application.TEXTINPUT_CLASS_NONE 0--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_CLASS_TEXT]]<br/><!--GIDEROSCST:Application.TEXTINPUT_CLASS_TEXT 1--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_CLASS_NUMBER]]<br/><!--GIDEROSCST:Application.TEXTINPUT_CLASS_NUMBER 2--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_CLASS_PHONE]]<br/><!--GIDEROSCST:Application.TEXTINPUT_CLASS_PHONE 3--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_CLASS_DATE]]<br/><!--GIDEROSCST:Application.TEXTINPUT_CLASS_DATE 4--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_TVARIANT_URI]]<br/><!--GIDEROSCST:Application.TEXTINPUT_TVARIANT_URI 0x10--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_TVARIANT_EMAIL]]<br/><!--GIDEROSCST:Application.TEXTINPUT_TVARIANT_EMAIL 0x20--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_TVARIANT_PASSWORD]]<br/><!--GIDEROSCST:Application.TEXTINPUT_TVARIANT_PASSWORD 0x80--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_DVARIANT_DATE]]<br/><!--GIDEROSCST:Application.TEXTINPUT_DVARIANT_DATE 0x10--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_DVARIANT_TIME]]<br/><!--GIDEROSCST:Application.TEXTINPUT_DVARIANT_TIME 0x20--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_NVARIANT_PASSWORD]]<br/><!--GIDEROSCST:Application.TEXTINPUT_NVARIANT_PASSWORD 0x10--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_TFLAG_CAPCHARACTERS]]<br/><!--GIDEROSCST:Application.TEXTINPUT_TFLAG_CAPCHARACTERS 0x1000--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_TFLAG_CAPWORDS]]<br/><!--GIDEROSCST:Application.TEXTINPUT_TFLAG_CAPWORDS 0x2000--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_TFLAG_CAPSENTENCES]]<br/><!--GIDEROSCST:Application.TEXTINPUT_TFLAG_CAPSENTENCES 0x4000--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_TFLAG_AUTOCORRECT]]<br/><!--GIDEROSCST:Application.TEXTINPUT_TFLAG_AUTOCORRECT 0x8000--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_TFLAG_MULTILINE]]<br/><!--GIDEROSCST:Application.TEXTINPUT_TFLAG_MULTILINE 0x20000--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_NFLAG_SIGNED]]<br/><!--GIDEROSCST:Application.TEXTINPUT_NFLAG_SIGNED 0x1000--> | ||
+ | [[Application.CONSTANTS|Application.TEXTINPUT_NFLAG_DECIMAL]]<br/><!--GIDEROSCST:Application.TEXTINPUT_NFLAG_DECIMAL 0x2000--> | ||
|} | |} | ||
{{GIDEROS IMPORTANT LINKS}} | {{GIDEROS IMPORTANT LINKS}} |
Latest revision as of 04:52, 8 November 2024
Supported platforms:
Available since: Gideros 2011.6
Inherits from: Object
Description
The Application class contains the common functions that are available to the current application.
There is a global variable application of type Application to access these functions.