selectedChunk always empty?

2010-10-10 Thread Inselfan

Hola,

Using 4.5 
Is there a reason, why selectedChunk is always empty???

using 1 field, place the cursor there and then I klick on a button with this
script:

on mouseUp
 put the selectedChunk into tSelectedChunk 
...
end mouseup

Whatever I do, tSelectedChunk is empty. Is there any reason, Am I doing
something wrong?

hoping for a helpfull hand, I send you kind regards 

Horst
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/selectedChunk-always-empty-tp2970443p2970443.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: selectedChunk always empty?

2010-10-10 Thread stephen barncard
perhaps you haven't selected a chunk of text in a field? If your field has a
blinking cursor but no selection, that would make the selectedChunk empty,
no?

On 10 October 2010 10:21, Inselfan balearenin...@gmx.net wrote:


 Hola,

 Using 4.5
 Is there a reason, why selectedChunk is always empty???

 using 1 field, place the cursor there and then I klick on a button with
 this
 script:

 on mouseUp
 put the selectedChunk into tSelectedChunk
 ...
 end mouseup

 Whatever I do, tSelectedChunk is empty. Is there any reason, Am I doing
 something wrong?

 hoping for a helpfull hand, I send you kind regards

 Horst
 --
 View this message in context:
 http://runtime-revolution.278305.n4.nabble.com/selectedChunk-always-empty-tp2970443p2970443.html
 Sent from the Revolution - User mailing list archive at Nabble.com.
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 



Stephen Barncard
San Francisco Ca. USA

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


Re: selectedChunk always empty?

2010-10-10 Thread Inselfan

Hola Stephen,

Thanks for this, but: Yes I have a blinking cursor and YES this
(Selectedchunk) works perfect with the same text-field and another button.
It is really 1:1

Must be something else

Kind regards

Horst
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/selectedChunk-always-empty-tp2970443p2970459.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: selectedChunk always empty?

2010-10-10 Thread stephen barncard
what is it supposed to return, all of the text in the field?

On 10 October 2010 10:34, Inselfan balearenin...@gmx.net wrote:


 Hola Stephen,

 Thanks for this, but: Yes I have a blinking cursor and YES this
 (Selectedchunk) works perfect with the same text-field and another button.
 It is really 1:1

 Must be something else

 Kind regards

 Horst
 --
 View this message in context:
 http://runtime-revolution.278305.n4.nabble.com/selectedChunk-always-empty-tp2970443p2970459.html
 Sent from the Revolution - User mailing list archive at Nabble.com.
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 



Stephen Barncard
San Francisco Ca. USA

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


Re: selectedChunk always empty?

2010-10-10 Thread stephen barncard
perhaps you are defeating your selection by clicking a button or using the
message box

this works from the multi-line message box:


*select text of fld Field of card id 1002 of stack Untitled 1*

*put the selectedchunk*



if you put this into the script of a button


*on mousedown*

*  put the selectedChunk*

*end mousedown*

then the selection one makes by hand will remain and the selectedchunk will
be placed in the message box output:

char 1 to 22 of field 1

if the selection is a blinking cursor then the cursor position will be put
into the message box output:

char 23 to 22 of field 1


if neither the selection made by hand or a blinking cursor is happening,
then empty is returned:


On 10 October 2010 10:50, stephen barncard
stephenrevoluti...@barncard.comwrote:

 what is it supposed to return, all of the text in the field?


 On 10 October 2010 10:34, Inselfan balearenin...@gmx.net wrote:


 Hola Stephen,

 Thanks for this, but: Yes I have a blinking cursor and YES this
 (Selectedchunk) works perfect with the same text-field and another button.
 It is really 1:1

 Must be something else

 Kind regards

 Horst
 --
 View this message in context:
 http://runtime-revolution.278305.n4.nabble.com/selectedChunk-always-empty-tp2970443p2970459.html
 Sent from the Revolution - User mailing list archive at Nabble.com.
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




 --



 Stephen Barncard
 San Francisco Ca. USA

 more about sqb  http://www.google.com/profiles/sbarncar




-- 



Stephen Barncard
San Francisco Ca. USA

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


Re: selectedChunk always empty?

2010-10-10 Thread Ken Ray
 
 Whatever I do, tSelectedChunk is empty. Is there any reason, Am I doing
 something wrong?

Turn off the 'traversalOn' property for the button. When you click it it's
getting the focus and removing it from the field before you can get the
selectedChunk.


Ken Ray
Sons of Thunder Software, Inc.
Email: k...@sonsothunder.com
Web Site: http://www.sonsothunder.com/


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


Re: selectedChunk always empty?

2010-10-10 Thread Inselfan

Hola Stephen,

Thanks for your helping hand, but all exercises worked fine in the
message-Box but didn't in the btn. So I tried Ken's help. 

But, :( this also didn't help.

The solution was as simple: I created a new button, coppied the
Message-Box-Text and... that works.

I don't understand the miracles behind but that took me the full Sunday 

Once again, thanks Stephen and Ken

time to go to bed now (23.57 p.m.)

Horst
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/selectedChunk-always-empty-tp2970443p2970681.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: SelectedChunk

2010-10-04 Thread Warren Kuhl
Mike,

You have saved me lots of brainstorming.  This forum post should work for
what I am doing.  Thanks again!

Warren

On Mon, Sep 27, 2010 at 10:10 AM, Mike Bonner bonnm...@gmail.com wrote:

 http://forums.runrev.com/phpBB2/viewtopic.php?f=7t=3199

 Not the post I was thinking of, but some really useful stuff in that forum
 thread about whole word selections.

 On Mon, Sep 27, 2010 at 9:05 AM, Warren Kuhl warrenk...@gmail.com wrote:

  Mike,
 
  Thank you very much.  You have been most helpful!
  
  All the best!
  Warren
 
  On Mon, Sep 27, 2010 at 10:03 AM, Mike Bonner bonnm...@gmail.com
 wrote:
 
   Would have to program it, and now that i'm more awake, not sure you
 need
  to
   go through all the convoluted stuff I did.
  
   This is probably closer to what you can end up with.
   on mouseUp
 put word 2 of the selectedchunk into tChar
 put char 1 to tChar of field 1 into tTmp
 put the number of words in tTmp
   end mouseUp
  
   This will work with the exception that if your selection includes a
 space
   at
   the left the wordcount will be off by 1, so you'd have to test and
 decide
   how you want it to behave in that situation.  Will also have to test
 for
  a
   simple insertion point rather than a selection also and adjust
  accordingly.
  
  
   To force full word selections, I believe one of the Marks posted
  something
   a
   not too long ago that would do this... The gist of the script (If I
  recall
   correctly) was that when a selection is made, you check for word
  boundaries
   to the right and left and adjust the selection accordingly.
   Once you have your char positions you can set the selection.
  
   select char 5 to 12 of field yourfield
  
   I haven't actually tried the forced selection part.
  
   G'luck with all this. If I can locate the script I'm trying to
 remember,
   i'll post a link.
  
  
  
   On Mon, Sep 27, 2010 at 8:40 AM, Warren Kuhl warrenk...@gmail.com
  wrote:
  
Mike,
   
Thank you very much for this.  I really appreciate it.  Looks exactly
   like
what I was looking for.
   
You mentioned forcing only whole words.  Is this a command?  Or
  something
   I
would need to program?
   
Thanks again!
Warren
   
   
   
   
On Mon, Sep 27, 2010 at 9:21 AM, Mike Bonner bonnm...@gmail.com
  wrote:
   
 I'm positive this can be shortened, but as is should do what you
  want.
   It
 could be simplified greatly of course if you are forcing only whole
   word
 selections, but this will account for partial word selects, and
 also
   just
 an
 insertion point.
 *
 on mouseUp
   -- Determine if there is actually a selection of more than 1 char
   if word 2 of the selectedchunk - word 4 of the selectedchunk  0
  then
  put word 2 of the selectedchunk into tChar
   else
  put word 4 of the selectedchunk into tChar
   end if

   -- Determine if the selection is already on a word boundary.
   --if so determine which word the break is at.
   if char tChar of field 1 is space then
  put true into tCharMatch
  put char 1 to tChar of field 1 into tTmp
  putWord:   the number of words  in tTmp + 1 into tWord
   end if

   -- if a match hasn't been found yet, and we're not at the field
  start
   -- nudge 1 char left and check for word break. Repeat until top
 of
field
 or match
   repeat while tChar  1 and tCharMatch is empty
  subtract 1 from tChar
  if char tChar of field 1 is space then
 put true into tCharMatch
 put char 1 to tChar of field 1 into tTmp
 put Word:   the number of words in tTmp + 1 into tWord
  else if tChar = 0 then
 --if we reach the start of the field, must be the first
 word
 put Word: 1 into tWord
  end if
   end repeat

  answer information tWord
 end mouseUp*

 On Mon, Sep 27, 2010 at 7:17 AM, Warren Kuhl warrenk...@gmail.com
 
wrote:

  Is there an easy way to retrieve the word # of a field based on
 the
  SelectedChunk?  The SelectedChunk contains the start/end position
  of
   a
 word
  of a field.  Just am trying to determine which word without to
 much
  coding...if possible.
 
  Thanks for any help!
  Warren
  ___
  use-revolution mailing list
  use-revolution@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-revolution
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

Re: SelectedChunk

2010-09-28 Thread Andre.Bisseret

Bonjour,
Not sure I have well understand your need, but  does the following help:

  select word 1 to -1 of the selection -- avoid spaces (learn  
recently thanks to Jacque ;-))

   put the selection
   put cr  word 2 of the selectedChunk after msg

Best regards from Grenoble

André

Le 27 sept. 10 à 15:17, Warren Kuhl a écrit :


Is there an easy way to retrieve the word # of a field based on the
SelectedChunk?  The SelectedChunk contains the start/end position of  
a word

of a field.  Just am trying to determine which word without to much
coding...if possible.

Thanks for any help!
Warren
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution




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


SelectedChunk

2010-09-27 Thread Warren Kuhl
Is there an easy way to retrieve the word # of a field based on the
SelectedChunk?  The SelectedChunk contains the start/end position of a word
of a field.  Just am trying to determine which word without to much
coding...if possible.

Thanks for any help!
Warren
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: SelectedChunk

2010-09-27 Thread Mike Bonner
I'm positive this can be shortened, but as is should do what you want. It
could be simplified greatly of course if you are forcing only whole word
selections, but this will account for partial word selects, and also just an
insertion point.
*
on mouseUp
   -- Determine if there is actually a selection of more than 1 char
   if word 2 of the selectedchunk - word 4 of the selectedchunk  0 then
  put word 2 of the selectedchunk into tChar
   else
  put word 4 of the selectedchunk into tChar
   end if

   -- Determine if the selection is already on a word boundary.
   --if so determine which word the break is at.
   if char tChar of field 1 is space then
  put true into tCharMatch
  put char 1 to tChar of field 1 into tTmp
  putWord:   the number of words  in tTmp + 1 into tWord
   end if

   -- if a match hasn't been found yet, and we're not at the field start
   -- nudge 1 char left and check for word break. Repeat until top of field
or match
   repeat while tChar  1 and tCharMatch is empty
  subtract 1 from tChar
  if char tChar of field 1 is space then
 put true into tCharMatch
 put char 1 to tChar of field 1 into tTmp
 put Word:   the number of words in tTmp + 1 into tWord
  else if tChar = 0 then
 --if we reach the start of the field, must be the first word
 put Word: 1 into tWord
  end if
   end repeat

 answer information tWord
end mouseUp*

On Mon, Sep 27, 2010 at 7:17 AM, Warren Kuhl warrenk...@gmail.com wrote:

 Is there an easy way to retrieve the word # of a field based on the
 SelectedChunk?  The SelectedChunk contains the start/end position of a word
 of a field.  Just am trying to determine which word without to much
 coding...if possible.

 Thanks for any help!
 Warren
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

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


Re: SelectedChunk

2010-09-27 Thread Warren Kuhl
Mike,

Thank you very much for this.  I really appreciate it.  Looks exactly like
what I was looking for.

You mentioned forcing only whole words.  Is this a command?  Or something I
would need to program?

Thanks again!
Warren




On Mon, Sep 27, 2010 at 9:21 AM, Mike Bonner bonnm...@gmail.com wrote:

 I'm positive this can be shortened, but as is should do what you want. It
 could be simplified greatly of course if you are forcing only whole word
 selections, but this will account for partial word selects, and also just
 an
 insertion point.
 *
 on mouseUp
   -- Determine if there is actually a selection of more than 1 char
   if word 2 of the selectedchunk - word 4 of the selectedchunk  0 then
  put word 2 of the selectedchunk into tChar
   else
  put word 4 of the selectedchunk into tChar
   end if

   -- Determine if the selection is already on a word boundary.
   --if so determine which word the break is at.
   if char tChar of field 1 is space then
  put true into tCharMatch
  put char 1 to tChar of field 1 into tTmp
  putWord:   the number of words  in tTmp + 1 into tWord
   end if

   -- if a match hasn't been found yet, and we're not at the field start
   -- nudge 1 char left and check for word break. Repeat until top of field
 or match
   repeat while tChar  1 and tCharMatch is empty
  subtract 1 from tChar
  if char tChar of field 1 is space then
 put true into tCharMatch
 put char 1 to tChar of field 1 into tTmp
 put Word:   the number of words in tTmp + 1 into tWord
  else if tChar = 0 then
 --if we reach the start of the field, must be the first word
 put Word: 1 into tWord
  end if
   end repeat

  answer information tWord
 end mouseUp*

 On Mon, Sep 27, 2010 at 7:17 AM, Warren Kuhl warrenk...@gmail.com wrote:

  Is there an easy way to retrieve the word # of a field based on the
  SelectedChunk?  The SelectedChunk contains the start/end position of a
 word
  of a field.  Just am trying to determine which word without to much
  coding...if possible.
 
  Thanks for any help!
  Warren
  ___
  use-revolution mailing list
  use-revolution@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-revolution
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

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


Re: SelectedChunk

2010-09-27 Thread Mike Bonner
Would have to program it, and now that i'm more awake, not sure you need to
go through all the convoluted stuff I did.

This is probably closer to what you can end up with.
on mouseUp
   put word 2 of the selectedchunk into tChar
   put char 1 to tChar of field 1 into tTmp
   put the number of words in tTmp
end mouseUp

This will work with the exception that if your selection includes a space at
the left the wordcount will be off by 1, so you'd have to test and decide
how you want it to behave in that situation.  Will also have to test for a
simple insertion point rather than a selection also and adjust accordingly.


To force full word selections, I believe one of the Marks posted something a
not too long ago that would do this... The gist of the script (If I recall
correctly) was that when a selection is made, you check for word boundaries
to the right and left and adjust the selection accordingly.
Once you have your char positions you can set the selection.

select char 5 to 12 of field yourfield

I haven't actually tried the forced selection part.

G'luck with all this. If I can locate the script I'm trying to remember,
i'll post a link.



On Mon, Sep 27, 2010 at 8:40 AM, Warren Kuhl warrenk...@gmail.com wrote:

 Mike,

 Thank you very much for this.  I really appreciate it.  Looks exactly like
 what I was looking for.

 You mentioned forcing only whole words.  Is this a command?  Or something I
 would need to program?

 Thanks again!
 Warren




 On Mon, Sep 27, 2010 at 9:21 AM, Mike Bonner bonnm...@gmail.com wrote:

  I'm positive this can be shortened, but as is should do what you want. It
  could be simplified greatly of course if you are forcing only whole word
  selections, but this will account for partial word selects, and also just
  an
  insertion point.
  *
  on mouseUp
-- Determine if there is actually a selection of more than 1 char
if word 2 of the selectedchunk - word 4 of the selectedchunk  0 then
   put word 2 of the selectedchunk into tChar
else
   put word 4 of the selectedchunk into tChar
end if
 
-- Determine if the selection is already on a word boundary.
--if so determine which word the break is at.
if char tChar of field 1 is space then
   put true into tCharMatch
   put char 1 to tChar of field 1 into tTmp
   putWord:   the number of words  in tTmp + 1 into tWord
end if
 
-- if a match hasn't been found yet, and we're not at the field start
-- nudge 1 char left and check for word break. Repeat until top of
 field
  or match
repeat while tChar  1 and tCharMatch is empty
   subtract 1 from tChar
   if char tChar of field 1 is space then
  put true into tCharMatch
  put char 1 to tChar of field 1 into tTmp
  put Word:   the number of words in tTmp + 1 into tWord
   else if tChar = 0 then
  --if we reach the start of the field, must be the first word
  put Word: 1 into tWord
   end if
end repeat
 
   answer information tWord
  end mouseUp*
 
  On Mon, Sep 27, 2010 at 7:17 AM, Warren Kuhl warrenk...@gmail.com
 wrote:
 
   Is there an easy way to retrieve the word # of a field based on the
   SelectedChunk?  The SelectedChunk contains the start/end position of a
  word
   of a field.  Just am trying to determine which word without to much
   coding...if possible.
  
   Thanks for any help!
   Warren
   ___
   use-revolution mailing list
   use-revolution@lists.runrev.com
   Please visit this url to subscribe, unsubscribe and manage your
   subscription preferences:
   http://lists.runrev.com/mailman/listinfo/use-revolution
  
  ___
  use-revolution mailing list
  use-revolution@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-revolution
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

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


Re: SelectedChunk

2010-09-27 Thread Warren Kuhl
Mike,

Thank you very much.  You have been most helpful!

All the best!
Warren

On Mon, Sep 27, 2010 at 10:03 AM, Mike Bonner bonnm...@gmail.com wrote:

 Would have to program it, and now that i'm more awake, not sure you need to
 go through all the convoluted stuff I did.

 This is probably closer to what you can end up with.
 on mouseUp
   put word 2 of the selectedchunk into tChar
   put char 1 to tChar of field 1 into tTmp
   put the number of words in tTmp
 end mouseUp

 This will work with the exception that if your selection includes a space
 at
 the left the wordcount will be off by 1, so you'd have to test and decide
 how you want it to behave in that situation.  Will also have to test for a
 simple insertion point rather than a selection also and adjust accordingly.


 To force full word selections, I believe one of the Marks posted something
 a
 not too long ago that would do this... The gist of the script (If I recall
 correctly) was that when a selection is made, you check for word boundaries
 to the right and left and adjust the selection accordingly.
 Once you have your char positions you can set the selection.

 select char 5 to 12 of field yourfield

 I haven't actually tried the forced selection part.

 G'luck with all this. If I can locate the script I'm trying to remember,
 i'll post a link.



 On Mon, Sep 27, 2010 at 8:40 AM, Warren Kuhl warrenk...@gmail.com wrote:

  Mike,
 
  Thank you very much for this.  I really appreciate it.  Looks exactly
 like
  what I was looking for.
 
  You mentioned forcing only whole words.  Is this a command?  Or something
 I
  would need to program?
 
  Thanks again!
  Warren
 
 
 
 
  On Mon, Sep 27, 2010 at 9:21 AM, Mike Bonner bonnm...@gmail.com wrote:
 
   I'm positive this can be shortened, but as is should do what you want.
 It
   could be simplified greatly of course if you are forcing only whole
 word
   selections, but this will account for partial word selects, and also
 just
   an
   insertion point.
   *
   on mouseUp
 -- Determine if there is actually a selection of more than 1 char
 if word 2 of the selectedchunk - word 4 of the selectedchunk  0 then
put word 2 of the selectedchunk into tChar
 else
put word 4 of the selectedchunk into tChar
 end if
  
 -- Determine if the selection is already on a word boundary.
 --if so determine which word the break is at.
 if char tChar of field 1 is space then
put true into tCharMatch
put char 1 to tChar of field 1 into tTmp
putWord:   the number of words  in tTmp + 1 into tWord
 end if
  
 -- if a match hasn't been found yet, and we're not at the field start
 -- nudge 1 char left and check for word break. Repeat until top of
  field
   or match
 repeat while tChar  1 and tCharMatch is empty
subtract 1 from tChar
if char tChar of field 1 is space then
   put true into tCharMatch
   put char 1 to tChar of field 1 into tTmp
   put Word:   the number of words in tTmp + 1 into tWord
else if tChar = 0 then
   --if we reach the start of the field, must be the first word
   put Word: 1 into tWord
end if
 end repeat
  
answer information tWord
   end mouseUp*
  
   On Mon, Sep 27, 2010 at 7:17 AM, Warren Kuhl warrenk...@gmail.com
  wrote:
  
Is there an easy way to retrieve the word # of a field based on the
SelectedChunk?  The SelectedChunk contains the start/end position of
 a
   word
of a field.  Just am trying to determine which word without to much
coding...if possible.
   
Thanks for any help!
Warren
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
   
   ___
   use-revolution mailing list
   use-revolution@lists.runrev.com
   Please visit this url to subscribe, unsubscribe and manage your
   subscription preferences:
   http://lists.runrev.com/mailman/listinfo/use-revolution
  
  ___
  use-revolution mailing list
  use-revolution@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-revolution
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

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


Re: SelectedChunk

2010-09-27 Thread Mike Bonner
http://forums.runrev.com/phpBB2/viewtopic.php?f=7t=3199

Not the post I was thinking of, but some really useful stuff in that forum
thread about whole word selections.

On Mon, Sep 27, 2010 at 9:05 AM, Warren Kuhl warrenk...@gmail.com wrote:

 Mike,

 Thank you very much.  You have been most helpful!

 All the best!
 Warren

 On Mon, Sep 27, 2010 at 10:03 AM, Mike Bonner bonnm...@gmail.com wrote:

  Would have to program it, and now that i'm more awake, not sure you need
 to
  go through all the convoluted stuff I did.
 
  This is probably closer to what you can end up with.
  on mouseUp
put word 2 of the selectedchunk into tChar
put char 1 to tChar of field 1 into tTmp
put the number of words in tTmp
  end mouseUp
 
  This will work with the exception that if your selection includes a space
  at
  the left the wordcount will be off by 1, so you'd have to test and decide
  how you want it to behave in that situation.  Will also have to test for
 a
  simple insertion point rather than a selection also and adjust
 accordingly.
 
 
  To force full word selections, I believe one of the Marks posted
 something
  a
  not too long ago that would do this... The gist of the script (If I
 recall
  correctly) was that when a selection is made, you check for word
 boundaries
  to the right and left and adjust the selection accordingly.
  Once you have your char positions you can set the selection.
 
  select char 5 to 12 of field yourfield
 
  I haven't actually tried the forced selection part.
 
  G'luck with all this. If I can locate the script I'm trying to remember,
  i'll post a link.
 
 
 
  On Mon, Sep 27, 2010 at 8:40 AM, Warren Kuhl warrenk...@gmail.com
 wrote:
 
   Mike,
  
   Thank you very much for this.  I really appreciate it.  Looks exactly
  like
   what I was looking for.
  
   You mentioned forcing only whole words.  Is this a command?  Or
 something
  I
   would need to program?
  
   Thanks again!
   Warren
  
  
  
  
   On Mon, Sep 27, 2010 at 9:21 AM, Mike Bonner bonnm...@gmail.com
 wrote:
  
I'm positive this can be shortened, but as is should do what you
 want.
  It
could be simplified greatly of course if you are forcing only whole
  word
selections, but this will account for partial word selects, and also
  just
an
insertion point.
*
on mouseUp
  -- Determine if there is actually a selection of more than 1 char
  if word 2 of the selectedchunk - word 4 of the selectedchunk  0
 then
 put word 2 of the selectedchunk into tChar
  else
 put word 4 of the selectedchunk into tChar
  end if
   
  -- Determine if the selection is already on a word boundary.
  --if so determine which word the break is at.
  if char tChar of field 1 is space then
 put true into tCharMatch
 put char 1 to tChar of field 1 into tTmp
 putWord:   the number of words  in tTmp + 1 into tWord
  end if
   
  -- if a match hasn't been found yet, and we're not at the field
 start
  -- nudge 1 char left and check for word break. Repeat until top of
   field
or match
  repeat while tChar  1 and tCharMatch is empty
 subtract 1 from tChar
 if char tChar of field 1 is space then
put true into tCharMatch
put char 1 to tChar of field 1 into tTmp
put Word:   the number of words in tTmp + 1 into tWord
 else if tChar = 0 then
--if we reach the start of the field, must be the first word
put Word: 1 into tWord
 end if
  end repeat
   
 answer information tWord
end mouseUp*
   
On Mon, Sep 27, 2010 at 7:17 AM, Warren Kuhl warrenk...@gmail.com
   wrote:
   
 Is there an easy way to retrieve the word # of a field based on the
 SelectedChunk?  The SelectedChunk contains the start/end position
 of
  a
word
 of a field.  Just am trying to determine which word without to much
 coding...if possible.

 Thanks for any help!
 Warren
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

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

Re: SelectedChunk

2010-09-27 Thread Peter Brigham MD

The selectedChunk gives the segment of text selected, in the form

  char chartPosition to endPosition of field n

If the selection is empty (insertion point only), the result is  
something like char 5 to 4 of field 9 -- in this case to get the  
number of the word containing the insertion point, use:


  the number of words of char 1 to (word 4 of the selectedchunk) of  
field 9


If a run of text is selected then the above will get the number of the  
word containing the end of the selection.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



On Sep 27, 2010, at 9:17 AM, Warren Kuhl wrote:


Is there an easy way to retrieve the word # of a field based on the
SelectedChunk?  The SelectedChunk contains the start/end position of  
a word

of a field.  Just am trying to determine which word without to much
coding...if possible.

Thanks for any help!
Warren
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


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


Re: SelectedChunk

2010-09-27 Thread Mike Bonner
Ok thats cool.
So if its NOT just an insertion point then
the number of words of char 1 to (word 2 of the selectedchunk) of field
yourfield
will give the number of words preceeding the selection?

So this whole thing could boil down to

on mouseUp
   if word 4 of the selectedchunk  word 2 of the selectedchunk then
  put the number of words of (char 1 to (word 4 of the selectedchunk) of
field 1)
   else
  put the number of words of (char 1 to (word 2 of the selectedchunk) of
field 1)
   end if
end mouseUp

I knew I was making my solution WAY too difficult. Thanks for this.

On Mon, Sep 27, 2010 at 11:39 AM, Peter Brigham MD pmb...@gmail.com wrote:

 The selectedChunk gives the segment of text selected, in the form

  char chartPosition to endPosition of field n

 If the selection is empty (insertion point only), the result is something
 like char 5 to 4 of field 9 -- in this case to get the number of the word
 containing the insertion point, use:

  the number of words of char 1 to (word 4 of the selectedchunk) of field 9

 If a run of text is selected then the above will get the number of the word
 containing the end of the selection.

 -- Peter

 Peter M. Brigham
 pmb...@gmail.com
 http://home.comcast.net/~pmbrig http://home.comcast.net/%7Epmbrig




 On Sep 27, 2010, at 9:17 AM, Warren Kuhl wrote:

  Is there an easy way to retrieve the word # of a field based on the
 SelectedChunk?  The SelectedChunk contains the start/end position of a
 word
 of a field.  Just am trying to determine which word without to much
 coding...if possible.

 Thanks for any help!
 Warren
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution


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

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


Re: SelectedChunk

2010-09-27 Thread Mike Bonner
Nevermind. *sigh* Number of words prior to selection or insertion point is
  put the number of words of (char 1 to (word 2 of the selectedchunk) of
field 1)

Rev is far more amazing than I can make it be.  So is Livecode!

On Mon, Sep 27, 2010 at 11:50 AM, Mike Bonner bonnm...@gmail.com wrote:

 Ok thats cool.
 So if its NOT just an insertion point then
 the number of words of char 1 to (word 2 of the selectedchunk) of field
 yourfield
 will give the number of words preceeding the selection?

 So this whole thing could boil down to

 on mouseUp
if word 4 of the selectedchunk  word 2 of the selectedchunk then
   put the number of words of (char 1 to (word 4 of the selectedchunk)
 of field 1)
else
   put the number of words of (char 1 to (word 2 of the selectedchunk)
 of field 1)
end if
 end mouseUp

 I knew I was making my solution WAY too difficult. Thanks for this.

 On Mon, Sep 27, 2010 at 11:39 AM, Peter Brigham MD pmb...@gmail.comwrote:

 The selectedChunk gives the segment of text selected, in the form

  char chartPosition to endPosition of field n

 If the selection is empty (insertion point only), the result is something
 like char 5 to 4 of field 9 -- in this case to get the number of the word
 containing the insertion point, use:

  the number of words of char 1 to (word 4 of the selectedchunk) of field 9

 If a run of text is selected then the above will get the number of the
 word containing the end of the selection.

 -- Peter

 Peter M. Brigham
 pmb...@gmail.com
 http://home.comcast.net/~pmbrig http://home.comcast.net/%7Epmbrig




 On Sep 27, 2010, at 9:17 AM, Warren Kuhl wrote:

  Is there an easy way to retrieve the word # of a field based on the
 SelectedChunk?  The SelectedChunk contains the start/end position of a
 word
 of a field.  Just am trying to determine which word without to much
 coding...if possible.

 Thanks for any help!
 Warren
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution


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



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


Re: SelectedChunk

2010-09-27 Thread Peter Brigham MD
You can work out exactly what you want if you realize that the result  
of the selectedChunk is always char chartPosition to endPosition  
of field n, and this will be as you would expect if the selection is  
not empty:


ie, in this is a sample string of text in field 1, selecting the  
characters is a sample would result in a selectedchunk of char 6 to  
16 of field 1
in which case the number of words of char 1 to (word 2 of the  
selectedchunk) of field 1 would be:


the number of words of char 1 to 6 of field 1,
ie, the number of words of this i
which is 2

and if the selection is empty then indeed the selectedchunk is always  
of the form char n to n-1 of field 1:


So putting the insertion point before is in the above example would  
result in a selectedchunk of

char 6 to 5 of field 1
and therefore the number of words of char 1 to (word 2 of the  
selectedchunk) of field 1 would be


the number of words of char 1 to 5 of field 1,
ie, the number of words of this 
which is 1

On Sep 27, 2010, at 1:53 PM, Mike Bonner wrote:

Nevermind. *sigh* Number of words prior to selection or insertion  
point is
 put the number of words of (char 1 to (word 2 of the  
selectedchunk) of

field 1)

Rev is far more amazing than I can make it be.  So is Livecode!


Yes indeed. Once you get the hang of chunk expressions you can do  
*lots* of things -- auto-format phone numbers, insert boilerplate at  
particular points in a field, extract specific information from a  
field or other container, etc. I have a little function to get the zip  
code for an address by sending the address to google maps, fetching  
the htmltext of the resulting URL, parsing it to get the zip code from  
the middle of the htmltext, and returning the zip -- all behind the  
scenes without displaying the webpage. Takes less than a second with a  
fast internet connection, the zip code is inserted after the address,  
and the user never needs to know what goes on behind the scenes.


On Mon, Sep 27, 2010 at 11:50 AM, Mike Bonner bonnm...@gmail.com  
wrote:



Ok thats cool.
So if its NOT just an insertion point then
the number of words of char 1 to (word 2 of the selectedchunk) of  
field

yourfield
will give the number of words preceeding the selection?


Yes, but see above -- it would include the word that starts the  
selection.



So this whole thing could boil down to

on mouseUp
  if word 4 of the selectedchunk  word 2 of the selectedchunk then
 put the number of words of (char 1 to (word 4 of the  
selectedchunk)

of field 1)
  else
 put the number of words of (char 1 to (word 2 of the  
selectedchunk)

of field 1)
  end if
end mouseUp


Pretty much.


I knew I was making my solution WAY too difficult. Thanks for this.


No problem.

Check out the dictionary entries for not only selectedchunk but also  
offset, wordoffset, itemoffset, and related terms, then do some  
experimentation. Text parsing in Rev, er, LiveCode, is very powerful.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


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


Re: SelectedChunk problem (part 2)

2010-09-08 Thread Jean-Pierre Soto

here's the result

i][ char 2 to 1 of field 1
il][char 3 to 2 of field 1
il ][   char 4 to 3 of field 1
il m][  char 5 to 4 of field 1
il me][ char 6 to 5 of field 1
il men][char 7 to 6 of field 1
il menj][   char 8 to 7 of field 1
il menj ][  char 9 to 8 of field 1

here I go to an another paletteStack
( this palette stack use external C++ fonction, I hope that's not the  
problem)

then I come back to the field

il mn][jchar 5 to 4 of field 1
il man][j   char 6 to 5 of field 1
il manj][   char 7 to 6 of field 1
il manj ][  char 8 to 7 of field 1
il man ][   char 7 to 6 of field 1
il mang ][  char 8 to 7 of field 1
il mange ][ char 9 to 8 of field 1
il mange  ][char 10 to 9 of field 1
][il mange u
][il mange un
][il mange un


Le 1 sept. 10 à 01:50, J. Landman Gay a écrit :



On 8/28/10 12:25 PM, Jean-Pierre Soto wrote:

Hello,

I have some problem with the SelectedChunk function. It's work  
well but

sometime it return empty.

I can type character and I have the flashing insertion cursor in the
field but the result is still empty.

I must leave the field and re-enter it to have correct result.

Does anyone know that problem ?


Can you post a your script? I'm not sure what you mean about the  
result.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution



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


Re: SelectedChunk problem (part 1)

2010-09-06 Thread Jean-Pierre Soto

hello,

here's the script


on rawKeyUp k
  global readTarget,homepath
  put readTarget into tID

  -- Gestion du clavier en mode Rédaction
  if the writeEnable of tID is true then

get the selectedChunk

put it

put word 2 of it into p
put word 4 of  it into w

put isChar(numTochar(k)) into R1
put isChar(char w-1 of the text of  tID) into R2

if  R1 is false and R2 is true and k65288   then --  
65288=backspace


 ...

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


Re: SelectedChunk problem (part 2)

2010-09-06 Thread Jean-Pierre Soto

here's the result


i][ char 2 to 1 of field 1
il][char 3 to 2 of field 1
il ][   char 4 to 3 of field 1
il m][  char 5 to 4 of field 1
il me][ char 6 to 5 of field 1
il men][char 7 to 6 of field 1
il menj][   char 8 to 7 of field 1
il menj ][  char 9 to 8 of field 1

here I go to an another paletteStack
( this palette stack use external C++ fonction, I hope that's not the  
problem)
then I come back to the field 
___

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


Re: SelectedChunk problem (part 3)

2010-09-06 Thread Jean-Pierre Soto

il mn][jchar 5 to 4 of field 1
il man][j   char 6 to 5 of field 1
il manj][   char 7 to 6 of field 1
il manj ][  char 8 to 7 of field 1
il man ][   char 7 to 6 of field 1
il mang ][  char 8 to 7 of field 1
il mange ][ char 9 to 8 of field 1
il mange  ][ 			char 10 to 9 of field 1( here's the  
problem )

][il mange u
][il mange un
][il mange un


and the selectedChunk return empty until I leave the readTarget field  
and reEnter it.


Le 1 sept. 10 à 01:50, J. Landman Gay a écrit :



On 8/28/10 12:25 PM, Jean-Pierre Soto wrote:

Hello,

I have some problem with the SelectedChunk function. It's work  
well but

sometime it return empty.

I can type character and I have the flashing insertion cursor in the
field but the result is still empty.

I must leave the field and re-enter it to have correct result.

Does anyone know that problem ?


Can you post a your script? I'm not sure what you mean about the  
result.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution



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


Re: SelectedChunk problem

2010-08-31 Thread J. Landman Gay

On 8/28/10 12:25 PM, Jean-Pierre Soto wrote:

Hello,

I have some problem with the SelectedChunk function. It's work well but
sometime it return empty.

I can type character and I have the flashing insertion cursor in the
field but the result is still empty.

I must leave the field and re-enter it to have correct result.

Does anyone know that problem ?


Can you post a your script? I'm not sure what you mean about the result.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


SelectedChunk problem

2010-08-28 Thread Jean-Pierre Soto

Hello,

I have some problem with the SelectedChunk function. It's work well  
but sometime it return empty.


I can type character and I have the flashing insertion cursor in the  
field but the result is still empty.


 I must leave the field and re-enter it to have correct result.

Does anyone know that problem ?

Jean-Pierre


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


Re: selectedchunk anyone?

2007-01-18 Thread Chipp Walters

OK, no takers then..
Here's how I've decided to solve it:

(list field script)

local lSelChk

on mouseEnter
 put the selectedChunk into lSelChk
end mouseEnter


On 1/18/07, Chipp Walters [EMAIL PROTECTED] wrote:


I'm trying to figure out where the I-beam cursor sits in a field. Not
hard, check the selectedChunk. But what if AFTER I've clicked a list field?
Even with TraversalOn set to false for a list field, it still insists on
resetting the selectedChunk to it's own 'hilitedline' even though the I-beam
cursor is blinking in the other field.

Any ideas on how to tell where the I-beam cursor is in the first field? I
suppose I can 'send in time' a message to the field, but thought there must
be an easier way...

-Chipp


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


Re: selectedchunk anyone?

2007-01-18 Thread J. Landman Gay
I was going to respond but I'm not sure I understand what you are trying 
to do. But maybe this will help: you can get the selectedchunk of a 
particular field like so:


put the selectedchunk of fld 1

Is that what you mean?

Chipp Walters wrote:

OK, no takers then..
Here's how I've decided to solve it:

(list field script)

local lSelChk

on mouseEnter
 put the selectedChunk into lSelChk
end mouseEnter


On 1/18/07, Chipp Walters [EMAIL PROTECTED] wrote:


I'm trying to figure out where the I-beam cursor sits in a field. Not
hard, check the selectedChunk. But what if AFTER I've clicked a list 
field?

Even with TraversalOn set to false for a list field, it still insists on
resetting the selectedChunk to it's own 'hilitedline' even though the 
I-beam

cursor is blinking in the other field.

Any ideas on how to tell where the I-beam cursor is in the first field? I
suppose I can 'send in time' a message to the field, but thought there 
must

be an easier way...

-Chipp


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

http://lists.runrev.com/mailman/listinfo/use-revolution




--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: selectedchunk anyone?

2007-01-18 Thread Chipp Walters

Yeah, I guess I'm not being too clear here. Thanks for the tip-- I didn't
know selectedChunk was field dependant. Just what I was looking for.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


selectedchunk anyone?

2007-01-17 Thread Chipp Walters

I'm trying to figure out where the I-beam cursor sits in a field. Not hard,
check the selectedChunk. But what if AFTER I've clicked a list field? Even
with TraversalOn set to false for a list field, it still insists on
resetting the selectedChunk to it's own 'hilitedline' even though the I-beam
cursor is blinking in the other field.

Any ideas on how to tell where the I-beam cursor is in the first field? I
suppose I can 'send in time' a message to the field, but thought there must
be an easier way...

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


the selectedChunk on windows

2006-06-29 Thread Ludovic THEBAULT

Hello,

Why this work on macos X and not on windows (the selectedchunk is  
empty) :
i've a fld and a button. When i select a text on the fld and i click  
on the button i need to get the selectedchunk of the fld in the  
mouseup handler.

Work on macos x not on windows.

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


Re: the selectedChunk on windows

2006-06-29 Thread Martin Baxter

Ludovic THEBAULT wrote:

Hello,

Why this work on macos X and not on windows (the selectedchunk is empty) :
i've a fld and a button. When i select a text on the fld and i click on 
the button i need to get the selectedchunk of the fld in the mouseup 
handler.

Work on macos x not on windows.

Thanks.


On windows the button takes focus from the field. Set the traversalon of
the button to false and it should work the same on both platforms.

Martin Baxter

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


ask dialog removes selectedChunk in field

2006-03-01 Thread Garrett Hylltun

Rev 2.6.1

Greetings,

When I use the ask dialog to get some user input on changing some  
hilighted text in a field, the ask dialog removes the focus from the  
field, thus losing the ability to use the selectedChunk after the  
dialog has been dismissed.


I did not know if there was any way within any of the properties to  
stop this, such as setting traversalOn, so I put the selectedChunk  
into a variable before the ask dialog.


Other than what I have done to resolve this, is there some property  
dealing with the ask dialog that might bypass the need to record the  
selectedChunk before the ask dialog?


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


Re: ask dialog removes selectedChunk in field

2006-03-01 Thread J. Landman Gay

Garrett Hylltun wrote:

When I use the ask dialog to get some user input on changing some  
hilighted text in a field, the ask dialog removes the focus from the  
field, thus losing the ability to use the selectedChunk after the  
dialog has been dismissed.


I did not know if there was any way within any of the properties to  
stop this, such as setting traversalOn, so I put the selectedChunk  into 
a variable before the ask dialog.


Other than what I have done to resolve this, is there some property  
dealing with the ask dialog that might bypass the need to record the  
selectedChunk before the ask dialog?


I think you've solved the problem in the best way. When a dialog is 
shown, the focus is removed from the original stack and the selection is 
lost; the workaround is exactly what you've done.


--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


selectedChunk in MAC and Windows

2005-11-23 Thread paolo mazza
Referring to the selectedChunk property, I  noticed there is a different
behaviour in Mac and Windows.

Try this:
After selecting  a word in a text field  
if I  press a button with  put the selectedChunk 
in MAC it returs char 1 to 9 of field 1
in windows it returns empty

The poin is that in MAC it keeps the selection after pressing the button,
in windows no.

Is it a bug or what? I transferd exactly the same stack.

Best regards

Paolo Mazza




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


Re: selectedChunk in MAC and Windows

2005-11-23 Thread Richard Gaskin

paolo mazza wrote:

Referring to the selectedChunk property, I  noticed there is a different
behaviour in Mac and Windows.

Try this:
After selecting  a word in a text field  
if I  press a button with  put the selectedChunk 
in MAC it returs char 1 to 9 of field 1

in windows it returns empty

The poin is that in MAC it keeps the selection after pressing the button,
in windows no.

Is it a bug or what? I transferd exactly the same stack.


Windows provides navigation of all control with the keyboard.  By 
default, most button stypes of their traversalOn property set to true, 
which governs if the control can be traversed with the keyboard (most 
commonly via the Tab key).


The problem you're experiencing is that when you press the button it 
also gets keyboard focus, which takes away the focus from the field.


If you turn off the traversalOn property of the button you should be in 
good shape.


--
 Richard Gaskin
 Managing Editor, revJournal
 ___
 Rev tips, tutorials and more: http://www.revJournal.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Owner of selectedChunk?

2005-11-08 Thread Scott Rossi
Recently, [EMAIL PROTECTED]  wrote:

 How does one determine the stack that contains the field where the
 selectedChunk resides?

 Try 
 put the selectedfield...

Thanks Xavier.

Another question [I seem to recall reading about this a long time ago but
have no memory of what the answer was]:

With some text selected in a field in a top stack, is it possible to
maintain focus on/selection of the text when clicking in a palette that
contains a text field?  I'm running into the problem of focus shifting from
the text field in top stack to the text field in the palette.

Thanks  Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia  Design
-
E: [EMAIL PROTECTED]
W: http://www.tactilemedia.com

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


Re: Owner of selectedChunk?

2005-11-08 Thread xavier . bury
The trick is quite easy. I use it all the time.

For the button that you are going to click (or the owner of the button - 
grp or cd),

here's an example from my textstyleNO2 Bold button

local lselection, lstack
on mouseenter
  get the defaultstack,the topstack
  if the tool is Browse tool then
put the selectedchunk into lselection
if lselection is not empty then
  put the selectedfield into lfield
  put the topstack into lstack
  put lselection  of  lstack into lselection
end if
  else
put the selobj into lselection
  end if
end mouseenter

on mousedown
  if lselection is not empty then
if the tool is Browse tool then
  select lselection
else
  put the selobj into lselection
end if
  end if
end mousedown

on mouseUp
  if lselection is not empty
  then select lselection
 
  if the selectedchunk is empty then exit mouseup
  SetFontStyle (the short name of me), lselection
 
  set the hilite of me to (the short name of me) is in the textstyle of 
the selectedchunk
  if the hilite of me then unhilite btn Plain
  select lselection
end mouseUp




 

[EMAIL PROTECTED] wrote on 08/11/2005 09:08:26:

 Recently, [EMAIL PROTECTED]  wrote:
 
  How does one determine the stack that contains the field where the
  selectedChunk resides?
 
  Try 
  put the selectedfield...
 
 Thanks Xavier.
 
 Another question [I seem to recall reading about this a long time ago 
but
 have no memory of what the answer was]:
 
 With some text selected in a field in a top stack, is it possible to
 maintain focus on/selection of the text when clicking in a palette that
 contains a text field?  I'm running into the problem of focus shifting 
from
 the text field in top stack to the text field in the palette.
 
 Thanks  Regards,
 
 Scott Rossi
 Creative Director
 Tactile Media, Multimedia  Design
 -
 E: [EMAIL PROTECTED]
 W: http://www.tactilemedia.com
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your 
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution



-
To make communications with Clearstream easier, Clearstream has
recently changed the email address format to conform with industry
standards. The new format is '[EMAIL PROTECTED]'.

Visit us at http://www.clearstream.com

IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream
International does not accept legal responsibility for the contents of
this message.

The information contained in this e-mail is confidential and may be
legally privileged. It is intended solely for the addressee. If you are
not the intended recipient, any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. Any views expressed in this e-mail are
those of the individual sender, except where the sender specifically
states them to be the views of Clearstream International or of any of
its affiliates or subsidiaries.

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


Re: Owner of selectedChunk?

2005-11-08 Thread Trevor DeVore

On Nov 8, 2005, at 12:08 AM, Scott Rossi wrote:

With some text selected in a field in a top stack, is it possible to
maintain focus on/selection of the text when clicking in a palette  
that
contains a text field?  I'm running into the problem of focus  
shifting from

the text field in top stack to the text field in the palette.


Right now you have to script around it.  It seems there should be a  
property of a stack that would return the name of the field that has  
focus for that stack.


Here is some code I use in a library stack for tracking the last  
active field of a stack.  I like to mark the field with a light grey  
background when it is suspended and restore the background to empty  
when the stack resumes.  This code also creates two getProps that  
return the selectedChunk and selectedField for a stack.  In order for  
the library to track fields in a stack you must set the uWindow 
[Name] prop of the stack to some value.  Maybe this will help.



--
Trevor DeVore
Blue Mango Multimedia
[EMAIL PROTECTED]



local sWindowsA

/**
* When a stack is suspended we save the active field (if any) and  
hilite the

* text with a light grey.
*/
on suspendStack
local tWindowName

if the uWindow[Name] of the owner of the target is not empty then
put the uWindow[Name] of this stack into tWindowName
		if selectedField() is not empty AND exists(long id of the owner of  
selectedField()) then

put long id of the owner of selectedField() into tObj
repeat while word 1 of tObj  stack
put the owner of tObj into tObj
end repeat

			if the short name of tObj is the short name of the owner of the  
target then

put selectedChunk() into 
sWindowsA[tWindowName,activechunk]

if not the listBehavior of selectedField() then
set the backgroundColor of selectedChunk() to 
200,200,200
select empty
end if
end if
else
put empty into sWindowsA[tWindowName,activechunk]
end if
end if

pass suspendStack
end suspendStack


on resumeStack
local tWindowName

if the uWindow[Name] of the owner of the target is not empty then
put the uWindow[Name] of this stack into tWindowName

if sWindowsA[tWindowName,activechunk]   is not empty then
			set the backgroundColor of sWindowsA[tWindowName,activechunk] to  
empty

select sWindowsA[tWindowName,activechunk]
end if
end if

pass resumeStack
end resumeStack


/**
* Returns the short name of the last active field of a stack.
*
*/
getProp uStackFocusedField
local tWindowName

	if selectedField() is not empty AND exists(long id of the owner of  
selectedField()) then

put long id of the owner of selectedField() into tObj
repeat while word 1 of tObj  stack
put the owner of tObj into tObj
end repeat

if the short name of tObj is the short name of the target then
return short name of selectedField()
end if
end if

if the uWindow[Name] of the target is not empty then
put the uWindow[Name] of the target into tWindowName
if sWindowsA[tWindowName,activechunk] is not empty then
get word -2 to -1 of 
sWindowsA[tWindowName,activechunk]
return short name of it
end if
end if

return empty
end uStackFocusedField


/**
* Returns the active chunk of a stack as returned by selectedChunk().
*
*/
getProp uStackFocusedChunk
local tWindowName

	if selectedField() is not empty AND exists(long id of the owner of  
selectedField()) then

put long id of the owner of selectedField() into tObj
repeat while word 1 of tObj  stack
put the owner of tObj into tObj
end repeat

if the short name of tObj is the short name of the target then
return selectedChunk()
end if
end if

if the uWindow[Name] of the target is not empty then
put the uWindow[Name] of the target into tWindowName
if sWindowsA[tWindowName,activechunk] is not empty then
return sWindowsA[tWindowName,activechunk]
end if
end if

return empty
end uStackFocusedChunk

Owner of selectedChunk?

2005-11-07 Thread Scott Rossi
How does one determine the stack that contains the field where the
selectedChunk resides?

Thanks  Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia  Design
-
E: [EMAIL PROTECTED]
W: http://www.tactilemedia.com

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


Re: Owner of selectedChunk?

2005-11-07 Thread xavier . bury
Hi Scott

Try 
  put the selectedfield...

cheers
Xavier

[EMAIL PROTECTED] wrote on 08/11/2005 08:48:12:

 How does one determine the stack that contains the field where the
 selectedChunk resides?
 
 Thanks  Regards,
 
 Scott Rossi
 Creative Director
 Tactile Media, Multimedia  Design
 -
 E: [EMAIL PROTECTED]
 W: http://www.tactilemedia.com
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your 
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution



-
To make communications with Clearstream easier, Clearstream has
recently changed the email address format to conform with industry
standards. The new format is '[EMAIL PROTECTED]'.

Visit us at http://www.clearstream.com

IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream
International does not accept legal responsibility for the contents of
this message.

The information contained in this e-mail is confidential and may be
legally privileged. It is intended solely for the addressee. If you are
not the intended recipient, any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. Any views expressed in this e-mail are
those of the individual sender, except where the sender specifically
states them to be the views of Clearstream International or of any of
its affiliates or subsidiaries.

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


Re: SelectedChunk

2005-03-21 Thread Thomas McGrath III
selectedChunk function
Platform support:
Introduced in version 1.0
Returns a chunk expression describing the location of the text 
selection or insertion point.

the selectedChunk
selectedChunk
the selectedChunk
put the selectedChunk into storedChunk
See also: clickChunk function, foundChunk function, mouseChunk 
function, select command, selectedField function, selectedLine 
function, selectedLoc function, selectedText function, Why is the 
selected text deselected?, Why is the selection lost when clicking a 
button?

Description
Use the selectedChunk function to determine which text is selected.
Value:
The selectedChunk function returns a chunk expression of the form
  char startChar to endChar of field fieldNumber
Comments:
The return value reports the selected text: the startChar is the first 
character of the selection, and the endChar is the last character.

If no text is selected but the text insertion point is in a field, the 
startChar is the character after the insertion point, and the endChar 
is the character before the insertion point. In this case, the endChar 
is one less than the startChar.

If there is no insertion point or text selection, the selectedChunk 
function returns empty.

To get actual text that is selected, use the selectedText function.
Try
on tabKey
put the selectedChunk into foo
answer foo
end tabKey
On Mar 20, 2005, at 11:38 PM, Mikey wrote:
on tabKey
   get the selectedChunk
   answer it
end tabKey
the variable watcher reports that IT is empty.  In addition, changing
the code to
on tabKey
   put the selectedText into foo
   answer foo
end tabKey
Thomas J. McGrath III
SCS
1000 Killarney Dr.
Pittsburgh, PA 15234
412-885-8541
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


SelectedChunk

2005-03-20 Thread Mikey
Hmm.  Per previous discussion, in an attempt to determine where the
cursor was when the user hit a key (in this case a tab key), I
generated the following script for the field in question

on tabKey
   get the selectedChunk
   answer it
end tabKey

the variable watcher reports that IT is empty.  In addition, changing
the code to

on tabKey
   put the selectedText into foo
   answer foo
end tabKey

the variable watcher reports the same thing for foo.  As one would
expect, in either case the answer is empty.
-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: SelectedChunk

2005-03-20 Thread Ken Ray
On 3/20/05 10:38 PM, Mikey [EMAIL PROTECTED] wrote:

 Hmm.  Per previous discussion, in an attempt to determine where the
 cursor was when the user hit a key (in this case a tab key), I
 generated the following script for the field in question
 
 on tabKey
get the selectedChunk
answer it
 end tabKey
 
 the variable watcher reports that IT is empty.  In addition, changing
 the code to
 
 on tabKey
put the selectedText into foo
answer foo
 end tabKey
 
 the variable watcher reports the same thing for foo.  As one would
 expect, in either case the answer is empty.

As it turns out, Mikey, you picked one of the few keys that would actually
do something about changing the focus, etc. when the key is struck. Look at
tabKey as the equivalent of keyUp, meaning that it takes place *after*
the key has been struck, so it actually tabs out of the field (or at least
clears the selectedChunk) before you trap it. What you want to use is
rawKeyDown instead:

on rawKeyDown pKey
  if pKey is 65289 then  -- key code for Tab
get the selectedChunk
answer it
  end if
  pass rawKeyDown
end rawKeyDown

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [EMAIL PROTECTED]


___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: Problem with selectedChunk in Windows

2004-11-13 Thread MisterX
Can you show your script?

Usually works fine on windows but haven't tested any 2.5 compilations...

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Bruce A. Pokras
 Sent: Saturday, November 13, 2004 04:11
 To: [EMAIL PROTECTED]
 Subject: Problem with selectedChunk in Windows
 
 I have  a script that uses the selectedchunk to locate the 
 cursor in a field so that it can add some text at the cursor 
 location. This works fine in a standalone under Mac OS 9. 
 However, it totally fails in a Windows standalone.
 
 To test this out, I added an answer dialog to tell me what 
 the selectedChunk was returning. On the Mac, it gave the 
 expected char # to # of cd fld x. Under Windows, it 
 returned empty. Bugzilla showed two selectedChunk bugs, but 
 one was for Mac, only, and the other related to pasting htmlText.
 
 Anyone have a workaround?
 
 Regards,
 
 Bruce Pokras
 Blazing Dawn Software
 www.blazingdawn.com
 [EMAIL PROTECTED]
 ___
 use-revolution mailing list
 [EMAIL PROTECTED]
 http://lists.runrev.com/mailman/listinfo/use-revolution
 

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: Problem with selectedChunk in Windows

2004-11-13 Thread MisterX
Wouldn't it be wiser to do this when entering the field and reset it back
when you exit the field? This would permit both behaviors...

A guide to cross platform changes like this would be interesting. This
important information is rather dispersed across all object references in
the documentation. I hope I didn't miss something like it in the docs but
don't remember seeing it...

cheers
Xavier


 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Jan Schenkel
 Sent: Saturday, November 13, 2004 08:28
 To: How to use Revolution
 Subject: Re: Problem with selectedChunk in Windows
 
 --- Bruce A. Pokras [EMAIL PROTECTED] wrote:
  I have  a script that uses the selectedchunk to locate the 
 cursor in a 
  field so that it can add some text at the cursor location. 
 This works 
  fine in a standalone under Mac OS 9. However, it totally fails in a 
  Windows standalone.
  
  To test this out, I added an answer dialog to tell me what the 
  selectedChunk was returning. On the Mac, it gave the 
 expected char # 
  to # of cd fld x. Under Windows, it returned empty.
  Bugzilla showed
  two selectedChunk bugs, but one was for Mac, only, and the other 
  related to pasting htmlText.
  
  Anyone have a workaround?
  
  Regards,
  
  Bruce Pokras
  
 
 Hi Bruce,
 
 Your buttons probably have the 'traversalOn' property set to 
 true -- on MacOS, buttons do not receive the eyboard focus, 
 but on Windows they do : when you click on a button, the 
 previous selection is lost.
 The quick solution is to set the 'traversalOn'
 property to false for all your buttons.
 
 Hope this helped,
 
 Jan Schenkel.
 
 =
 Join us at the European Revolution Conference November 14-16, 
 MALTA. ~ http://TechieTours.com/Rev/
 
 =
 As we grow older, we grow both wiser and more foolish at the 
 same time.  (La Rochefoucauld)
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection 
 around http://mail.yahoo.com 
 ___
 use-revolution mailing list
 [EMAIL PROTECTED]
 http://lists.runrev.com/mailman/listinfo/use-revolution
 

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Problem with selectedChunk in Windows

2004-11-12 Thread Bruce A. Pokras
I have  a script that uses the selectedchunk to locate the cursor in 
a field so that it can add some text at the cursor location. This 
works fine in a standalone under Mac OS 9. However, it totally fails 
in a Windows standalone.

To test this out, I added an answer dialog to tell me what the 
selectedChunk was returning. On the Mac, it gave the expected char # 
to # of cd fld x. Under Windows, it returned empty. Bugzilla showed 
two selectedChunk bugs, but one was for Mac, only, and the other 
related to pasting htmlText.

Anyone have a workaround?
Regards,
Bruce Pokras
Blazing Dawn Software
www.blazingdawn.com
[EMAIL PROTECTED]
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Problem with selectedChunk in Windows

2004-11-12 Thread Jan Schenkel
--- Bruce A. Pokras [EMAIL PROTECTED] wrote:
 I have  a script that uses the selectedchunk to
 locate the cursor in 
 a field so that it can add some text at the cursor
 location. This 
 works fine in a standalone under Mac OS 9. However,
 it totally fails 
 in a Windows standalone.
 
 To test this out, I added an answer dialog to tell
 me what the 
 selectedChunk was returning. On the Mac, it gave the
 expected char # 
 to # of cd fld x. Under Windows, it returned empty.
 Bugzilla showed 
 two selectedChunk bugs, but one was for Mac, only,
 and the other 
 related to pasting htmlText.
 
 Anyone have a workaround?
 
 Regards,
 
 Bruce Pokras
 

Hi Bruce,

Your buttons probably have the 'traversalOn' property
set to true -- on MacOS, buttons do not receive the
eyboard focus, but on Windows they do : when you click
on a button, the previous selection is lost.
The quick solution is to set the 'traversalOn'
property to false for all your buttons.

Hope this helped,

Jan Schenkel.

=
Join us at the European Revolution Conference
November 14-16, MALTA. ~ http://TechieTours.com/Rev/

=
As we grow older, we grow both wiser and more foolish at the same time.  (La 
Rochefoucauld)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


selectedChunk under Windows

2003-09-24 Thread Kjetil Rå Hauge
Is there something special about the 
selectedChunk under Windows? I have a stack where 
the user clicks on a word (or a sequence of 
words) in a locked field, and then on a button to 
have a given handler operate on the selection. 
The problem is that the selectedChunk seems to 
get lost immediately in the Windows build (tested 
under Windows 2000). For instance, I have a 
statement to trap for no selection being made:

if the selectedChunk is empty then
   answer First click on a word to be messed around with.
   exit thisHandler
end if
This always evaluates to true, while the Mac OS X 
build behaves as expected. (And of course if I 
remove the statement, there is no result from the 
following statements that should work on the 
selectedChunk.)

The button calls a handler in the stack script, 
and I have tried putting the selectedChunk into a 
global already in the button script and 
reselecting it in the stack script, in case 
Windows releases the selection between the button 
and the handler, but with the same results. 
Suggestions are very welcome.

--
---
Kjetil Rå Hauge, U. of Oslo, PO Box 1030 Blindern, N-0315 Oslo, Norway
Tel. +47/22856710, fax +47/22854140
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: selectedChunk under Windows

2003-09-24 Thread Ken Ray
It is probably the fact that the traversalOn of the button is TRUE.
Turn it off and you should be OK. The reason is that if the traversalOn
of the button is true, the field loses its focus when you mouseDown on
the button, so when it runs the mouseUp script, nothing is currently
selected  and hence no selectedChunk.

Ken Ray
Sons of Thunder Software
Email: [EMAIL PROTECTED]
Web Site: http://www.sonsothunder.com/ 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Kjetil Rå Hauge
 Sent: Wednesday, September 24, 2003 10:30 AM
 To: [EMAIL PROTECTED]
 Subject: selectedChunk under Windows
 
 
 Is there something special about the 
 selectedChunk under Windows? I have a stack where 
 the user clicks on a word (or a sequence of 
 words) in a locked field, and then on a button to 
 have a given handler operate on the selection. 
 The problem is that the selectedChunk seems to 
 get lost immediately in the Windows build (tested 
 under Windows 2000). For instance, I have a 
 statement to trap for no selection being made:
 
 if the selectedChunk is empty then
     answer First click on a word to be messed around with.
     exit thisHandler
 end if
 
 This always evaluates to true, while the Mac OS X 
 build behaves as expected. (And of course if I 
 remove the statement, there is no result from the 
 following statements that should work on the 
 selectedChunk.)
 
 The button calls a handler in the stack script, 
 and I have tried putting the selectedChunk into a 
 global already in the button script and 
 reselecting it in the stack script, in case 
 Windows releases the selection between the button 
 and the handler, but with the same results. 
 Suggestions are very welcome.
 
 -- 
 ---
 Kjetil Rå Hauge, U. of Oslo, PO Box 1030 Blindern, N-0315 
 Oslo, Norway Tel. +47/22856710, fax +47/22854140 
 ___
 use-revolution mailing list
 [EMAIL PROTECTED] 
 http://lists.runrev.com/mailman/listinfo/use- revolution
 


___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


SelectedChunk problems with OS 9

2003-06-14 Thread Dan Soneson
I have constructed a small keyboard stack with buttons with 
international characters. When entering text into a field in a stack a 
user can call up this keyboard stack as a palette. When the user 
clicks on one of these buttons that international character is inserted 
into the field of the toplevel stack at the point of the cursor. The 
user can then continue entering text into the field.

The stack is called from a button script. Here is the relevant portion

on callUpKeyboard

 global gMyStack

  put the name of this stack into gMyStack -- needed for the keyboard 
to set the topstack

-- some code here to configure the buttons for the appropriate language

  palette stack keyboard

end callUpKeyboard

Then in the key group of the keyboard stack there is this script:

on mouseUp
  global gmyStack
  topLevel stack gMyStack
  put the label of the target into myChar
  put mychar into the selectedChunk
end mouseUp
This works like a charm in OSX, rev 2.01. However, in OS 9, I 
constantly get an error message, indicating it can't find the 
selectedChunk. I am unable to insert the character at the cursor point 
in the field in the main stack. However, I can replace a character in 
the field in the main stack if I actually select it. So, by typing 
horen in the field, selecting the o and clicking on my button in the 
keyboard palette that is an o with an umlaut, I can get the umlaut in 
the proper place. But I still need to click in the field to continue 
typing.

Is this a problem with the way Rev works in OS 9? Are my handlers 
problematic?

thanks,
Dan
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: selectedchunk

2002-01-17 Thread Ken Norris (dialup)

on 1/15/02 11:14 AM, bmmeili at [EMAIL PROTECTED] wrote:

 hi
 I've still got a problem with the selectedchunk-function.
 
 The following test-script works properly and I get the wished
 chunk-description.
 
 on mouseup
 select word random(50) of field 1
 put the selectedchunk
 end mouseup
 
 But, if I select a word in field 1 myself and then press the button with the
 script
 
 on mouseup
 put the selectedchunk
 end mouseup
 
 Š then I only get an empty message-box. In Rev. 1.0 the whole thing
 works fine.
 
 I already tried to get an answer to this problem from the use-rev-lists, but
 nobody answered.
 
 Isn't there really anybody out there who can help me?
--
Try:

put the selection

Best regards,
Ken N.

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



selectedchunk

2002-01-08 Thread bmmeili

I've got a problem with the selectedchunk-function.


In Revolution 1.0 the following handler works fine whereas it doesn't work
neither in Revolution 1.1. nor in Revolution 1.1.1.

on mouseup
put the selectedchunk  -- some text is marked in a card field
end mouseup

Is there somebody who can give me some advice?

Martin

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution