gambas-source-code/app/examples/Misc/SystemTray/.src/FMain.class
gambas 627afc0c90 SystemTray: Update example to follow the new behaviour of X11Systray class.
[EXAMPLES]
* BUG: SystemTray: Update example to follow the new behaviour of X11Systray class.
2021-05-27 04:15:39 +02:00

45 lines
772 B
Text

' Gambas class file
'Private $hImage As Image
Public Sub _new()
'Me.Background = &H007FFF 'Color.SetAlpha(&H007FFF, 192)
End
Public Sub Form_Open()
X11Systray.Show(dwgSystemTray.Handle, dwgSystemTray.Background)
End
Static Public Sub X11Systray_Arrange()
Dim I As Integer
Dim X, Y, H As Integer
Debug X11Systray.Count
X = 2
Y = 2
For I = 0 To X11Systray.Count - 1
With X11Systray[I]
Debug I;; .IconW;; .IconH
If (X + .IconW) >= (Me.ClientW - 2) Then
X = 2
Y += H + 2
H = 0
Endif
.Move(X, Y, .IconW, .IconH)
H = Max(H, .IconH)
X += .IconW + 2
End With
Next
End
Public Sub dwgSystemTray_Arrange()
X11Systray.Move(0, 0, dwgSystemTray.Width, dwgSystemTray.Height)
End