зеркало из https://github.com/mono/ikvm-fork.git
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:
Родитель
13009f3905
Коммит
b072ef34a0
|
@ -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)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче