Strange behavior of TlinkList Class

Post Reply
User avatar
Sakis
Posts: 41
Joined: Fri Oct 21, 2005 2:12 pm
Location: Athens

Strange behavior of TlinkList Class

Post by Sakis »

Hi All

I have the following situation. When i want to display a tree inside a browser (using the TlinkList Class) i faced two different appearences.
When i display the tree structure for the first time display's correctly. When i use the :end() method to release the associated object and after recalling the browser to re-display it, the nodes buttons (+) (-) and the nodes lines straingly dissapears -Or- displayed double when i make a call to another browser to dislpay another tree structure. Trees and BROWSER declared as STATICS.

Here is the code for Browser Redefination (the other browser uses the same characteristics execpt for the different name)

Code: Select all

        
REDEFINE  LISTBOX  JobTree ;
FIELDS SIZES,91,200;
ID 4017;
OF RootDlg                  

JobTree:nLineStyle = 0 // no lines
JobTree:SetTree( MakeTree() )
And here is the 1st Tree Structure ( also the other Tree Structure is similar)

Code: Select all

FUNCTION MakeTree()//
*********************
LOCAL nCounter
LOCAL Containers:=0

IF  ManagmentReq 
     TREE RootTree
           TREEITEM "Πληροφορίες Έργου" RESOURCE "FOLDER_CLOSE", "FOLDER_OPEN"
            TREE
              TREEITEM "Δεν είναι διαθέσημες οι Πληροφορίες Έργου" RESOURCE "NODATA"
              TREEITEM "κατή την λειτουργία της Διαχείρiσης των"
              TREEITEM "Κινήσεων του Έργου." 
              TREEITEM "Για να δείτε τα στοιχεία της κίνησης"
              TREEITEM "επιλέξτε την και μετά αριστερό κλικ"
              TREEITEM "στην λέξη 'ΟΔΗΓΟΣ'"
            ENDTREE    
     ENDTREE
     RootTree:Draw()
     RootTree:OpenAll()
     JobTree:GoTop()
     JobTree:Disable()
     RETURN(RootTree)
ENDIF     

TREE RootTree   // ΚΥΡΙΟ ΔΕΝΔΡΟ <αρχή>

     TREEITEM "Πληροφορίες Έργου" RESOURCE "FOLDER_CLOSE", "FOLDER_OPEN" 
            TREE // ΓΕΝΙΚΕΣ ΠΛΗΡΟΦΟΡΙΕΣ ΕΡΓΟΥ__ <αρχή>
                TREEITEM  "Γενικές Πληροφορίες Έργου" RESOURCE "INFO"
                   TREE  //1ο δένδρο ΓΕΝΙΚΕΣ ΠΛΗΡΟΦΟΡΙΕΣ ΕΡΓΟΥ <αρχή>
                   WITH OBJECT odbJOBS 
                   TREEITEM "Διεύθυνση Έργου : "+:aBuffer[06] RESOURCE "INFO"
                   TREEITEM "Kωδικός Χάρτη   : "+:aBuffer[07] RESOURCE "INFO"
                   TREEITEM "Yπεύθυνος Έργου : "+:aBuffer[08] RESOURCE "INFO"
                   TREEITEM "Tηλ. Υπευθύνου  : "+:aBuffer[09] RESOURCE ;
                            iif (LEFT(:aBuffer[09],2)="69","CELL","PHONE")
                   TREEITEM "1o Tηλέφ. Έργου : "+:aBuffer[10] RESOURCE "PHONE"
                   TREEITEM "2o Tηλεφ. Έργου : "+:aBuffer[11] RESOURCE "PHONE"
                   TREEITEM "3o Tηλεφ. Έργου : "+:aBuffer[12] RESOURCE "PHONE"
                   TREEITEM "Αριθμ FAX Έργου : "+:aBuffer[13] RESOURCE "FAX"   
                      END // WITH OBJECT odbJOBS
                    ENDTREE   // 1ο δένδρο ΓΕΝΙΚΕΣ ΠΛΗΡΟΦΟΡΙΕΣ ΕΡΓΟΥ <τέλος> 
                TREEITEM  "Που Τιμολογούμε ;" RESOURCE "OPTION"
                   TREE   // 2ο δένδρο ΠΟΥ ΤΙΜΟΛΟΓΟΥΜΕ <αρχή> ;
                    WITH OBJECT odbCUSTOMERS
                         //odbCUSTOMERS:Goto(nCustPosition)
                   TREEITEM "Eπωνυμία : "+:aBuffer[02] RESOURCE "OPTION"
                   TREEITEM "Eπάγγελμα: "+:aBuffer[03] RESOURCE "OPTION"
                   TREEITEM "Διεύθυνση: "+:aBuffer[05] RESOURCE "OPTION"
                   TREEITEM "Α.Φ.Μ    : "+:aBuffer[08] RESOURCE "OPTION"
                   TREEITEM "Δ.Ο.Υ    : "+:aBuffer[09] RESOURCE "OPTION"
                    END // WITH OBJECT odbCUSTOMERS
                   ENDTREE    //2ο δένδρο  ΠΟΥ ΤΙΜΟΛΟΓΟΥΜΕ; <τέλος>  
              ENDTREE  // ΓΕΝΙΚΕΣ ΠΛΗΡΟΦΟΡΙΕΣ ΕΡΓΟΥ__ <τέλος>    
       TREEITEM  "Kινήσεις του Έργου" RESOURCE "FOLDER_CLOSE","FOLDER_OPEN"
       TREEITEM  "Eκκρεμότητες Έργου" RESOURCE "FOLDER_CLOSE","FOLDER_OPEN"
       TREEITEM  "Εγκαταστάσεις Έργου" RESOURCE "FOLDER_CLOSE","FOLDER_OPEN"
           TREE    //5o Δένδρο
                IF ! odbLOGISTICS = NIL  
                     odbLOGISTICS:Activate() 
                ELSE 
                     OpenLOGISTICS() 
                ENDIF
                WITH OBJECT odbLOGISTICS
                      If Empty (odbLOGISTICS:IndexName())
                                odbLOGISTICS:AddIndex("LOGISTICS")
                      endif          
               
                      :Seek(cJobCode)
                           IF :Found() 
                 FOR nCounter:= 2 TO 5 ; Containers:=Containers + :aBuffer[nCounter]; NEXT
                 
                       IF Containers <> 0                  
                              TREEITEM "Εγκατεστημένα 10άρια________"+ALLTRIM(STR(:aBuffer[02],3,0));
                              RESOURCE "TRUCK"
                              TREEITEM "Eγκατεστημένα 30άρια________"+ALLTRIM(STR(:aBuffer[03],3,0));
                              RESOURCE "TRUCK"
                              TREEITEM "Εγκατεσημένα  PC12άρια______"+ALLTRIM(STR(:aBuffer[04],3,0));
                              RESOURCE "TRUCK"
                              TREEITEM "Εγκατεστημένα PC20άρια______"+ALLTRIM(STR(:aBuffer[05],3,0));
                              RESOURCE "TRUCK"
                              TREEITEM "Ημερομηνία 1ης Eγκατάστασης__"+DTOC(:aBuffer[06]);
                              RESOURCE "TRUCK"
                        ELSE
                              TREEITEM:Delete()
                        ENDIF      
                           ELSE
                              TREEITEM:DELETE()
                           ENDIF  // IF FOUND
               END // WITH OBJECT odbLOGISTICS
           ENDTREE // 5o Δένδρο 
  ENDTREE  //ΚΥΡΙΟ ΔΕΝΔΡΟ <τέλος>
RootTree:Draw()
JobTree:BugUp()
JobTree:Refresh()
ExitReq:=.T.
RETURN(RootTree)
Any help would be apreciate

Thanks in advance
Dionisis

P.S I can provide a photo with the problem but i don't have any URL available to upload it as these forums dont accept attachments yet. I hope in the future Antonio make the attachements availables.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Demetrios,

As you have found yourself, better use a TreeView 32 bits.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply