Geo's Troublesome EditBox

-- START OF OPTIONS WINDOW

local AddOnHelpFrame = CreateFrame("Frame")
AddOnHelpFrame.name = "AddOn Help"

-- Name and Version

local lblTitle = AddOnHelpFrame:CreateFontString(nil, nil, "GameFontHighlight")
lblTitle:SetPoint("TOPLEFT", AddOnHelpFrame, "TOPLEFT", 12, -12)
lblTitle:SetText("|cFF00FF00AddOn Help v" .. GetAddOnMetadata("AddOnHelp", "Version") .. " - Command List|r")

-- Command List

local txtCommandList = CreateFrame("EditBox", nil, AddOnHelpFrame, "InputBoxTemplate")
txtCommandList:ClearAllPoints()
txtCommandList:SetPoint("TOPLEFT", lblTitle, "TOPLEFT", 8, -72)
txtCommandList:SetPoint("BOTTOMLEFT", lblTitle, "BOTTOMLEFT", 8, -72)
txtCommandList:SetAutoFocus(false)
txtCommandList:SetWidth(540)
txtCommandList:SetHeight(600)
txtCommandList:SetMaxLetters(10000)
txtCommandList:SetMultiLine(true)
txtCommandList:Show()

-- Test Button 1

local btnTestOne = CreateFrame("Button", nil, AddOnHelpFrame, "UIPanelButtonTemplate")
btnTestOne:SetSize(128,32)
btnTestOne:SetPoint("TOPLEFT", lblTitle, "BOTTOMLEFT", 0, -16)
btnTestOne:SetScript("OnClick", function(frame)
	txtCommandList:SetText("Test #1 completed successfully!")
end)
btnTestOne:SetText("Test One")

-- Test Button 2

local btnTestTwo = CreateFrame("Button", nil, AddOnHelpFrame, "UIPanelButtonTemplate")
btnTestTwo:SetSize(128,32)
btnTestTwo:SetPoint("LEFT", btnTestOne, "RIGHT", 16, 0)
btnTestTwo:SetScript("OnClick", function(frame) 
	txtCommandList:SetText("Test #2 completed successfully!\nAdditional line entered.\nAdditional line entered.\nAdditional line entered.\nAdditional line entered.\nAdditional line entered.\nAdditional line entered.\nAdditional line entered.\nAdditional line entered.\nAdditional line entered.\nAdditional line entered.")
end)
btnTestTwo:SetText("Test Two")

InterfaceOptions_AddCategory(AddOnHelpFrame)

-- END OF OPTIONS FRAME
  • Expires: Never
  • Author: GeodesicDragon
  • Created: Mar 31, 2021
  • Edited: Mar 31, 2021
  • Language: Lua

Reply to Paste

A live preview will appear here...