Each clickable tag doesn't necessarily have to be its own control. It just has to be a region that you can detect being clicked.
Suppose you represent each area as a Windows region. You can figure out how wide each one should be based on its text with the TCanvas.TextExtent
function. Then create a region with a function like CreateRectRgn
. For rounded corners, try CreateRoundRectRgn
instead. You can test for mouse events in each region with the PtInRegion
function. You can paint borders around them with FrameRgn
. The last obstacle is to draw them on the screen so they'll all fit. You're creating the regions and you know their widths, so assign tags to a row until you run out of space, and then start the next line.