2006-08-26 20:21:15 +04:00
|
|
|
/*
|
2010-07-20 12:24:19 +04:00
|
|
|
* Copyright 2006-2010, Haiku, Inc. All rights reserved.
|
2006-08-26 20:21:15 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _SPLIT_VIEW_H
|
|
|
|
#define _SPLIT_VIEW_H
|
|
|
|
|
|
|
|
#include <View.h>
|
|
|
|
|
|
|
|
class BSplitLayout;
|
|
|
|
|
|
|
|
|
|
|
|
class BSplitView : public BView {
|
|
|
|
public:
|
|
|
|
BSplitView(
|
2013-07-09 02:27:55 +04:00
|
|
|
orientation orientation = B_HORIZONTAL,
|
2010-09-03 02:58:24 +04:00
|
|
|
float spacing = B_USE_DEFAULT_SPACING);
|
2010-07-20 12:24:19 +04:00
|
|
|
BSplitView(BMessage* from);
|
2006-08-26 20:21:15 +04:00
|
|
|
virtual ~BSplitView();
|
|
|
|
|
2009-06-23 14:56:22 +04:00
|
|
|
void SetInsets(float left, float top, float right,
|
|
|
|
float bottom);
|
2011-06-10 00:58:52 +04:00
|
|
|
void SetInsets(float horizontal, float vertical);
|
|
|
|
void SetInsets(float insets);
|
2009-08-27 15:12:41 +04:00
|
|
|
void GetInsets(float* left, float* top,
|
|
|
|
float* right, float* bottom) const;
|
2009-06-23 14:56:22 +04:00
|
|
|
|
2006-08-26 20:21:15 +04:00
|
|
|
float Spacing() const;
|
|
|
|
void SetSpacing(float spacing);
|
|
|
|
|
|
|
|
orientation Orientation() const;
|
2013-07-09 02:27:55 +04:00
|
|
|
void SetOrientation(orientation orientation);
|
2006-08-26 20:21:15 +04:00
|
|
|
|
|
|
|
float SplitterSize() const;
|
|
|
|
void SetSplitterSize(float size);
|
|
|
|
|
2011-11-03 02:41:55 +04:00
|
|
|
int32 CountItems() const;
|
2011-01-01 15:08:49 +03:00
|
|
|
float ItemWeight(int32 index) const;
|
|
|
|
float ItemWeight(BLayoutItem* item) const;
|
|
|
|
void SetItemWeight(int32 index, float weight,
|
|
|
|
bool invalidateLayout);
|
|
|
|
void SetItemWeight(BLayoutItem* item, float weight);
|
2006-08-26 20:21:15 +04:00
|
|
|
|
2011-11-17 18:09:47 +04:00
|
|
|
bool IsCollapsible(int32 index) const;
|
2006-08-26 20:21:15 +04:00
|
|
|
void SetCollapsible(bool collapsible);
|
|
|
|
void SetCollapsible(int32 index, bool collapsible);
|
|
|
|
void SetCollapsible(int32 first, int32 last,
|
|
|
|
bool collapsible);
|
|
|
|
|
2011-11-17 18:09:47 +04:00
|
|
|
bool IsItemCollapsed(int32 index) const;
|
|
|
|
void SetItemCollapsed(int32 index, bool collapsed);
|
2011-11-17 07:19:02 +04:00
|
|
|
|
2006-08-26 20:21:15 +04:00
|
|
|
// void AddChild(BView* child);
|
|
|
|
void AddChild(BView* child, BView* sibling = NULL);
|
|
|
|
bool AddChild(BView* child, float weight);
|
|
|
|
bool AddChild(int32 index, BView* child,
|
|
|
|
float weight);
|
|
|
|
|
|
|
|
bool AddChild(BLayoutItem* child);
|
|
|
|
bool AddChild(BLayoutItem* child, float weight);
|
|
|
|
bool AddChild(int32 index, BLayoutItem* child,
|
|
|
|
float weight);
|
|
|
|
|
|
|
|
virtual void Draw(BRect updateRect);
|
2011-11-06 00:25:06 +04:00
|
|
|
virtual void DrawAfterChildren(BRect updateRect);
|
2006-08-26 20:21:15 +04:00
|
|
|
virtual void MouseDown(BPoint where);
|
|
|
|
virtual void MouseUp(BPoint where);
|
|
|
|
virtual void MouseMoved(BPoint where, uint32 transit,
|
|
|
|
const BMessage* message);
|
|
|
|
|
2011-11-06 00:25:06 +04:00
|
|
|
virtual void MessageReceived(BMessage* message);
|
|
|
|
|
2006-08-26 20:21:15 +04:00
|
|
|
|
|
|
|
virtual void SetLayout(BLayout* layout);
|
|
|
|
// overridden to avoid use
|
|
|
|
|
2010-07-20 12:24:19 +04:00
|
|
|
virtual status_t Archive(BMessage* into, bool deep = true) const;
|
|
|
|
static BArchivable* Instantiate(BMessage* from);
|
|
|
|
|
2011-11-01 00:57:30 +04:00
|
|
|
virtual status_t Perform(perform_code d, void* arg);
|
|
|
|
|
2006-08-26 20:21:15 +04:00
|
|
|
protected:
|
2011-12-02 07:45:50 +04:00
|
|
|
virtual status_t AllArchived(BMessage* into) const;
|
|
|
|
virtual status_t AllUnarchived(const BMessage* from);
|
|
|
|
|
2006-08-26 20:21:15 +04:00
|
|
|
virtual void DrawSplitter(BRect frame,
|
2009-06-20 19:03:33 +04:00
|
|
|
const BRect& updateRect,
|
2013-07-09 02:27:55 +04:00
|
|
|
orientation orientation,
|
2009-08-27 15:12:41 +04:00
|
|
|
bool pressed);
|
2006-08-26 20:21:15 +04:00
|
|
|
|
|
|
|
private:
|
2011-11-02 10:29:33 +04:00
|
|
|
|
|
|
|
// FBC padding
|
|
|
|
virtual void _ReservedSplitView1();
|
|
|
|
virtual void _ReservedSplitView2();
|
|
|
|
virtual void _ReservedSplitView3();
|
|
|
|
virtual void _ReservedSplitView4();
|
|
|
|
virtual void _ReservedSplitView5();
|
|
|
|
virtual void _ReservedSplitView6();
|
|
|
|
virtual void _ReservedSplitView7();
|
|
|
|
virtual void _ReservedSplitView8();
|
|
|
|
virtual void _ReservedSplitView9();
|
|
|
|
virtual void _ReservedSplitView10();
|
|
|
|
|
2011-11-05 08:23:22 +04:00
|
|
|
// forbidden methods
|
|
|
|
BSplitView(const BSplitView&);
|
|
|
|
void operator =(const BSplitView&);
|
|
|
|
|
2006-08-26 20:21:15 +04:00
|
|
|
static void _DrawDefaultSplitter(BView* view, BRect frame,
|
2009-06-20 19:03:33 +04:00
|
|
|
const BRect& updateRect,
|
2013-07-09 02:27:55 +04:00
|
|
|
orientation orientation,
|
2009-08-27 15:12:41 +04:00
|
|
|
bool pressed);
|
2006-08-26 20:21:15 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
BSplitLayout* fSplitLayout;
|
2011-11-02 10:29:33 +04:00
|
|
|
uint32 _reserved[3];
|
2006-08-26 20:21:15 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _SPLIT_VIEW_H
|