Forum > Designer

Custom component: Capture clicks and select an item in Designer

<< < (3/3)

hukka:
I have now managed to solve it – turns out the solution was in the wiki.
Specifically this:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure ThToolbar.CMDesignHitTest(var Message: TLMessage);begin  Message.Result := 1;end; procedure ThToolbar.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  ClickedItem := GetItemAt(X, Y);  if csDesigning in ComponentState then  begin        GlobalDesignHook.SelectOnlyThis(ClickedItem);        Exit;  end;  ... 
and now my MouseDown handler gets called in the IDE and the proper toolbar item gets selected as I click on it.

Navigation

[0] Message Index

[*] Previous page

Go to full version