|
|
|||||||
Kixforms-Classic 2.4.6 [PTBR] Olá a todo eu não estou conseguindo selecionar um node, não sei, mas acredito que seja a sintaxe que estou usando errado. É desta forma que se usa, eu não entendi! [ENG] Hello to all I'm not achieved, select a node, I do not know, but believe me it's a syntax that I'm using wrong. This is how it is used, I do not understand! Quote: $tree.nodes(1).SelectedNode |
||||||||
|
|
|||||||
Olá Andre, questions first: - How many branches does your tree have? - Do you want to get or set .SelectedNode? |
||||||||
|
|
|||||||
[PTBR] A minha árvore não possuí subárvores. e eu quero definir eu quero que um dos nós sejam selecionados. Você me entende? [ENG] My tree has no subtrees. and I want to define I want one of the nodes to be selected. You understand me? Ex: $tree.Nodes(0).text = 'ola' $tree.Nodes(1).text = 'ola1' $tree.Nodes(2).text = 'ola2' $tree.Nodes(3).text = 'ola3' $tree.Nodes(2).selectedNode [PTBR] Dá para entender com este exemplo o que quero fazer? Obrigado desde já! [ENG] Can you understand by this example what I want to do? Thank you in advance! : D |
||||||||
|
|
|||||||
Ja, I understand perfectly now you want to do this then: Code: $tree = $system.TreeView ;or, if you use the form as parent: $tree = $form.TreeView $tree.Nodes.Add('ola') $tree.Nodes.Add('ola1') $tree.Nodes.Add('ola2') $tree.Nodes.Add('ola3') $tree.SelectedNode = 2 If you don't have it already, I recomend you keep this little helper with you: http://www.kixforms.org/assets/files/kixforms/KiXforms_246.chm hth |
||||||||
|
|
|||||||
[PTBR] Olá, ainda não funcionou, veja só: [ENG] Hello, it still did not work, see: Code: Break on $system = createObject('kixtart.system') $form = $system.Form() $tree = $form.TreeView ;or, if you use the form as parent: $tree = $form.TreeView $=$tree.Nodes.Add('ola') $=$tree.Nodes.Add('ola1') $=$tree.Nodes.Add('ola2') $=$tree.Nodes.Add('ola3') $form.Show while $form.visible $tree.SelectedIndex = 2 $tree.SelectedNode.index? $=Execute($form.DoEvents(1)) loop [PTBR] Ele deveria ter selecionado o "ola2", e não foi isso que ele fez, ele não seleciona nada, na verdade. [ENG] He should have selected the "hello2", and that's not what he did, he does not select anything, actually. |
||||||||
|
|
|||||||
My Bad, have made one mistake (don't use Kixtart.System object for .Form objects) and a wrong assumption.. >The value of SelectedNode is of course an object not an index My only excuse is my long put to rest kixforms kung fu this works as requested: Code: Break on $system = createObject('kixtart.system') $form = $system.Form() $tree = $form.TreeView $0=$tree.Nodes.Add('ola') $1=$tree.Nodes.Add('ola1') $2=$tree.Nodes.Add('ola2') $3=$tree.Nodes.Add('ola3') $tree.SelectedNode = $2 $form.Show while $form.visible $=Execute($form.DoEvents(1)) loop |
||||||||
|
|
|||||||
[PTBR] Obrigado!!! Assim também funciona. [ENG] Thank you!!! So does it work. Code: Break on $system = createObject('kixtart.system') $form = $system.Form() $tree = $form.TreeView $=$tree.Nodes.Add('ola') $=$tree.Nodes.Add('ola1') $=$tree.Nodes.Add('ola2') $=$tree.Nodes.Add('ola3') $tree.SelectedNode = $tree.Nodes(2) $form.Show while $form.visible $=Execute($form.DoEvents(1)) loop |
||||||||
|
|
|||||||
thats even the better approach |