hrev48530 adds 6 changesets to branch 'master' old head: af012fd4de73d269279f998d0ba4b0b7b35d5983 new head: b825666f3f37b12e687b05f3139f42ce5dcd9638 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=b825666+%5Eaf012fd ---------------------------------------------------------------------------- a28ddb7: A few minor fixes to BTextControl docs 65dfd2c: Documentation fixes for BTab and BTabView ce3da8d: Add docs for BTab and BTabView 5ebeb71: B_WIDTH_FROM_LABEL was not available until BeOS R5 d3c4833: Some more small documentation fixes b825666: Rename method parameter in header to match implementation [ John Scipione <jscipione@xxxxxxxxx> ] ---------------------------------------------------------------------------- 5 files changed, 853 insertions(+), 180 deletions(-) docs/user/interface/InterfaceDefs.dox | 5 +- docs/user/interface/TabView.dox | 733 ++++++++++++++++++++++++++++++ docs/user/interface/TextControl.dox | 12 +- headers/os/interface/TabView.h | 26 +- src/kits/interface/TabView.cpp | 257 ++++------- ############################################################################ Commit: a28ddb79eca817c61a454b2cda82ac9addf29b2c URL: http://cgit.haiku-os.org/haiku/commit/?id=a28ddb7 Author: John Scipione <jscipione@xxxxxxxxx> Date: Sat Dec 20 00:43:00 2014 UTC A few minor fixes to BTextControl docs ---------------------------------------------------------------------------- diff --git a/docs/user/interface/TextControl.dox b/docs/user/interface/TextControl.dox index 6906d07..e4e70fa 100644 --- a/docs/user/interface/TextControl.dox +++ b/docs/user/interface/TextControl.dox @@ -1,5 +1,5 @@ /* - * Copyright 2001-2014 Haiku, Inc. All rights reserved. + * Copyright 2014 Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -147,6 +147,8 @@ /*! \fn status_t BTextControl::AllUnarchived(const BMessage* from) + \brief Hook method called when all views have been unarchived. + \copydetails BView::AllUnarchived() */ @@ -543,4 +545,4 @@ /*! status_t BTextControl::SetIcon(const BBitmap* icon, uint32 flags) \copydoc BControl::SetIcon() -*/ \ No newline at end of file +*/ ############################################################################ Commit: 65dfd2c67cbfcb15b18fa84c5bf1cd81247a27d7 URL: http://cgit.haiku-os.org/haiku/commit/?id=65dfd2c Author: John Scipione <jscipione@xxxxxxxxx> Date: Sat Dec 20 00:43:26 2014 UTC Documentation fixes for BTab and BTabView ---------------------------------------------------------------------------- diff --git a/headers/os/interface/TabView.h b/headers/os/interface/TabView.h index 02c4287..04a9a4e 100644 --- a/headers/os/interface/TabView.h +++ b/headers/os/interface/TabView.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2009, Haiku, Inc. All rights reserved. + * Copyright 2001-2009 Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. */ #ifndef _TAB_VIEW_H @@ -24,8 +24,7 @@ public: BTab(BMessage* archive); static BArchivable* Instantiate(BMessage* archive); - virtual status_t Archive(BMessage* archive, - bool deep = true) const; + virtual status_t Archive(BMessage* data, bool deep = true) const; virtual status_t Perform(uint32 d, void* arg); const char* Label() const; @@ -35,10 +34,10 @@ public: virtual void Select(BView* owner); virtual void Deselect(); - virtual void SetEnabled(bool enabled); + virtual void SetEnabled(bool enable); bool IsEnabled() const; - void MakeFocus(bool inFocus = true); + void MakeFocus(bool focus = true); bool IsFocus() const; // sets/gets the view to be displayed for this tab @@ -86,7 +85,7 @@ public: | B_FRAME_EVENTS | B_NAVIGABLE); BTabView(BRect frame, const char* name, button_width width = B_WIDTH_AS_USUAL, - uint32 resizingMode = B_FOLLOW_ALL, + uint32 resizeMask = B_FOLLOW_ALL, uint32 flags = B_FULL_UPDATE_ON_RESIZE | B_WILL_DRAW | B_NAVIGABLE_JUMP | B_FRAME_EVENTS | B_NAVIGABLE); @@ -106,9 +105,9 @@ public: virtual void MessageReceived(BMessage* message); virtual void KeyDown(const char* bytes, int32 numBytes); - virtual void MouseDown(BPoint point); - virtual void MouseUp(BPoint point); - virtual void MouseMoved(BPoint point, uint32 transit, + virtual void MouseDown(BPoint where); + virtual void MouseUp(BPoint where); + virtual void MouseMoved(BPoint where, uint32 transit, const BMessage* dragMessage); virtual void Pulse(); @@ -129,15 +128,14 @@ public: virtual void SetResizingMode(uint32 mode); virtual void ResizeToPreferred(); - virtual void GetPreferredSize(float* _width, - float* _height); + virtual void GetPreferredSize(float* _width, float* _height); virtual BSize MinSize(); virtual BSize MaxSize(); virtual BSize PreferredSize(); - virtual void FrameMoved(BPoint newLocation); - virtual void FrameResized(float width,float height); + virtual void FrameMoved(BPoint newPosition); + virtual void FrameResized(float newWidth, float newHeight); virtual BHandler* ResolveSpecifier(BMessage* message, int32 index, BMessage* specifier, diff --git a/src/kits/interface/TabView.cpp b/src/kits/interface/TabView.cpp index 2999fa1..cb2db7c 100644 --- a/src/kits/interface/TabView.cpp +++ b/src/kits/interface/TabView.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2013, Haiku, Inc. All rights reserved. + * Copyright 2001-2013 Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -41,12 +41,13 @@ static property_info sPropertyList[] = { NULL, 0, { B_INT32_TYPE } }, + {} }; -BTab::BTab(BView *tabView) +BTab::BTab(BView* tabView) : fEnabled(true), fSelected(false), @@ -56,7 +57,7 @@ BTab::BTab(BView *tabView) } -BTab::BTab(BMessage *archive) +BTab::BTab(BMessage* archive) : BArchivable(archive), fSelected(false), @@ -84,8 +85,8 @@ BTab::~BTab() } -BArchivable * -BTab::Instantiate(BMessage *archive) +BArchivable* +BTab::Instantiate(BMessage* archive) { if (validate_instantiation(archive, "BTab")) return new BTab(archive); @@ -95,27 +96,27 @@ BTab::Instantiate(BMessage *archive) status_t -BTab::Archive(BMessage *archive, bool deep) const +BTab::Archive(BMessage* data, bool deep) const { - status_t err = BArchivable::Archive(archive, deep); - if (err != B_OK) - return err; + status_t result = BArchivable::Archive(data, deep); + if (result != B_OK) + return result; if (!fEnabled) - err = archive->AddBool("_disable", false); + result = data->AddBool("_disable", false); - return err; + return result; } status_t -BTab::Perform(uint32 d, void *arg) +BTab::Perform(uint32 d, void* arg) { return BArchivable::Perform(d, arg); } -const char * +const char* BTab::Label() const { if (fView) @@ -126,7 +127,7 @@ BTab::Label() const void -BTab::SetLabel(const char *label) +BTab::SetLabel(const char* label) { if (!label || !fView) return; @@ -143,7 +144,7 @@ BTab::IsSelected() const void -BTab::Select(BView *owner) +BTab::Select(BView* owner) { // TODO: Shouldn't we still maintain fSelected like in Deselect()? if (!owner || !View() || !owner->Window()) @@ -178,9 +179,9 @@ BTab::Deselect() void -BTab::SetEnabled(bool enabled) +BTab::SetEnabled(bool enable) { - fEnabled = enabled; + fEnabled = enable; } @@ -192,9 +193,9 @@ BTab::IsEnabled() const void -BTab::MakeFocus(bool inFocus) +BTab::MakeFocus(bool focus) { - fFocus = inFocus; + fFocus = focus; } @@ -206,7 +207,7 @@ BTab::IsFocus() const void -BTab::SetView(BView *view) +BTab::SetView(BView* view) { if (!view || fView == view) return; @@ -219,7 +220,7 @@ BTab::SetView(BView *view) } -BView * +BView* BTab::View() const { return fView; @@ -227,7 +228,7 @@ BTab::View() const void -BTab::DrawFocusMark(BView *owner, BRect frame) +BTab::DrawFocusMark(BView* owner, BRect frame) { float width = owner->StringWidth(Label()); @@ -242,7 +243,7 @@ BTab::DrawFocusMark(BView *owner, BRect frame) void -BTab::DrawLabel(BView *owner, BRect frame) +BTab::DrawLabel(BView* owner, BRect frame) { be_control_look->DrawLabel(owner, Label(), frame, frame, ui_color(B_PANEL_BACKGROUND_COLOR), @@ -252,93 +253,34 @@ BTab::DrawLabel(BView *owner, BRect frame) void -BTab::DrawTab(BView *owner, BRect frame, tab_position position, bool full) +BTab::DrawTab(BView* owner, BRect frame, tab_position position, bool full) { rgb_color no_tint = ui_color(B_PANEL_BACKGROUND_COLOR); + uint32 borders = BControlLook::B_TOP_BORDER + | BControlLook::B_BOTTOM_BORDER; - if (be_control_look != NULL) { - uint32 borders = BControlLook::B_TOP_BORDER - | BControlLook::B_BOTTOM_BORDER; - if (frame.left == owner->Bounds().left) - borders |= BControlLook::B_LEFT_BORDER; - if (frame.right == owner->Bounds().right) - borders |= BControlLook::B_RIGHT_BORDER; - - if (position == B_TAB_FRONT) { - frame.bottom += 1; - be_control_look->DrawActiveTab(owner, frame, frame, no_tint, 0, - borders); - } else { - be_control_look->DrawInactiveTab(owner, frame, frame, no_tint, 0, - borders); - } - - DrawLabel(owner, frame); - return; - } + if (frame.left == owner->Bounds().left) + borders |= BControlLook::B_LEFT_BORDER; - rgb_color lightenmax = tint_color(no_tint, B_LIGHTEN_MAX_TINT); - rgb_color darken2 = tint_color(no_tint, B_DARKEN_2_TINT); - rgb_color darken3 = tint_color(no_tint, B_DARKEN_3_TINT); - rgb_color darken4 = tint_color(no_tint, B_DARKEN_4_TINT); - rgb_color darkenmax = tint_color(no_tint, B_DARKEN_MAX_TINT); + if (frame.right == owner->Bounds().right) + borders |= BControlLook::B_RIGHT_BORDER; - owner->SetHighColor(darkenmax); - owner->SetLowColor(no_tint); - // NOTE: "frame" goes from the beginning of the left slope to the beginning - // of the right slope - "lableFrame" is the frame between both slopes - BRect lableFrame = frame; - lableFrame.left = lableFrame.left + frame.Height() / 2.0; - DrawLabel(owner, lableFrame); - - owner->SetDrawingMode(B_OP_OVER); - - owner->BeginLineArray(12); - - int32 slopeWidth = (int32)ceilf(frame.Height() / 2.0); - - if (position != B_TAB_ANY) { - // full height left side - owner->AddLine(BPoint(frame.left, frame.bottom), - BPoint(frame.left + slopeWidth, frame.top), darken3); - owner->AddLine(BPoint(frame.left, frame.bottom + 1), - BPoint(frame.left + slopeWidth, frame.top + 1), lightenmax); - } else { - // upper half of left side - owner->AddLine(BPoint(frame.left + slopeWidth / 2, - frame.bottom - slopeWidth), - BPoint(frame.left + slopeWidth, frame.top), darken3); - owner->AddLine(BPoint(frame.left + slopeWidth / 2 + 2, - frame.bottom - slopeWidth - 1), - BPoint(frame.left + slopeWidth, frame.top + 1), lightenmax); - } - - // lines along the top - owner->AddLine(BPoint(frame.left + slopeWidth, frame.top), - BPoint(frame.right, frame.top), darken3); - owner->AddLine(BPoint(frame.left + slopeWidth, frame.top + 1), - BPoint(frame.right, frame.top + 1), lightenmax); - - if (full) { - // full height right side - owner->AddLine(BPoint(frame.right, frame.top), - BPoint(frame.right + slopeWidth + 2, frame.bottom), darken2); - owner->AddLine(BPoint(frame.right, frame.top + 1), - BPoint(frame.right + slopeWidth + 1, frame.bottom), darken4); + if (position == B_TAB_FRONT) { + frame.bottom += 1; + be_control_look->DrawActiveTab(owner, frame, frame, no_tint, 0, + borders); } else { - // upper half of right side - owner->AddLine(BPoint(frame.right, frame.top), - BPoint(frame.right + slopeWidth / 2 + 1, - frame.bottom - slopeWidth), darken2); - owner->AddLine(BPoint(frame.right, frame.top + 1), - BPoint(frame.right + slopeWidth / 2, - frame.bottom - slopeWidth), darken4); + be_control_look->DrawInactiveTab(owner, frame, frame, no_tint, 0, + borders); } - owner->EndLineArray(); + DrawLabel(owner, frame); } +// #pragma mark - FBC padding and private methods + + void BTab::_ReservedTab1() {} void BTab::_ReservedTab2() {} void BTab::_ReservedTab3() {} @@ -362,7 +304,7 @@ BTab &BTab::operator=(const BTab &) // #pragma mark - BTabView -BTabView::BTabView(const char *name, button_width width, uint32 flags) +BTabView::BTabView(const char* name, button_width width, uint32 flags) : BView(name, flags) { @@ -370,10 +312,10 @@ BTabView::BTabView(const char *name, button_width width, uint32 flags) } -BTabView::BTabView(BRect frame, const char *name, button_width width, - uint32 resizingMode, uint32 flags) +BTabView::BTabView(BRect frame, const char* name, button_width width, + uint32 resizeMask, uint32 flags) : - BView(frame, name, resizingMode, flags) + BView(frame, name, resizeMask, flags) { _InitObject(false, width); } @@ -388,7 +330,7 @@ BTabView::~BTabView() } -BTabView::BTabView(BMessage *archive) +BTabView::BTabView(BMessage* archive) : BView(BUnarchiver::PrepareArchive(archive)), fTabList(new BList), @@ -432,14 +374,14 @@ BTabView::BTabView(BMessage *archive) _InitContainerView(Flags() & B_SUPPORTS_LAYOUT); while (archive->FindMessage("_l_items", i, &tabMsg) == B_OK) { - BArchivable *archivedTab = instantiate_object(&tabMsg); + BArchivable* archivedTab = instantiate_object(&tabMsg); if (archivedTab) { - BTab *tab = dynamic_cast<BTab *>(archivedTab); + BTab* tab = dynamic_cast<BTab*>(archivedTab); BMessage viewMsg; if (archive->FindMessage("_view_list", i, &viewMsg) == B_OK) { - BArchivable *archivedView = instantiate_object(&viewMsg); + BArchivable* archivedView = instantiate_object(&viewMsg); if (archivedView) AddTab(dynamic_cast<BView*>(archivedView), tab); } @@ -451,8 +393,8 @@ BTabView::BTabView(BMessage *archive) } -BArchivable * -BTabView::Instantiate(BMessage *archive) +BArchivable* +BTabView::Instantiate(BMessage* archive) { if ( validate_instantiation(archive, "BTabView")) return new BTabView(archive); @@ -466,28 +408,28 @@ BTabView::Archive(BMessage* archive, bool deep) const { BArchiver archiver(archive); - status_t ret = BView::Archive(archive, deep); + status_t result = BView::Archive(archive, deep); - if (ret == B_OK) - ret = archive->AddInt16("_but_width", fTabWidthSetting); - if (ret == B_OK) - ret = archive->AddFloat("_high", fTabHeight); - if (ret == B_OK) - ret = archive->AddInt32("_sel", fSelection); - if (ret == B_OK && fBorderStyle != B_FANCY_BORDER) - ret = archive->AddInt32("_border_style", fBorderStyle); + if (result == B_OK) + result = archive->AddInt16("_but_width", fTabWidthSetting); + if (result == B_OK) + result = archive->AddFloat("_high", fTabHeight); + if (result == B_OK) + result = archive->AddInt32("_sel", fSelection); + if (result == B_OK && fBorderStyle != B_FANCY_BORDER) + result = archive->AddInt32("_border_style", fBorderStyle); - if (ret == B_OK && deep) { + if (result == B_OK && deep) { for (int32 i = 0; i < CountTabs(); i++) { BTab* tab = TabAt(i); - if ((ret = archiver.AddArchivable("_l_items", tab, deep)) != B_OK) + if ((result = archiver.AddArchivable("_l_items", tab, deep)) != B_OK) break; - ret = archiver.AddArchivable("_view_list", tab->View(), deep); + result = archiver.AddArchivable("_view_list", tab->View(), deep); } } - return archiver.Finish(ret); + return archiver.Finish(result); } @@ -579,7 +521,7 @@ BTabView::AllDetached() void -BTabView::MessageReceived(BMessage *message) +BTabView::MessageReceived(BMessage* message) { switch (message->what) { case B_GET_PROPERTY: @@ -591,7 +533,7 @@ BTabView::MessageReceived(BMessage *message) BMessage specifier; int32 index; int32 form; - const char *property; + const char* property; if (message->GetCurrentSpecifier(&index, &specifier, &form, &property) == B_OK) { if (strcmp(property, "Selection") == 0) { if (message->what == B_GET_PROPERTY) { @@ -651,7 +593,7 @@ BTabView::MessageReceived(BMessage *message) void -BTabView::KeyDown(const char *bytes, int32 numBytes) +BTabView::KeyDown(const char* bytes, int32 numBytes) { if (IsHidden()) return; @@ -687,34 +629,34 @@ BTabView::KeyDown(const char *bytes, int32 numBytes) void -BTabView::MouseDown(BPoint point) +BTabView::MouseDown(BPoint where) { - if (point.y > fTabHeight) + if (where.y > fTabHeight) return; for (int32 i = 0; i < CountTabs(); i++) { - if (TabFrame(i).Contains(point) + if (TabFrame(i).Contains(where) && i != Selection()) { Select(i); return; } } - BView::MouseDown(point); + BView::MouseDown(where); } void -BTabView::MouseUp(BPoint point) +BTabView::MouseUp(BPoint where) { - BView::MouseUp(point); + BView::MouseUp(where); } void -BTabView::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +BTabView::MouseMoved(BPoint where, uint32 transit, const BMessage* dragMessage) { - BView::MouseMoved(point, transit, message); + BView::MouseMoved(where, transit, dragMessage); } @@ -734,7 +676,7 @@ BTabView::Select(int32 index) if (index < 0 || index >= CountTabs()) index = Selection(); - BTab *tab = TabAt(Selection()); + BTab* tab = TabAt(Selection()); if (tab) tab->Deselect(); @@ -786,16 +728,16 @@ BTabView::WindowActivated(bool active) void -BTabView::MakeFocus(bool focused) +BTabView::MakeFocus(bool focus) { - BView::MakeFocus(focused); + BView::MakeFocus(focus); - SetFocusTab(Selection(), focused); + SetFocusTab(Selection(), focus); } void -BTabView::SetFocusTab(int32 tab, bool focused) +BTabView::SetFocusTab(int32 tab, bool focus) { if (tab >= CountTabs()) tab = 0; @@ -803,7 +745,7 @@ BTabView::SetFocusTab(int32 tab, bool focused) if (tab < 0) tab = CountTabs() - 1; - if (focused) { + if (focus) { if (tab == fFocus) return; @@ -1080,9 +1022,9 @@ BTabView::ResizeToPreferred() void -BTabView::GetPreferredSize(float *width, float *height) +BTabView::GetPreferredSize(float* _width, float* _height) { - BView::GetPreferredSize(width, height); + BView::GetPreferredSize(_width, _height); } @@ -1144,25 +1086,25 @@ BTabView::PreferredSize() void -BTabView::FrameMoved(BPoint newLocation) +BTabView::FrameMoved(BPoint newPosition) { - BView::FrameMoved(newLocation); + BView::FrameMoved(newPosition); } void -BTabView::FrameResized(float width,float height) +BTabView::FrameResized(float newWidth, float newHeight) { - BView::FrameResized(width, height); + BView::FrameResized(newWidth, newHeight); } // #pragma mark - -BHandler * -BTabView::ResolveSpecifier(BMessage *message, int32 index, - BMessage *specifier, int32 what, const char *property) +BHandler* +BTabView::ResolveSpecifier(BMessage* message, int32 index, + BMessage* specifier, int32 what, const char* property) { BPropertyInfo propInfo(sPropertyList); @@ -1174,7 +1116,7 @@ BTabView::ResolveSpecifier(BMessage *message, int32 index, status_t -BTabView::GetSupportedSuites(BMessage *message) +BTabView::GetSupportedSuites(BMessage* message) { message->AddString("suites", "suite/vnd.Be-tab-view"); @@ -1189,7 +1131,7 @@ BTabView::GetSupportedSuites(BMessage *message) void -BTabView::AddTab(BView *target, BTab *tab) +BTabView::AddTab(BView* target, BTab* tab) { if (tab == NULL) tab = new BTab(target); @@ -1208,13 +1150,13 @@ BTabView::AddTab(BView *target, BTab *tab) } -BTab * +BTab* BTabView::RemoveTab(int32 index) { if (index < 0 || index >= CountTabs()) return NULL; - BTab *tab = (BTab *)fTabList->RemoveItem(index); + BTab* tab = (BTab*)fTabList->RemoveItem(index); if (tab == NULL) return NULL; @@ -1237,10 +1179,10 @@ BTabView::RemoveTab(int32 index) } -BTab * +BTab* BTabView::TabAt(int32 index) const { - return (BTab *)fTabList->ItemAt(index); + return (BTab*)fTabList->ItemAt(index); } @@ -1299,7 +1241,7 @@ BTabView::Border() const } -BView * +BView* BTabView::ContainerView() const { return fContainerView; @@ -1313,10 +1255,10 @@ BTabView::CountTabs() const } -BView * +BView* BTabView::ViewForTab(int32 tabIndex) const { - BTab *tab = TabAt(tabIndex); + BTab* tab = TabAt(tabIndex); if (tab) return tab->View(); @@ -1493,4 +1435,3 @@ B_IF_GCC_2(_ReservedTabView1__8BTabView, _ZN8BTabView17_ReservedTabView1Ev)( { tabView->BTabView::SetBorder(border); } - ############################################################################ Commit: ce3da8de9f5c68eb2cfde52a908bb448359624ad URL: http://cgit.haiku-os.org/haiku/commit/?id=ce3da8d Author: John Scipione <jscipione@xxxxxxxxx> Date: Sat Dec 20 00:43:44 2014 UTC Add docs for BTab and BTabView ---------------------------------------------------------------------------- diff --git a/docs/user/interface/TabView.dox b/docs/user/interface/TabView.dox new file mode 100644 index 0000000..55ff9c8 --- /dev/null +++ b/docs/user/interface/TabView.dox @@ -0,0 +1,733 @@ +/* + * Copyright 2014 Haiku, Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * John Scipione, jscipione@xxxxxxxxx + * + * Corresponds to: + * headers/os/interface/TabView.h hrev45377 + * src/kits/interface/TabView.cpp hrev45377 + */ + + +/*! + \file TabView.h + \ingroup interface + \ingroup libbe + \brief Provides the BTab and BTabView classes. +*/ + + +/*! + \enum tab_position + \ingroup interface + + Tab position flags + + \since BeOS R3 +*/ + + +/*! + \var tab_position B_TAB_FIRST + + First tab in the tab view. + + \since BeOS R3 +*/ + + +/*! + \var tab_position B_TAB_FRONT + + Front most tab in the tab view. + + \since BeOS R3 +*/ + + +/*! + \var tab_position B_TAB_ANY + + Represents any tab in the tab view. + + \since BeOS R3 +*/ + + +/*! + \class BTab + \ingroup interface + \ingroup libbe + \brief A Tab that goes in a TabView. + + \since BeOS R3 +*/ + + +/*! + \fn BTab::BTab(BView* tabView) + \brief Initializes a new BTab object as part of a \a tabView. + + The BTab is enabled, but not selected nor the current focus. \a tabView + is set as the tab's target view -- when the tab is selected, its target + view is activated. + + \since BeOS R3 +*/ + + +/*! + \fn BTab::BTab(BMessage* archive) + \brief Archive Constructor. + + \since BeOS R3 +*/ + + +/*! + \fn BTab::~BTab() + \brief Destructor. +*/ + + +/*! + \fn BArchivable* BTab::Instantiate(BMessage* archive) + \brief Instantiates a BTab object from the passed in \a archive. + + \since BeOS R3 +*/ + + +/*! + \fn status_t BTab::Archive(BMessage* data, bool deep) const + \brief Archives the object into the \a data message. + + \param data A pointer to the BMessage object to archive the object into. + \param deep Whether or not to archive child views as well. + + \return A status code, \c B_OK if everything went well or an error code + otherwise. + \retval B_OK The object was archived. + \retval B_NO_MEMORY Ran out of memory while archiving the object. + + \since BeOS R3 +*/ + + +/*! + \fn status_t BTab::Perform(uint32 d, void* arg) + \brief Perform some action. (Internal Method) + + \since BeOS R3 +*/ + + +/*! + \fn const char* BTab::Label() const + \brief Returns the tab's label (The target view's name). + + \since BeOS R3 +*/ + + +/*! + \fn void BTab::SetLabel(const char* label) + \brief Sets the tab's label. + + \since BeOS R3 +*/ + + +/*! + \class BTabView + \ingroup interface + \ingroup libbe + \brief Displays and manipulates styled text. + + \since BeOS R3 +*/ + + +/*! + \fn bool BTab::IsSelected() const + \brief Returns whether or not the tab is selected. + + \since BeOS R3 +*/ + + +/*! + \fn void BTab::Select(BView* owner) + \brief Selects the tab. + + This also adds the tab's target view to the \a owner view. + + \since BeOS R3 +*/ + + +/*! + \fn void BTab::Deselect() + \brief Delects the tab. + + \since BeOS R3 +*/ + + +/*! + \fn void BTab::SetEnabled(bool enable) + \brief Enables or disables the tab. + + \since BeOS R3 +*/ + + +/*! + \fn bool BTab::IsEnabled() const + \brief Returns whether or not the tab is enabled. +*/ + + +/*! + \fn void BTab::MakeFocus(bool focus) + \brief Makes the tab the window's focus view or removes it. + + \since BeOS R3 +*/ + + +/*! + \fn bool BTab::IsFocus() const + \brief Returns whether or not the tab is the window's focus view. +*/ + + +/*! + \fn void BTab::SetView(BView* view) + \brief Sets the view to be displayed for this tab. +*/ + + +/*! + \fn BView* BTab::View() const + \brief Returns a pointer to the view to be displayed for this tab. +*/ + + +/*! + \fn void BTab::DrawFocusMark(BView* owner, BRect frame) + \brief Draws the mark indicating that the BTab object is in focus. + + This consists of a blue line drawn across the bottom of the tab frame + by default. + + \since BeOS R3 +*/ + + +/*! + \fn void BTab::DrawLabel(BView* owner, BRect frame) + \brief Draws the tab's title. + + \since BeOS R3 +*/ + + +/*! + \fn void BTab::DrawTab(BView* owner, BRect frame, tab_position position, + bool full) + \brief Draws the tab. + + This method draws the tab's title by calling DrawLabel(), then draws the + tab itself. The \a position of the tab may affect how the tab is rendered + -- for example the frontmost tab may have a different appearance than the + other tabs. + + \param owner The view that owns the tab. + \param frame The frame rectangle to draw in. + \param position May affect how the tab is rendered. Choices include: + - \c B_TAB_FIRST + - \c B_TAB_FRONT + - \c B_TAB_ANY + \param full Whether or not to completely draw the tab, no longer used. + + \since BeOS R3 +*/ + + +/*! + \class BTabView + \ingroup interface + \ingroup libbe + \brief A container for BTab objects to display all tabs. + + \since BeOS R3 +*/ + + +/*! + \fn BTabView::BTabView(const char* name, button_width width, uint32 flags) + \brief Initializes a new BTabView object for use as part of a BLayout. + + \param name The name of the tab view. + \param width The tab width flag to use. Options include: + - \c B_WIDTH_AS_USUAL + - \c B_WIDTH_FROM_WIDEST + - \c B_WIDTH_FROM_LABEL + \param flags \a flags passed to BView. + + \since Haiku R1 +*/ + + +/*! + \fn BTabView::BTabView(BRect frame, const char* name, button_width width, + uint32 resizeMask, uint32 flags) + \brief Initializes a new BTabView object. + + \param frame The frame rectangle. + \param name The name of the tab view. + \param width The tab width flag to use. Options include: + - \c B_WIDTH_AS_USUAL + - \c B_WIDTH_FROM_WIDEST + - \c B_WIDTH_FROM_LABEL + \param resizeMask Resizing mask, passed to BView. + \param flags \a flags passed to BView. + + \since BeOS R3 +*/ + + +/*! + \fn BTabView::BTabView(BMessage* archive) + \brief Creates a BTabView object from the passed in \a archive. + + \since BeOS R3 +*/ + + +/*! + \fn BTabView::~BTabView() + \brief Frees the memory allocated by each tab then destroys the object. + + \since BeOS R3 +*/ + + +/*! + \name Archiving +*/ + + +//! @{ + + +/*! + \fn BArchivable* BTabView::Instantiate(BMessage* archive) + \brief Instantiates a BTabView object from the passed in \a archive. + + \since BeOS R3 +*/ + + +/*! + \fn status_t BTabView::Archive(BMessage* data, bool deep) const + \brief Archives the object into the \a data message. + + \param data A pointer to the BMessage object to archive the object into. + \param deep Whether or not to archive child views as well. + + \return A status code, \c B_OK if everything went well or an error code + otherwise. + \retval B_OK The object was archived. + \retval B_NO_MEMORY Ran out of memory while archiving the object. + + \since BeOS R3 +*/ + + +/*! + \fn status_t BTabView::AllUnarchived(const BMessage* from) + \brief Hook method called when all views have been unarchived. + + \copydetails BView::AllUnarchived() +*/ + + +//! @} + + +/*! + \fn status_t BTabView::Perform(perform_code code, void* _data) + \brief Perform some action. (Internal Method) +*/ + + +/*! + \name Hook Methods +*/ + + +//! @{ + + +/*! + \fn void BTabView::AllAttached() + \copydoc BView::AllAttached() +*/ + + +/*! + \fn void BTabView::AllDetached() + \copydoc BView::AllDetached() +*/ + + +/*! + \fn void BTabView::AttachedToWindow() + \copydoc BView::AttachedToWindow() +*/ + + +/*! + \fn void BTabView::DetachedFromWindow() + \copydoc BView::DetachedFromWindow() +*/ + + +/*! + \fn void BTabView::Draw(BRect updateRect) + \brief Draws the focus tab and the tab view frame. + + \since BeOS R3 +*/ + + +/*! + \fn BRect BTabView::DrawTabs() + \brief Draws all the tabs in the BTabView and returns the frame rectangle + of the currently selected tab. + + \since BeOS R3 +*/ + + +/*! + \fn void BTabView::DrawBox(BRect selTabRect) + \brief Draws the box that encloses the container view. + + \param selTabRect The frame rectangle of the currently selected tab. + + \since BeOS R3 +*/ + + +/*! + \fn void BTabView::FrameResized(float newWidth, float newHeight) + \copydoc BView::FrameResized() +*/ + + +/*! + \fn void BTabView::KeyDown(const char* bytes, int32 numBytes) + \brief Handles keyboard navigation for the BTabView. + + Down and left arrow keys move the focus tab left, up and right + arrow keys move the focus tab right. The space bar and enter keys + select the currently focused tab. + + \sa BView::KeyDown() + + \since BeOS R3 +*/ + + +/*! + \fn void BTabView::MessageReceived(BMessage* message) + \brief Handles scripting messages for the tab view. + + \copydetails BView::MessageReceived() +*/ + + +/*! + \fn void BTabView::MouseDown(BPoint where) + \brief Selects the tab that the user clicked on (if any). + + \sa BView::MouseDown() + + \since BeOS R3 +*/ + + +/*! + \fn void BTabView::MouseUp(BPoint where) + \copydoc BView::MouseUp() +*/ + + +/*! + \fn void BTabView::MouseMoved(BPoint where, uint32 code, + const BMessage* dragMessage) + \copydoc BView::MouseMoved() +*/ + + +/*! + \fn void BTabView::Pulse() + \copydoc BView::Pulse() +*/ + + +/*! + \fn void BTabView::Select(int32 index) + \brief Selects the tab at the given \a index making it the selected tab. + + \param index The zero-based tab index of the tab to select. + + \since BeOS R3 +*/ + + +/*! + \fn int32 BTabView::Selection() const + \brief Returns the currently selected tab's index. + + \since BeOS R3 +*/ + + +/*! + \fn void BTabView::WindowActivated(bool active) + \copydoc BView::WindowActivated() +*/ + + +//! @} + + +/*! + \fn void BTabView::MakeFocus(bool focus) + \brief Highlight or unhighlight the selection when the tab view acquires + or loses its focus state. + + \copydetails BView::MakeFocus() +*/ + + +/*! + \fn void BTabView::SetFocusTab(int32 tab, bool focus) + \brief Sets the focus state of the specified \a tab. + + \param tab The index of the tab to set the focus state of. + \param focus \c true to set focus, \c false to remove it. + + \since BeOS R3 +*/ + + +/*! + \fn int32 BTabView::FocusTab() const + \brief Returns the index of the current focus tab. + + \since BeOS R3 +*/ + + +/*! + \fn BRect BTabView::TabFrame(int32 index) const + \brief Returns the frame rectangle of the tab at the specified \a index. + + \since BeOS R3 +*/ + + +/*! + \fn void BTabView::SetFlags(uint32 flags) + \copydoc BView::SetFlags() +*/ + + +/*! + \fn void BTabView::SetResizingMode(uint32 mode) + \copydoc BView::SetResizingMode() +*/ + + +/*! + \fn void BTabView::ResizeToPreferred() + \copydoc BView::ResizeToPreferred() +*/ + + +/*! + \fn void BTabView::GetPreferredSize(float* _width, float* _height) + \copydoc BView::GetPreferredSize() +*/ + + +/*! + \fn BSize BTabView::MinSize() + \brief Returns the tab view's minimum size in a BLayout. + + \since Haiku R1 +*/ + + +/*! + \fn BSize BTabView::MaxSize() + \brief Returns the tab view's maximum size in a BLayout. + + \since Haiku R1 +*/ + + +/*! + \fn BSize BTabView::PreferredSize() + \brief Returns the tab view's preferred size in a BLayout. + + \since Haiku R1 +*/ + + +/*! + \fn void BTabView::FrameMoved(BPoint newPosition) + \copydoc BView::FrameMoved() +*/ + + +/*! + \fn void BTabView::FrameResized(float newWidth, float newHeight) + \copydoc BView::FrameResized() + + +/*! + \fn BHandler* BTabView::ResolveSpecifier(BMessage* message, int32 index, + BMessage* specifier, int32 what, const char* property) + \copydoc BHandler::ResolveSpecifier() +*/ + + +/*! + \fn status_t BTabView::GetSupportedSuites(BMessage* message) + \copydoc BHandler::GetSupportedSuites() +*/ + + +/*! + \fn void BTabView::AddTab(BView* target, BTab* tab) + \brief Adds the specified \a tab to the BTabView. + + The tab is added to the end of the tab list. The new tab's target view is + set to \a target. If \a tab is \c NULL, a new BTab object is constructed + and added to the BTabView. You can get a pointer to the new tab by calling + the TabAt() method. + + If you choose to reimplement AddTab(), you should call this parent method + at the end of your method. + + \sa BTabView::TabAt() + + \since BeOS R3 +*/ + + +/*! + \fn BTab* BTabView::RemoveTab(int32 index) + \brief Removes the tab at the specified \a index from the BTabView and + returns a pointer to the BTab object. + + The BTab object is not deleted, if you don't need it anymore you should delete it. + + \since BeOS R3 +*/ + + +/*! + \fn BTab* BTabView::TabAt(int32 index) const + \brief Returns a pointer to the BTab object at the specified \a index. + + \since BeOS R3 +*/ + + +/*! + \fn void BTabView::SetTabWidth(button_width width) + \brief Sets the width of the tabs in the BTabView + + \a width is one of the following: + - \c B_WIDTH_FROM_WIDEST Each tab's width is determined from the width of the widest tab. + - \c B_WIDTH_AS_USUAL The default tab width is used for all tabs. + - \c B_WIDTH_FROM_LABEL The label of each tab determines the tab width. + + \since BeOS R3 +*/ + + +/*! + \fn button_width BTabView::TabWidth() const + \brief Returns the current tab width flag. + + \since BeOS R3 +*/ + + +/*! + \fn void BTabView::SetTabHeight(float height) + \brief Sets the height of the tabs to \a height. + + \a height should be an integral value. + + \since BeOS R3 +*/ + + +/*! + \fn float BTabView::TabHeight() const + \brief Returns the current tab height. + + \since BeOS R3 +*/ + + +/*! + \fn void BTabView::SetBorder(border_style border) + \brief Sets the border of the tab view to \a border. + + \since Haiku R1 +*/ + + +/*! + \fn border_style BTabView::Border() const + \brief Returns the current border_style flag. + + \since Haiku R1 +*/ + + +/*! + \fn BView* BTabView::ContainerView() const + \brief Returns a pointer to the tab view's container view. + + \since Haiku R1 +*/ + + +/*! + \fn int32 BTabView::CountTabs() const + \brief Returns the number of tabs in the tab view. + + \since Haiku R1 +*/ + + +/*! + \fn BView* BTabView::ViewForTab(int32 tabIndex) const + \brief Returns the BView of the tab at the specified \a tabIndex. + + \since Haiku R1 +*/ + ############################################################################ Commit: 5ebeb710aba4cb5184afe72d66d50a312a8ec0b6 URL: http://cgit.haiku-os.org/haiku/commit/?id=5ebeb71 Author: John Scipione <jscipione@xxxxxxxxx> Date: Sat Dec 20 00:51:01 2014 UTC B_WIDTH_FROM_LABEL was not available until BeOS R5 ---------------------------------------------------------------------------- diff --git a/docs/user/interface/InterfaceDefs.dox b/docs/user/interface/InterfaceDefs.dox index 05c10c6..d66410d 100644 --- a/docs/user/interface/InterfaceDefs.dox +++ b/docs/user/interface/InterfaceDefs.dox @@ -127,7 +127,7 @@ Set the width of each button to accomidate the width of the button's label. - \since BeOS R3 + \since BeOS R5 */ ############################################################################ Commit: d3c48335141aa55d470dedc362032b914e4f6844 URL: http://cgit.haiku-os.org/haiku/commit/?id=d3c4833 Author: John Scipione <jscipione@xxxxxxxxx> Date: Sat Dec 20 00:58:14 2014 UTC Some more small documentation fixes ---------------------------------------------------------------------------- diff --git a/docs/user/interface/InterfaceDefs.dox b/docs/user/interface/InterfaceDefs.dox index d66410d..5c8a2f3 100644 --- a/docs/user/interface/InterfaceDefs.dox +++ b/docs/user/interface/InterfaceDefs.dox @@ -124,8 +124,7 @@ /*! \var button_width B_WIDTH_FROM_LABEL - Set the width of each button to accomidate the width of the button's - label. + Set the width of each button to accommodate the label. \since BeOS R5 */ diff --git a/docs/user/interface/TabView.dox b/docs/user/interface/TabView.dox index 55ff9c8..7d6b780 100644 --- a/docs/user/interface/TabView.dox +++ b/docs/user/interface/TabView.dox @@ -50,7 +50,7 @@ /*! \var tab_position B_TAB_ANY - Represents any tab in the tab view. + Any tab in the tab view. \since BeOS R3 */ @@ -60,7 +60,7 @@ \class BTab \ingroup interface \ingroup libbe - \brief A Tab that goes in a TabView. + \brief A tab that goes in a BTabView. \since BeOS R3 */ diff --git a/docs/user/interface/TextControl.dox b/docs/user/interface/TextControl.dox index e4e70fa..d4a02f2 100644 --- a/docs/user/interface/TextControl.dox +++ b/docs/user/interface/TextControl.dox @@ -430,7 +430,7 @@ \fn void BTextControl::GetPreferredSize(float* _width, float* _height) \brief Fills out \a _width and \a _height with the optimal width and height of the text control to display the label and the text - respectively. + respectively. \since BeOS R3 */ @@ -513,8 +513,8 @@ /*! \fn BLayoutItem* BTextControl::CreateLabelLayoutItem() - \brief Creates a label layout item and returns a pointer to it. - (Layout constructor only) + \brief Creates a label layout item and returns a pointer to it + (Layout constructor only). \sa CreateTextViewLayoutItem() ############################################################################ Revision: hrev48530 Commit: b825666f3f37b12e687b05f3139f42ce5dcd9638 URL: http://cgit.haiku-os.org/haiku/commit/?id=b825666 Author: John Scipione <jscipione@xxxxxxxxx> Date: Sat Dec 20 00:58:56 2014 UTC Rename method parameter in header to match implementation ---------------------------------------------------------------------------- diff --git a/headers/os/interface/TabView.h b/headers/os/interface/TabView.h index 04a9a4e..3bf12f3 100644 --- a/headers/os/interface/TabView.h +++ b/headers/os/interface/TabView.h @@ -111,7 +111,7 @@ public: const BMessage* dragMessage); virtual void Pulse(); - virtual void Select(int32 tab); + virtual void Select(int32 index); int32 Selection() const; virtual void WindowActivated(bool active);