Single function bringToSecond:
move window (tForm) to the SECOND position
in the Z-Order list of application windows.
Z-Index
T0P Wnd00 +--> Wnd_A Wnd_A
1 Wnd01 | Wnd00 +--> Wnd_B
2 ... | Wnd01 | Wnd00
3 ... | ... | Wnd01
... ... | ... |
N bringToSecond(Wnd_A)--^ ... |
M ... bringToSecond(Wnd_B)--^
... ... ...
.................................................................
DeskTop DeskTop DeskTop DeskTop DeskTop DeskTop DeskTop DeskTop
uBringToSecond.pasgeneralized version. If possible, use a native implementation for the target platform. If there is no implementation, it is a cross-platform version.uBringToSecond_LCL.pascross-platform version- the functionality of the
bringToSecondprocedure is achieved by two consecutive calls to the standardtForm.bringToFront - 💩 periodically noticeable characteristic flickering of the interface. 👍 should work on ALL platforms
- the functionality of the
uBringToSecond_WIN.pasuse functions WinAPIuBringToSecond_X11.pasuse functions xlibuBringToSecond_GtkX.pasuse functions GtkuBringToSecond_QtX.pasuse functions QtuBringToSecond_cocoa.pasuse functions NSWindow
| win32/64 | x11/xlib | GTK2 | GTK3 | Qt4 | Qt5 | cocoa | |
|---|---|---|---|---|---|---|---|
.._LCL.pas |
[::] | [::] | [::] | [::] | [::] | [::] | [::] |
.._WIN.pas |
[+] | [+] | [#] | [+] | |||
.._X11.pas |
[+] | [+] | [+] | ||||
.._GtkX.pas |
[~1] | [+] | [+] | ||||
.._QtX.pas |
[~2] | [~3] | [~3] | ||||
..cocoa.pas |
[+] |
[::]- should work EVERYWHERE, where there is Lazarus[+]- implemented, tested[#]- implemented, NOT tested[~1]- usedgdk_window_restackINCORRECT works underWINDOWS, the implementation is similar toLCLbut withGTKmethods ( [+] GTK2; [#] GTK3 ).[~2]- the necessary methods do not EXIST, the implementation is similar toLCLbut withQtmethods ( [#] Qt4; [+] Qt5 ).[~3]- the necessary methods do not EXIST, the implementation is similar toLCLbut withQtmethods ( [+] Qt4; [+] Qt5 ).
-
Place the source code of the library into the folder
%SomeDIR%(clone the repository or download the latest version). -
In the project settings, specify the folder
%SomeDIR%in other unit files. -
Using in code:
uses ... uBringToSecond, ...; .. bringToSecond(myForm); ..
For a ready-to-study example, see in repository of demo project.