Anpassung Auswertung aus Ansicht

This commit is contained in:
ms
2022-01-31 08:21:52 +01:00
parent 1d86aa1bb9
commit 77cc6eec0a
15 changed files with 760 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
Public Class frmMainV2
Private Declare Function GetActiveWindow Lib "user32" Alias "GetActiveWindow" () As IntPtr
Public Shared cUserSettings As New cUsersettings
Private Sub UserPanelSwitcher_Click(sender As Button, e As EventArgs) Handles btnFirmen.Click, btnAuftraege.Click, btnFrachtkosten.Click
btnFirmen.BackColor = Color.White
@@ -46,6 +47,8 @@
Private Sub frmMainV2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
lblVersion.Text = "Version: " & My.Resources.Version
cUserSettings.load()
ShowChat()
btnAuftraege.PerformClick()
End Sub
@@ -57,5 +60,101 @@
frmLogin.UpdateDISPO()
End Sub
Dim Timer_REFRESH_firstTime = True
Private Sub Timer_REFRESH_Tick(sender As Object, e As EventArgs) Handles Timer_Refresh.Tick
If Timer_REFRESH_firstTime Then
Timer_REFRESH_firstTime = False
Exit Sub
End If
Try
If VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_ChatBenutzer And picAVISOMessenger.Visible Then
Dim newMsg = VERAG_PROG_ALLGEMEIN.cMessenger.GET_NewMSG_COUNT()
' MsgBox(newMsg)
Label20.Text = newMsg
Label20.Visible = (newMsg > 0)
If newMsg Then
' Me.Icon = My.Resources.avisoNewMsg
Dim isshown = False
For Each openForm In Application.OpenForms()
If TypeOf (openForm) Is frmNotify Then
isshown = True
End If
Next
Dim isInFront = False
For Each openForm In Application.OpenForms()
If TypeOf (openForm) Is VERAG_PROG_ALLGEMEIN.frmMessenger Then
' If DirectCast(openForm, VERAG_PROG_ALLGEMEIN.frmMessenger).Focused Then
If GetActiveWindow = DirectCast(openForm, VERAG_PROG_ALLGEMEIN.frmMessenger).Handle Then
isInFront = True
End If
End If
Next
If Not isshown And Not isInFront Then newNotify(frmNotify.cNotify_ART.NEUER_CHAT, 0, "Neue Chat-Nachricht!", -1)
Else
' Me.Icon = My.Resources.Aviso
End If
If Label20.Visible Then Label20.BringToFront()
End If
Catch ex As Exception
End Try
End Sub
Sub newNotify(art As frmNotify.cNotify_ART, title As Integer, text As String, id As Integer)
' Exit Sub 'NICHT AKTIV
Dim formTmp = Me.ActiveForm
Dim frmNotify As New frmNotify(art, title, text, id)
frmNotify.TimerInterval = 1200000 ' 20min
Dim tmpY As Integer = Me.Height
If tmpY <= 0 Then tmpY = My.Computer.Screen.WorkingArea.Height
For Each ft As Form In Application.OpenForms
' MsgBox(ft.GetType.ToString)
If ft.GetType.ToString = "frmNotify" Then
If ft.Location.Y < tmpY Then tmpY = ft.Location.Y
End If
Next
frmNotify.Y = tmpY - frmNotify.Height - 10
frmNotify.Show()
' If formTmp IsNot Nothing Then formTmp.Focus()
End Sub
Private Sub picAVISOMessenger_Click(sender As Object, e As EventArgs) Handles picAVISOMessenger.Click
For Each openForm In Application.OpenForms()
If TypeOf (openForm) Is VERAG_PROG_ALLGEMEIN.frmMessenger Then
CType(openForm, VERAG_PROG_ALLGEMEIN.frmMessenger).WindowState = FormWindowState.Normal
CType(openForm, VERAG_PROG_ALLGEMEIN.frmMessenger).BringToFront()
Exit Sub
End If
Next
Dim f As New VERAG_PROG_ALLGEMEIN.frmMessenger
f.Location = Cursor.Position
f.Show(Me)
End Sub
Private Sub ShowChat()
picAVISOMessenger.Enabled = cUserSettings.ChatEnabled
picAVISOMessenger.Visible = cUserSettings.ChatEnabled
Timer_Refresh.Enabled = cUserSettings.ChatEnabled
End Sub
'Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs)
' cUserSettings.ChatEnabled = CheckBox1.Checked
' picAVISOMessenger.Enabled = CheckBox1.Checked
' picAVISOMessenger.Visible = CheckBox1.Checked
'End Sub
Private Sub ChatANAUSToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ChatANAUSToolStripMenuItem.Click
cUserSettings.ChatEnabled = Not cUserSettings.ChatEnabled
cUserSettings.save()
ShowChat()
End Sub
End Class