}
int setBounds (int control, int x, int y, int width, int height, boolean move, boolean resize, boolean events) {
boolean sameOrigin = true, sameExtent = true;
if (OS.HIVIEW) {
CGRect oldBounds = new CGRect ();
OS.HIViewGetFrame (control, oldBounds);
Rect inset = getInset ();
oldBounds.x -= inset.left;
oldBounds.y -= inset.top;
oldBounds.width += inset.left + inset.right;
oldBounds.height += inset.top + inset.bottom;
if (!move) {
x = (int) oldBounds.x;
y = (int) oldBounds.y;
}
if (!resize) {
width = (int) oldBounds.width;
height = (int) oldBounds.height;
}
CGRect newBounds = new CGRect ();
newBounds.x = x + inset.left;
newBounds.y = y + inset.top;
newBounds.width = width - inset.right - inset.left;
newBounds.height = height - inset.bottom - inset.top;
sameOrigin = newBounds.x == oldBounds.x && newBounds.y == oldBounds.y;