Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 15 of 15 total
Thread Populating a treeview
Wed, Feb 23 2011 3:09 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Only if you start at the top Smiley>>

Why wouldn't you start at the top ?  Just enforce that as a rule on how you
always get to the desired node, and you'll be all set.  Plus, any references
to upper nodes will already be cached, as a bonus.

--
Tim Young
Elevate Software
www.elevatesoft.com
Thu, Feb 24 2011 4:13 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

><< Only if you start at the top Smiley>>
>
>Why wouldn't you start at the top ? Just enforce that as a rule on how you
>always get to the desired node, and you'll be all set. Plus, any references
>to upper nodes will already be cached, as a bonus.

OK a bit more explanation

User is in system. They move to the contacts page (a form parented on a TAdvOfficePager (ExtendedData) page captioned "Contacts") in that form there is another TadvOfficePager which has a page "Overview" on that page there are a dbgrid and a panel (Panel2). On the panel there are several components one of which is a DBMemo (Attributes).

The tree therefore goes

TfR (application) -> FormController (AdvOfficePager) -> tabContacts (AdvOfficePage) -> Contacts (Form) -> ExtendedData (AdvOfficePager) -> Overview (AdvOfficePage) -> Panel2 -> Attributes

Anything between a Form and the app gets ignored so this is reduced to

TfR (application) -> Contacts (Form) -> ExtendedData (AdvOfficePager) -> Overview (AdvOfficePage) -> Panel2 -> Attributes

I pass over to the on-line manual subsystem TfR, Contacts, Attributes ie application=book, form=chapter, component=topic. I could use the standard Delphi method and have a help number or keyword for every component but frankly I don't fancy the effort of maintaining it.

The "tree table" has the following structure

"_ID" INTEGER GENERATED ALWAYS AS IDENTITY (START WITH 0, INCREMENT BY 1) NOT NULL,
"_Book" VARCHAR(30) COLLATE "ANSI_CI" DEFAULT '',
"_Chapter" VARCHAR(30) COLLATE "ANSI_CI" DEFAULT '',
"_Topic" VARCHAR(30) COLLATE "ANSI_CI" DEFAULT '',
"_Link" INTEGER DEFAULT 0,
"_Title" VARCHAR(50) COLLATE "ANSI_CI" DEFAULT '',
"_CanEdit" BOOLEAN DEFAULT FALSE

so I can use book/chapter/topic to identify a starting node and link to walk up the tree. I could find the top node easily using book. I can find the next node down easily using chapter. Then it gets sticky. I want to show where the component the user is asking about is in relation to other stuff (sometimes its important) so I'd either have to trace down every branch until I hit the right node or use the components RTTI to walk up its Parent property and get each of those in turn which is sort of what I'm doing anyway only using the table rather than RTTI which on occasion with my experiments goes a bit wonky.

Roy Lambert
Mon, Feb 28 2011 4:23 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< so I can use book/chapter/topic to identify a starting node and link to
walk up the tree. I could find the top node easily using book. I can find
the next node down easily using chapter. Then it gets sticky. I want to show
where the component the user is asking about is in relation to other stuff
(sometimes its important) so I'd either have to trace down every branch
until I hit the right node or use the components RTTI to walk up its Parent
property and get each of those in turn which is sort of what I'm doing
anyway only using the table rather than RTTI which on occasion with my
experiments goes a bit wonky. >>

I'm still not exactly sure what you're doing, but I suspect that the design
may need some tweeking.

In general, if you don't dynamically add/remove components from the forms,
then I would consider doing a quick "index" of the component names using a
TStringList.  Just put the names of the components in the strings, and the
object references in the objects, and then call Sort.  Do this at
FormCreate, and you'll have a very easy way of finding any component on a
form.

If you want to see how we do this with our custom help that we use with the
EDB Manager, I can post the code that I use for the HTML compilation and the
help manager that works with the IE web browser.  It might give you some
ideas, and does support a tree structure along with a topic index that can
quickly find a given topic using keywords.  Plus, it's very lightweight.

--
Tim Young
Elevate Software
www.elevatesoft.com
Tue, Mar 1 2011 3:08 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


>I'm still not exactly sure what you're doing, but I suspect that the design
>may need some tweeking.

Very probably since it reflects my own idiosyncratic view of how things should be done. When its eventually complete I'll post a demo into the binaries.

>In general, if you don't dynamically add/remove components from the forms,
>then I would consider doing a quick "index" of the component names using a
>TStringList. Just put the names of the components in the strings, and the
>object references in the objects, and then call Sort. Do this at
>FormCreate, and you'll have a very easy way of finding any component on a
>form.

Errr - from pressing the F1 key while the mouse cursor is over a component?

>If you want to see how we do this with our custom help that we use with the
>EDB Manager, I can post the code that I use for the HTML compilation and the
>help manager that works with the IE web browser. It might give you some
>ideas, and does support a tree structure along with a topic index that can
>quickly find a given topic using keywords.

I'm sure that a host of others would be interested in that as well as me.

>Plus, it's very lightweight.

Since I'm building in WPTools for editing purposes lightweight goes out of the window Smiley

Roy Lambert
Fri, Mar 4 2011 10:55 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I'm sure that a host of others would be interested in that as well as me.
>>

It's in the Binaries newsgroup here:

http://www.elevatesoft.com/forums?action=view&category=edb&id=edb_binaries&page=1&msg=22

--
Tim Young
Elevate Software
www.elevatesoft.com
« Previous PagePage 2 of 2
Jump to Page:  1 2
Image