mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
CComponentsText: Add function getTextLinesAutoHeight()
- Function is used for determine the number of lines in a text box in AUTO_HIGH mode. Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -273,3 +273,18 @@ string CComponentsText::iToString(int int_val)
|
||||
string i_string(i_str.str());
|
||||
return i_string;
|
||||
}
|
||||
|
||||
//helper, get lines per textbox page
|
||||
int CComponentsText::getTextLinesAutoHeight(const int& textMaxHeight, const int& textWidth, const int& mode)
|
||||
{
|
||||
CComponentsText box;
|
||||
box.iX = 0;
|
||||
box.iY = 0;
|
||||
box.iWidth = textWidth;
|
||||
box.iHeight = textMaxHeight;
|
||||
|
||||
CTextBox tb(ct_text.c_str(), ct_font, mode, &box);
|
||||
int ret = tb.getLinesPerPage();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user