Thread Tools Display Modes
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?
 
10-18-14, 10:09 AM   #2
TOM_RUS
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 95
Try b:SetMultiLine(true) may be?
 
10-18-14, 10:10 AM   #3
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Have you tried SetMultiline(true)?
 
10-18-14, 10:11 AM   #4
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Does b:SetMultiLine(true) fix your problem?
 
10-18-14, 10:15 AM   #5
shurshik
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 31
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
 
10-18-14, 10:38 AM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
 

WoWInterface » Site Forums » Archived Beta Forums » WoD Beta archived threads » EditBox:SetText doesn't show MultiLine correctly

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off