Minor header-related changes

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3246 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
haydentech
2003-05-14 17:21:46 +00:00
parent e1d7ae79b2
commit 30fd51473f
17 changed files with 1702 additions and 1698 deletions
+3 -3
View File
@@ -171,9 +171,9 @@ virtual void DrawBackground(BRect update);
/*----- Private or reserved -----------------------------------------*/ /*----- Private or reserved -----------------------------------------*/
private: private:
friend BWindow; friend class BWindow;
friend BMenuBar; friend class BMenuBar;
friend BMenuItem; friend class BMenuItem;
friend status_t _init_interface_kit_(); friend status_t _init_interface_kit_();
friend status_t set_menu_info(menu_info *); friend status_t set_menu_info(menu_info *);
friend status_t get_menu_info(menu_info *); friend status_t get_menu_info(menu_info *);
+4 -4
View File
@@ -80,10 +80,10 @@ virtual void AllDetached();
virtual status_t Perform(perform_code d, void *arg); virtual status_t Perform(perform_code d, void *arg);
private: private:
friend BWindow; friend class BWindow;
friend BMenuItem; friend class BMenuItem;
friend BMenuField; friend class BMenuField;
friend BMenu; friend class BMenu;
virtual void _ReservedMenuBar1(); virtual void _ReservedMenuBar1();
virtual void _ReservedMenuBar2(); virtual void _ReservedMenuBar2();
+3 -3
View File
@@ -65,9 +65,9 @@ virtual void Highlight(bool on);
/*----- Private or reserved -----------------------------------------*/ /*----- Private or reserved -----------------------------------------*/
private: private:
friend BMenu; friend class BMenu;
friend BPopUpMenu; friend class BPopUpMenu;
friend BMenuBar; friend class BMenuBar;
virtual void _ReservedMenuItem1(); virtual void _ReservedMenuItem1();
virtual void _ReservedMenuItem2(); virtual void _ReservedMenuItem2();
+2 -2
View File
@@ -74,9 +74,9 @@ virtual void _ReservedShape2();
virtual void _ReservedShape3(); virtual void _ReservedShape3();
virtual void _ReservedShape4(); virtual void _ReservedShape4();
friend BShapeIterator; friend class BShapeIterator;
friend class TPicture; friend class TPicture;
friend BView; friend class BView;
friend class BFont; friend class BFont;
void GetData(int32 *opCount, int32 *ptCount, uint32 **opList, BPoint **ptList); void GetData(int32 *opCount, int32 *ptCount, uint32 **opList, BPoint **ptList);
void SetData(int32 opCount, int32 ptCount, uint32 *opList, BPoint *ptList); void SetData(int32 opCount, int32 ptCount, uint32 *opList, BPoint *ptList);
+2 -2
View File
@@ -1,5 +1,5 @@
// //
// $Id: Autolock.h,v 1.1 2002/07/09 12:24:33 ejakowatz Exp $ // $Id: Autolock.h,v 1.2 2003/05/14 17:21:46 haydentech Exp $
// //
// This is the BAutolock interface for OpenBeOS. It has been created to // This is the BAutolock interface for OpenBeOS. It has been created to
// be source and binary compatible with the BeOS version of BAutolock. // be source and binary compatible with the BeOS version of BAutolock.
@@ -11,7 +11,7 @@
#define _OPENBEOS_AUTOLOCK_H #define _OPENBEOS_AUTOLOCK_H
#include "Locker.h" #include <Locker.h>
#include <Looper.h> #include <Looper.h>
+1 -1
View File
@@ -15,7 +15,7 @@
#include <SupportDefs.h> #include <SupportDefs.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <malloc.h> #include <stdlib.h>
#include <OS.h> #include <OS.h>
/*------------------------------*/ /*------------------------------*/
+1 -1
View File
@@ -2,7 +2,7 @@
#define _BLUE_STOP_WATCH_H #define _BLUE_STOP_WATCH_H
#include <BeBuild.h> #include <BeBuild.h>
#include "support/SupportDefs.h" #include <SupportDefs.h>
#ifdef USE_OPENBEOS_NAMESPACE #ifdef USE_OPENBEOS_NAMESPACE
namespace OpenBeOS { namespace OpenBeOS {
+1 -1
View File
@@ -40,7 +40,7 @@ typedef unsigned short ushort;
// System Includes ------------------------------------------------------------- // System Includes -------------------------------------------------------------
#include <BeBuild.h> #include <BeBuild.h>
#include <sys/types.h> #include <sys/types.h>
#include <support/Errors.h> #include <Errors.h>
// Project Includes ------------------------------------------------------------ // Project Includes ------------------------------------------------------------
+4 -4
View File
@@ -1,14 +1,14 @@
// //
// $Id: MessageQueue.cpp,v 1.2 2002/09/28 09:49:34 shatty Exp $ // $Id: MessageQueue.cpp,v 1.3 2003/05/14 17:21:46 haydentech Exp $
// //
// This file contains the implementation of the BMessageQueue class // This file contains the implementation of the BMessageQueue class
// for the OpenBeOS project. // for the OpenBeOS project.
// //
#include "MessageQueue.h" #include <MessageQueue.h>
#include "Autolock.h" #include <Autolock.h>
#include "Message.h" #include <Message.h>
#ifdef USE_OPENBEOS_NAMESPACE #ifdef USE_OPENBEOS_NAMESPACE
namespace OpenBeOS { namespace OpenBeOS {
+3 -3
View File
@@ -28,9 +28,9 @@
#include <stdio.h> #include <stdio.h>
// System Includes ------------------------------------------------------------- // System Includes -------------------------------------------------------------
#include "ColorControl.h" #include <ColorControl.h>
#include "TextControl.h" #include <TextControl.h>
#include <Support/Errors.h> #include <Errors.h>
// Project Includes ------------------------------------------------------------ // Project Includes ------------------------------------------------------------
+1 -1
View File
@@ -26,7 +26,7 @@
// Standard Includes ----------------------------------------------------------- // Standard Includes -----------------------------------------------------------
#include <string.h> #include <string.h>
#include <malloc.h> #include <stdlib.h>
// System Includes ------------------------------------------------------------- // System Includes -------------------------------------------------------------
#include <Control.h> #include <Control.h>
+481 -481
View File
@@ -1,481 +1,481 @@
// Standard Includes ----------------------------------------------------------- // Standard Includes -----------------------------------------------------------
#include <string.h> #include <string.h>
#include <malloc.h> #include <stdlib.h>
// System Includes ------------------------------------------------------------- // System Includes -------------------------------------------------------------
#include <MenuItem.h> #include <MenuItem.h>
#include <String.h> #include <String.h>
#include <Message.h> #include <Message.h>
#include <Window.h> #include <Window.h>
// Project Includes ------------------------------------------------------------ // Project Includes ------------------------------------------------------------
// Local Includes -------------------------------------------------------------- // Local Includes --------------------------------------------------------------
// Local Defines --------------------------------------------------------------- // Local Defines ---------------------------------------------------------------
// Globals --------------------------------------------------------------------- // Globals ---------------------------------------------------------------------
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BMenuItem::BMenuItem(const char *label, BMessage *message, char shortcut, BMenuItem::BMenuItem(const char *label, BMessage *message, char shortcut,
uint32 modifiers) uint32 modifiers)
: BInvoker(message, NULL), : BInvoker(message, NULL),
fSubmenu(NULL), fSubmenu(NULL),
fWindow(NULL), fWindow(NULL),
fSuper(NULL), fSuper(NULL),
fModifiers(modifiers), fModifiers(modifiers),
fCachedWidth(0.0f), fCachedWidth(0.0f),
fTriggerIndex(0), fTriggerIndex(0),
fUserTrigger(0), fUserTrigger(0),
fSysTrigger(0), fSysTrigger(0),
fShortcutChar(shortcut), fShortcutChar(shortcut),
fMark(false), fMark(false),
fEnabled(true), fEnabled(true),
fSelected(false) fSelected(false)
{ {
fLabel = strdup(label); fLabel = strdup(label);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BMenuItem::BMenuItem(BMenu *menu, BMessage *message) BMenuItem::BMenuItem(BMenu *menu, BMessage *message)
: BInvoker(message, NULL), : BInvoker(message, NULL),
fSubmenu(menu), fSubmenu(menu),
fWindow(NULL), fWindow(NULL),
fSuper(NULL), fSuper(NULL),
fModifiers(0), fModifiers(0),
fCachedWidth(0.0f), fCachedWidth(0.0f),
fTriggerIndex(0), fTriggerIndex(0),
fUserTrigger(0), fUserTrigger(0),
fSysTrigger(0), fSysTrigger(0),
fShortcutChar(0), fShortcutChar(0),
fMark(false), fMark(false),
fEnabled(true), fEnabled(true),
fSelected(false) fSelected(false)
{ {
fLabel = strdup(menu->Name()); fLabel = strdup(menu->Name());
fSubmenu->fSuperitem = this; fSubmenu->fSuperitem = this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BMenuItem::BMenuItem(BMessage *data) BMenuItem::BMenuItem(BMessage *data)
{ {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BArchivable *BMenuItem::Instantiate(BMessage *data) BArchivable *BMenuItem::Instantiate(BMessage *data)
{ {
if (validate_instantiation(data, "BMenuItem")) if (validate_instantiation(data, "BMenuItem"))
return new BMenuItem(data); return new BMenuItem(data);
return NULL; return NULL;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
status_t BMenuItem::Archive(BMessage *data, bool deep) const status_t BMenuItem::Archive(BMessage *data, bool deep) const
{ {
if (Label()) if (Label())
data->AddString("_label", Label()); data->AddString("_label", Label());
if (!IsEnabled()) if (!IsEnabled())
data->AddBool("_disable", true); data->AddBool("_disable", true);
if (IsMarked()) if (IsMarked())
data->AddBool("_marked", true); data->AddBool("_marked", true);
if (fUserTrigger) if (fUserTrigger)
data->AddInt32("_user_trig", fUserTrigger); data->AddInt32("_user_trig", fUserTrigger);
if (fShortcutChar && fModifiers) if (fShortcutChar && fModifiers)
{ {
data->AddInt32("_shortcut", fShortcutChar); data->AddInt32("_shortcut", fShortcutChar);
data->AddInt32("_mods", fModifiers); data->AddInt32("_mods", fModifiers);
} }
if (Message()) if (Message())
data->AddMessage("_msg", Message()); data->AddMessage("_msg", Message());
if (deep && Submenu()) if (deep && Submenu())
{ {
BMessage submenu; BMessage submenu;
Submenu()->Archive(&submenu); Submenu()->Archive(&submenu);
data->AddMessage("_submenu", &submenu); data->AddMessage("_submenu", &submenu);
} }
return B_OK; return B_OK;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BMenuItem::~BMenuItem() BMenuItem::~BMenuItem()
{ {
if (fLabel) if (fLabel)
free(fLabel); free(fLabel);
if (fSubmenu) if (fSubmenu)
delete fSubmenu; delete fSubmenu;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::SetLabel(const char *string) void BMenuItem::SetLabel(const char *string)
{ {
if (fLabel) if (fLabel)
free(fLabel); free(fLabel);
fLabel = strdup(string); fLabel = strdup(string);
Menu()->InvalidateLayout(); Menu()->InvalidateLayout();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::SetEnabled(bool state) void BMenuItem::SetEnabled(bool state)
{ {
if (Menu()->IsEnabled() == false) if (Menu()->IsEnabled() == false)
return; return;
fEnabled = state; fEnabled = state;
if (Submenu()) if (Submenu())
Submenu()->SetEnabled(state); Submenu()->SetEnabled(state);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::SetMarked(bool state) void BMenuItem::SetMarked(bool state)
{ {
fMark = state; fMark = state;
if (state && Menu()) if (state && Menu())
Menu()->ItemMarked(this); Menu()->ItemMarked(this);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::SetTrigger(char ch) void BMenuItem::SetTrigger(char ch)
{ {
fUserTrigger = ch; fUserTrigger = ch;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::SetShortcut(char ch, uint32 modifiers) void BMenuItem::SetShortcut(char ch, uint32 modifiers)
{ {
fShortcutChar = ch; fShortcutChar = ch;
fModifiers = modifiers; fModifiers = modifiers;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
const char *BMenuItem::Label() const const char *BMenuItem::Label() const
{ {
return fLabel; return fLabel;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool BMenuItem::IsEnabled() const bool BMenuItem::IsEnabled() const
{ {
return fEnabled; return fEnabled;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool BMenuItem::IsMarked() const bool BMenuItem::IsMarked() const
{ {
return fMark; return fMark;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
char BMenuItem::Trigger() const char BMenuItem::Trigger() const
{ {
if (fUserTrigger) if (fUserTrigger)
return fUserTrigger; return fUserTrigger;
else else
return fSysTrigger; return fSysTrigger;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
char BMenuItem::Shortcut(uint32 *modifiers) const char BMenuItem::Shortcut(uint32 *modifiers) const
{ {
if (modifiers) if (modifiers)
*modifiers = fModifiers; *modifiers = fModifiers;
return fShortcutChar; return fShortcutChar;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BMenu *BMenuItem::Submenu() const BMenu *BMenuItem::Submenu() const
{ {
return fSubmenu; return fSubmenu;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BMenu *BMenuItem::Menu() const BMenu *BMenuItem::Menu() const
{ {
return fSuper; return fSuper;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BRect BMenuItem::Frame() const BRect BMenuItem::Frame() const
{ {
return fBounds; return fBounds;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::GetContentSize(float *width, float *height) void BMenuItem::GetContentSize(float *width, float *height)
{ {
BMenu *menu = Menu(); BMenu *menu = Menu();
if (menu->fFontHeight == -1) if (menu->fFontHeight == -1)
menu->CacheFontInfo(); menu->CacheFontInfo();
*width = (float)ceil(menu->StringWidth(fLabel)); *width = (float)ceil(menu->StringWidth(fLabel));
*height = menu->fFontHeight; *height = menu->fFontHeight;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::TruncateLabel(float maxWidth, char *newLabel) void BMenuItem::TruncateLabel(float maxWidth, char *newLabel)
{ {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::DrawContent() void BMenuItem::DrawContent()
{ {
fSuper->DrawString(fLabel); fSuper->DrawString(fLabel);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::Draw() void BMenuItem::Draw()
{ {
if (IsEnabled() && fSelected) if (IsEnabled() && fSelected)
{ {
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DARKEN_2_TINT)); B_DARKEN_2_TINT));
fSuper->SetLowColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), fSuper->SetLowColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DARKEN_2_TINT)); B_DARKEN_2_TINT));
fSuper->FillRect(Frame()); fSuper->FillRect(Frame());
} }
BPoint pt = ContentLocation(); BPoint pt = ContentLocation();
fSuper->MovePenTo(pt.x, pt.y + Menu()->fAscent); fSuper->MovePenTo(pt.x, pt.y + Menu()->fAscent);
if (IsEnabled()) if (IsEnabled())
fSuper->SetHighColor(ui_color(B_MENU_ITEM_TEXT_COLOR)); fSuper->SetHighColor(ui_color(B_MENU_ITEM_TEXT_COLOR));
else else
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DISABLED_LABEL_TINT)); B_DISABLED_LABEL_TINT));
DrawContent(); DrawContent();
if (Menu()->Layout() == B_ITEMS_IN_COLUMN) if (Menu()->Layout() == B_ITEMS_IN_COLUMN)
{ {
if (IsMarked()) if (IsMarked())
DrawMarkSymbol(); DrawMarkSymbol();
if (Submenu()) if (Submenu())
DrawSubmenuSymbol(); DrawSubmenuSymbol();
else if (fShortcutChar) else if (fShortcutChar)
DrawShortcutSymbol(); DrawShortcutSymbol();
} }
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::Highlight(bool flag) void BMenuItem::Highlight(bool flag)
{ {
//Menu()->InvertRect(Frame()); //Menu()->InvertRect(Frame());
Menu()->Invalidate(Frame()); Menu()->Invalidate(Frame());
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool BMenuItem::IsSelected() const bool BMenuItem::IsSelected() const
{ {
return fSelected; return fSelected;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BPoint BMenuItem::ContentLocation () const BPoint BMenuItem::ContentLocation () const
{ {
if (!Menu()) if (!Menu())
return BPoint(); return BPoint();
return BPoint(fBounds.left + Menu()->fPad.left, return BPoint(fBounds.left + Menu()->fPad.left,
fBounds.top + Menu()->fPad.top); fBounds.top + Menu()->fPad.top);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::_ReservedMenuItem1() {} void BMenuItem::_ReservedMenuItem1() {}
void BMenuItem::_ReservedMenuItem2() {} void BMenuItem::_ReservedMenuItem2() {}
void BMenuItem::_ReservedMenuItem3() {} void BMenuItem::_ReservedMenuItem3() {}
void BMenuItem::_ReservedMenuItem4() {} void BMenuItem::_ReservedMenuItem4() {}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BMenuItem::BMenuItem(const BMenuItem &) BMenuItem::BMenuItem(const BMenuItem &)
{ {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BMenuItem &BMenuItem::operator=(const BMenuItem &) BMenuItem &BMenuItem::operator=(const BMenuItem &)
{ {
return *this; return *this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::InitData() void BMenuItem::InitData()
{ {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::InitMenuData(BMenu *menu) void BMenuItem::InitMenuData(BMenu *menu)
{ {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::Install(BWindow *window) void BMenuItem::Install(BWindow *window)
{ {
if (Submenu()) if (Submenu())
Submenu()->Install(window); Submenu()->Install(window);
char shortcut; char shortcut;
uint32 modifiers; uint32 modifiers;
if (shortcut = Shortcut(&modifiers)) if (shortcut = Shortcut(&modifiers))
window->AddShortcut(shortcut, modifiers, this); window->AddShortcut(shortcut, modifiers, this);
if (Target() == NULL) if (Target() == NULL)
SetTarget(window); SetTarget(window);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
status_t BMenuItem::Invoke(BMessage *message) status_t BMenuItem::Invoke(BMessage *message)
{ {
if (IsEnabled()) if (IsEnabled())
{ {
BMessage msg; BMessage msg;
if (message) if (message)
msg = *message; msg = *message;
else if (Message()) else if (Message())
msg = *Message(); msg = *Message();
else else
return B_OK; return B_OK;
msg.AddInt64("when", system_time()); // TODO msg.AddInt64("when", system_time()); // TODO
msg.AddPointer("source", this); msg.AddPointer("source", this);
msg.AddInt32("index", Menu()->IndexOf(this)); msg.AddInt32("index", Menu()->IndexOf(this));
return BInvoker::Invoke(&msg); return BInvoker::Invoke(&msg);
} }
else else
return B_OK; return B_OK;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::Uninstall() void BMenuItem::Uninstall()
{ {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::SetSuper(BMenu *super) void BMenuItem::SetSuper(BMenu *super)
{ {
fSuper = super; fSuper = super;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::Select(bool on) void BMenuItem::Select(bool on)
{ {
fSelected = on; fSelected = on;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::DrawMarkSymbol() void BMenuItem::DrawMarkSymbol()
{ {
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DARKEN_1_TINT)); B_DARKEN_1_TINT));
fSuper->StrokeLine(BPoint(fBounds.left + 6.0f, fBounds.bottom - 3.0f), fSuper->StrokeLine(BPoint(fBounds.left + 6.0f, fBounds.bottom - 3.0f),
BPoint(fBounds.left + 10.0f, fBounds.bottom - 12.0f)); BPoint(fBounds.left + 10.0f, fBounds.bottom - 12.0f));
fSuper->StrokeLine(BPoint(fBounds.left + 7.0f, fBounds.bottom - 3.0f), fSuper->StrokeLine(BPoint(fBounds.left + 7.0f, fBounds.bottom - 3.0f),
BPoint(fBounds.left + 11.0f, fBounds.bottom - 12.0f)); BPoint(fBounds.left + 11.0f, fBounds.bottom - 12.0f));
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DARKEN_4_TINT)); B_DARKEN_4_TINT));
fSuper->StrokeLine(BPoint(fBounds.left + 6.0f, fBounds.bottom - 4.0f), fSuper->StrokeLine(BPoint(fBounds.left + 6.0f, fBounds.bottom - 4.0f),
BPoint(fBounds.left + 10.0f, fBounds.bottom - 13.0f)); BPoint(fBounds.left + 10.0f, fBounds.bottom - 13.0f));
fSuper->StrokeLine(BPoint(fBounds.left + 5.0f, fBounds.bottom - 4.0f), fSuper->StrokeLine(BPoint(fBounds.left + 5.0f, fBounds.bottom - 4.0f),
BPoint(fBounds.left + 9.0f, fBounds.bottom - 13.0f)); BPoint(fBounds.left + 9.0f, fBounds.bottom - 13.0f));
fSuper->StrokeLine(BPoint(fBounds.left + 5.0f, fBounds.bottom - 3.0f), fSuper->StrokeLine(BPoint(fBounds.left + 5.0f, fBounds.bottom - 3.0f),
BPoint(fBounds.left + 3.0f, fBounds.bottom - 9.0f)); BPoint(fBounds.left + 3.0f, fBounds.bottom - 9.0f));
fSuper->StrokeLine(BPoint(fBounds.left + 4.0f, fBounds.bottom - 4.0f), fSuper->StrokeLine(BPoint(fBounds.left + 4.0f, fBounds.bottom - 4.0f),
BPoint(fBounds.left + 2.0f, fBounds.bottom - 9.0f)); BPoint(fBounds.left + 2.0f, fBounds.bottom - 9.0f));
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::DrawShortcutSymbol() void BMenuItem::DrawShortcutSymbol()
{ {
BString shortcut(""); BString shortcut("");
if (fModifiers & B_CONTROL_KEY) if (fModifiers & B_CONTROL_KEY)
shortcut += "ctl+"; shortcut += "ctl+";
shortcut += fShortcutChar; shortcut += fShortcutChar;
fSuper->DrawString(shortcut.String(), ContentLocation() + fSuper->DrawString(shortcut.String(), ContentLocation() +
BPoint(fBounds.Width() - 14.0f - 22.0f, fBounds.Height() - 4.0f)); BPoint(fBounds.Width() - 14.0f - 22.0f, fBounds.Height() - 4.0f));
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::DrawSubmenuSymbol() void BMenuItem::DrawSubmenuSymbol()
{ {
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_LIGHTEN_MAX_TINT)); B_LIGHTEN_MAX_TINT));
fSuper->FillTriangle(BPoint(fBounds.right - 14.0f, fBounds.bottom - 4.0f), fSuper->FillTriangle(BPoint(fBounds.right - 14.0f, fBounds.bottom - 4.0f),
BPoint(fBounds.right - 14.0f, fBounds.bottom - 12.0f), BPoint(fBounds.right - 14.0f, fBounds.bottom - 12.0f),
BPoint(fBounds.right - 5.0f, fBounds.bottom - 8.0f)); BPoint(fBounds.right - 5.0f, fBounds.bottom - 8.0f));
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DARKEN_2_TINT)); B_DARKEN_2_TINT));
fSuper->StrokeLine(BPoint(fBounds.right - 14.0f, fBounds.bottom - 5), fSuper->StrokeLine(BPoint(fBounds.right - 14.0f, fBounds.bottom - 5),
BPoint(fBounds.right - 9.0f, fBounds.bottom - 7)); BPoint(fBounds.right - 9.0f, fBounds.bottom - 7));
fSuper->StrokeLine(BPoint(fBounds.right - 7.0f, fBounds.bottom - 8), fSuper->StrokeLine(BPoint(fBounds.right - 7.0f, fBounds.bottom - 8),
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), fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DARKEN_3_TINT)); B_DARKEN_3_TINT));
fSuper->StrokeTriangle(BPoint(fBounds.right - 14.0f, fBounds.bottom - 4.0f), fSuper->StrokeTriangle(BPoint(fBounds.right - 14.0f, fBounds.bottom - 4.0f),
BPoint(fBounds.right - 14.0f, fBounds.bottom - 12.0f), BPoint(fBounds.right - 14.0f, fBounds.bottom - 12.0f),
BPoint(fBounds.right - 5.0f, fBounds.bottom - 8.0f)); BPoint(fBounds.right - 5.0f, fBounds.bottom - 8.0f));
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_LIGHTEN_1_TINT)); B_LIGHTEN_1_TINT));
fSuper->StrokeTriangle(BPoint(fBounds.right - 12.0f, fBounds.bottom - 7.0f), fSuper->StrokeTriangle(BPoint(fBounds.right - 12.0f, fBounds.bottom - 7.0f),
BPoint(fBounds.right - 12.0f, fBounds.bottom - 9.0f), BPoint(fBounds.right - 12.0f, fBounds.bottom - 9.0f),
BPoint(fBounds.right - 9.0f, fBounds.bottom - 8.0f)); BPoint(fBounds.right - 9.0f, fBounds.bottom - 8.0f));
fSuper->FillTriangle(BPoint(fBounds.right - 12.0f, fBounds.bottom - 7.0f), fSuper->FillTriangle(BPoint(fBounds.right - 12.0f, fBounds.bottom - 7.0f),
BPoint(fBounds.right - 12.0f, fBounds.bottom - 9.0f), BPoint(fBounds.right - 12.0f, fBounds.bottom - 9.0f),
BPoint(fBounds.right - 9.0f, fBounds.bottom - 8.0f)); BPoint(fBounds.right - 9.0f, fBounds.bottom - 8.0f));
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::DrawControlChar(const char *control) void BMenuItem::DrawControlChar(const char *control)
{ {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BMenuItem::SetSysTrigger(char ch) void BMenuItem::SetSysTrigger(char ch)
{ {
fSysTrigger = ch; fSysTrigger = ch;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BSeparatorItem::BSeparatorItem() BSeparatorItem::BSeparatorItem()
: BMenuItem(NULL, NULL, 0, 0) : BMenuItem(NULL, NULL, 0, 0)
{ {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BSeparatorItem::BSeparatorItem(BMessage *data) BSeparatorItem::BSeparatorItem(BMessage *data)
: BMenuItem(data) : BMenuItem(data)
{ {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BSeparatorItem::~BSeparatorItem() BSeparatorItem::~BSeparatorItem()
{ {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
status_t BSeparatorItem::Archive(BMessage *data, bool deep) const status_t BSeparatorItem::Archive(BMessage *data, bool deep) const
{ {
return BMenuItem::Archive(data, deep); return BMenuItem::Archive(data, deep);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BArchivable *BSeparatorItem::Instantiate(BMessage *data) BArchivable *BSeparatorItem::Instantiate(BMessage *data)
{ {
if (validate_instantiation(data, "BSeparatorItem")) if (validate_instantiation(data, "BSeparatorItem"))
return new BSeparatorItem(data); return new BSeparatorItem(data);
return NULL; return NULL;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BSeparatorItem::SetEnabled(bool state) void BSeparatorItem::SetEnabled(bool state)
{ {
BSeparatorItem::SetEnabled(state); BSeparatorItem::SetEnabled(state);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BSeparatorItem::GetContentSize(float *width, float *height) void BSeparatorItem::GetContentSize(float *width, float *height)
{ {
*width = 2.0f; *width = 2.0f;
*height = 8.0f; *height = 8.0f;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BSeparatorItem::Draw() void BSeparatorItem::Draw()
{ {
BRect bounds = Frame(); BRect bounds = Frame();
Menu()->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), Menu()->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_DARKEN_2_TINT)); B_DARKEN_2_TINT));
Menu()->StrokeLine(BPoint(bounds.left + 1.0f, bounds.top + 4.0f), Menu()->StrokeLine(BPoint(bounds.left + 1.0f, bounds.top + 4.0f),
BPoint(bounds.right - 1.0f, bounds.top + 4.0f)); BPoint(bounds.right - 1.0f, bounds.top + 4.0f));
Menu()->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), Menu()->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
B_LIGHTEN_2_TINT)); B_LIGHTEN_2_TINT));
Menu()->StrokeLine(BPoint(bounds.left + 1.0f, bounds.top + 5.0f), Menu()->StrokeLine(BPoint(bounds.left + 1.0f, bounds.top + 5.0f),
BPoint(bounds.right - 1.0f, bounds.top + 5.0f)); BPoint(bounds.right - 1.0f, bounds.top + 5.0f));
Menu()->SetHighColor(0, 0, 0); Menu()->SetHighColor(0, 0, 0);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BSeparatorItem::_ReservedSeparatorItem1() {} void BSeparatorItem::_ReservedSeparatorItem1() {}
void BSeparatorItem::_ReservedSeparatorItem2() {} void BSeparatorItem::_ReservedSeparatorItem2() {}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BSeparatorItem &BSeparatorItem::operator=(const BSeparatorItem &) BSeparatorItem &BSeparatorItem::operator=(const BSeparatorItem &)
{ {
return *this; return *this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -172,7 +172,7 @@ BArchivable *BScrollBar::Instantiate(BMessage *data)
return NULL; return NULL;
} }
status_t BScrollBar::Archive(BMessage *data, bool deep = true) const status_t BScrollBar::Archive(BMessage *data, bool deep) const
{ {
return B_ERROR; return B_ERROR;
} }
@@ -481,6 +481,10 @@ void BScrollBar::ResizeToPreferred()
void BScrollBar::GetPreferredSize(float *width, float *height) void BScrollBar::GetPreferredSize(float *width, float *height)
{ {
if (fOrientation == B_VERTICAL)
*width = B_V_SCROLL_BAR_WIDTH;
else if (fOrientation == B_HORIZONTAL)
*height = B_H_SCROLL_BAR_HEIGHT;
} }
void BScrollBar::MakeFocus(bool state) void BScrollBar::MakeFocus(bool state)
+5 -5
View File
@@ -24,11 +24,11 @@
// Description: BShape encapsulates a Postscript-style "path" // Description: BShape encapsulates a Postscript-style "path"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#include "Shape.h" #include <Shape.h>
#include "Point.h" #include <Point.h>
#include "Rect.h" #include <Rect.h>
#include <Support/Errors.h> #include <Errors.h>
#include <App/Message.h> #include <Message.h>
#define OP_LINETO 0x10000000 #define OP_LINETO 0x10000000
#define OP_BEZIERTO 0x20000000 #define OP_BEZIERTO 0x20000000
+1 -1
View File
@@ -25,7 +25,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Standard Includes ----------------------------------------------------------- // Standard Includes -----------------------------------------------------------
#include <malloc.h> #include <stdlib.h>
#include <string.h> #include <string.h>
// System Includes ------------------------------------------------------------- // System Includes -------------------------------------------------------------
File diff suppressed because it is too large Load Diff