Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder Components » View Thread |
Messages 1 to 2 of 2 total |
Clickable Overlay Panel - great for Touch screens |
Sat, Apr 17 2021 4:57 PM | Permanent Link |
Trinione | A technique I use to improve the clickability of areas is to place a transparent panel over it and set the event via the panel.
I have included Click and DblClick handing. function ClickableOverlayPanel(Sender: TObject; evntType: string; evnt: TNotifyEvent): TBasicPanel; function CreateClickableOverlayPanel(ctrl: TControl; evnt: TNotifyEvent): TBasicPanel; function ClickableOverlayPanel(Sender: TObject; evntType: string; evnt: TNotifyEvent): TBasicPanel; var pnl: TBasicPanel; begin pnl := TBasicPanel.Create(nil); pnl := CreateClickableOverlayPanel(TControl(Sender), evnt); if evntType = 'click' then pnl.OnClick := evnt; if evntType = 'dblClick' then pnl.OnDblClick := evnt; result := pnl; end; function CreateClickableOverlayPanel(ctrl: TControl; evnt: TNotifyEvent): TBasicPanel; var pnlOverlay: TBasicPanel; begin pnlOverlay := TBasicPanel.Create(ctrl); pnlOverlay.Height := ctrl.Height; pnlOverlay.Width := ctrl.Width; pnlOverlay.Borders.Bottom.Visible := False; pnlOverlay.Borders.Left.Visible := False; pnlOverlay.Borders.Top.Visible := False; pnlOverlay.Borders.Right.Visible := False; with pnlOverlay do begin Top := 0; Left := 0; Background.Fill.Color := clTransparent; end; if evnt <> nil then pnlOverlay.Cursor := crPointer; result := pnlOverlay; end; ........................................................ PascalNetwork.com pascal - the language we love |
Sat, Apr 17 2021 5:01 PM | Permanent Link |
Trinione | An example call would be:
ClickableOverlayPanel(imgLogo, 'click', imgLogoClick); procedure TForm1.imgLogoClick(Sender: TObject); begin ShowMessage('imgLogo transparent Overlay Panel clicked! ; end; ........................................................ PascalNetwork.com pascal - the language we love |
This web page was last updated on Friday, September 13, 2024 at 03:42 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |