Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) How do you add comments for Flow Charts? (Read 6090 times)
uv
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Aug 7th, 2007
How do you add comments for Flow Charts?
Aug 7th, 2007 at 3:03am
Print Post  
Hi, Smiley

I need to know how i can add comments to a Node by simply right clicking it. Please let me know whether i have to import a libarary for this?

Thanks in Advance

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How do you add comments for Flow Charts?
Reply #1 - Aug 7th, 2007 at 5:44am
Print Post  
Hi,

If you need to start editing the node's text upon right-click, handle the BoxClicked event and call the Box.BeginInplaceEdit method when e.Button == MouseButtons.Right.

Stoyan
  
Back to top
 
IP Logged
 
uv
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Aug 7th, 2007
Re: How do you add comments for Flow Charts?
Reply #2 - Aug 7th, 2007 at 9:33pm
Print Post  
Hi,

Thanks for the reply. But sorry that is not what i really wanted Sad. I need to add a COMMENT BOX or a NOTE to each node. e.g. like in Rational Rose, you can simply right click on a class diagram,and add a note to that.

Please help me with this. ???
Thanks again.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How do you add comments for Flow Charts?
Reply #3 - Aug 8th, 2007 at 6:32am
Print Post  
Hi,

Ok, create a box, attach it to the node, and optionally let users edit it inline:

Box commentBox = fc.CreateBox(...);
commentBox.AttachTo(classBox, AttachToNode...);
commentBox.BeginInplaceEdit();

Now the comment box will follow the class when the latter is moved around. If you have a class box reference, you will be able to access its comment boxes through the classBox.SubordinateGroup.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
uv
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Aug 7th, 2007
Re: How do you add comments for Flow Charts?
Reply #4 - Aug 9th, 2007 at 12:23am
Print Post  
Hi,

Thanks alot Roll Eyes. It helped me alot!

Kind Rgds,
UV
  
Back to top
 
IP Logged
 
uv
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Aug 7th, 2007
Re: How do you add comments for Flow Charts?
Reply #5 - Aug 9th, 2007 at 2:13am
Print Post  
Hi Stoyo,

Need to ask one more question. Once I right click and add the comment box, is it possible to attach it(without any arrows) to the selected node by using +/- button, so from that i can expand and collapse the comment box?


here with i'm sending the code, pls help me with it :(

private void addCommentToolStripMenuItem_Click(object sender, EventArgs e)
{
Box commentBox = loader.Chart.CreateBox(SelectedNode.BoundingRect.Right, SelectedNode.BoundingRect.Top - 10, 20, 20);
commentBox.Style = BoxStyle.Rectangle;
commentBox.FillColor = Color.LightGoldenrodYellow;
commentBox.AttachTo(SelectedNode, AttachToNode.BottomRight);
SelectedNode.SubordinateGroup.AttachToCorner(commentBox, 0);
SelectedNode.Expandable = true;
commentBox.BeginInplaceEdit();

}

Thanks in Advance!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How do you add comments for Flow Charts?
Reply #6 - Aug 9th, 2007 at 8:23am
Print Post  
Hi,

To use the +/- button without arrows, set the FlowChart.ExpandButtonAction property to RaiseEvents. Then from the ExpandButtonClicked event handler set commentBox.Visible to either true or false.

Stoyan
  
Back to top
 
IP Logged
 
uv
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Aug 7th, 2007
Re: How do you add comments for Flow Charts?
Reply #7 - Aug 10th, 2007 at 1:31am
Print Post  
Thanks Stoyo! It works fine. Cheesy

cheers!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How do you add comments for Flow Charts?
Reply #8 - Aug 10th, 2007 at 5:10am
Print Post  
8)
  
Back to top
 
IP Logged
 
uv
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Aug 7th, 2007
Re: How do you add comments for Flow Charts?
Reply #9 - Aug 13th, 2007 at 3:42am
Print Post  
Hi Stoyo,

Now i need to add a comment box, where ever i right clicked in the FlowChart. For this i have used the context menu event handler. But i need to get the current position (Point) of the location. Since we are not under a MouseEventArgs, i wont be able to get the mouse position. I have tried the following coding but it creates the box in a differnt place. Need ur help ASAP. Thanks !

private void addCommentToolStripMenuItem_Click(object sender, EventArgs e)
{
PointF ptf = Chart.ClientToDoc(new Point(MousePosition.X,MousePosition.Y));
commentBox = loader.Chart.CreateBox(ptf.X, ptf.Y, 20, 20);

commentBox.BeginInplaceEdit();
}
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How do you add comments for Flow Charts?
Reply #10 - Aug 13th, 2007 at 6:02am
Print Post  
Hi,

MousePosition is in screen coordinates and you must convert it from screen to client coordinates and then from client to logical ones, e.g. Chart.ClientToDoc(Chart.PointToClient(MousePosition)).

Another option is to save in a PointF variable the mouse position you receive with the BoxClicked or DocClicked event, and then use it in the menu item handler.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
uv
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Aug 7th, 2007
Re: How do you add comments for Flow Charts?
Reply #11 - Aug 13th, 2007 at 9:45pm
Print Post  
Thanks Stoyan! Roll Eyes

It works fine.

cheers!



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