Reputation: 5827
I need to design a Task Manager, not like windows task manager, but a more generic one.
like "i should take my kid to school" kind of task.
So, i need to design an appropriate scalable gui ? (in the future there might be hundreds of tasks)
Can someone suggest a place/app to look at ?
in addition, and on related subject : I opened Mfc resource editor, and was trying to add columns to a list box, but couldn't find a way. is there a nice way to do it without writing code ?
Thanks
Upvotes: 0
Views: 551
Reputation: 4476
Adding columns to a listbox must be done in the code. For example, in your InitDialog()
, or OnCreate()
, or some other override, call list.InsertColumn(...)
to add new columns. It's described very well in the MSDN help for CListCtrl
.
Upvotes: 0
Reputation: 490583
There's one example on CodeProject.
You make a list box multicolumn simply by clicking the "multicolumn" property. I'd guess what you really want is a list control in report mode, in which case you do need to add the second (and subsequent) columns using code.
Upvotes: 0
Reputation: 308520
Not sure where to point you for generic GUI design, but I can help with the specific list box question. No, there's no way to add columns in the resource editor. Here's some crude code I recently did to make it easier:
void CMyDlg::AddColumn(LPCTSTR pszHeading, int iWidth, int nFormat)
{
VERIFY(m_wndList.InsertColumn(m_iNextColumn, pszHeading, nFormat, iWidth, -1) == m_iNextColumn);
++m_iNextColumn;
}
void CMyDlg::AddItem()
{
m_wndList.InsertItem(m_iItemCount, _T(""));
m_iNextColumn = 0;
++m_iItemCount;
}
void CMyDlg::SetNextColumn(LPCTSTR pszText)
{
m_wndList.SetItemText(m_iItemCount - 1, m_iNextColumn, pszText);
++m_iNextColumn;
}
Upvotes: 0