Reply
Thread Tools Display Modes
Unread 01-26-12, 02:32 PM   #1
Melampus
Zombie
 
Melampus's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 2
Rift addon using wordwrap

I am a bit confused. I am using an addon that reads from a datafile, and displays that information onto the screen. I am attempting to insert that data into columns.
Rift addons cut the text after the column length is reached by default.
Is there a way to use the wordwrap command to spice the text and display it below the original text with out doing this manually for each piece of information? Or even using the wordwrap command to tell me where the text needs to be spliced?


ie

read x from file

x is too large for display in column y by 10 characters

->use wordwrap to display the additional 10 characters on line 2 of column y

all I have found is that I can use a string read command and manually read each character of the datafile - then compute that into the columns
Melampus is offline   Reply With Quote
Unread 01-27-12, 08:55 PM   #2
jca
Zombie
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 3
The Text:SetWordwrap() function is what you're looking for I think.
jca is offline   Reply With Quote
Unread 01-27-12, 09:11 PM   #3
algritz
Claw of Regulos
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 11
out of curiosity, what add-on are you using ?
algritz is offline   Reply With Quote
Unread 01-30-12, 08:03 PM   #4
Melampus
Zombie
 
Melampus's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 2
Wordwrap usage

It's for Guild Crafting Helper.

I add that segment, however it does not seem to work for me. The text still truncates on the single line... Here is the code I have so far

Code:
--- This segment reads from the fields from a datafile
--- If you notice ... I added a second 'null' line to make sure I could see any new text on the next line

if t[i].mType == (value1) and t[i].slot == (value2) then
			pid = pid.."\n".."\n"..t[i].id
			pmaker = pmaker.."\n".."\n"..t[i].maker
			pname = pname.."\n".."\n"..t[i].name
			pskill = pskill.."\n".."\n"..t[i].skill
			pslot = pslot.."\n".."\n"..(string.sub(t[i].slot, 5))
			pstatname = pstatname.."\n".."\n"..t[i].statname
			pmType = pmType.."\n".."\n"..t[i].mType
			i = i + 1
			end

				end
	--	return
	
	window.item1:SetText(pname)
	wordwrap = window.item1:GetWordwrap()
	window.item1:SetWordwrap(wordwrap)
	window.item2:SetText(pskill)
	wordwrap = window.item2:GetWordwrap()
	window.item2:SetWordwrap(wordwrap)
	window.item3:SetText(pslot)
	wordwrap = window.item3:GetWordwrap()
	window.item3:SetWordwrap(wordwrap)

	-------- Get the wordwrap status and use it for multiple makers	

	window.item4:SetText(pstatname)
	wordwrap = window.item4:GetWordwrap()
	window.item4:SetWordwrap(wordwrap)
	------- Is there another way to use this? I tried to use it window.item4:SetWordwrap(pstatname)...that crated an error

             window.item5:SetText(pmaker)
	wordwrap = window.item5:GetWordwrap()
	window.item5:SetWordwrap(wordwrap)

I have a feeling that I am just not calling it to set the flag correctly.
Melampus is offline   Reply With Quote
Unread 01-31-12, 04:19 PM   #5
Myrroddin
Endless Captain
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 50
:GetWordwrap returns the values of true or false. SetWordwrap(true) to enable, or SetWordwrap(false) to disable.
Code:
window.item1:SetText(pname)
window.item1:SetWordwrap(true)
window.item2:SetText(pskill)
window.item2:SetWordwrap(true)
Myrroddin is offline   Reply With Quote
Reply

Go BackRiftui » AddOns, Layouts and Macros » Help/Support » Rift addon using wordwrap

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