Re: How to insert text at cursor position?

2010-04-28 Thread Claus Dreischer
Thanks Jacqueline,

that's exactly what i was looking for.
For reference, this is what i have working now:


In the field:

global g_selection

on mousedown theMouse
   put the selectedchunk into g_selection
   popup button bt_popup
end mousedown



in the popup button bt_popup:

global g_selection

on menuPick pItemName
   select g_selection

   switch pItemName
  case Non Breaking Space
 put nbsp; after the selection
 break
  case Line Break
 put br after the selection
 break
   end switch
end menuPick



Am 27.04.10 21:49, schrieb J. Landman Gay:
 Claus Dreischer wrote:
 The problem was here was indeed the hilite.
 Putting
 put hello world into the selection
 or
 put hello world after the selection
 in a button works.

 Putting one of the above into a popup button doen't work.

 So, is there a way to somehow store the selection before it get lost?
 Can i insert text into a field from a popup button?
 
 You have a couple of choices. The easiest is to just turn off
 auto-hilite and substitute your own handlers. On mousedown, hilite the
 button, on mouseUp and mouseRelease, unhilite it.
 
 The second way is to use a local script variable to store the
 selectedchunk. When the button is released, reselect the stored chunk:
 
 local sStoredChunk
 
 on mouseDown
  put the selectedchunk into sStoredChunk
 end mouseDown
 
 on mouseUp
  select sStoredChunk
 end mouseUp
 
 on mouseRelease
  select sStoredChunk
 end mouseRelease
 
___
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: How to insert text at cursor position?

2010-04-27 Thread Claus Dreischer
The problem was here was indeed the hilite.
Putting
put hello world into the selection
or
put hello world after the selection
in a button works.

Putting one of the above into a popup button doen't work.

So, is there a way to somehow store the selection before it get lost?
Can i insert text into a field from a popup button?


Regards,
Claus.


Am 26.04.10 21:59, schrieb J. Landman Gay:
 Both work, I'm not sure why the first one didn't for the OP. It works
 here. Perhaps his button had auto-hilite set to true, which steals the
 selection.
 
 Joe Lewis Wilkins wrote:
 Actually, I find this very disturbing, since either of these
 expressions/commands would work in HyperCard; consequently, being very
 simple as they are, they should both work in Rev. I can understand
 complex deviations from HyperTalk, but not the basic, simple ones.
 What works in HyperTalk should work in RevTalk. Just my HO, but one of
 the reasons I've found Rev to be frustrating.

 Joe Wilkins
 On Apr 26, 2010, at 12:06 PM, Claus Dreischer wrote:

 doh ...

 i tried with

 put hello world into the selection

 which failed.

 Thanks Mark for the prompt response!


 Am 26.04.10 20:54, schrieb Mark Schonewille:
 Claus,

 put hello world after the selection

 -- 
 Best regards,

 Mark Schonewille
___
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: How to insert text at cursor position?

2010-04-27 Thread J. Landman Gay

Claus Dreischer wrote:

The problem was here was indeed the hilite.
Putting
put hello world into the selection
or
put hello world after the selection
in a button works.

Putting one of the above into a popup button doen't work.

So, is there a way to somehow store the selection before it get lost?
Can i insert text into a field from a popup button?


You have a couple of choices. The easiest is to just turn off 
auto-hilite and substitute your own handlers. On mousedown, hilite the 
button, on mouseUp and mouseRelease, unhilite it.


The second way is to use a local script variable to store the 
selectedchunk. When the button is released, reselect the stored chunk:


local sStoredChunk

on mouseDown
 put the selectedchunk into sStoredChunk
end mouseDown

on mouseUp
 select sStoredChunk
end mouseUp

on mouseRelease
 select sStoredChunk
end mouseRelease

--
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


How to insert text at cursor position?

2010-04-26 Thread Claus Dreischer
Hi,

I'm trying to perform the following:
There is a field in which the user can edit text.
There are some buttons which should help him insert some text/code at
the cursor position of that field.

How do i do that?
I looked at insert, cursor, selection, but none of these does the job.

So, which command am i looking for, or which code snipped does this task?

Regards,
Claus.
___
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: How to insert text at cursor position?

2010-04-26 Thread Mark Schonewille

Claus,

put hello world after the selection

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer

We have updated TwistAWord. Download TwistAWord 1.1 at http://www.twistaword.net

Op 26 apr 2010, om 20:53 heeft Claus Dreischer het volgende geschreven:


Hi,

I'm trying to perform the following:
There is a field in which the user can edit text.
There are some buttons which should help him insert some text/code at
the cursor position of that field.

How do i do that?
I looked at insert, cursor, selection, but none of these does the job.

So, which command am i looking for, or which code snipped does this  
task?


Regards,
Claus.|



___
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: How to insert text at cursor position?

2010-04-26 Thread Claus Dreischer
doh ...

i tried with

put hello world into the selection

which failed.

Thanks Mark for the prompt response!


Am 26.04.10 20:54, schrieb Mark Schonewille:
 Claus,
 
 put hello world after the selection
 
 -- 
 Best regards,
 
 Mark Schonewille
___
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: How to insert text at cursor position?

2010-04-26 Thread Joe Lewis Wilkins
Actually, I find this very disturbing, since either of these 
expressions/commands would work in HyperCard; consequently, being very simple 
as they are, they should both work in Rev. I can understand complex deviations 
from HyperTalk, but not the basic, simple ones. What works in HyperTalk should 
work in RevTalk. Just my HO, but one of the reasons I've found Rev to be 
frustrating.

Joe Wilkins 

On Apr 26, 2010, at 12:06 PM, Claus Dreischer wrote:

 doh ...
 
 i tried with
 
   put hello world into the selection
 
 which failed.
 
 Thanks Mark for the prompt response!
 
 
 Am 26.04.10 20:54, schrieb Mark Schonewille:
 Claus,
 
 put hello world after the selection
 
 -- 
 Best regards,
 
 Mark Schonewille
___
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: How to insert text at cursor position?

2010-04-26 Thread J. Landman Gay
Both work, I'm not sure why the first one didn't for the OP. It works 
here. Perhaps his button had auto-hilite set to true, which steals the 
selection.


Joe Lewis Wilkins wrote:

Actually, I find this very disturbing, since either of these 
expressions/commands would work in HyperCard; consequently, being very simple 
as they are, they should both work in Rev. I can understand complex deviations 
from HyperTalk, but not the basic, simple ones. What works in HyperTalk should 
work in RevTalk. Just my HO, but one of the reasons I've found Rev to be 
frustrating.

Joe Wilkins 


On Apr 26, 2010, at 12:06 PM, Claus Dreischer wrote:


doh ...

i tried with

put hello world into the selection

which failed.

Thanks Mark for the prompt response!


Am 26.04.10 20:54, schrieb Mark Schonewille:

Claus,

put hello world after the selection

--
Best regards,

Mark Schonewille

___
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 | 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