MGR: Fix sizes of task panes and buttons, ellipsing button text if needed

svn path=/trunk/boinc/; revision=25149
This commit is contained in:
Charlie Fenton 2012-01-25 12:18:43 +00:00
parent ed49749bae
commit 8f1069ed4e
1 changed files with 2 additions and 4 deletions

View File

@ -188,9 +188,8 @@ wxInt32 CBOINCTaskCtrl::UpdateControls() {
if (!pItem->m_pButton) {
pItem->m_pButton = new wxButton;
pItem->m_strNameEllipsed = pItem->m_strName;
pItem->m_pButton->Create(this, pItem->m_iEventID, wxEmptyString, wxDefaultPosition, wxSize(TASKBUTTONWIDTH, -1), 0);
EllipseStringIfNeeded(pItem->m_strNameEllipsed, pItem->m_pButton);
pItem->m_pButton->SetLabel(pItem->m_strNameEllipsed);
pItem->m_pButton->Create(this, pItem->m_iEventID, pItem->m_strNameEllipsed, wxDefaultPosition, wxSize(TASKBUTTONWIDTH, -1), 0);
pItem->m_pButton->SetHelpText(pItem->m_strDescription);
#if wxUSE_TOOLTIPS
pItem->m_pButton->SetToolTip(pItem->m_strName + wxT(": ") + pItem->m_strDescription);
@ -254,8 +253,7 @@ bool CBOINCTaskCtrl::OnRestoreState(wxConfigBase* pConfig) {
void CBOINCTaskCtrl::EllipseStringIfNeeded(wxString& s, wxWindow *win) {
int w, h;
wxSize sz = win->GetSize();
int maxWidth = sz.GetWidth() - 10;
int maxWidth = TASKBUTTONWIDTH - 10;
win->GetTextExtent(s, &w, &h);