Plugin:MirLua/Module/m icolib: Difference between revisions
Jump to navigation
Jump to search
(add langbar) |
Dart Raiden (talk | contribs) (Marked this version for translation) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
<languages/> | <languages/> | ||
<translate> | <translate> | ||
<!--T:1--> | |||
Allows you to work with icons. | Allows you to work with icons. | ||
</translate> | </translate> | ||
Line 9: | Line 10: | ||
=== AddIcon === | === AddIcon === | ||
<translate>Registers an icon.</translate> | <translate><!--T:2--> Registers an icon.</translate> | ||
==== {{Ls|MirLua/Modules/parameters}} ==== | ==== {{Ls|MirLua/Modules/parameters}} ==== | ||
Line 22: | Line 23: | ||
| style="text-align:center" | {{Ls|YesNo/yes}} | | style="text-align:center" | {{Ls|YesNo/yes}} | ||
| style="text-align:center" | <code>string</code> | | style="text-align:center" | <code>string</code> | ||
| <translate>Unique icon name.</translate> | | <translate><!--T:3--> Unique icon name.</translate> | ||
|- | |- | ||
! scope="row" class="MirLuaParametersTable-parameter" | description | ! scope="row" class="MirLuaParametersTable-parameter" | description | ||
| style="text-align:center" | {{Ls|YesNo/yes}} | | style="text-align:center" | {{Ls|YesNo/yes}} | ||
| style="text-align:center" | <code>string</code> | | style="text-align:center" | <code>string</code> | ||
| <translate>Description.</translate> | | <translate><!--T:4--> Description.</translate> | ||
|- | |- | ||
! scope="row" class="MirLuaParametersTable-parameter" | section | ! scope="row" class="MirLuaParametersTable-parameter" | section | ||
| style="text-align:center" | {{Ls|YesNo/no}} | | style="text-align:center" | {{Ls|YesNo/no}} | ||
| style="text-align:center" | <code>string</code> | | style="text-align:center" | <code>string</code> | ||
| <translate>Section name in Miranda icon settings. By default plugin name (<tvar|MirLua>MirLua</>) is used.</translate> | | <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 | ! scope="row" class="MirLuaParametersTable-parameter" | path | ||
| style="text-align:center" | {{Ls|YesNo/no}} | | style="text-align:center" | {{Ls|YesNo/no}} | ||
| style="text-align:center" | <code>string</code> | | style="text-align:center" | <code>string</code> | ||
| <translate>Default icon file to use. By default path to executable file of Miranda NG is used.</translate> | | <translate><!--T:6--> Default icon file to use. By default path to executable file of Miranda NG is used.</translate> | ||
|} | |} | ||
Line 43: | Line 44: | ||
{{nbsp|5}}{{Ls|MirLua/Modules/type}} <code>light userdata</code> | {{nbsp|5}}{{Ls|MirLua/Modules/type}} <code>light userdata</code> | ||
{{nbsp|5}}<translate>Returns icon handle if icon was registered successfully, otherwise <tvar|nil><code>nil</code></>.</translate> | {{nbsp|5}}<translate><!--T:7--> Returns icon handle if icon was registered successfully, otherwise <tvar|nil><code>nil</code></>.</translate> | ||
==== {{Ls|MirLua/Modules/example}} ==== | ==== {{Ls|MirLua/Modules/example}} ==== | ||
Line 50: | Line 51: | ||
=== GetIcon === | === GetIcon === | ||
<translate>Returns icon handle.</translate> | <translate><!--T:8--> Returns icon handle.</translate> | ||
==== {{Ls|MirLua/Modules/parameters}} ==== | ==== {{Ls|MirLua/Modules/parameters}} ==== | ||
Line 63: | Line 64: | ||
| style="text-align:center" | {{Ls|YesNo/yes}} | | style="text-align:center" | {{Ls|YesNo/yes}} | ||
| style="text-align:center" | <code>string</code> | | style="text-align:center" | <code>string</code> | ||
| <translate>Unique icon name.</translate> | | <translate><!--T:9--> Unique icon name.</translate> | ||
|} | |} | ||
==== {{Ls|MirLua/Modules/result}} ==== | ==== {{Ls|MirLua/Modules/result}} ==== | ||
{{nbsp|5}}{{Ls|MirLua/Modules/type}} <code>boolean</code> | {{nbsp|5}}{{Ls|MirLua/Modules/type}} <code>boolean</code> | ||
{{nbsp|5}}<translate>Returns icon handle if icon was found, otherwise <tvar|nil><code>nil</code></>.</translate> | |||
{{nbsp|5}}<translate><!--T:10--> Returns icon handle if icon was found, otherwise <tvar|nil><code>nil</code></>.</translate> | |||
==== {{Ls|MirLua/Modules/example}} ==== | ==== {{Ls|MirLua/Modules/example}} ==== | ||
Line 83: | Line 85: | ||
=== RemoveIcon === | === RemoveIcon === | ||
<translate>Removes an icon.</translate> | <translate><!--T:11--> Removes an icon.</translate> | ||
==== {{Ls|MirLua/Modules/parameters}} ==== | ==== {{Ls|MirLua/Modules/parameters}} ==== | ||
Line 96: | Line 98: | ||
| style="text-align:center" | {{Ls|YesNo/yes}} | | style="text-align:center" | {{Ls|YesNo/yes}} | ||
| style="text-align:center" | <code>string</code> | | style="text-align:center" | <code>string</code> | ||
| <translate>Unique icon name.</translate> | | <translate><!--T:12--> Unique icon name.</translate> | ||
|} | |} | ||
==== {{Ls|MirLua/Modules/example}} ==== | ==== {{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')