panel.GetPanelInfo

LuaFAR 3

panel.GetPanelInfo


tPanelInfo = panel.GetPanelInfo (handle, whatpanel)

Parameters:
  handle:    panel handle, or nil
  whatpanel: 1=active panel; 0=passive panel;

Returns:
  tPanelInfo: table, or nil
    fields of tPanelInfo:
      OwnerGuid:           string
      PluginHandle:        userdata, or nil
      PanelType:           integer
      PanelRect:           table (fields: left, top, right, bottom)
      ItemsNumber:         integer
      SelectedItemsNumber: integer
      CurrentItem:         1-based integer
      TopPanelItem:        1-based integer
      ViewMode:            integer
      SortMode:            integer
      Flags:               flags
      PluginObject:        non-false Lua value

Note 1:
  The PluginHandle field has a method:
  PluginHandle:rawhandle()
    returns the original value of handle received from Far Manager
    that is suitable for using with LuaJIT FFI and as a table key.

Note 2:
  The PluginObject field is LuaFAR-specific. It is only present if OwnerGuid==PluginGuid,
  i.e. when panel.GetPanelInfo was called from the same plugin that created the panel.
  The intended use of this field is when a panel plugin processes macro calls for operations
  on an already opened panel.

Far API used:
  PanelControl, FCTL_GETPANELINFO, PanelInfo