Hi Rodger

this works for me

if you are going with formatedRect to get to the left and right it is easier
but you would have to find the fudge factors for that.

make a button "indic" and change the script to reflect your table field

local sMyTable
on mouseUp
   put "field" && quote & "myTable" & quote into sMyTable
   myTable 1, 2, 6
end mouseUp

on MyTable pRow, pColumn, pLinesForIndicator
   put the left of sMyTable into tLeft
   put the top of sMyTable into tTop
   put the borderWidth of sMyTable into tBorderWidth
   put the leftMargin of sMyTable into tLeftMargin
   put tBorderWidth + tLeftMargin - 2 into tLeftFudge
   put the effective textHeight of sMyTable into tLineHeight
   put the tabWidths of sMyTable into tTabWidths
   put the number of items of tTabWidths into tWidthItems
   if tWidthItems = 1 then
      put item 1 of tTabWidths into tIndicWidth
      put (tTabWidths * (pColumn - 1)) into tLeftOfIndicator
      if tWidthItems <  pColumn then
         put item - 1 of tTabWidths into tIndicWidth
         put sum(tTabWidths) + ((pColumn - 1 - tWidthItems) * tIndicWidth) 
into tLeftOfIndicator
      end if
      if tWidthItems >= pColumn then
         put (item  pColumn - 1 of tTabWidths * (pColumn - 1))  into
         put item pColumn of tTabWidths into tIndicWidth
      end if
   end if
   if pColumn > 1 then 
      add tLeftFudge to tLeftOfIndicator
      subtract the hScroll of sMyTable from tLeftOfIndicator
      add tLeftFudge to tIndicWidth
   end if
   put item 2 of the formattedRect of item pColumn of line pRow of sMyTable
into tTopIndicator
   put item 4 of the formattedRect of item pColumn of line pRow
+pLinesForIndicator - 1 of sMyTable into tBotIndicator
   lock screen
   set the width of btn "indic" to tIndicWidth
   set the height of btn "indic" to tBotIndicator - tTopIndicator
   set the left of btn "indic" to tLeft + tLeftOfIndicator
   set the top of btn "indic" to tTopIndicator
   unlock screen
end MyTable

Kind regards

View this message in context: 
Sent from the Revolution - User mailing list archive at Nabble.com.

use-livecode mailing list
Please visit this url to subscribe, unsubscribe and manage your subscription 

Reply via email to