Namespace: window | Spider Monkey Panel

## window

Functions for working with the current SMP panel and accessing it's properties.

### Members

#### static DlgCode
`js/foo_spider_monkey_panel.js`, `line 1652`

  Indicates which keys should be processed by the panel.
  See https://docs.microsoft.com/en-us/windows/desktop/dlgbox/wm-getdlgcode for more info.

  ##### Example

      window.DlgCode = DLGC_WANTALLKEYS;

#### static, readonly Height :number
`js/foo_spider_monkey_panel.js`, `line 1694`

#### static, readonly ID :number
`js/foo_spider_monkey_panel.js`, `line 1661`

  Required in multiple methods such as fb.GetClipboardContents, utils.ColourPicker, utils.GetAlbumArtAsync, utils.InputBox, utils.LoadImageAsync and etc.

#### static, readonly InstanceType :number
`js/foo_spider_monkey_panel.js`, `line 1672`

  You need this to determine which GetFontXXX and GetColourXXX methods to use, assuming you want to support both interfaces.
  0 - if using Columns UI
  1 - if using default UI.

#### static, readonly IsTransparent :boolean
`js/foo_spider_monkey_panel.js`, `line 1682`

  Only useful within Panel Stack Splitter (Columns UI component)
  Depends on setting inside Spider Monkey Panel Configuration window. You generally use it to determine whether or not to draw a background.

#### static, readonly IsVisible :boolean
`js/foo_spider_monkey_panel.js`, `line 1688`

#### static MaxHeight :number
`js/foo_spider_monkey_panel.js`, `line 1702`

  window.MaxHeight, window.MaxWidth, window.MinHeight and window.MinWidth can be used to lock the panel size.
  Do not use if panels are contained within Panel Stack Splitter (Columns UI component).

#### static MaxWidth :number
`js/foo_spider_monkey_panel.js`, `line 1709`

  See window.MaxHeight.

#### static, readonly MemoryLimit :number
`js/foo_spider_monkey_panel.js`, `line 1718`

  Maximum allowed memory usage for the component (in bytes).
  If the total memory usage exceeds this value, all panels will fail with OOM error.

#### static MinHeight :number
`js/foo_spider_monkey_panel.js`, `line 1725`

  See window.MaxHeight.

#### static MinWidth :number
`js/foo_spider_monkey_panel.js`, `line 1732`

  See window.MaxHeight.

#### static, readonly Name :string
`js/foo_spider_monkey_panel.js`, `line 1741`

  Returns the author set in window.DefinePanel. If it isn't present, the GUID of the panel is returned.

#### static, readonly PanelMemoryUsage :number
`js/foo_spider_monkey_panel.js`, `line 1749`

  Memory usage of the current panel (in bytes).

#### static, readonly Tooltip :FbTooltip
`js/foo_spider_monkey_panel.js`, `line 1757`

  Get associated tooltip object.

#### static, readonly TotalMemoryUsage :number
`js/foo_spider_monkey_panel.js`, `line 1765`

  Total memory usage of all panels (in bytes).

#### static, readonly Width :number
`js/foo_spider_monkey_panel.js`, `line 1771`

### Methods

#### static ClearInterval(timerID)
`js/foo_spider_monkey_panel.js`, `line 1785`

  See clearInterval.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `timerID` | number |

#### static ClearTimeout(timerID)
`js/foo_spider_monkey_panel.js`, `line 1778`

  See clearTimeout.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `timerID` | number |

#### static CreatePopupMenu() → {MenuObject}
`js/foo_spider_monkey_panel.js`, `line 1807`

  ##### Returns:

  MenuObject

  ##### Example

      // See `samples/basic/MainMenuManager All-In-One.js`, `samples/basic/Menu Sample.js`

#### static CreateThemeManager(class_id) → {ThemeManager}
`js/foo_spider_monkey_panel.js`, `line 1816`

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `class_id` | string | https://docs.microsoft.com/en-us/windows/win32/controls/parts-and-states

  ##### Returns:

  ThemeManager

  ##### Example

      // See `samples/basic/SimpleThemedButton.js`

#### static CreateTooltip(font_nameopt, font_size_pxopt, font_styleopt) → {FbTooltip}
`js/foo_spider_monkey_panel.js`, `line 1831`

  Note: a single panel can have only a single tooltip object. Creating a new tooltip will replace the previous one. Deprecated: use fb.Tooltip and FbTooltip.SetFont instead.

  ##### Parameters:

  Name | Type | Attributes | Default | Description
  --- | --- | --- | --- | ---
  `font_name` | string | <optional> | 'Segoe UI' |
  `font_size_px` | number | <optional> | 12 |
  `font_style` | number | <optional> | 0 | See Flags.js > FontStyle

  ##### Returns:

  FbTooltip
  Deprecated:
    - Yes

#### static DefinePanel(name, optionsopt)
`js/foo_spider_monkey_panel.js`, `line 1799`

  Setups the panel information and available features.
  Can be called only once, so it's better to define it directly in the panel Configure menu.

  ##### Parameters:

  Name | Type | Attributes | Default | Description
  --- | --- | --- | --- | ---
  `name` | string |  |  | Displayed panel name

  `options`

  object

  <optional>

  {}

  ###### Properties

  Name | Type | Attributes | Default | Description
  --- | --- | --- | --- | ---
  `author` | string | <optional> | '' | Script author
  `version` | string | <optional> | '' | Script version

  `features`

  object

  <optional>

  Additional script features

  ###### Properties

  Name | Type | Attributes | Default | Description
  --- | --- | --- | --- | ---
  `drag_n_drop` | boolean | <optional> | false | Indicates if drag_n_drop functionality should be enabled

#### static GetColourCUI(type, client_guidopt) → {number}
`js/foo_spider_monkey_panel.js`, `line 1838`

  ##### Parameters:

  Name | Type | Attributes | Description
  --- | --- | --- | ---
  `type` | number |  | See Flags.js > Used in window.GetColourXXX()
  `client_guid` | string | <optional> | See Flags.js > Used in GetColourCUI() as client_guid.

  ##### Returns:

  number - returns black colour if the requested one is not available.

#### static GetColourDUI(type) → {number}
`js/foo_spider_monkey_panel.js`, `line 1844`

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `type` | number |

  ##### Returns:

  number - returns black colour if the requested one is not available.

#### static GetFontCUI(type, client_guidopt) → nullable {GdiFont}
`js/foo_spider_monkey_panel.js`, `line 1853`

  Note: see the example in window.GetFontDUI.

  ##### Parameters:

  Name | Type | Attributes | Description
  --- | --- | --- | ---
  `type` | number |  | See Flags.js > Used in window.GetFontXXX()
  `client_guid` | string | <optional> | See Flags.js > Used in GetFontCUI() as client_guid.

  ##### Returns:

  GdiFont - returns null if the requested font was not found.

#### static GetFontDUI(type) → nullable {GdiFont}
`js/foo_spider_monkey_panel.js`, `line 1868`

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `type` | number | See Flags.js > Used in window.GetFontXXX()

  ##### Returns:

  GdiFont - returns null if the requested font was not found.

  ##### Example

      // To avoid errors when trying to use the font or access its properties, you
      // should use code something like this...
      let font = window.GetFontDUI(0);
      if (!font) {
         console.log("Unable to determine your default font. Using Segoe UI instead.");
         font = gdi.Font("Segoe UI", 12);
      }

#### static GetProperty(name, default_valopt) → {*}
`js/foo_spider_monkey_panel.js`, `line 1881`

  Get value of property.
  If property does not exist and default_val is not undefined and not null, it will be created with the value of default_val.
  Note: leading and trailing whitespace are removed from property name.

  ##### Parameters:

  Name | Type | Attributes | Description
  --- | --- | --- | ---
  `name` | string |  |
  `default_val` | * | <optional> |

  ##### Returns:

  *

#### static NotifyOthers(name, info)
`js/foo_spider_monkey_panel.js`, `line 1889`

  This will trigger on_notify_data(name, info) in other panels.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `name` | string |
  `info` | * |

#### static Reload()
`js/foo_spider_monkey_panel.js`, `line 1895`

  Reload panel.

#### static Repaint(forceopt)
`js/foo_spider_monkey_panel.js`, `line 1904`

  Performance note: don't force the repaint unless it's really necessary - repaint calls might be grouped up when *not forced* which will turn them into a single repaint call, thus reducing the amount of on_paint calls.

  ##### Parameters:

  Name | Type | Attributes | Default | Description
  --- | --- | --- | --- | ---
  `force` | boolean | <optional> | false | If true, will repaint immediately, otherwise a repaint task will be *scheduled*.

#### static RepaintRect(x, y, w, h, forceopt)
`js/foo_spider_monkey_panel.js`, `line 1919`

  Repaints a part of the screen.
  Use this instead of window.Repaint on frequently updated areas such as time, bitrate, seekbar, etc.
  Performance note: see Performance note in window.Repaint.

  ##### Parameters:

  Name | Type | Attributes | Default | Description
  --- | --- | --- | --- | ---
  `x` | number |  |  |
  `y` | number |  |  |
  `w` | number |  |  |
  `h` | number |  |  |
  `force` | boolean | <optional> | false | If true, will repaint immediately, otherwise a repaint task will be *scheduled*.

#### static SetCursor(id)
`js/foo_spider_monkey_panel.js`, `line 1927`

  This would usually be used inside the on_mouse_move callback.
  Use -1 if you want to hide the cursor.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `id` | number | See Flags.js > Used in window.SetCursor()

#### static SetInterval(func, delay) → {number}
`js/foo_spider_monkey_panel.js`, `line 1937`

  See setInterval.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `func` | function |
  `delay` | number |

  ##### Returns:

  number

#### static SetProperty(name, valopt)
`js/foo_spider_monkey_panel.js`, `line 1950`

  Set property value.
  Property will be removed, if val is undefined or null.
  Property values are saved per panel instance and are remembered between foobar2000 restarts.
  Note: leading and trailing whitespace are removed from property name.

  ##### Parameters:

  Name | Type | Attributes | Description
  --- | --- | --- | ---
  `name` | string |  |
  `val` | * | <optional> |

#### static SetTimeout(func, delay) → {number}
`js/foo_spider_monkey_panel.js`, `line 1960`

  See setTimeout.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `func` | function |
  `delay` | number |

  ##### Returns:

  number

#### static ShowConfigure()
`js/foo_spider_monkey_panel.js`, `line 1966`

  Show configuration window of current panel

#### static ShowProperties()
`js/foo_spider_monkey_panel.js`, `line 1972`

  Show properties window of current panel