VSTGUI  4.10
Graphical User Interface Framework not only for VST plugins
VSTGUI::CDrawMethods Namespace Reference

Enumerations

enum  IconPosition : uint16_t { kIconLeft = 0, kIconCenterAbove, kIconCenterBelow, kIconRight }
 
enum  TextTruncateMode : uint16_t { kTextTruncateNone = 0, kTextTruncateHead, kTextTruncateTail }
 
enum  CreateTextTruncateFlags : uint16_t { kReturnEmptyIfTruncationIsPlaceholderOnly = 1 << 0 }
 

Functions

UTF8String createTruncatedText (TextTruncateMode mode, const UTF8String &text, CFontRef font, CCoord maxWidth, const CPoint &textInset=CPoint(0, 0), uint32_t flags=0)
 create a truncated string More...
 
void drawIconAndText (CDrawContext *context, CBitmap *iconToDraw, IconPosition iconPosition, CHoriTxtAlign textAlignment, CCoord textIconMargin, CRect drawRect, const UTF8String &title, CFontRef font, CColor textColor, TextTruncateMode truncateMode=kTextTruncateNone)
 draws an icon and a string into a rectangle More...
 

Enumeration Type Documentation

◆ CreateTextTruncateFlags

enum CreateTextTruncateFlags : uint16_t
Enumerator
kReturnEmptyIfTruncationIsPlaceholderOnly 

return an empty string if the truncated text is only the placeholder string

◆ IconPosition

enum IconPosition : uint16_t
Enumerator
kIconLeft 

icon left, text centered in the area next to the icon

kIconCenterAbove 

icon centered above the text, text centered

kIconCenterBelow 

icon centered below the text, text centered

kIconRight 

icon right, text centered in the area next to the icon

◆ TextTruncateMode

enum TextTruncateMode : uint16_t
Enumerator
kTextTruncateNone 
kTextTruncateHead 
kTextTruncateTail 

Function Documentation

◆ createTruncatedText()

UTF8String createTruncatedText ( TextTruncateMode  mode,
const UTF8String text,
CFontRef  font,
CCoord  maxWidth,
const CPoint textInset = CPoint(0, 0),
uint32_t  flags = 0 
)

create a truncated string

Parameters
modetruncation mode
texttext string
fontfont
maxWidthmaximum width
textInsettext inset
flagsflags see CreateTextTruncateFlags
Returns
truncated text or original text if no truncation needed

◆ drawIconAndText()

void drawIconAndText ( CDrawContext context,
CBitmap iconToDraw,
IconPosition  iconPosition,
CHoriTxtAlign  textAlignment,
CCoord  textIconMargin,
CRect  drawRect,
const UTF8String title,
CFontRef  font,
CColor  textColor,
TextTruncateMode  truncateMode = kTextTruncateNone 
)

draws an icon and a string into a rectangle

Parameters
contextdraw context
iconToDrawicon to draw
iconPositionposition of the icon
textAlignmentalignment of the string
textIconMarginmargin of the string
drawRectdraw rectangle
titlestring
fontfont
textColorfont color
truncateModetruncation mode