Lua Code:
LAM = LibStub("LibAddonMenu-1.0")
panelID = LAM:CreateControlPanel(controlPanelID, controlPanelName) --required
header = LAM:AddHeader(panelID, controlName, text) --each panel must have at last one header
slider = LAM:AddSlider(panelID, controlName, text, tooltip, minValue, maxValue, step, getFunc, setFunc, warning, warningText)
dropdown = LAM:AddDropdown(panelID, controlName, text, tooltip, validChoices, getFunc, setFunc, warning, warningText)
checkbox = LAM:AddCheckbox(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
colorpicker = LAM:AddColorPicker(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
editbox = LAM:AddEditBox(panelID, controlName, text, tooltip, isMultiLine, getFunc, setFunc, warning, warningText)
button = LAM:AddButton(panelID, controlName, text, tooltip, onClick, warning, warningText)
description = LAM:AddDescription(panelID, controlName, text, titleText)
submenu = LAM:AddSubMenu(panelID, controlName, text, tooltip)
--return value panelID is an index (number) stored in _G[controlPanelID]
--return value from all other functions is the control itself
--argument panelID is either panelID (type "number") or submenu (type "userdata")
--all warnings are optional and can be omitted