CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  基础类

请问如何设置一个doc/view程序状态栏的内容?

楼主df8327(DF)2005-10-24 15:53:44 在 VC/MFC / 基础类 提问

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

相关问题

  • 程序中如何打开/关闭状态栏
  • 在程序的状态栏中加载位图的问题
  • 应用程序在状态栏上的问题
  • 程序怎么在状态栏中消失不了?
  • 如何在程序中实现将系统状态栏隐藏???
  • 怎样让程序最小化后到状态栏中?************************************************************************
  • 程序的状态栏和标题栏的文字怎么变
  • 如何在Dialog based的程序窗体上加上状态栏
  • 如何能让程序在最小化时进入状态栏?
  • 关于程序缩小到状态栏的菜单问题?

关键词

  • dc
  • wndstatusbar
  • getpaneinfo
  • nstyle
  • 字符串
  • setpaneinfo
  • 栏
  • gettextextent
  • nid
  • 宽度

得分解答快速导航

  • 帖主:df8327
  • teli_eurydice
  • jiangsheng

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo