Recent

Author Topic: TMPlayerControl Click No Response  (Read 1077 times)

local-vision

  • New Member
  • *
  • Posts: 46
TMPlayerControl Click No Response
« on: February 27, 2021, 04:28:05 pm »
So... TMplayerControl has an OnClick event.
Yet this control event never fires when clicked on. Now the control is not visible at Runtime although the control properties are set to True for Enabled and Visible.

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, MPlayerCtrl;
  9.  
  10. type
  11.  
  12.   { TForm1 }
  13.  
  14.   TForm1 = class(TForm)
  15.     Button1: TButton;
  16.     MPlayerControl1: TMPlayerControl;
  17.     procedure Button1Click(Sender: TObject);
  18.     procedure FormShow(Sender: TObject);
  19.     procedure MPlayerControl1Click(Sender: TObject);
  20.   private
  21.  
  22.   public
  23.  
  24.   end;
  25.  
  26. var
  27.   Form1: TForm1;
  28.  
  29. implementation
  30.  
  31. {$R *.lfm}
  32.  
  33. { TForm1 }
  34.  
  35. procedure TForm1.MPlayerControl1Click(Sender: TObject);
  36. begin
  37.   ShowMessage('HowDoInck'); //Click all you want, this events never gets fired.
  38. end;            
  39.  
  40.  


Any ideas on:

1. How to make the control Click-able
2. How set a Color or image so that user can see the control at runtime

Did I miss something? Thanks.

GetMem

  • Hero Member
  • *****
  • Posts: 3452
Re: TMPlayerControl Click No Response
« Reply #1 on: February 27, 2021, 05:06:29 pm »
The OnClick event works fine here. Lazarus 2.0.12/Trunk on windows 10.  You did not provide any information about OS, Lazarus version, widgetset.

local-vision

  • New Member
  • *
  • Posts: 46
Re: TMPlayerControl Click No Response
« Reply #2 on: February 27, 2021, 05:13:11 pm »
Many thanks for testing. Have not tried on a Windows machine.

I am using Lazarus 2.0.10, Linux Mint. Dropped the control on the form and made no changes to its default properties

Would like to find out why on Win and not on Mint. Anyone else tried on a Linux machine?
« Last Edit: February 27, 2021, 05:17:09 pm by local-vision »

GetMem

  • Hero Member
  • *****
  • Posts: 3452
Re: TMPlayerControl Click No Response
« Reply #3 on: February 27, 2021, 05:50:11 pm »
Many thanks for testing. Have not tried on a Windows machine.

I am using Lazarus 2.0.10, Linux Mint. Dropped the control on the form and made no changes to its default properties

Would like to find out why on Win and not on Mint. Anyone else tried on a Linux machine?
Did you try OnMouseUp event? It's not OnClick, but is pretty close. :)

local-vision

  • New Member
  • *
  • Posts: 46
Re: TMPlayerControl Click No Response
« Reply #4 on: February 27, 2021, 06:43:27 pm »
Good suggestion. Tested. Unfortunately OnMouseUp event does not fire either.

TMPlayerControl works for me in all other ways except the Mouse events.

I can, for instance, make the TMPlayerControl a child of a TPanel and then I just use the TPanel events. But that is not the solution I would want.


 

TinyPortal © 2005-2018