Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to do this ? VFP6
Message
De
26/04/2004 04:01:28
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
26/04/2004 00:22:26
Suhas Hegde
Dental Surgeon
Sirsi, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00898040
Message ID:
00898067
Vues:
15
>hi all,
>here is what i am trying to acomplish. Maybe may of u would have already done this so it would be better for me to ask.
>
>I have a form and many,many controls on it.
>like a pageframe - pages - containers and again pageframes -.....
>
>I would like to have a treectrl to display those and in turn when clicked bring that frame up with the focus on the control clicked. like if it is label then the next textbox would take the focus. and if it is the textbox it will be focused. if the page then the activate would trigger.
>
>Is there any ready solution u know of or would i have to do it ?
>
>suhashegde

Suhas,
Addition to other message on XX :
* Form.Filltree - fills the nodes from a cursor/table
* Define some constants.
#Define tvwFirst	0
#Define tvwLast	1
#Define tvwNext	2
#Define tvwPrevious	3
#Define tvwChild	4

With This.OleTree
  .linestyle =1
  .labeledit =1
  .indentation = 5
  .PathSeparator = '\'
  .Scroll = .T.
  .OLEDragMode = 0
  .OLEDropMode = 0
  .CheckBoxes = .F.
Endwith

Select * ;
  from myCursor ;
  order By Level,Item ;
  into Cursor crsItems ;
  nofilter

Local oNode
With This.OleTree.nodes
  Scan
    If crsItems.Level = 0
      .Add(,tvwFirst,;
      Trim(crsItems.NodeID),;
      Trim(crsItems.NodeText))
    Else
      .Add(Trim(crsItems.ParentID), tvwChild, ;
      Trim(crsItems.NodeID), ;
      Trim(crsItems.NodeText))
    Endif
  Endscan
Endwith
Use In 'crsItems'
Use in 'myCursor'

* Tree.NodeClick
*** ActiveX Control Event ***
LPARAMETERS node
Node.ensurevisible
thisform.ItemSelected(Node.Key)

* Form.ItemSelected
Lparameters tcNodeID
this.oletree.object.Enabled = .F. && If for any reason needs to be disabled 
Local loRec
loRec = this.GetItemFromNodeID(m.tcNodeID)
* loRec - related record as object
* do whatever here
* ie: 
* with eval(loRec.ObjectHierarchy)
*    .SetFocus()
* endwith
this.oletree.object.Enabled = .T.

* Form.GetItemFromNodeID
Lparameters tcNodeID
Local loItem
* In my case all NodeID's are simply '_'+recno()
Select * from myCursor ;
   where Val(Substr(NodeId,2)) == Val(Substr(m.tcNodeId,2)) ;
   into cursor crsNode
Scatter name loItem memo
USE in 'myCursor'
USE in 'crsNode'
Return loItem
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform