[英]Gui Design Help - MFC
I need to design a Task Manager, not like windows task manager, but a more generic one. 我需要设计一个任务管理器,不像Windows任务管理器,而是一个更通用的任务管理器。
like "i should take my kid to school" kind of task. 像“我应该带我的孩子上学”这样的任务。
So, i need to design an appropriate scalable gui ? 因此,我需要设计适当的可扩展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. 此外,还有一个相关主题:我打开了Mfc资源编辑器,并试图将列添加到列表框中,但找不到方法。 is there a nice way to do it without writing code ?
有没有写代码的好方法吗?
Thanks 谢谢
Not sure where to point you for generic GUI design, but I can help with the specific list box question. 不确定要为通用GUI设计指向何处,但是我可以帮助您解决特定的列表框问题。 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;
}
There's one example on CodeProject. 在CodeProject上有一个示例 。
You make a list box multicolumn simply by clicking the "multicolumn" property. 您只需单击“ multicolumn”属性即可使列表框成为多列。 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.
我猜您真正想要的是报表模式下的列表控件,在这种情况下,您确实需要使用代码添加第二(和后续)列。
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. 例如,在您的
InitDialog()
或OnCreate()
或其他替代项中,调用list.InsertColumn(...)
以添加新列。 It's described very well in the MSDN help for CListCtrl
. MSDN帮助
CListCtrl
进行了很好的描述。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.