Attribute VB_Name = "z_UIMessages" ' Messaging module Option Private Module Option Explicit Public Enum MsgCode EM_MISSING_CONFIG IM_WRAPPER_OK End Enum Private g_UI As API_UserInteraction Public Function UserInteraction() As API_UserInteraction If g_UI Is Nothing Then _ Set g_UI = New API_UserInteraction Set UserInteraction = g_UI End Function Public Function SetUserInteraction(newUI As API_UserInteraction) Set g_UI = newUI End Function Public Function UIShowMessage(theCode As MsgCode, ParamArray params() As Variant) Dim unwrapped As Variant: unwrapped = params unwrapped = FixForwardedParams(unwrapped) Select Case theCode Case IM_WRAPPER_OK: Call MsgBox(Fmt("Успешно сгенерирован VBA API: {1}", unwrapped), vbInformation) Case EM_MISSING_CONFIG: Call MsgBox(Fmt("Не удалось найти глобальный конфиг: {1}", unwrapped), vbExclamation) Case Else: Call MsgBox("Неверный код сообщения", vbCritical) End Select End Function Public Function UIAskQuestion(theCode As MsgCode, ParamArray params() As Variant) As Boolean Dim unwrapped As Variant: unwrapped = params unwrapped = FixForwardedParams(unwrapped) Dim answer&: answer = vbNo Select Case theCode 'Case QM_CODE_DELETE_CONFIRM ' answer = MsgBox("Are you sure you want to delete ALL macros from target file?", vbYesNo + vbQuestion) Case Else Call MsgBox("Неверный код сообщения", vbCritical) End Select UIAskQuestion = answer = vbYes End Function