08-07-2007 02:46 PM
08-07-2007 03:30 PM
The selection mode has nothing to do with the check boxes or radio buttons that appear next to each tree item when you enable ATTR_SHOW_MARKS. The selection mode determines how many items can be selected, ie. hilited with the blue background using shift+click or shift+arrow keys.
What you want is to restrict how many items are 'marked' using either the check boxes or radio buttons. Changing the ATTR_MARK_TYPE of all the items to VAL_MARK_RADIO is the easiest way make sure at most only one item is marked. To do this, you could either change the default for new items before you populate the tree:
SetTreeItemAttribute(panel, tree, VAL_DFLT_FOR_NEW_OBJECTS, ATTR_MARK_TYPE, VAL_MARK_RADIO);
Or you can set the attribute for all the items in an already populated tree like this:
SetTreeItemAttribute(panel, tree, VAL_ALL_OBJECTS, ATTR_MARK_TYPE, VAL_MARK_RADIO);
I hope this helps.
- jared