Add private BViewPort class
* It simplifies putting regular layout-aware views or layout items into a BScrollView. * Not quite complete yet: Height-for-width support is missing, but that also requires fixing BScrollView in this respect. Scroll bar auto-hide support would be nice as well.
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright 2013, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Ingo Weinhold <[email protected]>
|
||||
*/
|
||||
#ifndef _VIEW_PORT_H
|
||||
#define _VIEW_PORT_H
|
||||
|
||||
|
||||
#include <View.h>
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
class BViewPort : public BView {
|
||||
public:
|
||||
BViewPort(BView* child = NULL);
|
||||
BViewPort(BLayoutItem* child);
|
||||
BViewPort(const char* name,
|
||||
BView* child = NULL);
|
||||
BViewPort(const char* name,
|
||||
BLayoutItem* child);
|
||||
virtual ~BViewPort();
|
||||
|
||||
BView* ChildView() const;
|
||||
void SetChildView(BView* child);
|
||||
|
||||
BLayoutItem* ChildItem() const;
|
||||
void SetChildItem(BLayoutItem* child);
|
||||
|
||||
private:
|
||||
class ViewPortLayout;
|
||||
friend class ViewPortLayout;
|
||||
|
||||
private:
|
||||
void _Init();
|
||||
|
||||
private:
|
||||
ViewPortLayout* fLayout;
|
||||
BLayoutItem* fChild;
|
||||
};
|
||||
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
|
||||
using ::BPrivate::BViewPort;
|
||||
|
||||
|
||||
#endif // _VIEW_PORT_H
|
||||
Reference in New Issue
Block a user