Fix for shortcut drawing in the test environment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16531 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,41 +1,25 @@
|
|||||||
//------------------------------------------------------------------------------
|
/*
|
||||||
// Copyright (c) 2001-2005, Haiku
|
* Copyright 2001-2006, Haiku, Inc.
|
||||||
//
|
* Distributed under the terms of the MIT License.
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
*
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
* Authors:
|
||||||
// to deal in the Software without restriction, including without limitation
|
* Marc Flerackers ([email protected])
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
* Bill Hayden ([email protected])
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
* Stefano Ceccherini ([email protected])
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
* Olivier Milla
|
||||||
//
|
*/
|
||||||
// The above copyright notice and this permission notice shall be included in
|
|
||||||
// all copies or substantial portions of the Software.
|
|
||||||
//
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
// DEALINGS IN THE SOFTWARE.
|
|
||||||
//
|
|
||||||
// File Name: MenuItem.cpp
|
|
||||||
// Authors Marc Flerackers ([email protected])
|
|
||||||
// Bill Hayden ([email protected])
|
|
||||||
// Stefano Ceccherini ([email protected])
|
|
||||||
// Olivier Milla
|
|
||||||
// Description: Display item for BMenu class
|
|
||||||
//
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#include <string.h>
|
//! Display item for BMenu class
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
const uint32 kCtrlLength = 20*11;
|
const uint32 kCtrlLength = 20*11;
|
||||||
const unsigned char kCtrlBits [] = {
|
const unsigned char kCtrlBits [] = {
|
||||||
0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x14,0xff,0xff,0xff,
|
0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x14,0xff,0xff,0xff,
|
||||||
@@ -726,12 +710,15 @@ BMenuItem::DrawShortcutSymbol()
|
|||||||
get_key_map(&keys, &chars);
|
get_key_map(&keys, &chars);
|
||||||
BRect rect(0,0,16,10);
|
BRect rect(0,0,16,10);
|
||||||
BBitmap control(rect, B_COLOR_8_BIT);
|
BBitmap control(rect, B_COLOR_8_BIT);
|
||||||
if ((keys->left_command_key == 0x5d) && (keys->right_command_key == 0x5f))
|
|
||||||
|
// TODO: isn't there a better way to do this?
|
||||||
|
if (keys != NULL
|
||||||
|
&& keys->left_command_key == 0x5d && keys->right_command_key == 0x5f)
|
||||||
control.SetBits(kAltBits, kAltLength, 0, B_COLOR_8_BIT);
|
control.SetBits(kAltBits, kAltLength, 0, B_COLOR_8_BIT);
|
||||||
else
|
else
|
||||||
control.SetBits(kCtrlBits, kCtrlLength, 0, B_COLOR_8_BIT);
|
control.SetBits(kCtrlBits, kCtrlLength, 0, B_COLOR_8_BIT);
|
||||||
fSuper->DrawBitmap(&control, where);
|
fSuper->DrawBitmap(&control, where);
|
||||||
|
|
||||||
where.x -= rect.Width();
|
where.x -= rect.Width();
|
||||||
|
|
||||||
free(chars);
|
free(chars);
|
||||||
|
|||||||
Reference in New Issue
Block a user