CTextBox: Add function getLinesPerPage()

- Add AUTO_LINEBREAK_NO_BREAKCHARS to textbox_modes for
 auto linebreak without '-' and '.' char


Origin commit data
------------------
Commit: 3d404afc7f
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2013-10-18 (Fri, 18 Oct 2013)

Origin message was:
------------------
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 1a636f462d
commit 1e6c8d4420
2 changed files with 14 additions and 10 deletions

View File

@@ -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);

View File

@@ -100,7 +100,8 @@ class CTextBox
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;};