Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-10-05 00:57:30


Stefan Seefeld wrote:

> Vladimir Prus wrote:
>
>> Let me try from a different angle. There's some settings made by user,
>> like font size, or toolbar icon size. The unit does not matter there.
>
> I'm not sure I understand what you mean by 'unit' here. Imagine you want
> to print a portion of the screen. Do you expect dimensions to be preserved
> on paper or not ? I do.

Physical dimenstions? In millimeters? Then I don't expect this. Say the
program shows a chart in a window. It's natural to print that chart to
occupy full size of A4 paper (if A4 is the current paper size), or have
page layout customizable.

>> I believe that in a good GUI library, you should not ever need to use any
>> dimensions for windows dimensions, but just allow the layout code in the
>> library to take care of this. And since you don't have to specify
>> dimensions, it does not matter if they are in pixels or not.
>
> What you describe is true for 'non-terminals' in the tree only. All leaf
> nodes (glyphs, icons, but also some part of the widgets themselves, such
> as bevels, slider and scrollbar handles, etc., etc.) do need their own
> size.

Right, but those sizes should be configurable by user and never tweaked by
developer. The logic in the library to determine slider width, for example,
might be complicated, but it should be inside library. Do you ever needed
to explicitly set scrollbar width?

>
>> So, it looks like the only place where coordinate unit choice makes a
>> difference makes difference is explicit 2D graphics (drawing lines,
>> circles and the like).
>
> Ok, if you read 'only' appropriately. :-)
>
>> Do we agree so far? I'm just trying to narrow down the scope of
>> discussion. It just don't not make sense, IMO, to have a choice of
>> coordinate unit for mouse press event.
>
> I think we are in violent agreement. Mouse events are reported in the
> coordinate system of the target region (window, widget, surface, whatever
> you name it). All I'm saying is that this coordinate system should reflect
> physical size, i.e. be independent from device-space coordinates.
> Unfortunately, traditionally GUIs are tied to a particular device and thus
> it is custom to express coordinates in the device's own coordinate system.

But this does not cause any problems I know about. If you know about any
problems, please tell! Say mouse events coordinates are mostly usefull for
testing which object mouse is over, or for positioning popup menu, or
something like that. In those cases, using device coordinates are OK.

- Volodya


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