| EditPart resize on children setVisible [message #897259] |
Mon, 23 July 2012 08:40  |
ModelGeek Mising name Messages: 351 Registered: June 2011 |
Senior Member |
|
|
Hi,
I have a editpart with multiple children. When i hide children using setVisible method the editpart does not resize. I want it to decrease size when children are hidden and increase size when chidren are visible.
I have tried repaint and revalidate method but it does not change size.
Any idea?
Cheers,
|
|
|
| Re: EditPart resize on children setVisible [message #897317 is a reply to message #897259] |
Mon, 23 July 2012 11:02   |
Jan Krakora Messages: 402 Registered: December 2009 Location: Prague |
Senior Member |
|
|
Hi, could you post some code here?
Changing the size is about the validation and setVisible on a Figure kicks the validation process for you.
So basically there are two options
- You have a layout manager on the parent and you're doing something wrong with its constraints
- You don't have any layout manager on the parent and you have to set the bounds manually
[Updated on: Mon, 23 July 2012 11:03] Report message to a moderator
|
|
|
|
|
|
| Re: EditPart resize on children setVisible [message #897567 is a reply to message #897526] |
Tue, 24 July 2012 10:10  |
Jan Krakora Messages: 402 Registered: December 2009 Location: Prague |
Senior Member |
|
|
And the figure being invisible is getting invisible, but the parent has the same size, so there is a "hole", right?
Well, I think the parent figure's layout manager (ToolBarLayout) asks the child figure's layout manager (FlowLayout) for the child figure's preferred size.
And since it doesn't take the visible state into account, it returns the same size as if the figure was visible.
Could you remove/add the figure from the parent figure instead of setting it invisible?
|
|
|
Powered by
FUDForum. Page generated in 0.01757 seconds