laatzen/Pruef2000/source/Shared/universal/MsgBox.bas
2021-10-01 11:11:04 +02:00

95 lines
2.2 KiB
QBasic

Attribute VB_Name = "modMsgBox"
'==============================================================================
'
' File : MsgBox.bas
' Date : 23.03.1999
' Version: 1.01
' Author : Andreas Schmidt, lindner&partner
'
'==============================================================================
'
' *shared*
'
' Hilfsfunktionen für Message Boxen.
'
' Abhängigkeiten:
' ---------------
'
'==============================================================================
'
' History:
'
' Date : 23.03.1999
' Version: 1.01
'
' Jede MsgBox zeigt jetzt den Titel der Applikation in der Titelleiste an.
' @see setStdCaption
'
' Date : 11.02.1999
' Version: 1.00
' Author : Andreas Schmidt, lindner&partner
'
' Erste Version.
'
'==============================================================================
Option Explicit
Public Sub setStdCaption(sCaption As String)
Call getSetStdCaption(True, sCaption)
End Sub
Private Function getStdCaption() As String
'getStdCaption = getSetStdCaption(False)
getStdCaption = ""
End Function
Private Function getSetStdCaption(bSet As Boolean, Optional sCaption As String) As String
Static s As String
If bSet Then s = sCaption
getSetStdCaption = s
End Function
' OK-MessageBox
'
' @param sMsg anzuzeigender Text
'
Public Sub OKMsgBox(sMsg As String)
Call MsgBox(sMsg, vbOKOnly, getStdCaption())
End Sub
' Exclamation-MessageBox
'
' @param sMsg anzuzeigender Text
'
Public Sub ExclMsgBox(sMsg As String)
Call MsgBox(sMsg, vbExclamation Or vbOKOnly, getStdCaption())
End Sub
' Exclamation-MessageBox für einen Fehlerhinweis ausgeben
'
' @param sMsg anzuzeigender Text
'
Public Sub ErrorMsgBox(sMsg As String)
LogIntoDB sMsg, "Softwarefehler"
Call ExclMsgBox("Es ist leider ein Fehler aufgetreten!" & vbCrLf & vbCrLf & sMsg)
End Sub
' Stop-MessageBox
'
' @param sMsg anzuzeigender Text
'
Public Sub StopMsgBox(sMsg As String)
Call MsgBox(sMsg, vbCritical Or vbOKOnly, getStdCaption())
End Sub
' YesNo-MessageBox
'
' @param sMsg anzuzeigender Text
'
Public Function YesNoMsgBox(sMsg As String) As Boolean
Dim nRet As Integer
nRet = MsgBox(sMsg, vbQuestion Or vbYesNo, getStdCaption())
YesNoMsgBox = (nRet = vbYes)
End Function