Difference between revisions of "Application:set"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Sets the state of the desktop setting provided as string parameter.
 
Sets the state of the desktop setting provided as string parameter.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
application:set(setting, value)
 
application:set(setting, value)
 
</source>
 
</source>
Line 18: Line 18:
 
=== List of available parameters and settings ===
 
=== List of available parameters and settings ===
 
To get a list of parameters that can be set use:
 
To get a list of parameters that can be set use:
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
print(application:set("help"))
 
print(application:set("help"))
 
--[[
 
--[[
Line 38: Line 38:
  
 
To get help for individual settings use:
 
To get help for individual settings use:
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
print(application:set("cursor","help")) -- eg: cursor
 
print(application:set("cursor","help")) -- eg: cursor
 
--[[
 
--[[
Line 67: Line 67:
 
</source>
 
</source>
  
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
print(application:set("windowModel","help")) -- eg: window mode
 
print(application:set("windowModel","help")) -- eg: window mode
 
--[[
 
--[[
Line 88: Line 88:
  
 
=== Examples ===
 
=== Examples ===
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
application:set("windowPosition", 64, 64)
 
application:set("windowPosition", 64, 64)
 
application:set("windowColor", 0, 0, 0)
 
application:set("windowColor", 0, 0, 0)
Line 95: Line 95:
 
</source>
 
</source>
  
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
-- global app size
 
-- global app size
 
myappleft, myapptop, myappright, myappbot = application:getLogicalBounds()
 
myappleft, myapptop, myappright, myappbot = application:getLogicalBounds()
Line 111: Line 111:
 
</source>
 
</source>
  
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
application:set("mkDir", application:get("directory","executable").."|dirName")
 
application:set("mkDir", application:get("directory","executable").."|dirName")
 
</source>
 
</source>
  
 
{{Application}}
 
{{Application}}

Revision as of 16:31, 12 July 2023

Available since: Gideros 2015.7
Class: Application

Description

Sets the state of the desktop setting provided as string parameter. <syntaxhighlight lang="lua"> application:set(setting, value) </source>


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: <syntaxhighlight 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: <syntaxhighlight lang="lua"> print(application:set("cursor","help")) -- eg: cursor --[[ Accepted value for cursor : - arrow - upArrow - cross - wait - IBeam - sizeVer - sizeHor - sizeBDiag - sizeFDiag - sizeAll - blank -- not available on win32 - splitV - splitH - pointingHand - forbidden - whatsThis - busy - openHand -- not available on win32 - closedHand -- not available on win32 - dragCopy -- not available on win32 - dragMove -- not available on win32 - dragLink -- not available on win32 ]] </source>

<syntaxhighlight 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

<syntaxhighlight lang="lua"> application:set("windowPosition", 64, 64) application:set("windowColor", 0, 0, 0) application:set("windowTitle", "My lovely window title") application:set("cursor", "openHand") </source>

<syntaxhighlight lang="lua"> -- 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>

<syntaxhighlight lang="lua"> application:set("mkDir", application:get("directory","executable").."|dirName") </source>