Style fixes to BMenuField
Rename resize to resizingMode, whitespace fixes, compare to 0 explicitly
This commit is contained in:
@@ -16,12 +16,14 @@ class BMenuField : public BView {
|
|||||||
public:
|
public:
|
||||||
BMenuField(BRect frame, const char* name,
|
BMenuField(BRect frame, const char* name,
|
||||||
const char* label, BMenu* menu,
|
const char* label, BMenu* menu,
|
||||||
uint32 resize = B_FOLLOW_LEFT|B_FOLLOW_TOP,
|
uint32 resizingMode = B_FOLLOW_LEFT
|
||||||
|
| B_FOLLOW_TOP,
|
||||||
uint32 flags = B_WILL_DRAW | B_NAVIGABLE);
|
uint32 flags = B_WILL_DRAW | B_NAVIGABLE);
|
||||||
BMenuField(BRect frame, const char* name,
|
BMenuField(BRect frame, const char* name,
|
||||||
const char* label, BMenu* menu,
|
const char* label, BMenu* menu,
|
||||||
bool fixed_size,
|
bool fixed_size,
|
||||||
uint32 resize = B_FOLLOW_LEFT|B_FOLLOW_TOP,
|
uint32 resizingMode = B_FOLLOW_LEFT
|
||||||
|
| B_FOLLOW_TOP,
|
||||||
uint32 flags = B_WILL_DRAW | B_NAVIGABLE);
|
uint32 flags = B_WILL_DRAW | B_NAVIGABLE);
|
||||||
BMenuField(const char* name,
|
BMenuField(const char* name,
|
||||||
const char* label, BMenu* menu,
|
const char* label, BMenu* menu,
|
||||||
@@ -41,8 +43,8 @@ public:
|
|||||||
virtual void MouseDown(BPoint where);
|
virtual void MouseDown(BPoint where);
|
||||||
virtual void KeyDown(const char* bytes, int32 numBytes);
|
virtual void KeyDown(const char* bytes, int32 numBytes);
|
||||||
virtual void MakeFocus(bool state);
|
virtual void MakeFocus(bool state);
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
virtual void WindowActivated(bool state);
|
virtual void WindowActivated(bool state);
|
||||||
virtual void MouseUp(BPoint where);
|
virtual void MouseUp(BPoint where);
|
||||||
virtual void MouseMoved(BPoint where, uint32 transit,
|
virtual void MouseMoved(BPoint where, uint32 transit,
|
||||||
const BMessage* dragMessage);
|
const BMessage* dragMessage);
|
||||||
@@ -58,7 +60,7 @@ public:
|
|||||||
virtual void SetLabel(const char* label);
|
virtual void SetLabel(const char* label);
|
||||||
const char* Label() const;
|
const char* Label() const;
|
||||||
|
|
||||||
virtual void SetEnabled(bool on);
|
virtual void SetEnabled(bool on);
|
||||||
bool IsEnabled() const;
|
bool IsEnabled() const;
|
||||||
|
|
||||||
virtual void SetAlignment(alignment label);
|
virtual void SetAlignment(alignment label);
|
||||||
@@ -69,13 +71,13 @@ public:
|
|||||||
void ShowPopUpMarker();
|
void ShowPopUpMarker();
|
||||||
void HidePopUpMarker();
|
void HidePopUpMarker();
|
||||||
|
|
||||||
virtual BHandler* ResolveSpecifier(BMessage* message,
|
virtual BHandler* ResolveSpecifier(BMessage* message,
|
||||||
int32 index, BMessage* specifier,
|
int32 index, BMessage* specifier,
|
||||||
int32 form, const char* property);
|
int32 form, const char* property);
|
||||||
virtual status_t GetSupportedSuites(BMessage* data);
|
virtual status_t GetSupportedSuites(BMessage* data);
|
||||||
|
|
||||||
virtual void ResizeToPreferred();
|
virtual void ResizeToPreferred();
|
||||||
virtual void GetPreferredSize(float* width, float* height);
|
virtual void GetPreferredSize(float* width, float* height);
|
||||||
|
|
||||||
virtual BSize MinSize();
|
virtual BSize MinSize();
|
||||||
virtual BSize MaxSize();
|
virtual BSize MaxSize();
|
||||||
@@ -87,8 +89,8 @@ public:
|
|||||||
virtual status_t Perform(perform_code d, void* arg);
|
virtual status_t Perform(perform_code d, void* arg);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual status_t AllArchived(BMessage* into) const;
|
virtual status_t AllArchived(BMessage* into) const;
|
||||||
virtual status_t AllUnarchived(const BMessage* from);
|
virtual status_t AllUnarchived(const BMessage* from);
|
||||||
|
|
||||||
virtual void LayoutInvalidated(bool descendants);
|
virtual void LayoutInvalidated(bool descendants);
|
||||||
virtual void DoLayout();
|
virtual void DoLayout();
|
||||||
|
|||||||
@@ -135,9 +135,9 @@ static float kVMargin = 2.0f;
|
|||||||
|
|
||||||
|
|
||||||
BMenuField::BMenuField(BRect frame, const char* name, const char* label,
|
BMenuField::BMenuField(BRect frame, const char* name, const char* label,
|
||||||
BMenu* menu, uint32 resize, uint32 flags)
|
BMenu* menu, uint32 resizingMode, uint32 flags)
|
||||||
:
|
:
|
||||||
BView(frame, name, resize, flags)
|
BView(frame, name, resizingMode, flags)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
@@ -153,9 +153,9 @@ BMenuField::BMenuField(BRect frame, const char* name, const char* label,
|
|||||||
|
|
||||||
|
|
||||||
BMenuField::BMenuField(BRect frame, const char* name, const char* label,
|
BMenuField::BMenuField(BRect frame, const char* name, const char* label,
|
||||||
BMenu* menu, bool fixedSize, uint32 resize, uint32 flags)
|
BMenu* menu, bool fixedSize, uint32 resizingMode, uint32 flags)
|
||||||
:
|
:
|
||||||
BView(frame, name, resize, flags)
|
BView(frame, name, resizingMode, flags)
|
||||||
{
|
{
|
||||||
InitObject(label);
|
InitObject(label);
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ BMenuField::BMenuField(BRect frame, const char* name, const char* label,
|
|||||||
|
|
||||||
|
|
||||||
BMenuField::BMenuField(const char* name, const char* label, BMenu* menu,
|
BMenuField::BMenuField(const char* name, const char* label, BMenu* menu,
|
||||||
uint32 flags)
|
uint32 flags)
|
||||||
:
|
:
|
||||||
BView(name, flags | B_FRAME_EVENTS)
|
BView(name, flags | B_FRAME_EVENTS)
|
||||||
{
|
{
|
||||||
@@ -637,7 +637,7 @@ BMenuField::SetDivider(float divider)
|
|||||||
|
|
||||||
fDivider = divider;
|
fDivider = divider;
|
||||||
|
|
||||||
if (Flags() & B_SUPPORTS_LAYOUT) {
|
if ((Flags() & B_SUPPORTS_LAYOUT) != 0) {
|
||||||
// We should never get here, since layout support means, we also
|
// We should never get here, since layout support means, we also
|
||||||
// layout the divider, and don't use this method at all.
|
// layout the divider, and don't use this method at all.
|
||||||
Relayout();
|
Relayout();
|
||||||
@@ -882,7 +882,7 @@ void
|
|||||||
BMenuField::DoLayout()
|
BMenuField::DoLayout()
|
||||||
{
|
{
|
||||||
// Bail out, if we shan't do layout.
|
// Bail out, if we shan't do layout.
|
||||||
if (!(Flags() & B_SUPPORTS_LAYOUT))
|
if ((Flags() & B_SUPPORTS_LAYOUT) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CALLED();
|
CALLED();
|
||||||
@@ -1137,7 +1137,6 @@ BMenuField::_InitMenuBar(BMenu* menu, BRect frame, bool fixedSize)
|
|||||||
|
|
||||||
AddChild(fMenuBar);
|
AddChild(fMenuBar);
|
||||||
fMenuBar->AddItem(menu);
|
fMenuBar->AddItem(menu);
|
||||||
|
|
||||||
fMenuBar->SetFont(be_plain_font);
|
fMenuBar->SetFont(be_plain_font);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user