applied a patch from barber for bug #661. Thanks! This fixes a weird behavior when using the menu

minor cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18093 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2006-07-10 22:12:40 +00:00
parent 2205ee0914
commit e2d5e00981

View File

@ -182,11 +182,12 @@ MethodReplicant::MouseDown(BPoint point)
where = ConvertToScreen(point);
fMenu.SetTargetForItems(this);
MethodMenuItem *item = (MethodMenuItem*)fMenu.Go(where, true, true, BRect(where - BPoint(4, 4),
where + BPoint(4, 4)));
if (item) {
BMenuItem *item = fMenu.Go(where, true, true,
BRect(where - BPoint(4, 4), where + BPoint(4, 4)));
if (item && dynamic_cast<MethodMenuItem *>(item)) {
BMessage msg(IS_SET_METHOD);
msg.AddInt32("cookie", item->Cookie());
msg.AddInt32("cookie", ((MethodMenuItem*)item)->Cookie());
BMessenger messenger(fSignature);
messenger.SendMessage(&msg);
}