History log of /haiku/src/kits/interface/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
ff21b4c3 22-Nov-2020 Pascal Abresch <nep@packageloss.eu>

HaikuControlLook: don't modify menu color before applying it

Change-Id: I31838d4c17d4616c2c166197596a93bf51785677
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3410
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>

18970361 23-Nov-2020 John Scipione <jscipione@gmail.com>

BTextView: ensure text rect width and height is > 0

Helps wth #16476 #16568

Change-Id: Idc8d399cf69776d26e492f568c9ef83bcd7a6686
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3413
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

529fedc7 07-Mar-2020 X512 <danger_mail@list.ru>

Interface kit: Resize menu if invalidated.

Change-Id: I45a966b13be6953431a1176378e4ddc10920916b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2325
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: X512 <danger_mail@list.ru>

b05d6f0a 05-Nov-2020 Jérôme Duval <jerome.duval@gmail.com>

POSIX: asprintf and vasprintf are BSD/GNU extensions

fix #16259

Change-Id: Ia16bb6e1944b87b25d1a940bbdaaf6e236db1abf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3381
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

7c095f47 01-Jun-2020 John Scipione <jscipione@gmail.com>

BeControlLook: Fix app integration drawing issues

Update BTab::DrawTab() to pass the current index, the index of the
selected tab, and the index of the first and last tabs into
BControlLook::DrawActiveTab() and BControlLook::DrawInactiveTab().
This allows you to draw tabs differently in your BTab or BControlLook
subclass in many different circumstances.

Modify BControlLook API to add indexes to DrawActiveTab() and
DrawInactiveTab() like so:

void DrawActiveTab(..., int32 index = 0, int32 selected = -1,
int32 first = 0, int32 last = 0);
void DrawInactiveTab(..., int32 index = 0, int32 selected = -1,
int32 first = 0, int32 last = 0);

These extra indexes are not used by HaikuControlLook which relies only
on if the tab is active or inactive to draw.

Add IndexOf(BTab* tab) method to BTabView and document it to get the
index of the current tab in BTab::DrawTab(). Also add a warning in the
BTabView::DrawTab() method not to use the position and full parameters
anymore, use BTabView::IndexOf(), BTabView::Selection(), and
BTabView::TabCount() to get the info you need.

Using a dynamic_cast to a BTabView in BeControlLook to determine if the
view is derived from a BTabView didn't work in the case of WebPositive.
Furthermore, WebPositive does custom tab drawing which needed to be
updated for alternative control look. These index parameters passed from
BTab to BeControlLook allow us to draw the tab like BeOS without relying
on a dynamic_cast to BTabView to get the info.

Reproduce the functionality described above for BTab in WebPositive's
custom tabs. Eliminate no longer needed code in favor of using indexes.
Update WebPositive custom tabs to use BControlLook::DrawTabFrame()
instead of BControlLook::DrawInactiveTab() matching the update made in

In BeControlLook::DrawTabFrame() fill rect with base color, WebPositive
doesn't draw any tab background, so it expects this work to be done for

Eliminate hasFrames variable from WebPositive.

Rename TabSelected(index) to UpdateSelection(index) in WebPositive to
better reflect its purpose.

Adjusted HaikuControlLook::DrawInactiveTab() to draw the tab borders more
selectively. Only draw border if left border is set for top and bottom tabs
or top border is set for left and right tabs. Undo no longer needed frame
manipulation border drawing workaround in HaikuControlLook::DrawTabFrame().

Draw scroll bar triangle without using DrawArrowShape().

Unlike in HaikuControlLook, DrawArrowShape() is used to draw arrows in
BOutlineListView and menus distinctly from how it draws arrows in scroll
bars. Draw our distinct arrows in DrawSrollBarButtons() instead.

This fixes overflow of time edit up-down arrows in Clock prefs and the
collapse-expand arrow in Deskbar not being vertically centered.

In DrawBorders() only inset if we actually draw the border.

Fix alignment issues with DrawSliderThumb dots for example in
MediaPlayer volume knobs.

Draw using line arrays calling AddLine instead of StrokeLine in
several places.

DrawMenuBar() extends to draw final pixel which eliminates an extra
lines at the end of menu bars.

Truncate button labels better fixing a few issues for example keymap
keyboard layout button labels. Button insets has been updated a bit
to fix drawing issues with buttons missing a border.

Using a dynamic_cast to a BButton to determine if a view is a button
in BeControlLook didn't work in the case of the keymap label. Look for
B_FLAT, B_HOVER, or B_DEFAULT_BUTTON flag in BeControlLook::DrawLabel()
to draw the label inverted on click. Pass the B_FLAT flag from Keymap
keys when drawing using BControlLook so that the label is inverted.

Change-Id: I07631f4b006bdb9aeca2adc9cbdf2da54dae8e92
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2866
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

06ed32b8 05-Oct-2020 Jérôme Duval <jerome.duval@gmail.com>

BCursor: add a constructor with bitmap and point

* enhancement #15169
* get_mouse_bitmap(): also reads the colorspace from app_server.
* docs and tests

Change-Id: Iba63f8a2789530ae596c30b92f14828f31761d98
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3292
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

b76afa5b 24-Sep-2020 John Scipione <jscipione@gmail.com>

BTextView: Draw string even if foundTab

Fixes #16544 (regression from hrev54549.)

Change-Id: Icca0b50f5432351b9c7ffcb82b1c8195a7ed286b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3267
Reviewed-by: humdinger <humdingerb@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>

9aea709d 03-Sep-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

Input prefs: handle errors

Various error handling cases were missing, which would lead to corrupt
settings and crashes. Add the missing error checks and make sure we
always revert to sane settings in case of problems.

Change-Id: Ib72621d6e4974345f5f6ee88e01a918cbf09d7ea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3069
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

02ad22d6 04-Aug-2020 Preetpal Kaur <preetpalok123@gmail.com>

Input: declare BString to get the Mouse Name

Change-Id: I3476f58839202a6fd8c93e325a15045963a9b7b2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3125
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

37d79323 04-Aug-2020 Preetpal Kaur <preetpalok123@gmail.com>

Added get_set_mulitple_mouse_type() functions

Change-Id: I95f85a15a77c3a548bb672cb966ae7b13fcefcc8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3127
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

d9385a9d 20-Jul-2020 John Scipione <jscipione@gmail.com>

IK: align BTextView text rect/fix alignment

Recalculate line breaks in FrameResized() if word-wrap is on, otherwise
only move the text rect into position. StyledEdit was recalculating line
breaks before on resize (we have to in this mode) and the frame offset
updates for non-wrapping text views are inexpensive. This makes resizing
text view's work like StyledEdit everywhere.

Scroll to cursor when word-wrap setting changes if text view is editable.
If you are viewing a long document changing word-wrap can move the cursor
quite far, so scroll back to it.

Fix _ActualTabWidth() pen location for right and center-aligned text views
so that tabs widths are calculated correctly.

Reset fTextRect horizontal limits to bounds minus insets in
_RecalculateLineBreaks(), then grow fTextRect based on alignment when
wrap is off.

Fixing insets also fixes right and center-aligned BTextViews.
Left-aligned text view's grow right, right-aligned ones grow left,
and center-aligned ones grow out.

Make extra scrolling space for all aligned text views go the other way
from how it did in hrev24130 (and on left-aligned text view's too) so
that half the text is visible when you edit past the end or before the
beginnning of a text view instead of none of it.

Fixes #1651 #12608 #13796 #15189

Do not _RecalculateLineBreaks() if text view bounds are invalid.
In SetText() detect invalid text view bounds and resize the view to the
width and height of the first line. Then recalculate line breaks.
This fixes BAlert text view size issues.

Fixes #16481 (regression from hrev54496.)

Remove useless and heavy computation. There is no point in computing line
breaks for a 10px wide text view and it takes a long time because it needs
a lot of linebreaks. The view eventually gets laid out properly.

Fixes #5582 (which was not locale-related, after all.)

Only apply default insets if text rect is set to bounds. This ensures
that apps that manipulate the text rect can continue to do so without
the default insets interfering while apps that don't can benefit
from the defaults. If you want to set the text rect to bounds and
not use the default insets you must override the default by calling
SetInsets(). This prevent the default insets from being applied once
apps have changed the text rect fixing a bug in Icon-O-Matic where the
text rect insets were being applied incorrectly.

Fixes #16488 (regression from hrev54496.)

Reduce left and right insets inside text views from full label spacing
to half label spacing. Unify padding between BTextControl and BTextView.

Move fLayoutData->UpdateInsets() to private BTextView::_UpdateInsets()
because we need access to BTextView member variables when deciding
whether or not to add the default padding or not.

_UpdateInsets() changes:
* Don't update insets if BTextView::SetInsets() was called.
* Don't add default insets unless fTextRect is set to view Bounds().
* Do not set the right and bottom insets to left and top if negative,
set them to 0 like we do to left and top -- DeskCalc bug otherwise.

Fixes #15688

Other BTextView fixes:
* Replace max_c and min_c with std::max and std::min respectively.
* Remove scrolling from one instance of BTextView::SetText() as it
produced undesired results while editing a scrolled text view.
* Add default insets in _UpdateInsets()
* Fix scrolling when entering and deleting text so that some part of
the text is always visible. Make visible scroll width depend on font
* Allow scrolling to a negative offset in x but not y. This allows you
to scroll the entire contents of right and centered-aligned text views
whose content does not fit in the box.
* Change _Refresh() to take an offset instead of a bool so that you can
scroll to any offset.
* Replace TextLength() with fText->Length() in a couple of places.

TextControl changes:
* Set text rect in BTextControl::DoLayout().
* Remove AlignTextRect() from TextInput.

Fix the following problems in apps:

ScreenSaver: Set text rect in PreviewView::AddPreview().
Tracker: Set "Edit name" text view insets to 2. Tweek text rect position
to be on top of label in icon, mini-icon, and list mode. Add a TODO that
the text rect is a pixel off from the name on some files.
Mail: Remove _AlignTextRect() and FrameResized() from AddressTextControl.
Use default insets on the text view, defaults are fine here.
DeskCalc: Set insets based on font size in ExpressionTextView
SetTextRect() instead of manipulating the text rect.
Remove _CheckTextRect() and related methods from InputTextView.
Icon-O-Matic: Remove _CheckTextRect() and related methods from InputTextView.
WebPositive: Remove _AlignTextRect() and FrameResized() from URLTextView
and call SetInsets().
StyledEdit: Word-wrap and FrameResized() changes ported to BTextView.

Fixes #16476 #16480 #16488 (regressions from hrev54496.)

Change-Id: Ifeca6077f8815ccd86d5a3880f99556298aaf0fe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3152
Reviewed-by: John Scipione <jscipione@gmail.com>

6148533e 22-Aug-2020 John Scipione <jscipione@gmail.com>

Revert "BTextView: remove useless and heavy computation"

This reverts commit ca6302dded7e62f3605efe70e652354827e8ec1d.

22758f16 17-Aug-2020 John Scipione <jscipione@gmail.com>

Revert "IK: align BTextView text rect/fix alignment"

This reverts commit a9b301871d06c0ebe42d22b31c685abed5107acd.


Change-Id: Ife3c834ad98d330f04976d9adf3b1553e7aca034
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3153
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>

6d9c0146 11-Aug-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

BGradient: fix assignment operator, add copy constructor

The BGradient class is a bit strange as it can store any gradient on its
own, butonly the subclasses allow to set some of the fields.

In the asignment operator, the non-base data (which is in an union) was
not copied over.

More importantly, the missing copy constructor led to the default
implementation being used, and BList (used for the color stops) was
being copied using its default copy constructor, resulting in the two
BGradient (original and copy) poinitng to the same stops data. Heap
corruption resulted whenever one of them was deleted.

Having a working copy ocnstructor fixes this. The alternative is making
the copy constructor private or protected to make sure gradients are not
copied, since normally you'd copy only the subclasses, preserving the
C++ type. However there is nothing enforcing that, and manipulating a
BGradient copied from a subclass works just fine.

Change-Id: I28e733eb8a2970b76ae623eabb75ef8435f508af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3144
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

a9b30187 20-Jul-2020 John Scipione <jscipione@gmail.com>

IK: align BTextView text rect/fix alignment

Preserve passed in text rect in fTextRext (unless in layout)
and create an internal version fAlignedTextRect which is used
in place of fTextRect. fAlignedTextRext is aligned to fit the
text rect bounds and grows to fit. fAlignedTextRect always grows
vertically but only grows horizontally if wrap is off.

Left-aligned text view's grow right, right-aligned ones grow left,
and center center aligned ones grow out.

Set fTextRect to bounds in _DoLayout().

Reduce left and right padding inside text views from full label
spacing to half label spacing. Unify padding between BTextControl
and BTextView.

Fixing padding also fixes right and center-aligned BTextViews.

Undo extra scrolling for non-left text views from hrev24130 fixing
a scrolling left and right with mouse bug when it shouldn't.

Replace max_c and min_c with std::max and std::min respectively.

Remove scrolling from one instance of BTextView::SetText as it
produced undesired results while editing a scrolled text view.

Set text rect in BTextControl::DoLayout() and ScreenSaver

Don't add padding if BTextView::SetInsets() is called. Set insets
to 0 in Tracker "Edit name" setting which prevents default padding
from being added. This is so that when you rename a file in Tracker
the TextView appears on top of the file name text with no padding.

80 char limit fixes.

Fixes #1651 #12608 #13796 #15189 #15688

Change-Id: I8c6106effc612f49aff374f29742471628b5df86
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3054
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

ca6302dd 05-Aug-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

BTextView: remove useless and heavy computation

There is no point in computing line breaks for a 10px wide text view and
it takes a long time because it needs a lot of linebreaks. The view
eventually gets laid out properly.

This may cause regressions, the TODO here is very old and I don't know
to which "other parts of the code" it refers. Possibly they were
rewritten, possibly not. In any case, there is no point in keeping this
nonsense initial text rect computation, it's better to fix the actual

Fixes #5582 (which was not locale-related, after all)

a06b52be 28-Jul-2020 Augustin Cavalier <waddlesplash@gmail.com>

BScrollView: Revert to earlier document-window adjust behavior.

We need a different constant or mechanism to get the document
window border size, it appears, or a static method to get
a scroll bar's preferred size.

Should fix #16422.

36ef16bf 27-May-2020 X512 <danger_mail@list.ru>

BGradient: add Flatten, Unflatten methods

Change-Id: I861bab8ae19628d34297c294fd6ce3e5b6c82b34
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2827
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

4399ec51 10-Jun-2020 X512 <danger_mail@list.ru>

BPicture: add fill rule support

Change-Id: I068e1c2e8659f7b90c6d7c7331a8bb25ae343fe9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2922
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

90ab1a44 27-May-2020 X512 <danger_mail@list.ru>

BPicture: add gradient support

Fixes #9680.

Change-Id: I0013326559cc40ff26cf7b44794c0b32aea832ba
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2829
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>

8539dfda 06-Jul-2020 Augustin Cavalier <waddlesplash@gmail.com>

BScrollBar: Use the minimum as the preferred size in the alternate axis.

This was the behavior before the commit yesterday that unified the
two methods of computing the preferred size. It seems some applications
expect this to be callable without a window lock, so this works when
the other method does not.

Fixes #16372.

bdfb3cd7 05-Jul-2020 Augustin Cavalier <waddlesplash@gmail.com>

BScrollBar: Report a more correct maximum size.

This way, BScrollBar will now be scaled appropriately when used
within layouts, as it is in e.g. Tracker.

b29bb4be 05-Jul-2020 Augustin Cavalier <waddlesplash@gmail.com>

BScrollBar: Apply font scaling to preferred sizes.

As BScrollView has already been adjusted to use this, most applications
will now have properly scaled scrollbars on HiDPI systems.

All unadjusted controls and applications will still be able to use
the hard-coded constants as before, but these should eventually
be deprecated altogether and then removed.

b022a5e2 05-Jul-2020 Augustin Cavalier <waddlesplash@gmail.com>

BScrollView: Ask the BScrollBars what their preferred sizes are.

This replaces the use of the hard-coded scroll bar size constants
and instead asks the scrollbars for their preferred sizes directly.

Right now, this is a giant no-op since BScrollBar just returns
the same hard-coded size when asked. The next commit will, however,
change that.

9481a1ec 04-Jul-2020 Augustin Cavalier <waddlesplash@gmail.com>

BScrollBar: Unify PreferredSize computations.

Reduces code duplication. This should not significantly affect
actually computed sizes.

9fe3529f 04-Jul-2020 Augustin Cavalier <waddlesplash@gmail.com>


It was always enabled, and disabling it would break ABI.
If we want to make it disable-able, it needs to be a setting,
but I don't really see a reason for that.

e9815ed8 04-Jul-2020 Augustin Cavalier <waddlesplash@gmail.com>

BScrollBar: Move SCROLL_BAR_{...}_KNOB_SIZE constants into the source.

They were not used anywhere else in the tree anyway. Resolves a TODO.

981f67b9 04-Jul-2020 Augustin Cavalier <waddlesplash@gmail.com>

BAlert: Add cast to appease GCC2.

9a0cae9d 04-Jul-2020 Augustin Cavalier <waddlesplash@gmail.com>

BButton: Use BControlLook for label spacing instead of a constant.

This gets button proportions under HiDPI much closer to the ones
under a default font size. Still not quite there yet, though.

2d68cd06 04-Jul-2020 Augustin Cavalier <waddlesplash@gmail.com>

HaikuControlLook: Scale frame insets.

This is a pretty simple change, but has a noticeable effect
on insets throughout the system under HiDPI.

cf7c2ea6 04-Jul-2020 Augustin Cavalier <waddlesplash@gmail.com>

BMenu: Make margins/padding more HiDPI-aware.

This greatly improves the appearance of menus under font-scaled systems.
The computations are written such that the margins should be unchanged
under a 12pt font size.

99e4ca5f 04-Jul-2020 Augustin Cavalier <waddlesplash@gmail.com>

BAlert: Use factional scaling for icons.

The behavior of not making the icons smaller than their default
pixel size is (for now) kept, but when making them larger,
fractional scaling is now used.

This makes alerts look much better on my system, which has a font
size of 18 (i.e. 150% normal, so 32px -> 48px.)

d9d96260 01-Jul-2020 X512 <danger_mail@list.ru>

BMenu: speed up deleting items

Fixes #16336.

Change-Id: Ie941f45f363f6fe94062fc3acb8bd3bb876c1f1e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2976
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

66f0993a 02-Jul-2020 waddlesplash <waddlesplash@gmail.com>

Revert "BMenu: fix memory leak in scripting"

This reverts commit fb44a1cd7204b88987cd1370cb1a5ccf30d479d5.

Reason for revert: may cause UAFs

Change-Id: I315ce4fc5cd1706ca07e7062fc0461b7fff7c831
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2980
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

fb44a1cd 02-Jul-2020 X512 <danger_mail@list.ru>

BMenu: fix memory leak in scripting

Change-Id: Ia283594a622f758189cc8280683a4e068ae1f3af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2978
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

079e9eef 23-Jun-2020 X512 <danger_mail@list.ru>

BListView: complete scripting support

Change-Id: Iff4b5cb775d1c0b0e588459429d6df7fb93a760e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2945
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

8fbce873 21-Jun-2020 X512 <danger_mail@list.ru>

BMenu: implement scripting

Fixes #15540.

Change-Id: I965d04bcbb6db41cc7a744d18fa3c9ffab2a81f1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2941
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

e1bb846d 19-Jun-2020 X512 <danger_mail@list.ru>

BColumnListView: fix keyboard navigation

Make expanding/collapsing logic the same as in BOutlineListView.

Change-Id: Ia8669ec6ac1be15c09879aa759474b4841451c39
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2933
Reviewed-by: John Scipione <jscipione@gmail.com>

1d22b1ae 08-Jun-2020 X512 <danger_mail@list.ru>

PicturePlayer: use BStackOrHeapArray

Change-Id: I7908d8304276d14782bde5c2b8c089f3ca0138e2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2894
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

c47cb94a 03-Jun-2020 X512 <danger_mail@list.ru>

BOutlineListView: fix keyboard navigation

* On left arrow key select parent item when selected item is collapsed.
* Scroll to selected item when expanding/collapsing.

Change-Id: Ia404abb970376d4168efd8bba4d8817712a885a6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2873
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

d5a3eb04 11-May-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

BCardLayout: make the first item visible.

Change-Id: I7b836a22bc5c281bec9b44859c42fec56af45574
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2683
Reviewed-by: Andrew Lindesay <apl@lindesay.co.nz>

9585fabd 12-May-2020 Augustin Cavalier <waddlesplash@gmail.com>

BColumnListView: Consider current, not preferred, column width for overall preferred with.

Otherwise, the entire list will be scanned for row widths, which
is extremely slow with thousands of items, and may not be what
the user wants anyway, if they have set specific column sizes
which are larger/smaller than that.

Helps with #16012 and #15889 considerably.

9cfe1443 10-May-2020 Augustin Cavalier <waddlesplash@gmail.com>

BCardLayout: Do not recompute size limits on visible item switch.

The size limits are already the minimum/maximum for all views,
not just the current one, so we do not need to recompute them
when the layout is invalidated due to an item switch.

Fixes #14675, and other performance issues on switching tabs
in layouted BTabViews, among other things.

Change-Id: I55bfe4ddb8c8a79c634634cfc27113205a790c42
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2677
Reviewed-by: Andrew Lindesay <apl@lindesay.co.nz>

db3a9414 06-Mar-2020 X512 <danger_mail@list.ru>

SeparatorItem: support horizontal layout

This is required for BMenuBar based toolbars.

Fixes #15785.

Change-Id: I8d108694b481e408e5c56e23a697c8e7829343dc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2316
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

1826e60d 08-May-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

Do not locate DeskBar window by its name

The name changes when translations are enabled. Use the index instead.

Fixes #8982.

Thanks to X512 for catching the problem!

Change-Id: I3c4e943f8476e46e7378a50e83a7758f694a8dc0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2606
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

20f2ebae 07-May-2020 Adrien Destugues <adrien.destugues@opensource.viveris.fr>

Remove MouseDownThread and its usages

This code comes from an old Be Newsletter and since then the API
received the addition of SetMouseEventMask. In several places the
MouseDownThread was misused: it would spawn a new thread on every mouse
click and not clear the previous one. This could for example lead to
BSpinner skipping values if you clicked it at the right speed.

There are functional changes in BSpinner, before it updated for the
first time 100ms after mouse down, and then as you moved the mouse
around the button, now it activates immediately on first click and then
every 200ms (which may be a bit short). In other places, no functional
changes intended.

Change-Id: Ie600dc68cbb87d1e237633953e5189918bf36575
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2599
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

ffd6da17 04-May-2020 Emir SARI <bitigchi@me.com>

Enable accept first click by default

Change initial setting as well.

Change-Id: I8dadde139f9c38ee7fa74ce99f0e616c42d9eb81
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2563
Reviewed-by: Sergei Reznikov <diver@gelios.net>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

494e2564 04-May-2020 John Scipione <jscipione@gmail.com>

BScrollBar: Redraw scroll bar button on click

DrawScrollBarButton passes B_ACTIVATED flag to HaikuControlLook which
draws the button as down.

This regression was introduced in hrev54032.

Fixes #15960

Change-Id: I87dbaa9e8c9169c67dd7cb463d3604d9727ae28f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2577
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

b7c0f682 05-Mar-2020 X512 <danger_mail@list.ru>

BListView: fix ScrollToSelection

When selection moves down, BListView was sometimes scroll to upper item,
not lower.

Change-Id: I8f3cf87d43e93c3d2cabfd7ca76f44f1575525e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2311
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

c2895beb 19-Apr-2020 Adrien Destugues <adrien.destugues@opensource.viveris.fr>

Build fix.

8a397b05 05-Feb-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

BTabView: use the back/forward buttons to switch tabs

Note that for this to work well, the child views in the tabs must
propagate MouseDown events up for these buttons.

47e83a42 18-Apr-2020 waddlesplash <waddlesplash@gmail.com>

Revert "BTabView: use the back/forward buttons to switch tabs"

This reverts commit 7ba52abdd38f37e7bd687334173108196760f609.

Reason for revert: Broke the build due to undeclared symbols.

Change-Id: If726d1f71a336f98428037dad2acfdaf961f1a84
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2497
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

7ba52abd 05-Feb-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

BTabView: use the back/forward buttons to switch tabs

Note that for this to work well, the child views in the tabs must
propagate MouseDown events up for these buttons.

Change-Id: I503d7203cb20e6ba85bd0d7e1cfaed988e3cf17b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2207
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

47102c07 24-Feb-2020 X512 <danger_mail@list.ru>

Interface Kit: introduce B_TRANSPARENT_BACKGROUND flag

BeOS didn't support transparent views. As documented in the Be Book,
SetViewColor(B_TRANSPARENT_COLOR) only effect is to not fill the
invalidated areas with the view color before calling Draw() (it avoids
flickering, especially when combined with B_FULL_UPDATE_ON_RESIZE).

A previous change made B_TRANSPARENT_COLOR actually make the view
transparent (that is, additionally to the above, the underlying view is
drawn before the transparent children), but it creates compatibility

In order to keep the API compatible with BeOS, the new behavior is now
enabled explicitly using the B_TRANSPARENT_VIEW flag. This also opens
for future developments like allowing a view color with an alpha
channel (not supported yet).

Adjust programs that require transparent views.

Fixes #15744, #15745.
Helps with #15645.

Change-Id: I529574ea23db0a23579521b263bc8d572775e35a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2275
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

5cfca119 06-Apr-2020 Niels Sascha Reedijk <niels.reedijk@gmail.com>

HaikuBook: Add documentation for BCardLayout

This adds documentation for BCardView, BCardLayout and BLayoutBuilder::Cards.
There is also a bit of cleanup for the BSplitView documentation.

It also makes explicit when a developer passes an invalid argument to
BCardLayout::SetVisibleItem(), by making that a debugger() call.

Change-Id: I17ac52cc773bb76c4f81beaa76f72af62a9e10f4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2460
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

1482b250 04-Mar-2020 John Scipione <jscipione@gmail.com>

IK: Update scroll bars for alternative control look

Scroll bars should look and work identically to before on

Add DrawScrollBarButton() and DrawScrollBarThumb() and
DrawScrollBarBorder() methods. These methods are used to draw scroll
bars in a generic way so that they can be drawn differently by alternative
control look's (e.g. BeControlLook). Also it gives us back drawing of
scroll bar knobs. However the knob setting is not exposed in the
interface in this commit.

These methods are in addition to the 2 existing DrawScrollBarBackground()
methods that draw the scroll bar background. One draws the area above and
below the thumb and the other is called by the first to actually draw the

The rest of the drawing besides the backgrounds was being done in
BScrollBar before. To draw the scroll bar arrows and thumb we were recyling
other ControlLook methods, while this worked well enough on HaikuControlLook
it wasn't flexible enough for alternative control looks.

DrawScrollBarButton() is used to draw the four scroll buttons and is
typically (so far) used in combination with DrawArrowShape().

DrawScrollBarThumb() draws the scroll bar thumb.

DrawScrollBarBorder() draws a 1px border around the entire scroll bar,
potentially B_KEYBOARD_NAVIGATION_COLOR if focused (although this is
feature not currently used.)

Draw unscrollable scroll bars as if they were disabled including the
buttons with their arrow shapes, background, and thumb.

Add FBC backwords compatibility macros in ControlLook.cpp

Change-Id: I9237c5ce45d17d674785111d51de951e5686306b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/351
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

67597f42 15-Mar-2020 X512 <danger_mail@list.ru>

Interface kit: fix regression introduced in hrev53944

In hrev53944 selection is cleared if text view lose focus, but it
don't work properly in StyledEdit, causing clearing selection when
menu is opened. Clear selection on lose focus is needed for text controls,
so when you click on another text control, previosly focused text
control should clear selection. This behavior is working in BeOS, so
some investigation is required.

Fixes #15810.

Change-Id: Ie104fc1d7e76c2cd2b97d3a0462856fe70cccbbf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2355
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>

61557c82 04-Apr-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

BListView: do not spawn a thread on every mouse click.

That's a bad idea. The drag and drop tracking could get confused enough
to crash app_server (possibly because of calling InitiateDrag multiple

Fixes #14983.

ddb8a390 18-Feb-2020 John Scipione <jscipione@gmail.com>

BWindow: Adjust default zoom for new mini-mode

Treat bottom left, bottom right, and top left mini-mode like
horizontal mode and go full screen in top right mini-mode.

Change-Id: I55c4c0875b5696e6c193a72d96f309c3b058bf9c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2254
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

1c9c7729 12-Jan-2020 X512 <danger_mail@list.ru>

Interface Kit: make BTextControl behave like BeOS

Contents of BTextControl should be not selected if text is directly clicked.
Selection should be removed if BTextView lose focus.

Change-Id: Ifba914c2ada4fc1aac88205f69a64a4356009469
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2109
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

9b33a309 04-Mar-2020 X512 <danger_mail@list.ru>

Interface Kit: fix menu resizing when scrolling is enabled

BMenuWindow::Attach/DetachScrollers can be called when scrollers are
already attached/detached and it should handle this case properly.

Call BMenuWindow::DetachScrollers when scrolling is not needed anymore.

Fixes #8513.

Change-Id: I1f70b63d75106cf33ab1f72d34e221a54b45a75e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2310
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>

2e08685b 03-Mar-2020 John Scipione <jscipione@gmail.com>

BMenu: Rename FrameMoved and FrameResized variable names

No functional change. lowercase_with_underscore file names are not
in-line with Haiku's style guidelines.

Change-Id: I254c975ee60168963ca4039a61dc428c05e0e6ba
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2306
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

ab319eb7 29-Feb-2020 Augustin Cavalier <waddlesplash@gmail.com>

BRegion: Do not "cheaply convert" to the internal format.

_ConvertToInternal does the same thing, and should get inlined
under normal circumstances, so just use it.

No functional change (intended).

Change-Id: Ic4fc9daeb33ab33967d795065a077f282e844f6d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2297
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>

f816ef57 29-Feb-2020 Augustin Cavalier <waddlesplash@gmail.com>

BRegion: Remove unneeded inline "documentation."

All this (and more) is in Region.dox already.

Change-Id: I94ff154cc78cda87d82941deb30f73cac39c3409
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2295
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>

fa60e7a6 24-Feb-2020 X512 <danger_mail@list.ru>

BMenu: remove delay when opening submenu with mouse

Fixes #11703.

Change-Id: Iae01eeffee27ecde5bb333c85b8c3cb411f1bd00
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2274
Reviewed-by: Sergei Reznikov <diver@gelios.net>
Reviewed-by: humdinger <humdingerb@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

17a91a98 02-Jan-2020 X512 <danger_mail@list.ru>

BMenu: fix menu navigation area

Change-Id: If9326ebc99978627d9dfb1eaff67912f0114f292
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2071
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

e10de1ec 12-Jul-2018 Ryan Leavengood <leavengood@gmail.com>

Visually align shortcuts in menus

In a menu, we use the right side both for submenu arrows and shortcuts.
As a result, when an entry has both a shortcut and a submenu, its
shortcut is not aligned with others, and this does not look so nice.

The spacing for the arrow appears only if there is a submenu in any of
the items in the parent menu.

Change-Id: If91fdcdad36abb0141fb05d1f59141f89540c1db
Reviewed-on: https://review.haiku-os.org/c/haiku/+/355
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Ryan Leavengood <leavengood@gmail.com>

59b700d0 19-Jan-2020 X512 <danger_mail@list.ru>

Interface Kit: remove more workarounds for BDragger

This workarounds are no longer needed after hrev53713.

Change-Id: I7b809c79bd9d2345a991f0d2360f79876d10cd6b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2132
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>

c4a686d8 19-Jan-2020 X512 <danger_mail@list.ru>

Interface kit: fix displaying draggers when they were initially hidden

IsHidden(this) should be used instead of IsHidden() because IsHidden() return
true if window is hidden (at moment of creation for example).

Fixes #15646.

Change-Id: I08c8bacd634139dd62fb239e16cb80f512e4be6d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2128
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>

52ac76ce 09-Jan-2020 X512 <danger_mail@list.ru>

Interface Kit: fix BDragger background drawing

Change-Id: I1ce8eca127e14af0652ef38fedcbbf588f1567fd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2092
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

db7c4791 10-Jan-2020 X512 <danger_mail@list.ru>

Interface Kit: read reply before calling hooks.

Part of #15548.

Change-Id: I074d36717ef1e2fad4e8bc215448fa72f797ed7f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2099
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

bb501d4c 12-Dec-2019 X512 <danger_mail@list.ru>

BTextView and BListView: fix scripting

fix #15539

Change-Id: I5139b91214e19b35af1ead203c070837b7a15bd9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2017
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>

c67dde0f 17-Nov-2019 Kacper Kasper <kacperkasper@gmail.com>

app_server: Add tiled bitmap drawing routines

Change-Id: I9a7bd967f2cc95d815a66707b764cf5e33b3f8ed
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1962
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

fb3493df 14-Aug-2019 John Scipione <jscipione@gmail.com>

BControlLook: Move tab frame drawing into DrawTabFrame()

The tab frame is drawn behind the tabs.

Create a new DrawTabFrame method in BControlLook and HaikuControlLook
that draws the tab frame background.

Until now we've been reusing the DrawInactiveTab method to draw the tab frame
in BTabView. While this works on HaikuControlLook, it doesn't work on other
ControlLook's (such as BeControlLook) that draw their tab frame differently.

Add FBC method to preserve binary compatibility on gcc2 and gcc4.

Move DrawTabFrame method to where _ReservedControlLook1 was in header.

Set rect to area of tab frame in TabView instead of doing the
calculation in HaikuControlLook so that others may benefit.

Change-Id: I513e238914f6d680f495659b6ec902df15555015
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1936
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

9c89ceb8 26-Sep-2019 Adrien Destugues <pulkomandy@pulkomandy.tk>

BTextView: missing archiving of HideTyping()

This was not stored in BeOS, but that looks like an oversight on their
part and adding it is unlikely to break anything.

Change-Id: I5dbaeb85adf97afc5040a3ecc1bff264af0b0b57
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1888
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>

07838f4c 26-Sep-2019 Adrien Destugues <pulkomandy@pulkomandy.tk>

BTextView: preserve ViewUIColor when unarchiving

When unarchiving, we can rely on BView to properly restore the colors,
and we should not alter them. So move the code doing that outside of
_InitObject, and into all non-unarchiving constructors instead.

Change-Id: I98050c69bb3b8edf6e77ad0498e2dade5eaadb1d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1887
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

e5d533fd 11-Sep-2019 Mikael Konradsson <mikael.konradsson@outlook.com>

OutLineListView: adjust color of expander arrow when using dark color scheme

Change-Id: I7de7a460111556b7f40565ed0a6110c1f7660a25
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1847
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

75e57397 16-Aug-2019 Simon South <simon@simonsouth.net>

BWindow: Do not invoke BView handlers directly

When dispatching a message to a BView, pass the message on to the view's
MessageReceived() method rather than invoking one of its handlers (e.g.
KeyDown() or MouseDown()) directly.

This commit moves the existing handler-invoking logic from
BWindow::DispatchMessage() into BView::MessageReceived(), preserving the
existing functionality.

Fixes #15254.

Change-Id: I230c0781df13e54e08573a5a31d7550520c060d5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1723
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Ryan Leavengood <leavengood@gmail.com>

aabebc30 27-Aug-2019 Mikael Konradsson <mikael.konradsson@outlook.com>

Interface Kit: Fix some hard-coded colors.

* Fix hardcoded black color in SeparatorView that caused invisible or
hard to read labels if you had a dark panel color. E.g MediaPrefs
* DrawBorder in HaikuControl didn't care about dark mode. Added check
for light/dark and changed the Tinting accordingly. We should probably
do the same for FancyBorder style as well.

Change-Id: I065211e56b0db5acd05ea287d6cacf75786f306f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1751
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

f146f74b 20-Aug-2019 X512 <danger_mail@list.ru>

Fix BMenuBar width

6967695c 24-Jul-2019 Adrien Destugues <pulkomandy@pulkomandy.tk>

PVS V547: always false comparisons

Change-Id: I1c7790ff0aa537b974bdc0fd65d76f277ea5f8cf
Reviewed-on: https://review.haiku-os.org/c/1647
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

1ec8732c 16-Jul-2019 Adrien Destugues <pulkomandy@pulkomandy.tk>

PVS V506: using pointer to deallocated stack space

Change-Id: I43f7d0208f7d644d6f4274a9a718773f7a1346a0
Reviewed-on: https://review.haiku-os.org/c/1600
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>

17c9e987 10-Jul-2019 Kacper Kasper <kacperkasper@gmail.com>

TextView: add shortcuts for wordwise delete

Change-Id: Ie67f6255c3f5d9d8ccc6699ed42dd71ae593fa16
Reviewed-on: https://review.haiku-os.org/c/1573
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

3ca2e85b 24-May-2019 Augustin Cavalier <waddlesplash@gmail.com>

Interface: Add casts to memcpy/memset invocations on BPoint & BRect.

Their copy constructors are exactly what GCC would generate,
but we can't remove them because doing so would make them
trivially copyable, and so they would be passed in registers
on x86_64, an ABI breakage.

So instead we have to add explicit casts to void* here.

632e7fd0 24-May-2019 Augustin Cavalier <waddlesplash@gmail.com>


629397f2 01-May-2019 François Revol <revol@free.fr>

Add basic support for loading ControlLook add-ons

app_server just passes the add-on path around.

Maybe we should make sure the add-on can be loaded when setting it.

Change-Id: I3acd3299782a22c1666bd5435dbf3d8053e359fa
Reviewed-on: https://review.haiku-os.org/c/1430
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

1b48852e 01-May-2019 François Revol <revol@free.fr>

Fix doxygen + whitespace

Change-Id: Ief0b2646e95841604a0396f15a054ff2086db198

f1fafe31 12-Apr-2019 Augustin Cavalier <waddlesplash@gmail.com>

kernel/OS.h: Include sys/types.h instead of pthread.h.

This avoids polluting the namespace significantly. Also adjust
all files which depended on this behavior to include pthread.h

d04d9b25 13-Mar-2019 Lee Mon <strongleemon@rambler.ru>

BugFix 2: fix errors found by cppcheck

Change-Id: I262af4dcf3ad1dca9d7e7d88838ae90323303c1d
Reviewed-on: https://review.haiku-os.org/c/1294
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

e89985cc 10-Feb-2019 Adrien Destugues <pulkomandy@pulkomandy.tk>

Fix drawing of B_GRAY1 bitmaps.

- Colors were reversed
- Padding was not handled properly because of a roundeing error

Add a test that shows the issue (behavior confirmed against BeOS)

Change-Id: I4c6e954fb6bdab92ad4e0e96897e78b26eb4727b
Reviewed-on: https://review.haiku-os.org/c/1025
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>

e5d0c909 01-Feb-2019 Augustin Cavalier <waddlesplash@gmail.com>

BView: Add a B_SCROLL_VIEW_AWARE flag.

* This indicates the view will manage whatever scrollbars are targeted
to it.
* Use _B_RESERVED7_ for this. It's been RESERVED since BeOS R5
(I guess it was probably something on some older BeOS version?)
and we don't really care about BeOS R4 ABI compatibility, so
that should be fine.
* Update BScrollView to not touch BScrollBar range/proportion
when the target view has this set.
* Update BListView to set this flag, always.

Fixes #14871.

Change-Id: I17027f3b63ef28da1e735c5393593496c415dce3
Reviewed-on: https://review.haiku-os.org/c/998
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

d27546c1 27-Jan-2019 Rob Gill <rrobgill@protonmail.com>

kits/interface Fix PVS902

* replace unformatted printf with puts

Change-Id: I06b5f436bf51423c60ddd3cc81d86217d06c78cd
Reviewed-on: https://review.haiku-os.org/c/961
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>

4854630d 27-Jan-2019 Augustin Cavalier <waddlesplash@gmail.com>

BScrollView: Resize scrollbars dynamically based on target's B_SUPPORTS_LAYOUT...

...instead of the BScrollView itself's layout flag. Thanks to Adrien and
Kacper for discussion on the mailing list.

5b0e5c0a 22-Jan-2019 Augustin Cavalier <waddlesplash@gmail.com>

BScrollView: Automatically update the scrollbar proportions in layout mode.

Since we know what size the target view is / wants to be, we can automatically
set the range, steps, and proportion trivially. In non-layout mode, we retain
the old behavior. Applications or views that need custom scrolling behavior almost
certainly will be using BScrollBars directly and not this, so this should not be
"wasted computation" in pretty much any case.

Greatly improves the appearance and UX of the default case of a layouted
view inside a BScrollView.

Change-Id: Ia6ff6ee14df96799c579e15d274fd4c849675577
Reviewed-on: https://review.haiku-os.org/c/892
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

5f603da0 17-Jul-2018 Adrien Destugues <pulkomandy@pulkomandy.tk>

Better shape for submenu arrow

Just use BControLook where appropriate. It already provides a nice arrow
drawing function (also used in DeskBar expander and in scrollbar

Fix second part of #8900

Changes by John Scipione:

Update menu mark and submenu arrow color with menu text color

Use text color for checkmark and submenu arrow colors, tint less black.
This means that colored bg/white text menu item will also draw a white
checkmark and submenu arrow.

Break out BMenuItem::Draw functionality into private methods _IsActive,
_LowColor() and _HighColor() methods and use them to set the mark colors.

Scale submenu arrow and checkmark with item height (which scales with
font size.)

does not align shortcuts with submenu arrows... but if you were to do
that you'd add item->Bounds().Height() / 2.

Signed-off-by: John Scipione <jscipione@gmail.com>

Change-Id: I8299094ef88bf227510b116eb1b84c261dc94723
Reviewed-on: https://review.haiku-os.org/c/341
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

0a973154 08-Jan-2019 Augustin Cavalier <waddlesplash@gmail.com>

BMenu: Look for ASCII characters < 128, not < 255.

Otherwise we will include ISO 8859-15 (é, à, etc.)
Thanks to PulkoMandy for pointing this out!

954a0a0c 02-Jan-2019 Stephan Aßmus <superstippi@gmx.de>

Fix some cases of updating draw state while recording a BPicture

* Also implemented recording DrawString(string, length,
BPoint[] locations), which was previously not recorded at all.
* Also implemented playing back recently added drawing commands
in PicturePlayer.cpp. I don't quite understand what this is
actually used for, but it seemed it was forgotten. I just followed
the pattern already established in the code.
* The other important bit in this change is to update the pen
location when it is needed while recording a BPicture. Often
the BView will use PenLocation() in order to transmit drawing
commands to the app_server which use absolute coordinates only.
This isn't actually so nice, since it means the client has to
wait for the server to transmit the current pen location. If there
were dedicated link-commands for pen-relative drawing commands,
the client could just keep sending without waiting for the server.
In any case, the app_server needs to update the pen location in
the current DrawState and even the DrawingEngine even while
recording a picture, because some next command may need up-2-date
state information, such as the font state and the pen location.
* I have not yet tried to find /all/ instances where the DrawState
needs to be updated while recording. This change should repair
/all/ font state changes, all versions of drawing a string, and
all versions of StrokeLine().

Change-Id: Ia0f23e7b1cd058f70f76a5849acb2d02e0f0da09
Reviewed-on: https://review.haiku-os.org/c/817
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>

52a022f2 21-Dec-2018 Augustin Cavalier <waddlesplash@gmail.com>

BMenu: Accept any alphanumeric ASCII character on the first trigger pass.

Since we use sentence-cased menus, there is probably only one capital
letter in the line, so looking for only capitals won't be very useful.
Instead, accept any ASCII character (< 255) which is alphanumeric,
as these are more likely to be command-able in any given keymap.

(IsAlNum returns true for accented Latin characters also, which may
be un-command-able if they require dead keys to type.)

588a0c9f 11-Dec-2018 Adrien Destugues <pulkomandy@pulkomandy.tk>

BMenu: Use BUnicodeChar for unicode char manipulation.

It is not allowed to use isspace, tolower, etc, on character outside of
the char type range (and EOF). Use BUnicodeChar instead to avoid out of
bound accesses.

Fixes the second crash in #14753.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Some changes by me to make "index" a byte instead of character index
as it needs to be.

1ac98e3a 20-Dec-2018 Augustin Cavalier <waddlesplash@gmail.com>

BWindow: Prevent CenterIn from moving the decorator bar offscreen.

The MoveTo() call is not restricted in any way; it can easily move the
window's titlebar offscreen, which is very confusing for users as if
they don't remember the window manipulation keyboard shortcuts,
dealing with such windows is often very tricky (or impossible
if the window is actually larger than the screen.)

Now we also call MoveOnScreen with DO_NOT_RESIZE and
MOVE_IF_PARTIALLY_OFFSCREEN set, which will simply get the size of
the decorator bar and then ensure it is entirely on-screen.

Fixes #11763.

4089701d 09-Dec-2018 Augustin Cavalier <waddlesplash@gmail.com>

interface: Remove some unreachable "break"s.

Spotted by Clang.

f0a1a07c 27-Nov-2018 Murai Takashi <tmurai01@gmail.com>

RegionSupport: Fix PVS 338-346

Fix 'true / false' value is implicitly cast to the integer type.

Change-Id: I2f72fcd34d2d97d20e2a98ed5efe25919a485c9d
Reviewed-on: https://review.haiku-os.org/739
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>

df4074fb 24-Nov-2018 Augustin Cavalier <waddlesplash@gmail.com>

Remove a lot of unused constants.

Spotted by Clang. No functional change intended.

a9002af9 18-Nov-2018 Murai Takashi <tmurai01@gmail.com>

UndoBuffer.cpp: Fix PVS 471

Fix 'fTypedText' is assigned values twice successively.

Change-Id: Ibadf2fced0f448441e541293d04b86bc14909c35
Reviewed-on: https://review.haiku-os.org/729
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>

62c7ec5c 23-Nov-2018 Augustin Cavalier <waddlesplash@gmail.com>

Fix various instances of -Wset-but-unused.

Largely no functional change; most of these are just
removing the unused variables.

a4ba4323 17-Nov-2018 Adrien Destugues <pulkomandy@pulkomandy.tk>

Fix line counting in StringView.cpp

- if fText is an empty string, we would start searching past its end,
possibly leading to a crash (noticed this in HaikuDepot).
- if fText is NULL, BString would report a size of 0 lines, it makes
more sense to report a size of 1 line.

35a074e0 05-Nov-2018 Kacper Kasper <kacperkasper@gmail.com>

BStringView: fix #14680

efafab64 02-Nov-2018 Axel Dörfler <axeld@pinc-software.de>

Deskbar: Resizable tray

* Adds max width and height arguments to
* Old applications just stay with a 16x16 scaled icon, though.
* All used apps within the repository are converted to the new call
besides the input_server input method icon (that will need further
API changes in the input_server).

Change-Id: I29cc439396917be2c24135888459d31364997dff
Reviewed-on: https://review.haiku-os.org/656
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

5fd3bc6d 03-Nov-2018 Axel Dörfler <axeld@pinc-software.de>

BDeskbar: Moved constants to shared header

* Instead of duplicating them in different files.

800e6fe4 03-Nov-2018 Kacper Kasper <kacperkasper@gmail.com>

BStringView: add support for multiline strings

* Actually draw the string at the bottom of the frame.
* Unfortunately BStringList cannot be cached because there is no
space left in the class.
* Change SGI and PNG translators to use it in place of BTextView.

Change-Id: I07e12bf1a8dc956d18c9624604c7b63453ad15a2
Reviewed-on: https://review.haiku-os.org/620
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

78b0cfc7 30-Oct-2018 Alexander G. M. Smith <agmsmith@ncf.ca>

Remove debug printf from BListView.

Change-Id: Ic3f3359305e066c27bfb071cc18a455d6f1c179f
Reviewed-on: https://review.haiku-os.org/648
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

7deac319 17-Oct-2018 Augustin Cavalier <waddlesplash@gmail.com>

interface: Fix -Wuninitialized in RegionSupport.

Also trim trailing spaces...

5723e0b2 17-Oct-2018 Murai Takashi <tmurai01@gmail.com>

RegionSupport: Fix memory leak

In XXorRegion(), memory allocated in if statement might be leaked.
Pointed by Clang Static Analyzer.

Change-Id: I6b8b68bc5fea7b7c1fd354f05f03d3ebb0b11b62
Reviewed-on: https://review.haiku-os.org/633
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>

ebb4be2a 02-Oct-2018 Kacper Kasper <kacperkasper@gmail.com>

Make spinner buttons look consistent with other controls

Change-Id: Icb29772c91687f4c7e4795a726636cf588b83f16
Reviewed-on: https://review.haiku-os.org/610
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

aa39f874 12-Sep-2018 Janus <janus2@ymail.com>

BColumnListView: hscrollbar matches visible columns

* _VirtualWidth() ignores invisible columns
This makes the horizontal scrollbar match the width of the visible columns.
Also trigger an initial update of the scrollbars.
* Fixes #14480

Change-Id: I7d4b27a8fdca58c150ac47f9b948b127fb275fdf
Reviewed-on: https://review.haiku-os.org/543
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>

c3ac0a72 11-Sep-2018 Augustin Cavalier <waddlesplash@gmail.com>

BMenuItem: Remove ourselves from the super menu on destruct.

This fixes the (intermittently) crashing test added in the previous commit,
and should also fix #12024 and #14348.

Note that this is a slight behavioral departure from BeOS, though since
BeOS crashed when this was done previously, it shouldn't cause any
other problems.

Change-Id: I90b6132ff7741b8d6cb601375a9b11fc3ffacb40
Reviewed-on: https://review.haiku-os.org/541
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

81d0a0e0 11-Sep-2018 David Murphy <murphman@gmail.com>

BColumnListView: Always update the reference rect in ::FindVisibleRect...

...if the row is present in the list, but continue to return false if the
row is not currently visible on the screen.

Part of #11675. Cherry-picked from https://review.haiku-os.org/442.

57067377 10-Sep-2018 JackBurton79 <stefano.ceccherini@gmail.com>

PictureDataWriter: Fix invert rect.
Resetting the drawing mode to B_OP_COPY was not right, since the previous mode could be anything.
Use WritePush/PopState() instead.

Change-Id: If9cba2c46bf372fd0164d951fcc49696cf72d576

466b81b6 16-Aug-2018 John Scipione <jscipione@gmail.com>

Window: Max-Zoom windows with Shift+Ctrl+Alt+Z

Since hrev52136 holding Shift while clicking the zoom button will
ignore the Deskbar and resize the window to take whole screen area
(the original behavior).
It'd be nice if the keyboard shortcut for zooming - Ctrl+Alt+Z
recognized an additionally held Shift in the same way.

Add shortcut to window.

Fixes #14365

Change-Id: I919ff2c3e8c41e022f8c675ea631daf18ff41eb3
Reviewed-on: https://review.haiku-os.org/470
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

fd25b902 14-Aug-2018 Augustin Cavalier <waddlesplash@gmail.com>

BControlLook: Add FBC padding.

Fixes #14295.

0e44a703 14-Aug-2018 Augustin Cavalier <waddlesplash@gmail.com>

BTabView: Don't assume BControlLook is in BPrivate.

Eventually it won't be, and we have a "using" directive so it is
accessible from the global namespace, so we can make this change

2f3e1117 13-Jan-2018 Sean Healy <jalopeura@users.noreply.github.com>

BOutlineListView::EachItemUnder gets too many items

EachItemUnder selects items that are not in fact under the superitem
passed to the method.

ticket: #13730
Change-Id: I12a2e29204e1b9bbecd5704e60a02e3613a7f4fd
Reviewed-on: https://review.haiku-os.org/52
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

fb7812fa 23-Jul-2018 John Scipione <jscipione@gmail.com>

BWindow: default Zoom() maximizes window when shift held down

In hrev51623 the default BWindow::Zoom() method was changed to respect
Deskbar, that is to say that the Window will zoom to screen area minus
the area taken up by Deskbar.

Some have complained that they miss the old maximize to full screen
frame behavior. This commit updates the default BWindow::Zoom() method
so that pressing Shift+zoom will maximize the window ignoring Deskbar,
the window will resize itself to take up the entire screen frame.

Note that if you override Zoom() in your app window then shift+zoom
will no longer work, this trick only works for apps which use the
default BWindow::Zoom() method.

Change-Id: Ic9f8fcb54f58663663db737103f6a7b42171ef46

fe66a314 22-Jul-2018 waddlesplash <waddlesplash@gmail.com>

Revert "BScrollBar: Add lines and dots knob styles to scroll bar"

This reverts commit ec1b18c58ae632444200f7e1f952ddd2e31048fa.

This was not well enough reviewed, and it seems that at least some
consumers of the old API (e.g. WebPositive) need more than the new one provides.

Change-Id: Ie7ad1fc70dab889922424298661504b00f66d31d

d8d6c655 19-Jul-2018 David Murphy <murphman@gmail.com>

BListView: Restore selection to MouseDown and fix multi-select drag'n'drop

* Moves list item selection logic back to MouseDown from MouseUp to improve
application compatibility and responsiveness
* Fixes multi-select drag and drop by not modifying the existing
selection if a MouseDown event is on a selected item.

Fixes #9190, #14264, #14289
Change-Id: I58050b403dac985f98e03faa72de1ebc5d24f95b

3c42c902 18-Jul-2018 Augustin Cavalier <waddlesplash@gmail.com>

Revert changes to BTextInput's text-rect calculation.

This reverts commit 11dee0444f911abba5555d3be056fb64f1f5eea4.
This reverts commit 1641a0516d9e8228a0189a83a688532d6554d271.
This reverts commit 484f64f315680eae5dcf5ad8b74325c3debc6da9.

These changes break various edge-cases in BTextInput (e.g. typing off the end
of a long string, using the arrow keys to navigate while out-of-bounds),
and nobody has found any fixes for them in the nearly-a-year since they've
been instanted, so they are now being reverted.

Reopens #12608, #13796.

9ece4920 17-Jul-2018 David Murphy <murphman@gmail.com>

BMenu: BMenuBar submenus at screen edge moved onscreen instead of scrolling

Fixes #9093
Change-Id: I1322c0cd8ba4bbfddace037ed8a8ef666ebe7fe3

e3f7fe94 16-Jul-2018 David Murphy <murphman@gmail.com>

BMenu: Submenu opening direction follows parent opening direction

Fixes #4859
Change-Id: I8e89afc3ad982d899428e3038fed354a78d04981

ec1b18c5 14-Jul-2018 John Scipione <jscipione@gmail.com>

BScrollBar: Add lines and dots knob styles to scroll bar

Fixes #9137

Move scroll bar drawing into HaikuControlLook

Added B_SCROLLABLE flag to BControlLook

Update FakeScrollBar in Appearance to also draw using HaikuControlLook.

Focus works on scroll bars again, used by FakeScrollBar... and probably
nowhere else.

Added private _ScrollingEnabled() convenience method to BScrollBar and
use it in a few places making.

Create ScrollBarPrivate.h header to share a couple of scroll bar related
enums with HaikuControlLook that come from BeOS Scroll Bar prefs.

Stuff arrow_direction enum into BScrollBar::Private as it has been
succeeded by a similar enum already present in BControlLook and is only
around now for BScrollBar::Private::DrawScrollBarButton.

Change-Id: Idc31ee41de091ba45ded2f0315a004af00143803

70f1070b 15-Jul-2018 Janus <janus2@ymail.com>

BColumnListView: BSizeColumn sort with big files works as expected

- Use off_t to compute the difference
- Fixes #14279

Change-Id: I253f16bb75501904ff59ac603a4680c66cfec33f

e4433ad0 07-Jul-2018 David Murphy <murphman@gmail.com>

BMenu: Fix crash and keyboard navigation on 'recent items' menus

* Prevents crash mentioned in Trac, but also enables keyboard navigation
to 'recent items' menus such as "Open files..." in MediaPlayer and DiskProbe
* Check selected menu and submenu exist in menu tracking thread before accessing
* Update BMenu::AttachedToWindow to pass in keydown param to _AddDynamicItems

Fixes #9251
Change-Id: I3031b8e9c1b9dd4ef1187c5a6b8ab7925e3496d2

e2d19ae5 04-Jul-2018 John Scipione <jscipione@gmail.com>

BListView: do not modify selection on MouseUp if drag & drop

bug seems to have been introduced only recently in hrev52062

f5face41 02-Jul-2018 David Murphy <murphman@gmail.com>

BListView: Fix drag n' drop in multi-select mode

Move list selection logic into MouseUp instead of MouseDown
Change-Id: I4e7c7f6636dabce130578777b5e1203d6695499a
Fixes #9190

582afd9a 21-Jun-2018 Augustin Cavalier <waddlesplash@gmail.com>

interface & app_server: Fix missing parentheses near ternary operators.

+ has greater operator precendence than ?, so we need parentheses when
using both in expressions. Both of these look like actual bugs.

Spotted by Clang.

356fc3bf 09-May-2018 Jérôme Duval <jerome.duval@gmail.com>

BWindow: fix debug build.

ad33fd78 08-May-2018 Adrien Destugues <pulkomandy@pulkomandy.tk>

BAffineTransform: de-virtualize some calls in flattening code

The Flatten and Unflatten method should check the size according to the
matching FlattenedSize method, not a possibly overriden version.

May also fix #14128 since we avoid use of the vtable by doing this.

630e3f14 11-Mar-2018 Jérôme Duval <jerome.duval@gmail.com>

View: move BAffineTransform out of ViewSetStateInfo.

the size of BAffineTransform is architecture dependent, so we transmit
its contents in a standard array instead.

Change-Id: I907110742168846a869a48bb2d116cc5292ec7d0

e3becd53 23-Apr-2018 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Ternary operator proper precedence.

Going through PVS Studio blogs on Haiku.

7cf48d4e 13-Feb-2018 hy che <cvghy116@gmail.com>

TextView: Remove redundant check in ScrollToOffset as PointAt() already does the check.

Change-Id: I2bf541fca84ef27749484ee1be05fb9debac32e2

d87eecee 05-Mar-2018 Humdinger <humdingerb@gmail.com>

Layout changes to AboutWindow

Most icons don't look that nice when blown up to 128px:

Before: https://lut.im/KNZw0f8j5r/3lnnRzzFXJSewq9Y.png
With this change: https://lut.im/3XcXJZv6ad/LsYKadFOiIJo1Kbz.png

* Use a 64px icon
* Make the window resizable
* Make the window a bit wider

Thanks Janus for hints where to insert SetExplicitMaxSize()...

4824497d 27-Nov-2017 John Scipione <jscipione@gmail.com>

BDeskbar: Set auto hide default value to false

Didn't notice this before so had to do a quick fix. Catch it before
Coverity can.

fd236f33 26-Nov-2017 John Scipione <jscipione@gmail.com>

BWindow: Update Zoom() with Deskbar window flags

Call newly created BDeskbar methods to adjust default Zoom().

if auto-hide is turned on don't consider Deskbar's frame.

In vertical mode allow windows to zoom on top of Deskbar if
auto-raise or always on top is turned on.

Deskbar can take up a significant area so you can reclaim that
space by turning on auto-raise or always on top.

In horizontal mode ignore auto-raise and always on top settings,
don't allow windows to zoom on top of Deskbar even if these
settings are turned on.

Deskbar doesn't take up very much space and you don't want your
window to get cut-off at the bottom.

fc23c097 26-Nov-2017 John Scipione <jscipione@gmail.com>

BDeskbar & Deskbar: export window bool settings to BDeskbar

Add methods to get and set "Always on top", "Auto raise", and "auto hide"
which are all booleans which control aspects of the Deskbar window to

Set the bool to the default value initially. Check if sending the
message succeeds, if so check the reply which also fills out the bool.
Don't check to see if reply succeeded because the bool will only be
overwritten if it did.

Follow the BDeskbar convention Is...() for getter, Set...() for setter
e.g IsAlwaysOnTop() is the getter, SetAlwaysOnTop() is the setter.

Define new message constants to call the newly created methods.
Follow BDeskbar convention: 'gtla' is used for getter, 'stla' for setter.
g/s for getter/setter, tla is an all-lowercase code unique to each
getter/setter pair.

Copy/paste these message constants into BarApp.h unchanged. Replace four
letter codes with imported message constants in BarApp.cpp and
BarWindow.cpp. Much nicer than using bare codes.

The new BDeskbar methods are all handled by TBarApp. The getters send
back a reply message containing the bool while the setters fall through
to existing setter cases.

f8811591 26-Nov-2017 John Scipione <jscipione@gmail.com>

BDeskbar: Style fixes

Update Copyright in cpp, add myself, alphabetize, standardize
Pointer style in cpp
Update some comments
Some 80 char stuff
pragma section headers

b1b84675 25-Oct-2017 John Scipione <jscipione@gmail.com>

BWindow: Update default Zoom() to respect Deskbar

Zoom() takes up all Desktop area excluding the area
occupied by Deskbar. This is calculated using information
from the BDeskbar class.

Window zooms just as you'd expect -- it takes up fullscreen
minus area taken up by Deskbar. In vertical mode the zoom
area depends on the width of Deskbar, consequently Zoom()
is more space efficient in horizontal mode than vertical
mode because the window doesn't use the area below Deskbar.

If the zoom limits are smaller than the Desktop area, the
zoom area shrinks towards the center of the Desktop not
covered by Deskbar. This is slightly different behavior,
the window insets off-center following Deskbar.

In some scenarios zooming to the non-Deskbar area was too
restrictive. I made an exception that if there is enough
room above or below Deskbar i.e. a short window, then Zoom()
instead insets from the screen edge ignoring Deskbar. Apps
which meet this criteria include DriveSetup and Expander.

2a493ea0 23-Nov-2017 Julian Harnath <julian.harnath@rwth-aachen.de>

BView: set initial frame rect invalid when using layouting

* When a view is used with the layout system, its initial frame rect
was set to (0, 0, 0, 0), which is a BRect covering 1 pixel in the
top left corner of the window.
Since this a valid rect, it can cause "badly behaved" views to
trigger redraws of themselves and other views during the layout
process, which is ultimately the reason for the HaikuDepot UI
freezing while populating with packages.

The misbehaving view in this case is BTextView. When in read-only
mode, since commit e27a53b2, its GetHeightForWidth() implementation
causes the view to resize (really resizing, not just simulating a
resize) and thus it invalidates itself. This is broken behaviour,
and needs to be fixed in BTextView. Since GetHeightForWidth() is
called during the layout process, all the not-yet-layouted views
have a frame of (0, 0, 0, 0). The invalidation of just the one
BTextView in the layout then hits *all* new views that are being
layouted (because they all occupy the same one pixel in the
corner), and they all get redrawn.
Many view Draw() implementations ignore the update rect, so work
is being done. And even if not, this can cause a lot of traffic
on the app_server link. In a test case with HaikuDepot's
FeaturedPackagesView, adding 300 rows (each containing a BTextView,
among other views) in quick succession caused over 6 million
commands to travel over the app_server link, completely freezing
the UI for a long time.

* The actual problem here is in BTextView::GetHeightForWidth() and
must be fixed there.
However we also put in an extra-fix here because it never makes
sense anyway to try and draw a view that has not yet been layouted.
So we set the initial BView frame to an invalid rect
(0, 0, -1, -1), which will suppress any actual updating, even
when the view actively invalidates itself, as long it doesn't
have a size yet. (The dirty region will always end up empty

* Fixes HaikuDepot UI freezing during package population (caused by
above described behaviour from BTextViews in FeaturedPackagesView).
Might improve performance in other applications using BTextView
with layouting as well.

484f64f3 23-Nov-2017 hyche <cvghy116@gmail.com>

TextInput: Align the text when typing or removing.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Closes #13796.

1641a051 23-Nov-2017 hyche <cvghy116@gmail.com>

Fix aligning when text growing more than the right bound..

because the bound scrolls to the current cursor to view the text (ScrollToOffset).
Follow up #12608

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>

11dee044 23-Nov-2017 hyche <cvghy116@gmail.com>

TextInput: Fix text width

Thanks PulkoMandy for teaching me how to use Debugger and part of the interface kit..
Fixes #12608

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

Thanks for investigating and finding the problem!

3a2b67b5 21-Nov-2017 Adrien Destugues <pulkomandy@pulkomandy.tk>

Support for configuring screen backlight

Accelerant interface:
Introduce new hooks B_SET_BRIGHTNESS and B_GET_BRIGHTNESS. Brightness is
a float in the 0..1 range.

Forward brightness things between BScreen and the accelerant.

Implement the hooks. Note that this only works for laptop panels, but
the driver will pretend to support it in other cases as well.

Screen preferences:
If the accelerant supports the B_GET_BRIGHTNESS hook, allow to set
brightness with a slider. Otherwise, the slidere is hidden and these
changes aren't visible.

aa19dd02 16-Nov-2017 John Scipione <jscipione@gmail.com>

BSpinner: Draw spinner buttons activated if mouse down

Fixes #13469

6a634757 16-Nov-2017 John Scipione <jscipione@gmail.com>

BSpinner: Draw spinner plus sign better

The plus was a bit too tall making it look odd.

16af9b4c 05-Nov-2017 Humdinger <humdingerb@gmail.com>

Style, no functional changes

Make termination consistant with that last commit hrev51521.
As wished and proof-read by waddlesplash. Hope all's well...

346d1496 05-Nov-2017 Humdinger <humdingerb@gmail.com>

Properly terminate property_info lists

BListView's property_info list lacked termination, resulting in
garbage output at the and of 'hey getsuites'.

Use { 0 } everywhere for sake of consistency.

Thanks to waddlesplash for spotting the bug an providing the easy fix.

7e42e5b5 18-Oct-2017 Sean Healy <jalopeura@users.noreply.github.com>

Do not force the keyboard focus if there wasn't one

Removing tabs tries to preserve the keyboard focus, but it should also
preserve the absence of it.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

d566b4d9 18-Oct-2017 Sean Healy <jalopeura@users.noreply.github.com>

Fix BWindow::_FindView when the window is hidden

_FindView finds a view that contains a specific BPoint (usually used to
dispatch a mouse event to it). It should ignore hidden views, but not if
they are hidden because of their parent.

In particular, if the whole window is hidden (for example, it is used to
draw onto a BBitmap), this should not be taken into account here.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

01ef8111 08-Oct-2017 Adrien Destugues <pulkomandy@pulkomandy.tk>

BChannelSlider: use native tooltips

BChannelSlider (used in media preferences) used to implement its own
tooltip, which didn't really work (as it could draw only inside the
view), and had hardcoded colors.

Use the native BToolTip which was added to Haiku since then.

db68ff23 10-Sep-2017 Augustin Cavalier <waddlesplash@gmail.com>

Interface Kit: Make BControlLook a proper pure-virtual base class.

All of its prior functionality has been moved into HaikuControlLook.
This paves the way for customizeable control looks, which I intend to implement
in the future as part of decorators.

This is being pushed now because libbe ABI was already broken due to the
Notifications changes, so this is riding that so we only have to do a mass
rebuild once.

bfbb9655 10-Sep-2017 Augustin Cavalier <waddlesplash@gmail.com>

Interface Kit: Remove more non-BControlLook code.

cf3524e0 26-Aug-2017 Kacper Kasper <kacperkasper@gmail.com>

Fix WebPositive drawing glitches.

* Introduced with recent BTabView changes.
* Adjust drawing tabs a bit.
* Remove trailing whitespace.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

a74f88cf 21-Aug-2017 Adrien Destugues <pulkomandy@pulkomandy.tk>

Build fix.

faef8633 21-Aug-2017 Adrien Destugues <pulkomandy@pulkomandy.tk>

BTabView: fix binary compatibility.

Re-introduce missing symbol so that old apps can still be used.

0d1bb791 20-Aug-2017 Adrien Destugues <pulkomandy@pulkomandy.tk>

BControlLook: remove broken intersection check

When using BAffineTransform, the update rect is not in the same
coordinate space as the drawing rectangle. Hence, testing them for
intersection does not work, and leads to not drawing buttons which are
in fact visible.

Moreover, the code in BControlLook does not perform only drawing, it is
also expected to update the drawing rect, so other functions may reuse
it later (for example, drawing a button border also computes the
rectangle for the button background). Because of this, it is not
possible to skip the drawing completely, or we could break the layout of
the client.

Fixes #13664

d47dec93 20-Aug-2017 Adrien Destugues <pulkomandy@pulkomandy.tk>

Make gcc2 happy.

cb13fce8 19-Aug-2017 Kacper Kasper <kacperkasper@gmail.com>

BTabView: implement drawing tabs on all sides.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

173e8195 19-Aug-2017 Kacper Kasper <kacperkasper@gmail.com>

BTabView: remove dead code.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

a34769a0 16-Aug-2017 Kacper Kasper <kacperkasper@gmail.com>

BTabView: cleanup draw function.

* Slightly changes how tabs look.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

b8d9fcbe 16-Aug-2017 Adrien Destugues <pulkomandy@pulkomandy.tk>

Revert "ControlLook: remove some bogus clipping"

This reverts commit b277177477148c83d79ba7f0b4737709f023f068.

b2771774 16-Aug-2017 Adrien Destugues <pulkomandy@pulkomandy.tk>

ControlLook: remove some bogus clipping

ConstrainClippingRegion was used in BControlLook to limit drawing to
inside the update rect. There are two problems with that:
- It would ignore any other clipping set by the application, as calls to
ConstrainClippingRegion are not cumulative,
- ConstrainClippingRegion ignores transforms on the view, so on a
transformed view, we would not draw anything in most cases.

If constrained clipping is needed here, it should be achieved using
ClipToPicture instead.

abb297f5 12-Jun-2017 Wiktor <vikkindhart@gmail.com>

InterfaceKit: fixed BSpinner's label rendering.

A '&' (reference) was missing on a specific line, causing
font information to never be updated. Also removed extra padding
dependent on a constant variable - if it is used, the label will
be render too far down.
Fixes #12981.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

d9823ef5 31-Jul-2017 Jérôme Duval <jerome.duval@gmail.com>

PrintJob: make struct print_file_header packed.

* also struct _page_header_: on x86_64, these would align to 8 bytes, which the code
doesn't handle well.
* remove beos leftovers.

13dbf471 24-Jul-2017 Jérôme Duval <jerome.duval@gmail.com>

Revert "BView: use off_t instead of long."

This reverts commit ab3a87ed6e5925dd8f9de119dbf689b6ac8afee5.

ab3a87ed 21-Jul-2017 Jérôme Duval <jerome.duval@gmail.com>

BView: use off_t instead of long.

2aaee070 18-Jul-2017 Kacper Kasper <kacperkasper@gmail.com>

Fix window behavior if default button is present.

* Almost all Enter keystrokes were hijacked without the ability to
* Let apps use these shortcuts.

Signed-off-by: Axel Dörfler <axeld@pinc-software.de>

e683838e 19-May-2017 Sean Healy <jalopeura@users.noreply.github.com>

BTextView: Fix archiving after setting and unsetting disallowed characters.

If you disallow and then re-allow characters, so that the number of disallowed
chars returns to zero, BTextView::Archive will fail with "Invalid Argument".

Fixes #13520.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>

9b6b158b 10-Mar-2016 dsizzle <dcieslak@yahoo.com>

Implementation of BFont::Blocks

BFont::Blocks is now implemented in ServerFont, via a call through the
app_server. It uses fontconfig to iterate through a charset of a font
and stores the defined blocks in a bitmap.

A new API was added, BFont::IncludesBlock, that will allow for arbitrary
testing of a given Unicode block. Since nothing is cached, searching
through an entire charset for a series of Unicode blocks can be quite
slow. In a given block there may be only 1 or 2 characters actually
defined so every character within a block needs to be checked until one
is found, which in a degenerate case will mean the entire block is

Signed-off-by: Axel Dörfler <axeld@pinc-software.de>

34ac7f7a 08-Apr-2017 Adrien Destugues <pulkomandy@pulkomandy.tk>

BListView: manage horizontal scrollbar

BListView automatically sets the vertical scrollbar range already. Do
the same for the horizontal scrollbar.

Also fix BOutlineListView to compute the preferred size taking into
account the items outline levels (it needs a little more space).

This fixes the horizontal scrollbars in Locale preferences, second part
of #6747.

fe9ddedc 31-Mar-2017 Axel Dörfler <axeld@pinc-software.de>

BBox: Fixed broken fBounds position update.

* FrameMoved() is only for frame movements; only scrolling affects the
bounds position.
* Thanks stippi!

ff4dee1c 24-Mar-2017 Axel Dörfler <axeld@pinc-software.de>

BView/BBox: Fixed FrameResized() handling.

* BView incorrectly passed the current width and height to
FrameResized(), not the one from the message. Since there is such
a call for each size change, a Draw() might have been called for
each of those in return.
* This should also fix such problems in BMenuBar, as it used the size
from FrameResized() as it should have.
* BBox now correctly takes the update events into account, and no
longer ignores the size passed to FrameResized().
* This fixes bug #3037.

c7fabe22 29-Jan-2017 Kacper Kasper <kacperkasper@gmail.com>

ControlLook: Fix redraw issues introduced in hrev50893.

* I was pretty sure that I didn't change the logic, but turns out
I was wrong. Sorry about that.
* Adjusted copy-pasted comments.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

Fixes #13238.

2332ebfd 21-Jan-2017 Kacper Kasper <kacperkasper@gmail.com>

ControlLook: Add side parameter to tab drawing functions.

* This allows drawing tabs on any side of the view.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

88510bc0 21-Jan-2017 Kacper Kasper <kacperkasper@gmail.com>

ControlLook: Fix drawing of right bottom tab corner.`

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

26d41644 12-Jan-2017 John Scipione <jscipione@gmail.com>

AbstractSpinner: Make TextView resizable

Fixes #13168

5973288e 12-Jan-2017 John Scipione <jscipione@gmail.com>

BSpinner: Fix copy-pasta bug, min=>min, max=>max

fMinValue was getting set to INT32_MAX then set to INT32_MIN
fMaxValue was not getting set

now set fMinValue to INT32_MIN, fMaxValue to INT32_MAX

also in _InitObject()

3705d40c 12-Jan-2017 John Scipione <jscipione@gmail.com>

BSpinner: Set min value then max value

... reverse this to avoid confusion, you'll see why in next commit.

No functional change intended in this commit, functional change is in the
next commit.

e1304871 01-Jan-2017 John Scipione <jscipione@gmail.com>

Revert "BWindow: CenterOnScreen a bit above center"

This reverts commit a5be1832cc9f29a230e587c77793e624ec4fbd2a.

a5be1832 31-Dec-2016 John Scipione <jscipione@gmail.com>

BWindow: CenterOnScreen a bit above center
BWindow docs: Document changes to CenterOnScreen()


Will revert if not appreciated.

4ee47fe9 25-Dec-2016 Rene Gollent <rene@gollent.com>

BListView: Cleanup, no functional change.

- Rename _FontChanged() to _UpdateItems() to more accurately reflect its
purpose, as discussed on commits list. Adjust callers accordingly.

078b08e4 20-Dec-2016 Rene Gollent <rene@gollent.com>

BListView: Fix missing update for list items.

- According to the Be Book, one of BListItem::Update()'s responsibilities
is updating the item's internal height/width. However, while we were
providing such updates in the case of the item initially being added
to the view, or when the list view's font was changed, we were not doing
so on frame resize. This would lead to items having a stale width field
in such a circumstance, leading to possibly incorrect behavior in apps
relying on that field to be correct.

134ed614 26-Oct-2016 John Scipione <jscipione@gmail.com>

ListView: Fix off-by-1 bug introduced in hrev50574



Fixes #12990 more better

Thanks Humdinger for noticing this bug and reporting it.

3798bf90 22-Oct-2016 Augustin Cavalier <waddlesplash@gmail.com>

Use the kDesktopWindowLook/kDesktopWindowFeel constants from WindowPrivate.h...

... instead of redefining them, or including a private Tracker header to
get them.

6a42abb2 17-Oct-2016 Augustin Cavalier <waddlesplash@gmail.com>

BView: Add missing NULL checks to GetMouse().

Fixes #12821.

7687a6ef 29-Aug-2016 John Scipione <jscipione@gmail.com>

ListView: Don't change selection while dragging

This allows you to drag and drop list items more easily, but,
removes the ability to drag and drop color squares in Appearance from
one list item to another. Changing selected list items while dragging
was more of a helpful side-effect for Appearance but isless reasonable
default behavior.

Fixes #12990
Partially regression on #8618

2446f53b 18-Aug-2016 John Scipione <jscipione@gmail.com>

BListView: Impliment autoscroll

BeOS had a feature where you could click on a list and while holding
down the mouse button scroll through the list items selecting them
as you went. I implemented the same feature on Haiku.

Did the work in separate thread which makes sure that the mouse
is held down the whole time even if you leave the view.

Thanks Diver for bringing this feature to my attention.

a98f98b7 18-Aug-2016 John Scipione <jscipione@gmail.com>

BListView: check message not NULL, grab buttons and modifiers

ccd7f24f 18-Aug-2016 John Scipione <jscipione@gmail.com>

BListView: Initialize all fTrack params to default

dc6233fc 18-Aug-2016 John Scipione <jscipione@gmail.com>

BListView: Check index non-negative, not only not -1

e10ca8cd 18-Aug-2016 John Scipione <jscipione@gmail.com>

BListView: Use std::max() and std::min()

... in place of max_c() and min_c() respectively.

9dfd244e 18-Aug-2016 John Scipione <jscipione@gmail.com>

BListView: Style fixes

* Rename kDoubleClickTresh to kDoubleClickThreshold
and use floating point in rval
* Pointer (*) goes with type for property var
* Use {}'s for multi-line if conditional
* rename point to where (consistent with header and rest of IK)
* Explicitly compare with 0 for bitwise operator statements
* Rename InitiateDrag() params

bd4ea656 11-Jul-2016 John Scipione <jscipione@gmail.com>

BMenuItem: Style fixes

* explict NULL check
* explicit boolean comparison and pointer style fixes

81364c9d 18-Apr-2016 John Scipione <jscipione@gmail.com>

BColorMenuItem: add custom color menufield


* Make the color box a rectangle with proportions of golden ratio.
* Override GetContentSize() to make menu item area larger.
* Label should never truncate since I make sure there is enough room.
* Draw the label using BMenuItem parent class
* Carefully adjust the spacing so that there is an attractive amount of
padding between the checkmark and color box and the color box and label.

Add _AddMenu method to BMenuField that adds BColorMenuItem as its
base menu item. This shows the BColorMenuItem in the closed state.

Create BPrivate::MenuItemPrivate

Add a SetSubmenu() method to MenuItemPrivate that gives you
the ability to add a submenu after creating the object. This
method should be public

Skip disabled items

Color gets updated even if you select an item in a submenu

ca766a50 19-Apr-2016 John Scipione <jscipione@gmail.com>

BMenu: Offset the menu field's menu window left 8px

...so that the text when the menu is closed lines up with the text
when the menu is open.

The checkmark is draw to the left of left edge of the closed menufield.

e8d4db8e 19-Apr-2016 John Scipione <jscipione@gmail.com>

MenuPrivate: Add SetItemMargins() method

b75a2e9d 19-Apr-2016 John Scipione <jscipione@gmail.com>

BMenu: Add default padding to ctor

dcecaf60 19-Apr-2016 John Scipione <jscipione@gmail.com>

BMenu: Remove _ from protected method _DrawItems

61dfdec4 19-Apr-2016 John Scipione <jscipione@gmail.com>

BMenu and friends: style fixes

BMenuBar: style fix: msg => message

MenuPrivate: style fixes

MenuItem: 80 char limit style fix

MenuBar: tiny style fix

Menu: tiny style fix, indentation

Menu: Small refactor

Implement _SetIgnoreHidden() in header
Change on to ignoreHidden
Change on in _SetStickyMode to sticky

_BMCItem_: tiny whitespace style fix

Menu: style fixes, rename msgr => messenger

BMenu: style fix, pointer != NULL

BMenu::Archive rename ret to status

Also check pointer against NULL explicitly

BMenuItem style fixes: rename abbreviation, pointer style

04039d6f 19-Jul-2016 looncraz <looncraz@looncraz.net>

BStringView: Proper color inheritence.

Legacy applications setting colors manually on BStringView would prevent
the BStringView from inheriting theparent view color. Most legacy
applications that did this also set the view color manually, so this went
unnoticed except in Beezer's Preferences window.

This fix introduces another, minor, issue for legacy applications that do
the same thing - they will not receive the system default panel text color.
In most instances, you don't want that happening anyway, so it's not much of
an issue.

Fixes #12868.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>

7cdea13c 10-Jul-2016 looncraz <looncraz@looncraz.net>

BBox: Correct low color for drawing label.

Includes some simplification for existing code.

Fixes #12628, which was mostly exhibited in FilWip and a few other legacy
applications which used the default low color and a custom background color.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>

de9c53f8 12-Jul-2016 looncraz <looncraz@looncraz.net>

BButton: Revert to using B_CONTROL_TEXT_COLOR for text.

Fixes #12604.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
The switch to using HighColor() was made in the "Set*UIColor" commit,
but as some applications set it for some reason, it broke BeOS compatibility.

65d0cbfd 29-Apr-2016 John Scipione <jscipione@gmail.com>

BTabView: Draw bottom tab border in DrawTabs()

...instead of DrawBox().

Also use ceilf when calculating tab height to prevent non-integral height.

Fixes #12683

More Todo:

You have to understand way too much about how this class draws if you
want to have any hope of overriding one of its Draw... methods and have
it do what you expect.

e.g. The BeBook implies that the tabs are drawn first, then the box, but, we
draw them in the opposite order. Probably better this way but not intuitive.

There are a number of remaining questions:
1. Why don't we need to draw the bottom of tabs if B_FANCY_BORDER?
2. Why do we need to expand tab border horizontally if B_PLAIN_BORDER?
3. Why is the bottom border color (152, 152, 152) instead of (151, 151, 151)?

Add a bunch of TODOs for these questions and more.

There can be some unitiutive gaps between the box border and view
depending on if you choose B_FANCY_BORDER or B_PLAIN_BORDER.
You don't notice the gaps unless the view draws right on it's edge. Some
views, including in Devices and Media Prefs do this though. Media Prefs
further complicates matters by overriding BTabView.

76b2ce77 12-Mar-2016 John Scipione <jscipione@gmail.com>

BTabView: Remove borderOffset, no longer useful

1eb05790 29-Apr-2016 John Scipione <jscipione@gmail.com>

BTabView: Don't use std, just call std::nothrow

24cb14bc 10-Mar-2016 John Scipione <jscipione@gmail.com>

BTabView: Style fixes

Fix misleading indentation

remove extra newline

just a newline

selTabRect => selectedTabRect

3490eda8 29-Apr-2016 John Scipione <jscipione@gmail.com>

ControlLook: Rename border param to borderStyle

border vs. borders is confusing.

BTabView: Rename border param to borderStyle

BTabView docs: rename border param to borderStyle

enumerate border styles in docs

a204259b 25-Mar-2016 Rene Gollent <rene@gollent.com>

BShape: Fix issues for debug build.

As part of the refactoring that was done for app_server layer support,
the private shape_data struct was updated to derive from BReferenceable.
However, BShape's destructor was never updated to reflect this, and
consequently attempts to use a debug build of libbe would consistently
throw the user into the debugger due to BReferenceable's sanity check
against non-zero deletes that weren't on the stack.

It should be noted though that there are probably a few things that could
be factored out and/or simplified with that class in general, since e.g.
when copying its data from another shape_data instance, it uses C++ array
allocations, while when being manipulated by BShape directly, the latter
uses alloc/realloc/free.

6a8276c4 22-Mar-2016 John Scipione <jscipione@gmail.com>

BSlider: Remove non be_control_look drawing code

8e7b383a 22-Mar-2016 John Scipione <jscipione@gmail.com>

Slider: Replace min_c and max_c with std::min and std::max

8be1a5f0 22-Mar-2016 John Scipione <jscipione@gmail.com>

Slider: Style fixes

Pointer style
Compare against NULL or 0 explicitly
use single floating point precision for float literals (i.e. use 0.0f)

8b902d94 22-Mar-2016 John Scipione <jscipione@gmail.com>

IK: Use panel text color for select control labels

NOTE: This should have no effect on the colors of these labels unless
you have changed the panel text color and control text colors to be
different. Both are black by default.

In the case of the menu field, spinner, check box, radio button,
slider, and text control labels we want to draw these labels using
the panel text color instead of the control text color because they
are drawn on top of the panel color. (the menu field label color was
changed in a previous commit in this push).

In all cases except the menu field the label color is specified by
temporarily unsetting the B_IS_CONTROL flag while drawing the label.
All use control look to draw the label.

The control text color is meant to be used for text INSIDE the control,
not the label text that accompanies the control -- at least that's the
way I understand it.

5b2aa7f8 22-Mar-2016 John Scipione <jscipione@gmail.com>

ControlLook: style changes only

indent fix (tiny)

59e1b2f4 22-Mar-2016 John Scipione <jscipione@gmail.com>

BMenuField: Change label to panel text color

...instead of menu item text color when the label is unselected.

Menu item text color seems to make sense when the control is unselected
because we use selected menu item text color when the control is
selected, but, this isn't the case. We color the label background using
the menu item color because we are reproducing similar behavior of
BeOS R5. However, when the menu field is unselected the label needs to
draw so that it goes on the panel bg color.

b0016556 17-Mar-2016 John Scipione <jscipione@gmail.com>

BWindow & WebPostive: Move TextView detection code

... from WebPositive to BWindow. This way every window will detect
Command+Arrows and send them to BTextView if a BTextView has focus
instead of just WebPositive.


This trick doesn't work in Vision though...

Fixes #9913

105a543e 17-Mar-2016 John Scipione <jscipione@gmail.com>

BWindow: Rename string to bytes

2ab6ca29 17-Mar-2016 John Scipione <jscipione@gmail.com>

BWindow: Style fixes

a99b9010 17-Mar-2016 John Scipione <jscipione@gmail.com>

BWindow: Reorder includes

53f75ce5 12-Mar-2016 John Scipione <jscipione@gmail.com>

BColorControl: Remove fOffscreenView pointer

...and rename fBitmap to fOffscreenBitmap to make it more clear what it is.

We don't need to save a pointer to both the offscreen bitmap and
the offscreen view, just the bitmap. We can access the view by calling
fOffscreenBitmap->ChildAt((int32)0). This gives us back a _reserved private
variable slot.

In the (unlikely) case that _InitData() is called with offscreen = false but
the fOffscreenBitmap is not NULL, delete fOffscreenBitmap before
setting it to NULL so that memory is not leaked.

76b9d53b 08-Mar-2016 John Scipione <jscipione@gmail.com>

BColorControl: Rebuild control after mode switch

App Server sends each window a message that the screen has changed:
Propegate B_SCREEN_CHANGED message to all child views first

Tell BColorControl to read the B_SCREEN_CHANGED message and reinitialize itself.

* Only reinit if switching to or from B_CMAP8
* Initialize all pointers to NULL in constructor
* Don't destroy and rebuild offscreen view (and text views) on reinit
* Reinitialize offscreen view on reinit.

Fixes #8035

Also initialzing the pointers to NULL in constructor fixes #12673

0e3b3f92 12-Mar-2016 John Scipione <jscipione@gmail.com>

BColorControl: Awesome style fixes

8db20d05 12-Mar-2016 John Scipione <jscipione@gmail.com>

BColorControl: Standardize on useOffscreen

...instead of doubleBuffered for the flag that specifies whether or not to
draw using an offscreen buffer.

Also remove the (not currently used) text from the docs since the parameter
is being used.

27c801a1 10-Mar-2016 John Scipione <jscipione@gmail.com>

BTabView: Draw right border even if 1 tab

The right border is seen on active tabs giving them a bit of a shadow.

a0ea818b 10-Mar-2016 John Scipione <jscipione@gmail.com>

BTabView: Move first tab over by B_WINDOW_SPACING

BTabView::DrawTabs() got a makeover:
Draw the tab background across the whole view, then draw the tabs,
finally draw the rightmost tab's right border.

31c8f7b1 10-Mar-2016 John Scipione <jscipione@gmail.com>

BTabView: Style fixes

80bc632a 07-Mar-2016 Augustin Cavalier <waddlesplash@gmail.com>

BStatusBar: Restore the old blue-ish color from before the Set*Color changes.

214f8799 04-Mar-2016 Jérôme Duval <jerome.duval@gmail.com>

try to fix gcc5 build on buildbot.

* I'd only reproduce the kernel build failure locally, weird.

3e08f216 16-Jan-2016 looncraz <looncraz@looncraz.net>

MenuField Low Color (for frame)

BMenuField's frame is drawn from the LowColor() which is adopted from its
parent. However, we should be adopting the parent's view color for our low
color, otherwise we sometimes end up with a miscolored border (most often white).

This was not noticed earlier as most views have matching view and low colors.

Fixes ticket #12603

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>

f9fe8e12 24-Jan-2016 Adrien Destugues <pulkomandy@pulkomandy.tk>

Style fixes as suggested by Axel.

be1537b4 24-Jan-2016 Adrien Destugues <pulkomandy@pulkomandy.tk>

BBox: tolerate non-layouted child in layouted mode

While mixing layouted and non-layouted views is not supported, we are
doing it in some cases, including translator preferences (which uses
layout, but the views may come from a translator add-on which doesn't).

So, try to handle that case and at least avoid crashes by calling
MinSize/MaxSize and other unsupported layout code on views which won't
handle it.

Fixes #12610.

37f9a292 18-Jan-2016 looncraz <looncraz@looncraz.net>

Improve Default BButton Appearance

Change control border color to 172, 172, 172 and use for default button
indicator drawing.

People doing an in-place upgrade will need to modify the border color from
its previous default manually or by pressing "Default" in the Appearance
preflet. This is a one-time annoyance.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

Fixes: #12589

9909ce41 15-Jan-2016 looncraz <looncraz@looncraz.net>

BSlider - Don't Use Control Mark Color

This returns BSlider to its original appearance.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

Fixes #12578.

8028ede7 15-Jan-2016 Rene Gollent <rene@gollent.com>

Build: Add architecture rule for libshared.a.

- As suggested by Ingo, add libshared.a to the architecture name map.
This allows it to be linked by its short name like other frequently
used libraries.
- Adjust all Jamfiles referencing the lib accordingly.

7a3892f4 14-Jan-2016 Rene Gollent <rene@gollent.com>

BWindow: Fix keyboard handling bug.

- In the case of certain messages that are dispatched from the
app_server with multiple target tokens (i.e. due to an attached
view that has a mouse or keyboard event mask set), we need to
strip the focus flag from the message before passing it to the
non-focus views. Fixes a bug observed via Clipdinger where the
aforementioned circumstance would result in all keyboard shortcuts
being invoked multiple times.

56af4c7c 13-Jan-2016 Augustin Cavalier <waddlesplash@gmail.com>

BShelf: Use strcmp().

faf00c7f 10-Jan-2016 looncraz <looncraz@looncraz.net>

ControlLook - Desktop Labels

Enforce use of proper colors in DrawLabel() when on the desktop.

This repairs an issue where the text looks wrong in ActivityMonitor when it is a
desktop replicant and likely other unreported issues.

Fixes #12576.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>

d3fc049b 12-Jan-2016 Augustin Cavalier <waddlesplash@gmail.com>

BShelf: Use BString for comparing strings.

Recommended by Jessica on the Commits ML.

e2dfcf70 12-Jan-2016 Augustin Cavalier <waddlesplash@gmail.com>

BShelf: Fix crash in the case that view is NULL.

Also correct some formatting.
Fixes #12584.

d2d239f4 09-Jan-2016 looncraz <looncraz@looncraz.net>

Improve BButton Color Adaptability

View color now shows through, so we keep the view color in sync with the
parent to act as the button background color. The low color is used to
determine the button color. The high color is used to determine the
button label color.

The default low and high colors are the control background and text colors,
respectfully. To maintain the identical appearance as before, the default
control background color is tinted to match the default panel background
color. As the color has a gradient applied anyway, no one will notice a
difference while playing with custom control colors.

Fixes #12568.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>

f9f16ddb 09-Jan-2016 looncraz <looncraz@looncraz.net>

BAbstractSpinner Colors

Adopted parent colors for the text view - should not have done so.
Disabled colors were incorrect, so I also corrected those in this patch.

Fixes #12574.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>

ed749c62 09-Jan-2016 Jessica Hamilton <jessica.l.hamilton@gmail.com>

BView::AdoptViewColors: handle not yet attached to a Window.

As per API documentation, a BView caches the configured view
colours when not yet attached to the app_server via its
window. So check if we're attached to a window, and if we are,
then and only then do we attempt to lock/unlock our looper.

This fixes uses of AdoptViewColors and AdoptParentColors when
the view isn't yet attached to a window.

054c8166 09-Jan-2016 looncraz <looncraz@looncraz.net>

MediaPlayer PositionToolTip Color

Previously the layout would crush the default colors of BStringView preventing
BStringView from calling AdoptParentColors() on its own, so we must call it

In addition, the default tooltip view should fully adopt tooltip colors so
that any colors will default to the desired foreground color (which is the
same as the tooltip text color).

Fixes #12573.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>

c9bd4d84 06-Jan-2016 looncraz <looncraz@looncraz.net>

Interface Kit: Correct button colors.

What appeared to be multiple issues was just one issue: BButton was drawing the
control background color for its border, whereas the previous system drew the
control low color, which was the parent's view color.

Neither is correct, no border should be drawn at all.

This made it appear that the default button was larger than it was and also
made it appear that some apps had a "white" border around the buttons.

In addition, BButton can now use the default BControl color behavior and
BButton exclusively adopt either parental or system colors without worrying
about the case in which another view has set the button's view color manually.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>

1d114757 06-Jan-2016 Augustin Cavalier <waddlesplash@gmail.com>

BAboutWindow: Put the AboutView and StripeView into BPrivate.

To avoid name clashes. Possibly fixes the HaikuDepot crashes.

3199cff3 04-Jan-2016 Augustin Cavalier <waddlesplash@gmail.com>

kits/interface: Convert the new BCardView over as well.

a4f254fa 04-Jan-2016 Augustin Cavalier <waddlesplash@gmail.com>

Remove printf() definition added in previous commit.

7a96554c 09-Dec-2015 looncraz <looncraz@looncraz.net>

kits/interface: Convert to using Set*UIColor.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Patches 0003-0017 from looncraz, unmodified.

7f9368ca 09-Dec-2015 looncraz <looncraz@looncraz.net>

Set*UIColor, etc.

The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.

BView gains:

SetViewUIColor(color_which, float tint)
ViewUIColor(float* tint)

BWindow gains a simple helper method:

BMessage gains:

HasColor() * allegedly this API is deprecated, but I implemented it anyway

Previous private ColorTools methods are made public and moved into GraphicsDefs:

mix_color, blend_color, disable_color

These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.

In addition, four new colors are created:

These changes are documented in their proper user documentation files.

In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.

On the app_server side, the following has changed:

Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.

Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.

In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.

Decorator changes are live now, which required some reworking.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>

3c857341 31-Dec-2015 Augustin Cavalier <waddlesplash@gmail.com>

BTextView: Don't crash if the file supplied is zero-length.

Fixes #12551.

5f2db70f 26-Dec-2015 Markus Himmel <markus@himmel-villmar.de>

Interface Kit: Add BCardView

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>

04f969a5 21-Nov-2015 Axel Dörfler <axeld@pinc-software.de>

BWindow::MoveOnScreen(): Need to use inner frame for resize.

* This caused the window to grow each time.
* This was especially noticeable at applications that store their
size on quit, and restore it on start.
* This fixes bug #12456.

670cfb15 16-Nov-2015 Axel Dörfler <axeld@pinc-software.de>

BWindow: lock the looper in some new methods.

* This makes it more convenient to call them from someplace else, and
follows the design used in the rest of the implementation.

25dbf74b 10-Nov-2015 Julian Harnath <julian.harnath@rwth-aachen.de>

BView: add methods for affine translation/scaling/rotation

* BView::TranslateBy(), BView::ScaleBy() and BView::RotateBy()
allow to conveniently modify the current affine transformation.
This makes it unnecessary to first read the current transform,
modify it, and then set it again.
Uses the new Pre...() methods of BAffineTransform.

* Also, remove setting the transform "through" to the BView even
while recording a BPicture, as this now results in transforms
being applied more than once.

4bd6f322 09-Nov-2015 Julian Harnath <julian.harnath@rwth-aachen.de>

app_server/Interface Kit: add new clipping API

* Add new clipping API for rectangles (ClipToRect, ClipToInverseRect)
and shapes (ClipToShape, ClipToInverseShape)

* Works with affine transforms and automatically switches from fast
region-based clipping to alpha-mask based clipping as necessary.

* Always self-intersecting, i.e. no state push required to further
narrow down the clipping region. All of the 4 new methods can be
mixed in any order.

ab120936 09-Nov-2015 Julian Harnath <julian.harnath@rwth-aachen.de>

BShape: move bounding box method to shape_data

* Makes it easier to get the bounding box from inside app_server

08135223 09-Nov-2015 Julian Harnath <julian.harnath@rwth-aachen.de>

Affine transforms: add method to test for dilation

* Add IsDilation() to BAffineTransform and Transformable which check
whether the transform is a dilation, i.e. consists of only
translation and/or scaling

6109a208 10-Nov-2015 Julian Harnath <julian.harnath@rwth-aachen.de>

Merge branch 'app_server'


In addition, the following files were also adapted to master branch
BPicture changes during the merge:

949cf6ac 19-Apr-2015 Murai Takashi <tmurai01@gmail.com>

Fix GCC 5 build.

* Add -fgnu89-inline flag for libroot/posix/glibc
* Change __GNUC__ == 4 to __GNUC__ >= 4

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

Fixes #11990, most of the changes had already been done.

8a3ae7a4 14-Oct-2015 John Scipione <jscipione@gmail.com>

Restore the BMenuField label background

Highlighting was added in hrev45983, stopped working in hrev49614, specifically

Add comment to explain what is happening and hopefully deter this from being
removed again in the future.

Fixes #12359

31b0eb9f 14-Sep-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

BWindow::MoveOnScreen(), fix parentheses warning.

93244a65 14-Sep-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

BScrollView: _ComputeFrame(BRect,...) used incorrect insets.

Previously, the BRect would be expanded by the call to
InsetBy(), but the replacement _InsetBorders() forgot to
take this into account.

Fixes #12380.

b11399ff 14-Sep-2015 Axel Dörfler <axeld@pinc-software.de>

BAlert: fixed missing initialization of fAlertSem.

* Fixes bug #12372.

8e96ec34 14-Sep-2015 Axel Dörfler <axeld@pinc-software.de>

BWindow::MoveOnScreen() now has a flags field.

* You can now specify whether or not you want to resize the window,
and move it on screen, or center it.
* Removed PulseWindow::MoveOnScreen() method.

ac9ec47d 09-Sep-2015 Axel Dörfler <axeld@pinc-software.de>

BMenu: made left side padding font size relative.

* Also changed BMenuItem to make better use of that size.

14cc5b4c 09-Sep-2015 Axel Dörfler <axeld@pinc-software.de>

BMenuBar::SetBorders() added.

* This allows you to only draw some of the borders.

fd79684a 09-Sep-2015 Axel Dörfler <axeld@pinc-software.de>

BScrollView::SetBorders() added to disable borders.

* You can specify which borders will be drawn using the
BControlLook::B_TOP_BORDER, ... constants.
* Adapted Mail to no longer need the SetInsets() hack.

f7c2983e 08-Sep-2015 Axel Dörfler <axeld@pinc-software.de>

HaikuDepot: change window frame setting.

* Moved entirely into MainWindow.
* Moved duplicated code into separate methods.
* Resize the main window on larger screens by default, as we can make
use of the extra space.
* Use BWindow::MoveOnScreen() instead of make_sure_frame_is_on_screen()
as the former has more info. And is even smarter now as it can
optionally resize windows to fit on screen.
* Center window on screen by default (ie. when there are no settings).

ce27f961 05-Sep-2015 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implement ClipToPicture inside a BPicture. Not working yet.
BView::ClipToPicture doesn't work anymore, when nested inside a BPicture,
This happened when its implementation was moved server-side.

83dc74af 05-Sep-2015 Michael Lotz <mmlr@mlotz.ch>

BPicture: Fix archive constructor on 64 bit.

The int32 was cast to a ssize_t which has a different size on 64 bit,
therefore clobbering the stack.

Also remove the use of basic type references in arguments, which
probably was the reason for doing the above in the first place.

d64c7086 05-Sep-2015 Michael Lotz <mmlr@mlotz.ch>

Various whitespace cleanup only.

8b9ec556 05-Sep-2015 Michael Lotz <mmlr@mlotz.ch>

BPicture: Fix archive constructor.

The cleanup commit df48d3f9a839a18e16b3d7036935bef621b4fbb6 broke
constructing a BPicture from an archive due to an incomplete rename.
The passed in BMessage was used as the data buffer instead of the
extracted data field.

Fixes the application side crash of #12340. Seeing how long this was
broken without anyone noticing, the feature doesn't seem to be very

eec73693 05-Sep-2015 Michael Lotz <mmlr@mlotz.ch>

PicturePlayer: Rework to be more safe against corrupted data.

This introduces a more sane API (currently private) that allows for
safer and possibly more efficient implementations:

* It uses a struct of named and typed function pointers instead of just
a void pointer array. This adds type safety to the callbacks so the
compiler can figure out if things match up before subtle bugs get
* It provides bounds for all strings/buffers passed to the callbacks.
* It uses const references instead of implicitly copying arguments.
* It folds stroke_x/fill_x pairs into draw_x functions with a fill
argument to reduce the amount of functions needed.
* It uses unsigned values where negative values make no sense.

The old API has been implemented on top of the new one using adapter
functions. It makes copies of all data passed to the callbacks which
effectively keeps the picture data from being modified. This matches
with the R5 behaviour.

This also reimplements the buffer parsing to be safe against corrupted
data by validating that the types actually fit in the provided sizes
and buffers (using a templated reader).

Since this class is used from the app_server with user provided data,
making it more safe is important even though it comes with a slight
overhead (replicating R5 behaviour, i.e. crashing the app_server when
corrupted data is fed, doesn't seem very appropriate here).

d8919236 30-Aug-2015 Axel Dörfler <axeld@pinc-software.de>

BMenuField: use layout rect for the label.

* Instead of just laying it out as without the layout API.

e047b40a 25-Aug-2015 Axel Dörfler <axeld@pinc-software.de>

Interface Kit: use different spacing constants.

* While this breaks binary compatibility with earlier Haiku releases,
use values that are less likely to clash with actual use cases.
* Specifically, using a negative spacing is one way to get rid of the
border of BScrollViews, to put them into a window neatly.
* Also, BControlLook now uses a switch to resolve them.

ebf4cbe6 03-Sep-2015 Axel Dörfler <axeld@pinc-software.de>

Incredibly smart BWindow::MoveOnScreen() method added.

* Makes sure that the window is as complete as possible on screen.

71cc4d49 01-Sep-2015 Julian Harnath <julian.harnath@rwth-aachen.de>

Merge branch 'master' into app_server


8f3d6d19 29-Aug-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

Revert "BPrintJob: fixed crash."

This reverts commit 1805bbf29bceca563985ff377f2b153c46057c2b.

d7a9cbde 29-Aug-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

BAlert: don't center ourselves if we've already been positioned.

21c3286b 29-Aug-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

BAlert: make SetShortcut() work again.

In hrev49481, the call to AddCommonFilter was accidentally
removed, preventing SetShortcut() from working. The filter
has also been updated to enumerate all buttons, rather than
a maximum of the first three.

a84dc754 29-Aug-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

BAlert: move setting default button into AddButton().

This properly fixes the crash in #12271, introduced by

1805bbf2 29-Aug-2015 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BPrintJob: fixed crash.
Since hrev49481, BAlert sets its default button in Go(), and not in the
constructor. So DefaultButton() will return NULL if Go() hasn't been called
Moreover, BAlert now centers itself on screen in Go() and not in the costructor,
so move it away from screen after the Go() call.
Fixes #12271, although there should be a nicer way to implement this.

e2eb9b7b 29-Aug-2015 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed empty line

2f41383c 24-Aug-2015 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BBitmap: Archive the data also if "deep" is not set
Fixes #12326

25af167e 20-Jun-2015 John Scipione <jscipione@gmail.com>

Spinner: Tweak the spinner button colors

* Tint the button text 1.777f which yields #303030 for the text color
which produces a nice dark grey but-not-quite-black color. In testing
black text is too dark and B_DARKEN_4_TINT (1.555f) yields #606060
which is too light. #303030 is a compromise between the two.
* The button text gets darkened to black on mouse down and the button
background gets darkened to B_DARKEN_1_TINT on hover as before, but
the frame color is no longer affected --- the button frame tinted by
B_DARKEN_1_TINT always (yielding standard Haiku button frame color).

a0ba79fb 11-Mar-2015 John Scipione <jscipione@gmail.com>

Split BSpinner into BAbstractSpinner and...

2 concrete classes which are currently implemented:
* BSpinner (works on int32s)
* BDecimalSpinner (works on doubles)

In addition BAbstractSpinner now inherits from BControl instead of
BView/BInvoker. This allowed for code simplification at the cost of needing to
cast for the decimal version because SetValue(int32 value) comes from BControl.

Also, add a spinner_button_style enum with 3 options:

which sets the spinner arrows to either use horizontal arrows (left/right)
vertical arrows, (up/down), or +/- symbols (the default).

If the spinner button is using horizontal arrows you can decrement and increment
the spinner value by pushing control+left/right, otherwise you can increment and
decrement by pushing up or down. The reason for needing control is so that you
can move the cursor in the textbox otherwise.

Switch the 3 apps that are currently using BSpinners to use the integer variety
in Deskbar preferences, WebPostive preferences, and Screen preferences.

d1229383 10-Mar-2015 John Scipione <jscipione@gmail.com>

Spinner: Generalize actions into methods

Add an Increment(), Decrement(), and SetValueFromText() method.

These can be overridden by derived classes.

a9385e8e 10-Mar-2015 John Scipione <jscipione@gmail.com>

Spinner: Move ValueChanged up

... along with the other hook methods

e4df9afe 09-Mar-2015 John Scipione <jscipione@gmail.com>

Spinner: Use plus/minus instead of arrows

Eliminate the border between the buttons

963d585e 09-Mar-2015 John Scipione <jscipione@gmail.com>

Spinner: Improve look and feel

This arranges the buttons to the right of the text box horizontally and also
updates the background color and arrow cool to give feed back when moused over
the button, disabled, and pressed. Used be_control_look arrows to match arrows
used elsewhere (such as scrollbars).

The background darkens on mouse over if enabled, the arrow is drawn darker when
the mouse is down, and lighter if disabled.

adba4ce9 10-Mar-2014 John Scipione <jscipione@gmail.com>

Add BSpinner class based on GCI2013 work

103adddb 17-Aug-2015 Axel Dörfler <axeld@pinc-software.de>

BTextView: do not restrict max size in GetHeightForWidth().

2a58d543 15-Aug-2015 Julian Harnath <julian.harnath@rwth-aachen.de>

Merge branch 'master' into app_server

f2de125b 11-Aug-2015 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed code path for be_control_look == NULL.
Adjusted TODO comment.

fb4ea396 04-Aug-2015 Augustin Cavalier <waddlesplash@gmail.com>

BMenu: Check return value of LockLooper().

CIDs 602450-602452.

2ffa9f8e 03-Aug-2015 Augustin Cavalier <waddlesplash@gmail.com>

Revert "Revert "BTwoDimensionalLayout: Removed duplicated code.""

This reverts commit c2e9a9227ecadca3a4fdc7e7f7569fb9c7dc1391. I
misunderstood what Diver meant -- apparently whe he said "revert",
he meant the whole changeset, not this specific commit. So the culprit
is probably BTextView then.

e9c7257a 03-Aug-2015 Augustin Cavalier <waddlesplash@gmail.com>

BAlert: Use half-item spacing for layouts. Restores the old "compact" look.

Fixes #12273.

c2e9a922 03-Aug-2015 Augustin Cavalier <waddlesplash@gmail.com>

Revert "BTwoDimensionalLayout: Removed duplicated code."

This reverts commit fd3e3e7bfb6e31cced1a98fc6a24c45f2feeba93.
Apparently this code wasn't duplicated, as it caused all sorts of
problems in applications (e.g. Debugger was blank).

Fixes #12269.

70191174 01-Aug-2015 Stefano Ceccherini <stefano.ceccherini@gmail.com>

ChannelSlider: Remove original look.
The Thumb returned by BChannelSlider::ThumbFor() is currently ignored.

0b421b80 01-Aug-2015 Stefano Ceccherini <stefano.ceccherini@gmail.com>

ChannelControl: Implemented SetLimitLabelsFor().
Implemented without testing how it's done on BeOS.
Moreover, I have no idea if, when and where these labels should be drawn.

3333f968 30-Jul-2015 Rene Gollent <rene@gollent.com>

SplitLayout: Fix #12261.

- SetItemCollapsed()/IsItemCollapsed() didn't properly handle inverting
values when mapping between the collapsed flag and the layout item's
internal visibility flag, leading to them having the opposite semantics
from what their name would suggest.

7b0ff5c6 29-Jul-2015 Axel Dörfler <axeld@pinc-software.de>

BAlert: use layout API, allow any number of buttons.

* Added default constructor; you can now alter the complete behavior
via setters, and also add buttons afterwards.

e27a53b2 30-Jul-2015 Axel Dörfler <axeld@pinc-software.de>

BTextView: implemented height-for-width when read-only.

* This is not an ideal implementation, as it actually relayouts
the text view. IOW it's actually wrong, but it does seem to
work without any issues.

fd3e3e7b 30-Jul-2015 Axel Dörfler <axeld@pinc-software.de>

BTwoDimensionalLayout: Removed duplicated code.

* Probably some refactoring leftovers.

99b4affa 30-Jul-2015 Axel Dörfler <axeld@pinc-software.de>

Added BWindow::ResizeToPreferred().

* B_AUTO_UPDATE_SIZE_LIMITS only really makes sense for resizable
windows, and it only sets the minimum/maximum window size.
* ResizeToPreferred() resizes the window to its preferred size, and
also supports height-for-width layouts.

e716f487 29-Jul-2015 Stefano Ceccherini <stefano.ceccherini@gmail.com>

ChannelSlider: don't check be_control_look for NULL
Also if0 the code that draws the old/dano look so it's more clear that
it's not called intentionally.

9b780235 28-Jul-2015 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BChannelSlider: Fixed memory leak.
At least, I think so.
Check allocations in BChannelSlider::ThumbFor()-
Also updated copyright and e-mail address.

551438b9 25-Jul-2015 Julian Harnath <julian.harnath@rwth-aachen.de>

app_server: add new BView layers API

* Add new methods
BView::BeginLayer(uint8 opacity)

* All drawing between begin and end of a layer is redirected onto an
intermediate bitmap. When ending the layer, this bitmap is
composited onto the view with the opacity given when the layer was

* Layers can be nested arbitrarily and will be blended onto each
other in order. There can also be any arbitrary interleaving of
layer begin/end and drawing operations.

* Internally, drawing commands are redirected into a BPicture between
BeginLayer and EndLayer (but client code need not know or care
about this). Client code can also start/end other BPictures while
inside a layer.

* Uses the PictureBoundingBoxPlayer to determine the size of the
layer bitmap before allocating and drawing into it, so it does not
allocate more memory than necessary and -- more importantly -- it
will not alpha-composite more pixels than necessary.

* Drawing mode is always set to B_OP_ALPHA, blend mode to
(B_PIXEL_ALPHA, B_ALPHA_COMPOSITE) while inside layers. This is
necessary for (a) correct compositing output and (b) for
redirection of drawing into the intermediate bitmap, which uses the
renderer_region offset (in B_OP_COPY, the Painter does not use the
AGG renderer methods, it directly accesses the pixel data. This
would access out-of-bounds without the offset, so B_OP_COPY cannot
be allowed.)
To ensure these modes aren't changed, BView::SetDrawingMode()
and BView::SetBlendingMode() are ignored while inside a layer.

* The main motivation behind this new API is WebKit, which internally
expects such a layers functionality to be present. A performant and
reusable implementation of this functionality can only be done
server-side in app_server.

c34cbf28 08-Jul-2015 Julian Harnath <julian.harnath@rwth-aachen.de>

app_server: fix PicturePlayer dummy function table

* With the support for BAffineTransform, it needs to have 49 entries

239f8573 23-Jul-2015 Axel Dörfler <axeld@pinc-software.de>

libbe: ui_color() now works without UI connection.

* Since the app_server is a BApplication, too, now, Workspaces would
trigger this problem.
* Now it checks whether the shared memory is actually set, and only
uses it in this case. This will also fix using ui_color() in any
BServer without UI connection.

df459da6 15-Jul-2015 Rene Gollent <rene@gollent.com>

{Tree,Table}: Add cell rect accessor.

- Add helper method for getting the visible rect of a given field.
Refactor SuggestTextPosition to use it.

- Add wrapper to retrieve table cell rect using the aforementioned
BCLV helper.

fe47b32f 14-Jul-2015 Augustin Cavalier <waddlesplash@gmail.com>

TabView: Assume be_control_look is not NULL.

6fd25536 14-Jul-2015 Augustin Cavalier <waddlesplash@gmail.com>

TabView: Lots of style fixes.

c432a83b 14-Jul-2015 Augustin Cavalier <waddlesplash@gmail.com>

TabView: Add TabViewPrivate class, actually fix non-layout SetView.

Thanks to Axel and Stephan for reviewing!

ce7470f8 14-Jul-2015 Adrien Destugues <pulkomandy@gmail.com>

BTab: fix behavior with custom BTabView

* BTab should not assume too much about BTabView, because some apps (eg.
Terminal) completely override the structure of it.
* Use the given owner view in Select/Deselect, rather than trying to
guess from the fTabView.

Fixes tabs not showing in Terminal, mouse not working in Terminal, and
probably some other problems there as the view tree was not correct

6031dea0 13-Jul-2015 Augustin Cavalier <waddlesplash@gmail.com>

BTabView: Lots of fixes & cleanup.

* Address TODO about setting fSelected when nothing is done.
* Pass a pointer to the tab view to the BTab so that it can call Invalidate().
(Checked against BeOS).
* Call Invalidate() from the BTab after SetView() & SetName().

Fixes #12108 & #12196.

4cb7d0e7 30-Jun-2015 Philippe Saint-Pierre <stpere@gmail.com>

AboutWindow: Set initial font color in the TextView

50e2057d 27-Dec-2014 Puck Meerburg <puck@puckipedia.nl>

BGridLayout: fix reversal of parameters.

CID 1210907.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>

7c3d316b 14-Jun-2015 Adrien Destugues <pulkomandy@gmail.com>

Style fixes.

83a02adb 22-May-2015 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BButton: Fix hover status glitch
A BButton didn't lose its hover status when another window partially covered
it and the mouse cursor left its bounds rectangle.
Check for B_EXITED_VIEW in MouseMoved to fix the problem.
This fixes ticket #11962. Thanks to X512 for the analysis of the problem.

d54a4f43 03-May-2015 Janus <janus2@ymail.com>

BColumListView: uses system colors.

* Partialy fixes #10840.

8fceacff 03-May-2015 Janus <janus2@ymail.com>

InterfaceDef: Use a lighter grey for list selection.

* Use the BColumnListView grey for list selection.

487d015a 30-Apr-2015 Adrien Destugues <pulkomandy@gmail.com>

PVS43: two if with same condition in BBitmap::SetBits

63effa09 26-Apr-2015 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fix typo (missing pointer dereference).
Found by PVS-Studio developer Svyatoslav Razmyslov.
Also update my email address.

ebea950b 18-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

BLayout: Don't delete the layout of the view in RemoveView().

The layout item representing the layout of the view to be removed is
owned by the view and must not be deleted. The layout only owns the
item if a new layout item was created when adding the view, i.e. when
it did not have a layout.

Fixes the underlying issue that triggered #11976.

b598325a 14-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

BView: Move tooltip release and fix small coding style issues.

This is only an optical change.

e837ee8b 14-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

BView: Fix destruction order of layout items.

Because of the virtual hooks a BLayout must never be destroyed while it
still has layout items. If these items are only removed from the layout
in its destructor, the subclass version of hooks like ItemRemoved() are
not called anymore. This lead to leaks because many BLayout subclasses
use the ItemRemoved() hook to clean up associated data (as is suggested
explicitly in the BLayout documentation).

In the same line of thought, a BLayoutItem must never be deleted when it
is still attached to a layout, as it similarly has virtual hooks like
DetachedFromLayout() that can not be called at this point anymore.

The destructors of BLayout and BLayoutItem now have debugger calls in
case these conditions are not met which should help to avoid
accidentally introducing such hard to debug issues.

To ensure the correct destruction order the sequence is now:

* Destroy the child views first. This cleans up their layout items while
the layout tree is still intact.
* Unset the view layout before removing layout items so it can properly
detach from the layout instead of just deleting it.

0cc8c71b 14-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

BLayoutItem: Add RemoveSelf() convenience method.

It works analoguous to BView::RemoveSelf(), i.e. it removes itself from
the parent (layout in this case) and returns whether or not it had and
was successfully removed from said parent.

19bb9ef9 14-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

BView: Remove old TODO comment.

The BShelf is not owned by the BView (nor the BWindow for that matter)
and so must not be deleted on destruction.

32e627a7 14-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

BTwoDimensionalLayout: Fix leak of CompoundLayouter layout[er].

814393e6 14-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

BGridLayout: Fix leak of grid.

0fc30d89 09-Apr-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Deskbar: Sanitize the usage of BMessage

... especially for SendMessage and SendReply.
* Delete the item's message if AddItem does not return successfully.
* Fixes #11934.

Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>

e01de522 10-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

More whitespace cleanup all over the place.

e25776bd 07-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

Whitespace cleanup only.

85b350ed 05-Apr-2015 Janus <janus2@ymail.com>

BColumnListView: BRow height is proportional to font size.

* Add a BRow default constructor that use font size to compute height.
* Min height size for Title and Row are decoupled.
* The font ratio for Title and Row are decoupled.
* For small font use min height (set to usual 16.0).
* Better baseline formula.
* Fixes #11944.

5a7c64f9 04-Apr-2015 Janus <janus2@ymail.com>

BColumnListView: Avoid crash on column resize.

* Inizialize fSelectedColumn before calling ResizeSelectedColumn().
* Fixes #10439.

3fc2dd56 04-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

BView: Fix 64 bit build with debug output, whitespace cleanup.

46578389 04-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

BShelf: Unset the shelf of the containing view on destruction.

The BShelf sets itself as a handler on the containing view on creation
but didn't unset itself on destruction. When the containing view was
later destroyed it would unset the shelf which triggered a
use-after-free if you deleted the BShelf beforehand.

Since the ownership of a BShelf isn't explicitly documented I took the
shelf in DeskWindow of Tracker as a reference, which does delete it

06cdb655 16-Mar-2015 Axel Dörfler <axeld@pinc-software.de>

_BTextInput_: Only invalidate parent when in a window.

* Otherwise there is nothing to it.
* Removed comment and commented out invalidation. Seems to work
just fine without it, and I cannot think of a reason why it should
be there.

ccc3ced2 16-Mar-2015 Axel Dörfler <axeld@pinc-software.de>

_BTextInput_: style cleanup.

8bc3ecb0 16-Mar-2015 Axel Dörfler <axeld@pinc-software.de>

Added BTextControl::TextLength() method.

8359b407 13-Mar-2015 John Scipione <jscipione@gmail.com>

CheckBox: Center the check mark again

See 46b39e83 Changed rounding behavior for StrokeLine.

This effectively undoes the change in rounding behavior from that commit.

22af0f18 16-Mar-2015 John Scipione <jscipione@gmail.com>

RadioButton: Scale mark to font size

This way the amount of inset varies, small font get small inset,
large fonts get large inset.

c7756ee1 11-Mar-2015 John Scipione <jscipione@gmail.com>

ControlLook: Use std::max() instead of max_c()

It's a little silly to cast an integer literal to an int32 but the compiler

6905b4fa 11-Mar-2015 John Scipione <jscipione@gmail.com>

ControlLook: Style fixes

No {}'s for single line, compare against 0 explicitly

2c3505de 16-Mar-2015 John Scipione <jscipione@gmail.com>

PictureDataWriter: Style fixes only

No functional change intended

70adf6d5 16-Mar-2015 John Scipione <jscipione@gmail.com>

BRect: Style fixes, take out extra space.

For some reason there was an extra space here, has been since first import.

53253ac4 13-Mar-2015 Humdinger <humdingerb@gmail.com>

Sentence casing in context menus. Thanks Janus for noticing.

ec9d05b0 24-Feb-2015 John Scipione <jscipione@gmail.com>

ControlLook: Remove erroneous PopState() call.

This may have contributed to some drawing issues on the keymap app.

35384ab4 20-Feb-2015 John Scipione <jscipione@gmail.com>

MenuPrivate: Add a SetLayout() method to MenuPrivate

that allows you to set the menu_layout of the menu after construction.

794c227e 13-Feb-2015 Axel Dörfler <axeld@pinc-software.de>

BView: fixed RemoveSelf() layout item handling.

* When RemoveSelf() is called, we do not own our own layout items, so
we must not delete them.
* However, we do own them when we still have layout items left when
we get deleted ourselves.
* This fixes removing/adding a child view to a view without deleting
it inbetween (like the new Network preferences will do).
* Optimized item removal -- not a good idea to always remove item 0.

47205988 04-Feb-2015 John Scipione <jscipione@gmail.com>

Style fixes to StyleBuffer only

5fbf0afd 04-Feb-2015 Adrien Destugues <pulkomandy@gmail.com>

BTextView: add handling of B_FONT_FACE mask to SetFontAndColor

The B_FONT_FACE mask would be ignored, making it impossible to change
only the font face.

Thanks to samgtr for finding the bug!

ccc66661 12-Jun-2014 John Scipione <jscipione@gmail.com>

BWindow: remove workspace switching shortcuts

These are going to be activated by an input server filter instead.

75e162f7 11-Jun-2014 John Scipione <jscipione@gmail.com>

BWindow: style fixes

Update copyright header

95fdee0b 21-Jan-2015 Axel Dörfler <axeld@pinc-software.de>

BStringView: added truncation support.

* Added new truncation mode B_NO_TRUNCATION.
* The Truncation()/SetTruncation() methods itself are Dano-compatible,
however, there was no B_NO_TRUNCATION.

ce39d3a3 09-Jan-2015 Adrien Destugues <pulkomandy@gmail.com>

BTextView: use calloc to replace malloc+memset

Fixes #11721.

2ba93e7d 06-Jan-2015 Adrien Destugues <pulkomandy@gmail.com>

ColorControl: show the correct colors.

BColorControl was recently modified to preview the colors in the
sliders. However the computation was not correct and the colors shown
were not useful.

Fix the code so the correct colors are used. Since this can result in
the sliders having very bright colors, change the selection rings to use
black and white colors instead of just white, so they are always easily

65dfd2c6 19-Dec-2014 John Scipione <jscipione@gmail.com>

Documentation fixes for BTab and BTabView

f4664459 18-Dec-2014 John Scipione <jscipione@gmail.com>

Changes to BTextControl for docs.

Also remove the non-ControlLook drawing code.

c4793b24 17-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

fix adding or removing items to an open BMenu

The menu would try to relayout itself, but fail to get the supermenu
bounds as the looper for it was not locked in that case.

This fixes the crash with two downsides:
* The menu width isn't adjusted to match the parent menu (mostly visible
in BMenuFields)
* There is some flickering as the menu is updated

Fixes #9863 (Network prefs part).

4696958a 15-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

BBox: fix minimal size when using layouted mode.

It is possible to set a custom layout on a BBox, which is then applied
to the children excluding the label. However, the label size must still
be used when computing the minimal size of the BBox in that case.

3bcb6981 12-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

BOptionPopUp: call the superclass AttachedToWindow.

It's ther that the view background color is inherited from the parent.
Fix option popups having a white background eg. in MediaPlayer

Thanks to DeadYak for noticing the problem.

94d14479 11-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

ListView: computate disabled color only for disabled items.

265f2996 11-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

ListView: move the color setting code to DrawItem

... so it can also be used by OutlineListView.

Fixes #11598.

6f207787 10-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

ControlLook: fix DrawActiveTab with subpixel rectangle

Fixes #4078.

When font hinting is disabled, the width of a string may not be an
integer number of pixels. This results in the tab position also being
non-integer, and the drawing code doesn't handle this, resulting in part
of the tab being shifted 1px to the right.

Snap the rectangle to the pixel grid so the runding error doesn't

cbb8ebbb 10-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

Set item colors in BListView instead of BStringItem

* Fixes #3970 without introducing the bugs from BeOS
* Makes it easy to override BStringItem just to change the text color.
* Makes it easy to implement custom list items using the correct colors.

04f88428 10-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

Colorcontrol: show resulting colors in the slider

Instead of showing plain red, green and blue color ramps, show what
the color would be if you moved the sliders to each point.

This is what was done on Mac OS classic and is also used in some other
tools to help you targetting a particular color.

It also limits the need for a color preview, which BColorControl
currently doesn't include, forcing apps to implement one themselves.

Fixes #3790 (the patch there didn't apply anymore, so I redid the work.
Credits for the change should go to stpere).

4cec648e 04-Dec-2014 Laurent Chea <contact@laurentchea.com>

Fix alignment in TextControl widgets

* Fixes #8391

Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>

* This was visible for example in the "double click text area" in Mouse

5ae0cde3 04-Dec-2014 John Scipione <jscipione@gmail.com>

Style fixes to BStringView related to docs

555c1cbf 02-Dec-2014 John Scipione <jscipione@gmail.com>

ColumnListView: Remove pre-ControlLook drawing code

a9f45419 02-Dec-2014 John Scipione <jscipione@gmail.com>

ColumnListView: Add default case to switch

73b59622 02-Dec-2014 John Scipione <jscipione@gmail.com>

ColumnListView: preserve view high color

86ebf4c7 02-Dec-2014 John Scipione <jscipione@gmail.com>

ColumnListView: check for NULL column

539dc1bc 02-Dec-2014 John Scipione <jscipione@gmail.com>

A bunch of style fixes

No functional changes intended

fec56923 02-Dec-2014 Chirayu Desai <chirayudesai1@gmail.com>

ColumnListView: Fix two bugs reported by Coverity

* Fix Coverity bug 991147: Copy-paste error
* Fix Coverity bug 991264: Dereference after null check

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>

4ca1c247 02-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

Default decorator: localize about box.

3d06e082 27-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

BOptionPopUp: move mennu setup to AttachedToWindow

* There is no need to delay this to AllAttached
* Apps may want to override the SetDivider, and doing it as late as
AllAttached can be annoying.

Fixes #10734.

42272d23 26-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

OutlineListView: yet another list/fullList mismatch.

Fixes #5817.

31f5b8b5 25-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

BView::BeginLineArray: leave object in consistent state

We allow this method to throw bad_alloc exceptions as there is no other
way to report errors. However we left the object in a broken state
(maxCount set, but array not initialized) which would crash when calling
either AddLine or EndLineArray.

Initialize the count to 0 before throwing the exception so now
EndLineArray can be called and operations resumed safely after an
allocation failure.

c278afde 26-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

BOptionPopUp: build fix.

d47ada16 26-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

BOptionPopUp: don't offset when there is no label.

We add a 8 pixel space between the label and the menu, but we shouldn't
do that when the label is empty. This matches BMenuField behavior.

Fixes part of #10734.

2824c5d3 24-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

Fix various typos and inconsistencies in strings

DiskProbe, DriveSetup, Icon-O-Matic, Installer, Login,
PackageInstaller, Screenshot, Translation Inspector, BootManager,
CharacterMap, CodyCam, BPrintJob

DiskUsage: removed useless translation, used only for layouting purposes

Thanks to KapiX for spotting these problems.

8b27b730 23-Nov-2014 Rene Gollent <rene@gollent.com>

BCLV: Adjust arrow key behavior.

- Left/right arrow can now be used to collapse/expand the focus
row. Holding shift reverts to the previous behavior of scrolling
the view.

073da302 17-Nov-2014 Jérôme Duval <jerome.duval@gmail.com>

ColumnListView: deselect the last selected row

when the shift movement goes back. This behavior feels better to me,
but opinions are welcome. Tested with HaikuDepot package listview.
Noticed that CLV uses Ctrl whereas Tracker uses Alt for single item

0eb59784 18-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

BMenu: don't invalidate layout when changing marked item

* The layout does not need to change. The label may change in
SetLabelFromMarked mode, but this only affects the layout of the parent
* This would crash when programatically changing the menu marked item
while the menu is open.

c8b83b17 12-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

Make disabling BOptionPopUp actually work

* Patch by ttcoder
* Fixes #10735

b7aac5d2 12-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

Fix BDragger drawing when parent doesn't draw.

BDragger use some tricks to draw as a partially transparent view, it
calls the parent Draw method, then draws a partially transparent bitmap
over the resulting drawing.

This only works if the parent does somthing in the dragger area. In case
it doesn't, first fill the dragger with the parent view color, so there
is at least "something" in those pixels.

Fixes #5906.

1bf53ffc 12-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

Remove leftover printf and fix build.

bdb4ae32 12-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

Fix unarchiving of BScrollView with layout

* We archive views using "managed" archives, and the children are not
attached in the BView(BMessage*) constructor, but later. So it's not
possible to find the target and scrollbars in the constructor of
* Make BScrollView override AllUnarchived and find the target and
scrollbars again there. The code is slightly different as there is no
guarantee that the first child will be the target in that case. The
existing code in the constructor is preserved for non-managed archives.

4cada380 11-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

BDragger: add layout-aware constructor.

Somehow no one needed this yet.

e0f81db6 08-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

re-add the _BMCItem_ class for binary compatibility.

This was removed in hrev17147, because our implementation of BMenuItem
does not uses it anymore. However, we must keep it in order to properly
unarchive BMenuFields that were archived in BeOS.

One application that was crashing because of this is VNCViewer.

37456be7 06-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

Make use of the "invalid control" look flag

* Use a red border for BTextControl when the invalid flag is set.

6f9eb8d1 04-Oct-2014 Stephan Aßmus <superstippi@gmx.de>

HaikuDepot: Validate input before creating account

Provide error or info alert when fields are invalid, suggest
providing an email, but allow to ignore the warning.

5db8f48c 19-Sep-2014 Sidhant Sharma [:TigerKid001] <tigerkid001@gmail.com>

Change Success/Failure colors.

* Part of #10834
* Colors were picked from http://clrs.cc, which was suggested by John Scipione.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

13d147b1 30-Sep-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

Introduce "invalid" text controls.

* MarkAsInvalid is used to enable or disable the mark
* The B_INVALID BControlLook flag is used
* invalid BTextControls are drawn with a red border.
* You ar encouraged to let the user know more precisely what's wrong, by
showing an helpful error message next to the control or in a tooltip.

03598119 28-Sep-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

libcolumnlistview: hybrid arch build, add to image

* This is a very useful control, and 3rd-party apps should be able to
use it.
* But, there are planned improvements (making a better model/view
interface) which prevents making it part of the stable API yet.

76a607d2 19-Sep-2014 Humdinger <humdingerb@gmail.com>

BAboutWindow: use the standard "OK" instead of "Ok"

0bbed962 19-Sep-2014 Stefano Ceccherini <stefano.ceccherini@gmail.com>

TextGapBuffer: Style changes
Change long to int32
Removed useless parenthesis

0eb9b74e 19-Sep-2014 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BTextView: Fixed GetText().
Patch by Pete Goodeve which fixes a problem in TextGapBuffer::GetString()
used by BTextView::GetText(). Thanks! Fixes #8447.

6073b1d5 22-Jul-2014 John Scipione <jscipione@gmail.com>

Interface Kit: fix bad free, CID 611174

dc4ae0e9 24-Jul-2014 John Scipione <jscipione@gmail.com>

TextView: Fix regression for Home and End

... while Shift is held down in a selection.

Before this commit, if you had some text selected and you pressed
Home or End with a Shift held down the selection would not change.
This was annoying and most likely unintentional. Thank you Axel for
informing me of this problem.

After this commit if you have some text selected and you press Home
with a Shift key held down it will move the end of the selection to the
first character of the same line that the end of selection is on and if you
press End with a Shift key held down it will move the end of the selection
to the last character of the same line that the end of the selection is on.

I looked at how a bunch of different OS's and applications handled this
and found that there are a bunch of different behaviors we could use here,
and there doesn't appear to be any consensus as to what the "right" or
"wrong" way to do this is so please forgive me if this doesn't work exactly
as you expect it to.

Note that the implementation used here is very different from how BeOS
R5 worked. In BeOS R5 pressing Home or End with Shift held down
always extended the selection, it never subtracted from it.

In BeOS pressing Home with Shift held down extended the selection from
the left-most part of the selection to the first charcter of the same line.
Pressing End with Shift held down extended the selection from the
right-most part of the selection to the end of the same line.

1d1e61bb 23-Jul-2014 John Scipione <jscipione@gmail.com>

TextView: include re-arrange style fix

* Put #include TextView.h first as our style guide suggests.
* Put #include <new> in it's own C++ includes section
* also remove an extra newline

b55f61d6 23-Jul-2014 John Scipione <jscipione@gmail.com>

TextView: update comments

Private Method docs are/should be in doxygen format. Remove \brief as doxygen
doesn't need this if you document along side the method.

Remove brief description comments from public methods, you'll need to look in the
Haiku Book for this now.

style squash

62f70e6f 23-Dec-2013 Puck Meerburg <puck@puckipedia.nl>

Fix Coverity bug 1108392: Stray semicolon

Signed-off-by: Philippe Saint-Pierre <stpere@gmail.com>

db1ef05a 14-Jul-2014 John Scipione <jscipione@gmail.com>

BShape: Style fixes for docs

33d60fa2 19-Jun-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

BRegion: add ScaleBy(BSize) and user documentation.

669ac9d6 19-Jun-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

BRegion: add ScaleBy method.

* Is there a reason to not have it?

076cb5a7 09-Apr-2014 Cedric Degea <invalid@invalid.com>

BOptionPopUp: check for non-NULL Message(). Fixes #10733

Signed-off-by: John Scipione <jscipione@gmail.com>

1f424632 11-Jun-2014 John Scipione <jscipione@gmail.com>

Style fixes to IK, focus on docs

daabbbe5 04-Jun-2014 John Scipione <jscipione@gmail.com>

BRegion: Style fix, update parameter name

No functional change.

Trying to indentify each kind of object uniquely and consistently.

... update docs as well.

44cee340 03-Jun-2014 John Scipione <jscipione@gmail.com>

BRegion: Style updates for documentation.

No functional changes intended.

* Updated copyright information.
* Reduced doxygen documentation down to a helpful summary
in a regular comment, the documentation has been moved into
the Haiku Book.
* Some parameter renaming for consistency and clarity.
* A few other style fixes.

532c8733 30-May-2014 John Scipione <jscipione@gmail.com>

BRect: Replace max_c() and min_c() with std::max() and std::min()

1f46fc6d 30-May-2014 John Scipione <jscipione@gmail.com>

BRect: Style fixes for documentation

8ad6baf7 28-May-2014 John Scipione <jscipione@gmail.com>

BButton style fixes for docs.

No functional change intended.

b29d84a8 28-May-2014 John Scipione <jscipione@gmail.com>

BRadioButton style fixes for docs.

7ad8e674 28-May-2014 John Scipione <jscipione@gmail.com>

BCheckBox: Style fixes, variable renaming for consistency, docs.

Also some other style fixes, no functional changes intended.

092e3093 28-May-2014 John Scipione <jscipione@gmail.com>

BControl: Style fixes, variable renaming for consistency, docs.

Also some other style fixes, no functional changes intended.

f4870e1c 27-May-2014 John Scipione <jscipione@gmail.com>

BView: Rename parameters for consistency, docs.

No functional change.

b955a4ca 21-May-2014 John Scipione <jscipione@gmail.com>

BPolygon: Style fixes for documentation.

1867d69c 20-May-2014 John Scipione <jscipione@gmail.com>

BPoint: Replace max_c() and min_c() with std::max() and std::min()

e430d19e 20-May-2014 John Scipione <jscipione@gmail.com>

BPoint: Style fixes for documentation.

c109d7e0 19-May-2014 John Scipione <jscipione@gmail.com>

BPictureButton: Style fixes related to documentation

Some variable renaming for consistency.

df48d3f9 19-May-2014 John Scipione <jscipione@gmail.com>

BPicture: Style fixes related to documentation.

Mostly pointer style adjustments

24a8416e 02-May-2014 Jessica Hamilton <jessica.l.hamilton@gmail.com>

Revert "Fix window behavior when default button is present"

With some testing, found that even with the second patch
provided in #10792, the behaviour is still inconsistent, so
reverting for now.

This reverts commit 273109e0048442ba5f6361d6e683e5b4a69a472b.

77b60d22 02-May-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

Use std::stable_sort instead of mergesort.

* stable_sort is part of the C++ standard, and should work just as well.

3dfdd437 02-May-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

BGradient: preserve order of stops with same offset.

* Use merge sort, which is a stable sort, instead of the qsort used in
* This allows setting two stops with the same offset to create a sharp
color change in a gradient. This trick is used to create stripe patterns
with css gradients in some web pages.

Fixes #10733.

1d09e9ce 29-Apr-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

BScrollbar: remove unused field.

* Nothing ever reads fTargetName in the scrollbar code, so remove the
* Frees one reserved slot, and a little memory, as the target name was
copied with strdup.

273109e0 28-Apr-2014 Kacper Kasper <kacperkasper@gmail.com>

Fix window behavior when default button is present

* Don't intercept Enter key press in a window when there is default
button and another BControl focused.
* Current behavior was basically breaking every window using default
button. Even if there was a button focused (using Tab key), when Enter
was hit, default button handled the message, therefore instead of
i.e. 'Revert' 'Apply' was pressed.
* Fixes #10792.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>

667cfcdd 09-Jan-2014 Guillermo Bonvehi <gbonvehi@gmail.com>

TabView BTab::Select only add child if it doesn't have a parent

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>

60370b9a 22-Apr-2014 John Scipione <jscipione@gmail.com>

BMenuField/BTextControl: Store and reuse Label()

b11edca4 22-Apr-2014 John Scipione <jscipione@gmail.com>

BTextControl: style fixes

c79f2602 22-Apr-2014 John Scipione <jscipione@gmail.com>

BMenuField: Check if menuBar is NULL explicitly

d055b93b 22-Apr-2014 John Scipione <jscipione@gmail.com>

BMenuField: Replace 5 with DefaultLabelSpacing()

58a3b207 22-Apr-2014 John Scipione <jscipione@gmail.com>

BMenuField: style fixes

c884d017 24-Apr-2014 John Scipione <jscipione@gmail.com>

BMenuBar style fixes

ca6cc0aa 24-Apr-2014 John Scipione <jscipione@gmail.com>

BMenu: Replace min_c and max_c

... with std:min and std:max

b7096fd7 23-Apr-2014 John Scipione <jscipione@gmail.com>

BMenu: remove useless default case

cb30cf14 22-Apr-2014 John Scipione <jscipione@gmail.com>

BMenu: style fixes

a631719f 24-Apr-2014 John Scipione <jscipione@gmail.com>

BButton style fixes

de3e2b51 22-Apr-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

BGradient: don't allow out of bounds stops.

* They crash app_server if you try to use them, which is not a good idea.
* we could clamp them to 0/255, but reporting the error to the user
seems better.

02cdea9f 12-Apr-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

BTab: use ControlLook to draw label.

* Supports disabled tabs like BeOS did: label is drawn with disabled
color, but can still be selected.

e439b003 07-Apr-2014 John Scipione <jscipione@gmail.com>

Fix button label position, try number 2

Create and use BLayoutUtils::AlignOnRect() to position the button label
in BControlLook::DrawLabel().

AlignOnRect(), unlike AlignInFrame(), provides the possibility to return
a rectangle with dimensions greater than the available size.

Add some comments above the methods in LayoutUtils that indicate such.

Also update copyright headers in LayoutUtils and ControlLook

f0fdd7b9 07-Apr-2014 John Scipione <jscipione@gmail.com>

LayoutUtils: Use floorf() instead of floor()

6ecc270f 04-Apr-2014 John Scipione <jscipione@gmail.com>

LayoutUtils: Use std::max instead of max_c

04b48a29 04-Apr-2014 John Scipione <jscipione@gmail.com>

LayoutUtils: Style fix, remove leading space

4e8acd32 07-Apr-2014 John Scipione <jscipione@gmail.com>

ControlLook::DrawLabel() tiny style changes

c79ddce4 04-Apr-2014 John Scipione <jscipione@gmail.com>

Revert "Fix button label position"

This reverts commit 1c69e1c306186ef5f58e377835ed00a51ffcc955.

f5c284ee 01-Apr-2014 John Scipione <jscipione@gmail.com>

Style fixes to BTextView

1c69e1c3 01-Apr-2014 John Scipione <jscipione@gmail.com>

Fix button label position

This reverts a portion of hrev46580 concerning placement of a label on a button.
The label was draw too low on the button in some cases, notably in Keymap.
Restoring the old code for the icon-less case fixes the problem.

There still may be a problem drawing labels on buttons with icons, but, the code
should behave the same as it did in hrev46580 for that case, which is when
buttons with icons was introduced.

9ce450b9 25-Mar-2014 John Scipione <jscipione@gmail.com>

AboutWindow: Move to Interface Kit (still private)

24479670 17-Mar-2014 Stephan Aßmus <superstippi@gmx.de>

app_server: store and restore fill rule...

...when sending the whole view state over the link.
Also inherit the fill rule when pushing states (DrawState
copy constructor). A somewhat sloppy oversight, I must add.

eb431663 11-Mar-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

app_server & interface kit: support fill rules.

* BView gets SetFillRule/FillRule methods. The fill rule is part of the
view state.
* The B_NONZERO rule is the default. This is what we implemented before.
* The B_EVEN_ODD rule is the other common possibility for this, and
we need to support it to help WebKit to render properly.

5d98ee1e 08-Mar-2014 John Scipione <jscipione@gmail.com>

Revert "BScrollView: Increase small scroll step size from 1 to 3"

This reverts commit bdcfc076173236ddecccfebd945530a309debdce.

a6213356 07-Mar-2014 John Scipione <jscipione@gmail.com>

BView: scroll horizontally when holding control

... instead of vertically. This actually swaps horizontal and vertical
so if you have a mouse with a fancy 2-axis scroll ball it will swap
the x and y coordinates. (untested)

ab5c7442 07-Mar-2014 John Scipione <jscipione@gmail.com>

BView: ScrollWithMouseWheelDelta return status code

b2404e2a 07-Mar-2014 John Scipione <jscipione@gmail.com>

BView: Check scroll delta isn't 0

bdcfc076 07-Mar-2014 John Scipione <jscipione@gmail.com>

BScrollView: Increase small scroll step size from 1 to 3

... and then don't multiply by 3 in BView

c4337a43 07-Mar-2014 John Scipione <jscipione@gmail.com>

BView: style fixes related to mouse scrolling

b7929c05 07-Mar-2014 John Scipione <jscipione@gmail.com>

BScrollBar: style fixes, update copyright header

86bdb1b6 07-Mar-2014 John Scipione <jscipione@gmail.com>

Style fixes to BStringItem

5d10a74c 04-Mar-2014 John Scipione <jscipione@gmail.com>

BSeparatorItem: Style fix, rename archive to data

... missed it in a few places, trying to make variables names consistent.

Update hrev in docs

379ede58 04-Mar-2014 John Scipione <jscipione@gmail.com>

Style fixes to BMenuItem::GetContentSize and update docs

Rename width and height to _width and _height matching the header.

Update the documentation for this method as well.

4479c8fd 04-Mar-2014 John Scipione <jscipione@gmail.com>

Style fixes to BSeparatorItem class.

Mostly meant for documentation with a few other style corrections as well.

Update copyright header.

fa412b5f 28-Feb-2014 John Scipione <jscipione@gmail.com>

BMenuItem: Style fixes related to documentation.

91233f88 26-Feb-2014 Stephan Aßmus <superstippi@gmx.de>

Font: Work on support for spacing modes.

* Change default spacing to B_BITMAP_SPACING. The BeBook does not document
what the default spacing is, and I have no BeOS install handy to check.
However, I believe that B_BITMAP_SPACING is what should be the default,
since it gives the best visible result for the common use-case.
In terms of implementation, there is no change, since spacing was ignored
until now and the behavior was that of B_BITMAP_SPACING. This change could
however break BeOS apps which assume B_CHAR_SPACING is the default and don't
set it on new when they need it. Sample code in the BeBook however shows
setting B_CHAR_SPACING on a newly created BFont.
* Implement B_STRING_SPACING to do something sensible. The BeBook documentation
is completely vague in what it is actually supposed to do. Given the
possibilities of FreeType, I am implementing it to enable the use of
kerning. Kerning optimizes the spacing between two glyphs, for example, it
would decrease the spacing between "T" and "e" in the string "Test" for
our default font. Untested.

569eed2d 26-Feb-2014 Stephan Aßmus <superstippi@gmx.de>

Font.cpp: Style cleanup

* Unify asterisk style
* switch indentation style of FontList declaration
* Order FontList methods according to declaration
* Use named constants in default BFont constructor for spacing and encoding.

14aa801a 20-Feb-2014 John Scipione <jscipione@gmail.com>

Update DecorInfo to scan for decorators

Look in system and user packaged and non-packaged decorator directories.

bb322d35 18-Feb-2014 Stephan Aßmus <superstippi@gmx.de>

BMenuField: Draw everything on resize

* The label might be truncated, in which case the entire width needs to be
redrawn when the menu field shrinks or grows.
* Invalidating the border in the parent looked a bit weird. Simplified.

a6db6bd4 04-Feb-2014 Stephan Aßmus <superstippi@gmx.de>

Added WIP support for affine transformations to BViews.

Everything untested, but compiles, so it must work. The idea is to introduce
BAffineTransform additionally to the existing Origin and Scale properties of
BViews. One may use it in parallel or as an alternative. Painter in app_server
is not yet aware of the additional transformation. It is however already used
to transform drawing coordinates. It probably needs to work differently,
perhaps only in Painter and AGGTextRenderer.

77acb432 01-Feb-2014 John Scipione <jscipione@gmail.com>

TextView: Remove Cmd+Up and Cmd+Down Shortcuts

to go to the beginning and end of the document.

b58b8cdd 01-Feb-2014 Stephan Aßmus <superstippi@gmx.de>

BView: Fix ClipTo[Inverse]Picture() syncing.

When BPictures are created on the stack and go out of scope, they send a
AS_DELETE_PICTURE command to the ServerApp thread, and that command may be
processed sooner than the AS_VIEW_CLIP_TO_PICTURE command in the ServerWindow
thread, causing that command to no longer find a ServerPicture for the given
token. Apparently, the Be API leaves you the choice not to sync, in case for
example when you cache your BPictures and they remain valid. The default
value for "sync" is true. The BeBook could explain the situation better when
sync is needed and when not.

138e4c77 31-Jan-2014 Stephan Aßmus <superstippi@gmx.de>

BPicture: Attach as many picture tokens as promised.

08751732 31-Jan-2014 John Scipione <jscipione@gmail.com>

TextView: Update nav shortcuts again

Make Cmd+Left and Cmd+Right work the same as Option+Left and
Option+Right, that is, they do word-wise navigation.

Make Option+Up go to beginning of paragraph and Option+Down go to end
of paragraph like Cmd+Left and Cmd+Right used to.

Unfortunately option shortcuts are currently eaten by S&T until #9431
gets fixed.

eb774c29 10-Jan-2014 John Scipione <jscipione@gmail.com>

TextView: Update navigation shortcuts

* Command+Left goes to beginning of line, ignoring softwrap
* Command+Right goes to the end of line, ignoring softwrap
* Home goes to beginning of line, accounting for softwrap
* End goes to end of line, accounting for softwrap
* Option+Left goes to previous word
* Option+Right goes to next word
* Command+Home and Command+Up go to beginning of document
* Command+End and Command+Down go to end of document

Shift with any of the above also selects the text.

This is similar to how the text editor Eddie works.

d0fa6c78 28-Jan-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

BView: Allow resetting ClipToPicture

Just like for regions, ClipToPicture(NULL) removes any picture clipping
at the current state level (clipping in pushed states are not undone).

73ac4cdc 27-Jan-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

truncate_string(): Be a lot laxer wrt. rounding incaccuracies

Instead of 1/10000 we now add 1/128 to the width to compensate for
rounding inaccuracies. Due to the limited float mantissa precision
(23 bit) the previous value would already have no effect for relatively
small widths (>= 128).

Fixes #10455.

e0d1cc18 22-Jan-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

BView: move ClipToPicture code to app_server

Now that DrawingContext makes it possible to draw on a ServerBitmap
without the need for a BView, we can replay pictures on app_server side,
avoiding the cost of creating a BBitmap, offscreen BWindow, and BView
from the application side.

The offscreen drawing context gets the same state as the view it's
rendering the picture for, so font size, drawing mode, etc are used.

The implementation is still the suboptimal one, converting the BBitmap
to a BRegion, and using that for clipping. Changing that comes next.

5c3fd460 12-Jan-2014 Stephan Aßmus <superstippi@gmx.de>

BView: Don't allow a view to add itself as a child.

a0848a19 29-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BButton: Add optional pop-up marker

* Add behavior constant B_POP_UP_BEHAVIOR which adds a pop-up marker
to the button (similar to that of BMenuField).
* Add methods [Set]PopUpMessage(). To set/get the the message that is
sent to the button's target when the pop-up marker is clicked.

87f392c9 29-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BControlLook::GetFrameInsets(): Fix button insets

The button frame is 3 pixels wide, but that includes one pixel that
actually belongs to the background, which is accounted for by
Removes the additional one pixel inset accidentally introduced earlier.

813c5772 29-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BButton: Removed dead code

Remove methods _DrawDefault() and _DrawFocusLine() which were used for
the non-BControlLook drawing.

b998f9f0 28-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BButton: Add support for toggle button behavior

Add methods SetBehavior(), Behavior(). Supported behavior constants are
B_BUTTON_BEHAVIOR -- normal button behavior -- and B_TOGGLE_BEHAVIOR
-- toggle button behavior.

a249edfb 28-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BButton: Add flat property

* Add methods SetFlat()/IsFlat(). A flat button doesn't draw its frame,
unless the mouse is hovering over it or it is otherwise activated.
* As a side effect this change also activates the hover glow that was
already implemented in BControlLook, but not activated in BButton.

63632ee1 23-Dec-2013 John Scipione <jscipione@gmail.com>

BListView: Skip disabled items via keys

in KeyDown() to skip over disabled items.

c6c5cd99 23-Dec-2013 John Scipione <jscipione@gmail.com>

BListView: Only select enabled items

when selecting multiple items in a multi-select list view.

b38f03f5 23-Dec-2013 John Scipione <jscipione@gmail.com>

BListView: small optimization.

We already got item at index, don’t get it again

d0931012 23-Dec-2013 John Scipione <jscipione@gmail.com>

BListView: style fixes

5e815cf3 22-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BRadioButton: Add icon support

* Fix off-by-one issue in Draw() and GetPreferredSize(). The label was
too close to the knob.
* GetPreferredSize(): Remove empty space to the right, when no label
and no icon was specified. Like with BCheckBox there's still two rows
of empty pixels above and below the knob.
* Draw(), GetPreferredSize(): Add icon support.

36e15662 22-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BRadioButton: Remove non-BControlLook code

f0c31011 22-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BControl: Move icon code to separate class BIcon

97bf0ce3 22-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BControl: Move icon code to separate class BIcon

5414b3c4 22-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Move icon related constants to InterfaceDefs.h

There will be non-BControl views to use those as well.

f8298894 21-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BCheckBox: Add icon support

* Draw(): Remove the non-BControlLook code.
* GetPreferredSize(): Implement based on _ValidatePreferredSize() to
avoid code duplication.
* Draw(): Fix off-by-one error. The label was too close to the box.
* Draw(), _ValidatePreferredSize(): Add icon support.
_ValidatePreferredSize() is now actually aligned with what Draw()
expects. The preferred width is now a tight fit; there were three or
four pixels of empty space before.
Due to the fixed check box position the layout isn't that nice in
some situations (particularly with an icon larger than the text),

6af520e2 21-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BControlLook::DrawLabel(): Fix off-by-one error

* BFont::TruncateString() expects a pixel count (as opposed to a pixel
distance). That would cause a tightly fitting string to be truncated.
* Round the result of StringWidth() to avoid drawing at a non-integer

fe878769 21-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BButton: Add icon support

* Remove non-BControlLook drawing code. It's just an annoyance to
* Update Draw() and _ValidatePreferredSize() to add icon support.

be436742 21-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BControl subclasses: Override SetIcon()

... and implement Perform() action for potential later use.

be260374 21-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BControl: Add icon support

The icon is meant as an addition to or replacement of the label. Icon
bitmaps for various states of the control (off, on, partially on, each
enabled or disabled, plus up to 125 custom states) can be set
individually via SetIconBitmap() (getter IconBitmap()).
The convenience method SetIcon() can be used to set the bitmaps for the
standard states from a single bitmap; it also supports cropping the
icon to its non-transparent area. Code borrowed from BIconButton.

1b848ee7 21-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BControlLook: Add DrawLabel() variants with icon

A label, a bitmap, or both can be specified.

8719e0dc 21-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BControlLook: Add methods for getting insets

* Update the previously unused frame_type and background_type enums.
* Add methods GetFrameInsets(), GetBackgroundInsets(), GetInsets() to
get the insets for a given frame type, background type, or both

df37cd4e 20-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BCheckBox: Add tri-state support

* Add possible control state B_CONTROL_PARTIALLY_ON and support it in
BCheckBox and BControlLook.
* BCheckBox: Add partialStateToOff property defining whether the
partial state should transition to off. Defaults to false (i.e.
partial to on).

5d7f782d 20-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BLooper: Add DispatchExternalMessage()

* This is primarily a service method for ports of widget tool kits
that require single-threaded GUI. DispatchExternalMessage() calls
DispatchMessage(), but also sets fLastMessage, so that
[Detach]CurrentMessage() work correctly. This allows to detach a
message in DispatchMessage() when called from the window thread,
add it to a global queue, and later process the queued messages in
a different thread that calls DispatchExternalMessage().
* BLooper/BWindow: Make sure fLastMessage is accessed only when locked.

57973ac9 20-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BRadioButton: Fix spurious Invoke()

MouseUp(): Don't call SetValue() and Invoke() when the button was
already the selected one.

cf9414ff 16-Dec-2013 John Scipione <jscipione@gmail.com>

Convert coords of B_MOUSE_IDLE in _SanitizeMessage()

When BWindow receives a message in screen coordinates and the
message has a target view, as it does when the message comes from
App Server, convert the coordinates to view coordinates before
passing the message along.

Revert the portion of hrev46532 where BView converts screen
coordinates and converts them since that happens in
BWindow::_SanatizeMessage() now.

19360a8c 16-Dec-2013 John Scipione <jscipione@gmail.com>

BWindow: Style fix, 80 char limit.

dd0bdb49 13-Dec-2013 John Scipione <jscipione@gmail.com>

Fix a bug retreiving tooltips

Noticed this in Time prefs was displaying wrong time zone tool tip,
dug deeper...

hrev46290 introduced this bug because it passes fLastCursorPosition
into the “be:view_where” parameter of the B_MOUSE_IDLE message.
The problem is that fLastCursorPosition is in the screen’s coordinate
system, not the view’s and BView expects “be:view_where” to be in the
view’s coordinate system.

So, to fix this I pass fLastCursorPosition in the “screen_where” parameter
instead which I’ve instructed BView to interpret as the point in the screen’s
coordinate system which is then dutifully converted back the the view’s
coordinate system.

I tried to follow the naming scheme of other code, not sure if screen_where
should be namespaced with the be: predicate or not.

8c6d5490 25-Nov-2013 John Scipione <jscipione@gmail.com>

BStringItem: Set the low color to the list view color

instead of the low color, practically this should make little difference,
just a cleanup.

e3be58f1 25-Nov-2013 John Scipione <jscipione@gmail.com>

BStringItem: Tiny style fix

1e1afb39 11-Dec-2013 John Scipione <jscipione@gmail.com>

Updates to BOutlineListView for docs

mostly param naming.

No functional change intended.

964e6ee1 08-Dec-2013 Stephan Aßmus <superstippi@gmx.de>

Shelf: Save() leaked a previous fStream. Untested.

Also, a few style-cleanups along the way.

eb539d59 22-Nov-2013 Julian Harnath <julian.harnath@rwth-aachen.de>

Don't try to open another menu window if there already is one.

* Fixes crash when using Gobe Productive toolbar.

c88a1b9d 29-Oct-2013 Stephan Aßmus <superstippi@gmx.de>

Use delivery and reply timeouts...

when contacting the input_server.

6f33360f 11-Nov-2013 John Scipione <jscipione@gmail.com>

BPopUpMenu style fixes for documentation, no functional change intended

b781fcec 15-Jul-2013 Murai Takashi <tmurai01@gmail.com>

GridLayout.cpp: use delete[] instead of delete. Fixes #9875.

Signed-off-by: Matt Madia <mattmadia@gmail.com>

ef92b3dd 06-Nov-2013 John Scipione <jscipione@gmail.com>

BMenuBar: Update param names related to docs.

No functional change intended.

Renamed title => name in regular constructors,
No right or wrong here but consistant now.
Renamed data => archive in Achive constructor,

45e17d3d 06-Nov-2013 John Scipione <jscipione@gmail.com>

Update BView::DrawAfterChildren() param name

... from r to updateRect, no functional change intended.

Also a tiny change to the param description in the docs.

9a9ebda4 05-Nov-2013 John Scipione <jscipione@gmail.com>

BMenu: Some style fixes related to docs

Mostly just making the variable names match between the
header and source.

No functional change intended.

40082f76 31-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BMenu: Update comment

0b4c2d32 31-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BMenu: Use shift modifier for page-wise wheel scrolling

Fixes part of #9907.

7f94398c 26-Oct-2013 Siarzhuk Zharski <zharik@gmx.li>

TextView:Restore caret offset on B_HOME/B_END in R/O mode

Handling Ctrl-Home / Ctrl-End shortcuts in non-editable mode left the
caret offset unchanged. That provoked stuck of the page scrolling mode.
Reset the caret offset on such actions. Fixes #9407.

057c8708 26-Oct-2013 Julian Harnath <julian.harnath@rwth-aachen.de>

Move B_MOUSE_IDLE generation to app_server.

* BWindow used to generate the B_MOUSE_IDLE events by sending a
delayed message with a one-shot BMessageRunner to itself.
Every creation and deletion of BMessageRunners causes synchronous
messaging between the application under the mouse cursor and the
registrar. This creates large amounts of calls to set_port_owner()
in the kernel whenever moving the mouse.

* Now, B_MOUSE_IDLE is sent by the cursor loop inside the app_server
instead. When the mouse wasn't moved for the tooltip delay time,
it inserts a B_MOUSE_IDLE message into the event stream.

* The tooltip delay thus becomes a system-wide constant and is not
configurable per-application anymore (no code currently in the
Haiku repo makes use of that anyhow).

2be66b51 25-Oct-2013 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Remove unneeded space

c29f2d22 25-Oct-2013 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Close the menu on keypress.
After _InvokeItem(), call QuitTracking() to close the menu.
Incidentally this also seems to fix #9863.

6c1a6532 22-Oct-2013 Jérôme Duval <jerome.duval@gmail.com>

PrintJob.cpp: use MemoryDeleter.

1c9b1111 20-Oct-2013 Rene Gollent <rene@gollent.com>

Implement #10116.

- BColumnListView now accepts middle click as well as double click
to resize a column to preferred.

ebea2b79 20-Jul-2013 Murai Takashi <tmurai01@gmail.com>

Fix use of memory after it is freed

Signed-off-by: Matt Madia <mattmadia@gmail.com>

26a23118 19-Oct-2013 John Scipione <jscipione@gmail.com>

BWindow: use Unicode lowercase method

285b7163 08-Oct-2013 John Scipione <jscipione@gmail.com>

MenuField: Filter out additional MouseDown messages.

...while mouse is down on a menufield

This makes it so that you can't open 2 menufields simultaneously
by clicking and holding the right mouse button on one menufield while
clicking a second with the the left mouse button opening it.

This matches the behavior on BeOS R5.

Should help with #6408 comment:9

e67f9c9b 08-Oct-2013 John Scipione <jscipione@gmail.com>

Revert "MenuBar: Fix sticky menu issue. #6408 comment:9"

This reverts commit 74627342028d4a2ca7cf4e64d5ea9a07efab87ef.

Fixes #10072, breaks #6408 comment:9 again.

ed6f171a 16-Sep-2013 Stephan Aßmus <superstippi@gmx.de>

BColumnListView: Enable invalidating rows, fix SetField()

* Seems like there was no easy way to simply invalidate
a given BRow. Introduced BColumnListView::InvalidateRow().
* BRow::SetField() tried to invalidate the row, but invalidated
the listview instead of the BOutlineView responsible for
drawing the list contents. Use the new InvaalidateRow().

1c38517e 15-Sep-2013 Siarzhuk Zharski <zharik@gmx.li>

ListView: More safe ScrollToSelection implementation

The Problem was observed in the Time Preferences Zone view - the
selection was set inside of TimeZoneView::DoLayout() call on
the OutlineListView control that had zero-sized Bounds. After
the control was resized the selection stay mainly hidden "under"
the upper edge. The Problem looks like generic so should be fixed
in the interface kit code. Proposed fix introduces additional check
for the scroll position to not cross the top edge of control.

cf70d345 12-Sep-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Merge remote-tracking branch 'haiku/master' into package-management

This reverts 8f7f28a7c3db28711920ad5d15df401fae90bcf1 (OpenGL: Upgrade
Mesa 9.2).


426f721b 11-Sep-2013 Rene Gollent <anevilyak@gmail.com>

Fix default alignment on BCheckBox.

Was most readily noticeable in WebPositive's Find pane, where the
CheckBox was incorrectly top-aligned. Thanks to Humdinger for reporting.

88f12ad8 10-Sep-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Add private BViewPort class

* It simplifies putting regular layout-aware views or layout items into
a BScrollView.
* Not quite complete yet: Height-for-width support is missing, but that
also requires fixing BScrollView in this respect. Scroll bar auto-hide
support would be nice as well.

5c56812d 10-Sep-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BControlLook::ComposeSpacing(): Avoid non-integers

4a8da960 10-Sep-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BLayoutUtils: Add GetLayoutTreeDump()

Returns a debug output string listing the basic layout properties of
the view/item hierarchy.

8ce846e2 26-Aug-2013 Adrien Destugues <pulkomandy@gmail.com>

Fix infinite loop with huge tooltips

* With a tooltip big enough trying to align below or above the mouse, the algorithm would loop endlessly trying to fit it on either side.
* After trying each side once, set alignment to middle to try to show as much as the tooltip as possible.

A way to trigger this is browsing WebKit github repository in WebPositive. Github will show the full commit message in a tooltip when you hover a file or directory, and some of
their messages are big enough to overflow my desktop.

4385f739 25-Aug-2013 John Scipione <jscipione@gmail.com>

Revert "Menu: check numBytes == 1 on KeyDown"

This reverts commit 44dc533861d5e6c8c80f3ed89d6dfb4b8a30c724.

163fc310 25-Aug-2013 John Scipione <jscipione@gmail.com>

Revert "MenuField: Make sure input is a single byte"

This reverts commit 4e075e0f4c60a600a86792d9c36eae513f1cda31.

74627342 24-Aug-2013 John Scipione <jscipione@gmail.com>

MenuBar: Fix sticky menu issue. #6408 comment:9

60a7f115 24-Aug-2013 John Scipione <jscipione@gmail.com>

Menu: Handle Keyboard input better.

When you push an arrow key obscure the cursor so that it doesn't get in the
way of the menu items. BeOS R5 also did this.

When you select an item with Enter or Space, or cancel with Escape, set the
super menu to close in _QuitTracking() if you've specified onlyThis == false.
Also, show the cursor here in case you haven't moved the mouse since it was

This fixes a problem where when you select an item in a menu via the keyboard
while your mouse is over the parent menu item or menu field it would pop the
menu back up again even though you've made your selection or cancelled.

3dd9ff2b 24-Aug-2013 John Scipione <jscipione@gmail.com>

BMCMenuBar: Refactor MakeFocus()

Get rid of unused fRunner variable.

It is very basic now, it just works.

Also, renamed msg to message in MessageReceived() and
declared MakeFocus() above it (alphabetically).

8f74b989 24-Aug-2013 John Scipione <jscipione@gmail.com>

MenuField: Remove unused variables

fSelected and fTransition

44dc5338 24-Aug-2013 John Scipione <jscipione@gmail.com>

Menu: check numBytes == 1 on KeyDown

cccc4076 24-Aug-2013 John Scipione <jscipione@gmail.com>

Menu and friends: Style fixes, no functional

... changes intended.

* 80 char limit fixes
* Indentation fixes
* Braces style fixes
* Use ternary operator where appropriate
* Rename menuItem to just item and declare it once outside
the loop
* Omit 3rd param of GetMouse() because it is default
* Rename variables eg state => focused and menu => submenu
* Indent comments below line they apply to
* Reword some comments
* Add some #pragmas

f5bb8311 23-Aug-2013 John Scipione <jscipione@gmail.com>

Menu: Silly code optimization

Always set releasedOnce to true here instead of setting it true in the
case that it is false. It's almost certainly faster and clearer to always do
the assignment than to incur the cost of the conditional and branch.

4e075e0f 23-Aug-2013 John Scipione <jscipione@gmail.com>

MenuField: Make sure input is a single byte

d5de9547 21-Aug-2013 John Scipione <jscipione@gmail.com>

Menu: some helpful comments

9422c92e 20-Aug-2013 John Scipione <jscipione@gmail.com>

MenuField: Open the menu bar when the label is clicked

Fixes #6894

Private DrawLabel() method renamed to _DrawLabel() and rest of drawing
code moved to new private method _DrawMenuField(). These methods both
check to make sure that they are drawing in a valid rect that intersects

When label or menu is selected Draw a the label background in the selected
menu color matching the behavior of BeOS R5.

_DrawLabel() calls be_control_look->DrawLabel()

Update copyright year in MenuField.h

408c0ee4 20-Aug-2013 John Scipione <jscipione@gmail.com>

MenuField: enable/disable the menu field when...

the child menu bar or the child menu bar's menu is enabled/disabled.

This means that there is just one status we have to check, the menu
fields, and the child menus agree. This change takes practical form
in the Backgrounds preflet which disables the placement menu when
the image is set to "None", but, only the menu got disabled and not the
parent menu field so the label was erroneously still drawn as enabled.

ac359925 20-Aug-2013 John Scipione <jscipione@gmail.com>

Revert "don't open the menu if it's disabled."

This reverts commit ce8253d97b588366540230d11fb534c4846d0a09.

3de334b9 19-Aug-2013 John Scipione <jscipione@gmail.com>

MenuField: need stdio.h if TRACE enabled

* Also update authors adding myself

db85cbe0 20-Aug-2013 John Scipione <jscipione@gmail.com>

MenuItem: Set and restore the low color too

A small revision on my last published commit, set and restore the
low color in addition to the high color when drawing the menu item
because DrawString() will produce nicer looking results if the low
color of the view matches the color it draws on due to anti-aliasing.

dec0a352 20-Aug-2013 John Scipione <jscipione@gmail.com>

MenuItem: Fix disabled sub-menu item color

See #6610 comment:15 for details.

Firstly, don't save and restore the super menu's low color
since it never changes, instead, save and restore the super
menu's high color which does get altered here.

Secondly, set the high color to
B_MENU_SELECTED_ITEM_TEXT_COLOR only if the menu item
is activated and enabled, otherwise set the high color by tinting the
background color which might be
B_MENU_BACKGROUND_COLOR depending on whether
the item is selected or not.

Thirdly, complete the TODO by using a lighten tint if the menu
has a dark background and vice-versa.

This third item is actually a good candidate for a BControlLook
function because the disabled tint should depend on whether the
background color of the thing you're disabling is light or dark.

83ea4af4 20-Aug-2013 John Scipione <jscipione@gmail.com>

BMenu: Don't hit test separator items

Fixes #4147 while not causing the regression described in #6610
like hrev35248 did.

77850e8d 20-Aug-2013 John Scipione <jscipione@gmail.com>

Revert "BMenu return only enabled items"

Patch by "stimut"

This reverts commit abc26ba8ad02a8394a30dece78ba443fc099b81d.

Reverting this patch fixes #6610

74577830 17-Aug-2013 John Scipione <jscipione@gmail.com>

ColorControl: Implement keyboard navigation

Implements enhancement described in #9819

This feature works pretty much as it did on BeOS R5.

When you focus on the color control, the border is drawn blue and
the dot on the red ramp draws as an outline to show that it is
selected. You can push the up and down arrow keys to navigate to the
previous and next ramps respectively and can push right and left to
increment and decrement the color value of the selected ramp.

Clicking on the control no longer gives it focus.

In BeOS the left and right arrows would increment and decriment by 5,
on Haiku they increment and decrement by 1, but, by holding down the
key for a second or so the increment value increases to 5 allowing for
both course and fine adjustments.

On a technical note I split the int32 fFocusedComponent member variable
into 2 int16 member variables, fFocusedRamp and fClickedRamp. I did this
because I needed an entra variable, and can't change the size of the
class without using up another reserved member variable slot. int16
should be more than enough for these variables as they store an index to
the currently focused or clicked on ramp (0-3). Please someone chime in
if this is not okay for FBC in some condition I didn't think about.

d38ba8f7 13-Aug-2013 John Scipione <jscipione@gmail.com>

ControlLook: Check IsFocus() first

Otherwise we make two unnecessary function calls for every control
in a window where only one of them is the focus control.

Thanks Stippi.

59655dcb 12-Aug-2013 John Scipione <jscipione@gmail.com>

Update control focus flag. Fixes #9915

Parent window must be active for control to draw as focused. This
affects all controls that draw their focus ring using ControlLook
including but not limited to BButton, BCheckBox, and BRadioButton.

I won't pretend to know what is "right" but the behavior now matches
BeOS R5.

1058f86a 10-Aug-2013 Stephan Aßmus <superstippi@gmx.de>

BColumnListView: Regard StatusView in DoLayout() and Draw()

a8b89c6b 04-Aug-2013 Stephan Aßmus <superstippi@gmx.de>

BControlLook: The spacing values need to be rounded...

... or they will cause all sorts of graphics glitches and layout

b0944c78 01-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

More work towards hybrid support

* All packaging architecture dependent variables do now have a
respective suffix and are set up for each configured packaging
architecture, save for the kernel and boot loader variables, which
are still only set up for the primary architecture.
and TARGET_LIBSTDC++ are set to the respective values for the primary
packaging architecture by default.
* Introduce a set of MultiArch* rules to help with building targets for
multiple packaging architectures. Generally the respective targets are
(additionally) gristed with the packaging architecture. For libraries
the additional grist is usually omitted for the primary architecture
(e.g. libroot.so and <x86>libroot.so for x86_gcc2/x86 hybrid), so that
Jamfiles for targets built only for the primary architecture don't
need to be changed.
* Add multi-arch build support for all targets needed for the stage 1
cross devel package as well as for libbe (untested).

be92485f 29-Jul-2013 Humdinger <humdingerb@gmail.com>

Fixed default vertical alignment of BTextControl.

Courtesy of Rene who broke it a while back and remote
controlled me on IRC to commit the fix...

323523c4 26-Jul-2013 John Scipione <jscipione@gmail.com>

BWindow: style fixes only, no functional change.

f1eb4295 18-Jul-2013 John Scipione <jscipione@gmail.com>

BMenuField: Check if Frame() is valid, refactor

8d75f143 18-Jul-2013 John Scipione <jscipione@gmail.com>

BMenuField: Style fixes

e724b26f 08-Jul-2013 John Scipione <jscipione@gmail.com>

Remove enum elaborated type specifier

...from orientation params. Elaborated type specifiers are not needed
for C++ code and removing them makes doxygen happy. Verified working
on both gcc2h and gcc4h builds.

d3765546 03-Jul-2013 Rene Gollent <anevilyak@gmail.com>

BBox: propagate alignment from child for the...


46d6e9d9 29-Jun-2013 Rene Gollent <anevilyak@gmail.com>

Interface Kit: Adjust max size and default alignment...

...on controls where it makes sense:
- BRadioButton and BCheckBox now return their preferred size as their
- BRadioButton, BCheckBox and BTextControl now use left alignment by
default, as this is the most common use case for them.

621ae6bd 01-Jul-2013 Rene Gollent <anevilyak@gmail.com>

Revert 7910d8b for now.

Quite a few layouts seem to depend on the previous behavior, and there
isn't really an elegant way to resolve that for now, unless I miss
something in the lauout APIs. However, this does need to be looked at
at some point, for some other controls as well, since it effectively
makes it impossible to properly use such controls in horizontal groups
and get an expected result.

bee420ff 30-Jun-2013 John Scipione <jscipione@gmail.com>

BStringView: Add scripting support. Fixes #9823

Configure BStringView to respond to messages to get and set Text and Alignment
properties. Fill out ResolveSpecifier() and GetSupportedSuites accordingly.

BeOS R5 did not provide any additional scripting support for BStringView so
this goes above and beyond what BeOS R5 did, but, doesn't break backwards

1103c53a 30-Jun-2013 Rene Gollent <anevilyak@gmail.com>

Fix another BTabView problem.

BTabView::RemoveTab() directly manipulated the selected index, which
would cause problems in conjunction with the recently introduced short
circuit, most notably observable in Terminal.

eaedb2f8 29-Jun-2013 Rene Gollent <anevilyak@gmail.com>

Fix regression introduced in 16e486e.

Explicitly select the first tab if the caller hasn't done so by the time
we're attached to the window.

16e486eb 29-Jun-2013 Rene Gollent <anevilyak@gmail.com>

BTabView: minor optimization.

Short circuit if asked to select the same index that's currently visible, to
avoid unnecessary invalidation/flicker.

Should fix last part of #9841.

27929dcd 28-Jun-2013 John Scipione <jscipione@gmail.com>

BView docs: Add remaining new method descriptions

Layout and Tool Tip method documentation.

Also ScrollWithMouseWheelDelta()

1e6e124c 28-Jun-2013 John Scipione <jscipione@gmail.com>

BView: Style fixes only, no functional change intended

Motivated by inconsistancies found while documenting BView.

Update copyright year, alphabetize

Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha

A couple of white spaces fixes.

A couple of !pointer => pointer == NULL fixes.

GetPreferredSize params => _width and _height to indicate out params.

7910d8b8 27-Jun-2013 Rene Gollent <anevilyak@gmail.com>

Adjust BCheckBox::MaxSize.

Previously BCheckBox returned unlimited width for its max size. This
became problematic if one wanted to put a checkbox in any kind of
horizontal layout with other controls, since they would expand to use as
much space as possible. This is also in contrast to other controls such
as BButton, which simply return the max to be the same as the preferred.
As such, adjust BCheckBox to do the same.

1f0b41ba 07-Jun-2013 John Scipione <jscipione@gmail.com>

BColorControl: Position text controls better

Position the text control vertically in the middle of the ramp in
the case that the text controls are pushed down so that the red, green,
and blue text controls are next to the red, green, and blue ramps.

d5432ed6 07-Jun-2013 John Scipione <jscipione@gmail.com>

BColorControl: Refactor _LayoutView()

In a few cases we were doing the work of _LayoutView() twice because
we called _LayoutView() and then called ResizeToPreferred() which called
_LayoutView() again.

Now only call ResizeToPreferred() which calls _LayoutView().

da6c116d 05-Jun-2013 John Scipione <jscipione@gmail.com>

BColorControl: Introduce kRampCount magic constant.

8b3b14fd 05-Jun-2013 John Scipione <jscipione@gmail.com>

BColorControl: Introduce a _PaletteFrame() method

... eliminating duplicate code.

abbd44ac 05-Jun-2013 John Scipione <jscipione@gmail.com>

BColorControl: Rename bevelRect to just rect

... with an explanatory comment. Correct similar comment.
Tiny style fix.

62fec205 02-Jun-2013 John Scipione <jscipione@gmail.com>

BColorControl: Size text rect based on font size

* Also change kMinCellSize from a uint32 to a float so that it can be used
with std::min() and std::max() instead of min_c() and max_c().
* Set the text controls sizes and margins based on the font size. Also rework
_TextRectOffset() so that it will get the right spacing from by dividing the
palette frame by 3.
* Replace bare numbers and refactor with calculation or magic constant.
* Create a private method _TextRectOffset() which calculates and
returns the vertical text rect offset to use based on the font size.
* Replace 2.0 with new kBevelSpacing constant where appropriate.
* fPaletteFrame calculation in _LayoutView() was refactored but should
not have changed.

1186916f 30-May-2013 John Scipione <jscipione@gmail.com>

BColorControl: Create _SetCellSize() method

...eliminating duplicated code.

0289f920 30-May-2013 John Scipione <jscipione@gmail.com>

BColorControl: Style fixes

* Update copyright in header, add my name, alphabetize.
* Rename _ColorRamp() to _DrawColorRamp().
* Rename update parameter to updateRect

1c95f722 07-Jun-2013 John Scipione <jscipione@gmail.com>

Don't set MaxContentWidth on the menu bar of a BMenuField

Fixes #9816

It is no longer necessary, or even desirable for us to set the max
content width of the menu bar of a BMenuField now that BMenuItem
truncation and BMenuField sizing are working.

The user may, however, wish to set the max content width of the menu
bar of a BMenuField themselves like so:


and the Interface Kit will automatically deduct the left and right
margins from the width including the space used by the drop down arrow.

cc27aad6 02-Jun-2013 Rene Gollent <anevilyak@gmail.com>

BCLV: Force scrollbar fixup if cleared.

fc77b031 30-May-2013 John Scipione <jscipione@gmail.com>

Revert "BBox: Always offset the top border by the same amount"

This reverts commit 39899cf6626bbcb3b41fd44fc49dd2bdec9a34f9.

Checked with BeOS R5, and this is not how it works, to remain
compatable we need to go back to how this was before.

39899cf6 30-May-2013 John Scipione <jscipione@gmail.com>

BBox: Always offset the top border by the same amount

...so that the top border of BBox's with no labels, BBox's with
text labels, and BBox's with BControl labels will all line up.

f9954bfc 30-May-2013 John Scipione <jscipione@gmail.com>

Style fixes to BBox, update copyright header

ca3a1c04 29-May-2013 John Scipione <jscipione@gmail.com>

BMenuField: If fixed size always set max content width

When you resize, also set max content width.

Create a SetMaxContentWidth() method that includes the margins.

d926be8a 29-May-2013 John Scipione <jscipione@gmail.com>

BMenuItem: Check MaxContentWidth for truncation

92c12506 29-May-2013 John Scipione <jscipione@gmail.com>

Move kMinMenuBarWidth to MenuField.cpp

6da3c1c7 29-May-2013 John Scipione <jscipione@gmail.com>

if menu _BMCMenuBar_ subtract the popup indicator width

... when calculating the width of items in _ComputeLayout. This prevents
that menu field from growing on selection fixing #9796 and #2413.

Also a few style fixes.

a1cf3ead 25-May-2013 John Scipione <jscipione@gmail.com>

Resize menu field if below minimum width in auto-size mode

... cancelling the normal item truncation behavior.
This funcationality comes from BeOS R5, we need to reproduce it for
backwards compat. KeymapSwitcher depends on it at least.

Minimum width is 20px, was set in last commit, comes from BeOS R5.

6031e624 25-May-2013 John Scipione <jscipione@gmail.com>

Move constants to BMCPrivate.h and refactor

We use these constants in both MenuField.cpp and BMCPrivate.cpp

Incorporate kMarginWidth into kPopUpIndicatorWidth.

A small code simplication in FrameResized() along with replacing bare numbers
with magic constants.

f7c092f5 25-May-2013 John Scipione <jscipione@gmail.com>

Refactor _BMCMenuBar_::Draw a bit

Move the comments around, expand on them and an 80 char fix.

9af9f515 25-May-2013 John Scipione <jscipione@gmail.com>

Don't resize to preferred height if fixed size, BeOS didn't

17aed1bf 25-May-2013 John Scipione <jscipione@gmail.com>

Use roundf() as suggested by Axel

01636e8f 15-May-2013 John Scipione <jscipione@gmail.com>

Adjust menu field's menu bar height in auto mode

On IRC diver pointed out to me that KeymapSwitcher had a menu field that
was drawing as just a line since my recent change to BMenuField. I did a
little research and discovered that this was because the menu field in
KeymapSwitch was not using the layout APIs and it's frame rect was set to
0 height.

I did a little more research and experimented with menu fields in
BeOS R5. I discovered that in R5 if the menu field is set to auto-size
mode then the menu bar inside ignores the height of the menu field frame
and uses the BMenuBar's preferred height instead.

So, I adjusted the BMenuField code in Haiku accordingly. This should make
Haiku match the behavior of BeOS R5 in auto-size mode. For fixed-size mode
it should also work the same, although some more testing is needed to
see if there are any regressions there.

298cd4c2 09-May-2013 John Scipione <jscipione@gmail.com>

BMenuField: Fix menu bar resizing in auto-size mode.

Fixes #9753 (for real this time)

Don't resize the menu field when the menu bar resizes, the menu
field stays the same size because we'll need to use it's width to
check when the menu bar width has expanded beyond its width.
Then, if the selected menu item expands the menu bar to a width
greater than the width of the menu field resize it to the menu field

f6d93b80 09-May-2013 John Scipione <jscipione@gmail.com>

Remove the unused bounds parameter from DrawLabel

Also refactor BMenuField::Draw()

869e4bdc 09-May-2013 John Scipione <jscipione@gmail.com>

Don't cast to float, use floorf

91810d8e 09-May-2013 John Scipione <jscipione@gmail.com>

Use better variable names in SetDivider

df5d08a7 08-May-2013 John Scipione <jscipione@gmail.com>

Style fixes to BMenuField

Rename resize to resizingMode, whitespace fixes, compare to 0 explicitly

ec1f08fb 08-May-2013 John Scipione <jscipione@gmail.com>

Resize menu field menu bar iff fFixedSize is true

If the menu field is not fixed size than the width of the menu bar
should depend on the menu item contents so just do the default and
get the Bounds() without any extra resizing.

a61d468c 08-May-2013 John Scipione <jscipione@gmail.com>

BMenuItem: Round to prevent unneeded truncation

The case I fear is if frameWidth is 99.999999 and labelWidth is 100.0
it will attempt to perform a truncation unnecessarily.

e28ba280 06-May-2013 John Scipione <jscipione@gmail.com>

BMCPrivate: Cleanup

Remove no longer needed header includes, most that I recently added
a few that were already there but just aren't needed anymore. Don't
use BPrivate::MenuPrivate namespace.

c1a7e89f 06-May-2013 John Scipione <jscipione@gmail.com>

Put the label truncation code back in BMenuItem.

Just a few commits ago I moved the label truncation code out of
BMenuItem and into BMCMenuBar because the truncation had to happen
outside of BMenuItem. Turns out, that wasn't true so I'm moving the
label truncation back into BMenuItem and removing the _DrawItems()
method from BMCMenuBar.

Note that the code is not a copy of what was there before, but, the
updated version I created for BMCMenuBar. The main difference is that
I use menuPrivate.Padding() instead of GetItemMargins() and I always
use the width of the parent menu frame instead of using fBounds even
if the state is not MENU_STATE_CLOSED. These are changes needed for
BMCMenuBar but should work just as well for a regular BMenu.

c3339662 06-May-2013 John Scipione <jscipione@gmail.com>

Draw truncated menu label in BMCPrivate, fixes #9735

...instead of in BMenuItem and remove the truncation code from BMenuItem.

The label truncation code cannot work in BMenuItem because the super
menu helpfully resizes itself to fit the menu item. So, instead we do the label
truncation in BMCPrivate making sure that BMenuItem there can't expand the
BMCMenuBar because we set the width to fMenuField->_MenuBarWidth()

Note that this only truncates the label in BMCMenuField, i.e. the label inside
the menufield, it does nothing to the labels of the menu items in the attached
BMenu or BPopUpMenu which is exactly what we want.

1afff671 06-May-2013 John Scipione <jscipione@gmail.com>

Set some static variables for magic number constants

4e1b1920 06-May-2013 John Scipione <jscipione@gmail.com>

Refactor BMenuField::DrawLabel()

also use std::max() instead of max_c()

2bf1592a 06-May-2013 John Scipione <jscipione@gmail.com>

Rework layout-enabled contructor for BMCMenuBar

Was passing !fixedSize into the view flags of BMenuBar, which made no sense.
Stop doing that, set fixedSize to true instead.

Remove the fixedSize parameter from this contructor, it's too late for that.

6c145207 06-May-2013 John Scipione <jscipione@gmail.com>

Remove pre-ControlLook drawing code in menu classes

d218f0f8 06-May-2013 John Scipione <jscipione@gmail.com>

Put the BMenuBar initilization on it's own line

d5c51ba6 06-May-2013 John Scipione <jscipione@gmail.com>

Update header comments

d97b4340 06-May-2013 John Scipione <jscipione@gmail.com>

Style fixes to BMenu and related classes.

ddd60371 05-May-2013 John Scipione <jscipione@gmail.com>

Some style fixes in MenuItem

69d85497 04-May-2013 Rene Gollent <anevilyak@gmail.com>

Fix update issues in BStringColumn.

In some cases, BStringColumn wouldn't properly detect that an update was
needed, and would consequently fail to truncate a string as needed with
a column resize.

5041cdf4 03-May-2013 John Scipione <jscipione@gmail.com>

Fix a few minor BMenu issues, follup on hrev45610

Only AttachScrollers() and scroll if B_ITEMS_IN_COLUMN because if not we don't
support scrolling anyway. Also, rename superpoint variable to superPoint.

4898c615 03-May-2013 Jessica Hamilton <jessica.l.hamilton@gmail.com>

BMenu: scroll marked item into view when menu has scrollers attached.

Signed-off-by: Axel Dörfler <axeld@pinc-software.de>

a56ddb2b 02-May-2013 John Scipione <jscipione@gmail.com>

BOutlineListView: Refactor to eliminate repeat vars

The latch width, height and indent width are now all set in one
place in LatchRect() and then LatchRect() is used in multiple places.

bb169747 02-May-2013 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed code path for be_control_look == NULL.
Improve comments.

3bf528b5 01-May-2013 Jessica Hamilton <jessica.l.hamilton@gmail.com>

Fix positioning of BPopUpMenu when a nested item is selected.

Signed-off-by: John Scipione <jscipione@gmail.com>

ecc07039 01-May-2013 John Scipione <jscipione@gmail.com>

Use a static_cast in place of a C cast

01b1b8bd 01-May-2013 John Scipione <jscipione@gmail.com>

BPopUpMenu style fixes

c19cb4dd 01-May-2013 John Scipione <jscipione@gmail.com>

Update BOutlineListView arrows to new style

...from BControlLook, and while I'm at it, use font-relative spacing dimensions.

f3decd20 30-Apr-2013 John Scipione <jscipione@gmail.com>

Fix #9726 Revert CenterIn() and CenterOnScreen()

... back to their previous void returning roles. AlertPosition() is used instead to
check that an alert fits within the sides of the screen and all that.

Also add another CenterOnScreen() method that takes a Screen ID
so you can center a window on another monitor that the one it is currently on
(theoretically someday anyway).

d4d842b4 30-Apr-2013 John Scipione <jscipione@gmail.com>

Style fix in BAlert, some sort of strange spaces got in there

6723d9fc 30-Apr-2013 John Scipione <jscipione@gmail.com>

Create a BWindow::AlertPosition() method and use it

...to position alert's and open/save dialogs nicely inside of the parent window,
or if that is unavailable, the screen frame.

AlertPosition() is private (for now) but BAlert and BFilePanel are BWindow's friends so
BWindow allows those classes to touch it's privates.

e894fbc0 28-Apr-2013 John Scipione <jscipione@gmail.com>

Adjust BAlert to position the alert using the revamped BWindow::CenterIn() method.

BAlert::AlertPosition() has been superceded by the new BWindow method and should
be considered deprecated. Note that the alert position is not in the direct center of the
screen, it is offset vertically like before.

54153cc8 28-Apr-2013 John Scipione <jscipione@gmail.com>

Update CenterIn() and CenterOnScreen() methods in BWindow

* These methods now return the new point after centering.
* But more importantly CenterIn() does some new adjustments to keep the window
position inside the screen edge. If you pass the screen frame into CenterIn()
it skips these adjustments.

65e6ce6d 28-Apr-2013 John Scipione <jscipione@gmail.com>

Style changes in Alert and StyledEdit Find Window

926535ab 25-Apr-2013 John Scipione <jscipione@gmail.com>

Style update to BListView.

Mostly rename msg argument of MessageReceived to message. Also a couple
of pointer style fixes.

83864481 23-Apr-2013 Jérôme Duval <jerome.duval@gmail.com>

ControlLook: fixed wrong conversion to uint32

af84ce79 16-Apr-2013 John Scipione <jscipione@gmail.com>

Rename B_COLOR_WHICH_COUNT to kColorWhichCount

376e5bb6 16-Apr-2013 John Scipione <jscipione@gmail.com>

Set legeneral_ui_info.mark_color to B_CONTROL_MARK_COLOR

50120176 13-Apr-2013 Stefano Ceccherini <stefano.ceccherini@gmail.com>

In case the BMenu is inside a BMenuField, override the items width to
span over the BMenuField's width. Note that if the BMenu is already
wider, we don't shrink it, at least for now.
Fixes #5015.

3ef837fd 12-Apr-2013 Stefano Ceccherini <stefano.ceccherini@gmail.com>

If a submenu was opened, the parent menu tracking loop would continue calling
_HitTestItems() even if the user didn't move the mouse.

429ae1b1 09-Apr-2013 John Scipione <jscipione@gmail.com>

A few more style fixes to ListView and ColorSet, thanks Axel

d45ea792 08-Apr-2013 John Scipione <jscipione@gmail.com>

One more style fix that I missed

63f3755c 08-Apr-2013 John Scipione <jscipione@gmail.com>

Many style fixes to ListView

29ceb649 08-Apr-2013 John Scipione <jscipione@gmail.com>

Style fixes to ListView

17c9912b 07-Apr-2013 John Scipione <jscipione@gmail.com>

Another tweak, make the left diagonal arrows flush left.

This moves the left up and left down arrows 1px to the left so that they are
flush with the left side of the container they're drawn in.

348cd0c5 07-Apr-2013 John Scipione <jscipione@gmail.com>

Tweak the diagonal arrows so they are square

1b41173c 06-Apr-2013 John Scipione <jscipione@gmail.com>

Add diagonal arrows to ControlLook DrawArrowShape() method

33025215 05-Apr-2013 John Scipione <jscipione@gmail.com>

Remove dependence on color constants in ServerReadOnlyMemory.

This fixes a maintainance problem where you have to update this otherwise
unrelated file to keep it in sync whenever you add a color constant.

I've added a B_COLOR_WHICH_COUNT constant to the color_which enum which should
be updated to point to the newest color constants as new ones are added. I
reworked ServerReadOnlyMemory to use this constant instead of using to the
current largest color constant directly. If you use B_COLOR_WHICH_COUNT to
refer to a color in your code expect to get unpredictable and nonsensical
results. Most likely you'll get an undefined result which will return black
but don't depend on it.

The net effect of this is that ServerReadOnlyMemory doesn't need to be updated
anymore when new color constants are introduced but will continue to produce
correct results.

Eliminate kNumColors constant, replace it with B_COLOR_WHICH_COUNT

9f24981a 05-Apr-2013 John Scipione <jscipione@gmail.com>


This allows you to change the scrollbar thumb color in Appearance preferences.
The default color is 216, 216, 216 so the scroll bar thumb looks the same by
default. Perhaps someday this can be updated to something a bit more colorful.

ab21cedc 16-Mar-2013 John Scipione <jscipione@gmail.com>

Remove docs and refactor style of TextView class.

* Make pointer style consistent, const char* name instead of const char *name.
* Lots of parameter renaming.
* in parameters don't get anything special, just font, or length instead of
inFont, inLength.
* out parameters get a leading _ so *outWidth becomes *_width for example.
* We don't detail private function in the Haiku book and this class has a bunch
so keep the documentation in the file but use regular comments instead.
* Normalize the parameter names between cpp file and header.
* Some minor whitespace fixes.

No functional change intended.

ff9b4ff8 04-Mar-2013 John Scipione <jscipione@gmail.com>

Lock BMenuBar::_Track() atomically. Fixes #9481

f44a56ca 03-Mar-2013 Ryan Leavengood <leavengood@gmail.com>

Add back moving the pen to origin in BControlLook arrow drawing.

Removing this did not affect scrollbar arrow buttons, but made the
arrows disappear on the Deskbar.

Clearly, BControlLook cannot be changed without extensive testing.

dca92a6c 03-Mar-2013 Ryan Leavengood <leavengood@gmail.com>

Removed unused colors from BScrollBar Draw.

f9b1a47f 03-Mar-2013 Ryan Leavengood <leavengood@gmail.com>

Use be_control_look for BScrollBar and FakeScrollBar.

Remove all code which checks for be_control_look being NULL.

Also fix the DrawArrowShape method in be_control_look so the arrow is aligned,
as per the previous commit. In addition the code to offset the arrow when the
scroll button is pressed was unnecessary.

There is still some room for improvement, and I am not happy with the
BControlLook behavior here, as noted in some TODOs.

8a920099 02-Mar-2013 Ryan Leavengood <leavengood@gmail.com>

Fix Scrollbar arrow button alignment.

The arrow symbol on the right and down buttons was off by one pixel.

Because of the resurrected FakeScrollbar in the Appearance preflet I had to
change this code in two places, which makes me unhappy. This needs to be pulled
into BControlLook.

Fixes #9104.

49126a0e 03-Jan-2013 Tri-Edge AI <triedgeai@gmail.com>

Added ResourceEdit and modified BColumnListView, BRow and BMenu.

Signed-off-by: Matt Madia <mattmadia@gmail.com>

da179153 24-Feb-2013 John Scipione <jscipione@gmail.com>

Small whitespace fix in MenuBar.cpp

43ee85f6 05-Feb-2013 Axel Dörfler <axeld@pinc-software.de>

BMenuField: fixed broken view color.

* Apparently, I only tested the other case :-)
* This fixes bug #9433.

0a7975bf 04-Feb-2013 Axel Dörfler <axeld@pinc-software.de>

BSlider::SetPosition() now calls BSlider's SetValue().

* Before it directly called the BControl version which doesn't really
make any sense, and prevented visual updates.

39b9d0f0 04-Feb-2013 Axel Dörfler <axeld@pinc-software.de>

BMenuField: use panel background color as default.

* There is no reason the BMenuField should behave differently from
any BControl here.

95a11c76 25-Jan-2013 Adrien Destugues <pulkomandy@gmail.com>

Style fix.

fdb61e98 25-Jan-2013 Adrien Destugues <pulkomandy@gmail.com>

Don't allow setting a scrollbar position to nan.

Since nan != nan, the scrollbar would otherwise try to move the view to
the new position, the view would try to set the scrollbar value again,
and so on.

9c840df0 18-Jan-2013 John Scipione <jscipione@gmail.com>

Woops, I meant == not =

a8f3c5a8 18-Jan-2013 John Scipione <jscipione@gmail.com>

Style fixes only

840476e1 18-Jan-2013 John Scipione <jscipione@gmail.com>

Rename SetFamilyAndStyle variable to code matching the header and BeBook.

c969b462 18-Jan-2013 John Scipione <jscipione@gmail.com>

Put comments in methods, only description line outside

1f7ff051 18-Jan-2013 John Scipione <jscipione@gmail.com>

Style updates and remove docs from cpp file

d45cd469 18-Dec-2012 Janus <janus2@ymail.com>

Fix #9302. The selection is calculated properly after a list insertion (AddList with index)

Signed-off-by: Jerome Duval <jerome.duval@gmail.com>

dc871e32 14-Jan-2013 Przemysław Buczkowski <przemub@yahoo.pl>

TextView:Cmd/Ctrl-Home/End Shift-selection support

Fixes #6859

Signed-off-by: Siarzhuk Zharski <zharik@gmx.li>

a0e655bf 03-Jan-2013 Hamish Morrison <hamishm53@gmail.com>

Fix BWindow::DecoratorFrame for top-titled windows.

Also take into account the border width for the edge with the title.
Fixes #8614.

57ec88b6 21-Dec-2012 John Scipione <jscipione@gmail.com>

Fix build, forgot to replace the variable names after renaming them.

78c12508 21-Dec-2012 John Scipione <jscipione@gmail.com>

Rename the bounds parameter of the BDragger class to frame matching the BeBook

aabb1481 21-Dec-2012 John Scipione <jscipione@gmail.com>

Rename the resizingMask parameter of the BDragger constructor to resizingMode matching the BeBook.

6c6fcaf9 20-Dec-2012 Alex Smith <alex@alex-smith.me.uk>

Some build fixes for DEBUG=1.

74f911be 16-Dec-2012 Siarzhuk Zharski <zharik@gmx.li>

Gently guessing prev. line caret pos on UP_ARROW

Fixes #3656

0d3bd614 16-Dec-2012 Siarzhuk Zharski <zharik@gmx.li>

Do not include CR-terminator in line width-height calculations

Fixes #3658

9e265b33 14-Dec-2012 Janus <janus2@ymail.com>

Fixes #7639 - the redraw issue in ColumListView.

Signed-off-by: Siarzhuk Zharski <zharik@gmx.li>

c077f500 26-Nov-2012 Oliver Tappe <zooey@hirschkaefer.de>

Fix #9217 - BTextView should clamp given offsets to avoid crashes

* applied patch provided with ticket, thanks!
* extended patch to implement offset clamping for all public methods
of BTextView and remove some checks from private methods to define
a clear baseline for sanity of offsets used in the code

02ca2d82 25-Nov-2012 Philippe Saint-Pierre <stpere@gmail.com>

ZombieReplicantView: Dereferrence before NULL check (CID 743868)

63881c3a 24-Nov-2012 John Scipione <jscipione@gmail.com>

Update StringItem use be_control_look->DefaultLabelSpacing()

Also update the Update() method to take into account the added

Thanks Axel and Stippi.

4807bf08 23-Nov-2012 John Scipione <jscipione@gmail.com>

Move StringItem text over 4 pixels.

This is so that it does not get draw flush to the edge of the
list view and there is just a bit of padding between the left
edge and where the text starts. The 4 pixels matches other
places that override the DrawItem() method (like Tracker prefs).

11c9f9a1 18-Nov-2012 Alex Smith <alex@alex-smith.me.uk>

Merge branch 'master' into x86_64


caddc641 15-Nov-2012 Joseph R. Prostko <joe.prostko@gmail.com>

Changes to allow Haiku source to build with GCC 4.7
* GCC 4.7 is more picky than GCC 4.6, so have to make changes accordingly
* Changes include addressing issues with scoping, redeclaration, etc.
Thanks Rene and Ingo for your input on these changes

fcfe60b0 24-Jul-2012 John Scipione <jscipione@gmail.com>

Renamed BMenuScrollView to TScrollArrowView and moved it into Deskbar

Also gave the Up Arrow and Down Arrow a scroll arrow. The up arrow works
but the down arrow doesn't because the sibling menu is stealing the
MouseDown event."

d7b5131b 22-Jul-2012 John Scipione <jscipione@gmail.com>

Set fValue and fLimit to be 0 in the MenuScrollView contructor.

afa1c291 21-Jul-2012 John Scipione <jscipione@gmail.com>

Tweaks, remove dead code. Menu and Menubar are stock again.

7ee3b479 21-Jul-2012 John Scipione <jscipione@gmail.com>

Make the MenuScrollView a fixed size...

instead of trying to make it follow fExpando just make it a fixed
size on creation. It is invisible and extends to the bottom of the
screen. fExpando grows inside it, and the window follows fExpando.
When the window grows taller than the screenframe the arrows are
added. You can scroll with the mouse wheel, but I haven't yet gotten
scrolling to work from clicking. Deskbar still crashes when going
from Mini mode to vertical expando mode. I have no idea why.

49ff476d 19-Jul-2012 John Scipione <jscipione@gmail.com>

Make ScrollMenu not rely on Menu.cpp

Rename ScrollMenu.cpp to MenuScrollView.cpp

Half step towards making this class work as part of Deskbar without
extending any other classes. Scrolling works both with mouse and
scroll wheel. Redraws on scroll, need to make that work better.
Also need to move classes out of the Interface Kit and into Deskbar.

cb55ef9f 27-Jun-2011 John Scipione <jscipione@gmail.com>

WIP: Created a BScrollMenu class that works like BMenuWindow but works on a view instead of a window. Use this to implement a scrollable BarMenuBar in Deskbar. The basics work but there are issues still with sizing and other issues.

Modify the ScrollMenu class to use the layout kit by adding a constructor that doesn't take a view.

Get the BScrollMenu class to follow the size of the BMenu it is a parent of. Adjust the scrollers to appear in the right places. This is a WIP but it works in Deskbar, next step is to integrate this directly into BMenu with the scrollers as children of the menu instead of as children of the BScroller class.

Rebase changes on top of master

Deskbar scrolling works for the most part, just need to fix the
bottom arrow and clean up a bit.

1cd0e20c 06-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Unbroke GCC4 BRect const compatibility.

* This can be removed again next time all GCC4 packages are rebuilt for
whatever reason.

7bcbf187 06-Nov-2012 Rene Gollent <anevilyak@gmail.com>

Optimize column preferred width calculation a bit.

Move calculating the width of the column title itself out to
OutlineView::GetColumnPreferredWidth(). Previously, each pass would
compute the width of both the field itself and the column title,
leading to considerable redundant work. Also, take outline level indent
into account in the resulting width. Should improve performance a bit.

09d87d91 04-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

The text control is now more flexible with its layout items.

* Before, you had to have both, the text view layout item, and the label
layout item or else nothing would ever be visible.
* Now you can only create the text view item, and it will still work.
* Also, no matter the order you added the layout items, they would always
put the label on the left, and the control to the right.
* You can place the label and text view layout items anywhere now, although
you should keep in mind that the view spans over their frame unions; IOW
they should always adjacent to each other, but not necessarily horizontally
and left to right.
* No longer uses a fixed label spacing, but utilizes
BControlLook::DefaultLabelSpacing() instead.
* However, the spacing is always added to the right of the label, no matter
how you place it in the layout. Maybe one wants to add a SetLabelTextViewGap()
like method.

6643ead5 04-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Made the BRect::*Copy() methods const as they should have been.

4656e550 04-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Added method SetExplicitSize() for convenience.

402c3b2c 04-Nov-2012 Oliver Tappe <zooey@hirschkaefer.de>

BTextView uses cmd instead of ctrl for navigation

* Adjust BTextView to use B_COMMAND_KEY instead of B_CONTROL_KEY
for wordwise navigation and jumping to the top and bottom.
This requires a shortcut, which is only installed if there is
none already (for the groups B_LEFT_ARROW/B_RIGHT_ARROW and
B_HOME/B_END). As a result, wordwise navigation no longer works
in Mail, for instance.

0619f34b 04-Nov-2012 Oliver Tappe <zooey@hirschkaefer.de>

Add BWindow::HasShortcut()

21f50d63 03-Nov-2012 Oliver Tappe <zooey@hirschkaefer.de>

Use SHIFT to accelerate scrolling via the bar arrows.

410d1973 03-Nov-2012 Oliver Tappe <zooey@hirschkaefer.de>

Adjust modifier for fast scrolling to match other OSes.

* instead of any of (OPTION, COMMAND, CONTROL), use SHIFT to
trigger accelerated scrolling via the mouse wheel

b5446310 04-Nov-2012 John Scipione <jscipione@gmail.com>

Remove the scroll bar knobs and corresponding setting

a4f0328e 02-Nov-2012 John Scipione <jscipione@gmail.com>

Rename hextent and vextent to knobWidth and knobHeight

dfa8cf8c 02-Nov-2012 John Scipione <jscipione@gmail.com>

Change SCROLL_KNOB_* constants to B_SCROLL_KNOB_*

4b5a6861 01-Nov-2012 John Scipione <jscipione@gmail.com>

Add the scrollbar constants enum to the header.

Also make some minor tweaks in ScrollBar.cpp

51e2ba81 31-Oct-2012 John Scipione <jscipione@gmail.com>

Variable name refactoring. They are knobs, not marks

a0e61cdf 31-Oct-2012 John Scipione <jscipione@gmail.com>

Implement BeOS style scrollbar knobs.

Not hooked up to a setting yet.

5666b4f7 19-Oct-2012 John Scipione <jscipione@gmail.com>

Preserve the clipping constraints of the parent view...

when drawing the following controls:
* SliderBar
* ActiveTab
* MenuField

This is a followup commit based on the change made for buttons in
hrev44708 in response to bug #8700. It is good practice to always preserve
the parent view's clipping constraints.

Stippi and Axel can you you at this commit and make sure this is kosher?


4fa76719 17-Oct-2012 John Scipione <jscipione@gmail.com>

Save and restore button clipping constraints.

This fixes #8700

8e80f8cc 23-Aug-2012 czeidler <haiku@clemens-zeidler.de>

Fix MinSize and PreferredSize.

91c78f09 20-Aug-2012 John Scipione <jscipione@gmail.com>

Create and use new list view item colors


2c1f6c10 20-Aug-2012 John Scipione <jscipione@gmail.com>

Update ListItem's to use menu item colors.

* Unselected text uses B_MENU_ITEM_TEXT_COLOR

Update BStringItem, but also the custom Listitem code in the
Appearance and Locale preflets.

d7f6b4c1 19-Aug-2012 Ryan Leavengood <leavengood@gmail.com>

ControlLook: Don't tint the selected menu item color.

Now that we use the actual selected menu item ui_color, this tinting is not
needed. In fact it makes the selected item too dark.

Thanks diver for noticing.

e688bf23 16-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Merge branch 'master' into x86_64


59347b7f 13-Aug-2012 Ryan Leavengood <leavengood@gmail.com>

Reverse the meaning of BWindow fShowLevel to match BView.

This also matches the client_window_info.show_hide_level field used in Deskbar
and other applications.

While doing this, keep fShowLevel fully in sync between BWindow and app_server,
use one message type for both hiding and showing, and make the decision to show
and hide the window in the app_server.

Lastly make minimize behave as described in the Be Book: hidden windows cannot
be minimized, and minimized windows which get hidden become unminimized.

96cabf58 12-Aug-2012 Ryan Leavengood <leavengood@gmail.com>

Sync BWindow fShowLevel with the app_server.

Implementing the window_info.show_hide_level in terms of this solves the
problem of minimized windows also being considered hidden, when really they are
just hidden in the app_server.

window_info.show_hide_level is still defined backwards with a comment making
that clear.

Also removed sending fShowLevel in the minimize request since it is now
maintained in the app_server.

Fixes #4127.

efffcb29 11-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Better fix for picture data type mismatch.

Should use a fixed-size type (int32) rather than a platform-dependent

e1c748e4 11-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Revert "Fixed type mismatch in picture data."

This reverts commit 81aad168f87486149f6e4ce8acc43e3e7a5de9e1.

ac4525b2 10-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Changed BRegion to use int32 instead of long.

There is no need for fCount and fDataSize to be long, not going to have
more than 2^32 rectangles in a region. Thanks Axel for pointing that

81aad168 10-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Fixed type mismatch in picture data.

The size of an operation block was written as size_t by PictureDataWriter
but read as int32 by PicturePlayer. Fixes an app_server crash.

a5e96a30 09-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Merge branch 'master' into x86_64

6e1a7a15 06-Aug-2012 x-ist <fakeEmail@fakesite.fake>

Fix BTextView tab calculation.

In rare cases such as described in #7955 BTextView happens to calculate the
width of a tab close to zero (e.g. 0.000031). This patch adds a fallback to the
default tab width in that case.

Signed-off-by: Ryan Leavengood <leavengood@gmail.com>

74e28840 08-Aug-2012 Rene Gollent <anevilyak@gmail.com>

64-bit fixes. Gets Debugger fully compiling on x86-64.

c802257b 05-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Merge branch 'master' into x86_64

57c5b09e 05-Aug-2012 Ryan Leavengood <leavengood@gmail.com>

Use be_control_look != NULL everywhere in the Interface Kit.

Should not be a functional change. It is not in the Haiku Coding Guidelines but
I feel like 'if (object != NULL)' is generally preferred to 'if (object)', plus
in this case of be_control_look that is the more common style.

aed35104 05-Aug-2012 Humdinger <humdingerb@gmail.com>

Close alerts with ESCAPE key.

Added SetFlags(B_CLOSE_ON_ESCAPE) or SetShortcut(index, B_ESCAPE) to BAlerts
depending if the result gets used later in the code, or if it's a one-button

3fed1a15 05-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Get app_server working on x86_64.

With this commit, app_server now compiles and runs at boot! Nothing
particularly interesting happens, just the blue background and a mouse
pointer. Remote backends are broken and not compiled in, see #8834.
Note that it won't be possible to build this quite yet, need to get
the FreeType package uploaded.

54393c03 04-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Merge branch 'master' into x86_64

bab4f5ad 03-Aug-2012 Ryan Leavengood <leavengood@gmail.com>

Use the parent menu's font when truncating labels.

Fixes the other bug uncovered by #8829, but my other fix was valid too.

4ffc27fc 03-Aug-2012 Ryan Leavengood <leavengood@gmail.com>

Fix incorrectly truncated menu labels.

An off-by-one error (> instead of >= really) was causing truncation when it
wasn't needed. But for some reason this only showed up when the main font size
was increased. I may or may not look into that, but this fixes the issue.

Maybe one of the faster bug logged to bug fixed times in Haiku history? ;)

0eed2a7c 02-Aug-2012 Ryan Leavengood <leavengood@gmail.com>

Fix flickering menus, especially menu bars.

Figured out by Stephan originally and only hacked in WebPositive, I knew
something about WebPositive was different because it did not flicker when
everything else did.

Since we fully draw the menus there is no need to have app_server fill in the
background with the view color. That is what was causing the flickering.

Should fix #484, #532 and #4335. Thanks diver for confirming the patch against
those tickets.

57e43684 01-Aug-2012 John Scipione <jscipione@gmail.com>

Revert "Remove the ellipses for About App in the replicant menu."

Apparently ellipses are used for all dialog boxes on Haiku.
Sorry for the noise.

Thanks AnEvilYak

This reverts commit 147ef3a9e89c28d64387f4bf645f48453913c3f8.

147ef3a9 01-Aug-2012 John Scipione <jscipione@gmail.com>

Remove the ellipses for About App in the replicant menu.

The ellipsis character (...) after a menu item means that
the command needs more information from the user before
the operation executes.

The ellipsis character doesn’t simply mean that a dialog
box or window will appear.

The window appearing completes the command and doesn’t
require additional input from the user before it executes.

9be774b5 30-Jul-2012 Alex Smith <alex@alex-smith.me.uk>

Compilation and 64-bit fixes to libbe.so sources.

Fixed the usual issues - printf format strings, uint32 instead of
addr_t, etc. One thing that isn't so nice is several places where
BList is used to store (u)int32, these require a double cast to addr_t
then void* to silence a warning on x86_64.

6a03786c 28-Jul-2012 Ryan Leavengood <leavengood@gmail.com>

Draw menus using the user chosen colors.

902a98ad 20-Jul-2012 Rene Gollent <anevilyak@gmail.com>

Fix #8753.

- Store whether or not the use of the horizontal scrollbar is desired
on the class itself. If the CLV was set to use the horizontal scrollbar,
and then asked to lay itself out while hidden, it would incorrectly assume
the horizontal scrollbar wasn't in use, and consequently repositioned its
views such that the horizontal scrollbar and outline view overlapped.

03aa456e 18-Jul-2012 Rene Gollent <anevilyak@gmail.com>

Fix mouse down handling error.

- When handling a mouse click, the button was hardcoded instead of
passing the actual button clicked by the user. Spotted by Chris

ed15f1b8 18-Jul-2012 Rene Gollent <anevilyak@gmail.com>

Fix scrollbar handling when removing rows in BCLV.

- If removing a row results in there no longer being any rows whatsoever
visible, force a scroll back into the visible range. Fixes #8287.

2d428808 13-Jul-2012 Alex Wilson <yourpalal2@gmail.com>

Make SpaceLayoutItem compose spacing using BControlLook.

This allows for passing spacing/inset flags to BSpaceLayoutItem.
Eg. in a builder, you could AddStrut(B_USE_ITEM_SPACING)

4bb5af76 15-Jul-2012 John Scipione <jscipione@gmail.com>

Add control mark color setting. #8054

An enhancement adding a setting to Colors under Appearance to
set the mark color of radio button and check box controls.

975867a4 13-Jul-2012 Rene Gollent <anevilyak@gmail.com>

Fix drawing bug in BStringField.

- If a string column was exactly the correct pixel width for the strings
contained within it, they would skip attempting to truncate the string.
However, the truncated string was always used for final drawing, with
the end result that the fields would be drawn blank. This would sometimes
manifest itself in Debugger where things like ID columns wound wind up
showing no data until one resized the column.

639ac470 12-Jul-2012 Hamish Morrison <hamish@lavabit.com>

BTextView should not accept disallowed chars being pasted.

* Patch from #6885: This filters out any disallowed characters from text
being pasted or dropped in. If the resulting filtered text is zero
characters long, it beeps. Works with styled text too.
* Coding style: variables renaming by korli.

9f5864ab 24-Jun-2012 Ryan Leavengood <leavengood@gmail.com>

Handle the scroll wheel changing over scrollbars.

* Extract the scrollbar change based on the mouse wheel delta into a protected
method of BView.
* Call that method from BScrollBar's MessageReceived.

With this change it is now a bit easier to scroll horizontally around the
system by putting the mouse cursor over a horizontal scrollbar and using the

Fixes #8631.

bea2387b 01-Jun-2012 Axel Dörfler <axeld@pinc-software.de>

Made constants static, coding style cleanup.

875b2182 09-May-2012 czeidler <haiku@clemens-zeidler.de>

Calling the BView version of {Enable,Disable}LayoutInvalidation() seems to be more natural.

31f76857 09-May-2012 czeidler <haiku@clemens-zeidler.de>

The layout checks the target view now if the layout invalidation has been disabled in the view.

58f3387d 08-May-2012 czeidler <haiku@clemens-zeidler.de>

Workaround to not trigger a relayout in DoLayout when adding the label view again.

c645f9bc 04-May-2012 John Scipione <jscipione@gmail.com>

Rework tooltip method in BView again.

Passing NULL or a blank string to SetToolTip(const char*) sets the
tooltip to NULL by calling SetToolTip(BToolTip*) with a NULL argument.

Calling SetToolTip(BToolTip*) with a NULL argument calls HideToolTip()
because sometimes the tool tip can change without the mouse moving,
for example because the user clicked.

Thanks Axeld and Stippi.

5ccf455f 03-May-2012 John Scipione <jscipione@gmail.com>

Fix another tooltip related bug that appears in Deskbar.

The bug is that in horizontal mode the tooltip will remain set to
the last moused over team menu item even if the mouse is no longer
over a menu item. The bug can be seen in the following screenshot:


To fix this bug, allow you to set the tooltip text to blank or NULL
in SetToolTip(const char* text). In ShowToolTip() check to see if
the tooltip text is blank or NULL and if so, don't show the tip.
Setting the tooltip to blank or NULL effectively unsets the tooltip
on a view.

4daa7647 02-May-2012 John Scipione <jscipione@gmail.com>

After setting the tooltip text, invalidate the layout.

This fixes a bug introduced in hrev44075 (I think) where the internal
tooltip window wouldn't resize itself after setting new tooltip text.
So if you set the tooltip to a short string then set it to a long
string the tooltip would get cut-off or if you set it to a long string
and then set it to a short string the tooltip window would be too wide.
The result can be seen in Deskbar in the following screenshot:


After invalidating the layout the internal tooltip window gets resized

7f7f5eac 02-May-2012 John Scipione <jscipione@gmail.com>

Refactor ToolTipManager a bit.

* Change ShowTip() point parameter name to where.
* Add a parameterless ResetWindowFrame() overload that get's the current
where and calls ResetWindowFrame(BPoint where) which does the actual
work. FrameResized() calls this parameterless ResetWindowFrame()
method instead of doing the work in that method. This is functionaly
the same but allows me to call the parameterless ResetWindowFrame()

a937ffd2 30-Apr-2012 czeidler <haiku@clemens-zeidler.de>

Make the menu window not resizable.

Right clicking the menu border showed the resize arrow and sometimes even made it possible to resize the menu.

8e2140fa 29-Apr-2012 Axel Dörfler <axeld@pinc-software.de>

Fixed a large client side memory leak for app_server memory.

* The areas allocated for BBitmaps were never deleted, even though the
app_server deleted its part when the memory got freed.
* This resulted in a constant memory increase if the application in question
would operate on many changing large bitmaps, like photos.
* Since the bitmaps are reference counted, we don't actually know when to delete
the areas, so that the app_server now notifies the client whenever that is
* This might fix #6824.

2f2f3fa0 28-Apr-2012 Axel Dörfler <axeld@pinc-software.de>

Moved stable tool tip concept into the BToolManager class.

* This removes the fVisibleToolTip member from BView, and fixes bug #5669;
BToolTipManager::ShowTip() now gets the owner of the tool tip as an extra
* Removed the work-around to hide that bug.
* Improved ToolTipTest application to include more test cases like a view that
periodically update its tool tip via SetToolTip(const char*), and one that
sets a new tool tip every second.
* Furthermore, added a test that shows that inner views inherit the tool tip
of their parents.
* Fixed another bug in BToolTipManager::ShowTip() that would release an
extra reference to the tool tip currently shown.

254640bf 17-Apr-2012 Axel Dörfler <axeld@pinc-software.de>

Remove the tool tip if an empty or NULL string is set.

41651bb3 17-Apr-2012 John Scipione <jscipione@gmail.com>

Small code simplication cleanup and add comment.

88969219 17-Apr-2012 John Scipione <jscipione@gmail.com>

Fix Deskcalc drawing rounded corners on the desktop as a replicant, although I am not sure why I'm even bothering at this point.

546208a5 16-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

More catalog-related cleanup.

* adjust all uses of both macros in Haiku's source tree
* use correct header guard for collecting/Catalog.h

The renamed macros require adjustments to all external applications
using catalogs.

3244c2bc 16-Apr-2012 John Scipione <jscipione@gmail.com>

Whoops, remove constraints after drawing slider bar.

a884b43b 19-Mar-2012 John Scipione <jscipione@gmail.com>

Added support for buttons and menuframes with rounded corners.

* Not turned on for default buttons and menuframes right now.
* Updated Deskcalc and Keymap to use buttons with rounded corners.
* Overloaded methods with radium parameters are not virtual right
now so as to not break vtables. Added /*virtual*/ before each
method that should be made virtual in ControlLook.h
* Added a light line to the left border of the down arrow frame
on menu frames as a small visual tweak.
* Replace StrokeRect() with StrokeRoundRect() when drawing the
default button indicator. This gives them a rounded
appearance if the button is also rounded.
* Added protected methods _DrawMenuFieldBackgroundOutside and
* Created some protected methods to get the edge, frame, and bevel
colors from a passed in base color because it was a mess and I
needed to calculate the colors from mutiple methods. It is much
cleaner now.
* Added myself to ControlLook.cpp authors list. Assigned copyright
to Haiku, Inc. Stippi also retains his copyright.
* Tons of style fixes.
- Change all instances of `if (flags & B_FLAG)` to
`if ((flags & B_FLAG) != 0)`
- Reorder some methods.
- Reorder includes.
- Spacing.
- Updated comments.

248f2283 15-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

Final part of cleanup in Catalog.h.

* move versions of the B_TRANSLATE_...-macros used during collecting
of catalog keys to a specific header file, which will only be picked
up when running collectcatkeys
* fix a couple of build problems during the preprocessing of the libbe-
sources when extracting catalog keys, all due to private headers not
being found
* move ZombieReplicantView.h from kits/interface to
headers/private/interface, as this way it can be picked up when
building the libbe catalog

a2bea84d 15-Apr-2012 John Scipione <jscipione@gmail.com>

Override the LayoutAlignment method in BStringView.

Left align StringViews using layout API by default falling back
to the alignment settings set by SetAlignment() only if
SetExplicitAlignment() is not used.

This way StringViews are left-aligned by default, can be changed
using the Layout API, and the pre-Layout API legacy method is used
as a fallback.

See this thread for details:

eaa5e093 14-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

Fix #8452 (app's crashing for non-existent system catalog)

* make the system catalog a BCatalog instead of a BCatalogAddOn*,
such that using a non-existing system catalog won't crash but
simply return the untranslated string instead
* rename MutableLocaleRoster::GetSystemCatalog() to LoadSystemCatalog()
and adjust it to use BCatalog::SetTo() in order to replace the
data used by the given catalog
* adjust all users of gSystemCatalog accordingly

3cee15aa 28-Mar-2012 John Scipione <jscipione@gmail.com>

Keymap changes from recent activity. No AltGr yet.

Below is a mostly complete summary of the changes in this commit.

* Set the DeadKeys for the US-International Keymap to use the Option map.
* Rename American keymap to US
* Update the US, US-International, and United-Kingdom keymaps to take
out unneeded spaces in the option layer. Also updated the dead keys
and some other keys on the US-International keyboard to use UTF-8
characters rather than there ASCII equivalents when different.
* Make the Option key fall-through when there is no mapping in the Option
table. Option is for special characters, if none, print the regular one.
This is mostly meant for the US keymap which has an empty option map. But
also so that you don't have to repeat the normal, shift, and caps maps in
the option map needlessly. Although the keymaps are still not empty in
some cases that it could be like numpad keys and space.
* Update the /bin/keymap app to use fputs() instead of printf() when there
is no actual formatting taking place. I've gotten into trouble for doing
this before and it is faster to not process the string unnecessarily.
* Also several 80-char limit style fixes and updated comments.
* In Keymap class Reorder the modifier keys to match the keymap files.
Put B_CONTROL_KEY check above B_OPTION_KEY. Neither change has any effect,
they are purely aesthetic.
* Update DumpKeymap() method to use the abbreviated modifier letters so it
will fit in your 80-char wide terminal.
* Tiny style fix in InputServer
* 80-char limit style fix in BWindow and add a comment that the shortcut
gets eaten in the case of Cmd+Q
* Implement IndexForModifier() in KeyboardLayout, although I am not using it.
* Take Caps Lock out of the Modifier keys window because I couldn't get
it to work the way I wanted it to.
* Move key roles to the left column, and the key label on the left. Add column
header labels. Thanks Rimas!
* Add validation and improve marking menu options. Add a 'Disabled' option
to control, option, and command menus to disable the key. Make the key
role text grey if the key roles is disabled. Validation ensures that you
cannot repeat the same key twice in the Modifier keys window since that
won't work. You can't define 2 sets of option keys even if you really want
to. You can disable your control, option, and command keys if you
want, but that is not recommended.
* Rename kUpdateModifiers to kUpdateModifierKeys message to differetiate
it from kUpdateModifier.
* Add shift key to Modifier keys window, use the stop icon instead of the
warning icon to indicate conflicts.
* Allow the Layout system to control the size of the Modifier keys window
again, set the width's of the key role lables to the widest, set the width
of the menu fields to take up the rest of the space minus room for the
conflict views. I didn't like it that the Modifier keys window would change
size based on what options you had selected in the menu fields. Now it
doesn't, but, the layout system still makes it all fit.

60f75e90 04-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

Merge liblocale.so into libbe.so.

* Make the locale kit a part of libbe.
* Drop the LocaleBackend kludge used from within libbe (and from
other places, too) in order to access system catalog strings.
This is now done via gSystemCatalog, which is provided and initialized
by libbe.
* Drop all references to liblocale.so from all Jamfiles.
* Add legacy symlink liblocale.so in order to keep optional packages
that rely on it in a working state.

TODO: the documentation hasn't been updated.

577265d1 31-Mar-2012 JackBurton <stefano.ceccherini@gmail.com>

Avoid calling BMenu::HitTestItems() if the cursor is over a submenu.

54687869 11-Mar-2012 JackBurton <stefano.ceccherini@gmail.com>

Merge branch 'master' of ssh://git.haiku-os.org/haiku

8f5079af 03-Mar-2012 Rene Gollent <anevilyak@gmail.com>

When changing the tab height, also update the layout insets if needed.

Fixes #8374.

92894183 03-Mar-2012 JackBurton <stefano.ceccherini@gmail.com>

Fix Indentation

417c123c 03-Mar-2012 JackBurton <stefano.ceccherini@gmail.com>

Fix indentation

41836758 02-Mar-2012 Rene Gollent <anevilyak@gmail.com>

Move black/white color constant definitions to header.

Previously, there were two instances of the actual variables, named in
ControlLook.cpp and Utilities.cpp. This caused clashes on gcc4 builds, leading
to various crashes during initialization. Instead we now declare them as
static constants in the header itself as is done for various other interface
color constants elsewhere. Fixes ticket #8358.

d452ff66 26-Feb-2012 Axel Dörfler <axeld@pinc-software.de>

Added some reserved fields to BControlLook.

* This makes future changes less troublesome, although we should also add
some virtual slots there (probably just dozens of it, though, that's why
I was being lazy).
* Don't pass messages by value; they are copied twice this way.
* Minor coding style corrections, automatic whitespace cleanup.

8adaa6c5 26-Feb-2012 Jerome Duval <jerome.duval@gmail.com>

interface kit: added compatibility symbols for GCC4

* InvalidateLayout method for BBox, BButton, BCheckBox, BMenuField,
BScrollView, BSlider, BStringView, BTextControl.

44c991ef 25-Feb-2012 Jerome Duval <jerome.duval@gmail.com>

interface kit: added compatibility symbol for BeAE

* added _ZN9BTextView16InvalidateLayoutEb for GCC4

7327891c 25-Feb-2012 Jerome Duval <jerome.duval@gmail.com>

interface kit: added compatibility symbols for BeAE for #8354

* _ZN5BMenu16InvalidateLayoutEb for GCC4
* InvalidateLayout__7BSliderb for GCC2

d63b75fa 22-Feb-2012 Philippe Saint-Pierre <stpere@gmail.com>

Outline of labels/strings drawn to desktop

* Rather than duplicating the decision taking logic involving wheter or not to draw
the outline or glow in every replicant, update be_control_look to make it more
* The Monitoring of the background preferences is now only done in Tracker (where it
was already being done).
* Add a BControlLook::B_IGNORE_OUTLINE flag to avoid this new behaviour.
* Remove that said logic from ActivityMonitor and use be_control_look.
* Use the ignore flag in DeskCalc to avoid the outline in its case.

Should fix #7716, #7291.

9d46237b 19-Feb-2012 Jérôme Duval <jerome.duval@gmail.com>

TabView.cpp: Use B_IF_GCC_2 to simplify things

7e2730f0 19-Feb-2012 Ingo Weinhold <ingo_weinhold@gmx.de>

View.cpp: Use B_IF_GCC_2 to simplify things

48d21c12 19-Feb-2012 Jérôme Duval <jerome.duval@gmail.com>

added BView::_ReservedView12() symbol for GCC4

* added _ZN5BView15_ReservedView12Ev
* helps with #8336

3e2017d2 11-Feb-2012 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Some cleanup in interface kit. From unused code warnings (before I updated buildtools).

1b6bc267 08-Feb-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

kits: Some spelling cleanup of common mistyped words

* Little whitespace cleanup
* No functional change

958ac01d 21-Jan-2012 czeidler <haiku@clemens-zeidler.de>

Reconnect window and recreate all views.

40c34878 21-Jan-2012 czeidler <haiku@clemens-zeidler.de>

Reconnect BPicture to the app_server.
* maintain a list of all BPictures to do so
* BView downloads the BPicture data after recording the picture. This could probably done more efficiently using shared memory in the first place.

577f5876 21-Jan-2012 czeidler <haiku@clemens-zeidler.de>

Make it possible to reconnect BBitmap to the app_server.
* maintain a list of all BBitmaps
* refactor the client memory allocator class, its possible now to just clone existing client area

7cd8f5f9 02-Jan-2012 Philippe Saint-Pierre <stpere@gmail.com>

TextView: initialize buttons variable

CID 10751.

981c729b 28-Dec-2011 Alex Wilson <yourpalal2@gmail.com>

Fix potential uninitialized variable bug in BLayout::AllUnarchived().

BMessage::GetInfo() doesn't set the count output var in error cases.

9f029231 28-Dec-2011 Alex Wilson <yourpalal2@gmail.com>

Fix typo in BLayout::AllArchived().

BLayout::AllArchived() was forwarding to BArchivable, skipping BLayoutItem.

f1e81e61 28-Dec-2011 Alex Wilson <yourpalal2@gmail.com>

Fix bug in BLayout::RemoveView().

Fix typo-induced bug causing (in many cases) the wrong item to be removed from the layout!
Also, improve performance from O(n * m) to O(n), although n and m will always be quite small in practice, we might as well.

61084e53 22-Dec-2011 Alex Wilson <yourpalal2@gmail.com>

Remove clamping in new BSplitLayout methods.

Since clamping the index for these methods could lead to confusing side effects, we'll just avoid the clamping, and let things segfault when the programmer goes out of bounds.

Closes #7902

f6c8d242 19-Dec-2011 Rene Gollent <anevilyak@gmail.com>

Use the correct perform invocation for these functions.

c8df0c9b 18-Dec-2011 Rene Gollent <anevilyak@gmail.com>

BePDF needed this one to be added as well.

466f2b8f 18-Dec-2011 Rene Gollent <anevilyak@gmail.com>

Add compatibility symbols for removed LayoutChanged() calls.

a84e14ca 15-Dec-2011 Alex Wilson <yourpalal2@gmail.com>

Merge branch 'master' of git://github.com/haiku/haiku

0e35d5d2 12-Dec-2011 John Scipione <jscipione@gmail.com>

Change instances of wether in comments to whether. No functional change intended.

76375d68 10-Dec-2011 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Point don't use any math functions.

29ef6eb5 08-Dec-2011 Alex Wilson <yourpalal2@gmail.com>

Fix BMenu behaviour/ABI by reinstating BMenu::InvalidateLayout()

It turns out,this is an old method added by Be, and is not really related to BView::InvalidateLayout(bool). In fact BMenu::InvalidateLayout() does something separate, but related to the BView method. I was wrong to delete this method, since it needs to have action taken each time it is called, so moving these actions into LayoutInvalidated() only worked sometimes (when the BView was considered to have a valid layout).

I have added a comment for future hackers so that they don't delete this method.

ea0a06e2 06-Dec-2011 Alex Wilson <yourpalal2@gmail.com>

Remove redundant checks for fParent before calling _InvalidateParentLayout().

8eec72dc 06-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Use safe length measure function and fix length usage.

* We may get non-terminated strings so we need to use the
UTF8NextCharLen() version that works with a length. Previously we may
have read beyond buffers, possibly leading to crashes.
* Also the length parameter is used as an actual length and not as
buffer size. The length check was wrong before, which resulted in the
function returning too early if an offset was supplied.
* Added a comment about the guaranteed 0 termination in one case.
* Minor cleanup.

9f65f3dd 06-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Rename variable so it is clear what is measured (bytes).

fb3c47eb 06-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Fix passing non-terminated string to font functions.

The string that is built for hashing the escapements for missing
chars was not 0 terminated, leading to accesses past the string.
Depending on what followed an allocation that could lead to too long
strings being sent to the app_server for evaluation (where, due to
defensive, programming nothing bad would actually happen). In the
unfortunate case that nothing followed the allocation (i.e. end of
heap area), it could also lead to an application crash.

Therefore ensure 0 termination of the string, check for allocation
failure and use memcpy() instead of a for loop to copy the bytes from
one string to the other.

182e2ee9 01-Dec-2011 Alex Wilson <yourpalal2@gmail.com>

Add a bit more FBC stuff for the Layout API, which I missed before.

d56e7bd6 01-Dec-2011 Alex Wilson <yourpalal2@gmail.com>

Make archiving hooks protected in layout classes.

* remove a stray blank line in Layout.cpp
* make BLayoutItem::SetLayout() private, as it should have been

f98f5ca4 01-Dec-2011 Alex Wilson <yourpalal2@gmail.com>

Fix bug in BView::RemoveSelf() that lead to a segfault.

Once again, the BObjectList removal behaviour leads to a null dereference. It's my fault of course, but there you have it. Comments have been included for future devs.

7b27c8fc 17-Nov-2011 Rene Gollent <anevilyak@gmail.com>

Adjust method naming.

6beb27d4 16-Nov-2011 Rene Gollent <anevilyak@gmail.com>

Add {Get,Set}ItemVisible() accessors and setters.

6d16dcfa 16-Nov-2011 Rene Gollent <anevilyak@gmail.com>

Add GetCollapsible() accessor to BSplitView/Layout.

30d17caa 28-Oct-2011 John Scipione <jscipione@gmail.com>

Added support for colored window tabs in the default decorator.

221f5018 11-Nov-2011 Rene Gollent <anevilyak@gmail.com>

Revert part of r43166 that was included accidentally. This resulted in
incorrect behavior while processing certain kinds of messages, and
consequently deadlocks in some apps. Fixes #8101.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43237 a95241bf-73f2-0310-859d-f6bbb57e9c96

8abe72fb 06-Nov-2011 John Scipione <jscipione@gmail.com>

Changes the menu key bitmap from CTL to CTRL and SHFT to SHIFT.

This is coming from but does not close #7967

Adds a new (currently unused) Menu key bitmap.

Instead of having a single AltAsCommandKey() method the menus now
show the correct bitmap when you switch between your control,
windows/option, and alt/command keys. This is really not flushed
out yet since it only works when you switch those keys and not
other combinations like say switching the control and caps lock
keys but it is a step in the right direction.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43205 a95241bf-73f2-0310-859d-f6bbb57e9c96

53617d36 05-Nov-2011 Alex Wilson <yourpalal2@gmail.com>

Override a bunch of methods in layout related classes for FBC stability.

* Especially made sure to override archiving methods, since these are called rarely, so the cost is very minimal
* Otherwise, the closer a class is to a base class, the more likely I was to give it all the overrides.

0c8b758c 05-Nov-2011 Alex Wilson <yourpalal2@gmail.com>

Add a BView::LayoutChanged() method, called after layout of this view and children.

Fixes #7683.

fceb7ee2 04-Nov-2011 Alex Wilson <yourpalal2@gmail.com>

Add FBC padding + Perform() methods to GridView and GroupView.

We probably won't need these, but these additions are cheap.

85c30aec 03-Nov-2011 Rene Gollent <anevilyak@gmail.com>

Remove extraneous code with respect to telling a menu to close which was
breaking various cases where menus coexisted in a window with a view which
was using event masks:
- If one invoked the menu via, e.g. a BMenuField, and then tried to choose
an item on it, the mouse down would get captured, the menu would be
closed, and the mouse event would be thrown away without ever reaching
the event mask view.

- Furthermore, since the menu was told to terminate early, it would decide
that the user hadn't actually chosen that item (the escape key case),
and never actually invoke it.

Fixes the menu fields in the mouse preflet being broken.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43166 a95241bf-73f2-0310-859d-f6bbb57e9c96

0d973a90 02-Nov-2011 Rene Gollent <anevilyak@gmail.com>

Add CountItems() convenience function to BSplitView.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43138 a95241bf-73f2-0310-859d-f6bbb57e9c96

8151838e 02-Nov-2011 Alex Wilson <yourpalal2@gmail.com>

Add FBC padding to all (I think..) of the visible Layout related classes.

a851b3ad 31-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Add Perform() methods to all the layout-related classes that needed them.

14ac1ee9 31-Oct-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Tweak the notification window again :
* Spacing of the bprogressbar is now 8pixels on each size
* Remove the useless window tab for now

Also fix DecoratorFrame() again as BORDERED_WINDOW didn't work with it either.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43034 a95241bf-73f2-0310-859d-f6bbb57e9c96

1ea897d0 31-Oct-2011 Rene Gollent <anevilyak@gmail.com>

Should have been part of yesterday's Deskbar changes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43019 a95241bf-73f2-0310-859d-f6bbb57e9c96

1326b9d0 29-Oct-2011 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Apply the patch by jscipione on ticket #7994.

* Update BScreen class style and variable names
* Remove documentation from Screen.cpp file
* Create Screen.dox documentation file

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42984 a95241bf-73f2-0310-859d-f6bbb57e9c96

9e9698bc 22-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Delete scratch files that weren't meant to be commited...

e7b0dc78 22-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Now that child classes aren't overriding the various InvalidateLayout() methods, we can take advantage of some guarantees to simplify/clean/optimize the layout invalidation propagation mechanisms!

c74faed4 22-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Add BLayoutItem::LayoutInvalidated() hook. Leave BLayoutItem::InvalidateLayout() (and therefore BLayout::InvalidateLayout()) virtual. This is needed to let BLayout override it for invalidation propagations.

61eb1f1d 22-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Replace remaining InvalidateLayout()'s with LayoutInvalidated(). Also do a bit of cleanup/move methods around.

eee4243d 20-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

De-virtualize BView::InvalidateLayout() and introduce LayoutInvalidated() hook, like BLayout.

b38ea98f 16-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Devirtualize BLayout::InvalidateLayout(), add a protected hook BLayout::DoLayout(). This will allow for much better control over the propagation of layout invalidations, and therefore cleaner, more optimal code.

449f014b 16-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Fix typo in BLayoutItem::SetLayout() which led to passing the wrong layout to the DetachedFromLayout() hook.

f87e4c73 16-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Fix bug in Layout.cpp's ViewRemover struct. operator() didn't deal well with NULLs.

90e61567 12-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

Fix a bug in BLayout::AddItem() where the right conditions + an error would have
caused the wrongful removal of a BView from its parent.

4e0131f5 09-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

Rename BLayout::DerivedLayoutItems() to DoLayout(), which is consistent with BView::DoLayout(). Also adjusted child classes and documentation.

cc1ca167 09-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

Fix a memory leak I introduced with my modification of BLayout::RemoveItem() and add comments so that it doesn't happen again. Also resolve some TODOs on the appropriate timing of calls to hook methods in BLayoutItem/BLayout.

fa01d084 08-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

User BView's layout item tracking functionality to simplify and optimize some methods in BLayout and BView.
Delete BLayout::RemoveViewRecursive() as it is no longer needed.
Add a few TODO's.

30b07d01 08-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

Use the classes from AutoDeleter.h to improve BLayout::AddView() and to simplify the ViewRemover struct created for BLayout::AddItem().

ea907ab5 08-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

Use BView's ability to track what layout items reference it to simplify BLayout::IndexOfView(). This also changes the semantics slightly, but I think it is a logical change.

bd97b9ad 07-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

Add a BObjectList<BLayoutItem> to BView::fLayoutData that keeps track of any BLayoutItems that refer to this view that are part of a layout. BLayoutItem does the registering/deregistering of the items, and BView::Private proxies fLayoutData for us. Currently, this is not used anywhere, but there are many places where it will be used soon.

edb4c824 06-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

Add a method to BView::Private that calls BView::_RemoveSelf().
Add a struct to kits/interface/Layout.cpp that uses BView::Private to
provide RAII mechanics for the removal of views (calling
Use the new struct to simplify BLayout::AddItem().

3f0171ff 29-Sep-2011 Axel Dörfler <axeld@pinc-software.de>

* Minor cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42781 a95241bf-73f2-0310-859d-f6bbb57e9c96

7ba0381d 21-Aug-2011 Oliver Tappe <zooey@hirschkaefer.de>

* add protected accessor for baseline offset to StringItem, as that value is of
interest to derived classes

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42665 a95241bf-73f2-0310-859d-f6bbb57e9c96

ee298c8b 06-Aug-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Fix DecoratorFrame() for kLeftTitledWindowLook windows
* Use it in notification window for better positionning.
Thanks augiedoggie for reporting the problem !

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42588 a95241bf-73f2-0310-859d-f6bbb57e9c96

77f593de 04-Aug-2011 Jérôme Duval <korli@users.berlios.de>

Patch from X512 (ticket #7408): Don't notify input server of focus change if window is not active.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42574 a95241bf-73f2-0310-859d-f6bbb57e9c96

b0b4ce7e 03-Aug-2011 Jérôme Duval <korli@users.berlios.de>

Patch from X512 (#7408): only send input method aware messages for active windows

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42557 a95241bf-73f2-0310-859d-f6bbb57e9c96

2dae355e 31-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Fix window stack api and Desktop::WindowForClientLooperPort lock assert.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42526 a95241bf-73f2-0310-859d-f6bbb57e9c96

3a850e1a 25-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Remove empty line, thanks Axel!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42488 a95241bf-73f2-0310-859d-f6bbb57e9c96

c0dad949 24-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

BRect's OffsetBy takes a BPoint. Add a similar BRegion method to be more consistent. This one takes a const reference instead a complete BPoint object.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42476 a95241bf-73f2-0310-859d-f6bbb57e9c96

d316dc57 14-Jul-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Remove over-optimization trying not to redraw the background under slider's thumbs.

This gets sliders with custom, non-rectangle thumbs, like the one in APlayer or the example in the BeBook, working properly.
I hope it doesn't break anything - it doesn't seem to but I may have overlooked some pixels.

Fixes #7817.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42425 a95241bf-73f2-0310-859d-f6bbb57e9c96

8c5a0acc 24-Jun-2011 Axel Dörfler <axeld@pinc-software.de>

* Do not reserve memory when the area is too large. This fixes #7740 where the
reserved amount was simply too small, but also works around address space
waste with many larger bitmaps.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42298 a95241bf-73f2-0310-859d-f6bbb57e9c96

d90a465e 17-Jun-2011 Alex Wilson <yourpalal2@gmail.com>

Change the value of other spacing/inset constants so that B_USE_DEFAULT_SPACING has its own unique value. Also adjust BControlLook::ComposeSpacing() to reflect this.
closes #7447

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42222 a95241bf-73f2-0310-859d-f6bbb57e9c96

32a44923 14-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

* Use B_PRI* macros.
* Automatic whitespace cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42176 a95241bf-73f2-0310-859d-f6bbb57e9c96

94af9087 12-Jun-2011 Alexandre Deckner <alex@zappotek.com>

* Fix #6548. Don't initially Hide() if already hidden, otherwise the showlevel
would never get a chance be visible again.

When instanciated from an archive, a BDragger restores its
BView::fShowLevel and thus can already be hidden if archived while hidden.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42137 a95241bf-73f2-0310-859d-f6bbb57e9c96

2a55b919 12-Jun-2011 Rene Gollent <anevilyak@gmail.com>

Revert r42120.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42121 a95241bf-73f2-0310-859d-f6bbb57e9c96

b52c7c59 11-Jun-2011 Rene Gollent <anevilyak@gmail.com>

Remove unnecessary calculations from BListView::ScrollToSelection(). At least I
see no useful purpose to the distinction made here.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42120 a95241bf-73f2-0310-859d-f6bbb57e9c96

813147df 09-Jun-2011 Alex Wilson <yourpalal2@gmail.com>

* Add new SetInsets() methods to BTwoDimensionalLayout, BSplitView
* Also add equivalent methods to the layout builders in LayoutBuilder.h
* BSplitView now calls BControlLook::ComposeSpacing(), instead of BSplitLayout
* part of #7447

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42077 a95241bf-73f2-0310-859d-f6bbb57e9c96

6648dd3c 07-Jun-2011 Alex Wilson <yourpalal2@gmail.com>

* Add new spacing/inset constants for the layout API. For now, leave B_USE_DEFAULT_SPACING, but this will go soon.
* Rename BControlLook::ComposeItemSpacing() to ComposeSpacing(), and extend it to handle the new constants.
* Adjust users of BControlLook::ComposeItemSpacing() accordingly.
* part of #7447

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42025 a95241bf-73f2-0310-859d-f6bbb57e9c96

e750d35c 06-Jun-2011 Stephan Aßmus <superstippi@gmx.de>

Applied patch by Pete Goodeve from ticket #7182. It improves
keyboard navigation/tracking of BMenus and BMenuBars, although
many issues remain.
Should not yet go into alpha, since there is one issue which
I am not sure if it's not a regression. The issue is that
invoking a menu item with Enter for the first time seems to
have no effect, while invoking it subsequently works as
expected. I don't know, yet, if that's a regression of this patch.
In any case, it's better than before, thanks, Pete!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42004 a95241bf-73f2-0310-859d-f6bbb57e9c96

f3997b74 03-Jun-2011 Stephan Aßmus <superstippi@gmx.de>

Applied patch by Pete Goodeve (with small coding style corrections)
which fixes vertical BSliders. (ticket #7548) Thanks a bunch!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41881 a95241bf-73f2-0310-859d-f6bbb57e9c96

48ae3e38 27-May-2011 Axel Dörfler <axeld@pinc-software.de>

* Followed Ingo's suggestion, and added a BWindow::Layout() method.
* Changed ShowImage to use that function.
+alpha in case Ingo gives his okay :-)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41782 a95241bf-73f2-0310-859d-f6bbb57e9c96

245423b1 22-May-2011 Alex Wilson <yourpalal2@gmail.com>

Remove unused method from CollapsingLayouter class.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41660 a95241bf-73f2-0310-859d-f6bbb57e9c96

c329950c 21-May-2011 Axel Dörfler <axeld@pinc-software.de>

* Put the decor stuff in the BPrivate namespace, as it should have been from
the beginning.
* Added header for the get_decorator() functions and friends.
* Minor coding style cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41638 a95241bf-73f2-0310-859d-f6bbb57e9c96

8102d8b3 20-May-2011 Stephan Aßmus <superstippi@gmx.de>

When cleaning up the patch, I accidentally removed some functionality
which I misunderstood. setdecor can now refer to decorators by their
short (i.e. file system) name as well.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41602 a95241bf-73f2-0310-859d-f6bbb57e9c96

b46615c5 19-May-2011 Stephan Aßmus <superstippi@gmx.de>

Applied patch by Joseph "looncraz" Groover from ticket #7445.
This changes how Decorators are managed and applied. The app_server
no longer scans and maintains the available ones himself, but is
simply asked to load a Decorator add-on from a provided path.
The Decorator scanning is moved into DecorInfo and DecorInfoUtil,
private classes in the InterfaceKit. The bin command 'setdecor'
uses those.
I cleaned up all the coding style violations that I could find,
removed chunks of code which didn't make sense (if you never put
a NULL pointer into a list, you don't need to check for this and
so on) and also cleaned up other passages for improved clarity
and simplicity.
I also tested the functionality and it works fine. Would even be
Ok to include in Alpha 3, IMHO. Thanks for the patch!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41581 a95241bf-73f2-0310-859d-f6bbb57e9c96

4296233f 06-May-2011 Axel Dörfler <axeld@pinc-software.de>

* Made the messed up BMessage* constructors private - since it only affects the
layout API, we probably can just phase it out after a while.
* Introduced new constructors, and added missing flags to one of them to make
it more convenient to use.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41350 a95241bf-73f2-0310-859d-f6bbb57e9c96

5e5a8daf 15-Apr-2011 Alex Wilson <yourpalal2@gmail.com>

Update CollapsingLayouter to fix crashes in a few applications. All these crashes were related to empty layouts. Fixes some of #7446

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41256 a95241bf-73f2-0310-859d-f6bbb57e9c96

de667551 14-Apr-2011 Alex Wilson <yourpalal2@gmail.com>

Add a new layouter 'CollapsingLayouter', which is used by BTwoDimensionalLayout to collapse empty rows or columns. Update BGridLayout so that empty rows/columns are given min/max constraints of B_SIZE_UNSET by default, which allows them to be collapsed. Fixes #6979

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41252 a95241bf-73f2-0310-859d-f6bbb57e9c96

73f559a4 13-Apr-2011 Jonas Sundström <jonas@kirilla.com>

Move IconView from kits/interface to kits/shared.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41246 a95241bf-73f2-0310-859d-f6bbb57e9c96

4b428674 12-Apr-2011 Jonas Sundström <jonas@kirilla.com>

Make DataTranslations' IconView available privately in the interface kit.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41244 a95241bf-73f2-0310-859d-f6bbb57e9c96

4d1288ba 18-Mar-2011 Siarzhuk Zharski <zharik@gmx.li>

Fix for the typo in alert message. Sorry.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41019 a95241bf-73f2-0310-859d-f6bbb57e9c96

4115645a 17-Mar-2011 Siarzhuk Zharski <zharik@gmx.li>

Localization of some UI parts:
- context menu of the replicant dragger. Fixes #7363;
- default <empty> menu placeholder. Fixes #7072;
- other messages used in PrintJob, Dragger and ZombieReplicantView classes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40991 a95241bf-73f2-0310-859d-f6bbb57e9c96

4153964a 25-Feb-2011 Stephan Aßmus <superstippi@gmx.de>

Moved IconUtils.h to Interface Kit and therefor made it an "official" header. Since the class has no
virtual but only static methods, it is not so likely that binary compatibility issues may arrise
from using it in new apps. Adjusted all the Jamfiles that included the private libicon headers. Note
that it was never necessary to link against libicon.a, since it's part of libbe anyway. There was one
instance where that was done. Hopefully it does not break the build, but I did this change a while ago,
tested it and then the harddrive began failing.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40679 a95241bf-73f2-0310-859d-f6bbb57e9c96

585db48d 22-Feb-2011 Jonas Sundström <jonas@kirilla.com>

Unsafe use of strncpy replaced by strlcpy. CID 2238.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40632 a95241bf-73f2-0310-859d-f6bbb57e9c96

51519728 17-Feb-2011 Alex Wilson <yourpalal2@gmail.com>

Fix possible null dereference in BGroupLayoutBuilder, CID #4212

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40548 a95241bf-73f2-0310-859d-f6bbb57e9c96

71947e47 15-Feb-2011 Alex Wilson <yourpalal2@gmail.com>

When unarchiving a BSplitLayout, initialize our members properly so that even if unarchiving fails, the object is in a usable state. Fixes CID 10045.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40522 a95241bf-73f2-0310-859d-f6bbb57e9c96

9fd5bdcb 11-Feb-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Made BPrintJob layout aware: while drawing recursively, we can't anymore
assume that all children B_WILL_DRAW.
Also call Draw() only when the view said it will.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40439 a95241bf-73f2-0310-859d-f6bbb57e9c96

f71910c0 27-Jan-2011 Ryan Leavengood <leavengood@gmail.com>

Apply the patch from Pete Goodeve from #7165 and therefore fix that ticket.

Instead of forcing a click to open rect this just restarts menu tracking if the
mouse was clicked. It seems to work great and is cleaner than my solution which
is removed in this commit as well.

This still fixes the problem of accidentially selecting menu items but also
maintains the API.

Good job Pete!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40306 a95241bf-73f2-0310-859d-f6bbb57e9c96

91f0846f 27-Jan-2011 Ryan Leavengood <leavengood@gmail.com>

Add a default right click context menu to BTextView.

This fixes #7022 and is mostly based on the patch attached to that ticket, with
these changes:
- The patch was adding this to the private _TextInput_ class, not BTextView.
- The patch had a Clear menu item too. I removed that due to the different
semantics between Clear in a BTextView and in a TextInput. The former just
clears the selection where the latter clears the whole view.

We could later add a virtual callback for adding menu items to this context
menu which could be used to add Clear with the two semantics in each class
(this is mainly needed for the enabling logic...each class could handle a clear
message in its own way.) This callback could also obviously be used for other
things, like a spell-check menu or whatever an application would want to add.
Since BTextView has 10 free virtual slots it seems reasonable to add.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40305 a95241bf-73f2-0310-859d-f6bbb57e9c96

915a7b8c 19-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

Make BObjectList<> publically available:
* cleaned up ObjectList.h
* switched several uses of new() to new(std::nothrow)
* moved ugly AsBList() hack into BObjectList<>::Private class and
adjusted all callers accordingly

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40252 a95241bf-73f2-0310-859d-f6bbb57e9c96

24a77ea0 08-Jan-2011 Axel Dörfler <axeld@pinc-software.de>

* Added ItemAt() method that accepts column and row.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40154 a95241bf-73f2-0310-859d-f6bbb57e9c96

77b7e18a 07-Jan-2011 Ryan Leavengood <leavengood@gmail.com>

Revert my hack from r40132 and just go ahead and fix our pop-up menu behavior
by forcing openAnyway and creating a clickToOpen rect if there is not one.
Should fix #7022 and maybe others. Partially based on the patch from #7022 and
Travis Reed's patch from the mailing list discussion in December.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40142 a95241bf-73f2-0310-859d-f6bbb57e9c96

d3e72a99 06-Jan-2011 Alex Wilson <yourpalal2@gmail.com>

In fixing CID #5841, I found that not only does the code in BAbstractLayout::AllUnarchived() leak, it is also mostly unnecessary! (mea culpa) This fixes both problems.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40140 a95241bf-73f2-0310-859d-f6bbb57e9c96

d0d510a7 06-Jan-2011 Alex Wilson <yourpalal2@gmail.com>

Fix BTabView bug which caused {Min,Max,Preferred}Size() to be at least 3 pixels too tall, depending on the border in use. Also a very small style fix. This fixes ticket #6544.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40138 a95241bf-73f2-0310-859d-f6bbb57e9c96

f8f64f9a 06-Jan-2011 Ryan Leavengood <leavengood@gmail.com>

Make pop-up menu behavior more like BeOS (though this still is not ideal):

If the menu opens right under the mouse cursor, do not select or invoke an item
until the mouse is moved. Since this seems to break normal menu bars, I added
the check for fSuper. As a (bad?) side effect BMenuField menus also need mouse
movement before something is selected. If anything else is broken, let me know.

I'm committing this because it does remove some bad behavior in pop up menus
(unintentionally selecting items.)

We may also want to force the openAnyway behavior as discussed on the mailing
list in December.

In general though the menu handling code really should be redesigned/refactored.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40132 a95241bf-73f2-0310-859d-f6bbb57e9c96

d1b6305c 31-Dec-2010 Stephan Aßmus <superstippi@gmx.de>

Forward important properties and setters of the private BSplitLayout
in the BSplitView class, related to getting and setting item weights

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40048 a95241bf-73f2-0310-859d-f6bbb57e9c96

f95b5003 29-Dec-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Style changes, some more error checks, removed ifdeffed broken

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40018 a95241bf-73f2-0310-859d-f6bbb57e9c96

b2f1b918 28-Dec-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

empty the message before reusing it, otherwise the pictures will be archived multiple times. Should fix ticket #7035.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39981 a95241bf-73f2-0310-859d-f6bbb57e9c96

08f914dc 26-Dec-2010 Oliver Tappe <zooey@hirschkaefer.de>

Fix CID-8112 & -8113 (strange pointer arithmetic)
* BShape:: AddShape(): drop manual multiplication in typed pointer
arithmetic - addding the number of elements to a typed pointer
will already move that pointer in steps of sizeof(type).
The effect of this bug would be overwritten memory somewhere behind the data array.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39951 a95241bf-73f2-0310-859d-f6bbb57e9c96

884384ff 25-Nov-2010 DarkWyrm <darkwyrm@gmail.com>

Sending B_COUNT_PROPERTIES for the View property now returns the right value.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39624 a95241bf-73f2-0310-859d-f6bbb57e9c96

a9e89a73 19-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Also made LayoutContext() const.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39526 a95241bf-73f2-0310-859d-f6bbb57e9c96

df730987 19-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Made AncestorsVisible() const.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39525 a95241bf-73f2-0310-859d-f6bbb57e9c96

df2b4726 19-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

BLayoutUtils::MoveIntoFrame(): Fixed check. Spotted by korli.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39509 a95241bf-73f2-0310-859d-f6bbb57e9c96

58bee544 19-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Renamed _CheckSizeLimits() to UpdateSizeLimits() and made it public.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39495 a95241bf-73f2-0310-859d-f6bbb57e9c96

39c1cc12 19-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added MoveIntoFrame() method.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39494 a95241bf-73f2-0310-859d-f6bbb57e9c96

8faf0ba7 18-Nov-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

Harmonized default even and odd lines colors with the ones used in
MediaPlayer's playlist.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39475 a95241bf-73f2-0310-859d-f6bbb57e9c96

e6cb8eb4 05-Nov-2010 Stephan Aßmus <superstippi@gmx.de>

* Reuse the check for changed location which decides whether
to Invoke() in MouseUp() in the code path for keyboard control.
Should fix ticket #6792, but I have not actually tested it.
* Don't post notification values in KeyDown() when the value did
not change because it was constrained between min and max values.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39323 a95241bf-73f2-0310-859d-f6bbb57e9c96

3ea301f3 22-Oct-2010 Alex Wilson <yourpalal2@gmail.com>

Update BLayout::IndexOfView() to return NULL for NULL input, and check for BViews that where added by BLayout, instead of by BViewLayoutItem.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39043 a95241bf-73f2-0310-859d-f6bbb57e9c96

5b349aa2 08-Oct-2010 Jérôme Duval <korli@users.berlios.de>

* IsFocus() always returns false, use the textview instead.
* Use SelectAll on the textview, when it has the focus (like in MakeFocus()). This fixes bug #6703.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38900 a95241bf-73f2-0310-859d-f6bbb57e9c96

50960935 03-Oct-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Remove B_NAVIGABLE flag from main view after setup the child text view that use the flags from the main view. Fix #6431.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38879 a95241bf-73f2-0310-859d-f6bbb57e9c96

676c1e96 26-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Let client applications set a DrawingMode() which will be the
default drawing mode for text rendering. Don't override it
with B_OP_COPY (still the default). Should not have any
consequences in any existing use-case. The MediaPlayer can
use BTextViews to render semi-transparent subtitles this way.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38823 a95241bf-73f2-0310-859d-f6bbb57e9c96

a58469f5 25-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Allow to set the false bold width in BTextView style runs.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38816 a95241bf-73f2-0310-859d-f6bbb57e9c96

d0844c50 20-Sep-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Fix typo.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38749 a95241bf-73f2-0310-859d-f6bbb57e9c96

62da9a0f 09-Sep-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

Ooops, fix the binary compatibility I introduced.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38592 a95241bf-73f2-0310-859d-f6bbb57e9c96

7ae97406 09-Sep-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

Cache text width to avoid calling StringWidth() too much while
both text and font don't change.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38591 a95241bf-73f2-0310-859d-f6bbb57e9c96

38c4dc0e 08-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Small improvement in efficiency, don't invalidate the
layout when the string width did not change.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38589 a95241bf-73f2-0310-859d-f6bbb57e9c96

82ab3167 02-Sep-2010 Alex Wilson <yourpalal2@gmail.com>

Add default spacing for Layouts (#5614)
* introduce B_USE_DEFAULT_SPACING, which works somewhat like B_SIZE_UNSET and B_ALIGN_HORIZONTAL_UNSET
* introduce static float BControlLook::ComposeItemSpacing(float spacing), which checks uses be_control_look->DefaultItemSpacing().
* modify layouts to use BControlLook::ComposeItemSpacing() in SetInsets and SetSpacing methods.
* default insets are still 0, 0, 0, 0, but can be set to default spacing by passing B_USE_DEFAULT_SPACING
* I've found two regressions, patches incoming, please report others on #5614.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38512 a95241bf-73f2-0310-859d-f6bbb57e9c96

3c772f3e 26-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

Finally fixed #3036: BColumnListView::PreferredSize() needs
to take into account the correct extra spacing around
the TitleView, as well the internal margin width that
the TitleView adds to the current column width sum for
its virtual width used to set the horizontal scrollbar
proportion. Introduced TitleView::MarginWidth() for that.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38374 a95241bf-73f2-0310-859d-f6bbb57e9c96

2f368a27 26-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

Fixed the overly complicated computation of the height of the
removed rows in OutlineView::RemoveRow(BRow* row). It also
contained a bug (tracked down by Duggan in ticket #3897, thanks!)
which caused it to skip the sub-tree height computation when
FindParent() returns false, which it does for root items.
Now the computation is simple: The subTreeHeight is the height
of the row itself, if a) the row doesn't have a parent or b)
the parent is visible and expanded. Then if the row being removed
is expanded, we calculate the sub-tree height recursively.
Removed a lot of duplicated or even trippled checks along the
way and solved two easily solvable TODOs with regards to what is
invalidated. Previously the entire list view was invalidated
for each row being removed, even if they were scrolled out the
view bounds.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38372 a95241bf-73f2-0310-859d-f6bbb57e9c96

dd96260d 26-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

Cleaned up OutlineView::FindParent(), only do the visibility check if required.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38366 a95241bf-73f2-0310-859d-f6bbb57e9c96

d8ede517 21-Aug-2010 Rene Gollent <anevilyak@gmail.com>

If we failed to instantiate the view (ergo we are a zombie), don't remove the drop coordinates from the replicant message we store as they'll be needed in order to reinstantiate the zombie at the correct position on the next pass.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38303 a95241bf-73f2-0310-859d-f6bbb57e9c96

994e9650 21-Aug-2010 Rene Gollent <anevilyak@gmail.com>

- Remove leftover debug output.
- Simplified BShelf::SaveLocation(). Resolves CID 431.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38302 a95241bf-73f2-0310-859d-f6bbb57e9c96

cc26ee39 21-Aug-2010 Rene Gollent <anevilyak@gmail.com>

Forgot to adjust the copyright on files affected in previous commit.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38297 a95241bf-73f2-0310-859d-f6bbb57e9c96

2041484b 21-Aug-2010 Rene Gollent <anevilyak@gmail.com>

Fix various problems found while investigating (and fixing) CID 1453. In short, handling of zombie replicants was completely broken ; they never actually made it to the shelf, and weren't saved/restored either. A problem still remains with respect to restoring them (the shelf relies on the dragged message's drop point to position them, which isn't preserved when the message is flattened/unflattened it seems).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38296 a95241bf-73f2-0310-859d-f6bbb57e9c96

1eeda2bd 18-Aug-2010 Alex Wilson <yourpalal2@gmail.com>

Fix style violations I've commited in r38207 and r38251, the first pointed out by Ingo <- thanks!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38252 a95241bf-73f2-0310-859d-f6bbb57e9c96

8f88fe1d 18-Aug-2010 Oliver Tappe <zooey@hirschkaefer.de>

* fix CID-258: BView::SetViewOverlay() shouldn't crash if given a NULL bitmap.
Coverity was complaining because we did a half-ass check against NULL only to
pass that NULL pointer on to a function that deref'd it.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38248 a95241bf-73f2-0310-859d-f6bbb57e9c96

65341d51 18-Aug-2010 Oliver Tappe <zooey@hirschkaefer.de>

Someone familiar with BBitmap, please review:
* BBitmap could leak fWindow in operator=()
* two copy constructors didn't initialize the members properly, which
could cause crashes in _CleanUp()
* minor cleanup
Actually found this while staring at CID 254-257, which were false alarm, though.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38246 a95241bf-73f2-0310-859d-f6bbb57e9c96

e1a64227 18-Aug-2010 Oliver Tappe <zooey@hirschkaefer.de>

Fix #6458 - crash in BTextView when entering Japanese characters
* when I changed InsertText() to adjust the caret position recently, I
forgot to drop that adjustment from all callers - _HandleInputMethodChanged()
was still doing it, leading to out of bounds access

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38243 a95241bf-73f2-0310-859d-f6bbb57e9c96

ee9246d5 17-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Remove unused communication port, pointed out by Axel.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38216 a95241bf-73f2-0310-859d-f6bbb57e9c96

94892dc0 17-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Make arguments const if appropriated. Style issues and port_id error check. Thanks Stippi.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38214 a95241bf-73f2-0310-859d-f6bbb57e9c96

7640bbb6 17-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Fix coding style.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38212 a95241bf-73f2-0310-859d-f6bbb57e9c96

352fb78f 17-Aug-2010 Alex Wilson <yourpalal2@gmail.com>

Fix Gcc4 build error from my previous commit.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38208 a95241bf-73f2-0310-859d-f6bbb57e9c96

1d6c7b6c 17-Aug-2010 Alex Wilson <yourpalal2@gmail.com>

Big change deriving BLayout from BLayoutItem, and allowing viewless BLayouts.
a few highlights:
* BLayout now derives publicly from BLayoutItem
* Added BAbstractLayout class, which our layouts now derive from
* updated layout builders to avoid creating views when they don't need to
* updated layout classes
* updated AboutSystem to fix a little regression
* more details on #6407
* please tell me about any regressions, I've tried to find them all, but some
may have slipped by.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38207 a95241bf-73f2-0310-859d-f6bbb57e9c96

5836cd75 17-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Add a BWindowStack interface class. Please review if adding a BWindowStack as a friend of BWindow in Window.h is ok.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38171 a95241bf-73f2-0310-859d-f6bbb57e9c96

a20769b3 16-Aug-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

CID 1500 : Potential NULL poiner dereference.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38140 a95241bf-73f2-0310-859d-f6bbb57e9c96

e70fa080 12-Aug-2010 Alex Wilson <yourpalal2@gmail.com>

Should have been part of my previous commit.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38065 a95241bf-73f2-0310-859d-f6bbb57e9c96

aa818be6 12-Aug-2010 Alex Wilson <yourpalal2@gmail.com>

Update BView to call debugger when passed a NULL archive for its archive constructor. This means there is no need to check for a NULL archive in BSeparatorView. Also update BUnarchiver and friends to be NULL safe. Pointed out by Adrien, fixes CID 1754.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38063 a95241bf-73f2-0310-859d-f6bbb57e9c96

0bae8717 11-Aug-2010 Oliver Tappe <zooey@hirschkaefer.de>

Closing #2334:
* fix incorrect implicit type extension in WidthBuffer::CharToCode() that led
to some values not being represented correctly (depending on input chars)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38034 a95241bf-73f2-0310-859d-f6bbb57e9c96

2feea51f 11-Aug-2010 Oliver Tappe <zooey@hirschkaefer.de>

* cleanup and style fixes in WidthBuffer

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38033 a95241bf-73f2-0310-859d-f6bbb57e9c96

e70da3e1 10-Aug-2010 Oliver Tappe <zooey@hirschkaefer.de>

Closing #5959:
* _DoInsertText() must not assume that the text is actually being inserted
by InsertText(), since that's a virtual method meant to be overridden by
subclasses. So the updating of caret-position and selection start/end has
to happen in InsertText().

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38006 a95241bf-73f2-0310-859d-f6bbb57e9c96

cb06c64a 10-Aug-2010 Oliver Tappe <zooey@hirschkaefer.de>

* style fixes to textview_support class LineBuffer

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38005 a95241bf-73f2-0310-859d-f6bbb57e9c96

a4bcdeaa 09-Aug-2010 Oliver Tappe <zooey@hirschkaefer.de>

Fix another glitch reported in #6435
* when shrinking the gap, avoid that deleting the next character will shrink
the gap again

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37989 a95241bf-73f2-0310-859d-f6bbb57e9c96

7e31a05c 09-Aug-2010 Oliver Tappe <zooey@hirschkaefer.de>

Close #6435:
* fix problem in TextGapBuffer which could lead to data loss at end of buffer
when deleting large chunks of text

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37987 a95241bf-73f2-0310-859d-f6bbb57e9c96

c3423856 09-Aug-2010 Oliver Tappe <zooey@hirschkaefer.de>

* style cleanup - no functional change

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37984 a95241bf-73f2-0310-859d-f6bbb57e9c96

afe949d2 07-Aug-2010 Alex Wilson <yourpalal2@gmail.com>

Fix incorrect initialization of boolean in BGridLayout::ItemRemoved() that lead to unreachable code, fixes CID 58.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37966 a95241bf-73f2-0310-859d-f6bbb57e9c96

3c38ebff 01-Aug-2010 François Revol <revol@free.fr>

Use IntegerWidth() & friend to avoid the cast, doesn't hurt.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37841 a95241bf-73f2-0310-859d-f6bbb57e9c96

a67b5b99 02-Aug-2010 François Revol <revol@free.fr>

Fix the width and height fields of the B_VIEW_RESIZED message to be of type int32 and not float, as stated in the BeBook. They are rarely used since BView::FrameResize() passes the floats directly from the updated bounds, but at least it should fix the XEmacs port.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37839 a95241bf-73f2-0310-859d-f6bbb57e9c96

6829d417 29-Jul-2010 Alex Wilson <yourpalal2@gmail.com>

Update BLayout::ItemAdded() and BLayout::ItemRemoved() to take an int32 index parameter, and ItemAdded() to return a bool indicating success or failure. Update BLayout::AddItem() to take the result of ItemAdded() into account. Also update BLayout::AllUnarchived() to take this into account. In either situation, if ItemAdded() returns false, the item does not get added to the layout. Removed various TODOs about code that could be removed once this change was made. In BSplitLayout, an item's LayoutData was lazy-initialized, but would always be created during ItemAdded(). Now we create the LayoutData explicitly, so that we can catch failed memory allocations. Closes #5524.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37817 a95241bf-73f2-0310-859d-f6bbb57e9c96

e867b26f 28-Jul-2010 Alex Wilson <yourpalal2@gmail.com>

Update BTabView to initialize fContainerView to NULL before calling _InitContainerView() from _InitData(). This fixes a regression DeadYak pointed out to me on IRC. (thanks DeadYak, sorry everyone!) Also a bit of cleanup, improved _InitContainerView() to not AddChild(fContainerView) if it was not created. Also archive BTabView::fBorderStyle.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37799 a95241bf-73f2-0310-859d-f6bbb57e9c96

5f844af7 28-Jul-2010 Alex Wilson <yourpalal2@gmail.com>

Update BTabView for layout-friendly archiving. Added _InitContainerView() method that is called from _InitObject() but also called on its own during unarchival. Implemented BTabView::AllUnarchived() and implemented a case for this in BTabView::Perform().

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37796 a95241bf-73f2-0310-859d-f6bbb57e9c96

5c47e35e 27-Jul-2010 Alex Wilson <yourpalal2@gmail.com>

Updated BTextControl and its custom BLayoutItems. Also a bit of style cleanup. Broke up BTextControl::_InitData() method into _InitData() and _InitText() and moved initialization of the BTextView there.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37780 a95241bf-73f2-0310-859d-f6bbb57e9c96

7a37b89b 27-Jul-2010 Alex Wilson <yourpalal2@gmail.com>

Updated BMenuField and its custom BLayoutItems for layout-safe archiving. Added an _InitMenu(const BMessage*) method that inits the menu during unarchival.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37778 a95241bf-73f2-0310-859d-f6bbb57e9c96

4a254e4d 27-Jul-2010 Alex Wilson <yourpalal2@gmail.com>

Generally, clean up new archiving constant names & strings to be consistent in all classes. Modify archiving constants to be const char* const (thanks Ingo). Also modify archiving in many classes to use less fields by storing more data in arrays and structs. The common min, max, and preferred sizes, for example are always stored in an array now. In BTwoDimensionalLayout and BSplitLayout, the insets are archived in a BRect. Also fixed a typo in BGridLayout which caused column info to be incorrect during archival.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37777 a95241bf-73f2-0310-859d-f6bbb57e9c96

81405788 20-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Alex Wilson:
* Added support for archiving/unarchiving.
* Coding style cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37613 a95241bf-73f2-0310-859d-f6bbb57e9c96

12463fa8 20-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Alex Wilson: Added archiving/unarchiving support to BSplitView.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37612 a95241bf-73f2-0310-859d-f6bbb57e9c96

e5ea208d 16-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Alex Wilson:
* Added archiving/unarchiving support.
* Coding style cleanup (some by myself).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37549 a95241bf-73f2-0310-859d-f6bbb57e9c96

4b20c303 16-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Alex Wilson:
* Added archiving/unarchiving support.
* Coding style cleanup (some more by myself).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37548 a95241bf-73f2-0310-859d-f6bbb57e9c96

39c72631 16-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Alex Wilson:
* Added archiving/unarchving support.
* Coding style cleanup (some more by myself).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37547 a95241bf-73f2-0310-859d-f6bbb57e9c96

ff626c8e 16-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Alex Wilson: Added archiving/unarchiving support.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37546 a95241bf-73f2-0310-859d-f6bbb57e9c96

3fb74eb7 16-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Alex Wilson (with minor changes by myself):
* Added support for archiving/unarchiving.
* Coding style cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37545 a95241bf-73f2-0310-859d-f6bbb57e9c96

849e11ad 16-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Alex Wilson:
* Implemented archiving/unarchiving support.
* Coding style cleanup (some more by myself).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37543 a95241bf-73f2-0310-859d-f6bbb57e9c96

d1535a45 16-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Alex Wilson:
* Implemented archiving/unarchiving support.
* Coding style cleanup (some more by myself).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37542 a95241bf-73f2-0310-859d-f6bbb57e9c96

80c2bbd8 16-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Alex Wilson (with small style changes by myself): Added support for

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37541 a95241bf-73f2-0310-859d-f6bbb57e9c96

7ed1644c 16-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Alex Wilson:
* Added archiving/unarchiving support.
* Style cleanup (also some by myself).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37540 a95241bf-73f2-0310-859d-f6bbb57e9c96

cbac1a23 16-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Alex Wilson: Added archiving/unarchiving of layout and layout
related data.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37539 a95241bf-73f2-0310-859d-f6bbb57e9c96

b137ab3e 16-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Alex Wilson (minor changes by myself) related to the new archiving
* Some cosmetic adjustments of the API, like using references instead of
pointers, argument order, method names, etc.
* Added convenience template methods for archiving and unarchiving to BArchiver
and BUnarchiver.
* BUnarchiver (respectively the private BUnarchiveManager) explicitly deals with
object ownership, now. This is necessary since an error while unarchiving
could leave an already unarchived object without owning object, which would
result in it being leaked. The BUnarchiver::{Get,Find}Object() methods do now
have an optional parameter to specify whether object ownership shall be
* Fixed incorrect header guard in headers/private/binary_compatibility/Global.h.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37538 a95241bf-73f2-0310-859d-f6bbb57e9c96

acbbf2c0 09-Jul-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Remove unused define

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37447 a95241bf-73f2-0310-859d-f6bbb57e9c96

9b741428 09-Jul-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Move assigments a bit earlier, so they aren't done at every loop.
Thanks to Sean Bailey for watching after me.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37445 a95241bf-73f2-0310-859d-f6bbb57e9c96

821a9b03 09-Jul-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Renamed attachAborted to addAborted
Use fAttachAborted in AttachedToWindow().

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37442 a95241bf-73f2-0310-859d-f6bbb57e9c96

27d84b48 08-Jul-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Patch by Alex Wilson as part of GSoC 2010 : Archiving of Layouted BViews hierarchy.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37433 a95241bf-73f2-0310-859d-f6bbb57e9c96

0cf8c36a 05-Jul-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Patch by Alex Wilson, part of GSoC 2010 : fix a "typo" in AbstractLayoutItem.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37399 a95241bf-73f2-0310-859d-f6bbb57e9c96

4225e5b7 03-Jul-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Use the Bfont object to discriminate between fonts (as in Dano)
and not just size and code. Style cleanups.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37369 a95241bf-73f2-0310-859d-f6bbb57e9c96

1bbf3b88 02-Jul-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Patch by Alex Wilson as part of GSoC 2010 : fix a crashing bug in BTwoDimensionalLayout::AlignWith() (ticket #6244).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37348 a95241bf-73f2-0310-859d-f6bbb57e9c96

8460e00c 30-Jun-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

_AddDynamicItems didn't pass the keyDown parameter to _OkToProceed (noticed
by Ziusudra).
Also removed leftover fDynamicItemsAdded.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37314 a95241bf-73f2-0310-859d-f6bbb57e9c96

7ecc0417 25-Jun-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed use of fDynamicItemsAdded, since it can't work like this.
Since a custom BMenu can remove the added items whenever it wants,
they wouldn't never be added back if the menu wasn't destroyed
and recreated

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37262 a95241bf-73f2-0310-859d-f6bbb57e9c96

780b76dc 25-Jun-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Applied patch by Ziusudra in ticket #4930 to avoid a deadlock when
navigating the menus via keyboard.
I also factored some code into functions, in particular the code to
add the dynamic items. Also keep track if the dynamic items have been added
or not (using a new boolean class member).
I tested for regressions but couldn't find any.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37261 a95241bf-73f2-0310-859d-f6bbb57e9c96

0c9f5a02 25-Jun-2010 Wim van der Meer <wpjvandermeer@gmail.com>

* Modified PtrScr key behaviour:
- No modifiers: take a screenshot with zero delay and launch the GUI
- Shift-PrtScr: Silent screenshot using the saved GUI settings
- Ctrl-PrtScr: Take a screenshot using the saved GUI settings and copy the
screenshot to the system clipboard
* A few locale related changes (I am not sure how this works when a class is
shared between two applications, I hope I got everything right)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37252 a95241bf-73f2-0310-859d-f6bbb57e9c96

8345d755 15-Jun-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Don't set the width and height of the view in the constructor,
otherwise some other calculation screws up later, and the menu frame ends up
to be offsetted by its height. Fixes ticket #6159.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37149 a95241bf-73f2-0310-859d-f6bbb57e9c96

12c93cc7 11-Jun-2010 Axel Dörfler <axeld@pinc-software.de>

* Before stippi starts clobbering the sources everywhere with superfluous
work-arounds, I applied the work-around where the problem actually occurs,
until someone takes the time to look into it.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37095 a95241bf-73f2-0310-859d-f6bbb57e9c96

3417d2a9 08-Jun-2010 Wim van der Meer <wpjvandermeer@gmail.com>

* Rename "ScreenshotApp" to "Screenshot", rename its signature from
"application/x-vnd.haiku-screenshotapp" to "application/x-vnd.haiku-screenshot"
* Rename "Screenshot" to "screenshot", rename its signature from
"application/x-vnd.haiku-screenshot" to "application/x-vnd.haiku-screenshot-cli"
* Move screenshot from /system/apps to /bin

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37059 a95241bf-73f2-0310-859d-f6bbb57e9c96

d2717a34 20-May-2010 Axel Dörfler <axeld@pinc-software.de>

* Also hide tool tips if a key has been pressed.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36885 a95241bf-73f2-0310-859d-f6bbb57e9c96

33394b85 16-May-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Wim van der Meer: Added get_mouse_bitmap() global method to
InterfaceDefs.h and corresponding implementation in the app_server. Thanks a
bunch! Closes ticket #5978.

A note to those using "update-all" with hybrid builds - the alternative GCC
system libs will not be updated this way, and this and Wim's last patch
change the libbe <-> app_server interface. You need to manually update the
respective libbe.so, or do a clean build, otherwise apps for the other GCC will
not start anymore.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36830 a95241bf-73f2-0310-859d-f6bbb57e9c96

0cf1ecfb 14-May-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Ziusudra: Fixes navigation in to and out of sub menus with the cursor
keys. Thanks! Closes ticket #5996.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36819 a95241bf-73f2-0310-859d-f6bbb57e9c96

52883718 14-May-2010 Stephan Aßmus <superstippi@gmx.de>

Rewrote BMenu::_NextItem(), since it could busy loop when there was no item.
The new code should be a little easier to follow. IMHO, there were also problems
with detecting and breaking out of a full cycle, in case there was no start
item passed to the method.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36813 a95241bf-73f2-0310-859d-f6bbb57e9c96

1c73ffa1 14-May-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Wim van der Meer: Implemented global Interface Kit function to retrieve
the current mouse position and pressed buttons. I've changed the return code
to status_t and added anal error checking, most of the rest of the file is not
doing it, though... :-) Thanks, Wim!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36811 a95241bf-73f2-0310-859d-f6bbb57e9c96

43775be6 11-May-2010 Ithamar R. Adema <ithamar.adema@team-embedded.nl>

* Revert r36316 as there are too many apps broken (Vision, Chart, Tracker Find, etc) in different unexpected ways. I'm sorry for the
trouble :( I'll revisit the change and post a patch with a hopefully better solution soon....

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36795 a95241bf-73f2-0310-859d-f6bbb57e9c96

6f05b102 11-May-2010 Stephan Aßmus <superstippi@gmx.de>

Removed stuff which was completely unused.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36790 a95241bf-73f2-0310-859d-f6bbb57e9c96

676a46d5 08-May-2010 Stephan Aßmus <superstippi@gmx.de>

fSelected was accessed unchecked in _UpdateStateOpenSelect(), but the method
can be called without any item being selected yet. In that case, fall back
to just select the item and return (setting fSelected). I've had Tracker
crash with a BT that suggest this was the case, when I invoked some context

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36759 a95241bf-73f2-0310-859d-f6bbb57e9c96

a40ec7c5 08-May-2010 Ithamar R. Adema <ithamar.adema@team-embedded.nl>

* Revert my changes to BListView for now

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36758 a95241bf-73f2-0310-859d-f6bbb57e9c96

e2e16032 08-May-2010 Ithamar R. Adema <ithamar.adema@team-embedded.nl>

* Revert MinSize() and PreferredSize() to the normal BView variants, since unlike the comment says GetPreferredSize() actually looks at the content of the listview to determine the size.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36756 a95241bf-73f2-0310-859d-f6bbb57e9c96

b513501f 08-May-2010 Ithamar R. Adema <ithamar.adema@team-embedded.nl>

* When a BMenuItem contains a submenu, and that menu IsLabelFromMarked(), use its preferred width as the content width in GetContentSize().

This fixes problems with the Min/PreferredSize() calculations for BMenuField, with a Menu that IsLabelFromMarked().

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36752 a95241bf-73f2-0310-859d-f6bbb57e9c96

4eb0cbb0 07-May-2010 Matt Madia <mattmadia@gmail.com>

Updated TR_CONTEXT to be B_TRANSLATE_CONTEXT, relating to #5408.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36733 a95241bf-73f2-0310-859d-f6bbb57e9c96

542aff1b 07-May-2010 Axel Dörfler <axeld@pinc-software.de>

* Added constructor that takes a name for the view.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36725 a95241bf-73f2-0310-859d-f6bbb57e9c96

5396d90d 07-May-2010 Axel Dörfler <axeld@pinc-software.de>

* Made zooming to full screen center the window when the window cannot be made
full screen (due to size restrictions).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36714 a95241bf-73f2-0310-859d-f6bbb57e9c96

cac9f196 07-May-2010 Axel Dörfler <axeld@pinc-software.de>

* Added BListItem::SetOutlineLevel() method.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36713 a95241bf-73f2-0310-859d-f6bbb57e9c96

75eb45a7 06-May-2010 Matt Madia <mattmadia@gmail.com>

Updated to use B_TRANSLATE* macros. relates to #5408.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36678 a95241bf-73f2-0310-859d-f6bbb57e9c96

139aacf4 06-May-2010 Axel Dörfler <axeld@pinc-software.de>

* The window was now always taken to the new workspace with Ctrl-Alt-arrow;
lazy debugging left over that closes ticket #5675 again.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36637 a95241bf-73f2-0310-859d-f6bbb57e9c96

0a51dbde 02-May-2010 Axel Dörfler <axeld@pinc-software.de>

* Unified the Desktop and ServerApp AS_ACTIVATE_WORKSPACE to work in the same
* Use that newly exposed feature of taking the focus window to the new workspace
when using the Ctrl-Alt-Shift-Arrow shortcut.
* This fixes #5675.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36585 a95241bf-73f2-0310-859d-f6bbb57e9c96

a8e3f157 02-May-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Applied (part of) a patch by Kaliber, attached to ticket #5875. Thanks!
Will commit the rest later.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36577 a95241bf-73f2-0310-859d-f6bbb57e9c96

cd9af8e7 01-May-2010 Rene Gollent <anevilyak@gmail.com>

Reverted r35463 and applied a patch by Stefano to handle the Terminal context
menu issue a different way. Should fix #5835.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36575 a95241bf-73f2-0310-859d-f6bbb57e9c96

59d0c2e4 30-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

* Introduced PaletteConverter::IndexForRGBA32() which checks if the alpha
component of a 32 bit color is below 128 and returns the special CMAP8 index
for indicating transparency.
* Changed the WriteCMAP() color conversion function to expext a 32bit RGBA
value and use IndexForRGBA32().
* Adapted B_CMAP8 target color space case of ConvertBits() to the new

This allows transparency in bitmaps when converting B_RGBA32 bitmaps to
B_CMAP8, tested only for this case and working as expected.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36549 a95241bf-73f2-0310-859d-f6bbb57e9c96

5af79883 25-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Make sure to invalidate the region that was previously within the text rect,
but which is outside the new text rect, when changing the text rect. Solves
dirty regions in BTextViews. For example the black bar along the top of the
URL input in WebPositive after starting it. Or random bits of text left-over
in Beam when switching emails.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36470 a95241bf-73f2-0310-859d-f6bbb57e9c96

3417c110 24-Apr-2010 Oliver Tappe <zooey@hirschkaefer.de>

Fix #5725, single pixel caret drawing artefact in an empty BTextView:
* _NullStyleHeight() must return the height including the 1 pixel gap between
the lines, as that's how it's being used

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36469 a95241bf-73f2-0310-859d-f6bbb57e9c96

f7b6636a 24-Apr-2010 Rene Gollent <anevilyak@gmail.com>

Don't set releasedOnce unless we actually detect an appropriate change in mouse button states. Otherwise we could mistakenly invoke menu items when not desired. Fixes the other part of #3267.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36453 a95241bf-73f2-0310-859d-f6bbb57e9c96

8e23974b 23-Apr-2010 Rene Gollent <anevilyak@gmail.com>

After looking for items/submenus, always update the closed state at least once before mouse polling. Otherwise the click to open sticky setting would sometimes not get evaluated until after the mouse cursor had already moved outside of the click to open rect. Fixes ticket #3267.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36443 a95241bf-73f2-0310-859d-f6bbb57e9c96

d7fcb36f 21-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

* Allow to set the scale (versus multiplication with a scale).
* Added commented versions for translation, rotation and shear, which would
work similar.
* Added B_AFFINE_IDENTITY_TRANSFORM constant similar to B_ORIGIN.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36401 a95241bf-73f2-0310-859d-f6bbb57e9c96

5292aff1 21-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Reverted the BTextView part of r35731 again - turns out this usually doesn't
do what one would want. This closes ticket #5671.
* I'm not sure if we want to resurrect the pose view part of r35731 again; it
adds bitmap and text clips to dragged files. At least the bitmap change was
unrelated, but I'm a bit torn if that is the way this should be handled.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36390 a95241bf-73f2-0310-859d-f6bbb57e9c96

76d5e064 19-Apr-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Partially revert r35962, since the cure is worse than the sickness.
Should fix #5717 (but probably reopens #3103)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36369 a95241bf-73f2-0310-859d-f6bbb57e9c96

1da48c41 15-Apr-2010 Michael Lotz <mmlr@mlotz.ch>

Simplify the SetTrigger() code. The trigger is a single byte char anyway, so no
need to convert the looked up label position to a char code. Also actually make
sure that the trigger is lower case by doing an explicit tolower() instead of
assuming that it already is.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36316 a95241bf-73f2-0310-859d-f6bbb57e9c96

bae33cda 15-Apr-2010 Michael Lotz <mmlr@mlotz.ch>

Automatic whitespace cleanup, no functional change.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36315 a95241bf-73f2-0310-859d-f6bbb57e9c96

8c4c164a 15-Apr-2010 Michael Lotz <mmlr@mlotz.ch>

Make the result a proper const char *.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36313 a95241bf-73f2-0310-859d-f6bbb57e9c96

2272ecea 15-Apr-2010 Michael Lotz <mmlr@mlotz.ch>

* Ensure that there is still buffer left when 0-terminating the buffer in
* Remove the fExtraCount member and instead make it into a constant as that's
how it's used and more obvious.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36306 a95241bf-73f2-0310-859d-f6bbb57e9c96

5c4e7641 15-Apr-2010 Michael Lotz <mmlr@mlotz.ch>

* Large cleanup in _FindLineBreak(), be a bit more clever by storing the found
offsets instead of calculating them multiple times, use
_TabExpandedStyledWidth() instead of _StyledWidth() and manual tab calculation
which was also broken (it assumed tabs were consequtive which was possibly not
the case).
* Modified CanEndLine() to also return true when going from non-whitespace to
whitespace and the other way around which is more logical (so we'd break after
the word and not after word + whitespace, even though we actually do that
in the end by eating whitespace after words in _FindLineBreak()).
* The TextGapBuffer is not necessarily 0 terminated, so RealCharAt() needs to
check if the index is at the end of the string and return 0 in that case.
Before it would access the buffer "out by one" which could've lead to a crash.
* Simplified the gap moving calculations by removing some no-op calculations.
* Added debugger calls in TextGapBuffer in case of invalid use.
* Some minor cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36304 a95241bf-73f2-0310-859d-f6bbb57e9c96

ec7d1680 15-Apr-2010 Michael Lotz <mmlr@mlotz.ch>

Automatic whitespace cleanup, no functional change.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36301 a95241bf-73f2-0310-859d-f6bbb57e9c96

24386c29 15-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Minor cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36300 a95241bf-73f2-0310-859d-f6bbb57e9c96

c944d11f 13-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

All views which cache layout information need to call ResetLayoutInvalidation()
when they have updated the cached information. Otherwise calling
InvalidateLayout() once they are already attached to a layout may not have any

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36217 a95241bf-73f2-0310-859d-f6bbb57e9c96

26fe4141 13-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Small coding style fixes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36216 a95241bf-73f2-0310-859d-f6bbb57e9c96

a66b66ff 13-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

* When inside a layouted environment, InvalidateLayout() in MakeDefault()
instead of just resizing.
* When the view thinks it knows the correct size, it needs to
ResetLayoutInvalidation(). TODO: Actually all views that cache layout size
info need to do this.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36214 a95241bf-73f2-0310-859d-f6bbb57e9c96

5608589f 12-Apr-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Remove leftover debug printf()s
* Fix the layouting of BColorControl so it is now locale aware

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36191 a95241bf-73f2-0310-859d-f6bbb57e9c96

4343960f 12-Apr-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Introduce an add-on system to allow libbe to call things living inside liblocale (as liblocale depends on libbe, it can't be linked the usual way)
* This allows localizing the BColorControl class that had some text inside it.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36190 a95241bf-73f2-0310-859d-f6bbb57e9c96

846cb932 12-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Fix my strlcpy() adventure with a much simpler version of the code that should
also perform better for the usual case of inserting one char at a time. Using
strpbrk() on non-terminated strings was probably also not too healthy.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36187 a95241bf-73f2-0310-859d-f6bbb57e9c96

a68045b3 12-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

strlcpy() takes buffer size and will copy buffer size - 1 chars at max and then
use the remaining byte to terminate the buffer. Thanks for the heads up!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36185 a95241bf-73f2-0310-859d-f6bbb57e9c96

954af586 11-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Bug found by mmlr, since the "inText" is not terminated, strcpy could overwrite
a random amount of memory of the allocated "buffer". If it were terminated, it
would overwrite one byte, since it will also terminate the destination buffer,
which didn't contain the necessary room. Use strlcpy() instead and provide
enough room.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36172 a95241bf-73f2-0310-859d-f6bbb57e9c96

a2224f75 11-Apr-2010 Jonas Sundström <jonas@kirilla.com>

Corrected strace output.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36161 a95241bf-73f2-0310-859d-f6bbb57e9c96

575625f1 11-Apr-2010 Oliver Tappe <zooey@hirschkaefer.de>

fix drawing artefacts when the caret is being clipped, which lead
to parts of the caret being inverted:
* instead of always inverting the caret rect, we now invalidate when the
caret should be hidden

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36153 a95241bf-73f2-0310-859d-f6bbb57e9c96

03e6434e 10-Apr-2010 Jérôme Duval <korli@users.berlios.de>

* fixes a BSlider issue noticed by Matt on the mailing list:
Invoke() wasn't called the first time you grab a slider and slide it all the way to the left.
Thanks for the test case.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36145 a95241bf-73f2-0310-859d-f6bbb57e9c96

599a58a6 08-Apr-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Better error checking.
Style changes

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36094 a95241bf-73f2-0310-859d-f6bbb57e9c96

320a5686 28-Mar-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* The CompoundLayouters were leaked before. Made the class BReferenceable and
update references correctly.
* LocalLayouter::SetCompoundLayouter(): Remove the local layouter from the
previous compound layouter.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35983 a95241bf-73f2-0310-859d-f6bbb57e9c96

bb2576f0 26-Mar-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed some code which was added to fix a crash, which was obviously fixed
correctly later in another way.
Removing this code should also fix ticket #3103.
Use the width of the Bitmaps instead of fixed values.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35962 a95241bf-73f2-0310-859d-f6bbb57e9c96

2789b391 26-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Rewrote BAffineTransform to not be based on agg::trans_affine, which was pulling
in the AGG header. Reused the AGG code were applicable and implemented a lot
more features. The Multiply and PreMultiply meaning is reversed with respect to
AGG, but follows the mathematical meaning. Added type_code
B_AFFINE_TRANSFORM_TYPE to TypeConstants.h and let BAffineTransform derive from

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35958 a95241bf-73f2-0310-859d-f6bbb57e9c96

abb02bc4 26-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Moved BAffineTransform from shared kit into interface kit. Still in BPrivate
namespace. Applied 80 char/line limit.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35955 a95241bf-73f2-0310-859d-f6bbb57e9c96

9521d557 24-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Always sync the view cursor immediately, not only when entering the view. Should
fix the remaining issues pointed out in #3198.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35946 a95241bf-73f2-0310-859d-f6bbb57e9c96

00873f78 18-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Added BShape::CurrentPoint(), returning the current end point of the path.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35908 a95241bf-73f2-0310-859d-f6bbb57e9c96

76ab3f88 18-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Basically, this changeset implements BShape::ArcTo(). In more detail:
* Added BShape::ArcTo() and BShapeIterator::IterateArcTo(), using a previously
unused virtual slot. (Added the symbols for binary compatibility for GCC2
and GCC4.)
* Added operator=(), operator==() and operator!=() to BShape.
* Added BShape::BezierTo() version taking three points, which is sometimes
more convenient.
* Added the four new shape data ops OP_LARGE_ARC_TO_CW, OP_LARGE_ARC_TO_CCW,
OP_SMALL_ARC_TO_CW and OP_SMALL_ARC_TO_CCW. For a single arc, provided the
radius is large enough, there are four possibilities to draw the arc, these
are controlled by the two boolean flags to ArcTo() and mapped to the new
commands accordingly.
* Some style cleanup in Shape.cpp (sorry for mixing it up, but it gets
worse below...)
* Added ShapeTest to src/tests/servers/app.
* Changed the way BShapes are transformed from view to screen space in the
app_server. For arcs, it would be nontrivial to apply a proper transformation,
it's much easier to let AGG take care of it. This affects ServerPicture as
* Wrapped iterating the BShape into try/catch blocks in ShapeIterator. But
I really don't understand the purpose of the class in the first place.
Maybe it can now be dropped, since coordinates don't have to be transformed
in place anymore.
* Refactored copy&paste shape iteration code in Painter. The transformation
to screen space happens there.
* Since RemoteDrawingEngine needed to be adopted anyway, I also updated
it for the new DrawString() with offsets version. But the client still needs
to be adapted.
* Style cleanup in Painter.h

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35905 a95241bf-73f2-0310-859d-f6bbb57e9c96

991ab2d3 17-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Removed left-over, thanks Axel!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35893 a95241bf-73f2-0310-859d-f6bbb57e9c96

cc28efee 16-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Use the new cursors.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35892 a95241bf-73f2-0310-859d-f6bbb57e9c96

a5b1cf59 16-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

* Style cleanup.
* Use the new cursors.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35890 a95241bf-73f2-0310-859d-f6bbb57e9c96

770ebcea 16-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Just realized that BTabViews don't have a BLayout set when not layouted. But
just in case someone calls the BSize methods on such a tab view, provide a fall
back implementation. This one should now also report the correct size, only
less efficient.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35888 a95241bf-73f2-0310-859d-f6bbb57e9c96

7b19a569 16-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

The layout on the BTabView already knows the correct necessary size, because
the insets for the border and tab height have already been applied. The old
implementation for the BSize methods did not take border width into account.
It fixes tabviews being layouted too small.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35887 a95241bf-73f2-0310-859d-f6bbb57e9c96

a9daf3d9 15-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Improved the DrawString() method that takes offsets per glyph by making the
client provide the array size. Added version that doesn't take a string length
for convenience.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35866 a95241bf-73f2-0310-859d-f6bbb57e9c96

77e5acc0 15-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

* Extended the BView drawing API by a DrawString() version that takes an array
of locations, one for each glyph.
* Added a test for the new functionality.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35865 a95241bf-73f2-0310-859d-f6bbb57e9c96

8074fdce 13-Mar-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Set the preferred height of the separator to be always even, since, and center
the horizontal lines which represents it to the actual bounds. Should fix

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35856 a95241bf-73f2-0310-859d-f6bbb57e9c96

8c3d172b 03-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Fixed hovering over a sub-menu to let it open automatically, which I broke
with my previous commit.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35749 a95241bf-73f2-0310-859d-f6bbb57e9c96

2bcccf5a 03-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Patch in part by "yourpalal":
* Set the MENU_STATE_CLOSED state upon BMenu initialization.
* When drawing the label, use the parent bounds, including
item margins to truncate the label, when the parent menu is

Thanks a lot for the patch!

Changes by myself:
* Cache the MenuPrivate instance in BMenuItem::DrawContent().
* Use Window()->UpdateIfNeeded() to animate the flashing invoked menu item,
which makes a lot more sense, the comment about it working in BeOS is
probably due to item->Select() probably drawing outside of an update cycle.
* The trigger invokation in keyboard handling didn't break out of the loop
after invoking an item. Probably didn't matter since triggers are hopefully
not assigned to more than one menu item. :-)
* Use the same trick as BMenuBar to avoid interfering with keyboard navigation
in the BMenu::_Track() hook.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35739 a95241bf-73f2-0310-859d-f6bbb57e9c96

7c0f5738 02-Mar-2010 Rene Gollent <anevilyak@gmail.com>

Remove Tracker's special DnD handling. Instead, BTextView/BTextControl now
honors drag messages containing entry refs and resolves the path of the first
one contained. Will work on a more sophisticated solution that would allow
optionally extracting the file text instead via right click drag context menu
when I have more time.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35731 a95241bf-73f2-0310-859d-f6bbb57e9c96

fa5956d5 28-Feb-2010 Rene Gollent <anevilyak@gmail.com>

Removed obsolete TODO: BMessage is smart enough to already use area transfers if needed.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35688 a95241bf-73f2-0310-859d-f6bbb57e9c96

7ee23666 24-Feb-2010 Stephan Aßmus <superstippi@gmx.de>

Fixed regression reported by Axel. If the BStatusBar is not running in layout
mode, revert to the old behavior to include the room for the labels, even if
there aren't any.
Also in layouted mode, trigger a layout invalidation when switching from running
without labels to using labels and vice versa.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35610 a95241bf-73f2-0310-859d-f6bbb57e9c96

e4a439b4 21-Feb-2010 Rene Gollent <anevilyak@gmail.com>

Fix several problems in BListView:
- SwapItems() did not correctly swap the item tops of the two items being swapped. This would result in quite broken/confusing behavior due to the view having the wrong idea of their current position.
- SwapItems() also did not pass the correct range to _RescanSelection(). This could result in the selection range getting quite confused when swapping items.
- _RescanSelection() did not always correctly reset fLastSelection, though this mostly only would've resulted in unnecessary but harmless work.

Fixes ticket #4253 and possibly some others.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35571 a95241bf-73f2-0310-859d-f6bbb57e9c96

b2e1893c 21-Feb-2010 Stephan Aßmus <superstippi@gmx.de>

Added SetBorder() virtual method and feature. Could also be used by the Terminal
now to polish the tabbed look.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35569 a95241bf-73f2-0310-859d-f6bbb57e9c96

481baf2e 21-Feb-2010 Stephan Aßmus <superstippi@gmx.de>

Fix spelling in debugger invokation.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35568 a95241bf-73f2-0310-859d-f6bbb57e9c96

43a7eb6c 21-Feb-2010 Stephan Aßmus <superstippi@gmx.de>

Add comment explaining why MenusBeginning() is invoked before handling key events
with the command key pressed.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35567 a95241bf-73f2-0310-859d-f6bbb57e9c96

b1e7ac2a 21-Feb-2010 Rene Gollent <anevilyak@gmail.com>

When using layout mode, we need to remove the tab from the layout before updating the selection, otherwise the correct view isn't unhidden in some cases.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35558 a95241bf-73f2-0310-859d-f6bbb57e9c96

19b31ecf 18-Feb-2010 Rene Gollent <anevilyak@gmail.com>

BTabView::Select() needs to update the focus tab.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35517 a95241bf-73f2-0310-859d-f6bbb57e9c96

861e4437 13-Feb-2010 Stephan Aßmus <superstippi@gmx.de>

If we already figured out the correct low colow to use in AttachedToWindow(),
we might as well use it. Couldn't see any regressions so far.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35457 a95241bf-73f2-0310-859d-f6bbb57e9c96

4f24f311 11-Feb-2010 Stephan Aßmus <superstippi@gmx.de>

The decision to inform the server about changed flags needs to depend on the
changed flags, not on the new flags! Fixes the server and client going out of
sync when clearing any flag that the server needs to know about.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35451 a95241bf-73f2-0310-859d-f6bbb57e9c96

c5b26d73 10-Feb-2010 Artur Wyszynski <aljen-mlists@o2.pl>

Simplified logic for a previous fix

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35448 a95241bf-73f2-0310-859d-f6bbb57e9c96

e457eb2a 10-Feb-2010 Artur Wyszynski <aljen-mlists@o2.pl>

Fixed BBox behaviour when it has layout set and BView based class as a label

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35447 a95241bf-73f2-0310-859d-f6bbb57e9c96

731480e8 08-Feb-2010 Rene Gollent <anevilyak@gmail.com>

Call UpdateTextChanged() in BSlider::AttachedToWindow() instead of updating the text manually. Otherwise when a subclass overrode UpdateText and the value hadn't yet been changed, the text would never be updated correctly which resulted in several problems in the VirtualMemory preflet when localizations used a longer string for "Requested swap file size:".

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35435 a95241bf-73f2-0310-859d-f6bbb57e9c96

cee04e80 08-Feb-2010 Artur Wyszynski <aljen-mlists@o2.pl>

Fixed various errors/warnings reported by cppcheck:
* memory leaks
* resource leaks
* added const's to getters
* removed a few reundant conditions

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35433 a95241bf-73f2-0310-859d-f6bbb57e9c96

a487da80 06-Feb-2010 Stephan Aßmus <superstippi@gmx.de>

* Make a BStatusBar comfortable to use without any text labels.
* In SetBarHeight(), use InvalidateLayout() when used with layout management.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35418 a95241bf-73f2-0310-859d-f6bbb57e9c96

85874d8d 04-Feb-2010 Stephan Aßmus <superstippi@gmx.de>

When a Window is created for holding BViews attached to an offscreen bitmap,
always behave as if within a transaction. Otherwise all drawing calls to such
BViews wait for the server to finish the request. This change gives a tremendous
speed boost for these situations and is compatibly with BeOS, since there you
also had to call Sync() before drawing a bitmap that was painted with attached

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35414 a95241bf-73f2-0310-859d-f6bbb57e9c96

5bc9fb9d 01-Feb-2010 Michael Lotz <mmlr@mlotz.ch>

* Replace the truncate_string() helper function with a new, simplified version.
* Remove no longer necessary support functions.
* The new version uses a single BString as input/output parameter and only
modifies that one by removing non-fitting chars and inserting the ellipsis
where appropriate, so avoids copying around bytes/chars/strings in a few
places. It uses the new Chars functions of BString so also no need for manual
multibyte handling.
* Adjusted the BFont and ServerFont usage of truncate_string() which are both
simplified by using the single BString. It avoids a lot of temprary
allocations and string copying. The char * version of BFont
GetTruncatedStrings() now uses the BString version and not the other way
around anymore which requires us to allocate temporary BString objects, it's
not worse than before though.
* This fixes a bunch of problems with the previous functions like always
prepending the ellipsis for B_TRUNCATE_BEGINNING, crashing on short enough
widths, violating the width in the B_TRUNCATE_END case when the width was
short enough, non-optimal truncation in a few cases and sometimes truncation
where none would've been needed. Also fixes #4128 which was a symptom of the

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35381 a95241bf-73f2-0310-859d-f6bbb57e9c96

f3c8afe8 31-Jan-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Fix a bug in OutlineListView::ItemUnderAt that made it pick totally wrong items when some things in the list were collapsed.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35361 a95241bf-73f2-0310-859d-f6bbb57e9c96

e917a240 31-Jan-2010 Rene Gollent <anevilyak@gmail.com>

Fix some selection-related problems in BOutlineListView as well as
broken behavior in _RemoveItem that could potentially result in the wrong
list items being removed/deleted depending on the expanded/collapsed state
of higher items in the list.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35360 a95241bf-73f2-0310-859d-f6bbb57e9c96

5993482b 25-Jan-2010 Stephan Aßmus <superstippi@gmx.de>

Fixed LowColor() of "background" view. Seems this was always wrong, but now we
are running without offscreen view, and this caused dark slider background,
since LowColor() was unintentionally B_TRANSPARENT_COLOR. Fixes #5323.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35284 a95241bf-73f2-0310-859d-f6bbb57e9c96

4cdd68e7 22-Jan-2010 Stephan Aßmus <superstippi@gmx.de>

* Don't draw/clear the background if the parent view draws on children.
* Make use of the BControlLook method to draw labels.

Both fix ticket #4875.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35261 a95241bf-73f2-0310-859d-f6bbb57e9c96

c4e211fe 22-Jan-2010 Stephan Aßmus <superstippi@gmx.de>

* Refactored a method to draw a label when the location is already known.
(This one takes care of setting up the correct color.)
* Added TODO about using either B_CONTROL_TEXT_COLOR, or elliminating that
constant (which I am in favor of...).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35260 a95241bf-73f2-0310-859d-f6bbb57e9c96

10ddee8d 22-Jan-2010 Stephan Aßmus <superstippi@gmx.de>

Tweaked the alpha values to be more in line with the look when not blending.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35257 a95241bf-73f2-0310-859d-f6bbb57e9c96

61ac1a85 22-Jan-2010 Stephan Aßmus <superstippi@gmx.de>

* Set the BLEND_FRAME flag when detecting that the parent view of the control
renders over children.
* Support the BLEND_FRAME flag also when drawing BSliders.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35256 a95241bf-73f2-0310-859d-f6bbb57e9c96

abc26ba8 23-Jan-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by "stimut": Fixed BMenu to return only enabled BMenuItems when invoking
them via mouse. This will make the mechanism that BSeparatorItems are always
disabled actually work and the behavior correct for other items as well. It also
fixes #4147 (Magnify crashing because it assume all its items have a BMessage).

Thanks a lot!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35248 a95241bf-73f2-0310-859d-f6bbb57e9c96

3e6fa229 13-Jan-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Humdinger:
Switched strings to sentence case in servers and kits. This is the
case-servers+kits.diff applied from #5169. Couldn't spot any possibly
problematic changes.
Thanks a lot!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35044 a95241bf-73f2-0310-859d-f6bbb57e9c96

e74e04d6 12-Jan-2010 Stephan Aßmus <superstippi@gmx.de>

Added TODO note about making sure that B_FRAWE_EVENTS is part of the flags
as soon as a scroll view is controlling the list view. Otherwise scroll bars
are not updated if FrameEvents() is not called. I can imagine problems, though,
if an application did not set B_FRAWE_EVENTS on purpose and is controlling
the scroll bars itself.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35035 a95241bf-73f2-0310-859d-f6bbb57e9c96

cd591a3e 08-Jan-2010 Oliver Tappe <zooey@hirschkaefer.de>

* BTextView no longer inverts the caret although there is a selection, which
would yield double inversion of the caret position, causing #5006
* cleanup with respect to when the selection can be highlighted and/or the
caret can be shown/hidden

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34944 a95241bf-73f2-0310-859d-f6bbb57e9c96

9d6dc833 10-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Made sure the tool tip stays on screen without moving itself below the cursor;
I'm afraid there is nothing left of stippi's earlier solution. This fixes
bug #5097.
* The alignment as specified in the BToolTip is now respected.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34616 a95241bf-73f2-0310-859d-f6bbb57e9c96

f331ce24 02-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* CanContinue() should obviously return "true" before there is a reason to stop,
ie. also before BeginJob() has been called.
* This fixes BePDF and Gobe Productive not being able to print under Haiku.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34446 a95241bf-73f2-0310-859d-f6bbb57e9c96

e90df819 02-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34445 a95241bf-73f2-0310-859d-f6bbb57e9c96

ea3a9471 30-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Should have been part of r34388. be_clipboard initialization.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34390 a95241bf-73f2-0310-859d-f6bbb57e9c96

015943d7 30-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Use pthread_once() to guard the initialization of sPaletteConverter. This
changes the semantics slightly: Previously after a failed initialization
another invocation of InitializeDefault() could theoretically initialize the
converter. Since the only error conditions are out of memory and broken app
server connection, this shouldn't really matter, though.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34383 a95241bf-73f2-0310-859d-f6bbb57e9c96

1cbfe2ef 30-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Moved the static stuff into a singleton.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34376 a95241bf-73f2-0310-859d-f6bbb57e9c96

0eb45760 29-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Turned FontList into a singleton.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34374 a95241bf-73f2-0310-859d-f6bbb57e9c96

17f68169 29-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Turned the screens list into a singleton.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34373 a95241bf-73f2-0310-859d-f6bbb57e9c96

4a6fb0a8 30-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Turned the loaded images map into a singleton.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34368 a95241bf-73f2-0310-859d-f6bbb57e9c96

adcb8345 30-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* The WidthBuffer lock was unnecessarily static. Made it an object member.
* Automatic whitespace cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34367 a95241bf-73f2-0310-859d-f6bbb57e9c96

4ac097c5 30-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Made the BToolTipManager lock non-static. Create the singleton via

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34366 a95241bf-73f2-0310-859d-f6bbb57e9c96

5f341c38 29-Nov-2009 Philippe Saint-Pierre <stpere@gmail.com>

Reverting r34335. Wrong location of my "B_NOT_MINIZABLE" check.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34350 a95241bf-73f2-0310-859d-f6bbb57e9c96

9b606d42 28-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* TabFrame() did not check if the index was valid. This should fix #5051.
* Cleanup, removed commented code.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34346 a95241bf-73f2-0310-859d-f6bbb57e9c96

2c9bea98 28-Nov-2009 Philippe Saint-Pierre <stpere@gmail.com>

Make BWindow honor the B_NOT_MINIMIZABLE flag. Fixes ticket #4337.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34335 a95241bf-73f2-0310-859d-f6bbb57e9c96

af10de93 28-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Changed a comment

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34329 a95241bf-73f2-0310-859d-f6bbb57e9c96

4ce4d86b 22-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

The scrollbars need to be constructed before calling
BView::TargetedByScrollView(), otherwise the target view couldn't
access them in that method.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34186 a95241bf-73f2-0310-859d-f6bbb57e9c96

09749e95 18-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Added a BWindow::InViewTransaction() that determines whether or not the
window is currently updating its drawings as suggested by Stippi.
* Add this method to decide whether to call _FontChanged() in

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34109 a95241bf-73f2-0310-859d-f6bbb57e9c96

289d85d2 18-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* BWindow::SendBehind(NULL) will now send the window to back.
* Added shortcuts ctrl-alt-F to get a window to front, and ctrl-alt-b to move it
to the back.
* Updated the user guide with these shortcuts, and also explained the missing
"single click to bring window to front" behaviour.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34108 a95241bf-73f2-0310-859d-f6bbb57e9c96

5a0982b5 16-Nov-2009 Jonas Sundström <jonas@kirilla.com>


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34081 a95241bf-73f2-0310-859d-f6bbb57e9c96

faf42dfe 13-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Disabled calling _FontChanged() on SetFont() - since any item can temporarily
change the font in its DrawItem() method, this is not the way to go.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34023 a95241bf-73f2-0310-859d-f6bbb57e9c96

4914357d 07-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Automatic trailing whitespace removal.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33929 a95241bf-73f2-0310-859d-f6bbb57e9c96

5f917b22 06-Nov-2009 Oliver Tappe <zooey@hirschkaefer.de>

Implement a suggestion of Humdinger in the aftermath of #4785:
* make word-wise navigation via cursor keys match Pe, such that it is consistent
throughout haiku (unless some applications brew their own)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33913 a95241bf-73f2-0310-859d-f6bbb57e9c96

76d24e95 05-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Ugh, forgot to check this in quite a while ago:
If the view doesn't have a tool tip, pass the B_MOUSE_IDLE to the next handler,
so the parent view can show a tool tip. This makes tool tips in a column list
view possible (or at least reasonably easy).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33902 a95241bf-73f2-0310-859d-f6bbb57e9c96

bd34734f 04-Nov-2009 Oliver Tappe <zooey@hirschkaefer.de>

fixed regression of r33882 reported by Michael Weirauch:
* wrapping must always be possible at a newline!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33886 a95241bf-73f2-0310-859d-f6bbb57e9c96

a85a827c 04-Nov-2009 Oliver Tappe <zooey@hirschkaefer.de>

* introduced two new private methods, _PreviousWordStart() and _NextWordStart(),
which are now being used to implement the word-wise keyboard navigation,
fixing #4785

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33885 a95241bf-73f2-0310-859d-f6bbb57e9c96

32c29a08 04-Nov-2009 Oliver Tappe <zooey@hirschkaefer.de>

Reworked character class handling in BTextView:
* Word selection via double-click now works like in R5, except that '_' is now
being considered part of a textual word, too. This fixes #4754.
* Adjusted CanEndLine() to make much more sense (at least for western
While I have tested the wrapping quite a bit, it is not unlikely that these
changes introduce regressions. If you spot one, please tell!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33882 a95241bf-73f2-0310-859d-f6bbb57e9c96

baa33660 04-Nov-2009 Oliver Tappe <zooey@hirschkaefer.de>

* the textrect.right should always be rounded up to the next integer -
fixes #4894
* PointAt() now rounds x- and y-positions to the next integer instead of always
rounding them up - this yields improved caret-positions (e.g. before an 'f'

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33877 a95241bf-73f2-0310-859d-f6bbb57e9c96

075cff30 29-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Also resize the window if it wouldn't fit on screen otherwise.
* Fixes bug #3675.
* Minor cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33828 a95241bf-73f2-0310-859d-f6bbb57e9c96

4b0f176d 28-Oct-2009 Oliver Tappe <zooey@hirschkaefer.de>

Fix more regressions in _AutoResize() visible when renaming a file in Tracker
(reported by Axel):
* _AutoResize() can no longer check the difference between the textrect and
the maximum line width, as the textrect is no being adjusted earlier during
the line-calculation code - instead, it needs to measure the difference
between the bounds and the textrect width plus the insets.
* MakeResizable(true) needs to reset the right inset, as otherwise the auto-
resizing would get confused about how large the textview needs to be
(seems to be an artefact of how Tracker creates the textview).
* GetInsets() doesn't need to compute the insets, as they're maintained in

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33813 a95241bf-73f2-0310-859d-f6bbb57e9c96

4223d92e 25-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed lots of style violations, many of them introduced with r33732.
* Brecht, is it possible your line break column is one character too short? At
least you broke some lines without need.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33766 a95241bf-73f2-0310-859d-f6bbb57e9c96

4ac5ee1c 25-Oct-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed BOptionPopUp when used in the layout system.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33764 a95241bf-73f2-0310-859d-f6bbb57e9c96

c544ccf5 25-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Expand(), and Collapse() aren't supposed to do the work themselves.
* Instead, they should call the protected virtual ExpandOrCollapse(), this makes
one of my apps work again under Haiku (where the list view contents are
filled on demand).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33760 a95241bf-73f2-0310-859d-f6bbb57e9c96

510fae5f 25-Oct-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Also add layout-friendly constructor for BOptionPopUp (not yet tested)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33757 a95241bf-73f2-0310-859d-f6bbb57e9c96

ba69bf19 25-Oct-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added layout friendly constructor for BOptionControl

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33756 a95241bf-73f2-0310-859d-f6bbb57e9c96

14cf6a83 22-Oct-2009 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

This does seem more logical and makes it build on gcc4. Not sure if it's the right thing :)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33734 a95241bf-73f2-0310-859d-f6bbb57e9c96

926e63c8 22-Oct-2009 Brecht Machiels <brecht@mos6581.org>

* added click to focus mouse mode; right-click for bring-to-front and send-to-back
(might cause some regressions in FFM)
* made accept first click user configurable
* updated the Mouse preflet to use the layout kit
* removed the warp and instant warp modes from the Mouse preflet
* changed internal representation of mouse modes (warp modes moved)
* coding style fixes

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33732 a95241bf-73f2-0310-859d-f6bbb57e9c96

ec397948 21-Oct-2009 Oliver Tappe <zooey@hirschkaefer.de>

fix regression reported in #4826:
* SetTextRect for non-wrapped textviews needs to update the insets,
as otherwise several misalignments occur within several apps - renaming
in Tracker was effected the worst, though

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33717 a95241bf-73f2-0310-859d-f6bbb57e9c96

32c8ab89 21-Oct-2009 Oliver Tappe <zooey@hirschkaefer.de>

* added _TabExpandedStyledWidth(), which makes sure to expand all tab chars
during the width calculation
* used _TabExpandedStyledWidth() at all places that need to expand tabs,
fixing #4822
* removed _StyledWidthUTF8Safe() as it didn't make sense - we now perform
the same auto-scrolling horizontally as we do vertically

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33713 a95241bf-73f2-0310-859d-f6bbb57e9c96

b18f133d 21-Oct-2009 Oliver Tappe <zooey@hirschkaefer.de>

generally overhauled non-wrapping mode of BTextView, as it was considerably broken:
* switching from wrapping to non-wrapping mode triggers a recomputation of
the text rect
* non-wrapping mode now triggers updating of the data rect for the horizontal
scrollbar as needed, fixing #4705
* corrected a couple of width computations that confused bounds and text
rect width, leading to drawing artefacts at the end of a line
* unified computation of text rect width to always take all lines into
account (not just the first one)
* some cleanup

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33703 a95241bf-73f2-0310-859d-f6bbb57e9c96

3ee51068 21-Oct-2009 Oliver Tappe <zooey@hirschkaefer.de>

* added helper method MaxWidth() to BTextView::LineBuffer

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33702 a95241bf-73f2-0310-859d-f6bbb57e9c96

80351b4d 21-Oct-2009 François Revol <revol@free.fr>

- this should fix gcc2 build, sorry ;)
- style fixes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33691 a95241bf-73f2-0310-859d-f6bbb57e9c96

223ae47d 20-Oct-2009 François Revol <revol@free.fr>

Extend the Ctrl-Alt-arrows shortcuts to also move the current window when shift is held, as on Gnome.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33690 a95241bf-73f2-0310-859d-f6bbb57e9c96

01618252 19-Oct-2009 Stephan Aßmus <superstippi@gmx.de>

Fixed an annoying problem with the scroll bar repeat feature. If you clicked
a button or within the bar background within the timeout for the repeat-thread,
the thread would exit and there would be no repeating. I think there is still
a race condition somewhere since I managed to see it stall once again, probably
because it locks the looper twice in the loop...

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33666 a95241bf-73f2-0310-859d-f6bbb57e9c96

20a11271 17-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Added a (to be virtual) DefaultItemSpacing() method to control look. This is
what you should use in for example BGroupLayout as spacing/inset.
* Changed the label spacing to be dependent on the font size, too (and enlarged
it a bit as well).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33621 a95241bf-73f2-0310-859d-f6bbb57e9c96

07dbd4d5 17-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup, no functional change.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33615 a95241bf-73f2-0310-859d-f6bbb57e9c96

2fc49d9b 14-Oct-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added ColumnAt(BPoint) version.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33587 a95241bf-73f2-0310-859d-f6bbb57e9c96

786fa735 09-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed drawing glitch with B_FANCY_BORDER.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33492 a95241bf-73f2-0310-859d-f6bbb57e9c96

931cd377 07-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Added a new flag kAcceptKeyboardFocusFlag that allows B_AVOID_FOCUS windows
to still receive keyboard events. This is now used for menu windows (before,
the menu feel alone would trigger that behaviour).
* This also fixes bug #4691, as tool tip windows use the menu feel as well.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33481 a95241bf-73f2-0310-859d-f6bbb57e9c96

81c431d2 05-Oct-2009 Michael Lotz <mmlr@mlotz.ch>

Include the terminating 0 byte when adding as string type. Otherwise someone
reading the message as an actual string will run into problems.
Should fix #4697.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33442 a95241bf-73f2-0310-859d-f6bbb57e9c96

7a842ef7 04-Oct-2009 Stephan Aßmus <superstippi@gmx.de>

Check negative out-of-bounds index in BTextView::OffsetAt(). According to
#4707, this is the BeOS behavior. I have not checked myself and the BeBook is
very brief on this, but similar methods do trim indices to be in range.
Another alternative would be returning an index indicating an error (-1).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33439 a95241bf-73f2-0310-859d-f6bbb57e9c96

8a5e590d 28-Sep-2009 Stephan Aßmus <superstippi@gmx.de>

Work based on a patch by Joshua R. Elsasser:
* Some key-sequences cause \0 chars in the "bytes" data which is supposed to
be passed to BView::KeyDown() and BView::KeyUp(). Therefor, one cannot use
string methods for adding/extracting the data to/from the events. For
example, Control-Space now works in the Terminal.

Thanks a lot for the original patch, Joshua!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33338 a95241bf-73f2-0310-859d-f6bbb57e9c96

92c015e6 18-Sep-2009 Stephan Aßmus <superstippi@gmx.de>

Make sure tool tips are not displayed outside of the screen bounds.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33166 a95241bf-73f2-0310-859d-f6bbb57e9c96

0210dcd7 18-Sep-2009 Stephan Aßmus <superstippi@gmx.de>

Small cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33165 a95241bf-73f2-0310-859d-f6bbb57e9c96

58465926 07-Sep-2009 Michael Lotz <mmlr@mlotz.ch>

Fix auto indent feature of BTextView. The indent was inserted before the line
break instead of after. Also whitespace after the cursor position wasn't

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32993 a95241bf-73f2-0310-859d-f6bbb57e9c96

3ecf187e 04-Sep-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Made MenuWindow::GetSteps() const.
Increased the scrollers size from 10 to 12, since at high resolutions,
they're really too small.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32932 a95241bf-73f2-0310-859d-f6bbb57e9c96

96f041c5 03-Sep-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Also scroll by a small step, when using the menuscrollers.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32923 a95241bf-73f2-0310-859d-f6bbb57e9c96

4aa6ec09 02-Sep-2009 Axel Dörfler <axeld@pinc-software.de>

* IsMinimized() now locks the window. This should fix bug #4274.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32902 a95241bf-73f2-0310-859d-f6bbb57e9c96

b439d6e5 31-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

* Moved restriction to min/max column width from where GetColumnPreferredWidth
was used into GetColumnPreferredWidth for convenience.
* Disabled cached total column width in title view, since it wasn't properly
maintained. Instead of finding the bug (the code should use proper listening
mechanisms, and such problems would go away automatically), the total width
is now calculated on the fly. It is used for updating the horizontal
* Resolved TODO in PreferredSize(), the width is now based on the preferred
width of all columns.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32850 a95241bf-73f2-0310-859d-f6bbb57e9c96

8c212161 31-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

* When dragging/resizing columns, remember and take the click offset into
* When releasing the mouse buttom from a resize operation, don't reset the
view cursor, as we would still start resizing the column again if we

This doesn't only improve these mouse operations, but solves weird jumping
columns, for example when just clicking in the resize hot-area.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32849 a95241bf-73f2-0310-859d-f6bbb57e9c96

9fe35223 26-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* BWindowScreens had no sychronization mechanism whatsoever - since the
workspace activation message was asynchronous, whether or not the
BWindowScreen stopped drawing in time was pure luck (this also caused crashes
with the VESA driver, as that one unmaps its frame buffer during mode switch).
Introduced a new AS_DIRECT_SCREEN_LOCK protocol for this.
* In the long term, we should let BWindowScreen use the same mechanism as
BDirectWindows, though.
* Removed superfluous locking in BDirectWindow::_InitData().

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32746 a95241bf-73f2-0310-859d-f6bbb57e9c96

89208c77 27-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

Finished unifying the Interface Kit headers:
* Fixed copyrights (puncuation and capitalization, removed authors from
* Updated indentation style
* Unified pointer/reference style
* Re-ordered some methods for better grouping where it could be done
(abd adopted source accordingly)
* Small coding style fixes here and there

No functional change intended.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32745 a95241bf-73f2-0310-859d-f6bbb57e9c96

33d568ae 26-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

* Indentation cleanup
* Code cleanup
* Refactoring (the unit tests still pass)
* Disabled experimental API (BAffineTransform, which is not yet publically
available anyway)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32723 a95241bf-73f2-0310-859d-f6bbb57e9c96

8cc8b1b7 26-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

* Updated indentation style
* Fixed copyright
* Reordered inherited virtuals to improve the grouping


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32718 a95241bf-73f2-0310-859d-f6bbb57e9c96

6eb37bde 25-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

* Copyright fixed
* Indentation updated.
* Better grouping of methods.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32702 a95241bf-73f2-0310-859d-f6bbb57e9c96

13e50c47 25-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

* Indentation cleanup.
* 80 chars limit
* Copyright fixed.
* Better grouping of methods.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32701 a95241bf-73f2-0310-859d-f6bbb57e9c96

0a5897b7 26-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

* Updated indentation style
* Better grouping of methods
* Fixed copyright

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32700 a95241bf-73f2-0310-859d-f6bbb57e9c96

a3840a51 26-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

One more little cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32688 a95241bf-73f2-0310-859d-f6bbb57e9c96

c5c20344 26-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

* Cleaned up the header
* Reordered methods to group them logically
* Use nothrow version of new when instantiating BCheckBox from archive.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32687 a95241bf-73f2-0310-859d-f6bbb57e9c96

d89b690d 25-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

* Finished rewriting the header.
* Cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32667 a95241bf-73f2-0310-859d-f6bbb57e9c96

d62eae6e 24-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Do not allow a menu window to be movable. This fixes bug #4314.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32650 a95241bf-73f2-0310-859d-f6bbb57e9c96

19bce722 22-Aug-2009 Ryan Leavengood <leavengood@gmail.com>

Remove the forced resizing to preferred size when CenterIn is called, and
instead just check if the size limits need to be set. The code that previously
did this when processing the B_LAYOUT_WINDOW message was extracted into a
private method, which is called from both places.

This may be slightly wasteful in some cases (since the size limits may be set
multiple times), but it is definitely needed because without it both of the
current test apps (DiskProbe and Screenshot) did not have properly centered

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32622 a95241bf-73f2-0310-859d-f6bbb57e9c96

b0586d61 22-Aug-2009 Ryan Leavengood <leavengood@gmail.com>

Remove useless BRect* version of CenterIn, make remaining version take a const
BRect reference.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32614 a95241bf-73f2-0310-859d-f6bbb57e9c96

2ff62714 22-Aug-2009 Ryan Leavengood <leavengood@gmail.com>

Finally implemented BWindow::CenterOnScreen, with associated CenterIn(BRect)
methods as well as Size(). To avoid the problem of centering the window before
it has been resized by the layout system, I force the resizing early. If there
is a better way to do this or some way to avoid doing it repeatedly, let me
know. But I figure the Center* methods should not be called that often.

Updated Screenshot and DiskProbe to use this new method as a test. It certainly
cleaned up DiskProbe. I will update other code over the next few days (if
anyone wants to help, please do :)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32612 a95241bf-73f2-0310-859d-f6bbb57e9c96

d587e0fb 21-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Not sure why we are that generous (copying BView behaviour), but pressing
Alt, Option, or Control while scrolling the menu via the mouse wheel now
scrolls page wise.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32581 a95241bf-73f2-0310-859d-f6bbb57e9c96

c1df12d2 21-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

fixed / removed comments

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32563 a95241bf-73f2-0310-859d-f6bbb57e9c96

1f3bec89 21-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

removed resolved TODO comment

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32562 a95241bf-73f2-0310-859d-f6bbb57e9c96

e18224cd 21-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Added a new AS_GET_SCREEN_FRAME function, as getting the frame via
AS_SCREEN_GET_MODE won't work with multi-screen support anymore, and is also
more overhead than needed.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32559 a95241bf-73f2-0310-859d-f6bbb57e9c96

f7e005eb 21-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Moved PrivateScreen.h header to headers/private/interface.
* Desktop is now including it as well to be able to use the new
* Include order cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32558 a95241bf-73f2-0310-859d-f6bbb57e9c96

aadbd94e 21-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* BPrivateScreen used B_CURRENT_WORKSPACE where an index was required. This
was reason that caused bug #2658.
* Introduced a new constant B_CURRENT_WORKSPACE_INDEX in PrivateScreen.h; maybe
this should be made public one day.
* Fixed another reason that caused bug #2658: BPrivateScreen waited 100ms
between frame updates, leaving a large window open for such problems; I've
reduced it to 10ms now, but the actual bug fix is to reset the counter for
each BScreen object, so that when you create a new BScreen object, the frame
is retrieved timely.
* The reference count was not initialized, causing BPrivateScreens to be leaked

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32557 a95241bf-73f2-0310-859d-f6bbb57e9c96

0eed9183 20-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Rewrote screen configuration management: VirtualScreen doesn't have anything
to do with the configurations now, instead, there is a separated
ScreenConfigurations class that maintains all known screen_configurations
per workspace (and the Workspace::Private class has two of them, one for the
current modes, one for the stored modes).
* Added Desktop::{Get|Set}ScreenMode() methods, ServerApp now only calls those.
* Getting and setting of anything else than the current screen is now supported.
* This change also fixes that a temporarily set screen mode was not being
restored on workspace switch.
* Also, the Deskbar now seems to have the wrong location a lot, which is
something that should be easily fixable therefore. I will look into this next.
* Got rid of the unhandy screen_id structure server side, and in BPrivateScreen;
we now just use an int32 - the next API break should definitely replace the
screen_id with a simple typedef.
* Some cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32541 a95241bf-73f2-0310-859d-f6bbb57e9c96

87da7984 19-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Contrl-~ now switches between application windows. This is handier than the
mechanism used in BeOS, that is to press Control+Option-Tab (which didn't
work on Haiku, though).
* Did not change the window switch logic, though, so it's still not really

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32524 a95241bf-73f2-0310-859d-f6bbb57e9c96

5b0a5c36 19-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Our jump-to-next-group never worked, and since no one complained, option-tab
now takes over this role (leaving Alt-Tab) to the application.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32517 a95241bf-73f2-0310-859d-f6bbb57e9c96

ec3e7feb 19-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* The PNGDump stuff is no longer used.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32516 a95241bf-73f2-0310-859d-f6bbb57e9c96

2ecef7f3 19-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Reuse an existing text tool tip, when a new text is set.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32515 a95241bf-73f2-0310-859d-f6bbb57e9c96

9946ba71 16-Aug-2009 Oliver Tappe <zooey@hirschkaefer.de>

* reordered members of BTextView to be compatible with R5 again,
although it should have been safe before, too, since BTextView neither
has inline methods nor any friends that live outside of libbe
* added new member fLastClickOffset in order to be able to restore the
triple-click handling (linewise selection)
* renamed fClickOffset to fCaretOffset, as that is what it really is

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32444 a95241bf-73f2-0310-859d-f6bbb57e9c96

5ffbab2a 10-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Made the BToolTip interface a bit more convenient to use when subclassing it.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32249 a95241bf-73f2-0310-859d-f6bbb57e9c96

60286ab2 11-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Use kMenuWindowFeel for the tool tips, or else they won't work on
B_AVOID_FRONT windows (like the Deskbar).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32247 a95241bf-73f2-0310-859d-f6bbb57e9c96

fcd50212 11-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Made the tool tip manager's lock available, and guarded adding/removing the
tool tip view with this lock, too.
* BTextToolTip::SetText() can now be called in all circumstances safely.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32242 a95241bf-73f2-0310-859d-f6bbb57e9c96

99452e33 10-Aug-2009 Jonas Sundström <jonas@kirilla.com>


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32233 a95241bf-73f2-0310-859d-f6bbb57e9c96

a57dddca 10-Aug-2009 Jonas Sundström <jonas@kirilla.com>

Add TabFrame window property.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32228 a95241bf-73f2-0310-859d-f6bbb57e9c96

12194e33 07-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Added missing default initializer for the message.
* Changed BMenuField::MenuBarLayoutItem::BasePreferredSize() to return the
min size as well, instead of a fixed 100 pixels for the width...
* More minor cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32177 a95241bf-73f2-0310-859d-f6bbb57e9c96

50f8cd14 07-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup, no functional change.
* Remove superfluous operator=() implementations.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32174 a95241bf-73f2-0310-859d-f6bbb57e9c96

d82ea8ab 07-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Only take the popup marker into account if fShowPopUpMarker is true.
* Automatic whitespace cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32173 a95241bf-73f2-0310-859d-f6bbb57e9c96

01592a40 06-Aug-2009 Rene Gollent <anevilyak@gmail.com>

Fix small style violation.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32172 a95241bf-73f2-0310-859d-f6bbb57e9c96

102a66c3 06-Aug-2009 Rene Gollent <anevilyak@gmail.com>

BMenuField's private menu bar did not take into account the width of the popup indicator when computing its minimum size. Fixes ticket #3635.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32171 a95241bf-73f2-0310-859d-f6bbb57e9c96

a8266798 05-Aug-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Only build the gcc 2 compatibility symbols with gcc 2.
* Added gcc 4 _ReservedView11() compatibility symbol.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32132 a95241bf-73f2-0310-859d-f6bbb57e9c96

d6629c31 05-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

fixed copy/paste error which caused bug #4186. Sorry

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32127 a95241bf-73f2-0310-859d-f6bbb57e9c96

1bfa2699 04-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Made the default tool tip color a bit easier on the eye.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32114 a95241bf-73f2-0310-859d-f6bbb57e9c96

44145c74 03-Aug-2009 Oliver Tappe <zooey@hirschkaefer.de>

Fixed two more peculiarities in ListView:
* when items are removed, the anchor may need adjustment (fixes the problem
in Beam reported by Stippi)
* the check for needed adjustment of fLastSelected in _Select(from, to, extend)
was broken, as it needs to be independent of fFirstSelected - this fixes
broken navigation after doing a select-all

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32099 a95241bf-73f2-0310-859d-f6bbb57e9c96

9fe39401 03-Aug-2009 Oliver Tappe <zooey@hirschkaefer.de>

small cleanup in ListView:
* avoid setting fAnchorIndex multiple times in certain situations

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32090 a95241bf-73f2-0310-859d-f6bbb57e9c96

9f981a88 03-Aug-2009 François Revol <revol@free.fr>

Fix a warning.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32083 a95241bf-73f2-0310-859d-f6bbb57e9c96

8318af01 03-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Added a basic tool tip API, and implementation.
* The BView API can probably be regarded as good enough; the implementation
might need to be improved over time (also, some things as archivability
aren't fully implemented yet). The ToolTip.h header should get public once
* Added new B_MOUSE_IDLE message that is sent to a BView after a certain
time has passed (BToolTipManager::ShowDelay()).
* Added small test app (ToolTipTest) that shows what is already working.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32078 a95241bf-73f2-0310-859d-f6bbb57e9c96

360495a3 03-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Only use the new preferred computation method if word wrap is disabled, or
else this won't work as is (this is something that could be done, better,

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32077 a95241bf-73f2-0310-859d-f6bbb57e9c96

0b1db200 03-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* The preferred size is now actually the preferred size - the size that is
needed to show all of the text view's contents. No idea what the previous
solution was about.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32075 a95241bf-73f2-0310-859d-f6bbb57e9c96

dcc8ae91 01-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Some cleanups: made the bitmaps static, moved variables around. No functional change.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32056 a95241bf-73f2-0310-859d-f6bbb57e9c96

51ab53a6 31-Jul-2009 Rene Gollent <anevilyak@gmail.com>

Fix some regressions in keyboard shift selection behavior introduced by the last set of changes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32053 a95241bf-73f2-0310-859d-f6bbb57e9c96

d7a16b23 31-Jul-2009 Michael Lotz <mmlr@mlotz.ch>

* Fully switch to the Haiku message format so that it is also used for on-disk
* Remove reduntant information from the header (field_count vs. fields_size).
* Remove checksums previously used to validate the message passing by area
* Move variables that are purely used by the instance out of the header and into
the BMessage object.
* Use more sensible types for the different message fields.
* Reduce some field sizes to realistic values.
* Make size_t values into uint32 values so the message format will not change
when later moving to 64 bits.
* Pack the structures used for flat message storage so it doesn't change
because of padding.
* Fix message passing by area. It never worked because the created area was
never actually filled with any data!
* Some more allocation checks with graceful fallbacks (should be all now).
* Some more checks for negative index values (should also be all now).
* Make printing more inline with how the rest of the class works and make some
of the output more consistent.
* Also add the new unsigned types to PrintToStream() output.
* Fix printing of unknown types and invalid BMessages, it would always have
printed only the first entry respectively the same error.
* Added some clarifying comments.
* Cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32039 a95241bf-73f2-0310-859d-f6bbb57e9c96

74b19566 30-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

Turned off mouse wheel support in BTabView to switch the tabs. I think that
functionality like this is mostly annoying with little use to be honest, but
other opinions are welcome, of course :-)

It reminds me too much about the insane workspace switching via the mouse
wheel in Ubuntu.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32008 a95241bf-73f2-0310-859d-f6bbb57e9c96

33e0d2e4 30-Jul-2009 Rene Gollent <anevilyak@gmail.com>

Also remove no longer needed variable.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32003 a95241bf-73f2-0310-859d-f6bbb57e9c96

5171d87a 30-Jul-2009 Rene Gollent <anevilyak@gmail.com>

Removed stray debug printf.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32002 a95241bf-73f2-0310-859d-f6bbb57e9c96

c08c945f 30-Jul-2009 Oliver Tappe <zooey@hirschkaefer.de>

Two more changes to BListView:
* fixed handling of B_HOME and B_END in extend mode for multiselection, such that
now all the items inbetween the anchor and the final target are selected, too
* made sure that the anchor always gets adjusted in _Select(), as otherwise
navigation via cursor keys could get "locked".

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31980 a95241bf-73f2-0310-859d-f6bbb57e9c96

c2c39a98 30-Jul-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved functions declarations to InterfacePrivate.h

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31979 a95241bf-73f2-0310-859d-f6bbb57e9c96

81bbdfe9 30-Jul-2009 Oliver Tappe <zooey@hirschkaefer.de>

Fixed two problems in BListView:
* fixed recent regression with respect to navigating via cursor keys
* unified (and thus partly corrected) computation of whether or not we're in
extend mode in KeyDown(), fixing the handling of unmodified B_HOME and B_END
in multiselection mode

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31975 a95241bf-73f2-0310-859d-f6bbb57e9c96

753365b4 30-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Added new (private) calls {get|set}_workspaces_layout().
* Implemented old count_workspaces(), and set_workspace_count() using the
new functions.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31971 a95241bf-73f2-0310-859d-f6bbb57e9c96

3a816565 30-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* BControl::AttachedToWindow() now also sets the background color to
B_PANEL_BACKGROUND_COLOR if there is no parent.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31969 a95241bf-73f2-0310-859d-f6bbb57e9c96

eac9c545 29-Jul-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

CreateBitmap(): Fail if it can not allocate bitmaps.
In init_interface_kit(), check the return value of MenuPrivate::CreateBitmaps()
and fail on error.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31964 a95241bf-73f2-0310-859d-f6bbb57e9c96

7a8567e6 30-Jul-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved MenuPrivate implementation to its own file. Made MenuPrivate.h
self-contained. Adjusted other files accordingly.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31963 a95241bf-73f2-0310-859d-f6bbb57e9c96

c3d7cee2 30-Jul-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Instead of creating the Modifiers bitmaps on demand, for every DrawItem invocation,
for every BMenuItem, have them created in _init_interface_kit(), and keep
them cached. This required some reorganisation of the code in Menu and MenuItem.
Also has the side effect that BMenuItem doesn't have to know about the
alt/ctrl/command keys stuff.
Added a comment in BMenu::AttachedToWindow().

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31962 a95241bf-73f2-0310-859d-f6bbb57e9c96

69f9a367 29-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* The app_server no longer uses workspace counts internally, but only columns,
and rows.
* set_workspace_count() now uses the logic formerly found in
WorkspacesView::_GetGrid() to determine the layout.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31958 a95241bf-73f2-0310-859d-f6bbb57e9c96

49056337 28-Jul-2009 Rene Gollent <anevilyak@gmail.com>

Fix another omitted instance of anchor updating.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31891 a95241bf-73f2-0310-859d-f6bbb57e9c96

7155254d 28-Jul-2009 Rene Gollent <anevilyak@gmail.com>

Fix several instances of the anchor index not being properly tracked. When shift-selecting via keyboard, rely on the anchor to know where to shift the selection towards. Fixes rest of ticket #4120.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31890 a95241bf-73f2-0310-859d-f6bbb57e9c96

e80a60b5 28-Jul-2009 Rene Gollent <anevilyak@gmail.com>

Only react to B_SELECT_ALL when in multiple selection mode. Fixes part of ticket #4120.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31889 a95241bf-73f2-0310-859d-f6bbb57e9c96

8752f52d 28-Jul-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added an (empty) destructor. Use a const BRegion (since we can now), honour
the 80 column limit. Some comment clarification.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31853 a95241bf-73f2-0310-859d-f6bbb57e9c96

82ad5f99 28-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

Doh... added the BSeparatorView to libbe.so.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31847 a95241bf-73f2-0310-859d-f6bbb57e9c96

79f2db07 28-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

Implemented a BSeparatorView. It can be a horizontal or vertical line/border,
or also a label, optionally with a BView for the label. Some aspects of it have
not been exposed to throughrough testing, yet (archiving, label view),
the BAlignment support is also not well tested.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31846 a95241bf-73f2-0310-859d-f6bbb57e9c96

2e6adc56 27-Jul-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added a _BPictureExtent_::Flatten(), moved some code from BPicture::Flatten()
into it. Renamed ImportData() to Unflatten(). Some code shuffling.
No functional change.
Some style cleanup needed.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31842 a95241bf-73f2-0310-859d-f6bbb57e9c96

1d6720dc 27-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Don't use B_ZOOM; this does not respect the B_NOT_ZOOMABLE flag, same problem
as with B_MINIMIZE. This fixes bug #4134.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31828 a95241bf-73f2-0310-859d-f6bbb57e9c96

47d9ed62 27-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Added AS_GET_WORKSPACE_LAYOUT to get the number of columns/rows of the
* Added shortcuts Ctrl-Alt-{Left|Right|Up|Down} to switch to adjacent

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31824 a95241bf-73f2-0310-859d-f6bbb57e9c96

6d52606f 27-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Don't use the B_MINIMIZE message for the minimize shortcut (ctrl-alt-m), since
that ignores the B_NOT_MINIMIZABLE flag. Instead, there is now a private
_MINIMIZE_ message (naming like those other ugly private BMessage constants in
AppDefs.h) which honours that flag.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31799 a95241bf-73f2-0310-859d-f6bbb57e9c96

f09d0bff 27-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Style cleanups.
* Removed former dead print-screen code.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31797 a95241bf-73f2-0310-859d-f6bbb57e9c96

63c07622 26-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Some style cleanups, no functional change.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31759 a95241bf-73f2-0310-859d-f6bbb57e9c96

40265acf 26-Jul-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fix the build

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31758 a95241bf-73f2-0310-859d-f6bbb57e9c96

ab53bb20 26-Jul-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Export get_bytes_per_row() from InterfacePrivate.h, and use it in ServerBitmap
in place of the own rolled implementation. Comment typo fix.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31757 a95241bf-73f2-0310-859d-f6bbb57e9c96

1b98cebd 24-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

Turn off the optimization to skip calling Flush() when an invalidate request
was already sent by this or another view. This was already the case for the
BRect version of Invalidate(), but was forgotten in the BRegion version. I
just had an idea what the problem could be, but I think it's bogus. Needs some
investigation. Should fix ticket #4119 for the time being.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31734 a95241bf-73f2-0310-859d-f6bbb57e9c96

a5339f65 24-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

Fix a GCC4 warning.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31733 a95241bf-73f2-0310-859d-f6bbb57e9c96

514fcf3b 15-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Pass the mouse wheel message to our parent (ie. the next handler) if we don't
have any scrollers.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31580 a95241bf-73f2-0310-859d-f6bbb57e9c96

68504ee9 15-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Style cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31579 a95241bf-73f2-0310-859d-f6bbb57e9c96

4e23bc03 02-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* BMenu now scrolls when you press page up/down, if possible.
* BMenuWindow no longer uses a fixed scroll step - instead, the menu sets it
to the height of its first item.
* Cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31389 a95241bf-73f2-0310-859d-f6bbb57e9c96

9515252e 03-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* The view always included the "error" in the reply, but that's only supposed
to happen when an actual error occured.
* The "set frame" property resized the view incorrectly.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31388 a95241bf-73f2-0310-859d-f6bbb57e9c96

a0747aad 29-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

After the first call to BView::InvalidateLayout() further invocations don't
invoke the layout's InvalidateLayout() anymore. This could cause problems when
the layout caches layout related information and also updates those on calls
other than LayoutView(). A call to such a method after an InvalidateLayout()
would mark the cached info valid and the layout would use the cached info
until the first InvalidateLayout() after the next LayoutView(), even if
BView::InvalidateLayout() had been called again in the meantime.

* Introduced a new method BView::ResetLayoutInvalidation(), which must be
called by layout implementations whenever they have updated their cached
information and need further InvalidateLayout() notifications.
* Adjusted the existing layout implementations to use the method.

Fixes bug #4047.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31316 a95241bf-73f2-0310-859d-f6bbb57e9c96

17a8a6f7 27-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Made ScrollTo(BRow*) more useful. Now it only scrolls, if the row isn't fully
visible and it only scrolls as much as necessary.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31268 a95241bf-73f2-0310-859d-f6bbb57e9c96

4aeb7a3c 23-Jun-2009 Stephan Aßmus <superstippi@gmx.de>

* Made BTwoDimensionalLayout and BSplitLayout::GetInsets() const.
* Give access to BSplitLayout::SetInsets() and GetInsets() from BSplitView.
* Give access to BSplitView::SetInsets() from BSplitLayoutBuilder and
* Some automatic white-space cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31197 a95241bf-73f2-0310-859d-f6bbb57e9c96

b3601d82 21-Jun-2009 Stephan Aßmus <superstippi@gmx.de>

* Update indentation style in TabView.h
* Added _MinTabeSize() to BTabView. It makes sure that the BTabView displays
at least two tabs. In the future it should also add the room to display some
buttons for cycling the currently displayed tabs left/right if there is more
than can fit.
* In BTabView::Min/Max/PreferredSize(), use _MinTabSize() to compute the
respective size.
* Improve Tab rendering code so there are no ugly overlaps at the right edge
if the tabs falls directly on the view edge.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31157 a95241bf-73f2-0310-859d-f6bbb57e9c96

ea603b7a 21-Jun-2009 Stephan Aßmus <superstippi@gmx.de>

Small style cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31155 a95241bf-73f2-0310-859d-f6bbb57e9c96

8f24c711 20-Jun-2009 Stephan Aßmus <superstippi@gmx.de>

Reverted my change to usage of _get_object_token_(), it already means to use
a cached token... doh! Thanks Axel!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31140 a95241bf-73f2-0310-859d-f6bbb57e9c96

3756e259 20-Jun-2009 Rene Gollent <anevilyak@gmail.com>

GCC4 build fix.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31139 a95241bf-73f2-0310-859d-f6bbb57e9c96

1f9fd6d8 20-Jun-2009 Stephan Aßmus <superstippi@gmx.de>

* Added BSplitView drawing code to ControlLook.
* BSplitView uses ControlLook to draw itself.
* Small refactoring in SplitLayout to implement IsAboveSplitter(BPoint).
* BSplitView updates the view cursor when the mouse is above a splitter.
* Standard splitter size is now 6 pixels, which is a bit easer to hit.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31137 a95241bf-73f2-0310-859d-f6bbb57e9c96

01206002 20-Jun-2009 Stephan Aßmus <superstippi@gmx.de>

* Added NOTE to BListView destructor about not freeing the items.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31136 a95241bf-73f2-0310-859d-f6bbb57e9c96

262c5f65 20-Jun-2009 Stephan Aßmus <superstippi@gmx.de>

* Small cleanup

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31135 a95241bf-73f2-0310-859d-f6bbb57e9c96

fa0ba1f8 20-Jun-2009 Stephan Aßmus <superstippi@gmx.de>

Cache a view's server token. Avoids getting it for every
BView method that contacts the server.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31134 a95241bf-73f2-0310-859d-f6bbb57e9c96

19e179ca 19-Jun-2009 Stephan Aßmus <superstippi@gmx.de>

* Moved the implementation of SetViewCursor from the thread of the
window of the view into the application thread. This solves the
race condition with asynchronous SetViewCursor and deleting the
cursor immediately afterwards for real.
* The ServerApp now requires a reference to the current cursor,
just in case...
* Added TODOs for caching the BView token, it's currently resolved
for every single BView call that talks to the server... not good!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31133 a95241bf-73f2-0310-859d-f6bbb57e9c96

834a9474 17-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed bug that prevented the font state to be properly popped. It could be
solved more efficiently by adding a new app_server call for this, though.
* Fixed stupid operator precedence bug that caused BView to always archive
everything, instead of only those items with their archiving flag set.
* Minor cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31091 a95241bf-73f2-0310-859d-f6bbb57e9c96

f3b1ada5 17-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* Moved class BStringItem into its own source file.
* Changed BStringItem::Update() to set a better baseline offset and height;
this should improve vertical text placement.
* Fixed a bug in BStringItem::Update(): it used the owner to determine the
width, but must use the font passed in instead.
* Coding style cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31090 a95241bf-73f2-0310-859d-f6bbb57e9c96

08a35638 17-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* Added layout-friendly constructor.
* Reordered functions to match the order in the header (and vice versa).
* Removed unused private functions.
* Updated the header to follow our coding style.
* Cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31088 a95241bf-73f2-0310-859d-f6bbb57e9c96

041b97a8 16-Jun-2009 Stephan Aßmus <superstippi@gmx.de>

* Updated header indentation style and small cleanups.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31070 a95241bf-73f2-0310-859d-f6bbb57e9c96

f2e0ac2c 30-May-2009 Oliver Tappe <zooey@hirschkaefer.de>

* Instead of moving bounds-height during paging, we now determine the exact
next position of the caret and only scroll the distance between the current
and the next position. This fixes #3981
* When paging upwards, we need to compensate for the fact that the caret
position is always considered at the top of the line, as otherwise a
page-up would pass one more line than a page-down

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30933 a95241bf-73f2-0310-859d-f6bbb57e9c96

4b6aea9b 30-May-2009 Oliver Tappe <zooey@hirschkaefer.de>

Fixed bug in BTextView reported by Matt:
* when selecting via mouse, the caret position now follows the direction of
the selection - which is less surprising than not moving the caret at all

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30928 a95241bf-73f2-0310-859d-f6bbb57e9c96

a47e7e30 30-May-2009 Jérôme Duval <korli@users.berlios.de>

* merged Frame and Hidden properties (set and get) (bug #3493).
* changed Hidden set property to not check the current hidden state, as it's not exactly related.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30920 a95241bf-73f2-0310-859d-f6bbb57e9c96

591bc3f2 28-May-2009 Jérôme Duval <korli@users.berlios.de>

* various fixes identified by gcc4, provided by Joe Prostko

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30902 a95241bf-73f2-0310-859d-f6bbb57e9c96

e9c3e84e 17-May-2009 Stephan Aßmus <superstippi@gmx.de>

Removed debugging left-over... sorry.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30785 a95241bf-73f2-0310-859d-f6bbb57e9c96

2627bad1 17-May-2009 Stephan Aßmus <superstippi@gmx.de>

* Removed unnecessary code and simplified some places in the drawing code paths.
* Calling BTextView::SetText() will invoke Window()->UpdateIfNeeded(), maybe
since some recent changes only - we should perhaps look into this... (zooey),
but the problem was that we called BControl::SetValueNoUpdate() after that,
and thus we were drawing the color mark at the old offset and the invalidation
in SetValue() was rendered effectless. Fixes #3719.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30784 a95241bf-73f2-0310-859d-f6bbb57e9c96

97970c5c 17-May-2009 Axel Dörfler <axeld@pinc-software.de>

* Applied a changed patch by Romain that fixes the non-working double click in
BListView. This fixes bug #3919. Got rid of the _TryInitiateDrag() method,
and let MouseMoved() do it all.
* Style cleanup of the header, automatic whitespace cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30782 a95241bf-73f2-0310-859d-f6bbb57e9c96

d69a73df 16-May-2009 Axel Dörfler <axeld@pinc-software.de>

* The Be API requires that options and mask is 0 to remove a mask using
BView::SetEventMask(). This fixes bug #3928.
* And while the app_server handled that correctly, BView actually did not, and
stored the wrong value.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30772 a95241bf-73f2-0310-859d-f6bbb57e9c96

b62daa48 15-May-2009 Oliver Tappe <zooey@hirschkaefer.de>

* adjusted _HandleInputMethodChanged() to not blindly insert the string that
has been given via the inline input method, but to feed the individual
UTF8-characters it contains to KeyDown() - this way special keys like
B_BACKSPACE and cursor keys will be handled correctly instead of producing
a "unknown char rectangle"

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30764 a95241bf-73f2-0310-859d-f6bbb57e9c96

78da6449 14-May-2009 Oliver Tappe <zooey@hirschkaefer.de>

* corrected the computation of alignment offsets for centered or right-aligned
textviews, such that the characters are drawn at their correct positions and
there are no longer any mismatches between caret and character positions
* fixed too large widths returned by LineWidth() for lines ending with a
newline: the newline character must not contribute to the width
This makes the textcontrol in DiskProbe work properly again.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30762 a95241bf-73f2-0310-859d-f6bbb57e9c96

8ca914d1 13-May-2009 Oliver Tappe <zooey@hirschkaefer.de>

* removed debug output

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30758 a95241bf-73f2-0310-859d-f6bbb57e9c96

f287ca7d 13-May-2009 Oliver Tappe <zooey@hirschkaefer.de>

fixed behaviour of non-editable textviews:
* non-editable textviews no longer draw the caret
* the cursor keys scroll immediately, not only when the (invisible) caret
reaches the views bounds
* HOME/END work more reliably
* any selection stays active throughout keyboard navigation
Tested with AboutSystem, Mail, StyledEdit and Beam - seems to work ok

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30756 a95241bf-73f2-0310-859d-f6bbb57e9c96

6f260d07 10-May-2009 Oliver Tappe <zooey@hirschkaefer.de>

Fixed two bug(let)s in BTextView that I encountered when working on the
Keymap preflet:
* obscure the cursor only if the textview has the focus
* initiate a drag not only if the cursor has moved to another index, but also
when the cursor has moved more than three pixels, since otherwise it was
impossible to drag the first character to the left or top of the view
(as the corresponding index was always zero)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30698 a95241bf-73f2-0310-859d-f6bbb57e9c96

91ad692e 09-May-2009 Philippe Saint-Pierre <stpere@gmail.com>

Make ScrollToSelection() use "Contains" rather than an "Intersects" to determine if it should scroll.

This make the end key work (trigger the scroll) if the last item is overlapping the bottom boundary.

This fixes bug #1820.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30689 a95241bf-73f2-0310-859d-f6bbb57e9c96

d571c583 09-May-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced methods ResizeColumnToPreferred() and
* Automatic white space cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30683 a95241bf-73f2-0310-859d-f6bbb57e9c96

c6278c8f 07-May-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Lock the root menu before calling BMenuItem::Invoke(). This fixes #3842, although in some circumstances could introduce a deadlock (if someone does strange things in Invoke(), for example).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30662 a95241bf-73f2-0310-859d-f6bbb57e9c96

a48d16a0 07-May-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BMenuItem didn't draw the modifier indicator for B_OPTION_KEY. Fixes ticket #3887

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30661 a95241bf-73f2-0310-859d-f6bbb57e9c96

a7ed06ce 02-May-2009 Philippe Saint-Pierre <stpere@gmail.com>

There was an "off by one" error in the routine used to detect if a click was inside the arrow buttons.

Reported by mmadia in ticket #3611. Thanks!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30596 a95241bf-73f2-0310-859d-f6bbb57e9c96

bfb8f4ca 02-May-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* BTabView::AddTab(): Call Select() only when already attached to the window.
It's only necessary in this case and apparently there are applications that
rely on Select() not being called before the tab is attached to the window.
Fixes #3852.
* Automatic white-space cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30558 a95241bf-73f2-0310-859d-f6bbb57e9c96

73af36d4 01-May-2009 Oliver Tappe <zooey@hirschkaefer.de>

* maintain width of 80 chars per line
* automatic whitespace cleanup

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30533 a95241bf-73f2-0310-859d-f6bbb57e9c96

5cc8dc2f 01-May-2009 Oliver Tappe <zooey@hirschkaefer.de>

* unified application of style into a separate method _ApplyStyleRange()
in order to maintain the null-style appropriately, if required
* finally fix #3040 for real (a single style is now maintained at all times
for non-stylable textviews)
* the caret is now being drawn with the correct size, even if it is on
the empty line at the end of the buffer and a specific font size has been

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30532 a95241bf-73f2-0310-859d-f6bbb57e9c96

435455ab 30-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

* textviews that aren't editable no longer perform cut or paste actions (again
reported by kirilla, thanks!)
* when tracking the mouse in order to detect drags, it is not necessary to
check if the pointer is within the selection, as that causes problems when
you e.g. click on the border of the selection and then move the mouse outside
of it (we'd still want to initiate a drag in that case)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30519 a95241bf-73f2-0310-859d-f6bbb57e9c96

c27ffb3a 30-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

Fixed a bug reported by kirilla:
* the textview now only initiates a drag after the mouse has been moved to
another offset, making it possible to click into the selection in order to
position the caret at the offset corresponding to the point of the click
(just as R5 does it)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30518 a95241bf-73f2-0310-859d-f6bbb57e9c96

819c98a3 30-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

Fixing #3040 (DeskCalcs textview showing wrong/multiple styles)
* fixed crash in StyleBuffer::SetStyleFromMode() if any of the given pointers
is NULL (which is perfectly valid)
* BTextView::SetFontAndColor() now syncs the null style before it sets the
range, thus making sure that there is only one style if the view is not

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30516 a95241bf-73f2-0310-859d-f6bbb57e9c96

62417557 27-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

Fixed all wrapping issues that I know of (non-working wrapping at end of text, broken hard-wrapping of overlong words, visual leftovers after a word got wrapped):
* adjusted _FindLineBreak() to no longer expect that only whitespace can
end a line, as that is simply not true
* CanEndLine() returns true for characters that are followed by end-of-text
or a separator
* activated the commented lines in CanEndLine() that allow '...' to be treated
as a word
As I have nothing more relating to BTextView on my todo-list, I will start doing something else now, but please *do* send any complaints my way ;-)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30473 a95241bf-73f2-0310-859d-f6bbb57e9c96

cad2c3d0 27-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

* fixed bug in autoscrolling that caused the content to jump between the
view's top and bottom if you moved the pointer above the view and reached
the top
* increased auto-scrolling speed to 40 scroll steps per second and changed
_PerformAutoScrolling() to behave as R5: do soft scrolling

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30463 a95241bf-73f2-0310-859d-f6bbb57e9c96

588b46ea 27-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

more work concerning navigation within BTextView:
* pressing HOME on last line works again
* made public versions of LineAt() do what is required to pass back the
correct value even for the last line of the buffer (original implementation
has been moved to private _LineAt())
* PAGE_UP/PAGE_DOWN now moves the view by the bounds-height, making the
behaviour somewhat less confusing (IMHO, please shout if that's not
acceptable for you)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30458 a95241bf-73f2-0310-859d-f6bbb57e9c96

2ae836db 27-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

* temporarily removed parts of my last change as this completely ruins
single-lined textviews - needs some more thinking ...

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30456 a95241bf-73f2-0310-859d-f6bbb57e9c96

8fd209b4 26-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

Fixed incompatibility with R5 (and general PITA) - LineAt(TextLength())
returned one less than it should, causing unexpected moves of the caret, for instance when pressing HOME on the last (empty) line:
* LineBuffer::OffsetToLine() and LineBuffer::PixelToLine() did not check
for the last line in their binary search
* removed a special case from TextView::PointAt() which now is no longer
necessary (not sure if it was, before)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30435 a95241bf-73f2-0310-859d-f6bbb57e9c96

f7c48ade 26-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

* fixed a couple of inconsistencies with respect to handling of cursor-
and paging-keys, especially extending the selection via shift was more or
less broken

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30431 a95241bf-73f2-0310-859d-f6bbb57e9c96

c4945a42 25-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added Count{Columns,Rows}().

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30399 a95241bf-73f2-0310-859d-f6bbb57e9c96

6217e77c 25-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

AddTab(): Explicitly select the first-added tab. Fixes the problem that the page
wouldn't be made visible, when the tabs were added after the tab view had been
attached to the window.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30398 a95241bf-73f2-0310-859d-f6bbb57e9c96

1ad26e2a 22-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Swapped k{Up,Down}SortArrow*. This not only makes the naming more intuitive
(the "down" arrow actually points down, now), it also uses the arrows
consistent with Tracker -- i.e. arrow pointing down means ascending order.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30340 a95241bf-73f2-0310-859d-f6bbb57e9c96

4ab94faa 22-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

The BMessage constructor of BScrollBar had a couple of rather important

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30319 a95241bf-73f2-0310-859d-f6bbb57e9c96

da34a085 21-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Do not scale the scroll bar thumb size between min size and max size, but
between 0 and max size and restrict to min size afterwards. This leads to more
consistent behavior and a more reasonable scroll bar size until the minimum
size is reached. And it also fixes #3801. Probably also fixes the bug where
some Pe windows could not be scrolled, or only scrolled very little. I assume
this because a special trick is used for proportional scroll bars in Pe. It
does not set the proportion, but only large steps and then the proportion is
calculated from that. But since the minimum size was not taken into account
before, it would have exactly this inconsistency. Since the size now ranges
from 0 to max, this should now be in sync. But I didn't have a Pe window handy
which exposed this bug to confirm my assumption...

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30309 a95241bf-73f2-0310-859d-f6bbb57e9c96

a31d4f9d 21-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Init global fonts before BWidthBuffer. Probably cleaner, since it may use
some fonts already, but I have not looked...

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30308 a95241bf-73f2-0310-859d-f6bbb57e9c96

23079ac1 20-Apr-2009 Philippe Saint-Pierre <stpere@gmail.com>

Modified the DrawLatch routine to make the latch vertically centered.

* It's particularly notice-able with big fonts.
* I did put the latch's width and height in constants.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30284 a95241bf-73f2-0310-859d-f6bbb57e9c96

1370f1b6 16-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Of course it still needs to invalidate, d'oh. If the size isn't changed because
of invalidating the layout, we still need to draw...

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30192 a95241bf-73f2-0310-859d-f6bbb57e9c96

b10020de 16-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Since a BStringView draws the text vertically centered, it should simply use
the B_FULL_UPDATE_ON_RESIZE flag. Removed the Invalidate() call accordingly
from InvalidateLayout(). Small cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30191 a95241bf-73f2-0310-859d-f6bbb57e9c96

84b7e122 16-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Both BTextControl and BMenuField layout the inner control at divider
+ frame width. BTextControl was even calculating it like this everywhere,
but then layouted like BMenuField. Now it's consistent and much easier to
align other controls with the text view or menu bar layout item.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30190 a95241bf-73f2-0310-859d-f6bbb57e9c96

699451e6 16-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

The fancy border is now 3 pixels wide.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30189 a95241bf-73f2-0310-859d-f6bbb57e9c96

ed4f2d88 15-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

Fixed a regression pointed out by Rene:
* Select() did not adjust fClickOffset, which resulted in the cursor
position not being where on would expect (noticable when pressing

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30184 a95241bf-73f2-0310-859d-f6bbb57e9c96

fc2c8b88 13-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup, no functional change.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30156 a95241bf-73f2-0310-859d-f6bbb57e9c96

dd0e375f 13-Apr-2009 Rene Gollent <anevilyak@gmail.com>

Fix build break I introduced in previous commit. Add some extra behavior for OutlineListView's right arrow: if the item has children and is expanded, right arrow now jumps to the first child.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30150 a95241bf-73f2-0310-859d-f6bbb57e9c96

86656c6b 13-Apr-2009 Rene Gollent <anevilyak@gmail.com>

When checking double click with jitter threshold, make sure that both clicks are also on the same list item. Thanks stippi for pointing out this oversight!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30149 a95241bf-73f2-0310-859d-f6bbb57e9c96

2b110c14 12-Apr-2009 Rene Gollent <anevilyak@gmail.com>

Modify double click check to allow some fuzz in the pointer placement, as is done in Tracker. BTextView likely needs a similar adjustment.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30147 a95241bf-73f2-0310-859d-f6bbb57e9c96

11c511b9 11-Apr-2009 Rene Gollent <anevilyak@gmail.com>

Make BListView's doubleclick handling a bit more sane. Should fix ticket #3724.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30131 a95241bf-73f2-0310-859d-f6bbb57e9c96

fcdaa0c7 11-Apr-2009 Rene Gollent <anevilyak@gmail.com>

If an item does not have an expand/collapse latch, let the left arrow jump to its parent (if any). Implements ticket #3725.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30130 a95241bf-73f2-0310-859d-f6bbb57e9c96

d3171391 09-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Fixes for the B_NO_BORDER LOOK:
* Draw the left/top border anyways, since it just looks bad with scrollbars
where the frame cannot be turned off. But, don't draw the focus indication
in this mode.
* Fixed layout of the views for B_NO_BORDER_LOOK. There was a one pixel

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30090 a95241bf-73f2-0310-859d-f6bbb57e9c96

c44aa833 09-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Also draw the scroll corner when there is no border.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30089 a95241bf-73f2-0310-859d-f6bbb57e9c96

78772ca5 09-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Should fix the problems with dirty selection left-overs when editing and also
other situations. Basically, I made DeleteText() adjust the selection according
to the deleted range. Some places where DeleteText() was called forgot to
adopt the selection. Other places adopted the selection. Maybe some of those
could be removed now, but some also change fClickOffset, so I just left them
as they are.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30076 a95241bf-73f2-0310-859d-f6bbb57e9c96

bedfcd63 09-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Improve the word wrapping a bit. This should eventually use the LocalKit when
it's ready. For now, I just tried to fix stuff like breaking before
punctuations. I had trouble wrapping my mind around the wrapping code, so I
didn't include as much cases as I wanted. Basically, the wrapping code assumes
that a spot where CanEndLine() returns true must be a white space character,
which wouldn't be the case.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30075 a95241bf-73f2-0310-859d-f6bbb57e9c96

cd7f1893 09-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* The slider position was actually computed incorrectly.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30072 a95241bf-73f2-0310-859d-f6bbb57e9c96

b8473812 09-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Making it private doesn't help unless you have a const BSlider. Therefore,
removed it from the public namespace, and made it only visible when linking.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30071 a95241bf-73f2-0310-859d-f6bbb57e9c96

d9479a69 09-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Added const version of GetLimits() (the non-const version is still around
for binary compatibility).
* Always round the bar thickness, or we get drawing artefacts.
* Cleaned up the header following our coding style.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30070 a95241bf-73f2-0310-859d-f6bbb57e9c96

b2a271d2 08-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Changing the text selection region calculation was not such a good idea, it
needs more testing before I can do that, but in principle, I think the idea
was an ok one... :-)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30048 a95241bf-73f2-0310-859d-f6bbb57e9c96

82d9f508 08-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Some BTextView fixes, most importantly the annoying up/down ping pong when
triggering auto-scrolling in BTextControls...
* _BTextInput_::MinSize() added 1 to the line height, but when aligning the
text rect, at least one pixel is added at the top and bottom, which makes
for at least two extra pixels.
* BTextView::_PerformAutoScrolling() had some code which was supposed to
prevent from out-of-bounds scrolling, but the bottom maximum coordinate
was not correctly calculated. This and the above item led to the ping-pong
* Additionally, I prevented scrolling vertically for one-line text views
* On mouse-up, reset the cursor. It may have to be the I-Beam cursor again,
for example after de-selecting.
* While mouse tracking the selection, always use the I-Beam cursor.
* Also when mouse tracking, do not use the minimum/maximum text offset when
the mouse is above/below the text rect. Do this only when it's also outside
on left/right sides. This is less irritating and works like on other
platforms. It means the first/last line can still be selected, without
having to constrain the mouse to the inside of the text view.
* When calculating the selection region, don't make the bottom one pixel too
far up. Lines which contain glyphs that extend below the base-line have
one more pixel below the glyphs that is inverted now.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30046 a95241bf-73f2-0310-859d-f6bbb57e9c96

cd03af05 07-Apr-2009 Rene Gollent <anevilyak@gmail.com>

Various cleanups to how the selection indices are maintained when part of the selection is occluded by a collapse operation, which could cause a crash in some instances. This fixes ticket #3711.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30015 a95241bf-73f2-0310-859d-f6bbb57e9c96

200da682 07-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

* implemented wordwise navigation via control + arrow keys
* renamed _FindXXXWordBoundary() methods to _Previous/_NextWordBoundary()
since the respective per-char methods are named this way
* started to work on improving the behaviour of page-up/page-down

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30012 a95241bf-73f2-0310-859d-f6bbb57e9c96

ed5f1fd3 07-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

* fix off-by-one error in my last change that reverted the editing
direction - oops ;-)
* undo is now active by default

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29996 a95241bf-73f2-0310-859d-f6bbb57e9c96

3f3ab162 07-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

continued work on BTextView:
* reverted my recent change that caused Mail to always show the end
of mails 8-) and now invoke ScrollToOffset() wherever it was missing
(mostly in keyboard-related methods)
* _DoInsertText() only moves the caret if the text has been inserted
in front of the caret, not after it
* overhauled selection by char/word/line and their extension mechanism
(which now behaves as the haiku shell)
* use strnlen() instead of strlen() in those versions of Insert() which
accept a length parameter, as strlen can potentially waste a lot of
cycles skipping the whole string, when all we want is to clamp the length.
* cleanup (some of it automatic removal of trailing whitespace)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29995 a95241bf-73f2-0310-859d-f6bbb57e9c96

c121b41f 06-Apr-2009 Rene Gollent <anevilyak@gmail.com>

Make gcc4 happy.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29985 a95241bf-73f2-0310-859d-f6bbb57e9c96

940901b6 06-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

applied two textview-patches from Blub that fixes #3458:
* Select() did not re-show the caret when it should
* GoToLine() must hide/show the caret to avoid drawing artefacts

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29983 a95241bf-73f2-0310-859d-f6bbb57e9c96

2a30a9e9 06-Apr-2009 Rene Gollent <anevilyak@gmail.com>

Implemented BTextControl's string "Value" property. This fixes ticket #3494.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29982 a95241bf-73f2-0310-859d-f6bbb57e9c96

c51d0337 06-Apr-2009 Alexandre Deckner <alex@zappotek.com>

* Rewrote BDragger's mouse tracking to be asynchronous using a message filter. Placed the filter in
kits/shared since i plan to use it in other places like Tracker. Animated replicants like
ActivityMonitor wont stall anymore when initiating the drag. (On the desktop, Tracker's mouse
tracking still busy loops sometimes, that's next on my list).

I had asynchronous long click detection (one button mouse support) in it but decided to get rid of
it, it adds unneeded complexity in the code and is even getting in your way sometimes (ex: now you can
take your time to drag the dragger, you wont be interrupted). If we want to reimplement that
someday it should be done system wide anyway (only Tracker and replicants have that 'feature'

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29972 a95241bf-73f2-0310-859d-f6bbb57e9c96

4e50f1ae 06-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

* Instead of invoking _DrawLines out of the app-server drawing context,
we request the drawing via Invalidate() - this make use of the app-server's
potential double buffering, whenever that is active. This change reduces
flickering in VESA mode considerably.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29962 a95241bf-73f2-0310-859d-f6bbb57e9c96

2da74964 06-Apr-2009 Oliver Tappe <zooey@hirschkaefer.de>

fixed two scalability problems that made BTextView perform rather slow
with large contents:
* when searching for tab characters in DrawLine(), we now limit the search
to the current line, too (not only the end of the style) - this avoids
scanning to the end of large contents repeatedly
* there's no need to refresh from the edit location to the end of the
content in _DoInsertText(), we only need to refresh the part that has

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29960 a95241bf-73f2-0310-859d-f6bbb57e9c96

9cfb11a5 05-Apr-2009 Alexandre Deckner <alex@zappotek.com>

* Make BDragger respect the doc and only archive/unarchive the popup menu when it's a
custom provided one. Incidentally makes #1775 (that i'll reopen in a moment, see r29947) a
lot less likely to happen for most users since it can now only happen with those
customized popups.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29949 a95241bf-73f2-0310-859d-f6bbb57e9c96

642cc131 05-Apr-2009 Alexandre Deckner <alex@zappotek.com>

* Fixes a small regression introduced in r29728, don't return B_ERROR if we couldn't lock
the popup's window, in this case the window just closed, so we go on with archiving then.
There's still a (rarely occuring) problem with the unlocking though, probably due to some
BMenu funkyness, will investigate, left a TODO.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29947 a95241bf-73f2-0310-859d-f6bbb57e9c96

12349c7d 05-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Begun to use structs for the BView<->app_server communication. This makes
the protocoll less prone to errors, reduces possible points of failure and
most importantly, reduces the number of function calls to the link API.
I only know the numbers for StrokeLine(), which I tested via the Benchmark
test app. With this change, drawing random colored and positioned lines
actually doubled in speed. On the BView side, the calls to
ServerLink::Attach() only halfed, while on the app_server side, the number
of calls to ServerLink::Read() is now 1/4th. It will also be worth
investigating why the link stuff is so slow at all. I also optimized
BView::DrawString() a lot in this change, but I don't have any numbers
yet. Some other commands which used multiple Attach()/Read() calls were
also optimized, at least the most important ones. Begin/EndLineArray() was
also pretty bad on the app_server side.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29937 a95241bf-73f2-0310-859d-f6bbb57e9c96

c06e2871 04-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Patch by Olivier Coursiere: Fixes ticket #3673. Thanks a lot!
NOTE: There are some more problems with regard to this, if you resize
DeskCalc (which sets a new font size on the expression view, and then type
something, the newly typed stuff will have the old font still...)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29911 a95241bf-73f2-0310-859d-f6bbb57e9c96

454ff904 03-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Prettify the column title drawing. TODO: Make this more re-usable and put into
BControlLook. Then use from Tracker as well. Also, Tracker still has the nicer
sorting indicators.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29878 a95241bf-73f2-0310-859d-f6bbb57e9c96

ce955579 03-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Make sure to fill the scroll corner if necessary.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29877 a95241bf-73f2-0310-859d-f6bbb57e9c96

9fffb1c2 02-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* At least pretend to support all unicode blocks, and don't make such
obvious lies.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29867 a95241bf-73f2-0310-859d-f6bbb57e9c96

49b582ef 01-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Fixed a few more coding style issues, thanks Axel!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29853 a95241bf-73f2-0310-859d-f6bbb57e9c96

ac754ba0 31-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Patch by Brecht Machiels: Add operator==() to BRegion. Thanks a lot!
Also fixed some coding style inconsistency.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29849 a95241bf-73f2-0310-859d-f6bbb57e9c96

bfc1a92f 31-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Make BColumnListView layout-friendly.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29848 a95241bf-73f2-0310-859d-f6bbb57e9c96

0a7367b7 31-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

* B_SUPPORTS_LAYOUT is already added by the BView consturctor.
* Fixed MaxSize() and PreferredSize() to use the correct explicitly set size.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29847 a95241bf-73f2-0310-859d-f6bbb57e9c96

89c9e2b9 31-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Puh... big coding style cleanup. I probably missed a few issues too... but
should be much better now. There was like three different styles before.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29841 a95241bf-73f2-0310-859d-f6bbb57e9c96

f2471136 31-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Added DecoratorFrame() method, which returns the outer frame of the window
on screen (ie including the decorator border and tab). Plus the necessary
refactoring as well as some TODO notes about windows with the tab on the left

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29820 a95241bf-73f2-0310-859d-f6bbb57e9c96

8d8da849 31-Mar-2009 Axel Dörfler <axeld@pinc-software.de>

* Added missing MaxSize() implementation.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29819 a95241bf-73f2-0310-859d-f6bbb57e9c96

68b8f65f 29-Mar-2009 Axel Dörfler <axeld@pinc-software.de>

* Reworked r29180 to make _HandleKeyDown() no longer rely on the active window
but if the message was targeted to the focus view. It will now only handle
shortcuts in this case.
* This also fixes bug #3513.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29776 a95241bf-73f2-0310-859d-f6bbb57e9c96

4f579098 28-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Introduce the possiblity to draw certain frames with alpha blending on top of
an existing background. It's not supported by many frame types yet, but BButton
and TextControl frames work as well as the soft recessed frame which many
controls use.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29762 a95241bf-73f2-0310-859d-f6bbb57e9c96

06ab1718 28-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Make the code work that has the parent draw the background for the little
handle (parent draws on top of it's dragger child view).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29761 a95241bf-73f2-0310-859d-f6bbb57e9c96

339dcf9c 28-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

When changing the text rect, simply invalidate the view. Otherwise it leaves
dirt in various cases.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29760 a95241bf-73f2-0310-859d-f6bbb57e9c96

df8b89cb 26-Mar-2009 Alexandre Deckner <alex@zappotek.com>

* Return B_ERROR if the window couldn't be locked, thanks stippi

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29728 a95241bf-73f2-0310-859d-f6bbb57e9c96

82e6d2ff 26-Mar-2009 Alexandre Deckner <alex@zappotek.com>

* Lock the popup menu window when archiving, fixes #1775
* Made the drag detection less sensitive as most simple clicks would initiate an unwanted drag.
* Don't show the dragger's popup from its original parent window (not a shelf) for all buttons, as in R5.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29727 a95241bf-73f2-0310-859d-f6bbb57e9c96

681c2e44 25-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

The button and menu field draw routines take a background color into account,
which makes the resessed frame blend better with the surroundings. This can
be seen best in Keymap, where a different color is set on some buttons, but
the resessed frame should still be the same across all those buttons.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29716 a95241bf-73f2-0310-859d-f6bbb57e9c96

94e66d17 25-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Fixed recently introduced regressions with layouted BMenuFields. When passing
fixedSize=true to the private BMenuBar class, it would set the follow mode
in AttachedToWindow() such that BMenu would calculate the minimum width
differently. Also fixes ticket #3606.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29691 a95241bf-73f2-0310-859d-f6bbb57e9c96

fdfeaa4e 25-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Small code simplifications. No functional change.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29690 a95241bf-73f2-0310-859d-f6bbb57e9c96

2ce5b172 24-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Fix case label coding style violations...

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29688 a95241bf-73f2-0310-859d-f6bbb57e9c96

62b9a2ce 24-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

* Header cleanup.
* Removed dead code which was for drawing a BButton like R5.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29677 a95241bf-73f2-0310-859d-f6bbb57e9c96

47e745c6 22-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

* Fixed the unified menu bar width calculations. SetDivider() got it wrong.
* _InitMenuBar() had the meaning of fixedSize reversed. The layout-mode
constructors pass fixedSize = true accordingly.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29664 a95241bf-73f2-0310-859d-f6bbb57e9c96

5d67bb7c 23-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Use BControlLook new BScrollView drawing method. Should have been part of
last commit...

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29662 a95241bf-73f2-0310-859d-f6bbb57e9c96

74bb70ae 23-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Moved the BScrollView frame drawing entirely into BControlLook.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29661 a95241bf-73f2-0310-859d-f6bbb57e9c96

cda78e4f 23-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Fixed more inconsistencies in layouting the menu bar. These would mostly
result in the BMenuField not always drawing all of the frame around the
menu bar correctly, for example cutting off at left for divider = 0.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29660 a95241bf-73f2-0310-859d-f6bbb57e9c96

31852cb1 22-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Various fixes to BMenuField behavior:
* In layout mode, using a BMenuField directly will make it behave like using
a fixed size BMenuField in non-layout mode. This is open for debate, but
not a change to the previous behavior. When using the Label and MenuBar-
LayoutItems though, the behavior is now changed to be more what one would
expect, ie the BMenuBar part is layouted across the full available width
just like it happens with BTextControls.
* Fixed invalidation of the BMenuBar when it auto-resizes according to picking
another item, and when it is resized due to layout changes.
* Fixed the problem with growing BMenuFields in file panels after changing
folders the first time. The fix is not so nice, but the purpose of setting
the menu item margins is to make sure it renders at the same vertical
offset as the BMenuField label. The better fix would be to change the
calculation of the content location or required margins in the BMenuItem
code... however the BMCPrivate code needs to account for the popup indicator
in the margins so I just kept the fix for the offset there as well.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29650 a95241bf-73f2-0310-859d-f6bbb57e9c96

ca4463c2 22-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Small cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29649 a95241bf-73f2-0310-859d-f6bbb57e9c96

40a10e1c 21-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Added method to draw an arrow shape like that of the BScrollBar.
TODO: Adjust BScrollBar to use it.
TODO: Make it virtual like the others, but I don't want to break Vision and
other native Haiku apps just now.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29630 a95241bf-73f2-0310-859d-f6bbb57e9c96

36759a6b 18-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Always use B_OP_OVER for rendering the text in BMenuItem, not just when using

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29598 a95241bf-73f2-0310-859d-f6bbb57e9c96

1a72cb41 18-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Make BMenuBar background drawing more flexible and also support an "activated"