Kaydet (Commit) 86a773cd authored tarafından Jean-Pierre Ledure's avatar Jean-Pierre Ledure

Access2Base - Database events

Introduce 21 database On... events returning the invoked scripts
Read-only
üst 16598d52
...@@ -102,6 +102,111 @@ Property Get ObjectType() As String ...@@ -102,6 +102,111 @@ Property Get ObjectType() As String
ObjectType = _PropertyGet("ObjectType") ObjectType = _PropertyGet("ObjectType")
End Property ' ObjectType (get) End Property ' ObjectType (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnCreate() As String
OnCreate = _PropertyGet("OnCreate")
End Property ' OnCreate (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnFocus() As String
OnFocus = _PropertyGet("OnFocus")
End Property ' OnFocus (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnLoad() As String
OnLoad = _PropertyGet("OnLoad")
End Property ' OnLoad (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnLoadFinished() As String
OnLoadFinished = _PropertyGet("OnLoadFinished")
End Property ' OnLoadFinished (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnModifyChanged() As String
OnModifyChanged = _PropertyGet("OnModifyChanged")
End Property ' OnModifyChanged (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnNew() As String
OnNew = _PropertyGet("OnNew")
End Property ' OnNew (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnPrepareUnload() As String
OnPrepareUnload = _PropertyGet("OnPrepareUnload")
End Property ' OnPrepareUnload (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnPrepareViewClosing() As String
OnPrepareViewClosing = _PropertyGet("OnPrepareViewClosing")
End Property ' OnPrepareViewClosing (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnSave() As String
OnSave = _PropertyGet("OnSave")
End Property ' OnSave (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnSaveAs() As String
OnSaveAs = _PropertyGet("OnSaveAs")
End Property ' OnSaveAs (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnSaveAsDone() As String
OnSaveAsDone = _PropertyGet("OnSaveAsDone")
End Property ' OnSaveAsDone (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnSaveAsFailed() As String
OnSaveAsFailed = _PropertyGet("OnSaveAsFailed")
End Property ' OnSaveAsFailed (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnSaveDone() As String
OnSaveDone = _PropertyGet("OnSaveDone")
End Property ' OnSaveDone (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnSaveFailed() As String
OnSaveFailed = _PropertyGet("OnSaveFailed")
End Property ' OnSaveFailed (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnSubComponentClosed() As String
OnSubComponentClosed = _PropertyGet("OnSubComponentClosed")
End Property ' OnSubComponentClosed (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnSubComponentOpened() As String
OnSubComponentOpened = _PropertyGet("OnSubComponentOpened")
End Property ' OnSubComponentOpened (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnTitleChanged() As String
OnTitleChanged = _PropertyGet("OnTitleChanged")
End Property ' OnTitleChanged (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnUnfocus() As String
OnUnfocus = _PropertyGet("OnUnfocus")
End Property ' OnUnfocus (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnUnload() As String
OnUnload = _PropertyGet("OnUnload")
End Property ' OnUnload (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnViewClosed() As String
OnViewClosed = _PropertyGet("OnViewClosed")
End Property ' OnViewClosed (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get OnViewCreated() As String
OnViewCreated = _PropertyGet("OnViewCreated")
End Property ' OnViewCreated (get)
REM ----------------------------------------------------------------------------------------------------------------------- REM -----------------------------------------------------------------------------------------------------------------------
Property Get Version() As String Property Get Version() As String
Version = _PropertyGet("Version") Version = _PropertyGet("Version")
...@@ -1654,7 +1759,14 @@ End Function ' _OutputToHTML V1.4.0 ...@@ -1654,7 +1759,14 @@ End Function ' _OutputToHTML V1.4.0
REM ----------------------------------------------------------------------------------------------------------------------- REM -----------------------------------------------------------------------------------------------------------------------
Private Function _PropertiesList() As Variant Private Function _PropertiesList() As Variant
_PropertiesList = Array("Connect", "Name", "ObjectType", "Version") _PropertiesList = Array("Connect", "Name", "ObjectType" _
, "OnCreate", "OnFocus", "OnLoad", "OnLoadFinished", "OnModifyChanged" _
, "OnNew", "OnPrepareUnload", "OnPrepareViewClosing", "OnSave", "OnSaveAs" _
, "OnSaveAsDone", "OnSaveAsFailed", "OnSaveDone", "OnSaveFailed", "OnSaveTo" _
, "OnSaveToDone", "OnSaveToFailed", "OnSubComponentClosed", "OnSubComponentOpened" _
, "OnTitleChanged", "OnUnfocus", "OnUnload", "OnViewClosed", "OnViewCreated" _
, "Version" _
)
End Function ' _PropertiesList End Function ' _PropertiesList
...@@ -1662,6 +1774,8 @@ REM ---------------------------------------------------------------------------- ...@@ -1662,6 +1774,8 @@ REM ----------------------------------------------------------------------------
Private Function _PropertyGet(ByVal psProperty As String) As Variant Private Function _PropertyGet(ByVal psProperty As String) As Variant
' Return property value of the psProperty property name ' Return property value of the psProperty property name
Dim i As Integer, vEvents As Variant, sEvent As String, vEvent As Variant
If _ErrorHandler() Then On Local Error Goto Error_Function If _ErrorHandler() Then On Local Error Goto Error_Function
Utils._SetCalledSub("Database.get" & psProperty) Utils._SetCalledSub("Database.get" & psProperty)
...@@ -1675,6 +1789,29 @@ Private Function _PropertyGet(ByVal psProperty As String) As Variant ...@@ -1675,6 +1789,29 @@ Private Function _PropertyGet(ByVal psProperty As String) As Variant
_PropertyGet = Title _PropertyGet = Title
Case UCase("ObjectType") Case UCase("ObjectType")
_PropertyGet = _Type _PropertyGet = _Type
Case UCase("OnCreate"), UCase("OnFocus"), UCase("OnLoad"), UCase("OnLoadFinished"), UCase("OnModifyChanged") _
, UCase("OnNew"), UCase("OnPrepareUnload"), UCase("OnPrepareViewClosing"), UCase("OnSave"), UCase("OnSaveAs") _
, UCase("OnSaveAsDone"), UCase("OnSaveAsFailed"), UCase("OnSaveDone"), UCase("OnSaveFailed"), UCase("OnSaveTo") _
, UCase("OnSaveToDone"), UCase("OnSaveToFailed"), UCase("OnSubComponentClosed"), UCase("OnSubComponentOpened") _
, UCase("OnTitleChanged"), UCase("OnUnfocus"), UCase("OnUnload"), UCase("OnViewClosed"), UCase("OnViewCreated")
' Find script event
sEvent = ""
vEvents = Document.getEvents().ElementNames ' Returns an array
For i = 0 To UBound(vEvents)
If UCase(vEvents(i)) = UCase(psProperty) Then sEvent = vEvents(i)
Next i
If sEvent = "" Then
_PropertyGet = ""
Else
vEvent = Document.getEvents().getByName(sEvent)
If IsEmpty(vEvent) Then
_PropertyGet = ""
ElseIf vEvent(0).Value <> "Script" Then
_PropertyGet = ""
Else
_PropertyGet = vEvent(1).Value
End If
End If
Case UCase("Version") Case UCase("Version")
_PropertyGet = MetaData.getDatabaseProductName() & " " & MetaData.getDatabaseProductVersion _PropertyGet = MetaData.getDatabaseProductName() & " " & MetaData.getDatabaseProductVersion
Case Else Case Else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment