From 33e684bc204bf2b4edbc04a1748faa693cf28ded Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 22 Sep 2012 23:17:30 +0200 Subject: [PATCH] *CTextBox: add optional text align TOP --- src/gui/widget/textbox.cpp | 4 ++-- src/gui/widget/textbox.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 33b226f24..a4b182011 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -507,8 +507,8 @@ void CTextBox::refreshText(void) int i; int x_center = 0; - // set text y position depends of lines count - if (m_nNrOfLines > 1) + // set text y position + if (m_nMode & TOP) // move to top of frame y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * m_nLinesPerPage) >> 1) - text_border_width; else diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index d12c05c67..58d77df5d 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -94,6 +94,7 @@ class CTextBox 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 };