Lazarus

Programming => LCL => Topic started by: Dan3468298 on July 16, 2020, 05:15:41 pm

Title: OnContextPopup? Cocoa Bug?
Post by: Dan3468298 on July 16, 2020, 05:15:41 pm
I have a PopupMenu assigned to the form.  On the form is a TEdit instance.  For the TEdit I want the default OS pop up of 'Select' etc.   However, after assigning the PopupMenu to the Form it is also activated in the TEdit.   How do I prevent this?  I can set Handled to True but what after that?  Thx
Title: Re: OnContextPopup?
Post by: balazsszekely on July 16, 2020, 05:17:42 pm
@Dan3468298
Quote
I have a PopupMenu assigned to the form.  On the form is a TEdit instance.  For the TEdit I want the default OS pop up of 'Select' etc.   However, after assigning the PopupMenu to the Form it is also activated in the TEdit.   How do I prevent this?  I can set Handled to True but what after that?  Thx
I cannot reproduce this on windows(Lazarus Trunk/ FPC 3.2.0), it must be a cocoa specific issue.
Title: Re: OnContextPopup?
Post by: Dan3468298 on July 16, 2020, 07:42:16 pm
Thank you GetMem.  Can someone else verify this problem on Cocoa?  Code:

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Menus;
  9.  
  10. type
  11.  
  12.   { TForm1 }
  13.  
  14.   TForm1 = class(TForm)
  15.     Edit1: TEdit;
  16.     MenuItem1: TMenuItem;
  17.     MenuItem2: TMenuItem;
  18.     PopupMenu1: TPopupMenu;
  19.   private
  20.  
  21.   public
  22.  
  23.   end;
  24.  
  25. var
  26.   Form1: TForm1;
  27.  
  28. implementation
  29.  
  30. {$R *.lfm}
  31.  
  32. end.

TForm1.PopUpMenu := PopUpMenu1
TEdit1.PopUpMenu := None (which means default OS PopUpMenu should apply to Select, Copy,Cut text).

Title: Re: OnContextPopup? Cocoa Bug?
Post by: Dan3468298 on July 24, 2020, 04:36:47 pm
No one else can verify this problem exists using Cocoa?   If so, I would like to file a bug. 
Title: Re: OnContextPopup? Cocoa Bug?
Post by: Dan3468298 on July 30, 2020, 12:39:03 am
Problems still exists in MacOS 2.1.0.   Will file a bug.
Title: Re: OnContextPopup? Cocoa Bug?
Post by: Dan3468298 on August 02, 2020, 07:56:51 pm
Bug Report field https://bugs.freepascal.org/view.php?id=37446 (https://bugs.freepascal.org/view.php?id=37446)
TinyPortal © 2005-2018