Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ItemModified Event arguments (Read 2264 times)
koosala
Full Member
***
Offline


Java Happens

Posts: 136
Joined: May 13th, 2007
ItemModified Event arguments
Aug 30th, 2007 at 2:55am
Print Post  
Hi,

The ItemModifying event raised gives back the selection handle as a part of the arguments. The ItemModified event doesn't give information about what was modified.

I want to recalculate the ElementTemplate for the text portion of a box when the box is modified.
But I have observed that

resizeToFitText(FitSize.KeepWidth);

resizeToFitText(FitSize.KeepHeight);

are very processor intensive sometimes.

So, I don't want to call them only when the box is resized and not when it is moved around.

This is just one of the instances where I would need to know what handle was modified.

So, is it possible to give this information in the modified event as well?
I know, I can locally store that info during the modified event and then use it, but that just makes the application harder to maintain.

2. Also, now that I brought up the resizeToFitText point I have a question there.

Since the box currently doesn't display text if it spills out of the box's text display area, I wanted to use the

measureString(text, box.getFont());
resizeToFitText(FitSize.KeepWidth);
resizeToFitText(FitSize.KeepHeight);

on another box, calculate the displayable area and then apply it to the text ElementTemplate for this box.

But sometimes I see that one of the resizeToFitText methods (mostly the keepWidth guy takes up full CPU usage for 5 - 10 seconds). But not with all the boxes. I saw it especially when I was zoomed in.


I would like to know if there are any standard guidelines I must follow before using these calls?

I could give you some exact code if you want, where you can see this problem for yourself.


A very nice product you have, by the way. And thanks for the very good support you are providing.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ItemModified Event arguments
Reply #1 - Aug 30th, 2007 at 6:29am
Print Post  
Hi,

1. Ok, we'll also add that parameter to itemModified.

2. Our developer is now working on a better text layout algorithm that will break a word if the whole word does not fit. Though that's not easy so he'll need at least 1-2 weeks to finish it. We'll also try to optimize the fitText method.

3. Thank you too  8)

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