Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using treeview like interface
Message
From
03/02/2000 08:30:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
03/02/2000 07:22:22
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00326618
Message ID:
00326627
Views:
25
>Greetings friends.
>At the moment I am developing a system where the interface should be a treeview control, until now everything is alright, however is required that of the left side be the treeview and of the other is shown the form, the querys and all the processes.
>In other words the whole system should be and run on a same form.
>You know where I could find samples, help in this respect.
>I think the treeview properties, node, images, and all should be save ina a free table.
>What is yours opinion?
>TIA.


Andrews,
Check solutions.app for different samples of treeview usages including saving and loading from a table. Basically any table with at least 3 columns (ParentId, ID, Text) could be used to build a treeview. node.Fullpath gives All text separated by "\" from topmost parent to current node. You could also use node.key to quickly access the item in table and resolve its "parents". Now with VFP6 supported new PEM you could drag&drop within a treeview itself too :) You could directly fill array data to a treeview (check OLE sample on drag&drop, you'll see OLEformats as text, array etc). One thing I learned with treeview is "never let" treeview to populate all of its nodes at startup otherwise your users should take a long lunch break. Instead I use this approach :
-Fill in first level nodes
-During filling, check if they should have childs
-If has child add "just one node" as Dummy (Provides +)
-When expanded if node is "dummy" fill with actual childs doing same as in prev step (otherwise already filled)
This approach is really fast. ie: If I use it to display my thousands of directories, I only fill root dir first. When any dir attempted to expand it's populated :) The result is instant (uhm compared to fox near instant - at least users have time to only blink their eyes instead of a lunch :)

And also consider using MSHflexGrid too. IMHO it's a treeview like grid dealing with "data" not "nodes" :) But of course it's also as hard to code as a treeview (as I could see not all the PEM work as they claim in help).

I think there is a datatree sample in files section too.
PS: For mysterious drophighlight use nXCoord * 96, nYcoord * 96 for hittest. 96 is horz. and vert. pixels per inch. It's actually calculated as (fontmetric() 19 and 20 ?) :
#DEFINE LOG_PIXELS_X 88
#DEFINE LOG_PIXELS_Y 90
#DEFINE TWIPS_PER_INCH 1440
* 1440 twips per inch

DECLARE integer GetActiveWindow in WIN32API
DECLARE integer GetDC in WIN32API integer iHDC
DECLARE integer GetDeviceCaps in WIN32API integer iHDC, integer iIndex

* Get a device context for VFP.
liHWnd = GetActiveWindow()
liHDC = GetDC(liHWnd)

* Get the pixels per inch.
liPixelsPerInchX = GetDeviceCaps(liHDC, LOG_PIXELS_X)
liPixelsPerInchY = GetDeviceCaps(liHDC, LOG_PIXELS_Y)
Good luck
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform