Plugin:MirLua/Module/m icolib: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Dart Raiden (talk | contribs) (Marked this version for translation) |
||
(5 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
<languages/> | |||
<translate> | |||
<!--T:1--> | |||
Allows you to work with icons. | Allows you to work with icons. | ||
</translate> | |||
{{Ls|MirLua/Modules/include_info}} <code>local icolib = require('m_icolib')</code> | |||
{{ | __TOC__ | ||
=== AddIcon === | |||
<translate><!--T:2--> Registers an icon.</translate> | |||
==== {{Ls|MirLua/Modules/parameters}} ==== | |||
{| class="wikitable" | |||
|- | |||
! scope="col" | {{Ls|MirLua/Modules/param_name}} | |||
! scope="col" | {{Ls|MirLua/Modules/required_param}} | |||
! scope="col" | {{Ls|Content/TableHeaders/type}} | |||
! scope="col" | {{Ls|Content/TableHeaders/description}} | |||
|- | |||
! scope="row" class="MirLuaParametersTable-parameter" | name | |||
| style="text-align:center" | {{Ls|YesNo/yes}} | |||
| style="text-align:center" | <code>string</code> | |||
| <translate><!--T:3--> Unique icon name.</translate> | |||
|- | |||
! scope="row" class="MirLuaParametersTable-parameter" | description | |||
| style="text-align:center" | {{Ls|YesNo/yes}} | |||
| style="text-align:center" | <code>string</code> | |||
| <translate><!--T:4--> Description.</translate> | |||
|- | |||
! scope="row" class="MirLuaParametersTable-parameter" | section | |||
| style="text-align:center" | {{Ls|YesNo/no}} | |||
| style="text-align:center" | <code>string</code> | |||
| <translate><!--T:5--> Section name in Miranda icon settings. By default plugin name (<tvar|MirLua>MirLua</>) is used.</translate> | |||
|- | |||
! scope="row" class="MirLuaParametersTable-parameter" | path | |||
| style="text-align:center" | {{Ls|YesNo/no}} | |||
| style="text-align:center" | <code>string</code> | |||
| <translate><!--T:6--> Default icon file to use. By default path to executable file of Miranda NG is used.</translate> | |||
|} | |||
==== {{Ls|MirLua/Modules/result}} ==== | |||
{{nbsp|5}}{{Ls|MirLua/Modules/type}} <code>light userdata</code> | |||
{{nbsp|5}}<translate><!--T:7--> Returns icon handle if icon was registered successfully, otherwise <tvar|nil><code>nil</code></>.</translate> | |||
=== | ==== {{Ls|MirLua/Modules/example}} ==== | ||
{{Content:MirLua/Example|code=local hIcon = icolib.AddIcon('iconUniqueName', 'My super icon')}} | {{Content:MirLua/Example|code=local hIcon = icolib.AddIcon('iconUniqueName', 'My super icon')}} | ||
---- | |||
=== GetIcon === | |||
<translate><!--T:8--> Returns icon handle.</translate> | |||
==== {{Ls|MirLua/Modules/parameters}} ==== | |||
{| class="wikitable" | |||
|- | |||
! scope="col" | {{Ls|MirLua/Modules/param_name}} | |||
! scope="col" | {{Ls|MirLua/Modules/required_param}} | |||
! scope="col" | {{Ls|Content/TableHeaders/type}} | |||
! scope="col" | {{Ls|Content/TableHeaders/description}} | |||
|- | |||
! scope="row" class="MirLuaParametersTable-parameter" | name | |||
| style="text-align:center" | {{Ls|YesNo/yes}} | |||
| style="text-align:center" | <code>string</code> | |||
| <translate><!--T:9--> Unique icon name.</translate> | |||
|} | |||
=== | ==== {{Ls|MirLua/Modules/result}} ==== | ||
{{nbsp|5}}{{Ls|MirLua/Modules/type}} <code>boolean</code> | |||
{{nbsp|5}}<translate><!--T:10--> Returns icon handle if icon was found, otherwise <tvar|nil><code>nil</code></>.</translate> | |||
==== {{Ls|MirLua/Modules/example}} ==== | |||
: Returns icon handle if icon was found, otherwise | |||
{{Content:MirLua/Example|code= | {{Content:MirLua/Example|code= | ||
if icolib.GetIcon('iconUniqueName') then | if icolib.GetIcon('iconUniqueName') then | ||
Line 46: | Line 78: | ||
end | end | ||
}} | }} | ||
---- | |||
=== GetIconHandle === | |||
---- | |||
=== RemoveIcon === | === RemoveIcon === | ||
Removes an icon. | <translate><!--T:11--> Removes an icon.</translate> | ||
==== {{Ls|MirLua/Modules/parameters}} ==== | |||
:: | {| class="wikitable" | ||
: | |- | ||
! scope="col" | {{Ls|MirLua/Modules/param_name}} | |||
! scope="col" | {{Ls|MirLua/Modules/required_param}} | |||
! scope="col" | {{Ls|Content/TableHeaders/type}} | |||
! scope="col" | {{Ls|Content/TableHeaders/description}} | |||
|- | |||
! scope="row" class="MirLuaParametersTable-parameter" | name | |||
| style="text-align:center" | {{Ls|YesNo/yes}} | |||
| style="text-align:center" | <code>string</code> | |||
| <translate><!--T:12--> Unique icon name.</translate> | |||
|} | |||
==== {{Ls|MirLua/Modules/example}} ==== | |||
{{Content:MirLua/Example|code=icolib.RemoveIcon('iconUniqueName')}} | {{Content:MirLua/Example|code=icolib.RemoveIcon('iconUniqueName')}} | ||
Latest revision as of 02:02, 10 February 2022
Allows you to work with icons.
Include module: local icolib = require('m_icolib')
AddIcon
Registers an icon.
Parameters
Parameter name | Required | Type | Description |
---|---|---|---|
name | Yes | string
|
Unique icon name. |
description | Yes | string
|
Description. |
section | No | string
|
Section name in Miranda icon settings. By default plugin name (MirLua) is used. |
path | No | string
|
Default icon file to use. By default path to executable file of Miranda NG is used. |
Result
Type: light userdata
Returns icon handle if icon was registered successfully, otherwise nil
.
Example
local hIcon = icolib.AddIcon('iconUniqueName', 'My super icon')
GetIcon
Returns icon handle.
Parameters
Parameter name | Required | Type | Description |
---|---|---|---|
name | Yes | string
|
Unique icon name. |
Result
Type: boolean
Returns icon handle if icon was found, otherwise nil
.
Example
if icolib.GetIcon('iconUniqueName') then
print('Icon iconUniqueName exists')
end
GetIconHandle
RemoveIcon
Removes an icon.
Parameters
Parameter name | Required | Type | Description |
---|---|---|---|
name | Yes | string
|
Unique icon name. |
Example
icolib.RemoveIcon('iconUniqueName')