WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   WoD Beta archived threads (https://www.wowinterface.com/forums/forumdisplay.php?f=151)
-   -   EditBox:SetText doesn't show MultiLine correctly (https://www.wowinterface.com/forums/showthread.php?t=50172)

shurshik 10-18-14 10:00 AM

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?

TOM_RUS 10-18-14 10:09 AM

Try b:SetMultiLine(true) may be?

semlar 10-18-14 10:10 AM

Have you tried SetMultiline(true)?

Duugu 10-18-14 10:11 AM

Does b:SetMultiLine(true) fix your problem?

shurshik 10-18-14 10:15 AM

Thank you!

Yes, it was MultiLine... I spent 4 hours to find a problem, I've never passed true before as a parameter, so now I've to check other functions and add "true" eveywhere

Phanx 10-18-14 10:38 AM

Not all methods require an argument. For example, :Show() and :Hide() not take any arguments. Technically you can pass them arguments anyway, but they're just ignored.

Find your widget type here to get a list of all its methods and what arguments they need:
http://wowprogramming.com/docs/widgets


All times are GMT -6. The time now is 10:47 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI