HaikuDepot: Moved some extra classes into .cpp file
This commit is contained in:
@@ -15,6 +15,65 @@
|
|||||||
#define B_TRANSLATION_CONTEXT "PackageListView"
|
#define B_TRANSLATION_CONTEXT "PackageListView"
|
||||||
|
|
||||||
|
|
||||||
|
// A field type displaying both a bitmap and a string so that the
|
||||||
|
// tree display looks nicer (both text and bitmap are indented)
|
||||||
|
// TODO: Code-duplication with DriveSetup PartitionList.h
|
||||||
|
class BBitmapStringField : public BStringField {
|
||||||
|
typedef BStringField Inherited;
|
||||||
|
public:
|
||||||
|
BBitmapStringField(BBitmap* bitmap,
|
||||||
|
const char* string);
|
||||||
|
virtual ~BBitmapStringField();
|
||||||
|
|
||||||
|
void SetBitmap(BBitmap* bitmap);
|
||||||
|
const BBitmap* Bitmap() const
|
||||||
|
{ return fBitmap; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
BBitmap* fBitmap;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// BColumn for PackageListView which knows how to render
|
||||||
|
// a BBitmapStringField
|
||||||
|
// TODO: Code-duplication with DriveSetup PartitionList.h
|
||||||
|
class PackageColumn : public BTitledColumn {
|
||||||
|
typedef BTitledColumn Inherited;
|
||||||
|
public:
|
||||||
|
PackageColumn(const char* title,
|
||||||
|
float width, float minWidth,
|
||||||
|
float maxWidth, uint32 truncateMode,
|
||||||
|
alignment align = B_ALIGN_LEFT);
|
||||||
|
|
||||||
|
virtual void DrawField(BField* field, BRect rect,
|
||||||
|
BView* parent);
|
||||||
|
virtual float GetPreferredWidth(BField* field,
|
||||||
|
BView* parent) const;
|
||||||
|
|
||||||
|
virtual bool AcceptsField(const BField* field) const;
|
||||||
|
|
||||||
|
static void InitTextMargin(BView* parent);
|
||||||
|
|
||||||
|
private:
|
||||||
|
uint32 fTruncateMode;
|
||||||
|
static float sTextMargin;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// BRow for the PartitionListView
|
||||||
|
class PackageRow : public BRow {
|
||||||
|
typedef BRow Inherited;
|
||||||
|
public:
|
||||||
|
PackageRow(const PackageInfo& package);
|
||||||
|
|
||||||
|
const PackageInfo& Package() const
|
||||||
|
{ return fPackage; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
PackageInfo fPackage;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - BBitmapStringField
|
// #pragma mark - BBitmapStringField
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,64 +12,7 @@
|
|||||||
#include "PackageInfo.h"
|
#include "PackageInfo.h"
|
||||||
|
|
||||||
|
|
||||||
// A field type displaying both a bitmap and a string so that the
|
class PackageRow;
|
||||||
// tree display looks nicer (both text and bitmap are indented)
|
|
||||||
// TODO: Code-duplication with DriveSetup PartitionList.h
|
|
||||||
class BBitmapStringField : public BStringField {
|
|
||||||
typedef BStringField Inherited;
|
|
||||||
public:
|
|
||||||
BBitmapStringField(BBitmap* bitmap,
|
|
||||||
const char* string);
|
|
||||||
virtual ~BBitmapStringField();
|
|
||||||
|
|
||||||
void SetBitmap(BBitmap* bitmap);
|
|
||||||
const BBitmap* Bitmap() const
|
|
||||||
{ return fBitmap; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
BBitmap* fBitmap;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// BColumn for PackageListView which knows how to render
|
|
||||||
// a BBitmapStringField
|
|
||||||
// TODO: Code-duplication with DriveSetup PartitionList.h
|
|
||||||
class PackageColumn : public BTitledColumn {
|
|
||||||
typedef BTitledColumn Inherited;
|
|
||||||
public:
|
|
||||||
PackageColumn(const char* title,
|
|
||||||
float width, float minWidth,
|
|
||||||
float maxWidth, uint32 truncateMode,
|
|
||||||
alignment align = B_ALIGN_LEFT);
|
|
||||||
|
|
||||||
virtual void DrawField(BField* field, BRect rect,
|
|
||||||
BView* parent);
|
|
||||||
virtual float GetPreferredWidth(BField* field,
|
|
||||||
BView* parent) const;
|
|
||||||
|
|
||||||
virtual bool AcceptsField(const BField* field) const;
|
|
||||||
|
|
||||||
static void InitTextMargin(BView* parent);
|
|
||||||
|
|
||||||
private:
|
|
||||||
uint32 fTruncateMode;
|
|
||||||
static float sTextMargin;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// BRow for the PartitionListView
|
|
||||||
class PackageRow : public BRow {
|
|
||||||
typedef BRow Inherited;
|
|
||||||
public:
|
|
||||||
PackageRow(const PackageInfo& package);
|
|
||||||
|
|
||||||
const PackageInfo& Package() const
|
|
||||||
{ return fPackage; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
PackageInfo fPackage;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class PackageListView : public BColumnListView {
|
class PackageListView : public BColumnListView {
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user