diff options
author | Jean-Pierre Ledure <jp@ledure.be> | 2019-07-02 11:12:14 +0200 |
---|---|---|
committer | Jean-Pierre Ledure <jp@ledure.be> | 2019-07-02 11:12:14 +0200 |
commit | 5d22b9a022f8c98b6b215860ce45b52aea41633e (patch) | |
tree | 3375606c62c39a43dd2b1a585e6eebbdd32450af /wizards/source | |
parent | a73f537efe225cef1eb0290ad71fad675038273f (diff) |
Access2Base - Addition of SetSelected method in Control class
... to workaround the limitation of Basic on Property Let
+ SetFocus i.o. setFocus (typo)
+ Tabstop i.o. TabStop (typo)
Diffstat (limited to 'wizards/source')
-rw-r--r-- | wizards/source/access2base/Control.xba | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/wizards/source/access2base/Control.xba b/wizards/source/access2base/Control.xba index 1c8a994d3d5c..9f6f36f1ba04 100644 --- a/wizards/source/access2base/Control.xba +++ b/wizards/source/access2base/Control.xba @@ -984,11 +984,11 @@ Error_Function: End Function ' Requery REM ----------------------------------------------------------------------------------------------------------------------- -Public Function setFocus() As Boolean +Public Function SetFocus() As Boolean ' Execute setFocus method - Utils._SetCalledSub("Control.setFocus") + Utils._SetCalledSub("Control.SetFocus") If _ErrorHandler() Then On Local Error Goto Error_Function - setFocus = False + SetFocus = False Dim i As Integer, j As Integer, iColPosition As Integer Dim ocControl As Object, ocGrid As Variant, oGridModel As Object @@ -1017,18 +1017,18 @@ Dim ocControl As Object, ocGrid As Variant, oGridModel As Object Else ControlView.setFocus() End If - setFocus = True + SetFocus = True Exit_Function: - Utils._ResetCalledSub("Control.setFocus") + Utils._ResetCalledSub("Control.SetFocus") Exit Function Error_Function: - TraceError(TRACEABORT, Err, "Control.setFocus", Erl) + TraceError(TRACEABORT, Err, "Control.SetFocus", Erl) Goto Exit_Function Error_Grid: TraceError(TRACEFATAL, ERRFOCUSINGRID, Utils._CalledSub(), 0, 1, Array(_Name, ocGrid._Name)) Goto Exit_Function -End Function ' setFocus V0.9.0 +End Function ' SetFocus V0.9.0 REM ----------------------------------------------------------------------------------------------------------------------- Public Function setProperty(ByVal Optional psProperty As String, ByVal Optional pvValue As Variant, ByVal Optional pvIndex As Variant) As Boolean @@ -1043,6 +1043,19 @@ Public Function setProperty(ByVal Optional psProperty As String, ByVal Optional End Function ' setProperty REM ----------------------------------------------------------------------------------------------------------------------- +Public Function SetSelected(ByVal Optional pvValue As Variant, ByVal Optional pvIndex As Variant) As Boolean +' Workaround for limitation of Basic: Property Let does not accept optional arguments + + If IsMissing(pvValue) Then Call _TraceArguments() + If IsMissing(pvIndex) Then + SetSelected = _PropertySet("Selected", pvValue) + Else + SetSelected = _PropertySet("Selected", pvValue, pvIndex) + End If + +End Function ' SetSelected + +REM ----------------------------------------------------------------------------------------------------------------------- REM --- PRIVATE FUNCTIONS --- REM ----------------------------------------------------------------------------------------------------------------------- Private Function _Formats(ByVal psControlType As String) As Variant @@ -1720,7 +1733,7 @@ Dim oControlEvents As Object, sEventName As String Case UCase("TabIndex") If Utils._hasUNOProperty(ControlModel, "TabIndex") Then _PropertyGet = ControlModel.TabIndex Case UCase("TabStop") - If Utils._hasUNOProperty(ControlModel, "TabStop") Then _PropertyGet = ControlModel.TabStop + If Utils._hasUNOProperty(ControlModel, "Tabstop") Then _PropertyGet = ControlModel.Tabstop Case UCase("Tag") If Utils._hasUNOProperty(ControlModel, "Tag") Then _PropertyGet = ControlModel.Tag Case UCase("Text") |