Difference between revisions of "ISDBIniFile::Apply"

From MediaMonkey Wiki
Jump to: navigation, search
 
 
Line 9: Line 9:
 
===Example code===  
 
===Example code===  
  
This example adds "Enable Tooltips" submenu items, so 'Edit -> Enable Tooltips' enables track tooltips (if were disabled)
+
This example adds "Enable Tooltips" submenu items, so 'Tools -> Enable Tooltips' enables track tooltips (if were disabled)
  
 
<source lang="vb">
 
<source lang="vb">
Line 17: Line 17:
 
     Dim oMenuItem
 
     Dim oMenuItem
  
     Set oMenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
+
     Set oMenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Tools, 0, 0)
 
     oMenuItem.Caption = "Enable Tooltips"
 
     oMenuItem.Caption = "Enable Tooltips"
 
     oMenuItem.UseScript = Script.ScriptPath
 
     oMenuItem.UseScript = Script.ScriptPath

Latest revision as of 15:06, 28 January 2011

CoClass SDBIniFile, Interface ISDBIniFile

Sub Apply


Method description

Applies all changes made to the ini file. This way you can change internal MediaMonkey variables and thus change its behaviour on-the-fly without a need to restart MediaMonkey.

Introduced in MediaMonkey 4.0

Example code

This example adds "Enable Tooltips" submenu items, so 'Tools -> Enable Tooltips' enables track tooltips (if were disabled)

Option Explicit

Sub OnStartup()
    Dim oMenuItem

    Set oMenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Tools, 0, 0)
    oMenuItem.Caption = "Enable Tooltips"
    oMenuItem.UseScript = Script.ScriptPath
    oMenuItem.OnClickFunc = "ShowTrackToolTip"
End Sub

Sub ShowTrackToolTip(oItem) 
    Dim inif
    Set inif = SDB.IniFile
    inif.BoolValue( "Appearance","ShowTrackToolTip") = true 
    inif.BoolValue( "Appearance","ShowTrackToolTipAll") = true
    inif.Apply
End Sub

(change myIniFile to whatever else of course)