mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
*CTextBox: add option BOTTOM
BOTTOM was missed
This commit is contained in:
@@ -492,7 +492,7 @@ void CTextBox::refreshText(void)
|
||||
if( frameBuffer == NULL)
|
||||
return;
|
||||
|
||||
//TRACE("[CTextBox] m_nCurrentLine: %d, m_cLineArray[m_nCurrentLine]: %s\r\n",m_nCurrentLine, m_cLineArray[m_nCurrentLine].c_str());
|
||||
//TRACE("[CTextBox] m_nCurrentLine: %d, m_nNrOfLines %d, m_cLineArray[m_nCurrentLine]: %s\r\n",m_nCurrentLine, m_nNrOfLines, m_cLineArray[m_nCurrentLine].c_str());
|
||||
|
||||
//Paint Text Background
|
||||
if (m_nPaintBackground)
|
||||
@@ -511,6 +511,10 @@ void CTextBox::refreshText(void)
|
||||
if (m_nMode & TOP)
|
||||
// move to top of frame
|
||||
y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * m_nLinesPerPage) >> 1) - text_border_width;
|
||||
else if (m_nMode & BOTTOM)
|
||||
// move to bottom of frame
|
||||
y += m_cFrameTextRel.iHeight - text_border_width - (m_nNrOfLines > 1 ? (m_nNrOfLines-1)*m_nFontTextHeight : 0) ;
|
||||
//m_nFontTextHeight + text_border_width /*- ((m_cFrameTextRel.iHeight + m_nFontTextHeight*/ * m_nLinesPerPage/*) >> 1)*/;
|
||||
else
|
||||
// fit into mid of frame space
|
||||
y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * std::min(m_nLinesPerPage, m_nNrOfLines)) >> 1) - text_border_width;
|
||||
|
@@ -93,9 +93,10 @@ class CTextBox
|
||||
AUTO_HIGH = 0x02, //auto adapt frame height to max height, text is painted with auto linebreak
|
||||
SCROLL = 0x04, //frame box contains scrollbars on long text
|
||||
CENTER = 0x40, //paint text centered
|
||||
RIGHT = 0x100, //paint text right
|
||||
TOP = 0x200, //paint text on top of frame
|
||||
NO_AUTO_LINEBREAK = 0x80 //paint text without auto linebreak, cutting text
|
||||
RIGHT = 0x80, //paint text right
|
||||
TOP = 0x100, //paint text on top of frame
|
||||
BOTTOM = 0x200, //paint text on bottom of frame
|
||||
NO_AUTO_LINEBREAK = 0x400 //paint text without auto linebreak, cutting text
|
||||
};
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user