History log of /haiku/src/kits/interface/ScrollView.cpp
Revision Date Author Comments
# 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>


# 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>


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

Interface Kit: Remove more non-BControlLook code.


# 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.


# 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.


# 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.


# 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
BScrollView.
* 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.


# 1f424632 11-Jun-2014 John Scipione <jscipione@gmail.com>

Style fixes to IK, focus on docs


# 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.


# f6c8d242 19-Dec-2011 Rene Gollent <anevilyak@gmail.com>

Use the correct perform invocation for these functions.


# 466f2b8f 18-Dec-2011 Rene Gollent <anevilyak@gmail.com>

Add compatibility symbols for removed LayoutChanged() calls.


# 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.


# 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


# 89208c77 27-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

Finished unifying the Interface Kit headers:
* Fixed copyrights (puncuation and capitalization, removed authors from
headers)
* 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.

+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32745 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


# 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


# 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


# 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


# 2f86ba45 15-Feb-2009 Stephan Aßmus <superstippi@gmx.de>

Implemented a new look for the Haiku interface controls. It was
overheard that they looked too ninety-ish.
TODO: The code behind this is work in progress. The basic idea
is to extract all drawing code into a new class BControlLook,
of which there is a global instance be_control_look, instantiated
in InterfaceDefs.cpp. At the moment, all the old drawing code is
still there, and the usage of be_control_look is inside if-bodies
checking the instance against NULL. In another words, by not
instanitating be_control_look, you can revert back to the old look.
BControlLook's job is to provide reusable methods for drawing
certain types of frames, backgrounds and labels, so that application
developers can make controls that re-use the same drawing code
as built-in controls and adopt to changes made there. I have added
the notion of "borders". Each of the frame drawing methods can be
made to draw certain borders only, which is supposed to help when
controls shall visually attach. This feature is not fully explored
at all ATM.
TODO: Update BColumnListView header view and BStringItem text
spacing. Update other apps where it makes sense to use BControlLook.
For the moment, only Tracker and LaunchBox are updated. More...
NOTE: The new look is not very radically different, so that existing
apps do not immediately look too ugly or out of place.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29221 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5fd5fe56 31-Jan-2009 Karsten Heimrich <host.haiku@gmx.de>

* refactor _Init and DoLayout to share some code
* DoLayout did not work as expected, after the call
the scrollbars would have an 1px offset inside the target
* the target needs to be resized while setting a new border, otherwise
it would overlap the border and give some drawing artefacts

- I'm still unsure if the behavior change introduced with the layout stuff is nice



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29103 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 125ec815 31-Oct-2008 Stephan Aßmus <superstippi@gmx.de>

r28258 (adapting BScrollView to be usable in layout management) exposed a
problem in TextSearch. After the change, the scrollbar and child view layout
would be messed up there. The reason is that TextSearch calls
scrollview->ResizeToPreferred() prior to adding it to the window. In this
situation, the child views (scrollbars, target view) do not follow the parent
view. Before r28258, ResizeToPreferred() would not change the size of the
view (calling it in TextSearch is stupid anyways, since it is layouted later
in the code). I have thought about how to best fix this. I know 100% that there
is code out there that will mess with scrollbar layout. So it wouldn't be a
good option to refactor the layout out of BScrollView::DoLayout() and calling
that method from AttachedToWindow(), although that seems like the cleanest
option. Instead, I opted to simply reject resizing in ResizeToPreferred()
when the scroll view is not yet attached to a window. What do others think?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28409 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9e163a7a 21-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Made BScrollView work when using it with the layout system.
* Added a layout friendly constructor - it's not so nice to use, though, since
the original one already doesn't get a BRect (we just don't need the
resizing mode, and have to set the B_SUPPORTS_LAYOUT flag).
* Refactored size/frame computation a bit.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28258 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 39fbf550 15-Oct-2008 Oliver Tappe <zooey@hirschkaefer.de>

bonefish + zooey:
* Fixed a general problem with respect to overriding of the reserved
virtual function slots: instead of statically invoking the method
that corresponds to the reserved slot on the class that contains the
slot, we now invoke the virtual Perform() method. Perform() then dispatches
the method invocation to the "proper" class, i.e. the highest class in the
hierarchy that actually implements the requested method.
This fixes a crash in apps that use liblayout's MSlider class and
should fix one or other spurious bug with old apps or libraries, too.
* added new header folder 'binary_compatibility' that contains files that
define the method codes and data structures required by Perform()
* looked for and implemented all used reserved virtual slot functions to
invoke Perform() where necessary or to pass on the method call statically
(for slots that were already maintained by Be)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28124 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9ecf9d1c 26-Aug-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Merge from layout management branch.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18649 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 27a00cdd 29-Dec-2005 Stephan Aßmus <superstippi@gmx.de>

don't resize scrollbars if the window hasn't even document look

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15727 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dde10e45 06-Dec-2005 Stephan Aßmus <superstippi@gmx.de>

fixes for various controls to remove or show focus indication when the window active status changes

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15362 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2e6a5805 05-Jul-2005 Stephan Aßmus <superstippi@gmx.de>

MenuField layouts the menu bar better with respect to fDivider, it aligns better with other controls. fDivider in TextControl is an integer number now, small fix and small cleanup in Menu, Window::InitData takes an optional BBitmap token to construct an offscreen window, fixed PrivateScreen IndexForColor, View prevents being located at fractional coordinates as in R5, BBitmap unlocks its offscreen window since it is never Show()n and needs manual unlocking, fixed Slider offscreen window mode and improved triange thumb drawing, ScrollView would not crash when passing a NULL target just for kicks, the private MenuBar class now implements Draw to draw itself a little differently inside the BMenuField (dark right and bottom side) - though how it currently sets the clipping region prevents the text controls to draw in Playground, needs fixing

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13450 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1ae95ac8 15-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

Mixed up argument order - dunno why this didn't have any effect on R5,
but the frame wasn't visible in Haiku, and rightly so :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13166 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8c15126a 15-May-2004 DarkWyrm <darkwyrm@gmail.com>

Replaced header with standard one
Investigated Axel's TODO concerning SetBorderHighlighted and converted the #if 0 to a regular C-style comment.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7590 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 75c3c8f5 20-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Fixed SetTarget() - BTW is even correctly implemented in R5.
Beautified SetBorderHighlighting().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6669 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52bb9b2d 20-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Now takes B_DOCUMENT_WINDOW_LOOK properly into account.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6667 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ecae3149 20-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

We are now updating our drawings properly on resize.
ModifyFlags() now sets B_FRAME_EVENTS if B_FULL_UPDATE_ON_RESIZE was not set.
Fixed a small bug in SetBorder().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6665 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 26a96b16 20-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

New private static method BorderSize().
Correctly implemented SetBorderHighlighted(), but differently from BeBook
description (see comment).
Unlike the R5 version, correctly implemented SetBorder().
Draw() now takes SetBorderHighlighted() into account.
The BScrollView(BMessage *) constructor now searches its children for
the scroll bars, no matter in what order they are.
Corrected a drawing glitch that was also exposed in the R5 version (the
scroll bars are misplaced for anything else but B_NO_BORDER).
Renamed resizeMask to the more usual resizingMode.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6664 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 122e979e 20-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Renamed ModFlags() to ModifyFlags() and made it static.
Implemented SetTarget().
Implemented BArchivable methods, R5 compatible.
The constructor still crashes when the provided target is NULL (as R5),
but the rest now accepts it (to make it reliable against SetTarget() and
shallow archiving).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6660 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5078b0fc 19-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Removed BScrollView::InitObject(); it's not exported by libbe.so.
Now uses ModFlags() instead of direct code in the constructor.
Moved CalcFrame() and ModFlags() a bit more to the top.
Fixed initial scroll bar values (name and maximum value now match
the R5 implementation).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6652 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8b35053e 18-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

The scroll bars are now actually placed at the correct location.
The Draw() method now draws all supported borders, but no highlighting yet.
CalcFrame() now seems to work correctly.
Fixed warnings due to missing return codes from non-implemented methods.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6646 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 16fe6dd9 18-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Added almost empty BScrollView implementation. It will actually create
the scroll bars, but it won't do much more yet; no border, no highlighting,
no ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6644 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 93244a65e6b96b37b4fe39e7e1d512b91c007721 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.


# fd79684a5f6650a4c479e90da5b884a7923eb152 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.


# 1bf53ffcfcb408417219ed47a5f62b4a97c9a5c9 12-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

Remove leftover printf and fix build.


# bdb4ae32fd5a6282583f17e35dcb382fc8c994b8 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
BScrollView.
* 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.


# 1f424632be5dcad5b81a23080eb205ab6471cd7b 11-Jun-2014 John Scipione <jscipione@gmail.com>

Style fixes to IK, focus on docs


# 8adaa6c54487cab1d200592bb2d5aca44ba2039b 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.


# f6c8d242946d814ca47bca8eb49219979f009686 19-Dec-2011 Rene Gollent <anevilyak@gmail.com>

Use the correct perform invocation for these functions.


# 466f2b8f997acaecf0397f9f1c8b36a2b1fc5a4e 18-Dec-2011 Rene Gollent <anevilyak@gmail.com>

Add compatibility symbols for removed LayoutChanged() calls.


# 61eb1f1d19eed26b6138b0701612e8eb31bb1d86 22-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Replace remaining InvalidateLayout()'s with LayoutInvalidated(). Also do a bit of cleanup/move methods around.


# eee4243d35225a35d0964ebebe94490eaca14261 20-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

De-virtualize BView::InvalidateLayout() and introduce LayoutInvalidated() hook, like BLayout.


# 4ce4d86bc9e79ef54b360baee5e17ead5334e255 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


# 89208c77f10235d43fda0c7b3fd6751db02cc12c 27-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

Finished unifying the Interface Kit headers:
* Fixed copyrights (puncuation and capitalization, removed authors from
headers)
* 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.

+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32745 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 262c5f651e687477c0d50fc86193c03ea94299f2 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


# 0a7367b70bcc941d8fb8e20c0058c44add9c9628 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


# 8d8da849c8c1a4986566107da6e5e3f4ae14ad35 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


# 5d67bb7cfa0f182fdbfddbab828b12e22a8a7539 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


# 2f86ba45579bdc9648b232175f87edc62ab71b54 15-Feb-2009 Stephan Aßmus <superstippi@gmx.de>

Implemented a new look for the Haiku interface controls. It was
overheard that they looked too ninety-ish.
TODO: The code behind this is work in progress. The basic idea
is to extract all drawing code into a new class BControlLook,
of which there is a global instance be_control_look, instantiated
in InterfaceDefs.cpp. At the moment, all the old drawing code is
still there, and the usage of be_control_look is inside if-bodies
checking the instance against NULL. In another words, by not
instanitating be_control_look, you can revert back to the old look.
BControlLook's job is to provide reusable methods for drawing
certain types of frames, backgrounds and labels, so that application
developers can make controls that re-use the same drawing code
as built-in controls and adopt to changes made there. I have added
the notion of "borders". Each of the frame drawing methods can be
made to draw certain borders only, which is supposed to help when
controls shall visually attach. This feature is not fully explored
at all ATM.
TODO: Update BColumnListView header view and BStringItem text
spacing. Update other apps where it makes sense to use BControlLook.
For the moment, only Tracker and LaunchBox are updated. More...
NOTE: The new look is not very radically different, so that existing
apps do not immediately look too ugly or out of place.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29221 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5fd5fe56bb933196362615bd00056d5bfad42ffe 31-Jan-2009 Karsten Heimrich <host.haiku@gmx.de>

* refactor _Init and DoLayout to share some code
* DoLayout did not work as expected, after the call
the scrollbars would have an 1px offset inside the target
* the target needs to be resized while setting a new border, otherwise
it would overlap the border and give some drawing artefacts

- I'm still unsure if the behavior change introduced with the layout stuff is nice



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29103 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 125ec815128d361030bd4a7052dd8c71986e8e2f 31-Oct-2008 Stephan Aßmus <superstippi@gmx.de>

r28258 (adapting BScrollView to be usable in layout management) exposed a
problem in TextSearch. After the change, the scrollbar and child view layout
would be messed up there. The reason is that TextSearch calls
scrollview->ResizeToPreferred() prior to adding it to the window. In this
situation, the child views (scrollbars, target view) do not follow the parent
view. Before r28258, ResizeToPreferred() would not change the size of the
view (calling it in TextSearch is stupid anyways, since it is layouted later
in the code). I have thought about how to best fix this. I know 100% that there
is code out there that will mess with scrollbar layout. So it wouldn't be a
good option to refactor the layout out of BScrollView::DoLayout() and calling
that method from AttachedToWindow(), although that seems like the cleanest
option. Instead, I opted to simply reject resizing in ResizeToPreferred()
when the scroll view is not yet attached to a window. What do others think?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28409 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9e163a7a93c4237b659bf8411513a48351ee60d3 21-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Made BScrollView work when using it with the layout system.
* Added a layout friendly constructor - it's not so nice to use, though, since
the original one already doesn't get a BRect (we just don't need the
resizing mode, and have to set the B_SUPPORTS_LAYOUT flag).
* Refactored size/frame computation a bit.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28258 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 39fbf5509b8740d9883b61649027478dc8a3ead8 15-Oct-2008 Oliver Tappe <zooey@hirschkaefer.de>

bonefish + zooey:
* Fixed a general problem with respect to overriding of the reserved
virtual function slots: instead of statically invoking the method
that corresponds to the reserved slot on the class that contains the
slot, we now invoke the virtual Perform() method. Perform() then dispatches
the method invocation to the "proper" class, i.e. the highest class in the
hierarchy that actually implements the requested method.
This fixes a crash in apps that use liblayout's MSlider class and
should fix one or other spurious bug with old apps or libraries, too.
* added new header folder 'binary_compatibility' that contains files that
define the method codes and data structures required by Perform()
* looked for and implemented all used reserved virtual slot functions to
invoke Perform() where necessary or to pass on the method call statically
(for slots that were already maintained by Be)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28124 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9ecf9d1c1d4888d341a6eac72112c72d1ae3a4cb 26-Aug-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Merge from layout management branch.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18649 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 27a00cdd92369cae6c611f9dd948a3f4a2575c64 29-Dec-2005 Stephan Aßmus <superstippi@gmx.de>

don't resize scrollbars if the window hasn't even document look

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15727 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dde10e451942993f3d48b9bccf2b777815efea79 06-Dec-2005 Stephan Aßmus <superstippi@gmx.de>

fixes for various controls to remove or show focus indication when the window active status changes

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15362 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2e6a5805ba8db3b072d81257cc44f966def5fd37 05-Jul-2005 Stephan Aßmus <superstippi@gmx.de>

MenuField layouts the menu bar better with respect to fDivider, it aligns better with other controls. fDivider in TextControl is an integer number now, small fix and small cleanup in Menu, Window::InitData takes an optional BBitmap token to construct an offscreen window, fixed PrivateScreen IndexForColor, View prevents being located at fractional coordinates as in R5, BBitmap unlocks its offscreen window since it is never Show()n and needs manual unlocking, fixed Slider offscreen window mode and improved triange thumb drawing, ScrollView would not crash when passing a NULL target just for kicks, the private MenuBar class now implements Draw to draw itself a little differently inside the BMenuField (dark right and bottom side) - though how it currently sets the clipping region prevents the text controls to draw in Playground, needs fixing

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13450 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1ae95ac8724efaf5fce9058e4d2f1c16a303ffea 15-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

Mixed up argument order - dunno why this didn't have any effect on R5,
but the frame wasn't visible in Haiku, and rightly so :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13166 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8c15126aec6b80f50b38b665b40c167dcba5e28a 15-May-2004 DarkWyrm <darkwyrm@gmail.com>

Replaced header with standard one
Investigated Axel's TODO concerning SetBorderHighlighted and converted the #if 0 to a regular C-style comment.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7590 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 75c3c8f50d388b53df93ced41c79f976bc7fb9d6 20-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Fixed SetTarget() - BTW is even correctly implemented in R5.
Beautified SetBorderHighlighting().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6669 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52bb9b2d33bcccaa4898d85d2b2cc551e39a8c56 20-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Now takes B_DOCUMENT_WINDOW_LOOK properly into account.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6667 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ecae314976edcc69a2048668092251c97678d67c 20-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

We are now updating our drawings properly on resize.
ModifyFlags() now sets B_FRAME_EVENTS if B_FULL_UPDATE_ON_RESIZE was not set.
Fixed a small bug in SetBorder().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6665 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 26a96b16746f8d3d9d8517aac708905fc19a0387 20-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

New private static method BorderSize().
Correctly implemented SetBorderHighlighted(), but differently from BeBook
description (see comment).
Unlike the R5 version, correctly implemented SetBorder().
Draw() now takes SetBorderHighlighted() into account.
The BScrollView(BMessage *) constructor now searches its children for
the scroll bars, no matter in what order they are.
Corrected a drawing glitch that was also exposed in the R5 version (the
scroll bars are misplaced for anything else but B_NO_BORDER).
Renamed resizeMask to the more usual resizingMode.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6664 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 122e979e2d63dd20a8fd8946770d6eed96faedfc 20-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Renamed ModFlags() to ModifyFlags() and made it static.
Implemented SetTarget().
Implemented BArchivable methods, R5 compatible.
The constructor still crashes when the provided target is NULL (as R5),
but the rest now accepts it (to make it reliable against SetTarget() and
shallow archiving).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6660 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5078b0fcccba89b08da420c8f166712ece348b8f 19-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Removed BScrollView::InitObject(); it's not exported by libbe.so.
Now uses ModFlags() instead of direct code in the constructor.
Moved CalcFrame() and ModFlags() a bit more to the top.
Fixed initial scroll bar values (name and maximum value now match
the R5 implementation).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6652 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8b35053e1aab60efb3e125f756c05ef6943f7e68 18-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

The scroll bars are now actually placed at the correct location.
The Draw() method now draws all supported borders, but no highlighting yet.
CalcFrame() now seems to work correctly.
Fixed warnings due to missing return codes from non-implemented methods.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6646 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 16fe6dd90f60f399716579085684a1626701c3f7 18-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Added almost empty BScrollView implementation. It will actually create
the scroll bars, but it won't do much more yet; no border, no highlighting,
no ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6644 a95241bf-73f2-0310-859d-f6bbb57e9c96