How make own componet with popup window? lazarus / 31-LCL ---------------------------------------------------------------------- Borneq · 2020-01-27 18:42 Popups are used in menu and combobox. How can I make own combobox with: - fast pull down window, no animation - advanced: colors, fonts - columns in popup window, this windows must use VirtualTree ---------------------------------------------------------------------- Handoko · 2020-01-27 18:49 Not answering your question, but maybe something like this: https://forum.lazarus.freepascal.org/index.php/topic,37369.msg250939.h tml#msg250939 Sorry, I'm not familiar with VirtualTree ---------------------------------------------------------------------- Borneq · 2020-01-27 19:03 OK, how make: - popup window without frame - auto close when click anywhere but outside window? ---------------------------------------------------------------------- Handoko · 2020-01-27 19:11 I haven't tried but I think it can. Popup window without frame Don't use TForm. Instead you runtime generate a TShape, TPaintBox, TPanel (BevelOuter := bvNone), or anything similar to what you want. Auto close when click outside Don't use show modal. On the component, you put the code to close it on OnExit event. ---------------------------------------------------------------------- Borneq · 2020-01-30 17:13 Lazarus IDE has fantastic popup window in code completion. How I obtaing similar thing? Where are sources of Code Completion? ---------------------------------------------------------------------- Handoko · 2020-01-30 17:30 As far as I know that is part of TSynEdit: https://wiki.lazarus.freepascal.org/SynEdit#Completion_plugins ---------------------------------------------------------------------- sash · 2020-01-30 19:05 Quick and dirty example: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   popup := THintWindow.Create(nil);  with popup do begin    SetBounds(Mouse.CursorPos.X, Mouse.CursorPos.Y, 200, 200);    btn := TButton.Create(popup);    btn.Caption := 'Button!';    btn.Parent := popup;    Brush.Color := clRed;    Show;  end;You should take care (figure out) about proper ownership/memory releasing of Popup and its children. Something like OnClose. Just see how it works in TPopupNotifier or SynEdit. ---------------------------------------------------------------------- Borneq · 2020-01-31 10:00 how to close THintWindow when mouse click outside it? I do Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  popup.Hide;end; but this work only when mouse down on pure form, not in any control. How to handle mouse events on whole form, including all controls? ---------------------------------------------------------------------- Handoko · 2020-01-31 11:03 I've just checked THintWindow, it has OnExit event. Maybe you can use it. ---------------------------------------------------------------------- Borneq · 2020-01-31 11:13 Is possible make form message filtering, mouse messsages before dispatching to controls? ---------------------------------------------------------------------- Handoko · 2020-01-31 16:52 Not fully understand what you want to do, here I quickly written a demo. Maybe it can give you some ideas. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Forms, Controls, ExtCtrls, StdCtrls; type   { TForm1 }   TForm1 = class(TForm)    Button1: TButton;    Label1: TLabel;    Panel1: TPanel;    Shape1: TShape;    Timer1: TTimer;    procedure FormClick(Sender: TObject);    procedure FormCreate(Sender: TObject);    procedure Panel1Exit(Sender: TObject);    procedure Shape1MouseDown(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);    procedure Timer1Timer(Sender: TObject);  end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.Shape1MouseDown(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);var  NewPos: TPoint;begin  NewPos := ScreenToClient(Mouse.CursorPos);  Panel1.Left  := NewPos.x;  Panel1.Top     := NewPos.y;  Panel1.Visible := True;  Panel1.SetFocus;end; procedure TForm1.Timer1Timer(Sender: TObject);begin  Label1.Caption := 'Now is ' + TimeToStr(Now) + LineEnding +                    'Click outside to close this box.';end; procedure TForm1.FormCreate(Sender: TObject);begin  Panel1.Visible := False;  Panel1.Caption := '';end; procedure TForm1.Panel1Exit(Sender: TObject);begin  Panel1.Visible := False;end; procedure TForm1.FormClick(Sender: TObject);begin  Panel1.Visible := False;end; end. Click the red rectangle to make the pop up appears. ---------------------------------------------------------------------- Borneq · 2020-01-31 21:56 But TPanel must be in whole inside form, THintWindow is better, in other hand, I can't properly handle OnExit of THintWindow. TSynCompletion is fine, but - is complicated - depend from TCustomSynedit, it can't use TEdit ot TComboBox as control - the worst: TSynBaseCompletion inherits from TLazSynMultiEditPlugin, is not Synedit angostic.