7323d0a21d
* Remove duplicated Interface Kit description. * Fixed links, a typo, inconsistent page names. Change-Id: I38e5943f31bf30870d33f02a97b4ef899222ec36 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4854 Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
73 lines
3.3 KiB
Plaintext
73 lines
3.3 KiB
Plaintext
/*
|
|
* Copyright 2010 Haiku, Inc. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Alex Wilson, yourpalal2@gmail.com
|
|
*/
|
|
|
|
|
|
/*!
|
|
\page interface_intro Introduction to the Interface Kit
|
|
\ingroup interface
|
|
|
|
\section Overview
|
|
|
|
The Interface Kit holds all the classes you'll need to develop a GUI.
|
|
Building on the messaging facilities provided by the Application Kit,
|
|
the Interface Kit can be used to create a responsive and attractive
|
|
graphical user interface.
|
|
|
|
The most important class in the Interface Kit is the BView class, which
|
|
handles drawing and user interaction. Pointer and keyboard events are
|
|
processed in this class.
|
|
|
|
Another important class is the BWindow class, which holds BViews and makes
|
|
them visible to the user. The BWindow class also handles BView focusing
|
|
and BMessage dispatching, among other things.
|
|
|
|
A new addition Haiku has added over the BeOS API is the Layout API, which
|
|
is based around the BLayoutItem and BLayout classes. These classes will
|
|
take care of making sure all your GUI widgets end up where you want them,
|
|
with enough space to be useful. You can start learning the Layout API
|
|
by reading the \ref layout_intro.
|
|
|
|
\section coordinatespaces Coordinate spaces
|
|
|
|
All APIs using coordinates (such as BRect or BPoint) refer to
|
|
a specific space where these coordinates are interpreted. BView and
|
|
BWindow provide various conversion function to translate coordinates
|
|
between different spaces, as needed, or provide separate methods such as
|
|
BView Bounds() and Frame(), returning results in different spaces as needed.
|
|
|
|
The initial coordinate space, from which all others are derived, is the
|
|
screen space. Its origin is at the center of the screen's top-left pixel.
|
|
Coordinates can be converted between this and a specific window or view
|
|
space is done using the ConvertToScreen and ConvertFromScreen methods of
|
|
the corresponding object.
|
|
|
|
Each BWindow has its own coordinate space. Its origin is at the center of
|
|
the top-left pixel of the window client area (just inside the window border).
|
|
Root level views added to the window have their frame rectangle defined in
|
|
this space.
|
|
|
|
Each BView also gets its own coordinate space. The origin is initially at the
|
|
top left of the view, but this can be changed by scrolling the view
|
|
(programatically using ScrollBy or ScrollTo, or by the user acting on a scrollbar).
|
|
|
|
Additionally, each BView also has a drawing space. This is further transformed
|
|
from the BView coordinate space by calls to SetOrigin, SetScale, SetTransform,
|
|
ScaleBy, RotateBy, and TranslateBy. The effects of the first two of these
|
|
methods are independant from the other four, and it's not recommended to mix
|
|
the two types of transformations in the same BView. Note that this is the only space
|
|
that can be scaled and rotated, and translated by non-integer units. All other
|
|
coordinate spaces are only translations of the screen one and remain aligned on pixels.
|
|
|
|
All drawing operations in a BView use coordinates specified in the drawing space.
|
|
However, the update rect passed to the Draw method (or passed to the Invalidate
|
|
method) is in the BView base coordinate space. Conversion between the two can
|
|
be done using the affine transform returned by BView::Transform, or in case the
|
|
legacy transformation functions are used, by applying the scale and origin returned
|
|
by the Scale() and Origin() functions.
|
|
*/
|