From a394c9efec830b275c0b738974126aead284ec4e Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Thu, 27 Sep 2012 20:43:20 +0200 Subject: Updated docs and some Doxygen fixes --- src/ui/README.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ui') diff --git a/src/ui/README.txt b/src/ui/README.txt index 9814ef0..a159ed5 100644 --- a/src/ui/README.txt +++ b/src/ui/README.txt @@ -1,4 +1,4 @@ /** - * \dir ui + * \dir src/ui * \brief 2D user interface controls - */ \ No newline at end of file + */ -- cgit v1.2.3-1-g7c22 From a38d60d1918dace1c2a35bf910e0644870fb77f9 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sat, 29 Sep 2012 19:29:17 +0200 Subject: Fixed CEdit cursor --- src/ui/edit.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/ui') diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp index 3d14b03..27ef576 100644 --- a/src/ui/edit.cpp +++ b/src/ui/edit.cpp @@ -725,7 +725,7 @@ int CEdit::MouseDetect(Math::Point mouse) // c = m_engine->GetText()->Detect(m_text+m_lineOffset[i], // len, offset, m_fontSize, // m_fontStretch, m_fontType); - c = m_engine->GetText()->Detect(std::string(m_text+m_lineOffset[i]), m_fontType, m_fontSize, offset); // TODO check if good + c = m_engine->GetText()->Detect(std::string(m_text+m_lineOffset[i]).substr(0, len), m_fontType, m_fontSize, offset); // TODO check if good } else { @@ -736,7 +736,7 @@ int CEdit::MouseDetect(Math::Point mouse) // m_format+m_lineOffset[i], // len, offset, size, // m_fontStretch); - c = m_engine->GetText()->Detect(std::string(m_text+m_lineOffset[i]), + c = m_engine->GetText()->Detect(std::string(m_text+m_lineOffset[i]).substr(0, len), m_format, size, offset); // TODO check if good @@ -1102,16 +1102,16 @@ void CEdit::Draw() if ( m_format.size() == 0 ) { - m_engine->GetText()->SizeText(std::string(m_text+m_lineOffset[i]), m_fontType, - size, pos, Gfx::TEXT_ALIGN_LEFT, - start, end); + m_engine->GetText()->SizeText(std::string(m_text+m_lineOffset[i]).substr(0, len), m_fontType, + size, pos, Gfx::TEXT_ALIGN_LEFT, + start, end); } else { - m_engine->GetText()->SizeText(std::string(m_text+m_lineOffset[i]), + m_engine->GetText()->SizeText(std::string(m_text+m_lineOffset[i]).substr(0, len), m_format, - size, pos, Gfx::TEXT_ALIGN_LEFT, - start, end); + size, pos, Gfx::TEXT_ALIGN_LEFT, + start, end); } pos.x = end.x; -- cgit v1.2.3-1-g7c22 From c8f39a4c96ab63f9e3edc96845e1b70c89b95d2b Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sat, 29 Sep 2012 22:04:39 +0200 Subject: Fixed CEdit delete[] issues --- src/ui/edit.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ui') diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp index 27ef576..ca53a7a 100644 --- a/src/ui/edit.cpp +++ b/src/ui/edit.cpp @@ -1483,7 +1483,7 @@ bool CEdit::ReadText(const char *filename, int addSize) FreeImage(); if (m_text != nullptr) - delete m_text; + delete[] m_text; m_text = new char[m_maxChar+1]; memset(m_text, 0, m_maxChar+1); @@ -1516,7 +1516,7 @@ bool CEdit::ReadText(const char *filename, int addSize) { m_text[j] = buffer[i]; //if ( m_format.size() > 0 ) - m_format[j] = font; + m_format[j] = font; j ++; } i ++; @@ -1857,7 +1857,7 @@ bool CEdit::ReadText(const char *filename, int addSize) { m_text[j] = buffer[i]; //if ( m_format.size() > 0 ) - m_format[j] = font; + m_format[j] = font; j ++; } i ++; @@ -1873,7 +1873,7 @@ bool CEdit::ReadText(const char *filename, int addSize) m_len = j; m_imageTotal = iIndex; - delete buffer; + delete[] buffer; Justif(); ColumnFix(); @@ -3320,8 +3320,8 @@ bool CEdit::SetFormat(int cursor1, int cursor2, int format) for ( i=cursor1 ; i