hmm fixed these bits, padded to multiple of 4

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16481 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2006-02-20 20:45:37 +00:00
parent 5a2ad00cab
commit d2350b2881

View File

@ -36,59 +36,66 @@
#include <String.h>
#include <Window.h>
const uint32 kCtrlLength = 20*11;
const unsigned char kCtrlBits [] = {
0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,
0x14,0x3f,0x3f,0x3f,0x1d,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
0x1a,0x1a,0x1a,0x17,0x14,0x3f,0x3f,0x3f,0x1d,0x1a,0x13,0x04,0x04,0x13,0x1a,0x1a,
0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x17,0x14,0x3f,0x3f,0x3f,0x1d,0x1a,0x04,0x1a,
0x1a,0x04,0x1a,0x04,0x04,0x04,0x1a,0x04,0x1a,0x1a,0x1a,0x17,0x14,0x3f,0x3f,0x3f,
0x1d,0x1a,0x04,0x1a,0x1a,0x1a,0x1a,0x1a,0x04,0x1a,0x1a,0x04,0x1a,0x1a,0x1a,0x17,
0x14,0x3f,0x3f,0x3f,0x1d,0x1a,0x04,0x1a,0x1a,0x1a,0x1a,0x1a,0x04,0x1a,0x1a,0x04,
0x1a,0x1a,0x1a,0x17,0x14,0x3f,0x3f,0x3f,0x1d,0x1a,0x04,0x1a,0x1a,0x04,0x1a,0x1a,
0x04,0x1a,0x1a,0x04,0x1a,0x1a,0x1a,0x17,0x14,0x3f,0x3f,0x3f,0x1d,0x1a,0x13,0x04,
0x04,0x13,0x1a,0x1a,0x04,0x1a,0x1a,0x04,0x04,0x04,0x1a,0x17,0x14,0x3f,0x3f,0x3f,
0x1d,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x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1a,0x1a,0x1a,0x17,0x14,0xff,0xff,0xff,
0x1d,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x14,0xff,0xff,0xff,
0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0xff,0xff,0xff
/* 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff*/
};
const uint32 kAltLength = 20*11;
const unsigned char kAltBits [] = {
0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,
0x14,0x3f,0x3f,0x3f,0x1d,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
0x1a,0x1a,0x1a,0x17,0x14,0x3f,0x3f,0x3f,0x1d,0x1a,0x1a,0x13,0x04,0x04,0x13,0x1a,
0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x17,0x14,0x3f,0x3f,0x3f,0x1d,0x1a,0x1a,0x04,
0x1a,0x1a,0x04,0x1a,0x04,0x1a,0x1a,0x04,0x04,0x04,0x1a,0x17,0x14,0x3f,0x3f,0x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0x1d,0x1a,0x1a,0x04,0x1a,0x1a,0x04,0x1a,0x04,0x1a,0x1a,0x1a,0x04,0x1a,0x1a,0x17,0x14,0xff,0xff,0xff,
0x1d,0x1a,0x1a,0x04,0x04,0x04,0x04,0x1a,0x04,0x1a,0x1a,0x1a,0x04,0x1a,0x1a,0x17,0x14,0xff,0xff,0xff,
0x1d,0x1a,0x1a,0x04,0x1a,0x1a,0x04,0x1a,0x04,0x1a,0x1a,0x1a,0x04,0x1a,0x1a,0x17,0x14,0xff,0xff,0xff,
0x1d,0x1a,0x1a,0x04,0x1a,0x1a,0x04,0x1a,0x04,0x04,0x04,0x1a,0x04,0x1a,0x1a,0x17,0x14,0xff,0xff,0xff,
0x1d,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x17,0x14,0xff,0xff,0xff,
0x1d,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x14,0xff,0xff,0xff,
0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0xff,0xff,0xff
/* 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff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d,0x1b,0x0d,0x1b,0x0d,0x1b,0x1b,0x1b,0x1b,0x0d,0x1b,0x1b,0x19,0x17,0xff,0xff,
0x1d,0x1b,0x1b,0x17,0x0d,0x0d,0x17,0x1b,0x0d,0x1b,0x0d,0x1b,0x0d,0x1b,0x1b,0x1b,0x1b,0x0d,0x1b,0x1b,0x19,0x17,0xff,0xff,
0x1d,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x19,0x17,0xff,0xff,
0x1d,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x17,0xff,0xff,
0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,0xff,0xff
/*0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff*/
};
@ -708,11 +715,11 @@ BMenuItem::DrawShortcutSymbol()
BRect rect(0,0,16,10);
BBitmap control(rect, B_COLOR_8_BIT);
if ((keys->left_command_key == 0x5d) && (keys->right_command_key == 0x5f))
control.SetBits(kAltBits, (rect.Width() + 1) * (rect.Height() + 1), 0, B_COLOR_8_BIT);
control.SetBits(kAltBits, kAltLength, 0, B_COLOR_8_BIT);
else
control.SetBits(kCtrlBits, (rect.Width() + 1) * (rect.Height() + 1), 0, B_COLOR_8_BIT);
fSuper->DrawBitmap(&control, ContentLocation() +
BPoint(fBounds.Width() - 14.0f - 52.0f, fBounds.Height() - 4.0f - rect.Height()));
control.SetBits(kCtrlBits, kCtrlLength, 0, B_COLOR_8_BIT);
fSuper->DrawBitmap(&control, rect, rect.OffsetByCopy(ContentLocation() +
BPoint(fBounds.Width() - 14.0f - 52.0f, fBounds.Height() - 4.0f - rect.Height())));
free(chars);
free(keys);
@ -720,9 +727,9 @@ BMenuItem::DrawShortcutSymbol()
if (fModifiers & B_SHIFT_KEY) {
BRect rect(0,0,21,10);
BBitmap shift(rect, B_COLOR_8_BIT);
shift.SetBits(kShiftBits, (rect.Width() + 1) * (rect.Height() + 1), 0, B_COLOR_8_BIT);
fSuper->DrawBitmap(&shift, ContentLocation() +
BPoint(fBounds.Width() - 14.0f - 74.0f, fBounds.Height() - 4.0f - rect.Height()));
shift.SetBits(kShiftBits, kShiftLength, 0, B_COLOR_8_BIT);
fSuper->DrawBitmap(&shift, rect, rect.OffsetByCopy(ContentLocation() +
BPoint(fBounds.Width() - 14.0f - 74.0f, fBounds.Height() - 4.0f - rect.Height())));
}
// TODO: If the shortcut is one of B_DOWN_ARROW, B_UP_ARROW, B_ENTER, etc.