2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include <proto/layers.h>
8 #include "intuition_intern.h"
9 #include "inputhandler.h"
10 #include "inputhandler_actions.h"
11 #include "propgadgets.h"
12 #include <intuition/intuition.h>
14 /******************************************************************** *********
17 #include <proto/intuition.h>
19 AROS_LH9(void, NewModifyProp
,
22 AROS_LHA(struct Gadget
*, gadget
, A0
),
23 AROS_LHA(struct Window
*, window
, A1
),
24 AROS_LHA(struct Requester
*, requester
, A2
),
25 AROS_LHA(ULONG
, flags
, D0
),
26 AROS_LHA(ULONG
, horizPot
, D1
),
27 AROS_LHA(ULONG
, vertPot
, D2
),
28 AROS_LHA(ULONG
, horizBody
, D3
),
29 AROS_LHA(ULONG
, vertBody
, D4
),
30 AROS_LHA(LONG
, numGad
, D5
),
33 struct IntuitionBase
*, IntuitionBase
, 78, Intuition
)
36 Changes the values in the PropInfo-structure of a proportional
37 gadget and refreshes the specified number of gadgets beginning
38 at the proportional gadget. If numGad is 0 (zero), then no
42 gadget - Must be a PROPGADGET.
43 window - The window which contains the gadget
44 requester - If the gadget has GTYP_REQGADGET set, this must be
47 horizPot - New value for the HorizPot field of the PropInfo
48 vertPot - New value for the VertPot field of the PropInfo
49 horizBody - New value for the HorizBody field of the PropInfo
50 vertBody - New value for the VertBody field of the PropInfo
51 numGad - How many gadgets to refresh. 0 means none (not even
52 the current gadget) and -1 means all of them.
58 If NewModifyProp does not work for you, check if you
59 really have a gadget with GTYP_PROPGADGET set. If you
60 create a new gadget object from PROPGCLASS, you
61 might very well get a GTYP_CUSTOMGADGET gadget.
62 As a workaround, you might have to set the
63 gadget type to GTYP_PROPGADGET manually during the
64 call to NewModifyProp. Intuition does this, too.
71 ModifyProp(), RefreshGadgets(), RefreshGList()
75 *****************************************************************************/
81 BOOL knobok1
, knobok2
;
83 if ((gadget
->GadgetType
& GTYP_GTYPEMASK
) != GTYP_PROPGADGET
84 || !gadget
->SpecialInfo
|| !window
)
87 EXTENDUWORD(horizPot
);
89 EXTENDUWORD(horizBody
);
90 EXTENDUWORD(vertBody
);
95 ObtainSemaphore(&GetPrivIBase(IntuitionBase
)->InputHandlerLock
);
97 LOCKWINDOWLAYERS(window
);
99 pi
= gadget
->SpecialInfo
;
101 CalcBBox (window
, requester
, gadget
, &old
);
104 #if PROP_RENDER_OPTIMIZATION
105 knobok1
= CalcKnobSize (gadget
, &old
);
109 /* We don't want the inputhandler to redraw the knob with values
110 * partially changed, so use some protection.
113 pi
->HorizPot
= horizPot
;
114 pi
->VertPot
= vertPot
;
115 pi
->HorizBody
= horizBody
;
116 pi
->VertBody
= vertBody
;
120 if ((gadget
== ((struct IIHData
*)GetPrivIBase(IntuitionBase
)->InputHandler
->is_Data
)->ActiveGadget
) && (FindTask(0) == ((struct IIHData
*)GetPrivIBase(IntuitionBase
)->InputHandler
->is_Data
)->InputDeviceTask
) && ((struct IIHData
*)GetPrivIBase(IntuitionBase
)->InputHandler
->is_Data
)->PropTask
)
122 Signal(((struct IIHData
*)GetPrivIBase(IntuitionBase
)->InputHandler
->is_Data
)->PropTask
,PSIG_REFRESHALL
);
127 // Permit(); stegerg: CHECKME, commented out!
129 knobok2
= CalcKnobSize (gadget
, &new);
133 RefreshPropGadgetKnob (gadget
, knobok1
? &old
: 0, &new, window
, requester
, IntuitionBase
);
142 if (numGad
> 1 && gadget
->NextGadget
)
143 RefreshGList (gadget
->NextGadget
, window
, requester
, numGad
- 1);
146 ReleaseSemaphore(&GetPrivIBase(IntuitionBase
)->InputHandlerLock
);
148 UNLOCKWINDOWLAYERS(window
);