Difference between revisions of "Application:set"

From GiderosMobile
(Created page with "__NOTOC__ <languages /> '''<translate>Available since</translate>:''' Gideros 2015.7<br/> '''<translate>Class</translate>:''' Application<br...")
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2015.7<br/>
'''<translate>Available since</translate>:''' Gideros 2015.7<br/>
+
'''Class:''' [[Application]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/Application|Application]]<br/>
+
 
=== <translate>Description</translate> ===
+
=== Description ===
<translate><br />
+
Sets the state of the desktop setting provided as string parameter.
Sets the state of the desktop setting provided as string parameter.<br />
 
<br /></translate>
 
 
<source lang="lua">
 
<source lang="lua">
 +
application:set(setting, value)
 +
</source>
 +
 +
 +
'''new''' Gideros 2022.1: implement '''application:set("wintabMode")'''
 +
 +
=== Parameters ===
 +
'''setting''': (string) the desktop setting<br/>
 +
'''value''': (varies) the new setting value(s)<br/>
 +
 +
=== List of available parameters and settings ===
 +
To get a list of parameters that can be set use:
 +
<source lang="lua">
 +
print(application:set("help"))
 +
--[[
 +
- windowPosition(x,y)
 +
- windowSize(w,h)
 +
- minimumSize(w,h)
 +
- maximumSize(w,h)
 +
- windowColor(r,g,b)
 +
- windowTitle(text)
 +
- windowModel(type//help)
 +
- cursor(type//help)
 +
- cursorPosition(x,y)
 +
- clipboard(text)
 +
- mkdir(path|dirName//help)
 +
- documentDirectory(path)
 +
- temporaryDirectory(path)
 +
]]
 +
</source>
 +
 +
To get help for individual settings use:
 +
<source lang="lua">
 +
print(application:set("cursor","help")) -- eg: cursor
 +
--[[
 +
Accepted value for cursor :
 +
- arrow
 +
- upArrow
 +
- cross
 +
- wait
 +
- IBeam
 +
- sizeVer
 +
- sizeHor
 +
- sizeBDiag
 +
- sizeFDiag
 +
- sizeAll
 +
- blank
 +
- splitV
 +
- splitH
 +
- pointingHand
 +
- forbidden
 +
- whatsThis
 +
- busy
 +
- openHand
 +
- closedHand
 +
- dragCopy
 +
- dragMove
 +
- dragLink
 +
]]
 +
</source>
 +
 +
<source lang="lua">
 +
print(application:set("windowModel","help")) -- eg: window mode
 +
--[[
 +
Accepted value for windowModel :
 +
- reset
 +
- stayOnTop
 +
- stayOnBottom
 +
- frameless
 +
- noTitleBar
 +
- noButton
 +
- onlyMinimize
 +
- onlyMaximize
 +
- onlyClose
 +
- noMinimize
 +
- noMaximize
 +
- noClose
 +
- helpButton
 +
]]
 +
</source>
 +
 +
=== Examples ===
 +
<source lang="lua">
 +
application:set("windowPosition", 64, 64)
 +
application:set("windowColor", 0, 0, 0)
 
application:set("windowTitle", "My lovely window title")
 
application:set("windowTitle", "My lovely window title")
 +
application:set("cursor", "openHand")
 
</source>
 
</source>
<translate><br />
+
 
Get list of parameters that can be set with:
 
</translate>
 
 
<source lang="lua">
 
<source lang="lua">
print(application:set("help"))
+
-- global app size
 +
myappleft, myapptop, myappright, myappbot = application:getLogicalBounds()
 +
myappwidth, myappheight = myappright - myappleft, myappbot - myapptop
 +
 
 +
if application:getDeviceInfo() == "Windows" and not application:isPlayerMode() then
 +
application:set("windowPosition", myappwidth * 1.2, 16)
 +
application:set("windowModel", "onlyClose")
 +
-- application:set("windowModel", "noMaximize") -- doesn't work for me!
 +
application:set("windowTitle", "App Title")
 +
application:set("minimumSize", myappwidth, myappheight)
 +
application:set("maximumSize", myappwidth, myappheight)
 +
application:set("windowColor", 0, 0, 0)
 +
end
 
</source>
 
</source>
 +
 +
{{Application}}

Revision as of 18:58, 11 May 2022

Available since: Gideros 2015.7
Class: Application

Description

Sets the state of the desktop setting provided as string parameter.

application:set(setting, value)


new Gideros 2022.1: implement application:set("wintabMode")

Parameters

setting: (string) the desktop setting
value: (varies) the new setting value(s)

List of available parameters and settings

To get a list of parameters that can be set use:

print(application:set("help"))
--[[
- windowPosition(x,y)
- windowSize(w,h)
- minimumSize(w,h)
- maximumSize(w,h)
- windowColor(r,g,b)
- windowTitle(text)
- windowModel(type//help)
- cursor(type//help)
- cursorPosition(x,y)
- clipboard(text)
- mkdir(path|dirName//help)
- documentDirectory(path)
- temporaryDirectory(path)
]]

To get help for individual settings use:

print(application:set("cursor","help")) -- eg: cursor
--[[
Accepted value for cursor :
- arrow
- upArrow
- cross
- wait
- IBeam
- sizeVer
- sizeHor
- sizeBDiag
- sizeFDiag
- sizeAll
- blank
- splitV
- splitH
- pointingHand
- forbidden
- whatsThis
- busy
- openHand
- closedHand
- dragCopy
- dragMove
- dragLink
]]
print(application:set("windowModel","help")) -- eg: window mode
--[[
Accepted value for windowModel :
- reset
- stayOnTop
- stayOnBottom
- frameless
- noTitleBar
- noButton
- onlyMinimize
- onlyMaximize
- onlyClose
- noMinimize
- noMaximize
- noClose
- helpButton
]]

Examples

application:set("windowPosition", 64, 64)
application:set("windowColor", 0, 0, 0)
application:set("windowTitle", "My lovely window title")
application:set("cursor", "openHand")
-- global app size
myappleft, myapptop, myappright, myappbot = application:getLogicalBounds()
myappwidth, myappheight = myappright - myappleft, myappbot - myapptop

if application:getDeviceInfo() == "Windows" and not application:isPlayerMode() then
	application:set("windowPosition", myappwidth * 1.2, 16)
	application:set("windowModel", "onlyClose")
--	application:set("windowModel", "noMaximize") -- doesn't work for me!
	application:set("windowTitle", "App Title")
	application:set("minimumSize", myappwidth, myappheight)
	application:set("maximumSize", myappwidth, myappheight)
	application:set("windowColor", 0, 0, 0)
end