2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include "intuition_intern.h"
8 #include "inputhandler_actions.h"
10 struct SetDMRequestActionMsg
12 struct IntuiActionMsg msg
;
13 struct Window
*window
;
14 struct Requester
*dmrequest
;
18 static VOID
int_setdmrequest(struct SetDMRequestActionMsg
*msg
,
19 struct IntuitionBase
*IntuitionBase
);
21 /*****************************************************************************
24 #include <proto/intuition.h>
26 AROS_LH2(BOOL
, SetDMRequest
,
29 AROS_LHA(struct Window
* , window
, A0
),
30 AROS_LHA(struct Requester
*, dmrequest
, A1
),
33 struct IntuitionBase
*, IntuitionBase
, 43, Intuition
)
36 Try to set the DMRequest of a window. A DMRequest is a requester that
37 appears if the user double-clicks with the menu button.
39 The new DMRequest will only be set if the old DMRequest is not in use.
40 The official way to change the DMRequest is to call ClearDMRequest()
41 until it returns TRUE and then call SetDMRequest().
44 window - The window from which the DMRequest is to be set
45 dmrequest - Pointer to the requester
48 TRUE if old DMRequest was not in use and therefore changed to
49 the new one, or FALSE if the old DMRequest was in use and could
50 not be set to the new one.
53 If the DMRequest has the POINTREL flag set, the DMR will show up
54 as close to the pointer as possible. The RelLeft/Top fields are
55 used to fine-tune the positioning.
62 ClearDMRequest(), Request()
66 *****************************************************************************/
70 struct SetDMRequestActionMsg msg
;
72 SANITY_CHECKR(window
,FALSE
)
73 SANITY_CHECKR(dmrequest
,FALSE
)
76 msg
.dmrequest
= dmrequest
;
78 DoSyncAction((APTR
)int_setdmrequest
, &msg
.msg
, IntuitionBase
);
86 static VOID
int_setdmrequest(struct SetDMRequestActionMsg
*msg
,
87 struct IntuitionBase
*IntuitionBase
)
89 struct Window
*window
= msg
->window
;
90 struct Requester
*dmrequest
= msg
->dmrequest
;
93 if (window
->DMRequest
&& window
->DMRequest
->Flags
& REQACTIVE
)
99 window
->DMRequest
= dmrequest
;
103 msg
->success
= result
;