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