Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic table like in Powerpoint (Read 2353 times)
ampersand
Junior Member
**
Offline



Posts: 55
Joined: Sep 21st, 2006
table like in Powerpoint
Oct 21st, 2006 at 8:31pm
Print Post  
I try to implement a table structure in flowchart, that is looking and behaving like the table in Microsoft Powerpoint. The user should be able to choose a number of rows and columns and receives a table construct on the screen. The table should consist of RichTextBoxes to give the user full control over textlayout.

I think that such a table construct can not be done with the FlowChart table class. Instead I thought of creating a controlhost object with an embedded RichTextBox for each cell of the table.

But how can I link these controlhosts together, so that thay move as one when the user wants to move the table? I had a look into the group class but couldn't find out how to position controlhosts so they look like a table. Also I was unsure what is the master object in this case.

Do you think this is the way such kind of a table should be implemented? Are there other possibilities?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: table like in Powerpoint
Reply #1 - Oct 23rd, 2006 at 6:56am
Print Post  
Hi,

One of our planned features for version 5 of FlowChart.NET is control-hosting in table cells. A client of ours suggested that in the "Flowchart.NET feature requests" board because he needs to show check boxes in cells, but I guess it will work for rich-text controls too.

At this time you could create a Box instance and attach ControlHost nodes to it using their AttachTo method. Leave some part of the box to serve as a caption bar and let you drag the whole group.

Another possibility is to use a Table node, and in its cells display bitmaps generated from the RichText control contents. You could display a RichText box only when users double click a cell to let them edit its contents.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
ampersand
Junior Member
**
Offline



Posts: 55
Joined: Sep 21st, 2006
Re: table like in Powerpoint
Reply #2 - Oct 23rd, 2006 at 10:38am
Print Post  
Thanks Stoyo,
for now until you implement the new table feature I will aim for the box and attach control host variant.

I couldn't find an example with void AttachTo( Node node, float percentX1, float percentY1, float percentX2, float percentY2); in the samples or help file. So I hope you can help me out with this.

I tried the following but the controlHosts stick to the upper left corner of the document and disappear as soon I move the box.

Code
Select All
btChart.BoxStyle = BoxStyle.Rectangle;

Box masterBox = btChart.CreateBox(10, 10, 90, 60);
ControlHost control1 = btChart.CreateControlHost(0, 0, 30, 30);
ControlHost control2 = btChart.CreateControlHost(0, 0, 30, 30);

control1.AttachTo(masterBox, 0F, 0F, 0.333F, 0.50F);
control2.AttachTo(masterBox, 0.333F, 0F, 0.667F, 0.50F );
 



The code should show up control 1 in the top left with a width of 33% of the masternode and 50% of the height. Control 2 should appear to the right of control 1.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: table like in Powerpoint
Reply #3 - Oct 23rd, 2006 at 4:24pm
Print Post  
Hi Dirk,

The control expects to get the AttachTo coordinates in the range [0-100,0-100], i.e. percent values. Try this:

control1.AttachTo(masterBox, 0F, 0F, 33.3F, 50.0F);

That's a left-over from our ActiveX diagramming control - it worked only with integer numbers, so we used percents to define such groups there  Undecided

Stoyan
  
Back to top
 
IP Logged
 
ampersand
Junior Member
**
Offline



Posts: 55
Joined: Sep 21st, 2006
Re: table like in Powerpoint
Reply #4 - Oct 23rd, 2006 at 7:42pm
Print Post  
I did as you suggested:

Code
Select All
control1.AttachTo(masterBox, 0.0F, 0.0F, 33.3F, 50.0F);
control2.AttachTo(masterBox, 33.3F, 0.0F, 66.7F, 50.0F );
 



Still both controlHosts are shown in the upper left corner of the document. But as soon as I move the masterBox, both controlHosts jump to their expected positions within the box.

I tried to invalidate the flowchart, but with no success.

By the way it seems that CreateControlHost() does not raise any events like ControlHostCreating or ControlHostCreated. Is that correct?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: table like in Powerpoint
Reply #5 - Oct 24th, 2006 at 4:46am
Print Post  
Created/Creating events are raised when items are created interactively by the user, but not when creating items through the control's API.

Call the Box.Move() method just after attaching the controls and they should jump to the correct position.

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