word wrap with tabbed field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
word wrap with tabbed field
im using a tabbed field to have two items side by side. an item and a price. It was working well until i had an incident where the 1st tabbed part was too long so obviously the 2nd tabbed area is pushed across. is there any way to make the 1st part word wrap inside its area?
Re: word wrap with tabbed field
For wrapping you could use a dataGrid.
Staying with a simple field you could simply HIDE the overlong part of tab-item 1:
Of course you can also measure each first tab-item with formattedWidth and set item 1 of the tabStops to the max.
And
shows again the item with its full length.
The color of the grid is set by the borderColor of the field.
Staying with a simple field you could simply HIDE the overlong part of tab-item 1:
Code: Select all
set tabStops of fld 1 to "70,42"
set vgrid of fld 1 to true
And
Code: Select all
set vgrid of fld 1 to false
The color of the grid is set by the borderColor of the field.
shiftLock happens
Re: word wrap with tabbed field
for some reason i hate data grid and have mind blocked myself from learning it grrr. also what im doing is printing a recipt. so when the receipt is being created it lists all items tabbed with its cost next to it. if the item is too long in name the price is forced off the side of the receipt.
Re: word wrap with tabbed field
You could break overlong items by script.
If you put CR & "..." after char x of such an item, say after char 12 if length(item) > 16, this generates a line with an empty price entry before the overlong item.
Disadvantage: Sorting requires more work.
[You could replace CR & "..." with an unusual char for sorting and revert this after sorting.]
If you put CR & "..." after char x of such an item, say after char 12 if length(item) > 16, this generates a line with an empty price entry before the overlong item.
Disadvantage: Sorting requires more work.
[You could replace CR & "..." with an unusual char for sorting and revert this after sorting.]
shiftLock happens
Re: word wrap with tabbed field
hmmm. if i cr the 1st item. then tab the next item (the price)... the price would line up to the 2nd line of the cr. i think you have something there. ill test it tonight and get back to this
AND A BIG SHOUT OUT TO LIVECODE
i have been teaching my 12 year old class programming and we have made a small game in it in our class. (just in case anyone big reads this)
AND A BIG SHOUT OUT TO LIVECODE
i have been teaching my 12 year old class programming and we have made a small game in it in our class. (just in case anyone big reads this)
Re: word wrap with tabbed field
has the same problem, i have been able to get it to work, i just don't understand howfor some reason i hate data grid and have mind blocked myself from learning it grrr. also what im doing is printing a recipt. so when the receipt is being created it lists all items tabbed with its cost next to it. if the item is too long in name the price is forced off the side of the receipt.


have a little database whit a tabbed field, and a grid, but the code is not really great, its a start for a summer project for me. maybe thats helps
nb, do have one codeline in stack, the rest of code is in the buttons.
- Attachments
-
- friendbase01.zip
- (6.01 KiB) Downloaded 198 times
Re: word wrap with tabbed field
The file you posted was empty. This was my solution to the problem
Code: Select all
function linetoolong theinputline thelinewidth
create fld "ytesteroni"
set width of fld "testlength" to thelinewidth
set the dontWrap of fld "ytesteroni" to true
put 1 into myyadvan
put theinputline into th1
put the number of words of th1 into fullnumber
put empty into oldline
repeat for fullnumber times
set the text of fld "testlength" to oldline
if the formattedWidth of fld "testlength" >= the width of fld "testlength" then
put word -1 of oldline into reword
delete word -1 of oldline
put cr & reword & space & word myyadvan of th1 & space after oldline
else
put word myyadvan of th1 & space after oldline
end if
add 1 to myyadvan
end repeat
delete fld "testlength"
return oldline
end linetoolong
Re: word wrap with tabbed field
thats strange, did download it, and it worked here.The file you posted was empty. This was my solution to the problem
but think we are talking about 2 different things? it was more a comment about the datagrid thing :-/