I am attempting to build a custom pushbutton with a canvas. I am unable to figure out how to make a new Inspector Behavior Caption as String to show the string OK when dropped in the IDE, as I can only get a blank canvas in the IDE. Any helpful hints?
The above shows the Custom Control without text and the Xojo control is showing the text OK.
Thanks for your help.
your custom control doesn’t have any way to draw itself IN the IDE
nothing you can do about that at this time
Wouldn’t it be great to have an event like “paintIDE” or something like that - where you could enter painting code to be executed in the IDE? Shouldn’t be THAT difficult to do, or is it?
I’m on a project with lots of custom controls at the moment and the window looks a bit confusing when I look at it in the editor
There should be a possibility to double- and triple-like posts…
Hi Eugene, I hadn’t thought of this until I read your post.
We work with a lot of “CanvasButtons” in our projects, and have some of the same issues with keeping track of them in the IDE. One option might be to create a ContainerControl which has your Canvas on it, and add an ImageWell that is placed in a similar location (though I would avoid giving the ImageWell the same Top and Left coordinates) as the Custom Canvas. The ImageWell could contain a representative image of what the Canvas Control will look like when rendered. The ImageWell will display the Image in the IDE. On the Open Event of the ContainerControl, set the Visible property of the ImageWell to False (or configure it that way in the IDE). Use the ContainerControls where you would have been using the Custom Canvases, and the ImageWells will give you the visual cues.
It will potentially add a small amount of effort to create the representative images, and will add a small amount of overhead to include the images in the project, but it could be worth it. Other variations on this theme would be to use standard Xojo buttons or Captions in a similar fashion, which removes the need to create and include the images.
This idea may have been mentioned by others in another thread, but I figured it was worth mentioning.