If the .NET control does not accept the new bounds (minimum size, maximum size) then we need to reflect the real bounds on the .NET site to the Java site

This commit is contained in:
smallsql 2009-09-20 09:39:33 +00:00
Родитель 13009f3905
Коммит b072ef34a0
1 изменённых файлов: 28 добавлений и 6 удалений

Просмотреть файл

@ -1797,7 +1797,29 @@ namespace ikvm.awt
public void reshape(int x, int y, int width, int height) public void reshape(int x, int y, int width, int height)
{ {
NetToolkit.BeginInvoke(delegate { control.SetBounds(x, y, width, height); }); NetToolkit.BeginInvoke(delegate
{
control.SetBounds(x, y, width, height);
//If the .NET control does not accept the new bounds (minimum size, maximum size)
//then we need to reflect the real bounds on the .NET site to the Java site
Rectangle bounds = control.Bounds;
if (bounds.X != x)
{
ComponentAccessor.setX(target, bounds.X);
}
if (bounds.Y != y)
{
ComponentAccessor.setY(target, bounds.Y);
}
if (bounds.Width != width)
{
ComponentAccessor.setWidth(target, bounds.Width);
}
if (bounds.Height != height)
{
ComponentAccessor.setHeight(target, bounds.Height);
}
});
} }
public void setBackground(java.awt.Color color) public void setBackground(java.awt.Color color)