views:

182

answers:

3

Title says it all.

Sometimes I want L-shaped, T-shaped, triangular, polygonal ...

Free reusable component please . . .

+3  A: 

There is a number of possibilities here, one of which is to implement your own component, derive from TPanel and use the a region to specify the area of the panel, this could be done by a call to the Windows API function CreatePolygonRgn. You would probably have to realign the child controls manually.

If you don't need the panel to contain any child controls, you should consider using shape objects (TShape) instead, you could use a combination of existing ones, or create your own.

One other option is to use regular panels, and draw the shape as background on them. The easiest way to do this might be to implement your own TPanel class and handle the paint code. This will not shape the panel, but you can simulate the visual features of it. If you need child components you might need to override the Realign function to make sure child components are kept within shaped panel boundaries.

Alternatively you have to try your luck on the internet finding 3rd party components that implements this, I did a quick search but found no panels that could do this specifically, although I must admit my search wasn't too thorough, you might have better luck than me.

TommyA
yes, Tommy, I know that I can code my own. I even know how; but I also know that it will be a pain in the posterior to do so - which is why I hoped for a free component which would save me form re-inventing too much of the wheel.(btw, then panel does need to support child-controls; it needs to support *everything* that TPanel does. I need a sub-class)And, yes, I do know how to use google. I'm here because, like you, I found nothing (after a rigorous serach)
Mawg
mawg - maybe you should state in your question that you are looking for an existing free reusable component
Seth
A: 

I purchased http://www.tmssoftware.com/site/products.asp?t=vclp which looks like it can do what I want (and provides source code in case it only does 90% of what I want)

See also http://stackoverflow.com/questions/2040160/seeking-floorplan-design-vcl-toolbar

Mawg
+2  A: 

It seemed to be too late, but I know a free one on the Angus's site.("Drawing Objects") . (I misunderstood what you need is like non-recutanglular form like TRzShapeForm from your question.)

Sorry.

angus's Drawing Objects

benok