Files
haiku-beta6/src/kits/interface/MenuItem.cpp
T

677 lines
13 KiB
C++
Raw Normal View History

2003-07-10 00:07:56 +00:00
//------------------------------------------------------------------------------
// Copyright (c) 2001-2002, OpenBeOS
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// 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
2003-07-10 00:07:56 +00:00
// Author: Marc Flerackers ([email protected])
// Bill Hayden ([email protected])
// Description: Display item for BMenu class
//
//------------------------------------------------------------------------------
2003-05-14 17:21:46 +00:00
#include <string.h>
#include <stdlib.h>
#include <Bitmap.h>
2003-05-14 17:21:46 +00:00
#include <MenuItem.h>
#include <String.h>
#include <Window.h>
BMenuItem::BMenuItem(const char *label, BMessage *message, char shortcut,
uint32 modifiers)
{
2003-06-16 08:05:30 +00:00
InitData();
if (label != NULL)
fLabel = strdup(label);
2003-06-16 08:05:30 +00:00
SetMessage(message);
fShortcutChar = shortcut;
if (shortcut != 0)
fModifiers = modifiers | B_COMMAND_KEY;
else
fModifiers = 0;
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
2003-05-14 17:21:46 +00:00
BMenuItem::BMenuItem(BMenu *menu, BMessage *message)
2003-06-16 08:05:30 +00:00
{
InitData();
SetMessage(message);
InitMenuData(menu);
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
2003-05-14 17:21:46 +00:00
BMenuItem::BMenuItem(BMessage *data)
{
2003-06-16 08:05:30 +00:00
InitData();
2004-12-30 10:02:39 +00:00
if (data->HasString("_label")) {
2003-06-16 08:05:30 +00:00
const char *string;
data->FindString("_label", &string);
SetLabel(string);
}
bool disable;
if (data->FindBool("_disable", &disable) == B_OK)
SetEnabled(!disable);
bool marked;
if (data->FindBool("_marked", &marked) == B_OK)
SetMarked(marked);
2004-12-30 10:02:39 +00:00
if (data->HasInt32("_user_trig")) {
2003-06-16 08:05:30 +00:00
int32 user_trig;
data->FindInt32("_user_trig", &user_trig);
SetTrigger(user_trig);
}
2004-12-30 10:02:39 +00:00
if (data->HasInt32("_shortcut")) {
2003-06-16 08:05:30 +00:00
int32 shortcut, mods;
data->FindInt32("_shortcut", &shortcut);
data->FindInt32("_mods", &mods);
SetShortcut(shortcut, mods);
}
2004-12-30 10:02:39 +00:00
if (data->HasMessage("_msg")) {
2003-06-16 08:05:30 +00:00
BMessage *msg = new BMessage;
data->FindMessage("_msg", msg);
SetMessage(msg);
}
BMessage subMessage;
2004-12-30 10:02:39 +00:00
if (data->FindMessage("_submenu", &subMessage) == B_OK) {
2003-06-16 08:05:30 +00:00
BArchivable *object = instantiate_object(&subMessage);
if (object != NULL) {
BMenu *menu = dynamic_cast<BMenu *>(object);
2003-06-16 08:05:30 +00:00
if (menu != NULL)
2003-06-16 08:05:30 +00:00
InitMenuData(menu);
}
}
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
BArchivable *
BMenuItem::Instantiate(BMessage *data)
2003-05-14 17:21:46 +00:00
{
if (validate_instantiation(data, "BMenuItem"))
return new BMenuItem(data);
2003-06-16 08:05:30 +00:00
else
return NULL;
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
status_t
BMenuItem::Archive(BMessage *data, bool deep) const
2003-05-14 17:21:46 +00:00
{
2003-06-16 08:05:30 +00:00
if (fLabel)
2003-05-14 17:21:46 +00:00
data->AddString("_label", Label());
if (!IsEnabled())
data->AddBool("_disable", true);
if (IsMarked())
data->AddBool("_marked", true);
if (fUserTrigger)
data->AddInt32("_user_trig", fUserTrigger);
2004-12-30 10:02:39 +00:00
if (fShortcutChar) {
2003-05-14 17:21:46 +00:00
data->AddInt32("_shortcut", fShortcutChar);
data->AddInt32("_mods", fModifiers);
}
if (Message())
data->AddMessage("_msg", Message());
2004-12-30 10:02:39 +00:00
if (deep && fSubmenu) {
2003-05-14 17:21:46 +00:00
BMessage submenu;
2003-06-16 08:05:30 +00:00
if (fSubmenu->Archive(&submenu, true) == B_OK)
data->AddMessage("_submenu", &submenu);
2003-05-14 17:21:46 +00:00
}
return B_OK;
}
2004-12-30 10:02:39 +00:00
2003-05-14 17:21:46 +00:00
BMenuItem::~BMenuItem()
{
2004-12-30 10:02:39 +00:00
free(fLabel);
delete fSubmenu;
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::SetLabel(const char *string)
2003-05-14 17:21:46 +00:00
{
if (fLabel != NULL) {
2003-05-14 17:21:46 +00:00
free(fLabel);
2004-12-30 10:02:39 +00:00
fLabel = NULL;
}
if (string != NULL)
2003-06-16 08:05:30 +00:00
fLabel = strdup(string);
if (fSuper != NULL) {
2003-06-16 08:05:30 +00:00
fSuper->InvalidateLayout();
2003-05-14 17:21:46 +00:00
2004-12-30 10:02:39 +00:00
if (fSuper->LockLooper()) {
2003-06-16 08:05:30 +00:00
fSuper->Invalidate();
fSuper->UnlockLooper();
}
}
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::SetEnabled(bool state)
2003-05-14 17:21:46 +00:00
{
if (fSubmenu != NULL)
2003-06-16 08:05:30 +00:00
fSubmenu->SetEnabled(state);
2003-05-14 17:21:46 +00:00
fEnabled = state;
2003-06-16 08:05:30 +00:00
BMenu *menu = Menu();
if (menu != NULL && menu->LockLooper()) {
2003-06-16 08:05:30 +00:00
menu->Invalidate(fBounds);
menu->UnlockLooper();
}
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::SetMarked(bool state)
2003-05-14 17:21:46 +00:00
{
fMark = state;
if (state && Menu() != NULL)
2003-05-14 17:21:46 +00:00
Menu()->ItemMarked(this);
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::SetTrigger(char ch)
2003-05-14 17:21:46 +00:00
{
fUserTrigger = ch;
2003-06-16 08:05:30 +00:00
if (strchr(fLabel, ch) != 0)
fSysTrigger = ch;
else
fSysTrigger = -1;
if (fSuper != NULL)
2003-06-16 08:05:30 +00:00
fSuper->InvalidateLayout();
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::SetShortcut(char ch, uint32 modifiers)
2003-05-14 17:21:46 +00:00
{
2003-06-16 08:05:30 +00:00
if (fShortcutChar != 0 && (fModifiers & B_COMMAND_KEY) && fWindow)
fWindow->RemoveShortcut(fShortcutChar, fModifiers);
2003-05-14 17:21:46 +00:00
fShortcutChar = ch;
2003-06-16 08:05:30 +00:00
if (ch != 0)
fModifiers = modifiers | B_COMMAND_KEY;
else
fModifiers = 0;
if (fShortcutChar != 0 && (fModifiers & B_COMMAND_KEY) && fWindow)
fWindow->AddShortcut(fShortcutChar, fModifiers, this);
2004-12-30 10:02:39 +00:00
if (fSuper) {
2003-06-16 08:05:30 +00:00
fSuper->InvalidateLayout();
2004-12-30 10:02:39 +00:00
if (fSuper->LockLooper()) {
2003-06-16 08:05:30 +00:00
fSuper->Invalidate();
fSuper->UnlockLooper();
}
}
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
const char *
BMenuItem::Label() const
2003-05-14 17:21:46 +00:00
{
return fLabel;
}
2004-12-30 10:02:39 +00:00
bool
BMenuItem::IsEnabled() const
2003-05-14 17:21:46 +00:00
{
2003-06-16 08:05:30 +00:00
if (fSubmenu)
return fSubmenu->IsEnabled();
if (!fEnabled)
return false;
return fSuper ? fSuper->IsEnabled() : true;
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
bool
BMenuItem::IsMarked() const
2003-05-14 17:21:46 +00:00
{
return fMark;
}
2004-12-30 10:02:39 +00:00
char
BMenuItem::Trigger() const
2003-05-14 17:21:46 +00:00
{
2003-06-16 08:05:30 +00:00
return fUserTrigger;
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
char
BMenuItem::Shortcut(uint32 *modifiers) const
2003-05-14 17:21:46 +00:00
{
if (modifiers)
*modifiers = fModifiers;
return fShortcutChar;
}
2004-12-30 10:02:39 +00:00
BMenu *
BMenuItem::Submenu() const
2003-05-14 17:21:46 +00:00
{
return fSubmenu;
}
2004-12-30 10:02:39 +00:00
BMenu *
BMenuItem::Menu() const
2003-05-14 17:21:46 +00:00
{
return fSuper;
}
2004-12-30 10:02:39 +00:00
BRect
BMenuItem::Frame() const
2003-05-14 17:21:46 +00:00
{
return fBounds;
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::GetContentSize(float *width, float *height)
2003-05-14 17:21:46 +00:00
{
2003-06-16 08:05:30 +00:00
fSuper->CacheFontInfo();
2003-05-14 17:21:46 +00:00
2003-06-16 08:05:30 +00:00
fCachedWidth = fSuper->StringWidth(fLabel);
2004-12-30 10:02:39 +00:00
if (width)
*width = (float)ceil(fCachedWidth);
if (height)
*height = fSuper->fFontHeight;
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::TruncateLabel(float maxWidth, char *newLabel)
2003-05-14 17:21:46 +00:00
{
2004-02-27 22:48:32 +00:00
// ToDo: implement me!
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::DrawContent()
2003-05-14 17:21:46 +00:00
{
2003-06-16 08:05:30 +00:00
fSuper->MovePenBy(0, fSuper->fAscent);
BPoint lineStart = fSuper->PenLocation();
2003-05-14 17:21:46 +00:00
fSuper->DrawString(fLabel);
2004-02-27 22:48:32 +00:00
// ToDo: label truncation is missing
if (fSuper->AreTriggersEnabled() && fTriggerIndex != -1) {
float escapements[128]; // TODO: this doesn't look nice
BFont font;
fSuper->GetFont(&font);
font.GetEscapements(fLabel, fTriggerIndex + 1, escapements);
for (int32 i = 0; i < fTriggerIndex; i++)
lineStart.x += escapements[i] * font.Size();
lineStart.x--;
lineStart.y++;
BPoint lineEnd(lineStart);
lineEnd.x += escapements[fTriggerIndex] * font.Size();
fSuper->StrokeLine(lineStart, lineEnd);
}
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::Draw()
2003-05-14 17:21:46 +00:00
{
// TODO: Cleanup
2003-06-16 08:05:30 +00:00
bool enabled = IsEnabled();
fSuper->CacheFontInfo();
if (IsSelected() && (enabled || Submenu()) /*&& fSuper->fRedrawAfterSticky*/) {
2003-05-14 17:21:46 +00:00
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DARKEN_2_TINT));
fSuper->SetLowColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DARKEN_2_TINT));
2003-06-16 08:05:30 +00:00
fSuper->FillRect(Frame());
2003-05-14 17:21:46 +00:00
}
if (IsEnabled())
fSuper->SetHighColor(ui_color(B_MENU_ITEM_TEXT_COLOR));
2003-06-16 08:05:30 +00:00
else if (IsSelected())
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_LIGHTEN_1_TINT));
2003-05-14 17:21:46 +00:00
else
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DISABLED_LABEL_TINT));
2003-06-16 08:05:30 +00:00
fSuper->MovePenTo(ContentLocation());
DrawContent();
2004-12-30 10:02:39 +00:00
if (fSuper->Layout() == B_ITEMS_IN_COLUMN) {
2003-05-14 17:21:46 +00:00
if (IsMarked())
DrawMarkSymbol();
2003-06-16 08:05:30 +00:00
if (fShortcutChar)
DrawShortcutSymbol();
2003-05-14 17:21:46 +00:00
if (Submenu())
DrawSubmenuSymbol();
}
fSuper->SetLowColor(ui_color(B_MENU_BACKGROUND_COLOR));
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::Highlight(bool flag)
2003-05-14 17:21:46 +00:00
{
2003-06-16 08:05:30 +00:00
Menu()->Draw(Frame());
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
bool
BMenuItem::IsSelected() const
2003-05-14 17:21:46 +00:00
{
return fSelected;
}
2004-12-30 10:02:39 +00:00
BPoint
BMenuItem::ContentLocation() const
2003-06-16 08:05:30 +00:00
{
2003-05-14 17:21:46 +00:00
return BPoint(fBounds.left + Menu()->fPad.left,
fBounds.top + Menu()->fPad.top);
}
2004-12-30 10:02:39 +00:00
2003-05-14 17:21:46 +00:00
void BMenuItem::_ReservedMenuItem1() {}
void BMenuItem::_ReservedMenuItem2() {}
void BMenuItem::_ReservedMenuItem3() {}
void BMenuItem::_ReservedMenuItem4() {}
2004-12-30 10:02:39 +00:00
2003-05-14 17:21:46 +00:00
BMenuItem::BMenuItem(const BMenuItem &)
{
}
2004-12-30 10:02:39 +00:00
BMenuItem &
BMenuItem::operator=(const BMenuItem &)
2003-05-14 17:21:46 +00:00
{
return *this;
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::InitData()
2003-05-14 17:21:46 +00:00
{
2003-06-16 08:05:30 +00:00
fLabel = NULL;
fSubmenu = NULL;
2003-06-16 08:05:30 +00:00
fWindow = NULL;
fSuper = NULL;
fModifiers = 0;
fCachedWidth = 0;
fTriggerIndex = -1;
fUserTrigger = 0;
fSysTrigger = 0;
fShortcutChar = 0;
fMark = false;
fEnabled = true;
fSelected = false;
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::InitMenuData(BMenu *menu)
2003-05-14 17:21:46 +00:00
{
2003-06-16 08:05:30 +00:00
fSubmenu = menu;
fSubmenu->fSuperitem = this;
BMenuItem *item = menu->FindMarked();
2003-06-16 08:05:30 +00:00
if (menu->IsRadioMode() && menu->IsLabelFromMarked() && item != NULL)
2003-06-16 08:05:30 +00:00
SetLabel(item->Label());
else
SetLabel(menu->Name());
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::Install(BWindow *window)
2003-05-14 17:21:46 +00:00
{
2003-06-16 08:05:30 +00:00
if (fSubmenu)
fSubmenu->Install(window);
2003-05-14 17:21:46 +00:00
2003-06-16 08:05:30 +00:00
fWindow = window;
2003-05-14 17:21:46 +00:00
2003-06-16 08:05:30 +00:00
if (fShortcutChar != 0 && (fModifiers & B_COMMAND_KEY) && fWindow)
window->AddShortcut(fShortcutChar, fModifiers, this);
if (!Messenger().IsValid())
2003-05-14 17:21:46 +00:00
SetTarget(window);
}
2004-12-30 10:02:39 +00:00
status_t
BMenuItem::Invoke(BMessage *message)
2003-05-14 17:21:46 +00:00
{
2003-06-16 08:05:30 +00:00
if (!IsEnabled())
return B_ERROR;
2003-05-14 17:21:46 +00:00
2003-06-16 08:05:30 +00:00
if (fSuper->IsRadioMode())
SetMarked(true);
2003-05-14 17:21:46 +00:00
2003-06-16 08:05:30 +00:00
bool notify = false;
uint32 kind = InvokeKind(&notify);
2003-05-14 17:21:46 +00:00
2003-06-16 08:05:30 +00:00
BMessage clone(kind);
status_t err = B_BAD_VALUE;
if (!message && !notify)
message = Message();
2004-12-30 10:02:39 +00:00
if (!message) {
2003-06-16 08:05:30 +00:00
if (!fSuper->IsWatched())
return err;
2004-12-30 10:02:39 +00:00
} else
2003-06-16 08:05:30 +00:00
clone = *message;
clone.AddInt32("index", Menu()->IndexOf(this));
clone.AddInt64("when", (int64)system_time());
clone.AddPointer("source", this);
clone.AddMessenger("be:sender", BMessenger(fSuper));
if (message)
err = BInvoker::Invoke(&clone);
// TODO: assynchronous messaging
// SendNotices(kind, &clone);
return err;
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::Uninstall()
2003-05-14 17:21:46 +00:00
{
if (fSubmenu != NULL)
2003-06-16 08:05:30 +00:00
fSubmenu->Uninstall();
if (Target() == fWindow)
SetTarget(BMessenger());
// TODO: I'm not sure about B_COMMAND_KEY
if (fShortcutChar != 0 && (fModifiers & B_COMMAND_KEY) && fWindow != NULL)
2003-06-16 08:05:30 +00:00
fWindow->RemoveShortcut(fShortcutChar, fModifiers);
fWindow = NULL;
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::SetSuper(BMenu *super)
2003-05-14 17:21:46 +00:00
{
if (fSuper != NULL && super != NULL)
2003-06-16 08:05:30 +00:00
debugger("Error - can't add menu or menu item to more than 1 container (either menu or menubar).");
2003-05-14 17:21:46 +00:00
fSuper = super;
2003-06-16 08:05:30 +00:00
if (fSubmenu != NULL)
2003-06-16 08:05:30 +00:00
fSubmenu->fSuper = super;
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::Select(bool on)
2003-05-14 17:21:46 +00:00
{
2004-12-30 10:02:39 +00:00
if (Submenu()) {
2003-06-16 08:05:30 +00:00
fSelected = on;
Highlight(on);
2004-12-30 10:02:39 +00:00
} else if (IsEnabled()) {
2003-06-16 08:05:30 +00:00
fSelected = on;
Highlight(on);
}
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::DrawMarkSymbol()
2003-05-14 17:21:46 +00:00
{
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DARKEN_1_TINT));
fSuper->StrokeLine(BPoint(fBounds.left + 6.0f, fBounds.bottom - 3.0f),
BPoint(fBounds.left + 10.0f, fBounds.bottom - 12.0f));
fSuper->StrokeLine(BPoint(fBounds.left + 7.0f, fBounds.bottom - 3.0f),
BPoint(fBounds.left + 11.0f, fBounds.bottom - 12.0f));
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DARKEN_4_TINT));
fSuper->StrokeLine(BPoint(fBounds.left + 6.0f, fBounds.bottom - 4.0f),
BPoint(fBounds.left + 10.0f, fBounds.bottom - 13.0f));
fSuper->StrokeLine(BPoint(fBounds.left + 5.0f, fBounds.bottom - 4.0f),
BPoint(fBounds.left + 9.0f, fBounds.bottom - 13.0f));
fSuper->StrokeLine(BPoint(fBounds.left + 5.0f, fBounds.bottom - 3.0f),
BPoint(fBounds.left + 3.0f, fBounds.bottom - 9.0f));
fSuper->StrokeLine(BPoint(fBounds.left + 4.0f, fBounds.bottom - 4.0f),
BPoint(fBounds.left + 2.0f, fBounds.bottom - 9.0f));
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::DrawShortcutSymbol()
2003-05-14 17:21:46 +00:00
{
BString shortcut("");
if (fModifiers & B_CONTROL_KEY)
shortcut += "ctl+";
shortcut += fShortcutChar;
fSuper->DrawString(shortcut.String(), ContentLocation() +
2003-06-16 08:05:30 +00:00
BPoint(fBounds.Width() - 14.0f - 32.0f, fBounds.Height() - 4.0f));
2003-05-14 17:21:46 +00:00
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::DrawSubmenuSymbol()
2003-05-14 17:21:46 +00:00
{
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_LIGHTEN_MAX_TINT));
fSuper->FillTriangle(BPoint(fBounds.right - 14.0f, fBounds.bottom - 4.0f),
BPoint(fBounds.right - 14.0f, fBounds.bottom - 12.0f),
BPoint(fBounds.right - 5.0f, fBounds.bottom - 8.0f));
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DARKEN_2_TINT));
fSuper->StrokeLine(BPoint(fBounds.right - 14.0f, fBounds.bottom - 5),
BPoint(fBounds.right - 9.0f, fBounds.bottom - 7));
fSuper->StrokeLine(BPoint(fBounds.right - 7.0f, fBounds.bottom - 8),
BPoint(fBounds.right - 7.0f, fBounds.bottom - 8));
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DARKEN_3_TINT));
fSuper->StrokeTriangle(BPoint(fBounds.right - 14.0f, fBounds.bottom - 4.0f),
BPoint(fBounds.right - 14.0f, fBounds.bottom - 12.0f),
BPoint(fBounds.right - 5.0f, fBounds.bottom - 8.0f));
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_LIGHTEN_1_TINT));
fSuper->StrokeTriangle(BPoint(fBounds.right - 12.0f, fBounds.bottom - 7.0f),
BPoint(fBounds.right - 12.0f, fBounds.bottom - 9.0f),
BPoint(fBounds.right - 9.0f, fBounds.bottom - 8.0f));
fSuper->FillTriangle(BPoint(fBounds.right - 12.0f, fBounds.bottom - 7.0f),
BPoint(fBounds.right - 12.0f, fBounds.bottom - 9.0f),
BPoint(fBounds.right - 9.0f, fBounds.bottom - 8.0f));
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::DrawControlChar(const char *control)
2003-05-14 17:21:46 +00:00
{
}
2004-12-30 10:02:39 +00:00
void
BMenuItem::SetSysTrigger(char ch)
2003-05-14 17:21:46 +00:00
{
fSysTrigger = ch;
}