Link to home
Start Free TrialLog in
Avatar of shaneholmes
shaneholmes

asked on

Developers Express TOrgChart Shape Help?

I need to create custom shapes in Developers Express TOrgChart. If you have done this, or have the source code of this component and can do it, there will be 500 points available. What I need is a Octagon and a Triangle.


Thanks - and good luck!
P.S. Bonus points to the one who provides all the same functionality as the other shapes.
Avatar of kretzschmar
kretzschmar
Flag of Germany image

listening . . .
hello shaneholmes,

I dont have the source code. But after displing the demo of TOrgChart I found that they use the standart TShape Component.

If you can get the Sourcecode so replace the TShape Component with TManyShape(TManyShape is a TGraphicControl descendant similiar to TShape, but adding new shapes (Diamond, Triangle, Star, Polygon))

http://www.torry.net/vcl/shapes/enhancedshapes/manysh.zip

good luck

Cesario
Avatar of shaneholmes
shaneholmes

ASKER

No,

It does not use TShape to draw its shapes.

In the source, a new type is declared:

TdxOcShape = (shRectangle, shRoundRect, shEllipse, shDiamond);

and its clear that they draw the shapes using the canvas methods such as :

shEllipse: Cnv.Ellipse(R.Left, R.Top, R.Right, R.Bottom);

shRoundRect:
        begin
          Rad := Node.Radius;
          Cnv.RoundRect(R.Left, R.Top, R.Right, R.Bottom,    Rad, Rad);
        end;


 shDiamond:
        begin
          Pts[0].X := R.Left; Pts[0].Y := R.Top + (R.Bottom - R.Top) shr 1;
          Pts[1].X := R.Left + (R.Right - R.Left) shr 1; Pts[1].Y := R.Top;
          Pts[2].X := R.Right - 1; Pts[2].Y := Pts[0].Y;
          Pts[3].X := Pts[1].X; Pts[3].Y := R.Bottom - 1;
          Cnv.Polygon(Pts);
        end;


Thanks for the attempt though - :)


Shane
BTW, if someone wants to attempt to do this for me, email me directly at shaen@holmes.net and i will work with you with the source code.

Shane
ASKER CERTIFIED SOLUTION
Avatar of Cesario Lababidi
Cesario Lababidi
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Cesario ,

Your email is bouncing back to me. Please send me a a valid email address

Shane
shane@holmes.net
Great Job,

If you make the required changes I requested, there is the bonus as well.

Thanks Again!
atleast, other may also see the solution
Right,

And I will when the changes are done!

Hi Meikl,

I think it´s not possible to post the Modification of the Source copy ( Copyright ) here. I am sure Shane can post you the new code.

Cesario
Shane,

I still have some Problems with the Star Shape. But I wil fix it totday.

Best Regards

Cesario
Right,

No plans on posting the entire source listing. Just the changes.

Shane