Crainiate Community

Support and discussion for users of Crainiate component software products
Welcome to Crainiate Community Sign in | Join | Help
in Search

Use controls in shapes

Last post 05-15-2008 8:49 AM by Mathy. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-14-2008 10:05 AM

    • Mathy
    • Top 10 Contributor
    • Joined on 07-16-2007
    • Posts 19

    Use controls in shapes

    Hi,

     I am wondering what the best approach would be to use controls in shapes. I looked a bit for a good solution it but can't find an easy one. Is there a general way to do this?


     

    • 194.7.161.130
  • 05-14-2008 11:20 PM In reply to

    Re: Use controls in shapes

    We dont advocate the use of controls inside a shape because the overhead this creates in a diagram (with potentially 1000's of shapes). Controls do not suit the vector nature of the product.

    However we do support a rich set of properties and methods to override to create your own customized class by rendering onto the diagram using GDI+ commands (system.drawing). User Interaction is handled by the OnMousexxx methods.

    Is there a specific control you wish to use?

    Filed under:
    • 86.130.59.174
  • 05-15-2008 8:49 AM In reply to

    • Mathy
    • Top 10 Contributor
    • Joined on 07-16-2007
    • Posts 19

    Re: Use controls in shapes

    At the moment I would like to put a combo-box on a shape. I already tried with letting the combo-box render in the diagram bitmap when it is redrawn, but this doesn't run very smoothly. Besides that there is quite some code needed to handle mouse-events etc properly. If it was something simple like a toggle-button it would be fairly easy to just implement the drawing and mouse-events myself, but I would like potential access to all controls.

    I now found that if you add the control to the controlcollection of the diagram it does get rendered properly and will receive events like it should, so now I'm writing a wrapper class around ComplexShape to allow for adding controls. The only downside I see of this method is that you need to know in which Diagram the shape will end up before you create it. You can also not put controls in StencilItems because you can't get a vector path for it.

    The program I am creating has a potential of about 100 shapes, so I don't think that will be a problem.

    • 194.7.161.130
Page 1 of 1 (3 items)