Window and View (and possibly the XP layer)

Subject: Window and View (and possibly the XP layer)
From: Mike Nordell (
Date: Sun Nov 12 2000 - 14:04:47 CST

Some parts of this post might seem "wierd", or even offending, at first, but
please read it before commenting on it.

I've been doing some usability studies (very informal, but still) of C++ GUI
APIs (from mostly a developers POV, but also from what a user might think of
FYI my main platform is Win32, but that has no bias in this "rant". I think
the Win32 model sucks. Big time.

The ones using BeOS might find the following reasoning easier to follow,
since the BeOS developers actually took the time to think of what we (from a
programming POV) try to do.

A window is the outer area surrounding your "workplace" in an app, and it's
defined by a (mostly) rectangular area. It may contain a title (in win32
thats a caption), minimize/maximize/restore buttons (win32&X (possibly also
Photon, haven't tried it _yet_)) or a "zoom" button (BeOS), and mostly it
also contains a border. It can also have behaviour such as being e.g.
sizeable (by the user).

Everything inside this are is really nothing else but "views" of different
stuff. This "stuff" should have as their absoluite (0,0) position the
top-left "client" are of that window. This suggests it lends itself bery
well to a OO hierarchical structure.

A status bar just a view that is (mostly) "attached" to the bottom of the
A toolbar is just a view that is (mostly) attached to the top of the window.

The View baseclass can tell the window (among other things) if it wants to
be aligned or if it doesn't care (unaligned, like a pop-up window). In this
terminology a statusbar would have a "hard" (i.e. non-questionable) relative
position to the windows bottom edge, but a "toolbar" would be "soft" aligned
to the top, since it can also be aligned to other toolbars...
An aligned view can be aligned relative the window (in pixels or percent) or
relative another view, whether it's trying to tell it's x,y or its size.. An
unaligned view of course have no alignment.

An aligned view can also say _what_ it's relative to. Window, or view. It
can also say "I need an absolute width" (like a pop-up "tooltip" saying "I
_really_ need 64 pixels to display my text").

Now, what do I actually mean with this?

I actually propose a change of view (pun intended) of the current model
we're using.
IMO, too much in AW is platform specific. We have (IMHO) too much behaviour
buried into platform specific classes. To give an example, have a look at
the Win32 input system that responds to the same user input (e.g. user press
a button) but much of it gets handled in platform specific code where we
could define an interface for this interaction (we _are_ in an enviable
situation because we actually _can_ define an XP interface and have the
ability to implement it). We can design it "right" instead of letting each
platforms code provide "workarounds" for the mismatches.

I'm not gonna try to force this view down anyones throat, I just wrote it
down to try give my wiew of what we should look at when we're trying to
create a cross-platform framework (AW isn't the end, it's the "pilot"). What
I (and probably many before me) have been wondering is "why do 'I' have to
re-implement handling for a press of this button when a "common-platform"
code (i.e. xp-code) could handle this).

If you find any of this even worth caring about, please comment on it. If
you don't think the discussion belongs in abi-dev, feel free to mail me. I
just wanted some input on this issue.

Thank you for listening (stepping down from the soap-box)...

/Mike - please don't cc

This archive was generated by hypermail 2b25 : Sun Nov 12 2000 - 14:03:03 CST