* 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:
@@ -13,34 +13,6 @@
|
|||||||
#include "SplitLayout.h"
|
#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)
|
BSplitView::BSplitView(enum orientation orientation, float spacing)
|
||||||
:
|
:
|
||||||
BView(NULL,
|
BView(NULL,
|
||||||
@@ -50,19 +22,19 @@ BSplitView::BSplitView(enum orientation orientation, float spacing)
|
|||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
}
|
}
|
||||||
|
|
||||||
// destructor
|
|
||||||
BSplitView::~BSplitView()
|
BSplitView::~BSplitView()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetInsets
|
|
||||||
void
|
void
|
||||||
BSplitView::SetInsets(float left, float top, float right, float bottom)
|
BSplitView::SetInsets(float left, float top, float right, float bottom)
|
||||||
{
|
{
|
||||||
fSplitLayout->SetInsets(left, top, right, bottom);
|
fSplitLayout->SetInsets(left, top, right, bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetInsets
|
|
||||||
void
|
void
|
||||||
BSplitView::GetInsets(float* left, float* top, float* right,
|
BSplitView::GetInsets(float* left, float* top, float* right,
|
||||||
float* bottom) const
|
float* bottom) const
|
||||||
@@ -70,112 +42,112 @@ BSplitView::GetInsets(float* left, float* top, float* right,
|
|||||||
fSplitLayout->GetInsets(left, top, right, bottom);
|
fSplitLayout->GetInsets(left, top, right, bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spacing
|
|
||||||
float
|
float
|
||||||
BSplitView::Spacing() const
|
BSplitView::Spacing() const
|
||||||
{
|
{
|
||||||
return fSplitLayout->Spacing();
|
return fSplitLayout->Spacing();
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetSpacing
|
|
||||||
void
|
void
|
||||||
BSplitView::SetSpacing(float spacing)
|
BSplitView::SetSpacing(float spacing)
|
||||||
{
|
{
|
||||||
fSplitLayout->SetSpacing(spacing);
|
fSplitLayout->SetSpacing(spacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Orientation
|
|
||||||
orientation
|
orientation
|
||||||
BSplitView::Orientation() const
|
BSplitView::Orientation() const
|
||||||
{
|
{
|
||||||
return fSplitLayout->Orientation();
|
return fSplitLayout->Orientation();
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetOrientation
|
|
||||||
void
|
void
|
||||||
BSplitView::SetOrientation(enum orientation orientation)
|
BSplitView::SetOrientation(enum orientation orientation)
|
||||||
{
|
{
|
||||||
fSplitLayout->SetOrientation(orientation);
|
fSplitLayout->SetOrientation(orientation);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SplitterSize
|
|
||||||
float
|
float
|
||||||
BSplitView::SplitterSize() const
|
BSplitView::SplitterSize() const
|
||||||
{
|
{
|
||||||
return fSplitLayout->SplitterSize();
|
return fSplitLayout->SplitterSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetSplitterSize
|
|
||||||
void
|
void
|
||||||
BSplitView::SetSplitterSize(float size)
|
BSplitView::SetSplitterSize(float size)
|
||||||
{
|
{
|
||||||
fSplitLayout->SetSplitterSize(size);
|
fSplitLayout->SetSplitterSize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetCollapsible
|
|
||||||
void
|
void
|
||||||
BSplitView::SetCollapsible(bool collapsible)
|
BSplitView::SetCollapsible(bool collapsible)
|
||||||
{
|
{
|
||||||
fSplitLayout->SetCollapsible(collapsible);
|
fSplitLayout->SetCollapsible(collapsible);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetCollapsible
|
|
||||||
void
|
void
|
||||||
BSplitView::SetCollapsible(int32 index, bool collapsible)
|
BSplitView::SetCollapsible(int32 index, bool collapsible)
|
||||||
{
|
{
|
||||||
fSplitLayout->SetCollapsible(index, collapsible);
|
fSplitLayout->SetCollapsible(index, collapsible);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetCollapsible
|
|
||||||
void
|
void
|
||||||
BSplitView::SetCollapsible(int32 first, int32 last, bool collapsible)
|
BSplitView::SetCollapsible(int32 first, int32 last, bool collapsible)
|
||||||
{
|
{
|
||||||
fSplitLayout->SetCollapsible(first, last, collapsible);
|
fSplitLayout->SetCollapsible(first, last, collapsible);
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddChild
|
|
||||||
void
|
void
|
||||||
BSplitView::AddChild(BView* child, BView* sibling)
|
BSplitView::AddChild(BView* child, BView* sibling)
|
||||||
{
|
{
|
||||||
BView::AddChild(child, sibling);
|
BView::AddChild(child, sibling);
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddChild
|
|
||||||
bool
|
bool
|
||||||
BSplitView::AddChild(BView* child, float weight)
|
BSplitView::AddChild(BView* child, float weight)
|
||||||
{
|
{
|
||||||
return fSplitLayout->AddView(child, weight);
|
return fSplitLayout->AddView(child, weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddChild
|
|
||||||
bool
|
bool
|
||||||
BSplitView::AddChild(int32 index, BView* child, float weight)
|
BSplitView::AddChild(int32 index, BView* child, float weight)
|
||||||
{
|
{
|
||||||
return fSplitLayout->AddView(index, child, weight);
|
return fSplitLayout->AddView(index, child, weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddChild
|
|
||||||
bool
|
bool
|
||||||
BSplitView::AddChild(BLayoutItem* child)
|
BSplitView::AddChild(BLayoutItem* child)
|
||||||
{
|
{
|
||||||
return fSplitLayout->AddItem(child);
|
return fSplitLayout->AddItem(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddChild
|
|
||||||
bool
|
bool
|
||||||
BSplitView::AddChild(BLayoutItem* child, float weight)
|
BSplitView::AddChild(BLayoutItem* child, float weight)
|
||||||
{
|
{
|
||||||
return fSplitLayout->AddItem(child, weight);
|
return fSplitLayout->AddItem(child, weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddChild
|
|
||||||
bool
|
bool
|
||||||
BSplitView::AddChild(int32 index, BLayoutItem* child, float weight)
|
BSplitView::AddChild(int32 index, BLayoutItem* child, float weight)
|
||||||
{
|
{
|
||||||
return fSplitLayout->AddItem(index, child, weight);
|
return fSplitLayout->AddItem(index, child, weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw
|
|
||||||
void
|
void
|
||||||
BSplitView::Draw(BRect updateRect)
|
BSplitView::Draw(BRect updateRect)
|
||||||
{
|
{
|
||||||
@@ -189,7 +161,7 @@ BSplitView::Draw(BRect updateRect)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MouseDown
|
|
||||||
void
|
void
|
||||||
BSplitView::MouseDown(BPoint where)
|
BSplitView::MouseDown(BPoint where)
|
||||||
{
|
{
|
||||||
@@ -200,7 +172,7 @@ BSplitView::MouseDown(BPoint where)
|
|||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// MouseUp
|
|
||||||
void
|
void
|
||||||
BSplitView::MouseUp(BPoint where)
|
BSplitView::MouseUp(BPoint where)
|
||||||
{
|
{
|
||||||
@@ -210,19 +182,19 @@ BSplitView::MouseUp(BPoint where)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MouseMoved
|
|
||||||
void
|
void
|
||||||
BSplitView::MouseMoved(BPoint where, uint32 transit, const BMessage* message)
|
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();
|
int32 splitterIndex = fSplitLayout->DraggedSplitter();
|
||||||
|
|
||||||
if (splitterIndex >= 0 || fSplitLayout->IsAboveSplitter(where)) {
|
if (splitterIndex >= 0 || fSplitLayout->IsAboveSplitter(where)) {
|
||||||
if (Orientation() == B_VERTICAL)
|
if (Orientation() == B_VERTICAL)
|
||||||
cursor = BCursor(kVSplitterCursor);
|
cursor = BCursor(B_CURSOR_ID_RESIZE_NORTH_SOUTH);
|
||||||
else
|
else
|
||||||
cursor = BCursor(kHSplitterCursor);
|
cursor = BCursor(B_CURSOR_ID_RESIZE_EAST_WEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (splitterIndex >= 0) {
|
if (splitterIndex >= 0) {
|
||||||
@@ -236,14 +208,14 @@ BSplitView::MouseMoved(BPoint where, uint32 transit, const BMessage* message)
|
|||||||
SetViewCursor(&cursor, true);
|
SetViewCursor(&cursor, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetLayout
|
|
||||||
void
|
void
|
||||||
BSplitView::SetLayout(BLayout* layout)
|
BSplitView::SetLayout(BLayout* layout)
|
||||||
{
|
{
|
||||||
// not allowed
|
// not allowed
|
||||||
}
|
}
|
||||||
|
|
||||||
// DrawSplitter
|
|
||||||
void
|
void
|
||||||
BSplitView::DrawSplitter(BRect frame, const BRect& updateRect,
|
BSplitView::DrawSplitter(BRect frame, const BRect& updateRect,
|
||||||
enum orientation orientation, bool pressed)
|
enum orientation orientation, bool pressed)
|
||||||
@@ -251,7 +223,7 @@ BSplitView::DrawSplitter(BRect frame, const BRect& updateRect,
|
|||||||
_DrawDefaultSplitter(this, frame, updateRect, orientation, pressed);
|
_DrawDefaultSplitter(this, frame, updateRect, orientation, pressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
// _DrawDefaultSplitter
|
|
||||||
void
|
void
|
||||||
BSplitView::_DrawDefaultSplitter(BView* view, BRect frame,
|
BSplitView::_DrawDefaultSplitter(BView* view, BRect frame,
|
||||||
const BRect& updateRect, enum orientation orientation, bool pressed)
|
const BRect& updateRect, enum orientation orientation, bool pressed)
|
||||||
|
|||||||
Reference in New Issue
Block a user