Originally Posted by Fizzlemizz
If it's just for Copy/Paste the scrollbar will be pretty useless when they can just CTRL-A/CTRL-C. You can probably hide the bar.
StaticPopup is using the size of the frame you passed it and the scrollbar is another frame attached to the right hand side of it in the creation of the UIPanelScrollFrameTemplate.
|
Right, I ended up doing it like this:
Lua Code:
local scrollBoxWidth = 400
local scrollBoxHeight = 120
local outerFrame = CreateFrame("Frame")
outerFrame:SetSize(scrollBoxWidth + 80, scrollBoxHeight + 20)
local borderFrame = CreateFrame("Frame", nil, outerFrame, "TooltipBackdropTemplate")
borderFrame:SetSize(scrollBoxWidth + 34, scrollBoxHeight + 10)
borderFrame:SetPoint("CENTER")
local scrollFrame = CreateFrame("ScrollFrame", nil, outerFrame, "UIPanelScrollFrameTemplate")
scrollFrame:SetPoint("CENTER", -10, 0)
scrollFrame:SetSize(scrollBoxWidth, scrollBoxHeight)
local editbox = CreateFrame("EditBox", nil, scrollFrame, "InputBoxScriptTemplate")
editbox:SetMultiLine(true)
editbox:SetAutoFocus(false)
editbox:SetFontObject(ChatFontNormal)
editbox:SetWidth(scrollBoxWidth)
editbox:SetText("test\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\n")
editbox:SetCursorPosition(0)
scrollFrame:SetScrollChild(editbox)
StaticPopupDialogs["MY_TEST"] = {
text = "Test",
button1 = "OK",
}
local dialog = StaticPopup_Show("MY_TEST", nil, nil, nil, outerFrame)
Thanks again!