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 » U++ Widgets - General questions or Mixed problems » TreeCtrl and ArrayCtrl - how to invoke editor for individual items? [SOLVED...]
TreeCtrl and ArrayCtrl - how to invoke editor for individual items? [SOLVED...] [message #2319] Sat, 08 April 2006 02:10 Go to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
TreeCtrl and ArrayCtrl - how to invoke editor for individual items?
Other way than:
//before edit
     tree.Remove(editid);
     tree.Add(parentid,  CtrlImg::imgEdit(), edit.Top(), 200);
....
//after edit
     tree.Remove(editid);
     tree.Add(parentid,  CtrlImg::imgOK(), editValue, 200);

would be good something like
tree.Add(int parentid¸ const Image& img¸ Ctrl& ctrl¸ int cx¸ int cy¸ bool withopen)

tree.Set(int parentid¸ const Image& img¸ Ctrl& ctrl¸ int cx¸ int cy¸ bool withopen)

...Or???

[Updated on: Sun, 09 April 2006 04:46]

Report message to a moderator

Re: TreeCtrl and ArrayCtrl - how to invoke editor for individual items? [message #2329 is a reply to message #2319] Sat, 08 April 2006 12:50 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Not sure what exactly you want to achieve, however, AFAIK the critical part is still TreeCtrl::Node... Wink

Mirek
Re: TreeCtrl and ArrayCtrl - how to invoke editor for individual items? [message #2338 is a reply to message #2329] Sat, 08 April 2006 16:32 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
luzr wrote on Sat, 08 April 2006 11:50

Not sure what exactly you want to achieve, however, AFAIK the critical part is still TreeCtrl::Node... Wink

Mirek


Yes. And that was the hint behind ...Or??? Smile
But
	TreeCtrl::Node n = tree.GetNode(editid);

 //   n = TreeCtrl::Node::Node(CtrlImg::Var(), edit.Top(), 200, 20);  //I want something like this
	n.SetImage(CtrlImg::Var());
	n.SetCtrl(editor);
	n.SetSize(Size(200,20));

	tree.SetNode(editid, n);


this code requires me to close and reopen the parent node to see the editor...
What's wrong in here?

[Updated on: Sat, 08 April 2006 16:33]

Report message to a moderator

Re: TreeCtrl and ArrayCtrl - how to invoke editor for individual items? [message #2340 is a reply to message #2329] Sat, 08 April 2006 16:39 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
luzr wrote on Sat, 08 April 2006 11:50

Not sure what exactly you want to achieve...
Mirek


The same like with F2 in MS Explorer. Is there an easier way?
Re: TreeCtrl and ArrayCtrl - how to invoke editor for individual items? [message #2341 is a reply to message #2340] Sat, 08 April 2006 17:09 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I see.

Well, first, this looks like corner case ortoghonality bug (I mean this is not typical usage, however, U++ should work anyway Wink.

Personally, I would rather tried to implement this by placing EditString over the TreeCtrl spot.

Mirek
Re: TreeCtrl and ArrayCtrl - how to invoke editor for individual items? [message #2342 is a reply to message #2341] Sat, 08 April 2006 20:29 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
luzr wrote on Sat, 08 April 2006 16:09

I see.

Well, first, this looks like corner case ortoghonality bug (I mean this is not typical usage, however, U++ should work anyway Wink.

Personally, I would rather tried to implement this by placing EditString over the TreeCtrl spot.

Mirek


At last, at least a bug? Smile I've spent some crazy time since yesterday with those TreeCtrl::Node's

Personally, I would rather have added Dirty() instead of RefreshItem(id) in TreeCtrl.cpp:

void   TreeCtrl::SetNode(int id, const TreeCtrl::Node& n)
{
	(TreeCtrl::Node&)item[id] = n;
	Dirty(id); //aris added - for refreshing added controls
//	RefreshItem(id); //not needed anymore?
}

don't you think?

[Updated on: Sat, 08 April 2006 20:29]

Report message to a moderator

Re: TreeCtrl and ArrayCtrl - how to invoke editor for individual items? [message #2343 is a reply to message #2319] Sat, 08 April 2006 21:21 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yes, sounds like a good idea, thanks! That should solve the corner-case...

Mirek
Re: TreeCtrl and ArrayCtrl - how to invoke editor for individual items? [message #2347 is a reply to message #2343] Sun, 09 April 2006 04:44 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
luzr wrote on Sat, 08 April 2006 20:21

Yes, sounds like a good idea, thanks! That should solve the corner-case...

Mirek


Sorry, what's "the corner-case"?
Re: TreeCtrl and ArrayCtrl - how to invoke editor for individual items? [message #2350 is a reply to message #2347] Sun, 09 April 2006 07:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fudadmin wrote on Sat, 08 April 2006 22:44

luzr wrote on Sat, 08 April 2006 20:21

Yes, sounds like a good idea, thanks! That should solve the corner-case...

Mirek


Sorry, what's "the corner-case"?



Ehm, pardon my english, I am not sure whether that is the real term that I acdcidentaly picked somewhere on the WWW (as I have learnt most of my czenglish) or if I simply made it up - it should describe situation as being unlikely to happen in normal usage, some untypical, unplanned use, that however should work anyway.

Mirek

[Updated on: Sun, 09 April 2006 07:31]

Report message to a moderator

Re: TreeCtrl and ArrayCtrl - how to invoke editor for individual items? [message #2355 is a reply to message #2350] Sun, 09 April 2006 14:00 Go to previous message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
luzr wrote on Sun, 09 April 2006 06:31

fudadmin wrote on Sat, 08 April 2006 22:44

luzr wrote on Sat, 08 April 2006 20:21

Yes, sounds like a good idea, thanks! That should solve the corner-case...

Mirek


Sorry, what's "the corner-case"?



Ehm, pardon my english, I am not sure whether that is the real term that I acdcidentaly picked somewhere on the WWW (as I have learnt most of my czenglish) or if I simply made it up - it should describe situation as being unlikely to happen in normal usage, some untypical, unplanned use, that however should work anyway.

Mirek


Ahh.. It's ok. I was a bit confused because I started thinking about corner orthogonality - the problem which exists in 2D and 3D applications... Smile
Previous Topic: widget lifetime
Next Topic: Dialog returned values
Goto Forum:
  


Current Time: Sat May 04 10:37:41 CEST 2024

Total time taken to generate the page: 0.02511 seconds