* Style cleanup.
* Use the new cursors. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35890 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
33e11f7c0f
commit
a5b1cf5973
@ -13,34 +13,6 @@
|
||||
#include "SplitLayout.h"
|
||||
|
||||
|
||||
static const unsigned char kHSplitterCursor[] = {
|
||||
16, 1, 8, 8,
|
||||
0x03, 0xc0, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40,
|
||||
0x1a, 0x58, 0x2a, 0x54, 0x4a, 0x52, 0x8a, 0x51,
|
||||
0x8a, 0x51, 0x4a, 0x52, 0x2a, 0x54, 0x1a, 0x58,
|
||||
0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x03, 0xc0,
|
||||
|
||||
0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0,
|
||||
0x1b, 0xd8, 0x3b, 0xdc, 0x7b, 0xde, 0xfb, 0xdf,
|
||||
0xfb, 0xdf, 0x7b, 0xde, 0x3b, 0xdc, 0x1b, 0xd8,
|
||||
0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0
|
||||
};
|
||||
|
||||
static const unsigned char kVSplitterCursor[] = {
|
||||
16, 1, 8, 8,
|
||||
0x01, 0x80, 0x02, 0x40, 0x04, 0x20, 0x08, 0x10,
|
||||
0x0f, 0xf0, 0x00, 0x00, 0xff, 0xff, 0x80, 0x01,
|
||||
0x80, 0x01, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xf0,
|
||||
0x08, 0x10, 0x04, 0x20, 0x02, 0x40, 0x01, 0x80,
|
||||
|
||||
0x01, 0x80, 0x03, 0xc0, 0x07, 0xe0, 0x0f, 0xf0,
|
||||
0x0f, 0xf0, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xf0,
|
||||
0x0f, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01, 0x80
|
||||
};
|
||||
|
||||
|
||||
// constructor
|
||||
BSplitView::BSplitView(enum orientation orientation, float spacing)
|
||||
:
|
||||
BView(NULL,
|
||||
@ -50,19 +22,19 @@ BSplitView::BSplitView(enum orientation orientation, float spacing)
|
||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||
}
|
||||
|
||||
// destructor
|
||||
|
||||
BSplitView::~BSplitView()
|
||||
{
|
||||
}
|
||||
|
||||
// SetInsets
|
||||
|
||||
void
|
||||
BSplitView::SetInsets(float left, float top, float right, float bottom)
|
||||
{
|
||||
fSplitLayout->SetInsets(left, top, right, bottom);
|
||||
}
|
||||
|
||||
// GetInsets
|
||||
|
||||
void
|
||||
BSplitView::GetInsets(float* left, float* top, float* right,
|
||||
float* bottom) const
|
||||
@ -70,112 +42,112 @@ BSplitView::GetInsets(float* left, float* top, float* right,
|
||||
fSplitLayout->GetInsets(left, top, right, bottom);
|
||||
}
|
||||
|
||||
// Spacing
|
||||
|
||||
float
|
||||
BSplitView::Spacing() const
|
||||
{
|
||||
return fSplitLayout->Spacing();
|
||||
}
|
||||
|
||||
// SetSpacing
|
||||
|
||||
void
|
||||
BSplitView::SetSpacing(float spacing)
|
||||
{
|
||||
fSplitLayout->SetSpacing(spacing);
|
||||
}
|
||||
|
||||
// Orientation
|
||||
|
||||
orientation
|
||||
BSplitView::Orientation() const
|
||||
{
|
||||
return fSplitLayout->Orientation();
|
||||
}
|
||||
|
||||
// SetOrientation
|
||||
|
||||
void
|
||||
BSplitView::SetOrientation(enum orientation orientation)
|
||||
{
|
||||
fSplitLayout->SetOrientation(orientation);
|
||||
}
|
||||
|
||||
// SplitterSize
|
||||
|
||||
float
|
||||
BSplitView::SplitterSize() const
|
||||
{
|
||||
return fSplitLayout->SplitterSize();
|
||||
}
|
||||
|
||||
// SetSplitterSize
|
||||
|
||||
void
|
||||
BSplitView::SetSplitterSize(float size)
|
||||
{
|
||||
fSplitLayout->SetSplitterSize(size);
|
||||
}
|
||||
|
||||
// SetCollapsible
|
||||
|
||||
void
|
||||
BSplitView::SetCollapsible(bool collapsible)
|
||||
{
|
||||
fSplitLayout->SetCollapsible(collapsible);
|
||||
}
|
||||
|
||||
// SetCollapsible
|
||||
|
||||
void
|
||||
BSplitView::SetCollapsible(int32 index, bool collapsible)
|
||||
{
|
||||
fSplitLayout->SetCollapsible(index, collapsible);
|
||||
}
|
||||
|
||||
// SetCollapsible
|
||||
|
||||
void
|
||||
BSplitView::SetCollapsible(int32 first, int32 last, bool collapsible)
|
||||
{
|
||||
fSplitLayout->SetCollapsible(first, last, collapsible);
|
||||
}
|
||||
|
||||
// AddChild
|
||||
|
||||
void
|
||||
BSplitView::AddChild(BView* child, BView* sibling)
|
||||
{
|
||||
BView::AddChild(child, sibling);
|
||||
}
|
||||
|
||||
// AddChild
|
||||
|
||||
bool
|
||||
BSplitView::AddChild(BView* child, float weight)
|
||||
{
|
||||
return fSplitLayout->AddView(child, weight);
|
||||
}
|
||||
|
||||
// AddChild
|
||||
|
||||
bool
|
||||
BSplitView::AddChild(int32 index, BView* child, float weight)
|
||||
{
|
||||
return fSplitLayout->AddView(index, child, weight);
|
||||
}
|
||||
|
||||
// AddChild
|
||||
|
||||
bool
|
||||
BSplitView::AddChild(BLayoutItem* child)
|
||||
{
|
||||
return fSplitLayout->AddItem(child);
|
||||
}
|
||||
|
||||
// AddChild
|
||||
|
||||
bool
|
||||
BSplitView::AddChild(BLayoutItem* child, float weight)
|
||||
{
|
||||
return fSplitLayout->AddItem(child, weight);
|
||||
}
|
||||
|
||||
// AddChild
|
||||
|
||||
bool
|
||||
BSplitView::AddChild(int32 index, BLayoutItem* child, float weight)
|
||||
{
|
||||
return fSplitLayout->AddItem(index, child, weight);
|
||||
}
|
||||
|
||||
// Draw
|
||||
|
||||
void
|
||||
BSplitView::Draw(BRect updateRect)
|
||||
{
|
||||
@ -189,7 +161,7 @@ BSplitView::Draw(BRect updateRect)
|
||||
}
|
||||
}
|
||||
|
||||
// MouseDown
|
||||
|
||||
void
|
||||
BSplitView::MouseDown(BPoint where)
|
||||
{
|
||||
@ -200,7 +172,7 @@ BSplitView::MouseDown(BPoint where)
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
// MouseUp
|
||||
|
||||
void
|
||||
BSplitView::MouseUp(BPoint where)
|
||||
{
|
||||
@ -210,19 +182,19 @@ BSplitView::MouseUp(BPoint where)
|
||||
}
|
||||
}
|
||||
|
||||
// MouseMoved
|
||||
|
||||
void
|
||||
BSplitView::MouseMoved(BPoint where, uint32 transit, const BMessage* message)
|
||||
{
|
||||
BCursor cursor(B_CURSOR_SYSTEM_DEFAULT);
|
||||
BCursor cursor(B_CURSOR_ID_SYSTEM_DEFAULT);
|
||||
|
||||
int32 splitterIndex = fSplitLayout->DraggedSplitter();
|
||||
|
||||
if (splitterIndex >= 0 || fSplitLayout->IsAboveSplitter(where)) {
|
||||
if (Orientation() == B_VERTICAL)
|
||||
cursor = BCursor(kVSplitterCursor);
|
||||
cursor = BCursor(B_CURSOR_ID_RESIZE_NORTH_SOUTH);
|
||||
else
|
||||
cursor = BCursor(kHSplitterCursor);
|
||||
cursor = BCursor(B_CURSOR_ID_RESIZE_EAST_WEST);
|
||||
}
|
||||
|
||||
if (splitterIndex >= 0) {
|
||||
@ -236,14 +208,14 @@ BSplitView::MouseMoved(BPoint where, uint32 transit, const BMessage* message)
|
||||
SetViewCursor(&cursor, true);
|
||||
}
|
||||
|
||||
// SetLayout
|
||||
|
||||
void
|
||||
BSplitView::SetLayout(BLayout* layout)
|
||||
{
|
||||
// not allowed
|
||||
}
|
||||
|
||||
// DrawSplitter
|
||||
|
||||
void
|
||||
BSplitView::DrawSplitter(BRect frame, const BRect& updateRect,
|
||||
enum orientation orientation, bool pressed)
|
||||
@ -251,7 +223,7 @@ BSplitView::DrawSplitter(BRect frame, const BRect& updateRect,
|
||||
_DrawDefaultSplitter(this, frame, updateRect, orientation, pressed);
|
||||
}
|
||||
|
||||
// _DrawDefaultSplitter
|
||||
|
||||
void
|
||||
BSplitView::_DrawDefaultSplitter(BView* view, BRect frame,
|
||||
const BRect& updateRect, enum orientation orientation, bool pressed)
|
||||
|
Loading…
x
Reference in New Issue
Block a user