Recent

Author Topic: OnContextPopup? Cocoa Bug?  (Read 611 times)

Dan3468298

  • Full Member
  • ***
  • Posts: 128
OnContextPopup? Cocoa Bug?
« 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
« Last Edit: July 17, 2020, 06:08:30 pm by Dan3468298 »
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

GetMem

  • Hero Member
  • *****
  • Posts: 3757
Re: OnContextPopup?
« Reply #1 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.

Dan3468298

  • Full Member
  • ***
  • Posts: 128
Re: OnContextPopup?
« Reply #2 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).

« Last Edit: July 16, 2020, 08:17:19 pm by Dan3468298 »
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

Dan3468298

  • Full Member
  • ***
  • Posts: 128
Re: OnContextPopup? Cocoa Bug?
« Reply #3 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. 
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

Dan3468298

  • Full Member
  • ***
  • Posts: 128
Re: OnContextPopup? Cocoa Bug?
« Reply #4 on: July 30, 2020, 12:39:03 am »
Problems still exists in MacOS 2.1.0.   Will file a bug.
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

Dan3468298

  • Full Member
  • ***
  • Posts: 128
Re: OnContextPopup? Cocoa Bug?
« Reply #5 on: August 02, 2020, 07:56:51 pm »
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

 

TinyPortal © 2005-2018