BCheckBox: Style fixes, variable renaming for consistency, docs.

Also some other style fixes, no functional changes intended.
This commit is contained in:
John Scipione
2014-05-28 14:06:32 -04:00
parent 78615023ce
commit 7ad8e674de
2 changed files with 44 additions and 45 deletions
+10 -10
View File
@@ -1,10 +1,11 @@
/*
* Copyright 2001-2009, Haiku, Inc. All rights reserved.
* Copyright 2001-2014 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _CHECK_BOX_H
#define _CHECK_BOX_H
#include <Control.h>
@@ -20,13 +21,12 @@ public:
= B_WILL_DRAW | B_NAVIGABLE);
BCheckBox(const char* label,
BMessage* message = NULL);
BCheckBox(BMessage* archive);
BCheckBox(BMessage* data);
virtual ~BCheckBox();
static BArchivable* Instantiate(BMessage* archive);
virtual status_t Archive(BMessage* archive,
bool deep = true) const;
static BArchivable* Instantiate(BMessage* data);
virtual status_t Archive(BMessage* data, bool deep = true) const;
virtual void Draw(BRect updateRect);
@@ -35,7 +35,7 @@ public:
virtual void AllAttached();
virtual void AllDetached();
virtual void FrameMoved(BPoint newLocation);
virtual void FrameMoved(BPoint newPosition);
virtual void FrameResized(float width, float height);
virtual void WindowActivated(bool active);
@@ -43,9 +43,9 @@ public:
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 code,
const BMessage* dragMessage);
virtual void GetPreferredSize(float* _width,
@@ -100,5 +100,5 @@ private:
bool fPartialToOff;
};
#endif // _CHECK_BOX_H
#endif // _CHECK_BOX_H
+22 -23
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2009, Haiku Inc.
* Copyright 2001-2014 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -7,7 +7,8 @@
* Stephan Aßmus <[email protected]>
*/
/*! BCheckBox displays an on/off control. */
// BCheckBox displays an on/off control.
#include <CheckBox.h>
@@ -62,9 +63,9 @@ BCheckBox::BCheckBox(const char *label, BMessage *message)
}
BCheckBox::BCheckBox(BMessage *archive)
BCheckBox::BCheckBox(BMessage* data)
:
BControl(archive),
BControl(data),
fOutlined(false),
fPartialToOff(false)
{
@@ -76,27 +77,27 @@ BCheckBox::~BCheckBox()
}
// #pragma mark -
// #pragma mark - Archiving methods
BArchivable*
BCheckBox::Instantiate(BMessage *archive)
BCheckBox::Instantiate(BMessage* data)
{
if (validate_instantiation(archive, "BCheckBox"))
return new(std::nothrow) BCheckBox(archive);
if (validate_instantiation(data, "BCheckBox"))
return new(std::nothrow) BCheckBox(data);
return NULL;
}
status_t
BCheckBox::Archive(BMessage *archive, bool deep) const
BCheckBox::Archive(BMessage* data, bool deep) const
{
return BControl::Archive(archive, deep);
return BControl::Archive(data, deep);
}
// #pragma mark -
// #pragma mark - Hook methods
void
@@ -153,9 +154,9 @@ BCheckBox::AllDetached()
void
BCheckBox::FrameMoved(BPoint newLocation)
BCheckBox::FrameMoved(BPoint newPosition)
{
BControl::FrameMoved(newLocation);
BControl::FrameMoved(newPosition);
}
@@ -173,9 +174,6 @@ BCheckBox::WindowActivated(bool active)
}
// #pragma mark -
void
BCheckBox::MessageReceived(BMessage* message)
{
@@ -200,7 +198,7 @@ BCheckBox::KeyDown(const char *bytes, int32 numBytes)
void
BCheckBox::MouseDown(BPoint point)
BCheckBox::MouseDown(BPoint where)
{
if (!IsEnabled())
return;
@@ -221,9 +219,9 @@ BCheckBox::MouseDown(BPoint point)
do {
snooze(40000);
GetMouse(&point, &buttons, true);
GetMouse(&where, &buttons, true);
bool inside = bounds.Contains(point);
bool inside = bounds.Contains(where);
if (fOutlined != inside) {
fOutlined = inside;
Invalidate();
@@ -244,12 +242,12 @@ BCheckBox::MouseDown(BPoint point)
void
BCheckBox::MouseUp(BPoint point)
BCheckBox::MouseUp(BPoint where)
{
if (!IsTracking())
return;
bool inside = Bounds().Contains(point);
bool inside = Bounds().Contains(where);
if (fOutlined != inside) {
fOutlined = inside;
@@ -269,12 +267,13 @@ BCheckBox::MouseUp(BPoint point)
void
BCheckBox::MouseMoved(BPoint point, uint32 transit, const BMessage *message)
BCheckBox::MouseMoved(BPoint where, uint32 code,
const BMessage* dragMessage)
{
if (!IsTracking())
return;
bool inside = Bounds().Contains(point);
bool inside = Bounds().Contains(where);
if (fOutlined != inside) {
fOutlined = inside;