Hierarchical list box, selection property (OpenInsight Specific)
At 14 MAY 1998 06:40:46PM Joseph Borojevic Eloquent Systems Inc wrote:
In a Hierarchical list box, that is populated at run time, how do you set the selection property. That is, how do you highlight a specific item 3 levels deep.
At 15 MAY 1998 10:48AM Oystein Reigem wrote:
Joseph,
(Some of this is sort of off the top of my head and I apologize for any errors.)
]
I assume you've managed to populate the list box and display what you want (I mean you might have some items expanded and some collapsed). You want to select an item, and if you know which visible line it's in you simply set SELPOS to that line number. (I guess "visible" is the wrong word, because items may be invisible because they are scrolled outside the visible area of the list box, but that's not what I'm talking about. Assume the box is very big. I'm talking about some items being invisible because parts of the hierarchy are collapsed.)
Your problem is perhaps that you don't know that line number. But if the text of your item is unique you can get the visible (non-collapsed) contents of the list box from the LIST property, and locate its position there.
And even if it isn't unique LIST has some information about the level of each item (at least it has in hierarchical list boxes with *bitmaps* which *I* use).
If that doesn't work either I assume you know the number the item has in the fully expanded list. So get the LIST_EX property too and work your way through LIST and LIST_EX from the top downwards.
Or perhaps your problem is that your item isn't visible because it's collapsed. Then you have to send EXPAND messages first.
Hope this helps.
- Oystein -
At 18 MAY 1998 12:06PM Cameron Revelation wrote:
Joseph,
See SELPOS, SELPOS_EX, and SELPOS_EX_BY_POS.
Cameron Purdy
Revelation Software
At 19 MAY 1998 04:31AM Oystein Reigem wrote:
Cameron,
I think Joseph's problem might be that he wants to set the SELPOS_EX property. Why isn't that property settable?
- Oystein -
At 19 MAY 1998 05:22AM Carl Pates wrote:
Hi Oystein,
If you look at some of the infomation SELPOS_EX contains, there's no way you could set it. Some of the info is definately read-only.
Take a look at the 'Indent' field (), the 'leafs' field () and the Predecessor field (). These are all dependant on the physical structure of the list, and the only way to modify them is by adding and removing items. ( Imagine what would happen if you tried to set the number of leafs in the next level to 6 with SELPOS_EX when there are only really 5? )
Hence, I can't see it being done any other way than with Send_Message and LIST I'm afraid.
Cheers,
cpates@sprezzatura.com
World Leaders in all things RevSoft
At 25 MAY 1998 07:07AM Oystein Reigem wrote:
Carl,
I totally agree and I expected this objection about setting SELPOS_EX. What I meant is it would be nice if you could set just and leave alone the rest. That would probably mean it would have to be implemented as a different property, though.
I hereby propose the settable property SELPOS_EX_BUT_JUST_THE_POS_BECAUSE_I_DONT_WANT_TO_MESS_UP_MY_HIERARCHICAL_LISTBOX_PLEASE.
![]()
- Oystein -