Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksoid <aleksoid@users.sourceforge.net>2010-07-20 09:38:39 +0400
committerAleksoid <aleksoid@users.sourceforge.net>2010-07-20 09:38:39 +0400
commitc13bcc7289aa38d76c96753585a4fd185d7a65e6 (patch)
tree6c458e84a9010a333c94333cf2cf1b8f65c2fb63 /src/apps/mplayerc/VMROSD.cpp
parent1952b9bfe4e480c9f350b43f78f2c1e7bad3c953 (diff)
Fix : Truncate ODS text and adds an ellipsis to indicate the truncation if message does not fit in the main window;
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@2139 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/VMROSD.cpp')
-rw-r--r--src/apps/mplayerc/VMROSD.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/apps/mplayerc/VMROSD.cpp b/src/apps/mplayerc/VMROSD.cpp
index 43f0d04ab..8c5efa3e6 100644
--- a/src/apps/mplayerc/VMROSD.cpp
+++ b/src/apps/mplayerc/VMROSD.cpp
@@ -237,15 +237,21 @@ void CVMROSD::DrawMessage()
switch (m_nMessagePos)
{
case OSD_TOPLEFT :
- rectMessages = CRect (10, 10, rectText.right + 10, rectText.bottom + 10);
+ rectMessages = CRect (10, 10, min((rectText.right + 10),(m_rectWnd.right - 10)), (rectText.bottom + 10));
break;
case OSD_TOPRIGHT :
default :
- rectMessages = CRect (m_rectWnd.right-10-rectText.Width(), 10, m_rectWnd.right-10, rectText.bottom + 10);
+ rectMessages = CRect (max(10,m_rectWnd.right-10-rectText.Width()), 10, m_rectWnd.right-10, rectText.bottom + 10);
break;
}
DrawRect (&rectMessages, &m_brushBack, &m_penBorder);
- m_MemDC.DrawText (m_strMessage, &rectMessages, DT_SINGLELINE |DT_CENTER|DT_VCENTER);
+ DWORD uFormat = DT_SINGLELINE|DT_CENTER|DT_VCENTER;
+ if(rectText.right > (m_rectWnd.right - 20))
+ {
+ m_strMessage = _T(" ") + m_strMessage;
+ uFormat = uFormat|DT_END_ELLIPSIS;
+ }
+ m_MemDC.DrawText (m_strMessage, &rectMessages, uFormat);
}
}