Palette stack of Custom Controls
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 854
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Palette stack of Custom Controls
I have worked on the stack over the weekend and settled on version 1.2. It needs some third party testing but I hope I have caught all the bugs.
It started out as an exercise in drag and drop from a Livecode palette but quickly morphed into trying to keep track of object references. These cause issues because neither names or IDs are unique across multiple stacks. If you do use this stack in its present form, no reason not to, I advise that you ensure that your behavior buttons are given unique names.
The stack has only been tested on an Apple Mac but should work on all desktops as an IDE plug-in. I will be posting it to Livecode Share once I am able to create an account.
Any comments, observations or results of testing welcomed.
It started out as an exercise in drag and drop from a Livecode palette but quickly morphed into trying to keep track of object references. These cause issues because neither names or IDs are unique across multiple stacks. If you do use this stack in its present form, no reason not to, I advise that you ensure that your behavior buttons are given unique names.
The stack has only been tested on an Apple Mac but should work on all desktops as an IDE plug-in. I will be posting it to Livecode Share once I am able to create an account.
Any comments, observations or results of testing welcomed.
- Attachments
-
- CustomrControlPaletteV1-2.livecode.zip
- A palette to hold your custom controls (groups)
- (120.01 KiB) Downloaded 190 times
best wishes
Skids
Skids
-
- VIP Livecode Opensource Backer
- Posts: 4013
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Palette stack of Custom Controls
Hi Simon,
thanks for the update.
In short testing it works flawlessly. Some behaviors are broken in card "DragSource". (they are displayed in red in the Properties Inspector in current versions of LC)
Another example how to control controls in a separate stack dynamically via behaviors is "bnGuides" on Livecode Share. It made me dizzy when doing it.
Kind regards
Bernd
thanks for the update.
In short testing it works flawlessly. Some behaviors are broken in card "DragSource". (they are displayed in red in the Properties Inspector in current versions of LC)
Another example how to control controls in a separate stack dynamically via behaviors is "bnGuides" on Livecode Share. It made me dizzy when doing it.
Kind regards
Bernd
-
- Posts: 854
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Palette stack of Custom Controls
Hi Bernd,
Yes I was left wishing that the property inspector would show ID numbers in addition to names (I did search but found no option to switch them on). I'll take a look at your stack to see how you solved the issues.
best wishes
Simon
Yes I was left wishing that the property inspector would show ID numbers in addition to names (I did search but found no option to switch them on). I'll take a look at your stack to see how you solved the issues.
best wishes
Simon
best wishes
Skids
Skids
-
- Posts: 854
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Palette stack of Custom Controls
Bernd,
best wishes
Simon
Please will you send me more details or a screen shot as I don't see any problems on my version.Some behaviors are broken in card "DragSource". (they are displayed in red in the Properties Inspector in current versions of LC)
best wishes
Simon
best wishes
Skids
Skids
-
- Posts: 854
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Palette stack of Custom Controls
oops please ignore my previous - I've spotted them - v1.3 next.
Simon
Simon
best wishes
Skids
Skids
-
- Posts: 854
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Palette stack of Custom Controls
Serves me right for starting with a stack I found on the forum: it had a couple of 1 by 1 fields lurking off screen. Mind you the two reds on the documentation stack were all my own doing.
Here is version 1.3. there should not be any red warnings and I have made the documentation stack a palette so that it may be viewed while in edit mode.
Simon
Here is version 1.3. there should not be any red warnings and I have made the documentation stack a palette so that it may be viewed while in edit mode.
Simon
- Attachments
-
- CustomrControlPaletteV1-3.livecode.zip
- (119.68 KiB) Downloaded 205 times
best wishes
Skids
Skids
-
- Posts: 854
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Palette stack of Custom Controls
Well I think I have posted v1-3 on the Sample Stacks site. It may be found by searching for "User Tools Palette".
best wishes
Skids
Skids
-
- Posts: 632
- Joined: Wed Apr 24, 2013 4:53 pm
- Contact:
Re: Palette stack of Custom Controls
Just found this thread, after working on similar stuff for the past 1-2 months
Anyway... the trick to doing cross-stack scripts seems to be to monitor either topStack or the mouseStack (need a front script for that) then when the script needs to do stuff, like get/set the fore/back colors of a control, on the other stack, you set the 'defaultStack' to that stack. defaultStack seems to work s a bit like the 'focus' syntax but for stack windows (or more accurately like the 'keyWindow' property in Apple's ObjC).
Your can use selectedObjects to get a list any selected controls, if that list is empty then you can check the selectedChunk to see if some text is selected (if your'e interested in the text, which I currently very much am), you can check 'the selectedImage' to see if the user in in pixel-image-paint mode. If you store the selections in some container/variable you can then combine them in your scripts (exam.: tSelectedChunk & " of " & tSelectedObj).
I won't go into the whole dragImage thing for drag-n-drop stuff because the demo stacks here and on livecodeshare (you could look at the IDE's tools stack too) pretty much cover that topic, with examples of drag drop behavior to insert into front script.
You can also subscribe your stack to IDE messages from the list returned by revIDEMessages(), in particular: revIDESubscribe "ideSelectedObjectChanged".
The tricky thing I'm trying now is to do cross-stack text editing via script, which in my testing stack I'm checking any non-empty selectedChunk using the 'on idle' syntax (with an idleRate set) but that's probably not optimal and will likely change it to an 'on ideMouseMove' from the revIDE library/subscribed messages. Text editing is done in 'browse tool' mode versus edit mode, so the selectedObjs is empty with that tool.
Anyway... the trick to doing cross-stack scripts seems to be to monitor either topStack or the mouseStack (need a front script for that) then when the script needs to do stuff, like get/set the fore/back colors of a control, on the other stack, you set the 'defaultStack' to that stack. defaultStack seems to work s a bit like the 'focus' syntax but for stack windows (or more accurately like the 'keyWindow' property in Apple's ObjC).
Your can use selectedObjects to get a list any selected controls, if that list is empty then you can check the selectedChunk to see if some text is selected (if your'e interested in the text, which I currently very much am), you can check 'the selectedImage' to see if the user in in pixel-image-paint mode. If you store the selections in some container/variable you can then combine them in your scripts (exam.: tSelectedChunk & " of " & tSelectedObj).
I won't go into the whole dragImage thing for drag-n-drop stuff because the demo stacks here and on livecodeshare (you could look at the IDE's tools stack too) pretty much cover that topic, with examples of drag drop behavior to insert into front script.
You can also subscribe your stack to IDE messages from the list returned by revIDEMessages(), in particular: revIDESubscribe "ideSelectedObjectChanged".
The tricky thing I'm trying now is to do cross-stack text editing via script, which in my testing stack I'm checking any non-empty selectedChunk using the 'on idle' syntax (with an idleRate set) but that's probably not optimal and will likely change it to an 'on ideMouseMove' from the revIDE library/subscribed messages. Text editing is done in 'browse tool' mode versus edit mode, so the selectedObjs is empty with that tool.
-
- Posts: 854
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Palette stack of Custom Controls
Thanks - I think ! 2020 seems along time ago.
best wishes
Skids
Skids
-
- Posts: 632
- Joined: Wed Apr 24, 2013 4:53 pm
- Contact:
Re: Palette stack of Custom Controls
Probably worth noting you could just store your reusable group objects in a library in the IDE's Object Library, which I've spent some time implementing drag-drop-to-place (for revImages too -- which is the same stack). For some reason it took me a long time to actually start using that bit to store some objects, now I'm find it very useful (specially after some modifications).
I'm basically working on mostly graphics things right now, trying to turn the IDE into a more QuarkXpress (v3 the best version)-like setup by building a text / tools palette loosly modeled on Quark (v3's) measurements palette, and changed command-keys to be more standard page-layout key commands... command+shift+C = center the selectedChunk, instead of Edit Card Script, Command-shift+ +/- to scale text up/down, etc.
I've also made a Color Swatch palette that can use different color sets, engine named colors or custom set (which can use click or drag-drop for applying)
-
- Livecode Opensource Backer
- Posts: 9444
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Palette stack of Custom Controls
Thanks for that code: when I find some time I'll work my way through those SVG stacks of mine and
make things possible to drag-n-drop the icons.
make things possible to drag-n-drop the icons.
-
- Posts: 854
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Palette stack of Custom Controls
Useful tools.
If I remember my own efforts were aimed at simplifying the use of custom controls built using livecode attempted partly in response to all the encouragement at the time to use Livecode Builder.
Simon
If I remember my own efforts were aimed at simplifying the use of custom controls built using livecode attempted partly in response to all the encouragement at the time to use Livecode Builder.
Simon
best wishes
Skids
Skids
-
- Posts: 632
- Joined: Wed Apr 24, 2013 4:53 pm
- Contact:
Re: Palette stack of Custom Controls
I've already done that, well like everything else it's a work in progress, it reads IconSVG library's arrays, has drag to place, and a simple export to SVG file.richmond62 wrote: ↑Wed May 10, 2023 9:16 amThanks for that code: when I find some time I'll work my way through those SVG stacks of mine and
make things possible to drag-n-drop the icons.
If you open the stack with the Alt/Option Key held down, then the stack will be opened in editable non-palette topLevel mode.
Last edited by PaulDaMacMan on Sat May 13, 2023 3:02 am, edited 4 times in total.
-
- Posts: 632
- Joined: Wed Apr 24, 2013 4:53 pm
- Contact:
Re: Palette stack of Custom Controls
Although, your files were Image controls with Drawing Library's 'compiled SVG' format data in them so they won't show up in this stack's listings, but you could convert them to Image Libraries (which Ive also enabled drag to place in), just by renaming them to 'revLibWhatever' and placing them in the appropriate folder.PaulDaMacMan wrote: ↑Sat May 13, 2023 12:35 amI've already done that, well like everything else it's a work in progress, it works reads IconSVG library's arrays, has drag to place, and a simple export to SVG file:richmond62 wrote: ↑Wed May 10, 2023 9:16 amThanks for that code: when I find some time I'll work my way through those SVG stacks of mine and
make things possible to drag-n-drop the icons.
SVG_Icons_Browser.rev.zip
Here's the modified revImageLibrary with drag-to-place enabled for replacing the one in the IDE with: There were some other issues with it I was trying to deal with, like previously making a new Object library would make the new library stack but wouldn't allow you to add items to the new library stack (you could only add to the existing revObjectLib. This version allows you to work with multiple object libraries.
-
- Livecode Opensource Backer
- Posts: 9444
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Palette stack of Custom Controls
Possibly.
Although, frankly, I would far rather keep my 'Gift' stacks as independent entities than 'fold them into the cake mix'.
Although, frankly, I would far rather keep my 'Gift' stacks as independent entities than 'fold them into the cake mix'.