BMenu: Some style fixes related to docs
Mostly just making the variable names match between the header and source. No functional change intended.
This commit is contained in:
@@ -47,9 +47,9 @@ typedef bool (*menu_tracking_hook)(BMenu* menu, void* state);
|
|||||||
|
|
||||||
class BMenu : public BView {
|
class BMenu : public BView {
|
||||||
public:
|
public:
|
||||||
BMenu(const char* title,
|
BMenu(const char* name,
|
||||||
menu_layout layout = B_ITEMS_IN_COLUMN);
|
menu_layout layout = B_ITEMS_IN_COLUMN);
|
||||||
BMenu(const char* title, float width,
|
BMenu(const char* name, float width,
|
||||||
float height);
|
float height);
|
||||||
BMenu(BMessage* archive);
|
BMenu(BMessage* archive);
|
||||||
|
|
||||||
@@ -109,12 +109,12 @@ public:
|
|||||||
|
|
||||||
virtual status_t SetTargetForItems(BHandler* target);
|
virtual status_t SetTargetForItems(BHandler* target);
|
||||||
virtual status_t SetTargetForItems(BMessenger messenger);
|
virtual status_t SetTargetForItems(BMessenger messenger);
|
||||||
virtual void SetEnabled(bool state);
|
virtual void SetEnabled(bool enable);
|
||||||
virtual void SetRadioMode(bool state);
|
virtual void SetRadioMode(bool on);
|
||||||
virtual void SetTriggersEnabled(bool state);
|
virtual void SetTriggersEnabled(bool enable);
|
||||||
virtual void SetMaxContentWidth(float maxWidth);
|
virtual void SetMaxContentWidth(float maxWidth);
|
||||||
|
|
||||||
void SetLabelFromMarked(bool state);
|
void SetLabelFromMarked(bool on);
|
||||||
bool IsLabelFromMarked();
|
bool IsLabelFromMarked();
|
||||||
bool IsEnabled() const;
|
bool IsEnabled() const;
|
||||||
bool IsRadioMode() const;
|
bool IsRadioMode() const;
|
||||||
@@ -165,7 +165,7 @@ public:
|
|||||||
B_ABORT
|
B_ABORT
|
||||||
};
|
};
|
||||||
virtual bool AddDynamicItem(add_state state);
|
virtual bool AddDynamicItem(add_state state);
|
||||||
virtual void DrawBackground(BRect update);
|
virtual void DrawBackground(BRect updateRect);
|
||||||
|
|
||||||
void SetTrackingHook(menu_tracking_hook hook,
|
void SetTrackingHook(menu_tracking_hook hook,
|
||||||
void* state);
|
void* state);
|
||||||
|
|||||||
+30
-30
@@ -439,13 +439,13 @@ BMenu::Draw(BRect updateRect)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BMenu::MessageReceived(BMessage* msg)
|
BMenu::MessageReceived(BMessage* message)
|
||||||
{
|
{
|
||||||
switch (msg->what) {
|
switch (message->what) {
|
||||||
case B_MOUSE_WHEEL_CHANGED:
|
case B_MOUSE_WHEEL_CHANGED:
|
||||||
{
|
{
|
||||||
float deltaY = 0;
|
float deltaY = 0;
|
||||||
msg->FindFloat("be:wheel_delta_y", &deltaY);
|
message->FindFloat("be:wheel_delta_y", &deltaY);
|
||||||
if (deltaY == 0)
|
if (deltaY == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -468,7 +468,7 @@ BMenu::MessageReceived(BMessage* msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BView::MessageReceived(msg);
|
BView::MessageReceived(message);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1017,34 +1017,34 @@ BMenu::SetTargetForItems(BMessenger messenger)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BMenu::SetEnabled(bool enabled)
|
BMenu::SetEnabled(bool enable)
|
||||||
{
|
{
|
||||||
if (fEnabled == enabled)
|
if (fEnabled == enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fEnabled = enabled;
|
fEnabled = enable;
|
||||||
|
|
||||||
if (dynamic_cast<_BMCMenuBar_*>(Supermenu()) != NULL)
|
if (dynamic_cast<_BMCMenuBar_*>(Supermenu()) != NULL)
|
||||||
Supermenu()->SetEnabled(enabled);
|
Supermenu()->SetEnabled(enable);
|
||||||
|
|
||||||
if (fSuperitem)
|
if (fSuperitem)
|
||||||
fSuperitem->SetEnabled(enabled);
|
fSuperitem->SetEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BMenu::SetRadioMode(bool flag)
|
BMenu::SetRadioMode(bool on)
|
||||||
{
|
{
|
||||||
fRadioMode = flag;
|
fRadioMode = on;
|
||||||
if (!flag)
|
if (!on)
|
||||||
SetLabelFromMarked(false);
|
SetLabelFromMarked(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BMenu::SetTriggersEnabled(bool flag)
|
BMenu::SetTriggersEnabled(bool enable)
|
||||||
{
|
{
|
||||||
fTriggerEnabled = flag;
|
fTriggerEnabled = enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1056,10 +1056,10 @@ BMenu::SetMaxContentWidth(float width)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BMenu::SetLabelFromMarked(bool flag)
|
BMenu::SetLabelFromMarked(bool on)
|
||||||
{
|
{
|
||||||
fDynamicName = flag;
|
fDynamicName = on;
|
||||||
if (flag)
|
if (on)
|
||||||
SetRadioMode(true);
|
SetRadioMode(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1319,17 +1319,17 @@ BMenu::SetItemMargins(float left, float top, float right, float bottom)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BMenu::GetItemMargins(float* left, float* top, float* right,
|
BMenu::GetItemMargins(float* _left, float* _top, float* _right,
|
||||||
float* bottom) const
|
float* _bottom) const
|
||||||
{
|
{
|
||||||
if (left != NULL)
|
if (_left != NULL)
|
||||||
*left = fPad.left;
|
*_left = fPad.left;
|
||||||
if (top != NULL)
|
if (_top != NULL)
|
||||||
*top = fPad.top;
|
*_top = fPad.top;
|
||||||
if (right != NULL)
|
if (_right != NULL)
|
||||||
*right = fPad.right;
|
*_right = fPad.right;
|
||||||
if (bottom != NULL)
|
if (_bottom != NULL)
|
||||||
*bottom = fPad.bottom;
|
*_bottom = fPad.bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1398,7 +1398,7 @@ BMenu::AddDynamicItem(add_state state)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BMenu::DrawBackground(BRect update)
|
BMenu::DrawBackground(BRect updateRect)
|
||||||
{
|
{
|
||||||
if (be_control_look != NULL) {
|
if (be_control_look != NULL) {
|
||||||
rgb_color base = sMenuInfo.background_color;
|
rgb_color base = sMenuInfo.background_color;
|
||||||
@@ -1419,7 +1419,7 @@ BMenu::DrawBackground(BRect update)
|
|||||||
borders |= BControlLook::B_TOP_BORDER
|
borders |= BControlLook::B_TOP_BORDER
|
||||||
| BControlLook::B_BOTTOM_BORDER;
|
| BControlLook::B_BOTTOM_BORDER;
|
||||||
}
|
}
|
||||||
be_control_look->DrawMenuBackground(this, rect, update, base, 0,
|
be_control_look->DrawMenuBackground(this, rect, updateRect, base, 0,
|
||||||
borders);
|
borders);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -1427,7 +1427,7 @@ BMenu::DrawBackground(BRect update)
|
|||||||
|
|
||||||
rgb_color oldColor = HighColor();
|
rgb_color oldColor = HighColor();
|
||||||
SetHighColor(sMenuInfo.background_color);
|
SetHighColor(sMenuInfo.background_color);
|
||||||
FillRect(Bounds() & update, B_SOLID_HIGH);
|
FillRect(Bounds() & updateRect, B_SOLID_HIGH);
|
||||||
SetHighColor(oldColor);
|
SetHighColor(oldColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user