Style fixes to BBox, update copyright header

This commit is contained in:
John Scipione
2013-05-30 20:35:42 -04:00
parent 19d9ad49ae
commit f9954bfc69
2 changed files with 44 additions and 40 deletions
+10 -10
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2005-2006, Haiku, Inc. All Rights Reserved. * Copyright 2005-2013 Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _BOX_H #ifndef _BOX_H
@@ -11,7 +11,7 @@
class BBox : public BView { class BBox : public BView {
public: public:
BBox(BRect frame, const char *name = NULL, BBox(BRect frame, const char* name = NULL,
uint32 resizingMode = B_FOLLOW_LEFT uint32 resizingMode = B_FOLLOW_LEFT
| B_FOLLOW_TOP, | B_FOLLOW_TOP,
uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS
@@ -47,8 +47,8 @@ class BBox : public BView {
virtual void DetachedFromWindow(); virtual void DetachedFromWindow();
virtual void AllAttached(); virtual void AllAttached();
virtual void AllDetached(); virtual void AllDetached();
virtual void FrameResized(float width, float height); virtual void FrameResized(float width, float height);
virtual void MessageReceived(BMessage* message); virtual void MessageReceived(BMessage* message);
virtual void MouseDown(BPoint point); virtual void MouseDown(BPoint point);
virtual void MouseUp(BPoint point); virtual void MouseUp(BPoint point);
virtual void WindowActivated(bool active); virtual void WindowActivated(bool active);
@@ -56,16 +56,16 @@ class BBox : public BView {
const BMessage* dragMessage); const BMessage* dragMessage);
virtual void FrameMoved(BPoint newLocation); virtual void FrameMoved(BPoint newLocation);
virtual BHandler* ResolveSpecifier(BMessage* message, virtual BHandler* ResolveSpecifier(BMessage* message,
int32 index, BMessage* specifier, int32 index, BMessage* specifier,
int32 what, const char* property); int32 what, const char* property);
virtual void ResizeToPreferred(); virtual void ResizeToPreferred();
virtual void GetPreferredSize(float* _width, float* _height); virtual void GetPreferredSize(float* _width, float* _height);
virtual void MakeFocus(bool focused = true); virtual void MakeFocus(bool focused = true);
virtual status_t GetSupportedSuites(BMessage* message); virtual status_t GetSupportedSuites(BMessage* message);
virtual status_t Perform(perform_code d, void* arg); virtual status_t Perform(perform_code d, void* arg);
virtual BSize MinSize(); virtual BSize MinSize();
virtual BSize MaxSize(); virtual BSize MaxSize();
+34 -30
View File
@@ -1,12 +1,13 @@
/* /*
* Copyright (c) 2001-2009, Haiku, Inc. * Copyright 2001-2013 Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT license. * Distributed under the terms of the MIT license.
* *
* Authors: * Authors:
* Marc Flerackers ([email protected]) * Stephan Aßmus, [email protected]
* Stephan Aßmus <[email protected]> * DarkWyrm, [email protected]
* DarkWyrm <[email protected]>
* Axel Dörfler, [email protected] * Axel Dörfler, [email protected]
* Marc Flerackers, [email protected]
* John Scipione, [email protected]
*/ */
@@ -41,9 +42,10 @@ struct BBox::LayoutData {
}; };
BBox::BBox(BRect frame, const char *name, uint32 resizingMode, uint32 flags, BBox::BBox(BRect frame, const char* name, uint32 resizingMode, uint32 flags,
border_style border) border_style border)
: BView(frame, name, resizingMode, flags | B_WILL_DRAW | B_FRAME_EVENTS), :
BView(frame, name, resizingMode, flags | B_WILL_DRAW | B_FRAME_EVENTS),
fStyle(border) fStyle(border)
{ {
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
@@ -54,8 +56,9 @@ BBox::BBox(BRect frame, const char *name, uint32 resizingMode, uint32 flags,
BBox::BBox(const char* name, uint32 flags, border_style border, BView* child) BBox::BBox(const char* name, uint32 flags, border_style border, BView* child)
: BView(name, flags | B_WILL_DRAW | B_FRAME_EVENTS), :
fStyle(border) BView(name, flags | B_WILL_DRAW | B_FRAME_EVENTS),
fStyle(border)
{ {
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
@@ -68,8 +71,9 @@ BBox::BBox(const char* name, uint32 flags, border_style border, BView* child)
BBox::BBox(border_style border, BView* child) BBox::BBox(border_style border, BView* child)
: BView(NULL, B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP), :
fStyle(border) BView(NULL, B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP),
fStyle(border)
{ {
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
@@ -81,9 +85,10 @@ BBox::BBox(border_style border, BView* child)
} }
BBox::BBox(BMessage *archive) BBox::BBox(BMessage* archive)
: BView(archive), :
fStyle(B_FANCY_BORDER) BView(archive),
fStyle(B_FANCY_BORDER)
{ {
_InitObject(archive); _InitObject(archive);
} }
@@ -97,8 +102,8 @@ BBox::~BBox()
} }
BArchivable * BArchivable*
BBox::Instantiate(BMessage *archive) BBox::Instantiate(BMessage* archive)
{ {
if (validate_instantiation(archive, "BBox")) if (validate_instantiation(archive, "BBox"))
return new BBox(archive); return new BBox(archive);
@@ -108,7 +113,7 @@ BBox::Instantiate(BMessage *archive)
status_t status_t
BBox::Archive(BMessage *archive, bool deep) const BBox::Archive(BMessage* archive, bool deep) const
{ {
status_t ret = BView::Archive(archive, deep); status_t ret = BView::Archive(archive, deep);
@@ -179,7 +184,7 @@ BBox::InnerFrame()
void void
BBox::SetLabel(const char *string) BBox::SetLabel(const char* string)
{ {
_ClearLabel(); _ClearLabel();
@@ -194,7 +199,7 @@ BBox::SetLabel(const char *string)
status_t status_t
BBox::SetLabel(BView *viewLabel) BBox::SetLabel(BView* viewLabel)
{ {
_ClearLabel(); _ClearLabel();
@@ -213,14 +218,14 @@ BBox::SetLabel(BView *viewLabel)
} }
const char * const char*
BBox::Label() const BBox::Label() const
{ {
return fLabel; return fLabel;
} }
BView * BView*
BBox::LabelView() const BBox::LabelView() const
{ {
return fLabelView; return fLabelView;
@@ -357,7 +362,7 @@ BBox::FrameResized(float width, float height)
void void
BBox::MessageReceived(BMessage *message) BBox::MessageReceived(BMessage* message)
{ {
BView::MessageReceived(message); BView::MessageReceived(message);
} }
@@ -385,7 +390,7 @@ BBox::WindowActivated(bool active)
void void
BBox::MouseMoved(BPoint point, uint32 transit, const BMessage *message) BBox::MouseMoved(BPoint point, uint32 transit, const BMessage* message)
{ {
BView::MouseMoved(point, transit, message); BView::MouseMoved(point, transit, message);
} }
@@ -398,10 +403,9 @@ BBox::FrameMoved(BPoint newLocation)
} }
BHandler * BHandler*
BBox::ResolveSpecifier(BMessage *message, int32 index, BBox::ResolveSpecifier(BMessage* message, int32 index, BMessage* specifier,
BMessage *specifier, int32 what, int32 what, const char* property)
const char *property)
{ {
return BView::ResolveSpecifier(message, index, specifier, what, property); return BView::ResolveSpecifier(message, index, specifier, what, property);
} }
@@ -424,7 +428,7 @@ BBox::ResizeToPreferred()
void void
BBox::GetPreferredSize(float *_width, float *_height) BBox::GetPreferredSize(float* _width, float* _height)
{ {
_ValidateLayoutData(); _ValidateLayoutData();
@@ -443,7 +447,7 @@ BBox::MakeFocus(bool focused)
status_t status_t
BBox::GetSupportedSuites(BMessage *message) BBox::GetSupportedSuites(BMessage* message)
{ {
return BView::GetSupportedSuites(message); return BView::GetSupportedSuites(message);
} }
@@ -480,7 +484,7 @@ BBox::Perform(perform_code code, void* _data)
BBox::GetHeightForWidth(data->width, &data->min, &data->max, BBox::GetHeightForWidth(data->width, &data->min, &data->max,
&data->preferred); &data->preferred);
return B_OK; return B_OK;
} }
case PERFORM_CODE_SET_LAYOUT: case PERFORM_CODE_SET_LAYOUT:
{ {
perform_data_set_layout* data = (perform_data_set_layout*)_data; perform_data_set_layout* data = (perform_data_set_layout*)_data;
@@ -633,7 +637,7 @@ BBox::_InitObject(BMessage* archive)
SetFont(&font, flags); SetFont(&font, flags);
if (archive != NULL) { if (archive != NULL) {
const char *string; const char* string;
if (archive->FindString("_label", &string) == B_OK) if (archive->FindString("_label", &string) == B_OK)
SetLabel(string); SetLabel(string);