ASPiK SDK
cdrawmethods.h
1 // This file is part of VSTGUI. It is subject to the license terms
2 // in the LICENSE file found in the top-level directory of this
3 // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
4 
5 #ifndef __cdrawmethods__
6 #define __cdrawmethods__
7 
8 #include "vstguifwd.h"
9 #include "cdrawdefs.h"
10 #include "cfont.h"
11 #include "cpoint.h"
12 
13 namespace VSTGUI {
14 
15 namespace CDrawMethods {
16 
17 //-----------------------------------------------------------------------------
18 enum IconPosition {
19  kIconLeft,
20  kIconCenterAbove,
21  kIconCenterBelow,
22  kIconRight
23 };
24 
25 //-----------------------------------------------------------------------------
26 enum TextTruncateMode {
27  kTextTruncateNone,
28  kTextTruncateHead,
29  kTextTruncateTail
30 };
31 
32 //-----------------------------------------------------------------------------
33 enum CreateTextTruncateFlags {
35  kReturnEmptyIfTruncationIsPlaceholderOnly = 1 << 0,
36 };
37 
38 //-----------------------------------------------------------------------------
49 UTF8String createTruncatedText (TextTruncateMode mode, const UTF8String& text, CFontRef font, CCoord maxWidth, const CPoint& textInset = CPoint (0, 0), uint32_t flags = 0);
50 
51 //-----------------------------------------------------------------------------
65 void drawIconAndText (CDrawContext* context, CBitmap* iconToDraw, IconPosition iconPosition, CHoriTxtAlign textAlignment, CCoord textIconMargin, CRect drawRect, const UTF8String& title, CFontRef font, CColor textColor, TextTruncateMode truncateMode = kTextTruncateNone);
66 
67 }} // namespaces
68 
69 #endif // __cdrawmethods__
Definition: customcontrols.cpp:8