Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TreeCtrl » OptionTree - something missing? [FIXED]
OptionTree - something missing? [FIXED] [message #5437] Thu, 21 September 2006 16:59 Go to previous message
James Thomas is currently offline  James Thomas
Messages: 26
Registered: June 2006
Promising Member
Currently there doesn't seem to be a way of correctly configuring the OptionTree control from code, if you set one of the options it's parent does not get correctly updated.

In the example below I set an option using two different methods and neither results in a change to the parent nodes state (it should turn grey).

#include <CtrlLib/CtrlLib.h>

class AWindow : public TopWindow
{
public:
	typedef AWindow CLASSNAME;
	Option _optA, _optAA, _optAAA, _optAAB, _optAAC;
	OptionTree _tree;
	Button _btn;

	AWindow()
	{
		_tree.SetRoot(_optA, "Root");
		_tree.Add(0, _optAA, "Node");
		_tree.Add(1, _optAAA, "Leaf 1");
		_tree.Add(1, _optAAB, "Leaf 2");
		_tree.Add(1, _optAAC, "Leaf 3");
		

		_tree.LeftPosZ(0, 140).TopPosZ(0, 164);
		_btn.LeftPosZ(0, 140).TopPosZ(164, 20);
		_btn <<= THISBACK(ButtonPush);		
		
		Add(_tree);
		Add(_btn);

		_tree.Set(3, 1); // Set through the TreeCtrl::Set - no call to SetOption
	}
	
	void ButtonPush() 
	{
		_optAAC.Set(1); // Set using the Option ctrl - also no call to SetOption
	}
};

GUI_APP_MAIN
{
	AWindow w;

	w.Run();
}


The work of setting the parent node is done in the OptionTree::SetOption function, which never gets called. I can understand that setting the option directly probably shouldn't work, but calling the Set function should. Perhaps there needs to be an override of TreeCtrl::Set() so that SetOption can be called, but there may be a more elegant way.

Strangely I think this used to work in release 602 because I'm sure I would have noticed, but I can't find any relevant changes to Option or OptionTree so I could be wrong.

EDIT: I'm using 605 RC, but I've looked at the dev source and the problem looks like it's still there.

[Updated on: Fri, 22 September 2006 11:57]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Example
Next Topic: TreeCtrl - DeepClose not works
Goto Forum:
  


Current Time: Tue Apr 23 22:26:41 CEST 2024

Total time taken to generate the page: 0.02414 seconds