Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Textarea of predefined Shapenodes (Read 2175 times)
Amosius
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 75
Joined: Sep 2nd, 2010
Textarea of predefined Shapenodes
Sep 3rd, 2010 at 12:12pm
Print Post  
I have a new class and inherit from Shapenode.
I have in this class a funktion SetShapeProperties.

[code]private void SetShapeProperties()
{
this.Shape = Shapes.BpmnParallelFork;
this.Bounds = new Rect(100, 200, 30, 30);
this.Brush = Brushes.LightYellow;
this.TextBrush = Brushes.Black;
}[/code]

I create a Shape like this (constuctor calls SetShapeProperties)
[code]
MyShape shape = new MyShape();
mydiagram.Nodes.Add(shape);[/code]

Due to the ShapeDesigner the BpmnParallelFork has a Textarea beneath the Shape.

When i enter a Text in the Shape, i get no text. Neither inside nor outside.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Textarea of predefined Shapenodes
Reply #1 - Sep 3rd, 2010 at 12:40pm
Print Post  
The text area is defined in terms of percents of the node size, and for a 30x30 pixels node there might not be much space left for the text. You can either define much larger text area for BpmnParallelFork, or use an attached transparent node to display the text.

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


I love YaBB 1G - SP1!

Posts: 75
Joined: Sep 2nd, 2010
Re: Textarea of predefined Shapenodes
Reply #2 - Sep 3rd, 2010 at 2:25pm
Print Post  
Hi Stoyan,

yes the shape was to small. When i resize it I get my text.

I would like to try defining much larger text area AND a much bigger Textbox to change the text. It's very small for typing a text :)

1. Can I achieve this without an attached label?
2. If yes: Do I have to create a new Shapetemplate or can i define the size/position of the textarea by a property of the BpmnFork Shape?
3. If no: how can I bind the attached label to the node (something like SetBinding(label.Text, node.Text);?

Hope you understand my request.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Textarea of predefined Shapenodes
Reply #3 - Sep 3rd, 2010 at 5:10pm
Print Post  
Hi,

It should be possible. For specifying the textbox size, implement the InplaceEditable interface and return larger rectangle from GetEditRect. I think it's relative to the node, a TextBox starting from 0,0 will coincide with the node's top-left corner.

For rendering the text, you could either modify Shapes.BpmnParallelFork.TextArea, or overide the ShapeNode.Draw method like this:

Code
Select All
override Draw(DrawingContext dc, RenderOptions ro)
{
	ro.EnableText = false;
	base.Draw(...);
	ro.EnableText = true;
	dc.DrawText(...);
} 



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


I love YaBB 1G - SP1!

Posts: 75
Joined: Sep 2nd, 2010
Re: Textarea of predefined Shapenodes
Reply #4 - Sep 6th, 2010 at 12:45pm
Print Post  
Hi Stoyan,

it worked very well.

I used the GetEditRect Function to specify the textbox and i modified the TextArea as suggested.

Thank you very much.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint