2010-05-07 04:47:10 -05:00
|
|
|
/*
|
2010-05-27 19:47:00 -05:00
|
|
|
* Copyright 2009-2010, Pier Luigi Fiorini. All rights reserved.
|
2010-05-07 04:47:10 -05:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _BITMAP_VIEW_H
|
|
|
|
#define _BITMAP_VIEW_H
|
|
|
|
|
|
|
|
#include <View.h>
|
|
|
|
|
|
|
|
class BBitmap;
|
|
|
|
|
|
|
|
class BitmapView : public BView {
|
|
|
|
public:
|
2010-05-20 13:11:32 -05:00
|
|
|
BitmapView(const char* name, uint32 flags
|
|
|
|
= B_WILL_DRAW);
|
2010-05-07 04:47:10 -05:00
|
|
|
~BitmapView();
|
|
|
|
|
2010-05-29 23:24:53 -05:00
|
|
|
virtual void AttachedToWindow();
|
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
status_t InitCheck();
|
|
|
|
|
2010-05-20 13:11:32 -05:00
|
|
|
BBitmap* Bitmap() const;
|
2010-05-27 19:47:00 -05:00
|
|
|
void SetBitmap(const char* filename);
|
2010-05-07 04:47:10 -05:00
|
|
|
void SetBitmap(BBitmap* bitmap);
|
|
|
|
|
|
|
|
virtual BSize MinSize();
|
|
|
|
virtual BSize MaxSize();
|
|
|
|
virtual BSize PreferredSize();
|
|
|
|
|
|
|
|
virtual void Draw(BRect frame);
|
|
|
|
|
|
|
|
private:
|
|
|
|
BBitmap* fBitmap;
|
|
|
|
float fWidth;
|
|
|
|
float fHeight;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _BITMAP_VIEW_H
|