statusbar 显示 toolbar的text

小呆呆呆 2011-09-27 11:09:58
我现在有个程序,当我鼠标移动到tool bar上面时候,status bar的text改为tool bar的text.

ON_UPDATE_COMMAND_UI (ID_INDICATOR_TIME, OnUpdateTime)
上面的函数我也没找到, 请问是如何做到的?
...全文
81 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Eleven 2011-09-27
  • 打赏
  • 举报
回复
主要都是框架类的功劳,F11进入CFrameWnd类的
WM_SETMESSAGESTRING消息响应函数

LRESULT CFrameWnd::OnSetMessageString(WPARAM wParam, LPARAM lParam)
{
UINT nIDLast = m_nIDLastMessage;
m_nFlags &= ~WF_NOPOPMSG;

CWnd* pMessageBar = GetMessageBar();
if (pMessageBar != NULL)
{
LPCTSTR lpsz = NULL;
CString strMessage;

// set the message bar text
if (lParam != 0)
{
ASSERT(wParam == 0); // can't have both an ID and a string
lpsz = (LPCTSTR)lParam; // set an explicit string
}
else if (wParam != 0)
{
// map SC_CLOSE to PREVIEW_CLOSE when in print preview mode
if (wParam == AFX_IDS_SCCLOSE && m_lpfnCloseProc != NULL)
wParam = AFX_IDS_PREVIEW_CLOSE;

// get message associated with the ID indicated by wParam
GetMessageString(wParam, strMessage);
lpsz = strMessage;
}
pMessageBar->SetWindowText(lpsz);

// update owner of the bar in terms of last message selected
CFrameWnd* pFrameWnd = pMessageBar->GetParentFrame();
if (pFrameWnd != NULL)
{
pFrameWnd->m_nIDLastMessage = (UINT)wParam;
pFrameWnd->m_nIDTracking = (UINT)wParam;
}
}

m_nIDLastMessage = (UINT)wParam; // new ID (or 0)
m_nIDTracking = (UINT)wParam; // so F1 on toolbar buttons work
return nIDLast;
}
小呆呆呆 2011-09-27
  • 打赏
  • 举报
回复
xiexie ni
古都一猿 2011-09-27
  • 打赏
  • 举报
回复
不是这样子的 你打开你的工程到资源里找到工具条 比如工具条的ID是ID_TOOLBAR1,打开它的属性下面不是有个“提示”嘛,输入“工具条\n工具条” “\n”前面的部分是你鼠标放到工具条按钮上显示的内容,后面就是你状态栏显示的内容啦
Introduction Introduction 7 Organization of This Document 7 Chapter 1 Key iPad Features and Characteristics 9 iPad Device Characteristics 9 New UI Elements and Behaviors 10 Chapter 2 From iPhone Application to iPad Application 11 Design Strategies for Translating Your iPhone Application 11 Case Study: From Mail on iPhone to Mail on iPad 12 Chapter 3 iPad User Experience Guidelines 17 Aim to Support All Orientations 17 Enhance Interactivity (Don’t Just Add Features) 19 Flatten Your Information Hierarchy 19 Reduce Full-Screen Transitions 22 Enable Collaboration and Connectedness 22 Add Physicality and Heightened Realism 23 Delight People with Stunning Graphics 24 De-emphasize User Interface Controls 25 Minimize Modality 25 Rethink Your Lists 25 Consider Multifinger Gestures 26 Consider Popovers for Some Modal Tasks 26 Restrict Complexity in Modal Tasks 27 Downplay File-Handling Operations 28 Ask People to Save Only When Necessary 28 Migrate Toolbar Content to the Top 29 Start Instantly 30 Always Be Prepared to Stop 31 Create Custom Icons 31 Create a Beautiful Application Icon 31 Create an Icon for Spotlight Search Results 33 Create a Settings Icon (if You Supply Settings) 33 Provide a Custom Document Icon 33 Create a Launch Image for Each Orientation 35 Follow Established Principles 36 3 2010-05-07 | © 2010 Apple Inc. All Rights Reserved. Chapter 4 iPad UI Element Guidelines 37 Bars 37 The Status Bar 37 Navigation Bar 38 Tab Bar 40 Toolbar 41 Content Views 41 Popover 42 Split View 44 Text View 46 Controls 46 Date and Time Picker, Picker 46 Info Button 47 Page Indicator 47 Search Bar 48 Segmented Control 48 Action Sheets, Alerts, and Modal Views 50 Action Sheet 50 Alert 51 Modal View 52 Edit Menu Additions 53 Keyboard Customization 53 Document Revision History 55

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧