ISDBApplication::RegisterIcon: Difference between revisions

From MediaMonkey Wiki
Jump to navigation Jump to search
No edit summary
 
mNo edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
==[[SDBApplication#ISDBApplication_members|ISDBApplication]]::RegisterIcon==
{{MethodDeclaration|SDBApplication|ISDBApplication|Function RegisterIcon(Filename As String, IconType As Long) As Long}}


''Function RegisterIcon(Filename As String, IconType As Long) As Long''
===Parameters===


===Parameters===
{{MethodParameters
|Filename |String |The .ico file from which the icon is loaded. The path can be relative to MediaMonkey main folder.
|IconType |Long |Either 0 (Menu icon) or 1 (Tree icon).}}


{{MethodParameters
|Filename |String |The .ico file from which the icon is loaded. The path can be relative to MediaMonkey main folder.
|IconType |Long |Either 0(Menu icon) or 1(Tree icon).}}
===Method description===
===Method description===


Adds an icon that can be later used either in menu (SDBMenuItem.IconIndex) or in tree (SDBTreeNode.IconIndex).
Adds an icon that can be later used either in menu ([[ISDBMenuItem::IconIndex]]) or in tree ([[ISDBTreeNode::IconIndex]]).
===Example code===
 
Returns a positive integer that is used as an identification of the icon. Return -1 if any problem occurs.
 
===Example code===                  
<source lang="vb">Set Node = Tree.CreateNode
<source lang="vb">Set Node = Tree.CreateNode
Node.Caption = "My Node"
Node.Caption = "My Node"
Node.IconIndex = SDB.RegisterIcon( "Scripts\Icons\new_node_icon", 1)</source>
Node.IconIndex = SDB.RegisterIcon( "Scripts\Icons\new_node_icon.ico", 1)</source>


[[Category:Scripting|{{PAGENAME}}]]
[[Category:Scripting|{{PAGENAME}}]]

Latest revision as of 19:44, 7 May 2007

CoClass SDBApplication, Interface ISDBApplication

Function RegisterIcon(Filename As String, IconType As Long) As Long


Parameters

Name Type Description
Filename String The .ico file from which the icon is loaded. The path can be relative to MediaMonkey main folder.
IconType Long Either 0 (Menu icon) or 1 (Tree icon).


Method description

Adds an icon that can be later used either in menu (ISDBMenuItem::IconIndex) or in tree (ISDBTreeNode::IconIndex).

Returns a positive integer that is used as an identification of the icon. Return -1 if any problem occurs.

Example code

Set Node = Tree.CreateNode
Node.Caption = "My Node"
Node.IconIndex = SDB.RegisterIcon( "Scripts\Icons\new_node_icon.ico", 1)