summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
Diffstat (limited to 'wizards')
-rw-r--r--wizards/source/sfdialogs/SF_DialogControl.xba20
1 files changed, 11 insertions, 9 deletions
diff --git a/wizards/source/sfdialogs/SF_DialogControl.xba b/wizards/source/sfdialogs/SF_DialogControl.xba
index 1b8c72cc25fe..161ff1d2b571 100644
--- a/wizards/source/sfdialogs/SF_DialogControl.xba
+++ b/wizards/source/sfdialogs/SF_DialogControl.xba
@@ -491,7 +491,7 @@ End Property ' SFDialogs.SF_DialogControl.XControlView (get)
REM -----------------------------------------------------------------------------
Property Get XTreeDataModel() As Object
-''' The XTreeDataModel property returns the model UNO object of the control
+''' The XTreeDataModel property returns the mutable data model UNO object of the tree control
XTreeDataModel = _PropertyGet("XTreeDataModel", Nothing)
End Property ' SFDialogs.SF_DialogControl.XTreeDataModel (get)
@@ -504,7 +504,7 @@ Public Function AddSubNode(Optional ByRef ParentNode As Variant _
) As Variant
''' Return a new node of the tree control subordinate to a parent node
''' Args:
-''' ParentNode: A node UNO object, of type com.sun.star.awt.tree.XMutableTreeNode
+''' ParentNode: A node UNO object, of type com.sun.star.awt.tree.XMutableTreeNode
''' DisplayValue: the text appearing in the control box
''' DataValue: any value associated with the new node. Default = Empty
''' Returns:
@@ -564,7 +564,7 @@ Public Function AddSubTree(Optional ByRef ParentNode As Variant _
''' A1 B1 C2 |__ B1
''' A1 B2 C3 |__ C1
''' A2 B3 C4 |__ C2
-''' A2 B3 C5 B2
+''' A2 B3 C5 |__ B2
''' A3 B4 C6 |__ C3
''' |__ A2
''' |__ B3
@@ -574,23 +574,23 @@ Public Function AddSubTree(Optional ByRef ParentNode As Variant _
''' |__ B4
''' |__ C6
''' Typically, such an array can be issued by the GetRows method applied on the SFDatabases.Database service
-''' when the array item containing the text to be displayed is = "" or is empty/null,
+''' when an array item containing the text to be displayed is = "" or is empty/null,
''' no new subnode is created and the remainder of the row is skipped
''' WithDataValue:
''' When False (default), every column of FlatTree contains the text to be displayed in the tree control
''' When True, the texts to be displayed (DisplayValue) are in columns 0, 2, 4, ...
''' while the DataValues are in columns 1, 3, 5, ...
''' Returns:
-''' The new node UNO object: com.sun.star.awt.tree.XMutableTreeNode
+''' True when successful
''' Examples:
''' Dim myTree As Object, theRoot As Object, oDb As Object, vData As Variant
''' Set myTree = myDialog.Controls("myTreeControl")
''' Set theRoot = myTree.CreateRoot("By product category")
''' Set oDb = CreateScriptService("SFDatabases.Database", "/home/.../mydatabase.odb")
''' vData = oDb.GetRows("SELECT [Category].[Name], [Category].[ID], [Product].[Name], [Product].[ID] " _
-''' & "FROM [Category], [PRODUCT] WHERE [Product].[CategoryID] = [Category].[ID] " _
+''' & "FROM [Category], [Product] WHERE [Product].[CategoryID] = [Category].[ID] " _
''' & "ORDER BY [Category].[Name], [Product].[Name]")
-''' myTree.AddSubTree(theRoot, vData)
+''' myTree.AddSubTree(theRoot, vData, WithDataValue := True)
Dim bSubTree As Boolean ' Return value
Dim oNode As Object ' com.sun.star.awt.tree.XMutableTreeNode
@@ -668,7 +668,7 @@ REM ----------------------------------------------------------------------------
Public Function CreateRoot(Optional ByVal DisplayValue As Variant _
, Optional ByRef DataValue As Variant _
) As Variant
-''' Return a new root node of the tree control. The new tree root is inserted below pre-exiting root nodes
+''' Return a new root node of the tree control. The new tree root is inserted below pre-existing root nodes
''' Args:
''' DisplayValue: the text appearing in the control box
''' DataValue: any value associated with the root node. Default = Empty
@@ -826,6 +826,7 @@ Public Function Properties() As Variant
"Cancel" _
, "Caption" _
, "ControlType" _
+ , "CurrentNode" _
, "Default" _
, "Enabled" _
, "Format" _
@@ -861,6 +862,7 @@ Public Function Properties() As Variant
, "Visible" _
, "XControlModel" _
, "XControlView" _
+ , "XTreeDataModel" _
)
End Function ' SFDialogs.SF_DialogControl.Properties
@@ -1503,7 +1505,7 @@ Const cstSubArgs = "Value"
If oSession.HasUNOProperty(_ControlModel, "Label") Then _ControlModel.Label = pvValue
Case Else : GoTo CatchType
End Select
- Case UCAse("CurrentNode")
+ Case UCase("CurrentNode")
Select Case _ControlType
Case CTLTREECONTROL
If Not ScriptForge.SF_Utils._Validate(pvValue, "Selection", ScriptForge.V_OBJECT) Then GoTo Finally