Yesterday's commit triggered some other visual bugs: hopefully fixed them all. A disabled menufield now doesn't open its associated menu anymore.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15906 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2006-01-11 09:31:27 +00:00
parent 0838a93037
commit f9f970d98c
3 changed files with 103 additions and 68 deletions
+5 -4
View File
@@ -6,8 +6,6 @@
* Marc Flerackers ([email protected])
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -36,7 +34,7 @@ BMenuField::BMenuField(BRect frame, const char *name, const char *label,
false, this);
AddChild(fMenuBar);
fMenuBar->AddItem(menu);
fMenuBar->AddItem(new _BMCItem_(menu));
fMenuBar->SetFont(be_plain_font);
@@ -223,7 +221,7 @@ BMenuField::AllAttached()
void
BMenuField::MouseDown(BPoint where)
{
if (where.x > fDivider && !fMenuBar->Frame().Contains(where))
if (!IsEnabled() || (where.x > fDivider && !fMenuBar->Frame().Contains(where)))
return;
BRect bounds = fMenuBar->ConvertFromParent(Bounds());
@@ -245,6 +243,9 @@ BMenuField::KeyDown(const char *bytes, int32 numBytes)
case B_RIGHT_ARROW:
case B_DOWN_ARROW:
{
if (!IsEnabled())
break;
BRect bounds = fMenuBar->ConvertFromParent(Bounds());
fMenuBar->StartMenuBar(0, true, true, &bounds);