Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Are there floating windows in Firemonkey?


This question is answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Dec 11, 2014 9:47 AM Last Post By: Michael Leahy
Michael Leahy

Posts: 239
Registered: 5/9/07
Are there floating windows in Firemonkey?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2014 12:49 PM
How does one make a window "float" over other windows? As,say, tool windows in a paint program?

Delphi XE7 MSWINDOWS and MACOS
Eli M

Posts: 1,346
Registered: 11/9/13
Re: Are there floating windows in Firemonkey?
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2014 6:09 PM   in response to: Michael Leahy in response to: Michael Leahy
Not sure about Mac OS but for Windows:

Get the windows handle.

http://docwiki.embarcadero.com/Libraries/XE7/en/FMX.Platform.Win.WindowHandleToPlatform

Use the Win32 API against it (always on top) maybe.

https://stackoverflow.com/questions/916259/win32-bring-a-window-to-top

Firemonkey use to have a TopMost property apparently but I don't see it anymore.

Or if you don't need it to move outside the main window (like MDI) just use a panel and add a drag toolbar inside it.

Michael Leahy

Posts: 239
Registered: 5/9/07
Re: Are there floating windows in Firemonkey?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2014 7:07 PM   in response to: Eli M in response to: Eli M
Eli M wrote:
Not sure about Mac OS but for Windows:

Get the windows handle.

http://docwiki.embarcadero.com/Libraries/XE7/en/FMX.Platform.Win.WindowHandleToPlatform

Use the Win32 API against it (always on top) maybe.

https://stackoverflow.com/questions/916259/win32-bring-a-window-to-top

Firemonkey use to have a TopMost property apparently but I don't see it anymore.

Or if you don't need it to move outside the main window (like MDI) just use a panel and add a drag toolbar inside it.


That helped. I think I found it. I set FormStyle to StayOnTop.

However, now that window stays on top of all applications! Definitely not what I wanted. I just want it to stay on top of all windows when my app is active.
Eli M

Posts: 1,346
Registered: 11/9/13
Re: Are there floating windows in Firemonkey?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 10, 2014 7:11 PM   in response to: Michael Leahy in response to: Michael Leahy
You could disable it when the app loses focus?
Michael Leahy

Posts: 239
Registered: 5/9/07
Re: Are there floating windows in Firemonkey?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 11, 2014 9:23 AM   in response to: Eli M in response to: Eli M
Eli M wrote:
You could disable it when the app loses focus?

How do I find out when the app loses focus?

I have tried hiding the floating window in the FormDeactivate() method of the main window and in any open document windows. However, sometimes the app loses focus and none of the windows gets a call to FormDeactivate(). (Sometimes they do.)

I imagine the trouble with this approach is that the floating window itself is the one that gets the FormDeactivate() call at times. It should not hide itself when it is deactivated because it spends most of its time deactivated but floating.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02