From 9a9ebda459d7df4925d516f9f638bdddd7140a74 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Tue, 5 Nov 2013 19:19:11 -0500 Subject: [PATCH] BMenu: Some style fixes related to docs Mostly just making the variable names match between the header and source. No functional change intended. --- headers/os/interface/Menu.h | 14 ++++----- src/kits/interface/Menu.cpp | 60 ++++++++++++++++++------------------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/headers/os/interface/Menu.h b/headers/os/interface/Menu.h index bbca5c4d6d..b96a7869e3 100644 --- a/headers/os/interface/Menu.h +++ b/headers/os/interface/Menu.h @@ -47,9 +47,9 @@ typedef bool (*menu_tracking_hook)(BMenu* menu, void* state); class BMenu : public BView { public: - BMenu(const char* title, + BMenu(const char* name, menu_layout layout = B_ITEMS_IN_COLUMN); - BMenu(const char* title, float width, + BMenu(const char* name, float width, float height); BMenu(BMessage* archive); @@ -109,12 +109,12 @@ public: virtual status_t SetTargetForItems(BHandler* target); virtual status_t SetTargetForItems(BMessenger messenger); - virtual void SetEnabled(bool state); - virtual void SetRadioMode(bool state); - virtual void SetTriggersEnabled(bool state); + virtual void SetEnabled(bool enable); + virtual void SetRadioMode(bool on); + virtual void SetTriggersEnabled(bool enable); virtual void SetMaxContentWidth(float maxWidth); - void SetLabelFromMarked(bool state); + void SetLabelFromMarked(bool on); bool IsLabelFromMarked(); bool IsEnabled() const; bool IsRadioMode() const; @@ -165,7 +165,7 @@ public: B_ABORT }; virtual bool AddDynamicItem(add_state state); - virtual void DrawBackground(BRect update); + virtual void DrawBackground(BRect updateRect); void SetTrackingHook(menu_tracking_hook hook, void* state); diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index ac324a3b03..e9a68e2cf2 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -439,13 +439,13 @@ BMenu::Draw(BRect updateRect) void -BMenu::MessageReceived(BMessage* msg) +BMenu::MessageReceived(BMessage* message) { - switch (msg->what) { + switch (message->what) { case B_MOUSE_WHEEL_CHANGED: { float deltaY = 0; - msg->FindFloat("be:wheel_delta_y", &deltaY); + message->FindFloat("be:wheel_delta_y", &deltaY); if (deltaY == 0) return; @@ -468,7 +468,7 @@ BMenu::MessageReceived(BMessage* msg) } default: - BView::MessageReceived(msg); + BView::MessageReceived(message); break; } } @@ -1017,34 +1017,34 @@ BMenu::SetTargetForItems(BMessenger messenger) void -BMenu::SetEnabled(bool enabled) +BMenu::SetEnabled(bool enable) { - if (fEnabled == enabled) + if (fEnabled == enable) return; - fEnabled = enabled; + fEnabled = enable; if (dynamic_cast<_BMCMenuBar_*>(Supermenu()) != NULL) - Supermenu()->SetEnabled(enabled); + Supermenu()->SetEnabled(enable); if (fSuperitem) - fSuperitem->SetEnabled(enabled); + fSuperitem->SetEnabled(enable); } void -BMenu::SetRadioMode(bool flag) +BMenu::SetRadioMode(bool on) { - fRadioMode = flag; - if (!flag) + fRadioMode = on; + if (!on) SetLabelFromMarked(false); } void -BMenu::SetTriggersEnabled(bool flag) +BMenu::SetTriggersEnabled(bool enable) { - fTriggerEnabled = flag; + fTriggerEnabled = enable; } @@ -1056,10 +1056,10 @@ BMenu::SetMaxContentWidth(float width) void -BMenu::SetLabelFromMarked(bool flag) +BMenu::SetLabelFromMarked(bool on) { - fDynamicName = flag; - if (flag) + fDynamicName = on; + if (on) SetRadioMode(true); } @@ -1319,17 +1319,17 @@ BMenu::SetItemMargins(float left, float top, float right, float bottom) void -BMenu::GetItemMargins(float* left, float* top, float* right, - float* bottom) const +BMenu::GetItemMargins(float* _left, float* _top, float* _right, + float* _bottom) const { - if (left != NULL) - *left = fPad.left; - if (top != NULL) - *top = fPad.top; - if (right != NULL) - *right = fPad.right; - if (bottom != NULL) - *bottom = fPad.bottom; + if (_left != NULL) + *_left = fPad.left; + if (_top != NULL) + *_top = fPad.top; + if (_right != NULL) + *_right = fPad.right; + if (_bottom != NULL) + *_bottom = fPad.bottom; } @@ -1398,7 +1398,7 @@ BMenu::AddDynamicItem(add_state state) void -BMenu::DrawBackground(BRect update) +BMenu::DrawBackground(BRect updateRect) { if (be_control_look != NULL) { rgb_color base = sMenuInfo.background_color; @@ -1419,7 +1419,7 @@ BMenu::DrawBackground(BRect update) borders |= BControlLook::B_TOP_BORDER | BControlLook::B_BOTTOM_BORDER; } - be_control_look->DrawMenuBackground(this, rect, update, base, 0, + be_control_look->DrawMenuBackground(this, rect, updateRect, base, 0, borders); return; @@ -1427,7 +1427,7 @@ BMenu::DrawBackground(BRect update) rgb_color oldColor = HighColor(); SetHighColor(sMenuInfo.background_color); - FillRect(Bounds() & update, B_SOLID_HIGH); + FillRect(Bounds() & updateRect, B_SOLID_HIGH); SetHighColor(oldColor); }