View Single Post
10-18-14, 10:00 AM   #1
shurshik
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 31
EditBox:SetText doesn't show MultiLine correctly

Hello!
I need some help..

I didn't find a way to fix it with a patch.

I have an EditBox (b) in the ScrollFrame (a):

Code:
a = CreateFrame("ScrollFrame", "a", myFRAME, "UIPanelScrollFrameTemplate")
a:SetPoint("TOPLEFT", myFRAME, "TOPLEFT", 20, -80)
a:SetHeight(280)
a:SetWidth(695)

b = CreateFrame("EditBox", "b", a)
b:SetPoint("TOPRIGHT", a, "TOPRIGHT", 0, 0)
b:SetPoint("TOPLEFT", a, "TOPLEFT", 0, 0)
b:SetPoint("BOTTOMRIGHT", a, "BOTTOMRIGHT", 0, 0)
b:SetPoint("BOTTOMLEFT", a, "BOTTOMLEFT", 0, 0)
b:SetScript("onescapepressed", function(self) b:ClearFocus() end)
b:SetFont(GameFontNormal:GetFont(), psfontsset[2])
b:SetMultiLine()
b:SetAutoFocus(false)
b:SetHeight(655)
b:SetWidth(695)
b:Show()
b:SetText(" ")

a:SetScrollChild(b)
a:Show()
If I insert Multiline text, example: b:SetText("Test Line 1 tata\r\nTest Line 2 lala")
I see only "Test Line 2 lala".

But if I click Ctrl+A and copy the selected text - there is the first line too. What it can be?

I see only the last line and sometimes not the whole line, just it's end, example:
/script b:SetText("Test Line 1 tdsfsdf dfd data\r\nTest Line 2 > fdsf dfdfsdf lala")
I see: t Line 2 > fdsf dfdfsdf lala

It was changed something for special characters?