General information
Category:
ActiveX controls in VFP
HI Doug !
Thank you for your help.
There is the first success with "Draging and droping"
But i'm still to stupid to set the expanded property when adding nodes !
Invalid parameter, invalid or unknown name ...
Here is my code to generate the treeview.
I think i have to set the property expanded = .T. after i do an nodes.add
(or scan...endscan when finished with generating ???)
Can you please tell me the correct systax for coding and where to put it in ?
Best regards
Albert
dimension ursprung(100)
dimension ursprung_alt(100)
thisform.pageframe1.page2.m_treeview.Nodes.Clear
****************************************************************************************************************
*my data
* stufe oberobjekt objekt uo_bezeichnung
* 1 b1 b1 building
* 1 b1 f1 floor1
* 2 f1 r1 room1 in floor1
* 3 r1 e1 environment e1 in room1 in floor1
* 2 f1 r2 room2 in floor1
* 1 b1 f2 floor2
* 2 f2 r22 room22 in floor2
* 3 r22 e22a environment e22a in room r22 in floor2
* 3 r22 e22b environment e22b in room r22 in floor2
* 1 b1 f3 floor 3
*
select struktur
* build startnode ***********************************************************************
zaehler = 0
aktuelle_stufe = 1
ursprung(1) = "root"
ursprung_alt(1) = "root"
*header record (building)
thisform.pageframe1.page2.m_treeview.nodes.add(,,ursprung,"Kopf-Objekt " + struktur.oberobjekt + " " + struktur.ob_bezeichnung)
*now structure of the biulding
do while .not. eof()
*key
node = "node"+alltrim(str(struktur.satznr))
*Untergeordnetes objekt !!
do case
case struktur.stufe = 1
aktuelle_stufe = struktur.stufe
ursprung(1) = "root"
ursprung_alt(1) = "root"
** build node ***
thisform.pageframe1.page2.m_treeview.nodes.add(ursprung (aktuelle_stufe),4,node,;
"Stufe"+ str(aktuelle_stufe,2) + " Pos= " + padl(trans(struktur.objposition),4,' ') + " Objekt " + ALLTRIM(struktur.objektnr) + " " + struktur.uo_bezeichnung)
case struktur.stufe > aktuelle_stufe and struktur.stufe > 1
aktuelle_stufe = struktur.stufe
** build node ***
thisform.pageframe1.page2.m_treeview.nodes.add(ursprung(aktuelle_stufe),4,node,;
"Stufe"+ str(aktuelle_stufe,2) + " Pos= " + padl(trans(struktur.objposition),4,' ') + " Objekt "+ ALLTRIM(struktur.objektnr) + " " + struktur.uo_bezeichnung)
case struktur.stufe = aktuelle_stufe and struktur.stufe > 1
aktuelle_stufe = struktur.stufe
** build node ***
thisform.pageframe1.page2.m_treeview.nodes.add(ursprung(aktuelle_stufe),4,node,;
"Stufe"+ str(aktuelle_stufe,2) + " Pos= " +padl(trans(struktur.objposition),4,' ') + " Objekt "+ ALLTRIM(struktur.objektnr) + " " + struktur.uo_bezeichnung)
case struktur.stufe < aktuelle_stufe and struktur.stufe > 1
aktuelle_stufe = struktur.stufe
** build node ***
thisform.pageframe1.page2.m_treeview.nodes.add(ursprung_alt(aktuelle_stufe),4,node,;
"Stufe"+ str(aktuelle_stufe,2) + " Pos= " + padl(trans(struktur.objposition),4,' ') + " Objekt "+ ALLTRIM(struktur.objektnr) + " " + struktur.uo_bezeichnung)
endcase
*next record
skip 1 in struktur
if not eof()
* prüfen ob Sprung in nächste Stufe
if struktur.stufe > aktuelle_stufe
ursprung_alt(aktuelle_stufe) = ursprung(aktuelle_stufe)
ursprung(struktur.stufe) = node
endif
* prüfen ob Sprung in eine vorherige Stufe
if struktur.stufe < aktuelle_stufe
ursprung(struktur.stufe) = ursprung_alt(struktur.stufe)
endif
endif
enddo
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only