Re: Workaround For No selectionChanged Message?
> Um, yes, I'm pretty sure that "palette stack xyz" sets the stack's style to > palette... :-) I thought you might know that ;-) > > But you got me thinking, I am trying to maintain the user's selection after > the text has been styled, and it seems that even the LiveCode IDE doesn't do > this (selection is lost after style is changed). So maybe the previously > selected text needs to be reselected after being styled. That makes sense. Probably the whole field is refreshed when you set a property of the selected chunk. Cheers -- Monte Goulding M E R Goulding Software Development Bespoke application development for vertical markets InstallGadget - How to create an installer in 10 seconds revObjective - Making behavior scripts behave ___ 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: Workaround For No selectionChanged Message?
Scott Rossi wrote: Recently, Monte Goulding wrote: I currently have text formatting controls in a palette There's got to be an easier way. Are you sure you are using a palette? This should work without you doing anything? Um, yes, I'm pretty sure that "palette stack xyz" sets the stack's style to palette... :-) But you got me thinking, I am trying to maintain the user's selection after the text has been styled, and it seems that even the LiveCode IDE doesn't do this (selection is lost after style is changed). So maybe the previously selected text needs to be reselected after being styled. This seems to work, but I could have sworn there was some window switching situation where the text selection would be lost. Anyway, I'll continue with this option -- thanks for the push Monte. You should be able to retain the text selection if the traversalOn of the buttons in the toolbar is set to false. When that property is true, the button gets focus when it's clicked, causing the selection to be lost. -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com LiveCode Journal blog: http://LiveCodejournal.com/blog.irv ___ 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: Workaround For No selectionChanged Message?
Recently, Monte Goulding wrote: >> I currently have text formatting controls in a palette > >> There's got to be an easier way. > > Are you sure you are using a palette? This should work without you doing > anything? Um, yes, I'm pretty sure that "palette stack xyz" sets the stack's style to palette... :-) But you got me thinking, I am trying to maintain the user's selection after the text has been styled, and it seems that even the LiveCode IDE doesn't do this (selection is lost after style is changed). So maybe the previously selected text needs to be reselected after being styled. This seems to work, but I could have sworn there was some window switching situation where the text selection would be lost. Anyway, I'll continue with this option -- thanks for the push Monte. Regards, Scott Rossi Creative Director Tactile Media, UX Design ___ 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: Workaround For No selectionChanged Message?
Hey Scott > I currently have text formatting controls in a palette > There's got to be an easier way. Are you sure you are using a palette? This should work without you doing anything? Cheers -- Monte Goulding M E R Goulding Software Development Bespoke application development for vertical markets InstallGadget - How to create an installer in 10 seconds revObjective - Making behavior scripts behave ___ 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: Workaround For No selectionChanged Message?
Recently, I wrote: > I have recently begun to struggle again with a simple text editor project > and it seems when the contents of a field are selected via script (select > text of fld 1), no selectionChanged message is sent. On a related note, how do folks handle maintaining text selections? I currently have text formatting controls in a palette, separate from a mainstack that contains the text to be edited. When clicking on the palette, the text selection is lost in the mainstack, so I add backColor to the selected text while the palette has focus; when focus is shifted back to the mainstack, the backColor is removed and the previously unselected text is reselected (!). The issue here is the appearances do not match: text selected by LiveCode has a different appearance than text with a backColor applied. The only way I can see around this is to always use the backColor selection and never allow "true" selection of text. What a pain. There's got to be an easier way. Is there one? Thanks & Regards, Scott Rossi Creative Director Tactile Media, UX Design ___ 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: Workaround For No selectionChanged Message?
Thanks for the confirmation Phil (couldn't believe I never ran across this in all my years dealing with Rev). Your solution is simple and appears to solve my dilemma. Thanks so much. Regards, Scott Rossi Creative Director Tactile Media, UX Design Recently, Phil Davis wrote: > Your experience is consistent with mine. So when my code makes selection > change, > it sends "selectionChanged" to the target field right after doing so. > > Phil Davis > > On 10/12/10 5:42 PM, Scott Rossi wrote: >> Am I living on another planet or is the selectionChanged message not >> triggered by selecting the contents of a field via script? ___ 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: Workaround For No selectionChanged Message?
Hi Scott, Your experience is consistent with mine. So when my code makes selection change, it sends "selectionChanged" to the target field right after doing so. Phil Davis On 10/12/10 5:42 PM, Scott Rossi wrote: Am I living on another planet or is the selectionChanged message not triggered by selecting the contents of a field via script? I have recently begun to struggle again with a simple text editor project and it seems when the contents of a field are selected via script (select text of fld 1), no selectionChanged message is sent. I have a frontScript with a selectionChanged routine that is supposed to track any changes in text selection. It works as expected when selections are changed via mouse, click, and drag, but when text is selected by script using the above "select text of fld 1" nothing happens. Admittedly, this is Rev 4.0, but is this correct behavior? I could use a klunky workaround of a looping script that constantly polls the selectedText but this is, er, klunky. Might there be another way? Thanks for any suggestions/clarifications. Regards, Scott Rossi Creative Director Tactile Media, UX Design ___ 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 -- Phil Davis PDS Labs Professional Software Development http://pdslabs.net ___ 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