CTextBox: add option BOTTOM

BOTTOM was missed


Origin commit data
------------------
Commit: fee315f642
Author: Thilo Graf <dbt@novatux.de>
Date: 2012-09-24 (Mon, 24 Sep 2012)

Origin message was:
------------------
*CTextBox: add option BOTTOM

BOTTOM was missed
This commit is contained in:
2012-09-24 16:35:38 +02:00
parent def1c260ab
commit 813249a861
2 changed files with 9 additions and 4 deletions

View File

@@ -492,7 +492,7 @@ void CTextBox::refreshText(void)
if( frameBuffer == NULL) if( frameBuffer == NULL)
return; 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 //Paint Text Background
if (m_nPaintBackground) if (m_nPaintBackground)
@@ -511,6 +511,10 @@ void CTextBox::refreshText(void)
if (m_nMode & TOP) if (m_nMode & TOP)
// move to top of frame // move to top of frame
y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * m_nLinesPerPage) >> 1) - text_border_width; 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 else
// fit into mid of frame space // fit into mid of frame space
y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * std::min(m_nLinesPerPage, m_nNrOfLines)) >> 1) - text_border_width; y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * std::min(m_nLinesPerPage, m_nNrOfLines)) >> 1) - text_border_width;

View File

@@ -93,9 +93,10 @@ class CTextBox
AUTO_HIGH = 0x02, //auto adapt frame height to max height, text is painted with auto linebreak 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 SCROLL = 0x04, //frame box contains scrollbars on long text
CENTER = 0x40, //paint text centered CENTER = 0x40, //paint text centered
RIGHT = 0x100, //paint text right RIGHT = 0x80, //paint text right
TOP = 0x200, //paint text on top of frame TOP = 0x100, //paint text on top of frame
NO_AUTO_LINEBREAK = 0x80 //paint text without auto linebreak, cutting text BOTTOM = 0x200, //paint text on bottom of frame
NO_AUTO_LINEBREAK = 0x400 //paint text without auto linebreak, cutting text
}; };
private: private: