On Mon, May 5, 2008 at 1:02 PM, Freddie Witherden <[EMAIL PROTECTED]> wrote:
>  > My suggestion is simply to make it snap to another widget (not
>  > necessarily a parent, could be a sibling), and then provide an (x, y)
>  > constant offset from it in pixel independent values (millimeters?).
>
>  Seems good. So we could say something like:
>
>  widgetAdd(parent, child, northSnap, eastSnap, southSnap, westSnap);

I was thinking more like widgetAdd(parentWidget,
frameOfReferenceWidget, side, offsetX, offsetY);

Putting an icon in the lowest right side of the main window:
widgetAdd(screen, screen, BottomLeft, 10, 10);
Adding the third button in a row inside a window: widgetAdd(window,
second, Right, 20, 0);

>  Take a label widget for example, lets say it has worked out it needs
>  to be *at least* 150 pixels large.

I think we can safely assume that we have no or decide we shall have
no widgets with such pixel precise requirements. Models, text, and
textures can all scale to fit the allocated space.

>  > I would suggest specifying size exactly using a pixel independent
>  > value (millimeter? permille of screen size?).
>
>  On Linux this would work. This is because X computes the screen DPI
>  on the fly. So a piece of 12pt text will be the same size on *all*
>  linux systems. Windows assumes a DPI of 96, while OS X assumes one of
>  72.

It is not that hard.

( pixel width of screen ) / CONSTANT = x factor
( pixel height of screen) / CONSTANT = y factor

We multiply all x, y values, which are in the range 0..CONSTANT, by
these factors and get resolution dependent values. We could even
decide to go the OpenGL way, and decide that the factor is 1.0 and
that x,y values are floating point.

  - Per

_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev

Reply via email to