Crainiate Community

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

about Costom Shape

Last post 02-23-2008 10:29 AM by James Westgate. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-21-2008 7:17 AM

    about Costom Shape

    I have built a costom shape,and want to use it like normal shape in stencil. But I can't add it into stencil. How can I do?

    Filed under:
    • 211.166.56.43
  • 02-21-2008 6:41 PM In reply to

    Re: about Costom Shape

    Stencils draw different paths for the same Shape base class. The only other time you need a stencil is when using the palette. In that case you can just add your custom shape directly to the Palette.Shapes collection.

    Let me know if this doesnt answer your question,

    • 86.146.159.85
  • 02-22-2008 1:19 AM In reply to

    Re: about Costom Shape

    Hi James,

    I have done what you told me,but new problem appears. When I drag my custom shape from palette to model, it Create a "Shape" object in it not my Custom Shape. Because I have add a mouse double click handler for MyShape,and pass this message from model mousedoubleclick to it. But In the mousedoubleclick handler of model,I get an error of "can't conver shape to myShape". My code is:

    dim myShape as MyShape

    myshape = selElements.Item(0)   ' this cause error msg because of can't convert

    myshape.onDoubleClick(e)

     

    Thanks for your Help!

    Jam

    Filed under: ,
    • 211.166.56.43
  • 02-23-2008 10:29 AM In reply to

    Re: about Costom Shape

    When you drag a shape from the palette, a new shape is created using the Clone method. You need to override Clone in your subclass to return a new MyShape eg

    public override object Clone()
    {
       
    return new MyShape(this
    );
    }

    Filed under:
    • 86.130.56.165
Page 1 of 1 (4 items)