BStringView: added truncation support.

* Added new truncation mode B_NO_TRUNCATION.
* The Truncation()/SetTruncation() methods itself are Dano-compatible,
  however, there was no B_NO_TRUNCATION.
This commit is contained in:
Axel Dörfler
2015-01-23 21:00:28 +01:00
parent 1bfa46f230
commit 95fdee0bc0
4 changed files with 72 additions and 41 deletions
+5 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2009, Haiku, Inc. All rights reserved.
* Copyright 2001-2015, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _STRING_VIEW_H
@@ -28,6 +28,8 @@ public:
const char* Text() const;
void SetAlignment(alignment flag);
alignment Alignment() const;
void SetTruncation(uint32 truncationMode);
uint32 Truncation() const;
virtual void AttachedToWindow();
virtual void DetachedFromWindow();
@@ -80,9 +82,10 @@ private:
private:
char* fText;
float fStringWidth;
uint32 fTruncation;
alignment fAlign;
BSize fPreferredSize;
};
#endif // _STRING_VIEW_H