f3b1ada54f
* Changed BStringItem::Update() to set a better baseline offset and height; this should improve vertical text placement. * Fixed a bug in BStringItem::Update(): it used the owner to determine the width, but must use the font passed in instead. * Coding style cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31090 a95241bf-73f2-0310-859d-f6bbb57e9c96
44 lines
1.1 KiB
C++
44 lines
1.1 KiB
C++
/*
|
|
* Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _STRING_ITEM_H
|
|
#define _STRING_ITEM_H
|
|
|
|
|
|
#include <ListItem.h>
|
|
|
|
|
|
class BStringItem : public BListItem {
|
|
public:
|
|
BStringItem(const char* text,
|
|
uint32 outlineLevel = 0, bool expanded = true);
|
|
BStringItem(BMessage* archive);
|
|
virtual ~BStringItem();
|
|
|
|
static BArchivable* Instantiate(BMessage* archive);
|
|
virtual status_t Archive(BMessage* archive, bool deep = true) const;
|
|
|
|
virtual void DrawItem(BView* owner, BRect frame,
|
|
bool complete = false);
|
|
virtual void SetText(const char* text);
|
|
const char* Text() const;
|
|
|
|
virtual void Update(BView* owner, const BFont* font);
|
|
|
|
virtual status_t Perform(perform_code code, void* arg);
|
|
|
|
private:
|
|
virtual void _ReservedStringItem1();
|
|
virtual void _ReservedStringItem2();
|
|
|
|
BStringItem(const BStringItem& item);
|
|
BStringItem& operator=(const BStringItem& item);
|
|
|
|
char* fText;
|
|
float fBaselineOffset;
|
|
uint32 _reserved[2];
|
|
};
|
|
|
|
#endif // _STRING_ITEM_H
|