Re: Storing Images for use by Custom Controls

2018-07-26 Thread Bob Sneidar via use-livecode
Yes that is exactly it. And because of that, if LC does not "see" that first group before the copy, then the images will not display correctly. If the images are in the same stack, then there is no problem, you can make copies of the group as much as you want, but suppose you copied the group

Re: Storing Images for use by Custom Controls

2018-07-26 Thread Simon Knight via use-livecode
Hi Stephen, Why lose the quotes, the texts are literals and not variables. Simon > On 25 Jul 2018, at 21:41, Stephen Barncard via use-livecode > wrote: > > ose the quotes inside the brackets?? > > sqb > > -- > Stephen Barncard - Sebastopol Ca. USA -

Re: Storing Images for use by Custom Controls

2018-07-26 Thread Simon Knight via use-livecode
Bob, The reason I went for the array rather than a naming convention such as you suggest is because I have no idea how Livecode resolves the names. I have an impression that it looks at the stack and works its way up through the images in ID order. The upshot is that a button in a copy of

Re: Storing Images for use by Custom Controls

2018-07-25 Thread BNig via use-livecode
I am sorry to say that my solution does not work if you paste the group on the same card. However Simons solution works when "of me" is added in the repeat loop resolve image is not granular enough to distinguish between groups. Once you paste the group onto a different card or stack then it

Re: Storing Images for use by Custom Controls

2018-07-25 Thread Bob Sneidar via use-livecode
About saving images: I learned a long time ago, both with graphics and publications development, as well as software development, to have copies of resources in a subfolder of a main project folder. This has a couple advantages: First of all, graphics applications can often auto-resolve

Re: Storing Images for use by Custom Controls

2018-07-25 Thread BNig via use-livecode
Simon, try to add "of me" like below repeat with x=1 to the number of images of me put the ID of image x of me into tID put the short name of image x of me into tName put tID into ImageA[tName] end repeat Kind regards Bernd scott--- via use-livecode wrote > Well I

Re: Storing Images for use by Custom Controls

2018-07-25 Thread Stephen Barncard via use-livecode
lose the quotes inside the brackets?? sqb -- Stephen Barncard - Sebastopol Ca. USA - mixstream.org On Wed, Jul 25, 2018 at 1:20 PM, Simon Knight via use-livecode < use-livecode@lists.runrev.com> wrote: > Hi Bernd, > > Unfortunately when I tried your code the copies referred back to the >

Re: Storing Images for use by Custom Controls

2018-07-25 Thread Simon Knight via use-livecode
Hi Bernd, Unfortunately when I tried your code the copies referred back to the original. best wishes Simon > On 25 Jul 2018, at 13:22, BNig via use-livecode > wrote: > > Hi Simon, > > I think the easiest way would be to copy the images your custom control uses > to the custom controls. >

Re: Storing Images for use by Custom Controls

2018-07-25 Thread Simon Knight via use-livecode
Well I tried using custom props but did not get very far with them. My solution is to add the image files to the group and hide them behind other controls. I have added the attached handler that sets the button icons to the values of the images in the group. The handler should be called when

Re: Storing Images for use by Custom Controls

2018-07-25 Thread scott--- via use-livecode
Neat! I didn’t know about resolve image. > On Jul 25, 2018, at 5:22 AM, BNig via use-livecode > wrote: > > Hi Simon, > > I think the easiest way would be to copy the images your custom control uses > to the custom controls. > then add this code to the group (it is for one button "bOne" and

Re: Storing Images for use by Custom Controls

2018-07-25 Thread BNig via use-livecode
Hi Simon, I think the easiest way would be to copy the images your custom control uses to the custom controls. then add this code to the group (it is for one button "bOne" and two images "greenRound" and "redQMark" on newGroup resolve image "redQMark" relative to button "bOne" of me if it

Re: Storing Images for use by Custom Controls

2018-07-25 Thread Simon Knight via use-livecode
Hi Scott, Thank you for your replies. I apologise for my question, I should have been clearer. However, I have copied your response to my “hints and tips” document for reference in the future as it seems like a useful workflow to know. To clarify my question; I have created a simple custom

Re: Storing Images for use by Custom Controls

2018-07-24 Thread scott--- via use-livecode
Hello Simon, I see I probably misunderstood what you were trying to do. With a custom control I might be tempted to store the images in a customProp if I wanted multiple resolutions to travel with the group object. Then do something like setting the imageData of the image. — Scott Elementary

Re: Storing Images for use by Custom Controls

2018-07-24 Thread scott--- via use-livecode
Hello Simon, When you say "compared to storing the images on a card or in a folder” it suggests two very different ways of organizing your source images. If you are taking advantage of LiveCode’s automagical ability to pick the correct resolution image then you need to have the images in your

Re: Storing Images for use by Custom Controls

2018-07-24 Thread Bob Sneidar via use-livecode
Never mind I figured out why it wasn't working when I tested it. I was copy/pasting the custom control group into a stack on the desktop, but my images were relatively linked to png's in a subfolder in one of my project folders! LOL! It works fine. Bob S > On Jul 24, 2018, at 09:43 , Bob

Re: Storing Images for use by Custom Controls

2018-07-24 Thread Bob Sneidar via use-livecode
Hmmm just tested. Doesn't seem to work. I'll have to investigate why. The old script works though I pasted it numerous times. Bob S > On Jul 24, 2018, at 09:35 , Bob Sneidar via use-livecode > wrote: > > No sooner said than done. Keep in mind this method depends on four things: > > 1.

Re: Storing Images for use by Custom Controls

2018-07-24 Thread Bob Sneidar via use-livecode
No sooner said than done. Keep in mind this method depends on four things: 1. Your main group consists of a number of child groups composed of three controls: a button, an icon image and a disabledIcon image 2. Your button names begin with "btn" and your images begin with "img" eg. "btnNew" 3.

Re: Storing Images for use by Custom Controls

2018-07-24 Thread Bob Sneidar via use-livecode
I have a custom control group with a series of buttons, each with an enabled icon and a disabled icon. I have this if the group script, which should give you some idea how to proceed: on newBackground -- Relink buttons to graphics as they all have different ID's now set the icon of button