Hi again Roger,

Below a version easier to understand I have commented and slightly modified :-)
The single parameter is the short name of the field.

on SetTabStops pFld
  local tNumOfLines,tNumOfItems = 0,tTabStopsList
  constant kPixelsAdded = 10 -- adjust this value as wanted
  ----- intialization:
-- number of columns (works even if the number of items is not the same in all lines)
  set the itemDel to tab
  repeat for each line tLine in fld pFld
    put max(the number of items of tLine,tNumOfItems) into tNumOfItems
  end repeat
  put the number of lines of fld pFld into tNumOfLines
  -- creating variables (as many as columns):
  repeat with i = 0 to tNumOfItems
    do "put 0 into r" & i
  end repeat
  ----- getting the wider item for each column:
  repeat with i = 1 to tNumOfLines
    repeat with j = 1 to tNumOfItems
set the htmlText of fld "Template" to the htmlText of item j of line i of fld pFld do "put max(r" & j & comma & "the formattedWidth of line 1 of fld" && quote & "Template" & quote & ") + kPixelsAdded into r" & j
    end repeat
  end repeat
  ----- building the right values (ts2 = ts1 + ts2, etc.):
  repeat with i = tNumOfItems down to 2
    repeat with j = i down to 2
      do "add r" & j - 1 && "to r" & i
    end repeat
  end repeat
  ----- building the tab stops list:
  repeat with i = 1 to tNumOfItems
    do "put r" & i && "after tTabStopsList"
    put comma after tTabStopsList
  end repeat
  put 10000 after tTabStopsList
  -- to throw away the last vertical bar if vertical bars are displayed
  set the tabstops of fld pFld to tTabStopsList
end SetTabStops

Le 13 janv. 06 à 16:41, [EMAIL PROTECTED] a écrit :

I need a table field to auto-resize to fit the tab-delimited content. What is a good method for growing/shrinking the tabStops to fit the longest
text of each item of a field?

Best Regards from Paris,
Eric Chatonet
------------------------------------------------------------------------ ----------------------
http://www.sosmartsoftware.com/    [EMAIL PROTECTED]/


_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to