Check if alt is the command key on BMenu::AttachedToWindow instead of doing it for every BMenuItem::Draw()

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16847 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2006-03-20 20:20:29 +00:00
parent b1e7bed203
commit 65b4fb8ab1
3 changed files with 13 additions and 14 deletions
+10 -1
View File
@@ -39,7 +39,7 @@ public:
menu_info BMenu::sMenuInfo;
bool BMenu::sAltAsCommandKey;
static property_info
sPropList[] = {
@@ -256,6 +256,15 @@ BMenu::AttachedToWindow()
{
BView::AttachedToWindow();
sAltAsCommandKey = true;
key_map *keys = NULL;
char *chars = NULL;
get_key_map(&keys, &chars);
if (keys == NULL || keys->left_command_key != 0x5d || keys->right_command_key != 0x5f)
sAltAsCommandKey = false;
free(chars);
free(keys);
if (AddDynamicItem(B_INITIAL_ADD)) {
do {
if (!OkToProceed(NULL)) {