muimaster.library: migrate handling of SelectChange and DoubleClick from Listview...
[AROS.git] / workbench / libs / muimaster / mui_layout.c
blobe24d52a8b4cc39ce7192231715c579b006c0b270
1 /*
2 Copyright © 2002-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <intuition/classusr.h>
7 #include <clib/alib_protos.h>
8 #include <proto/intuition.h>
9 #include <proto/muimaster.h>
11 #include "mui.h"
12 #include "muimaster_intern.h"
14 //#define MYDEBUG 1
15 #include "debug.h"
17 /*****************************************************************************
19 NAME */
20 AROS_LH6(BOOL, MUI_Layout,
22 /* SYNOPSIS */
23 AROS_LHA(Object *, obj, A0),
24 AROS_LHA(LONG, left, D0),
25 AROS_LHA(LONG, top, D1),
26 AROS_LHA(LONG, width, D2),
27 AROS_LHA(LONG, height, D3),
28 AROS_LHA(ULONG, flags, D4),
30 /* LOCATION */
31 struct Library *, MUIMasterBase, 21, MUIMaster)
33 /* FUNCTION
35 INPUTS
37 RESULT
39 NOTES
41 EXAMPLE
43 BUGS
45 SEE ALSO
47 INTERNALS
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
53 static const struct MUIP_Layout method = { MUIM_Layout };
54 Object *parent = _parent(obj);
57 * Called only by groups, never by windows
59 // ASSERT(parent != NULL);
61 if (_flags(parent) & MADF_ISVIRTUALGROUP)
63 /* I'm not yet sure what to do by virtual groups in virtual groups,
64 * eighter add their offsets too or not, will be tested soon */
65 IPTR val = 0;
66 get(parent,MUIA_Virtgroup_Left,&val);
67 left -= val;
68 get(parent,MUIA_Virtgroup_Top,&val);
69 top -= val;
72 _left(obj) = left + _mleft(parent);
73 _top(obj) = top + _mtop(parent);
74 _width(obj) = width;
75 _height(obj) = height;
77 D(bug("muimaster.library/mui_layout.c: 0x%lx %ldx%ldx%ldx%ld\n",obj,_left(obj),_top(obj),_right(obj),_bottom(obj)));
79 DoMethodA(obj, (Msg)&method);
80 return TRUE;
82 AROS_LIBFUNC_EXIT
84 } /* MUIA_Layout */