2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
6 Change position and size of a window.
9 #include "intuition_intern.h"
10 #include "inputhandler_actions.h"
12 struct ChangeWindowBoxActionMsg
14 struct IntuiActionMsg msg
;
15 struct Window
*window
;
22 static VOID
int_changewindowbox(struct ChangeWindowBoxActionMsg
*msg
,
23 struct IntuitionBase
*IntuitionBase
);
25 /*****************************************************************************
28 #include <proto/intuition.h>
30 AROS_LH5(void, ChangeWindowBox
,
33 AROS_LHA(struct Window
*, window
, A0
),
34 AROS_LHA(LONG
, left
, D0
),
35 AROS_LHA(LONG
, top
, D1
),
36 AROS_LHA(LONG
, width
, D2
),
37 AROS_LHA(LONG
, height
, D3
),
40 struct IntuitionBase
*, IntuitionBase
, 81, Intuition
)
43 Set the new position and size of a window in one call.
46 window - Change this window
47 left, top - New position
48 width, height - New size
53 This call is deferred. Wait() for IDCMP_CHANGEWINDOW if your
54 program depends on the new size.
64 *****************************************************************************/
68 struct ChangeWindowBoxActionMsg msg
;
70 DEBUG_CHANGEWINDOWBOX(dprintf("ChangeWindowBox: Window 0x%lx Left %d Top %d Width %d Height %d\n",
71 window
, left
, top
, width
, height
));
87 DoASyncAction((APTR
)int_changewindowbox
, &msg
.msg
, sizeof(msg
), IntuitionBase
);
88 // DoSyncAction((APTR)int_changewindowbox, &msg.msg, IntuitionBase);
92 } /* ChangeWindowBox */
95 static VOID
int_changewindowbox(struct ChangeWindowBoxActionMsg
*msg
,
96 struct IntuitionBase
*IntuitionBase
)
98 struct Window
*window
= msg
->window
;
100 if (!ResourceExisting(window
, RESOURCE_WINDOW
, IntuitionBase
)) return;
102 if (window
->Flags
& WFLG_SIZEGADGET
)
104 if (msg
->width
< window
->MinWidth
) msg
->width
= window
->MinWidth
;
105 if (msg
->width
> (UWORD
)window
->MaxWidth
) msg
->width
= (UWORD
)window
->MaxWidth
;
107 if (msg
->width
> window
->WScreen
->Width
) msg
->width
= window
->WScreen
->Width
;
109 if (window
->Flags
& WFLG_SIZEGADGET
)
111 if (msg
->height
< window
->MinHeight
) msg
->height
= window
->MinHeight
;
112 if (msg
->height
> (UWORD
)window
->MaxHeight
) msg
->height
= (UWORD
)window
->MaxHeight
;
114 if (msg
->height
> window
->WScreen
->Height
) msg
->height
= window
->WScreen
->Height
;
116 DoMoveSizeWindow(window
, msg
->left
, msg
->top
, msg
->width
, msg
->height
, TRUE
, IntuitionBase
);