summaryrefslogtreecommitdiff
path: root/vfd.c
diff options
context:
space:
mode:
authoranbr <vdr07@deltab.de>2014-05-04 11:23:50 +0200
committeranbr <vdr07@deltab.de>2014-05-04 11:23:50 +0200
commit3d87cc0b6a062a39b9385f33bdec88ee25967776 (patch)
tree3c907421cacd9ee7bd8d56e4e85f986d3b45bef1 /vfd.c
parentf110173bb35f84b8b6bca4dfd84b910b7deac1ef (diff)
downloadvdr-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.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/vfd.c b/vfd.c
index c77fe69..ac30f81 100644
--- a/vfd.c
+++ b/vfd.c
@@ -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.
*/