BMenuItem: Style fixes related to documentation.

This commit is contained in:
John Scipione 2014-02-28 19:04:49 -05:00
parent 41c51f73d1
commit fa412b5fd9
2 changed files with 18 additions and 17 deletions

View File

@ -29,8 +29,8 @@ public:
bool deep = true) const;
virtual void SetLabel(const char* name);
virtual void SetEnabled(bool enabled);
virtual void SetMarked(bool marked);
virtual void SetEnabled(bool enable);
virtual void SetMarked(bool mark);
virtual void SetTrigger(char trigger);
virtual void SetShortcut(char shortcut, uint32 modifiers);
@ -49,7 +49,7 @@ protected:
virtual void TruncateLabel(float maxWidth, char* newLabel);
virtual void DrawContent();
virtual void Draw();
virtual void Highlight(bool enabled);
virtual void Highlight(bool highlight);
bool IsSelected() const;
BPoint ContentLocation() const;

View File

@ -10,7 +10,6 @@
* John Scipione, jscipione@gmail.com
*/
//! Display item for BMenu class
#include <ctype.h>
#include <stdlib.h>
@ -186,7 +185,7 @@ BMenuItem::~BMenuItem()
void
BMenuItem::SetLabel(const char *string)
BMenuItem::SetLabel(const char* string)
{
if (fLabel != NULL) {
free(fLabel);
@ -208,15 +207,15 @@ BMenuItem::SetLabel(const char *string)
void
BMenuItem::SetEnabled(bool state)
BMenuItem::SetEnabled(bool enable)
{
if (fEnabled == state)
if (fEnabled == enable)
return;
fEnabled = state;
fEnabled = enable;
if (fSubmenu != NULL)
fSubmenu->SetEnabled(state);
fSubmenu->SetEnabled(enable);
BMenu* menu = fSuper;
if (menu != NULL && menu->LockLooper()) {
@ -227,11 +226,11 @@ BMenuItem::SetEnabled(bool state)
void
BMenuItem::SetMarked(bool state)
BMenuItem::SetMarked(bool mark)
{
fMark = state;
fMark = mark;
if (state && fSuper != NULL) {
if (mark && fSuper != NULL) {
MenuPrivate priv(fSuper);
priv.ItemMarked(this);
}
@ -267,14 +266,16 @@ BMenuItem::SetTrigger(char trigger)
void
BMenuItem::SetShortcut(char ch, uint32 modifiers)
BMenuItem::SetShortcut(char shortcut, uint32 modifiers)
{
if (fShortcutChar != 0 && (fModifiers & B_COMMAND_KEY) && fWindow)
if (fShortcutChar != 0 && (fModifiers & B_COMMAND_KEY) != 0
&& fWindow != NULL) {
fWindow->RemoveShortcut(fShortcutChar, fModifiers);
}
fShortcutChar = ch;
fShortcutChar = shortcut;
if (ch != 0)
if (shortcut != 0)
fModifiers = modifiers | B_COMMAND_KEY;
else
fModifiers = 0;
@ -498,7 +499,7 @@ BMenuItem::Draw()
void
BMenuItem::Highlight(bool flag)
BMenuItem::Highlight(bool highlight)
{
fSuper->Invalidate(Frame());
}