1 / 23

Using TreeView ActiveX Control in VFP

Using TreeView ActiveX Control in VFP. Venelina Jordanova JEI Varna, Bulgaria. Who am I ?. Master degree in CS from TU of Varna MCP FoxPro developer since v 2.0 Developer of various different information systems Speaker at Frankfurt Devcon 2003 and 2004, Prague 2004 and 2005 and

Download Presentation

Using TreeView ActiveX Control in VFP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using TreeView ActiveX Control in VFP Venelina Jordanova JEI Varna, Bulgaria Data access techniques using CursorAdapter class

  2. Who am I ? • Master degree in CS from TU of Varna • MCP • FoxPro developer since v 2.0 • Developer of various different information systems • Speaker at Frankfurt Devcon 2003 and 2004, Prague 2004 and 2005 and Microsoft Developers Day-Varna 2005 • Owner of JEI - Varna, Bulgaria Outsourcing center venelina@mnet.bg Data access techniques using CursorAdapter class

  3. Overview • What can we do with TreeView ActiveX Control • hierarchical data • card-index • organization trees • drill-down organized information • not data-bound control • programming • delayed loading • drag-drop Data access techniques using CursorAdapter class

  4. Adding a TreeView ActiveX control to a form • ActiveX controls selection in VFP Options dialog • Form Controls toolbar • Control specific property sheet • Help file - cmctl198.chm Data access techniques using CursorAdapter class

  5. TreeView ActiveX control properties, events and methods • Objects you work with: • TreeView control • Nodes collection • Node objects • ActiveX controls are part of an OLE Container control • Use the container's Object property Thisform.oTreeView.Object.Indentation = 10 Data access techniques using CursorAdapter class

  6. Style MousePointer LineStyle LabelEdit ImageList .oTreeView.Object. ImageList =.oImageList.Object BorderStyle, Appearance, OLEDragMode and OLEDragMode known from VFP Indentation PathSeparator HideSelection Sorted FullRowSelect Checkboxes SingleSel Scroll HotTracking TreeView Control Properties • TreeView Control Property sheet Data access techniques using CursorAdapter class

  7. TreeView Control Properties • Fontpage • Font object • Picturepage • Custom Mouse pointer Data access techniques using CursorAdapter class

  8. TreeView Control Properties • Properties, not listed in property sheet: • DropHighlight • Nodes • SelectedItem Data access techniques using CursorAdapter class

  9. TreeView Control Methods and Events • BeforeLabelEdit, AfterLabelEdit • Collapse, Expand • GetVisibleCount • HitTest • use GetDeviceCaps API function for TWIPS-to-Pixels conversion • NodeCheck • NodeClick • StartLabelEdit Data access techniques using CursorAdapter class

  10. Nodes Collection Properties • Count • Item(<Index>) Data access techniques using CursorAdapter class

  11. Nodes Collection Methods • Add <Object>.Nodes.Add(Relative, Relationship, Key, Text, Image, SelectedImage) • Relationship: • 0 - First • 1 - Last • 2 - (Default) Next • 3 - Previous • 4 - Child • Clear • Remove Data access techniques using CursorAdapter class

  12. Node Object Properties • Children • Expanded • FullPath • Image, ExpandedImage, and SelectedImage • Key • Child, FirstSibling, LastSibling, Previous, Parent, Next, and Root • Selected • Text Data access techniques using CursorAdapter class

  13. Node Object Methods • CreateDragImage • EnsureVisible Data access techniques using CursorAdapter class

  14. Programming the TreeView control • SYS(2333) • _VFP.AutoYield • use the Object property Data access techniques using CursorAdapter class

  15. Load data in TreeView control • Initializing ImageList property • Preparing data to be load • Loading nodes • Image indexes • Key expressions • Code to position to the data record • Demo – OrdersByMonth form Data access techniques using CursorAdapter class

  16. Delayed data loading • Performance considerations • Specifics: • load nodes only for root level records • add a dummy node, to show there is drill down information • Code in Expand event • Demo - OrdersByMonth_DelayedLoading form Data access techniques using CursorAdapter class

  17. Loading data from self-related tables • Recursive nodes loading • Demo – Employees form • cursor, containing only high level employees (root level nodes) • reentrant method BuildEmployeeSubtree Data access techniques using CursorAdapter class

  18. Drag & Drop in TreeView control • Control settings • OLEDragMode • OLEDropMode Data access techniques using CursorAdapter class

  19. DataObject object DataObject object methods SetFormat SetData ClearData GetFormat GetData OLEStartDrag OLEDragOver nEffect OLEDragDrop Drag & Drop in TreeView control • Events handling Data access techniques using CursorAdapter class

  20. Let’s do it • Demo – Drag & Drop in Employees form • Operation start • OLEDragOver event • DropHighlight property • Finish Drag & Drop operation • OLEDragDrop event • MoveEmployeeToTopLevel method • Change data record Data access techniques using CursorAdapter class

  21. Deploying • Deploying applications using TreeView ActiveX control • MSComCtl.ocx. • Microsoft Windows Common Controls (6.0) merge module Data access techniques using CursorAdapter class

  22. Resources • Help file - cmctl198.chm • http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fox7help/html/lngactivex_controls_overview.asp • http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconusingtreeviewcontrol.asp • http://www.microsoft.com/downloads/details.aspx?familyid=0746596E-3778-425A-BF0F-0C3A9023ED29&displaylang=en Data access techniques using CursorAdapter class

  23. Thank you! Please remember to fill out your evaluation. Data access techniques using CursorAdapter class

More Related