请问如何设置一个doc/view程序状态栏的内容?
RT,高手请帮忙! 问题点数:20、回复次数:9Top
1 楼teli_eurydice(哭泣的仙人掌。。。。)回复于 2005-10-24 16:03:22 得分 10
//在状态条上显示保存进度条,jingzhou xu,2002.8.14
CMainFrame * pMainFrame = (CMainFrame *) AfxGetApp()->m_pMainWnd;
pMainFrame->m_wndStatusBar.GetItemRect(3,&rc);Top
2 楼teli_eurydice(哭泣的仙人掌。。。。)回复于 2005-10-24 16:04:59 得分 0
// 设置信息框属性: 第0栏
m_wndStatusBar.SetPaneInfo(0, 0, SBPS_STRETCH, 0);
// 确定坐标宽度: 第1栏
size = dc.GetTextExtent("X=88888888,Y=88888888 ", 54);
m_wndStatusBar.GetPaneInfo(1, nID, nStyle, nWidth); // 坐标栏
m_wndStatusBar.SetPaneInfo(1, nID, nStyle, size.cx);
// 确定显示比例宽度: 第2栏
size = dc.GetTextExtent("888,888,888", 14);
m_wndStatusBar.GetPaneInfo(2, nID, nStyle, nWidth); // 显示比例
m_wndStatusBar.SetPaneInfo(2, nID, nStyle, size.cx);
// 确定商标宽度: 第3栏
size = dc.GetTextExtent(" ");
m_wndStatusBar.GetPaneInfo(3, nID, nStyle, nWidth); // 开发商
m_wndStatusBar.SetPaneInfo(3, nID, nStyle, size.cx);
m_wndStatusBar.SetPaneText(3, " ");
// 确定日期宽度: 第4栏
size = dc.GetTextExtent("8888年88月88日");
m_wndStatusBar.GetPaneInfo(4, nID, nStyle, nWidth); // 日期栏
m_wndStatusBar.SetPaneInfo(4, nID, nStyle, size.cx);
// 确定时间宽度: 第5栏
size = dc.GetTextExtent("88:88:88上午");
m_wndStatusBar.GetPaneInfo(5, nID, nStyle, nWidth); // 时间栏
m_wndStatusBar.SetPaneInfo(5, nID, nStyle, size.cx);
if (hOldFont != NULL)
dc.SelectObject(hOldFont);
// ---------------- End: 处理状态条显示信息 ---------------- //
Top
3 楼df8327(DF)回复于 2005-10-25 09:57:46 得分 0
能不能说得简略一点
比如
我有一个菜单,我就想实现类似系统自带菜单“文件”-》“新建”
一样的功能
在状态栏显示一些东西
这个如何实现?
Top
4 楼jiangsheng(蒋晟.Net[MVP])回复于 2005-10-25 10:48:15 得分 0
在字符串表创建命令对应的字符串,参考http://msdn.microsoft.com/msdnmag/issues/03/11/CQA/default.aspx
如果你需要更新费默认的状态项,参考
http://msdn.microsoft.com/library/en-us/vccore/html/_core_Status_Bars.3a_.Updating_the_Text_of_a_Status.2d.Bar_Pane.aspTop
5 楼df8327(DF)回复于 2005-10-25 11:33:26 得分 0
还挺复杂
高手能给我大体上讲解一下原理么?Top
6 楼jiangsheng(蒋晟.Net[MVP])回复于 2005-10-25 11:40:15 得分 10
上面的文章讲得很清楚了Top
7 楼df8327(DF)回复于 2005-10-25 12:10:00 得分 0
Q I'm working on a project that has a long history. When we started, we implemented our own popup menus for various reasons. When tooltips came along, we added this functionality to our menus so that tooltips appear when the user holds the mouse over a menu item. This is important to our users because it explains why a menu item is disabled. As our users became more familiar with the world of Windows® they wanted to have menus that looked like the standard menus. Currently we use CMenu, but we have lost our excellent menu tooltips. How can we implement these in MFC?
这个是原文问题的引用,人家讲解的是tooltip老大!
我需要的是CStatusBar的设置Top
8 楼jiangsheng(蒋晟.Net[MVP])回复于 2005-10-25 12:32:37 得分 0
看最底下
看得不耐烦的话也可以查找\nTop
9 楼df8327(DF)回复于 2005-10-25 12:38:37 得分 0
对不起,我以为第一篇是我问题的全部答案呢
原来只是在字符串表创建命令对应的字符串的方法
我这个东西不太了解
不好意思Top




