History log of /haiku/src/kits/interface/TabView.cpp
Revision Date Author Comments
# b00da680 29-Apr-2023 Máximo Castañeda <antiswen@yahoo.es>

BTabView: remove obsolete code

Seems to come mostly from before the move to ControlLook, and it's not
been working for some time as the drawing rect passed now to
DrawInactiveTab is invalid in one direction. tabsBounds should be
initialized to tabFrame (as set before DrawTabFrame changes it), but
then BeControlLook would draw something we don't want.

If HaikuControlLook (or any other) wants something special for the last
tab, it should handle that itself using the tab indexes.

Change-Id: Iabecb27d1d30d91423c51e7bc03cf7906e530afe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6397
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# f74699a9 26-Aug-2022 Augustin Cavalier <waddlesplash@gmail.com>

BTabView: Compose padding from BControlLook::DefaultLabelSpacing.

Greatly improves appearance on HiDPI.


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

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

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>


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


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


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


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


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


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


# 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


# 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


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


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


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


# 65dfd2c6 19-Dec-2014 John Scipione <jscipione@gmail.com>

Documentation fixes for BTab and BTabView


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


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


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


# 8f5079af 03-Mar-2012 Rene Gollent <anevilyak@gmail.com>

When changing the tab height, also update the layout insets if needed.

Fixes #8374.


# 9d46237b 19-Feb-2012 Jérôme Duval <jerome.duval@gmail.com>

TabView.cpp: Use B_IF_GCC_2 to simplify things


# 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


# 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


# 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


# 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


# 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


# 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


# 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


# 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


# 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


# 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


# 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


# 83aff015 17-Feb-2009 Philippe Houdoin <philippe.houdoin@gmail.com>

Fixed BTabs focus underline offset.
Fixed a typo in method name.

Please forgive me Stephan if I just screw your next commit...


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


# 24a0a80b 20-Nov-2008 Stephan Aßmus <superstippi@gmx.de>

Properly integrate the BTabView into a layout tree. Ie, the content will
now resize with the tab view. There is probably a more elegant way overriding
DoLayout(), but this should do for the time being.


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


# e401039e 20-Nov-2008 Stephan Aßmus <superstippi@gmx.de>

Patch by Artur Wyszynski:
* The BTabView can now be used with layout management. In this setup, children
views are managed by a BCardLayout and are hidden/shown instead of removed/
added when (de)activated.

Thanks a lot!


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


# 3bfa2d12 26-Apr-2008 Jérôme Duval <korli@users.berlios.de>

style cleanup


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


# 69fac0ce 02-Mar-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

patch by Andrea Anzani (with a few style modification by me) which
enables tab (as BTab) switching via mouse wheel. Thanks!



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


# 753fd45f 05-Feb-2008 Stephan Aßmus <superstippi@gmx.de>

Second part of a patch sent by Clemens zeidler:
* If in B_WIDTH_AS_USUAL mode, the strings in the tabs are nevertheless
truncated to the available width.
* Pass the real area available for the string to BTab::DrawLabel(), resolved
TODO in DrawLabel() about not having to calculate an offset to account
for the slope.
* Fixed some too lines of code.


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


# 741e605c 19-Jan-2008 Jérôme Duval <korli@users.berlios.de>

updated copyright header


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


# 14334b29 19-Jan-2008 Jérôme Duval <korli@users.berlios.de>

added scripting support for tab selection in BTabView


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


# e96b2023 27-Sep-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Patch from Ioan Molnar:
If a Tab is partially out of the window, clicking on it to make it the
active tab will scroll it to be completely visible.
The best solution would probably be having a way to scroll through the
whole list of tabs, or something like this. But for now, at least, makes
the tabbed terminal a bit more useful.
Thanks!



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


# 0a5c585a 28-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

There is a B_CONTROL_TEXT_COLOR after all.


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


# 11d7eceb 21-Apr-2006 Jérôme Duval <korli@users.berlios.de>

fixed some Archive() following stippi's path


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


# 39e8aac1 02-Jan-2006 Stephan Aßmus <superstippi@gmx.de>

implemented a "new" look for the BTabView, it is actually
a mix of the liblayout look (I hope Marcus doesn't mind)
and BMenuFields. I will have to clean up after myself one
day and calculate the tab rects properly instead of drawing
far out of the right side of tabs and adding a weird offset
to the label rendering and other places...


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


# f17df0a3 14-Jan-2005 Axel Dörfler <axeld@pinc-software.de>

Cleanup.


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


# a6e9b97b 04-Sep-2003 haydentech <haydentech@nowhere.fake>

Remove unused variable


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


# 5d5860e4 26-Jun-2003 haydentech <haydentech@nowhere.fake>

3 changes to remove infinite loops or crashes


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


# 9cb2dbe2 16-Jun-2003 Marc Flerackers <mflerackers@nowhere.fake>

Fixes


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


# fa49f505 13-Dec-2002 Marc Flerackers <mflerackers@nowhere.fake>

Some fixes


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


# f45d1cc7 14-Nov-2002 Marc Flerackers <mflerackers@nowhere.fake>

Compatibility changes


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


# 083d22e2 25-Oct-2002 Marc Flerackers <mflerackers@nowhere.fake>

Updated drawing, added missing functionality


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


# 398e73f2 01-Oct-2002 Marc Flerackers <mflerackers@nowhere.fake>

Fixed the drawing functions


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


# 4eb5e0d5 26-Sep-2002 Marc Flerackers <mflerackers@nowhere.fake>

Initial Checkin


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


# fe47b32f75e4f5acf80dd4693877cc8ed9a23fbc 14-Jul-2015 Augustin Cavalier <waddlesplash@gmail.com>

TabView: Assume be_control_look is not NULL.


# 6fd2553690c71824d7a6d80e2c6228c804eda3e8 14-Jul-2015 Augustin Cavalier <waddlesplash@gmail.com>

TabView: Lots of style fixes.


# c432a83bf3855f2a291d97b269bdcdee606149f5 14-Jul-2015 Augustin Cavalier <waddlesplash@gmail.com>

TabView: Add TabViewPrivate class, actually fix non-layout SetView.

Thanks to Axel and Stephan for reviewing!


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


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


# 65dfd2c67cbfcb15b18fa84c5bf1cd81247a27d7 19-Dec-2014 John Scipione <jscipione@gmail.com>

Documentation fixes for BTab and BTabView


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


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


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


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


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


# 8f5079af02b69eeb105a410516291050b12e16e9 03-Mar-2012 Rene Gollent <anevilyak@gmail.com>

When changing the tab height, also update the layout insets if needed.

Fixes #8374.


# 9d46237ba198f567a1bb38d80e6007d215690808 19-Feb-2012 Jérôme Duval <jerome.duval@gmail.com>

TabView.cpp: Use B_IF_GCC_2 to simplify things


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


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


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


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


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


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


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


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


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


# 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


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


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


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


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


# 83aff015eb79ec3b8c3cff465b6f5051da18d215 17-Feb-2009 Philippe Houdoin <philippe.houdoin@gmail.com>

Fixed BTabs focus underline offset.
Fixed a typo in method name.

Please forgive me Stephan if I just screw your next commit...


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


# 24a0a80b056c98004faac3db38ab8e404d0da60c 20-Nov-2008 Stephan Aßmus <superstippi@gmx.de>

Properly integrate the BTabView into a layout tree. Ie, the content will
now resize with the tab view. There is probably a more elegant way overriding
DoLayout(), but this should do for the time being.


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


# e401039efad6e333f53abd1c523a384bdcd15ff9 20-Nov-2008 Stephan Aßmus <superstippi@gmx.de>

Patch by Artur Wyszynski:
* The BTabView can now be used with layout management. In this setup, children
views are managed by a BCardLayout and are hidden/shown instead of removed/
added when (de)activated.

Thanks a lot!


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


# 3bfa2d12234cc993145fb63501613a80dfe61b71 26-Apr-2008 Jérôme Duval <korli@users.berlios.de>

style cleanup


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


# 69fac0cee0dc333b5f1057352dc03747b44f570c 02-Mar-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

patch by Andrea Anzani (with a few style modification by me) which
enables tab (as BTab) switching via mouse wheel. Thanks!



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


# 753fd45fc25a99b25d214dbe371c5db4b02523a0 05-Feb-2008 Stephan Aßmus <superstippi@gmx.de>

Second part of a patch sent by Clemens zeidler:
* If in B_WIDTH_AS_USUAL mode, the strings in the tabs are nevertheless
truncated to the available width.
* Pass the real area available for the string to BTab::DrawLabel(), resolved
TODO in DrawLabel() about not having to calculate an offset to account
for the slope.
* Fixed some too lines of code.


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


# 741e605cee5c8fb6e16eaf95d152b42671ce5dbe 19-Jan-2008 Jérôme Duval <korli@users.berlios.de>

updated copyright header


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


# 14334b29f18e97280ca0b9633df283d571b51e32 19-Jan-2008 Jérôme Duval <korli@users.berlios.de>

added scripting support for tab selection in BTabView


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


# e96b20231146d74d19186ae917c20a95277ec413 27-Sep-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Patch from Ioan Molnar:
If a Tab is partially out of the window, clicking on it to make it the
active tab will scroll it to be completely visible.
The best solution would probably be having a way to scroll through the
whole list of tabs, or something like this. But for now, at least, makes
the tabbed terminal a bit more useful.
Thanks!



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


# 0a5c585a92a559a24603510af72646441bee43d2 28-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

There is a B_CONTROL_TEXT_COLOR after all.


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


# 11d7ecebd0255943e4b27c2fe94174c30d00385d 21-Apr-2006 Jérôme Duval <korli@users.berlios.de>

fixed some Archive() following stippi's path


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


# 39e8aac1511f06f2e87a67bedf6b53cbcbe16913 02-Jan-2006 Stephan Aßmus <superstippi@gmx.de>

implemented a "new" look for the BTabView, it is actually
a mix of the liblayout look (I hope Marcus doesn't mind)
and BMenuFields. I will have to clean up after myself one
day and calculate the tab rects properly instead of drawing
far out of the right side of tabs and adding a weird offset
to the label rendering and other places...


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


# f17df0a3b5de1ff19ff2fab6f289fb608af47d8c 14-Jan-2005 Axel Dörfler <axeld@pinc-software.de>

Cleanup.


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


# a6e9b97ba4bcfa84d118fa6e3e4b044b02b485aa 04-Sep-2003 haydentech <haydentech@nowhere.fake>

Remove unused variable


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


# 5d5860e4f1ce1c8b199ce9f727ef7236c7dd5cc6 26-Jun-2003 haydentech <haydentech@nowhere.fake>

3 changes to remove infinite loops or crashes


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


# 9cb2dbe29dbcf58bce0bd925316c77faafce43e0 16-Jun-2003 Marc Flerackers <mflerackers@nowhere.fake>

Fixes


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


# fa49f5059f50c8effce0aedb983ecf5aadcf44dc 13-Dec-2002 Marc Flerackers <mflerackers@nowhere.fake>

Some fixes


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


# f45d1cc7e4d2696194105b90f103ce4c5252c112 14-Nov-2002 Marc Flerackers <mflerackers@nowhere.fake>

Compatibility changes


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


# 083d22e24d4a5b3ed58007fd2bf71d90fbddc33b 25-Oct-2002 Marc Flerackers <mflerackers@nowhere.fake>

Updated drawing, added missing functionality


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


# 398e73f23b9dc687145fb999fb58ca42b7c07b05 01-Oct-2002 Marc Flerackers <mflerackers@nowhere.fake>

Fixed the drawing functions


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


# 4eb5e0d516d3902ab5eecdd4d05b143dcd38f735 26-Sep-2002 Marc Flerackers <mflerackers@nowhere.fake>

Initial Checkin


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