My Notepad Style Project

H Baric hbaric at gmail.com
Sat Aug 2 10:22:54 EDT 2008


Hi Eric,

Thanks again! See my last note about drag n drop - seems to work by itself 
without any script?!

HA, not as easy as I'd hoped re the selectedX functions! Well I've been 
reading and trying out all the docs and tutes about Text processing etc 
today (on and off as I have a young child to care for) and still scratching 
my head about how to go about it exactly. I also haven't had a lot of sleep 
and all these concepts are still so new, like: geeez Chunks? Makes me want 
to throw up everytime I see that word HAHA! So maybe I'll get it out again 
and give it more thought tomorrow. I'm determined to work it out myself 
though, so no need to reply okay, until I beg for a hint ;)

I'm onto a new task tonight before I ZZZzzz, but that's my next post... :D

Cheers,
Heather :)

----- Original Message ----- 
From: "Eric Chatonet" <eric.chatonet at sosmartsoftware.com>
To: "How to use Revolution" <use-revolution at lists.runrev.com>
Sent: Friday, August 01, 2008 8:20 PM
Subject: Re: My Notepad Style Project


Bonjour Heather,

Glad to help you :-)
Your handler is perfect.

About inserting or replacing text have a look at selectedField,
selectedChunk and selectedText functions in the docs.
When you will master that you might think about implementing drag and
drop text into your "Edit" field:
Then you will have something more powerful than Note Pad :-)

Le 1 août 08 à 12:14, H Baric a écrit :

> Hi Eric, thanks for your help, it works perfectly :)
>
> Well, this is what I ended up using (in the stack script)
> Can you see if there is any problem writing it like this?
> I'm still VERY new to scripting :D:
>
> on commandKeyDown pKey
>
>    if pKey = "v" then
>
>       if the clipboard is "text" then
>
>       put the clipboardData[text] into field "Edit"
>
>       end if
>
>    else pass commandKeyDown
>
> end commandKeyDown
>
>
> Yes, and er now to work out how to  handle the replacing etc. Ack.
> So many
> things to think about isn't there hehe... :D
>
> Heather
>
> ----- Original Message -----
> From: "Eric Chatonet" <eric.chatonet at sosmartsoftware.com>
> To: "How to use Revolution" <use-revolution at lists.runrev.com>
> Sent: Friday, August 01, 2008 6:47 PM
> Subject: Re: My Notepad Style Project
>
>
> Bonjour Heather,
>
> Welcome to the list :-)
>
> First you have to check the clipboard contents to accept text only:
> if the clipboard is "text" then...
> Then use the clipboardData["text"] that is unformatted text:
> put the clipboardData["text"] into fld < Edit field>
>
> To handle the paste shortcut:
>
> on commandKeyDown pKey
>    if pKey = "v" then...
>    else pass commandKeyDown
> end commandKeyDown
>
> You can use the pasteKey message also but it will work in a
> standalone only.
> Last but not least, you'll have to struggle with the selectedChunk to
> paste at the right place or replace some selected text.
> Good luck :-)
>
> Le 1 août 08 à 10:27, H Baric a écrit :
>
>> Hi all, this is my first post. Hope it works!
>>
>> I'm making a very simple Text File Editor, based pretty much
>> exactly on Window's Notepad, for the sake of learning.
>>
>> I've been trying to find a way to set the Edit field to non-
>> formatted text when copying and pasting text from web-pages and
>> other applications for example.
>>
>> What would be the best way to ensure that the editing field cannot
>> be formatted in any way (like Notepad and other basic text editors)?
>>
>> Is it possible? How (and where) would I script this? Thanks in
>> advance :)
>>
>> Cheers,
>> Heather


Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------


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




More information about the use-livecode mailing list