menu

所属分类:菜单
开发工具:Visual C++
文件大小:3737KB
下载次数:3
上传日期:2009-11-09 13:17:08
上 传 者风清云淡
说明:  菜单的修改,添加,可实现菜单上附加文本框 选择框
(the programm is used to add menmu to the window,which conld be modified in the style the programmer liked, it is simple convinent and useful)

文件列表:
PopMenu\CHILDFRM.CPP (1493, 1999-01-23)
PopMenu\CHILDFRM.H (1403, 1999-01-23)
PopMenu\MAINFRM.CPP (2555, 1999-01-23)
PopMenu\MAINFRM.H (1550, 1999-01-23)
PopMenu\RESOURCE.H (1100, 1999-01-23)
PopMenu\STDAFX.CPP (201, 1999-01-23)
PopMenu\STDAFX.H (987, 1999-01-23)
PopMenu\Wzd.aps (35964, 2008-10-10)
PopMenu\WZD.CPP (4265, 1999-01-23)
PopMenu\WZD.H (1333, 1999-01-23)
PopMenu\WZD.RC (14587, 1999-01-23)
PopMenu\WZD5.DSP (4708, 1999-01-23)
PopMenu\WZD5.DSW (530, 1999-01-23)
PopMenu\WZD6.DSP (4821, 1999-01-23)
PopMenu\WZD6.DSW (530, 1999-01-23)
PopMenu\WZD6.ncb (91136, 2008-10-10)
PopMenu\WZD6.OPT (53760, 2008-10-10)
PopMenu\Wzd6.plg (241, 2008-10-10)
PopMenu\WZDDLG.CPP (1652, 1999-01-23)
PopMenu\WZDDLG.H (1193, 1999-01-23)
PopMenu\WZDDOC.CPP (1682, 1999-01-23)
PopMenu\WZDDOC.H (1450, 1999-01-23)
PopMenu\WZDVIEW.CPP (3442, 1999-01-23)
PopMenu\WZDVIEW.H (1974, 1999-01-23)
PopMenu\WIZARD (0, 2008-10-10)
PopMenu\RES\BITMAP1.BMP (2026, 1999-01-23)
PopMenu\RES\TOOLBAR.BMP (1078, 1999-01-23)
PopMenu\RES\WZD.ICO (1078, 1999-01-23)
PopMenu\RES\WZD.RC2 (395, 1999-01-23)
PopMenu\RES\WZDDOC.ICO (1078, 1999-01-23)
PopMenu\RES (0, 2008-10-10)
PopMenu\Debug\ChildFrm.obj (16372, 2008-10-10)
PopMenu\Debug\MainFrm.obj (19193, 2008-10-10)
PopMenu\Debug\StdAfx.obj (106060, 2008-10-10)
PopMenu\Debug\vc60.idb (214016, 2008-10-10)
PopMenu\Debug\vc60.pdb (364544, 2008-10-10)
PopMenu\Debug\Wzd.obj (23247, 2008-10-10)
PopMenu\Debug\Wzd.res (12932, 2008-10-10)
PopMenu\Debug\Wzd6.exe (131196, 2008-10-10)
... ...

///////////////////////////////////////////////////////////////////// // To Add a Menu... ///////////////////////////////////////////////////////////////////// // 1) Use the Menu Editor to create a new menu, or copy one from another // project. // // 2) Use the Dialog Editor to add this menu to your dialog app's template. // // 3) Use the ClassWizard to add command handlers to your dialog class. ///////////////////////////////////////////////////////////////////// // To Add a Toolbar... ///////////////////////////////////////////////////////////////////// // 1) Use the Toolbar Editor to create a new toolbar, or copy one from another // project. // // 2) Use the Dialog Editor to add a long skinny static control where you'd like // the toolbar to go in your dialog template. // // 3) Embed a CToolbar class variable in your dialog class: CToolbar m_wndToolBar; // 4) In the dialog class's OnInitDialog() message handler, create the toolbar // and position it inside the static control: if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) { TRACE0("Failed to create toolbar\n"); return -1; // fail to create } // move toolbar and status bar over static controls CRect rect; GetDlgItem(IDC_TOOLBAR_STATIC)->GetWindowRect(&rect); ScreenToClient(&rect); m_wndToolBar.MoveWindow(&rect); // 5) You must also manually update the status of these toolbars (gray them out, etc.) ///////////////////////////////////////////////////////////////////// // To Add a Status Bar... ///////////////////////////////////////////////////////////////////// // 1) Use the String Table Editor to define your status bar panes: ID_INDICATOR_ONE "xxx" ID_INDICATOR_TWO "yyy" // 2) Use the Dialog Editor to add a static control where you want your status // bar to appear in your dialog template. // 3) Embed a status bar control in your dialog class: CStatusBar m_wndStatusBar; // 4) Add a list of status pane definitions to the top of your dialog class: static UINT indicators[] = { ID_SEPARATOR, // status line indicator ID_INDICATOR_ONE, ID_INDICATOR_TWO, }; // 5) Create the status bar and position it over the static control: if (!m_wndStatusBar.Create(this,WS_CHILD|WS_VISIBLE|WS_BORDER) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT))) { TRACE0("Failed to create status bar\n"); return -1; // fail to create } GetDlgItem(IDC_STATUSBAR_STATIC)->GetWindowRect(&rect); ScreenToClient(&rect); m_wndStatusBar.MoveWindow(&rect); // 6) Indent the first status bar pane so that it shows: UINT nID,nStyle; int nWidth; m_wndStatusBar.GetPaneInfo(0, nID, nStyle, nWidth) ; m_wndStatusBar.SetPaneInfo(0, nID, SBPS_STRETCH, nWidth) ; // 7) You must now manually update the status panes in this bar. ///////////////////////////////////////////////////////////////////// // From: Visual C++ MFC Programming by Example by John E. Swanke // Copyright (C) 1999 jeswanke. All rights reserved. /////////////////////////////////////////////////////////////////////

近期下载者

相关文件


收藏者