Re: positioning graphics in relation to a line in a text field

2013-04-02 Thread Michael Doub
I must be missing something.  selectedLoc gets you the upper left corner.  
FormattedHeight will allow computation of the lowerLeft.   How do you get the 
right side?

-= Mike



On Apr 1, 2013, at 4:57 PM, Richard Gaskin ambassa...@fourthworld.com wrote:

 Curt Ford wrote:
 
 My client's project has long text fields, in which are a number of separate 
 lines that, in the original Word files, had boxes around them. The box 
 style in LiveCode is too tight around the text for their taste, so I've been 
 creating graphic rectangles and positioning them by hand.
 
 An issue has come up where wrapping is inconsistent on different systems 
 running XP; when the wrapping changes, the positioning of the graphics over 
 the text is wrong.
 
 Is there a  way to position the graphics in relation to a given line in a 
 field on the fly?
 
 A combination of the selectedLoc and formattedHeight functions should allow 
 you to derive a rect.
 
 --
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 Follow me on Twitter:  http://twitter.com/FourthWorldSys
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-02 Thread Mark Wieder
Michael-

Tuesday, April 2, 2013, 6:52:57 AM, you wrote:

 I must be missing something.  selectedLoc gets you the upper left
 corner.  FormattedHeight will allow computation of the lowerLeft.  
 How do you get the right side?

The formattedWidth of the longest line plus the left.

-- 
-Mark Wieder
 mwie...@ahsoftware.net


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-02 Thread Devin Asay

On Apr 2, 2013, at 7:52 AM, Michael Doub wrote:

 I must be missing something.  selectedLoc gets you the upper left corner.  
 FormattedHeight will allow computation of the lowerLeft.   How do you get the 
 right side?

[Slaps forehead.] Now I remember what I was trying to remember in my first 
post. Try using the formattedRect of the chunk of text. That will even take 
into account the scroll of the field.

Devin


 On Apr 1, 2013, at 4:57 PM, Richard Gaskin ambassa...@fourthworld.com wrote:
 
 Curt Ford wrote:
 
 My client's project has long text fields, in which are a number of separate 
 lines that, in the original Word files, had boxes around them. The box 
 style in LiveCode is too tight around the text for their taste, so I've 
 been creating graphic rectangles and positioning them by hand.
 
 An issue has come up where wrapping is inconsistent on different systems 
 running XP; when the wrapping changes, the positioning of the graphics over 
 the text is wrong.
 
 Is there a  way to position the graphics in relation to a given line in a 
 field on the fly?
 
 A combination of the selectedLoc and formattedHeight functions should allow 
 you to derive a rect.
 
 --
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 Follow me on Twitter:  http://twitter.com/FourthWorldSys
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

Devin Asay
Office of Digital Humanities
Brigham Young University


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-02 Thread Michael Doub
Thanks Mark.   I think it is going to be one of those days that I might as well 
stop looking for the forest or the trees.

-= Mike


On Apr 2, 2013, at 11:01 AM, Mark Wieder mwie...@ahsoftware.net wrote:

 Michael-
 
 Tuesday, April 2, 2013, 6:52:57 AM, you wrote:
 
 I must be missing something.  selectedLoc gets you the upper left
 corner.  FormattedHeight will allow computation of the lowerLeft.  
 How do you get the right side?
 
 The formattedWidth of the longest line plus the left.
 
 -- 
 -Mark Wieder
 mwie...@ahsoftware.net
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-02 Thread Thomas McGrath III
This works really well for me and it will handle multiple selected word on 
different lines etc. I had a grc that was a dashed box:

on mouseUp
 put the formattedRect of the selectedChunk into tRect
 put 4 into tMargin
 put item 1 of tRect - tMargin into item 1 of tRect
 put item 3 of tRect + tMargin + 3 into item 3 of tRect
 put item 4 of tRect + tMargin into item 4 of tRect
 set the rect of graphic Box to tRect
end mouseUp

-- Tom McGrath III
http://lazyriver.on-rev.com
mcgra...@mac.com

On Apr 2, 2013, at 11:24 AM, Michael Doub miked...@gmail.com wrote:

 Thanks Mark.   I think it is going to be one of those days that I might as 
 well stop looking for the forest or the trees.
 
 -= Mike
 
 
 On Apr 2, 2013, at 11:01 AM, Mark Wieder mwie...@ahsoftware.net wrote:
 
 Michael-
 
 Tuesday, April 2, 2013, 6:52:57 AM, you wrote:
 
 I must be missing something.  selectedLoc gets you the upper left
 corner.  FormattedHeight will allow computation of the lowerLeft.  
 How do you get the right side?
 
 The formattedWidth of the longest line plus the left.
 
 -- 
 -Mark Wieder
 mwie...@ahsoftware.net
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-02 Thread Michael Doub
Thanks Tom.  Mark, what are some of the complications that you mentioned about 
scrolling fields?   I am thinking about trying to emulate the little IOS 
selection handles. 

I can see going from the selection to find a location to put the pin graphic, 
but I am not quite sure how to modify the selection to track the pin movement.  

-= Mike


On Apr 2, 2013, at 12:42 PM, Thomas McGrath III mcgra...@mac.com wrote:

 This works really well for me and it will handle multiple selected word on 
 different lines etc. I had a grc that was a dashed box:
 
 on mouseUp
 put the formattedRect of the selectedChunk into tRect
 put 4 into tMargin
 put item 1 of tRect - tMargin into item 1 of tRect
 put item 3 of tRect + tMargin + 3 into item 3 of tRect
 put item 4 of tRect + tMargin into item 4 of tRect
 set the rect of graphic Box to tRect
 end mouseUp
 
 -- Tom McGrath III
 http://lazyriver.on-rev.com
 mcgra...@mac.com
 
 On Apr 2, 2013, at 11:24 AM, Michael Doub miked...@gmail.com wrote:
 
 Thanks Mark.   I think it is going to be one of those days that I might as 
 well stop looking for the forest or the trees.
 
 -= Mike
 
 
 On Apr 2, 2013, at 11:01 AM, Mark Wieder mwie...@ahsoftware.net wrote:
 
 Michael-
 
 Tuesday, April 2, 2013, 6:52:57 AM, you wrote:
 
 I must be missing something.  selectedLoc gets you the upper left
 corner.  FormattedHeight will allow computation of the lowerLeft.  
 How do you get the right side?
 
 The formattedWidth of the longest line plus the left.
 
 -- 
 -Mark Wieder
 mwie...@ahsoftware.net
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your 
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-02 Thread Peter Haworth
Michael,
I missed the beginning of this thread so not 100% sure of what you're
trying to achieve but have you considered  - set the imagesource of char x
of line y of field xyz to 1234?  That makes the image appear at the
specified location and it scrolls along with everything else.  You may also
have to use the textshift property of the same char to align the image
vertically.
Pete
lcSQL Software http://www.lcsql.com


On Tue, Apr 2, 2013 at 10:53 AM, Michael Doub miked...@gmail.com wrote:

 Thanks Tom.  Mark, what are some of the complications that you mentioned
 about scrolling fields?   I am thinking about trying to emulate the little
 IOS selection handles.

 I can see going from the selection to find a location to put the pin
 graphic, but I am not quite sure how to modify the selection to track the
 pin movement.

 -= Mike


 On Apr 2, 2013, at 12:42 PM, Thomas McGrath III mcgra...@mac.com wrote:

  This works really well for me and it will handle multiple selected word
 on different lines etc. I had a grc that was a dashed box:
 
  on mouseUp
  put the formattedRect of the selectedChunk into tRect
  put 4 into tMargin
  put item 1 of tRect - tMargin into item 1 of tRect
  put item 3 of tRect + tMargin + 3 into item 3 of tRect
  put item 4 of tRect + tMargin into item 4 of tRect
  set the rect of graphic Box to tRect
  end mouseUp
 
  -- Tom McGrath III
  http://lazyriver.on-rev.com
  mcgra...@mac.com
 
  On Apr 2, 2013, at 11:24 AM, Michael Doub miked...@gmail.com wrote:
 
  Thanks Mark.   I think it is going to be one of those days that I might
 as well stop looking for the forest or the trees.
 
  -= Mike
 
 
  On Apr 2, 2013, at 11:01 AM, Mark Wieder mwie...@ahsoftware.net
 wrote:
 
  Michael-
 
  Tuesday, April 2, 2013, 6:52:57 AM, you wrote:
 
  I must be missing something.  selectedLoc gets you the upper left
  corner.  FormattedHeight will allow computation of the lowerLeft.
  How do you get the right side?
 
  The formattedWidth of the longest line plus the left.
 
  --
  -Mark Wieder
  mwie...@ahsoftware.net
 
 
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode


 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-02 Thread stephen barncard
imagesource replaces a text character with a graphic.

The OP wanted a square with transparency to surround a word or phrase in a
text field that looks better than the built in function.


On Tue, Apr 2, 2013 at 11:43 AM, Peter Haworth p...@lcsql.com wrote:

 Michael,
 I missed the beginning of this thread so not 100% sure of what you're
 trying to achieve but have you considered  - set the imagesource of char x
 of line y of field xyz to 1234?  That makes the image appear at the
 specified location and it scrolls along with everything else.  You may also
 have to use the textshift property of the same char to align the image
 vertically.
 Pete
 lcSQL Software http://www.lcsql.com


 On Tue, Apr 2, 2013 at 10:53 AM, Michael Doub miked...@gmail.com wrote:

  Thanks Tom.  Mark, what are some of the complications that you mentioned
  about scrolling fields?   I am thinking about trying to emulate the
 little
  IOS selection handles.
 
  I can see going from the selection to find a location to put the pin
  graphic, but I am not quite sure how to modify the selection to track the
  pin movement.
 
  -= Mike
 
 
  On Apr 2, 2013, at 12:42 PM, Thomas McGrath III mcgra...@mac.com
 wrote:
 
   This works really well for me and it will handle multiple selected word
  on different lines etc. I had a grc that was a dashed box:
  
   on mouseUp
   put the formattedRect of the selectedChunk into tRect
   put 4 into tMargin
   put item 1 of tRect - tMargin into item 1 of tRect
   put item 3 of tRect + tMargin + 3 into item 3 of tRect
   put item 4 of tRect + tMargin into item 4 of tRect
   set the rect of graphic Box to tRect
   end mouseUp
  
   -- Tom McGrath III
   http://lazyriver.on-rev.com
   mcgra...@mac.com
  
   On Apr 2, 2013, at 11:24 AM, Michael Doub miked...@gmail.com wrote:
  
   Thanks Mark.   I think it is going to be one of those days that I
 might
  as well stop looking for the forest or the trees.
  
   -= Mike
  
  
   On Apr 2, 2013, at 11:01 AM, Mark Wieder mwie...@ahsoftware.net
  wrote:
  
   Michael-
  
   Tuesday, April 2, 2013, 6:52:57 AM, you wrote:
  
   I must be missing something.  selectedLoc gets you the upper left
   corner.  FormattedHeight will allow computation of the lowerLeft.
   How do you get the right side?
  
   The formattedWidth of the longest line plus the left.
  
   --
   -Mark Wieder
   mwie...@ahsoftware.net
  
  
   ___
   use-livecode mailing list
   use-livecode@lists.runrev.com
   Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
   http://lists.runrev.com/mailman/listinfo/use-livecode
  
  
   ___
   use-livecode mailing list
   use-livecode@lists.runrev.com
   Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
   http://lists.runrev.com/mailman/listinfo/use-livecode
  
   ___
   use-livecode mailing list
   use-livecode@lists.runrev.com
   Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
   http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode




-- 



Stephen Barncard
San Francisco Ca. USA

more about sqb  http://www.google.com/profiles/sbarncar
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-02 Thread Peter Haworth
Ok, thanks stephen, as I said I missed the beginning of this thread.
Pete
lcSQL Software http://www.lcsql.com


On Tue, Apr 2, 2013 at 11:46 AM, stephen barncard 
stephenrevoluti...@barncard.com wrote:

 imagesource replaces a text character with a graphic.

 The OP wanted a square with transparency to surround a word or phrase in a
 text field that looks better than the built in function.


 On Tue, Apr 2, 2013 at 11:43 AM, Peter Haworth p...@lcsql.com wrote:

  Michael,
  I missed the beginning of this thread so not 100% sure of what you're
  trying to achieve but have you considered  - set the imagesource of char
 x
  of line y of field xyz to 1234?  That makes the image appear at the
  specified location and it scrolls along with everything else.  You may
 also
  have to use the textshift property of the same char to align the image
  vertically.
  Pete
  lcSQL Software http://www.lcsql.com
 
 
  On Tue, Apr 2, 2013 at 10:53 AM, Michael Doub miked...@gmail.com
 wrote:
 
   Thanks Tom.  Mark, what are some of the complications that you
 mentioned
   about scrolling fields?   I am thinking about trying to emulate the
  little
   IOS selection handles.
  
   I can see going from the selection to find a location to put the pin
   graphic, but I am not quite sure how to modify the selection to track
 the
   pin movement.
  
   -= Mike
  
  
   On Apr 2, 2013, at 12:42 PM, Thomas McGrath III mcgra...@mac.com
  wrote:
  
This works really well for me and it will handle multiple selected
 word
   on different lines etc. I had a grc that was a dashed box:
   
on mouseUp
put the formattedRect of the selectedChunk into tRect
put 4 into tMargin
put item 1 of tRect - tMargin into item 1 of tRect
put item 3 of tRect + tMargin + 3 into item 3 of tRect
put item 4 of tRect + tMargin into item 4 of tRect
set the rect of graphic Box to tRect
end mouseUp
   
-- Tom McGrath III
http://lazyriver.on-rev.com
mcgra...@mac.com
   
On Apr 2, 2013, at 11:24 AM, Michael Doub miked...@gmail.com
 wrote:
   
Thanks Mark.   I think it is going to be one of those days that I
  might
   as well stop looking for the forest or the trees.
   
-= Mike
   
   
On Apr 2, 2013, at 11:01 AM, Mark Wieder mwie...@ahsoftware.net
   wrote:
   
Michael-
   
Tuesday, April 2, 2013, 6:52:57 AM, you wrote:
   
I must be missing something.  selectedLoc gets you the upper left
corner.  FormattedHeight will allow computation of the lowerLeft.
How do you get the right side?
   
The formattedWidth of the longest line plus the left.
   
--
-Mark Wieder
mwie...@ahsoftware.net
   
   
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
   subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
   
   
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
   subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
   
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
   subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
  
  
   ___
   use-livecode mailing list
   use-livecode@lists.runrev.com
   Please visit this url to subscribe, unsubscribe and manage your
   subscription preferences:
   http://lists.runrev.com/mailman/listinfo/use-livecode
  
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 



 --



 Stephen Barncard
 San Francisco Ca. USA

 more about sqb  http://www.google.com/profiles/sbarncar
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-02 Thread Mark Wieder
Michael Doub mikedoub@... writes:

 Thanks Tom.  Mark, what are some of the complications

Don't know about iOS, maybe there are other things to take care of, but in
general you have to catch all the scrollbar events: scrollbarDrag,
scrollbarLineInc, scrollbarLineDec, scrollbarPageInc, scrollbarPageDec, and
change the location of the graphic accordingly. And if the field is editable you
also have to handle the up-arrow, down-arrow keys. And account for the fact that
the user can insert and delete lines.

-- 
 Mark Wieder
 mwie...@ahsoftware.net





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-02 Thread Mark Wieder
oh... and don't forget to copy the graphic at the borders of the field.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-02 Thread Michael Doub
Thanks Mark and Tom for your advice.

The original question was how to create a graphic around some selected text.  I 
think that has be answered.   

I diverted the thread a bit to almost the opposite.  I want to have two 
graphics (one at the beginning and one at the end of the selected text) control 
the selection text.  I see how to position the graphics at the edge of the text 
as the starting point.   And I know how to get the location of the graphics.  
What I don't know is how to make the selection of the text be changed based on  
a new rect created from the graphics locations.

-= Mike

 
On Apr 2, 2013, at 5:51 PM, Mark Wieder mwie...@ahsoftware.net wrote:

 oh... and don't forget to copy the graphic at the borders of the field.
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-02 Thread Mark Wieder
Mark Wieder mwieder@... writes:

 you have to catch all the scrollbar events: scrollbarDrag,
 scrollbarLineInc, scrollbarLineDec, scrollbarPageInc, scrollbarPageDec

Ack! Correcting myself... scrollbarDrag handles all those messages as long as
there aren't other handlers for them.

-- 
 Mark Wieder
 mwie...@ahsoftware.net


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-02 Thread Mark Wieder
Thomas McGrath III mcgrath3@... writes:

  put the formattedRect of the selectedChunk into tRect

Thanks for the pointer to formattedRect. As long as you can specify the chunk
this works great (minus the scrolling complications).

-- 
 Mark Wieder
 mwie...@ahsoftware.net



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


positioning graphics in relation to a line in a text field

2013-04-01 Thread Curt Ford
My client's project has long text fields, in which are a number of separate 
lines that, in the original Word files, had boxes around them. The box style 
in LiveCode is too tight around the text for their taste, so I've been creating 
graphic rectangles and positioning them by hand.

An issue has come up where wrapping is inconsistent on different systems 
running XP; when the wrapping changes, the positioning of the graphics over the 
text is wrong.

Is there a  way to position the graphics in relation to a given line in a field 
on the fly?


Curt




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-01 Thread Devin Asay
On Apr 1, 2013, at 2:26 PM, Curt Ford wrote:

 My client's project has long text fields, in which are a number of separate 
 lines that, in the original Word files, had boxes around them. The box 
 style in LiveCode is too tight around the text for their taste, so I've been 
 creating graphic rectangles and positioning them by hand.
 
 An issue has come up where wrapping is inconsistent on different systems 
 running XP; when the wrapping changes, the positioning of the graphics over 
 the text is wrong.
 
 Is there a  way to position the graphics in relation to a given line in a 
 field on the fly?


Curt,

Would the selectedRect of a text chunk do what you want? I could imagine 
locking the screen, getting the selectedRect, drawing the box based on that, 
then unlocking the screen.

Devin


Devin Asay
Office of Digital Humanities
Brigham Young University


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-01 Thread Mark Wieder
Devin Asay devin_asay@... writes:

 Would the selectedRect of a text chunk do what you want?

Yeah, wouldn't that be nice?
Is there an enhancement request for this? Right now it's a bit of a complicated
algorithm, and requires a fixed line height in a field.

-- 
 Mark Wieder
 mwie...@ahsoftware.net




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-01 Thread Richard Gaskin

Curt Ford wrote:


My client's project has long text fields, in which are a number of separate lines that, 
in the original Word files, had boxes around them. The box style in LiveCode 
is too tight around the text for their taste, so I've been creating graphic rectangles 
and positioning them by hand.

An issue has come up where wrapping is inconsistent on different systems 
running XP; when the wrapping changes, the positioning of the graphics over the 
text is wrong.

Is there a  way to position the graphics in relation to a given line in a field 
on the fly?


A combination of the selectedLoc and formattedHeight functions should 
allow you to derive a rect.


--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 Follow me on Twitter:  http://twitter.com/FourthWorldSys

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-01 Thread Devin Asay

On Apr 1, 2013, at 2:47 PM, Mark Wieder wrote:

 Devin Asay devin_asay@... writes:
 
 Would the selectedRect of a text chunk do what you want?
 
 Yeah, wouldn't that be nice?
 Is there an enhancement request for this? Right now it's a bit of a 
 complicated
 algorithm, and requires a fixed line height in a field.

Wow, I must have hallucinated the existence of this property, or projected my 
intense desire onto reality. I guess I was thinking of the selectedLoc, which 
only gives you the top left corner of the text selection. Still, you can use 
this information to derive a rectangle, subject to the complications Mark 
mentions.

No more making things up from my malleable memory!

Devin


Devin Asay
Office of Digital Humanities
Brigham Young University


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


re: positioning graphics in relation to a line in a text field

2013-04-01 Thread Curt Ford
Ah, this is getting me pretty close:

   select line 3 of fld Field2
   set the left of graphic Rectangle to item 1 of the selectedLoc - 10
   set the top of graphic Rectangle to item 2 of the selectedLoc - 10
   select empty

And checking the formattedHeight of the selectedLine will let me adjust the 
size of the rectangle in accordance with any length or wrapping issues of the 
line to box up.

Thanks everyone!

Curt


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-01 Thread Mark Wieder
Curt Ford cford@... writes:

 
 Ah, this is getting me pretty close:
 
select line 3 of fld Field2
set the left of graphic Rectangle to item 1 of the selectedLoc - 10
set the top of graphic Rectangle to item 2 of the selectedLoc - 10
select empty
 
 And checking the formattedHeight of the selectedLine will let me adjust the
size of the rectangle in
 accordance with any length or wrapping issues of the line to box up.

Don't forget to adjust for scrolling as well.
And it gets slightly more complicated if you select multiple lines.

-- 
 Mark Wieder
 mwie...@ahsoftware.net




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: positioning graphics in relation to a line in a text field

2013-04-01 Thread Geoff Canyon
On Mon, Apr 1, 2013 at 5:31 PM, Mark Wieder mwie...@ahsoftware.net wrote:

 Don't forget to adjust for scrolling as well.
 And it gets slightly more complicated if you select multiple lines.



To simplify this I'd use a non-scrolling text field in a scrolling group
with the field (sized to fit all the content) and rects in it. As long as
the user is using the scrollbar(s) this is easy. If the user will
drag-select text then this becomes more difficult.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode