Recent

Author Topic: FormStyle = fsStayOnTop, mouse events are not fired from the Dialog Form.  (Read 830 times)

dmitryb

  • Jr. Member
  • **
  • Posts: 62
Ubuntu 22.04
Lazarus 2.2.0+dfsg1-5ubuntu1 (rev Debian package 2.2.0+dfsg1-5ubuntu1) FPC 3.2.2 x86_64-linux-gtk2

If the Form has the style FormStyle = fsStayOnTop, then mouse events are not fired over it if it is opened from the Dialog Form.


   Form2 := TForm2.Create(Application);
   Form2.ShowModal;

     Form3.FormStyle = fsStayOnTop
     Form3.Show;

and form Form3 can't be closed at all.

Demo project is attached.
   Run project.
     Click "Create ShowModal Test From"
      Click "New Popup Form"
        Try clicking "Click for test"

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2010
  • Fifty shades of code.
    • Delphi & FreePascal
Re: FormStyle = fsStayOnTop, mouse events are not fired from the Dialog Form.
« Reply #1 on: November 19, 2022, 02:48:34 am »
I have not tested your source, just read what you wrote.
Modal means, at least that's how I understand it, all other forms shall wait until Modal ends.
Plus the fact that the Modal form has its own event loop to do for what it is made for, be Modal/uninterruptable.
So creating another Form over a Modal Form is a bad idea in my thinking.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

dmitryb

  • Jr. Member
  • **
  • Posts: 62
Re: FormStyle = fsStayOnTop, mouse events are not fired from the Dialog Form.
« Reply #2 on: November 19, 2022, 02:54:18 am »
In such on the basis of what forms it is necessary to create drop-down lists in comboboxes.
I have a special non-standard combobox with a dropdown list.
How to create a combobox dropdown window so that it works in all operating systems?
Right now I have a dropdown based on FormStyle = fsStayOnTop working in Widnows but not working in Linux.

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2010
  • Fifty shades of code.
    • Delphi & FreePascal
Re: FormStyle = fsStayOnTop, mouse events are not fired from the Dialog Form.
« Reply #3 on: November 19, 2022, 03:04:45 am »
How to create a combobox dropdown window so that it works in all operating systems?
I agree, ComboBox DropDownCount is for whatever reason not supported by any Linux based OS, it aint a FPC/Lazarus failure.
Solution, create your own OS independent controlled component or switch to ListBox (maybe resize when focused/focus left) or rethink about your modal usage.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

 

TinyPortal © 2005-2018