CTextBox: Add function getLinesPerPage()

- Add AUTO_LINEBREAK_NO_BREAKCHARS to textbox_modes for
  auto linebreak without '-' and '.' char
This commit is contained in:
Michael Liebmann
2013-10-18 10:47:16 +02:00
committed by Thilo Graf
parent 5323e92a6f
commit 3d404afc7f
2 changed files with 14 additions and 10 deletions

View File

@@ -374,6 +374,8 @@ void CTextBox::refreshTextLineArray(void)
//manage auto linebreak,
if(m_nMode & NO_AUTO_LINEBREAK)
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
pos = m_cText.find_first_of("\n/-. ", pos_prev);

View File

@@ -100,7 +100,8 @@ class CTextBox
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
NO_AUTO_LINEBREAK = 0x400, //paint text without auto linebreak, cutting text
AUTO_LINEBREAK_NO_BREAKCHARS = 0x800 //no linbreak an char '-' and '.'
};
private:
@@ -195,6 +196,7 @@ class CTextBox
inline CBox getWindowsPos(void) {return(m_cFrame);};
inline int getMaxLineWidth(void) {return(m_nMaxLineWidth);};
inline int getLines(void) {return(m_nNrOfLines);};
inline int getLinesPerPage(void) {return m_nLinesPerPage;};
inline int getPages(void) {return(m_nNrOfPages);};
inline void movePosition(int x, int y) {m_cFrame.iX = x; m_cFrame.iY = y;};