mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 09:51:22 +02:00
CtextBox: Precise function getLines()
Use refreshTextLineArray() for calculation of lines. Note: count of lines will be only returned if CTextBox object is initialized with a valid CBox instance, otherwise count of 0 lines will be returned! also remove inline declaration, not needed here
This commit is contained in:
@@ -900,6 +900,16 @@ int CTextBox::getLines(const std::string& text)
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CTextBox::getLines()
|
||||||
|
{
|
||||||
|
if (m_cText.empty())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
refreshTextLineArray();
|
||||||
|
|
||||||
|
return m_nNrOfLines;
|
||||||
|
}
|
||||||
|
|
||||||
int CTextBox::getMaxLineWidth(const std::string& text, Font* font)
|
int CTextBox::getMaxLineWidth(const std::string& text, Font* font)
|
||||||
{
|
{
|
||||||
std::string txt = text;
|
std::string txt = text;
|
||||||
|
@@ -199,28 +199,30 @@ class CTextBox : public sigc::trackable
|
|||||||
void enableUTF8(bool enable = true){m_utf8_encoded = enable;}
|
void enableUTF8(bool enable = true){m_utf8_encoded = enable;}
|
||||||
void disableUTF8(bool enable = false){enableUTF8(enable);}
|
void disableUTF8(bool enable = false){enableUTF8(enable);}
|
||||||
|
|
||||||
inline bool isPainted(void) {if( frameBuffer == NULL) return (false); else return (true);};
|
bool isPainted(void) {if( frameBuffer == NULL) return (false); else return (true);};
|
||||||
inline CBox getWindowsPos(void) {return(m_cFrame);};
|
CBox getWindowsPos(void) {return(m_cFrame);};
|
||||||
|
|
||||||
inline int getLinesPerPage(void) {return m_nLinesPerPage;};
|
int getLinesPerPage(void) {return m_nLinesPerPage;};
|
||||||
inline int getPages(void) {return(m_nNrOfPages);};
|
int getPages(void) {return(m_nNrOfPages);};
|
||||||
inline int getBackGroundRadius(void) {return(m_nBgRadius);};
|
int getBackGroundRadius(void) {return(m_nBgRadius);};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns count of lines of a passed text.
|
* Returns count of lines of a passed text.
|
||||||
* @param[in] text
|
* @param[in] text
|
||||||
* @li exepts type std::string
|
* @li expects type std::string
|
||||||
* @return count of lines as int
|
* @return count of lines as int
|
||||||
* @see getLines()
|
* @see getLines()
|
||||||
*/
|
*/
|
||||||
static int getLines(const std::string& text);
|
static int getLines(const std::string& text);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns count of evaluated lines from an existent CTextBox instance.
|
* Returns count of calculated lines from an existing CTextBox instance.
|
||||||
* @return count of lines as int
|
* @return count of lines as int
|
||||||
* @see static version getLines()
|
* @see static version getLines()
|
||||||
|
* @note Real count of lines will be only returned if CTextBox object is initialized with a valid CBox instance, \n
|
||||||
|
* otherwise count of 0 lines will be returned!
|
||||||
*/
|
*/
|
||||||
int getLines(){return(m_nNrOfLines);}
|
int getLines();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns width of largest line from passed text
|
* Returns width of largest line from passed text
|
||||||
|
Reference in New Issue
Block a user