* Copyright fixed

* Indentation updated.
* Better grouping of methods.

+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32702 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2009-08-26 12:22:10 +00:00
parent 13e50c47a2
commit 6eb37bdef7
2 changed files with 222 additions and 192 deletions
+142 -118
View File
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2009, Haiku, Inc.
* Distributed under the terms of the MIT License.
* Copyright 2001-2009, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT license.
*
* Authors:
* Marc Flerackers ([email protected])
@@ -133,17 +133,140 @@ BMenuBar::Archive(BMessage* data, bool deep) const
}
// #pragma mark -
void
BMenuBar::SetBorder(menu_bar_border border)
BMenuBar::AttachedToWindow()
{
fBorder = border;
_Install(Window());
Window()->SetKeyMenuBar(this);
BMenu::AttachedToWindow();
*fLastBounds = Bounds();
}
menu_bar_border
BMenuBar::Border() const
void
BMenuBar::DetachedFromWindow()
{
return fBorder;
BMenu::DetachedFromWindow();
}
void
BMenuBar::AllAttached()
{
BMenu::AllAttached();
}
void
BMenuBar::AllDetached()
{
BMenu::AllDetached();
}
void
BMenuBar::WindowActivated(bool state)
{
BView::WindowActivated(state);
}
void
BMenuBar::MakeFocus(bool state)
{
BMenu::MakeFocus(state);
}
// #pragma mark -
void
BMenuBar::ResizeToPreferred()
{
BMenu::ResizeToPreferred();
}
void
BMenuBar::GetPreferredSize(float* width, float* height)
{
BMenu::GetPreferredSize(width, height);
}
BSize
BMenuBar::MinSize()
{
return BMenu::MinSize();
}
BSize
BMenuBar::MaxSize()
{
BSize size = BMenu::MaxSize();
return BLayoutUtils::ComposeSize(ExplicitMaxSize(),
BSize(B_SIZE_UNLIMITED, size.height));
}
BSize
BMenuBar::PreferredSize()
{
return BMenu::PreferredSize();
}
void
BMenuBar::FrameMoved(BPoint newPosition)
{
BMenu::FrameMoved(newPosition);
}
void
BMenuBar::FrameResized(float newWidth, float newHeight)
{
// invalidate right border
if (newWidth != fLastBounds->Width()) {
BRect rect(min_c(fLastBounds->right, newWidth), 0,
max_c(fLastBounds->right, newWidth), newHeight);
Invalidate(rect);
}
// invalidate bottom border
if (newHeight != fLastBounds->Height()) {
BRect rect(0, min_c(fLastBounds->bottom, newHeight) - 1,
newWidth, max_c(fLastBounds->bottom, newHeight));
Invalidate(rect);
}
fLastBounds->Set(0, 0, newWidth, newHeight);
BMenu::FrameResized(newWidth, newHeight);
}
// #pragma mark -
void
BMenuBar::Show()
{
BView::Show();
}
void
BMenuBar::Hide()
{
BView::Hide();
}
@@ -198,23 +321,7 @@ BMenuBar::Draw(BRect updateRect)
}
void
BMenuBar::AttachedToWindow()
{
_Install(Window());
Window()->SetKeyMenuBar(this);
BMenu::AttachedToWindow();
*fLastBounds = Bounds();
}
void
BMenuBar::DetachedFromWindow()
{
BMenu::DetachedFromWindow();
}
// #pragma mark -
void
@@ -240,13 +347,6 @@ BMenuBar::MouseDown(BPoint where)
}
void
BMenuBar::WindowActivated(bool state)
{
BView::WindowActivated(state);
}
void
BMenuBar::MouseUp(BPoint where)
{
@@ -254,48 +354,7 @@ BMenuBar::MouseUp(BPoint where)
}
void
BMenuBar::FrameMoved(BPoint newPosition)
{
BMenu::FrameMoved(newPosition);
}
void
BMenuBar::FrameResized(float newWidth, float newHeight)
{
// invalidate right border
if (newWidth != fLastBounds->Width()) {
BRect rect(min_c(fLastBounds->right, newWidth), 0,
max_c(fLastBounds->right, newWidth), newHeight);
Invalidate(rect);
}
// invalidate bottom border
if (newHeight != fLastBounds->Height()) {
BRect rect(0, min_c(fLastBounds->bottom, newHeight) - 1,
newWidth, max_c(fLastBounds->bottom, newHeight));
Invalidate(rect);
}
fLastBounds->Set(0, 0, newWidth, newHeight);
BMenu::FrameResized(newWidth, newHeight);
}
void
BMenuBar::Show()
{
BView::Show();
}
void
BMenuBar::Hide()
{
BView::Hide();
}
// #pragma mark -
BHandler*
@@ -313,39 +372,24 @@ BMenuBar::GetSupportedSuites(BMessage* data)
}
void
BMenuBar::ResizeToPreferred()
{
BMenu::ResizeToPreferred();
}
// #pragma mark -
void
BMenuBar::GetPreferredSize(float* width, float* height)
BMenuBar::SetBorder(menu_bar_border border)
{
BMenu::GetPreferredSize(width, height);
fBorder = border;
}
void
BMenuBar::MakeFocus(bool state)
menu_bar_border
BMenuBar::Border() const
{
BMenu::MakeFocus(state);
return fBorder;
}
void
BMenuBar::AllAttached()
{
BMenu::AllAttached();
}
void
BMenuBar::AllDetached()
{
BMenu::AllDetached();
}
// #pragma mark -
status_t
@@ -404,29 +448,6 @@ BMenuBar::Perform(perform_code code, void* _data)
}
BSize
BMenuBar::MinSize()
{
return BMenu::MinSize();
}
BSize
BMenuBar::MaxSize()
{
BSize size = BMenu::MaxSize();
return BLayoutUtils::ComposeSize(ExplicitMaxSize(),
BSize(B_SIZE_UNLIMITED, size.height));
}
BSize
BMenuBar::PreferredSize()
{
return BMenu::PreferredSize();
}
// #pragma mark -
@@ -443,6 +464,9 @@ BMenuBar::operator=(const BMenuBar &)
}
// #pragma mark -
void
BMenuBar::StartMenuBar(int32 menuIndex, bool sticky, bool showMenu,
BRect* specialRect)