Rewrote the BScrollView header from scratch.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6642 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-02-19 02:06:12 +00:00
parent 65a8a591f1
commit dfa1093a41

View File

@ -1,106 +1,92 @@
/******************************************************************************* /*
/ ** Copyright 2004, OpenBeOS. All Rights Reserved.
/ File: ScrollView.h ** Distributed under the terms of the OpenBeOS License.
/ */
/ Description: BScrollView provides scrolling machinery for its contents
/ (where the "contents" is some other view).
/
/ Copyright 1993-98, Be Incorporated, All Rights Reserved
/
*******************************************************************************/
#ifndef _SCROLL_VIEW_H #ifndef _SCROLL_VIEW_H
#define _SCROLL_VIEW_H #define _SCROLL_VIEW_H
#include <BeBuild.h> /** The BScrollView is a convenience class to add a scrolling
#include <ScrollBar.h> /* For convenience */ * mechanism to the target view.
#include <View.h> */
#include <ScrollBar.h>
/*----------------------------------------------------------------*/
/*----- BScrollView class ----------------------------------------*/
class BScrollView : public BView { class BScrollView : public BView {
public:
public: BScrollView(const char *name, BView *target,
BScrollView(const char *name, uint32 resizeMask = B_FOLLOW_LEFT | B_FOLLOW_TOP,
BView *target, uint32 flags = 0, bool horizontal = false, bool vertical = false,
uint32 resizeMask = B_FOLLOW_LEFT |
B_FOLLOW_TOP,
uint32 flags = 0,
bool horizontal = false,
bool vertical = false,
border_style border = B_FANCY_BORDER); border_style border = B_FANCY_BORDER);
BScrollView(BMessage *data); BScrollView(BMessage *data);
virtual ~BScrollView(); virtual ~BScrollView();
static BArchivable *Instantiate(BMessage *data);
virtual status_t Archive(BMessage *data, bool deep = true) const;
virtual void Draw(BRect updateRect); static BArchivable *Instantiate(BMessage *data);
virtual void AttachedToWindow(); virtual status_t Archive(BMessage *data, bool deep = true) const;
BScrollBar *ScrollBar(orientation flag) const;
virtual void SetBorder(border_style border); virtual void Draw(BRect updateRect);
virtual void AttachedToWindow();
BScrollBar *ScrollBar(orientation posture);
virtual void SetBorder(border_style border);
border_style Border() const; border_style Border() const;
virtual status_t SetBorderHighlighted(bool state); virtual void SetBorderHighlighted(bool state);
bool IsBorderHighlighted() const; bool IsBorderHighlighted() const;
void SetTarget(BView *new_target); void SetTarget(BView *target);
BView *Target() const; BView *Target() const;
virtual void MessageReceived(BMessage *msg); virtual void MessageReceived(BMessage *message);
virtual void MouseDown(BPoint pt); virtual void MouseDown(BPoint point);
virtual void WindowActivated(bool state);
virtual void MouseUp(BPoint pt);
virtual void MouseMoved(BPoint pt, uint32 code, const BMessage *msg);
virtual void DetachedFromWindow();
virtual void AllAttached();
virtual void AllDetached();
virtual void FrameMoved(BPoint new_position);
virtual void FrameResized(float new_width, float new_height);
virtual BHandler *ResolveSpecifier(BMessage *msg, virtual void WindowActivated(bool active);
int32 index, virtual void MouseUp(BPoint point);
BMessage *specifier, virtual void MouseMoved(BPoint point, uint32 code, const BMessage *msg);
int32 form,
const char *property);
virtual void ResizeToPreferred(); virtual void DetachedFromWindow();
virtual void GetPreferredSize(float *width, float *height); virtual void AllAttached();
virtual void MakeFocus(bool state = true); virtual void AllDetached();
virtual status_t GetSupportedSuites(BMessage *data);
/*----- Private or reserved -----------------------------------------*/ virtual void FrameMoved(BPoint position);
virtual status_t Perform(perform_code d, void *arg); virtual void FrameResized(float width, float height);
private: virtual BHandler *ResolveSpecifier(BMessage *message, int32 index,
BMessage *specifier, int32 form, const char *property);
friend class BView; virtual void ResizeToPreferred();
virtual void GetPreferredSize(float *_width, float *_height);
virtual void MakeFocus(bool state = true);
virtual status_t GetSupportedSuites(BMessage *data);
virtual void _ReservedScrollView1(); // private or reserved methods are following
virtual void _ReservedScrollView2();
virtual void _ReservedScrollView3(); virtual status_t Perform(perform_code d, void *arg);
virtual void _ReservedScrollView4();
private:
friend class BView;
virtual void _ReservedScrollView1();
virtual void _ReservedScrollView2();
virtual void _ReservedScrollView3();
virtual void _ReservedScrollView4();
BScrollView &operator=(const BScrollView &); BScrollView &operator=(const BScrollView &);
static BRect CalcFrame(BView *, bool, bool, border_style); static BRect CalcFrame(BView *target, bool h, bool v, border_style);
int32 ModFlags(int32, border_style); int32 ModFlags(int32, border_style);
void InitObject(); void InitObject();
BView *fTarget; BView *fTarget;
BScrollBar *fHSB; BScrollBar *fHorizontalScrollBar;
BScrollBar *fVSB; BScrollBar *fVerticalScrollBar;
border_style fBorder; border_style fBorder;
uint16 fPrevWidth; uint16 fPreviousWidth;
uint16 fPrevHeight; uint16 fPreviousHeight;
uint32 _reserved[3]; /* was 4 */
bool fHighlighted; bool fHighlighted;
uint32 _reserved[3];
}; };
/*-------------------------------------------------------------*/
/*-------------------------------------------------------------*/
#endif /* _SCROLL_VIEW_H */ #endif /* _SCROLL_VIEW_H */