mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CTextBox: Add function getLinesPerPage()
- Add AUTO_LINEBREAK_NO_BREAKCHARS to textbox_modes for auto linebreak without '-' and '.' char
This commit is contained in:
@@ -373,9 +373,11 @@ void CTextBox::refreshTextLineArray(void)
|
|||||||
{
|
{
|
||||||
//manage auto linebreak,
|
//manage auto linebreak,
|
||||||
if(m_nMode & NO_AUTO_LINEBREAK)
|
if(m_nMode & NO_AUTO_LINEBREAK)
|
||||||
pos = m_cText.find_first_of("\n",pos_prev);
|
pos = m_cText.find_first_of("\n", pos_prev);
|
||||||
|
else if(m_nMode & AUTO_LINEBREAK_NO_BREAKCHARS)
|
||||||
|
pos = m_cText.find_first_of("\n/ ", pos_prev);
|
||||||
else
|
else
|
||||||
pos = m_cText.find_first_of("\n/-. ",pos_prev);
|
pos = m_cText.find_first_of("\n/-. ", pos_prev);
|
||||||
|
|
||||||
//TRACE_1(" pos: %d pos_prev: %d\r\n",pos,pos_prev);
|
//TRACE_1(" pos: %d pos_prev: %d\r\n",pos,pos_prev);
|
||||||
|
|
||||||
|
@@ -93,14 +93,15 @@ class CTextBox
|
|||||||
/* Variables */
|
/* Variables */
|
||||||
enum textbox_modes
|
enum textbox_modes
|
||||||
{
|
{
|
||||||
AUTO_WIDTH = 0x01, //auto adapt frame width to max width or max text width, text is painted with auto linebreak
|
AUTO_WIDTH = 0x01, //auto adapt frame width to max width or max text width, text is painted with auto linebreak
|
||||||
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 = 0x80, //paint text right
|
RIGHT = 0x80, //paint text right
|
||||||
TOP = 0x100, //paint text on top of frame
|
TOP = 0x100, //paint text on top of frame
|
||||||
BOTTOM = 0x200, //paint text on bottom of frame
|
BOTTOM = 0x200, //paint text on bottom of frame
|
||||||
NO_AUTO_LINEBREAK = 0x400 //paint text without auto linebreak, cutting text
|
NO_AUTO_LINEBREAK = 0x400, //paint text without auto linebreak, cutting text
|
||||||
|
AUTO_LINEBREAK_NO_BREAKCHARS = 0x800 //no linbreak an char '-' and '.'
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -195,6 +196,7 @@ class CTextBox
|
|||||||
inline CBox getWindowsPos(void) {return(m_cFrame);};
|
inline CBox getWindowsPos(void) {return(m_cFrame);};
|
||||||
inline int getMaxLineWidth(void) {return(m_nMaxLineWidth);};
|
inline int getMaxLineWidth(void) {return(m_nMaxLineWidth);};
|
||||||
inline int getLines(void) {return(m_nNrOfLines);};
|
inline int getLines(void) {return(m_nNrOfLines);};
|
||||||
|
inline int getLinesPerPage(void) {return m_nLinesPerPage;};
|
||||||
inline int getPages(void) {return(m_nNrOfPages);};
|
inline int getPages(void) {return(m_nNrOfPages);};
|
||||||
inline void movePosition(int x, int y) {m_cFrame.iX = x; m_cFrame.iY = y;};
|
inline void movePosition(int x, int y) {m_cFrame.iX = x; m_cFrame.iY = y;};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user