View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0009098 | MMW v4 | Framework: Scripts/Extensions | public | 2012-02-06 00:14 | 2012-02-06 14:51 |
Reporter | zvezdan | Assigned To | |||
Priority | none | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | won't fix | ||
Summary | 0009098: FirstChildNode removes a sign for expanding node from collapsed nodes | ||||
Description | FirstChildNode method removes sign for expanding node as if a node has not child nodes. It does that for many nodes, especially those that are not previously expanded/collapsed, which also means that it behaves like that only for collapsed nodes. Such behavior is since I remember, maybe even in MM2. Here is the test code: Option Explicit Sub OnStartUp() Dim mnuTest Set mnuTest = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0) mnuTest.Caption = "Plus Sign Test" mnuTest.OnClickFunc = "Test" mnuTest.UseScript = Script.ScriptPath End Sub Sub Test(oItem) Dim oPrntNode Dim oTreeNode Set oPrntNode = SDB.MainTree.CurrentNode If oPrntNode Is Nothing Then Exit Sub Set oTreeNode = SDB.MainTree.FirstChildNode(oPrntNode) End Sub | ||||
Steps To Reproduce | - Restart the program, so none node is expanded by default; - expand Entire Library; - select Location node; - choose Edit | Test -> there is still [+] sign (i.e. sign for expanding nod) in the front of Location node, but when you hoover a mouse cursor over the Location node it would disappear. | ||||
Additional Information | I am using something like this to overcome that problem: bHasChildren = oPrntNode.HasChildren Set oTreeNode = SDB.MainTree.FirstChildNode(oPrntNode) ... oPrntNode.HasChildren = bHasChildren | ||||
Tags | No tags attached. | ||||
Fixed in build | |||||
|
Yes, that's how it works in the underlying tree control and so we decided to expose this as is. |
|
Well, your answer is not surprise for me, it is like usual. This is obviously a bug and should be treated like that. The FirstChildNode method should not affect HasChildren property, especially not if node actually has children, i.e. FirstChildNode (and subsequent NextSiblingNode) returns something different than Nothing. If this is so hard for you resolve, you should at least document that in wiki. |
|
Do you mean that you have an example where FirstChildNode really does return a node, but it modified HasChildren property to false? That would certainly be a bug. |
|
I am sorry, you are right. FirstChildNode doesn't return a node but Nothing if its parent is not been previously expanded. However, in my opinion, that is also some kind of a bug if some parent node must be previously expanded if we want FirstChildNode and HasChildren to return correct values. At least you should state that in wiki. |