implemented B_ITEMS_IN_MATRIX layout correctly. Small cleanups all around.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10571 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2005-01-03 13:33:03 +00:00
parent 9a8540fb4e
commit 4e876d126e
3 changed files with 40 additions and 39 deletions
+1 -10
View File
@@ -32,8 +32,6 @@
#include <MenuItem.h>
#include <Window.h>
#include <stdio.h>
#include <AppMisc.h>
#include <TokenSpace.h>
@@ -404,7 +402,6 @@ BMenuBar::Track(int32 *action, int32 startIndex, bool showMenu)
ulong buttons;
do {
snooze(40000);
printf("BMenuBar: tracking...\n");
GetMouse(&where, &buttons);
BMenuItem *menuItem = HitTestItems(where, B_ORIGIN);
if (menuItem) {
@@ -413,7 +410,6 @@ BMenuBar::Track(int32 *action, int32 startIndex, bool showMenu)
// all BMenuBar's BMenuItems are BMenus.
BMenu *menu = menuItem->Submenu();
if (menu) {
printf("BMenuBar: showing menu %s\n", menu->Name());
do {
snooze(40000);
GetMouse(&where, &buttons);
@@ -424,12 +420,9 @@ BMenuBar::Track(int32 *action, int32 startIndex, bool showMenu)
break;
resultItem = menu->_track((int *)action, startIndex);
printf("BMenuBar: menu %s: action: %ld\n", menu->Name(), *action);
// "action" is "5" when the BMenu is closed.
} while (*action != 5);
printf("BMenuBar: hiding menu %s\n", menu->Name());
}
SelectItem(NULL);
Invalidate();
@@ -439,10 +432,8 @@ BMenuBar::Track(int32 *action, int32 startIndex, bool showMenu)
window->Unlock();
}
if (resultItem != NULL) {
printf("BMenuBar: selected item %s\n", resultItem->Label());
if (resultItem != NULL)
resultItem->Invoke();
}
return resultItem;
}