Instead of letting the window reroute the messages, I just learned the

target can also simply be set to the preferred handler by using the
BInvoker::SetTarget(NULL, Looper()) form.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13068 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-06-11 17:57:03 +00:00
parent b4ca6a8fc1
commit e53168541f
2 changed files with 3 additions and 11 deletions

View File

@ -1252,9 +1252,12 @@ ProbeView::AttachedToWindow()
fRedoMenuItem->SetTarget(fDataView);
menu->AddSeparatorItem();
menu->AddItem(item = new BMenuItem("Copy", new BMessage(B_COPY), 'C', B_COMMAND_KEY));
item->SetTarget(NULL, Window());
menu->AddItem(fPasteMenuItem = new BMenuItem("Paste", new BMessage(B_PASTE), 'V', B_COMMAND_KEY));
fPasteMenuItem->SetTarget(NULL, Window());
CheckClipboard();
menu->AddItem(item = new BMenuItem("Select All", new BMessage(B_SELECT_ALL), 'A', B_COMMAND_KEY));
item->SetTarget(NULL, Window());
menu->AddSeparatorItem();
menu->AddItem(item = new BMenuItem("Find" B_UTF8_ELLIPSIS, new BMessage(kMsgOpenFindWindow),
'F', B_COMMAND_KEY));

View File

@ -39,17 +39,6 @@ ProbeWindow::MessageReceived(BMessage *message)
break;
}
case B_CUT:
case B_COPY:
case B_PASTE:
case B_SELECT_ALL:
{
BView *view = CurrentFocus();
if (view != NULL)
view->MessageReceived(message);
break;
}
default:
BWindow::MessageReceived(message);
}