[interfacekit] Re: programming problems

On 2004-02-01 at 18:51:35 [+0100], Adi Oanca wrote:
> 
>    How do you know witch resize mode a view is using???
>    'Cause (ResizingMode() & B_FOLLOW_BOTTOM) or any other "FOLLOW" is
> not working!

That's not surprising, given how the constants are constructed. Apparently 
it is possible to individually specify for each side whether it shall 
follow the top, left, bottom, right, center (or nothing) of the parent 
view. Using vertical modes for horizontal sides or vice versa doesn't seem 
to make much sense but can apparently be expressed nevertheless (Maybe it 
has a special meaning? You should check that.).

Anyway you can decompose the resizing mode like that:

        uint32 mode = ResizingMode();
        uint32 topMode = (mode >> 12) & 0xf;
        uint32 leftMode = (mode >> 8) & 0xf;
        uint32 bottomMode = (mode >> 4) & 0xf;
        uint32 rightMode = mode & 0xf;

And then analyze the value for each side:

        // top side follows...
        switch (topMode) {
                case 0:
                        // ... nothing
                        break;
                case _VIEW_TOP_:
                        // ... parent's top
                        break;
                case _VIEW_LEFT_:
                        // ... parent's left? -- meaning?
                        break;
                case _VIEW_BOTTOM_:
                        // ... parent's bottom
                        break;
                case _VIEW_RIGHT_:
                        // ... parent's right? -- meaning?
                        break;
                case _VIEW_CENTER_:
                        // ... parent's vertical center
                        break;
        } 

> PS: Look into View.h !

Anything special there?

CU, Ingo

Other related posts: