diff options
author | anbr <vdr07@deltab.de> | 2014-05-04 11:23:50 +0200 |
---|---|---|
committer | anbr <vdr07@deltab.de> | 2014-05-04 11:23:50 +0200 |
commit | 3d87cc0b6a062a39b9385f33bdec88ee25967776 (patch) | |
tree | 3c907421cacd9ee7bd8d56e4e85f986d3b45bef1 /vfd.c | |
parent | f110173bb35f84b8b6bca4dfd84b910b7deac1ef (diff) | |
download | vdr-plugin-targavfd-3d87cc0b6a062a39b9385f33bdec88ee25967776.tar.gz vdr-plugin-targavfd-3d87cc0b6a062a39b9385f33bdec88ee25967776.tar.bz2 |
Dual-Line-Mode: Eclipse long channel names (Closes: #1815)
Diffstat (limited to 'vfd.c')
-rw-r--r-- | vfd.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -456,13 +456,24 @@ bool cVFD::flush(bool refreshAll) * \param y Vertical character position (row). * \param string String that gets written. */ -int cVFD::DrawText(int x, int y, const char* string) +int cVFD::DrawText(int x, int y, const char* string, int nMaxWidth /* = 1024*/) { if(pFont && framebuf) - return pFont->DrawText(framebuf, x, y, string, 1024); + return pFont->DrawText(framebuf, x, y, string, nMaxWidth); return -1; } +int cVFD::DrawTextEclipsed(int x, int y, const char* string, int nMaxWidth /* = 1024*/) +{ + static const char* szEclipse = ".."; + int d = pFont->Width(szEclipse); + int w = this->DrawText(x, y, string, nMaxWidth - d); + if(w > 0 && ((w-x) != pFont->Width(string))) { + this->DrawText(w, y, szEclipse); + } + return w; +} + /** * Height of framebuffer from current device. */ |