Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Editing Caption in ContainerNode (Read 2124 times)
Amx
YaBB Newbies
*
Offline


digito ergo sum

Posts: 21
Joined: Jan 19th, 2010
Editing Caption in ContainerNode
Mar 12th, 2010 at 10:11am
Print Post  
Hi,

I need to have editables ShapeNodes and editable ContainerNodes.

For ShapeNodes, when I create it, call Diagram.BeginEdit(node) and I can edit Text.

ContainerNode have Caption field, instead of Text. I try calling Diagram.BeginEdit(node) but only result is the Caption that shift at center of ContainerNode (to return left-aligned when I click in a point of Diagram area outside node), but I can't edit.

How can I allow user change Caption text on ContainerNode?

Thanks,
Amx
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Editing Caption in ContainerNode
Reply #1 - Mar 12th, 2010 at 11:15am
Print Post  
It worked fine in my test project. Are you by chance handling the NodeTextEditing event?

Stoyan
  
Back to top
 
IP Logged
 
Amx
YaBB Newbies
*
Offline


digito ergo sum

Posts: 21
Joined: Jan 19th, 2010
Re: Editing Caption in ContainerNode
Reply #2 - Mar 12th, 2010 at 11:59am
Print Post  
I'm sorry, my mistake (I forced focus on diagram to handle a keypress event in every condition).

Now I can edit it, but I have another problem:
I AddNode by code, inserting a Caption string ("caption1" in example).
User may confirm or change text (inserting "caption2" in example)

I handle NodeTextEdited and when edit is done I check Caption and i find (correctly) "caption2". But on screen, the old uncorrect "caption1" string still remains until I do something (move node, collapse, etc.). Seems to be a refresh problem.

These handling I have described is the same for Text field of ShapeNodes but with ShapeNodes it's all ok.

Thanks,
Amx
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Editing Caption in ContainerNode
Reply #3 - Mar 13th, 2010 at 11:44am
Print Post  
This also works fine for me, but try calling the Repaint method of the node if it's not refreshed correctly when the event handler runs.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint