Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2004-09-03 08:41:43


"Hurd, Matthew" <hurdm_at_[hidden]> wrote

[snip]

> Side issue: resizing / device independence.

IMO This isnt a side issue ;-)

The problem of cross platform-ability would be fundamentally eased by a
clean abstraction of the viewport(s) and separation of that concept from the
concept of a device
My own experience is strictly Windows, but from the sound of your following
comments the lack of separation seems to be common.

There are two common abstractions of a Viewport

1 A matrix of pixels
2 A (usually rectangular) area of a certain length and height.

Generally speaking I would guess the one most used at the 'user level' is
the second abstraction. The first is used as the 'device level' abstraction.
Using the first abstraction at the user level, text displayed on a 640 * 480
pixel 'viewport' would be extremely difficult to read on a 1200 dpi laser
printer. I would assume most apps e.g a standard browser construct a
framework to achieve the second, so it seems a good candidate as a generic
component. I think Windows eg MFC ATL couples the two abstractions in a
DeviceContext, but the second abstraction is left very much up to the
developer to construct, thought the bones are there in eg GDI. Notably
though the DeviceContext must be informed about the user level abstraction.
It cant figure this out for itself.

   Problem with swing /
> wxwidget sizers and the like is that you can end up with some ugly
> looking screens with lots of space, things that are too small on screen
> sizes that are inappropriate. A lot of the time it doesn't matter too
> much, but often enough to irk me the screens just don't look "sharp"
> enough compared to an explicitly designed screen.

 I think it is one of the first problems that hits you when designing a
windowed application. A clear sign surely that the user level abstraction
of the viewport in that application has not been considered.

 This is often the
> issue with smaller screen sizes like portable devices. Something I've
> done in the past is to give components fractions of resizing for top,
> left, height and width which allows a tight design, to the pixel .

This sounds interesting but I dont fully understand it. Do you have a
generic algorithm or work 'per device'?

( I
> really like the compile time unit dimensioning of the co-ords by the
> way, positioning by mm dimensions is great) with easier control on how
> the thing will resize.

Thanks.... I'm working on it . ;-)

regards
Andy Little


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk