diff --git a/checkin_notes b/checkin_notes
index 614a4113d5..1ff5de4e7d 100644
--- a/checkin_notes
+++ b/checkin_notes
@@ -9214,3 +9214,9 @@ Charlie 21 Dec 2011
clientgui/
ProjectInfoPage.cpp,.h
+
+Charlie 21 Dec 2011
+ - MGR: Fix horizontal sizing of text in Simple View project description.
+
+ clientgui/
+ sg_TaskPanel.cpp,.h
diff --git a/clientgui/sg_TaskPanel.cpp b/clientgui/sg_TaskPanel.cpp
index ae2d152713..3d4c102083 100755
--- a/clientgui/sg_TaskPanel.cpp
+++ b/clientgui/sg_TaskPanel.cpp
@@ -31,7 +31,8 @@
#define SLIDESHOWBORDER 3
#define DESCRIPTIONSPACER 4
#define HIDEDEFAULTSLIDE 1
-#define TESTALLDESCRIPTIONS 0
+#define TESTALLDESCRIPTIONS 1
+#define SCROLLBARWIDTH 18
enum { suspendedIcon, waitingIcon, runningIcon };
@@ -49,8 +50,6 @@ CScrolledTextBox::CScrolledTextBox() {
CScrolledTextBox::CScrolledTextBox( wxWindow* parent) :
wxScrolledWindow( parent, ID_SGPROJECTDESCRIPTION, wxDefaultPosition, wxDefaultSize, wxVSCROLL)
{
- m_iAvailableWidth = 296; // This will be overwritten
-
SetForegroundColour(*wxBLACK);
m_TextSizer = new wxBoxSizer( wxVERTICAL );
@@ -68,7 +67,7 @@ CScrolledTextBox::~CScrolledTextBox() {
void CScrolledTextBox::SetValue(const wxString& s) {
- int lineHeight, totalLines;
+ int lineHeight, totalLines, availableWidth;
wxString t = s;
// Delete sizer & its children (CTransparentStaticText objects)
@@ -77,17 +76,10 @@ void CScrolledTextBox::SetValue(const wxString& s) {
// Change all occurrences of "n" to "^n"
t.Replace(wxT(""), wxT("^"), true);
t.Replace(wxT(""), wxT(""), true);
- wxString tt = t;
-
- // First, determine if scroll bars needed so sizer can recompute
- totalLines = Wrap(tt, m_iAvailableWidth, &lineHeight);
- m_TextSizer->FitInside(this);
- // Now get the actual client size with or without scroll bars
- GetClientSize(&m_iAvailableWidth, &lineHeight);
- m_TextSizer->Clear(true); // Delete sizer & its children
-
- totalLines = Wrap(t, m_iAvailableWidth - 3, &lineHeight);
+ wxSize taskPanelSize = GetGrandParent()->GetSize();
+ availableWidth = taskPanelSize.GetWidth() - (2*SIDEMARGINS);
+ totalLines = Wrap(t, availableWidth - SCROLLBARWIDTH, &lineHeight);
m_TextSizer->FitInside(this);
SetScrollRate(1, lineHeight);
diff --git a/clientgui/sg_TaskPanel.h b/clientgui/sg_TaskPanel.h
index eb12b3b367..69ef820ccd 100755
--- a/clientgui/sg_TaskPanel.h
+++ b/clientgui/sg_TaskPanel.h
@@ -58,7 +58,6 @@ class CScrolledTextBox : public wxScrolledWindow
void OnOutputLine(const wxString& line);
wxBoxSizer* m_TextSizer;
- int m_iAvailableWidth;
int m_iAvailableHeight;
bool m_eol;
wxString m_text;