使用ObjectARX2015开发类似outlook浮动面板窗格

上传人:d****1 文档编号:201895738 上传时间:2023-04-21 格式:DOCX 页数:27 大小:201.76KB
收藏 版权申诉 举报 下载
使用ObjectARX2015开发类似outlook浮动面板窗格_第1页
第1页 / 共27页
使用ObjectARX2015开发类似outlook浮动面板窗格_第2页
第2页 / 共27页
使用ObjectARX2015开发类似outlook浮动面板窗格_第3页
第3页 / 共27页
资源描述:

《使用ObjectARX2015开发类似outlook浮动面板窗格》由会员分享,可在线阅读,更多相关《使用ObjectARX2015开发类似outlook浮动面板窗格(27页珍藏版)》请在装配图网上搜索。

1、使用0bjectARX2015开发类似outlook浮动面板窗格开发步骤如下:1建立新项目,基于 MFC 类项目P *胆GE炖严t Ei DkicOilflJi+* SfldilrixppW KMRX -n善星叫心愎旳DI_B SB WPjlRdLTUSE (502添加基于 arx 类库的浮动对话框类,添加完后,会自动生成 DockControlBar 和 DockControlBarChildDlg 文件。11H .SL1, E皿假 lAkRMlY fiFTEE. MnulEXr IliC.iE*l.h. : hcljrrrisen rf ihi LkdtGniEDLBaECbiLdEilc

2、&e9?Ms sc R-Mrrl也ll-etxl- 4? 口 BPUUJ UIB 雲因 itniw flni IK-h BslsiN-alMu E?rE3nS3 Mm3 Sa- 9.3 Hvw- S3 S3- ptwKD 3 Hni i?3 -T -SB 日s*iyn,菁SUCJUeEfc 0?-s-t9111fEJEr 更 rlvn:w tDdcLCa.mlirN-dDab-&xDEi-d!E!htlFra:RlpEF:Fm 3-jE From rlwE2斤 号ftFMuIM*VPJ_STRUCTURE - Mitrasaft Visual Sludia直理SCto Siii 15!E|V)

3、项目 生也回 fflStZDi SIP,(M1 工Sill HliJt(5; (J欝枸(g 逊f(UD Z|(W|Q -33 -窪IHGY * 卜植 Window 洞證-口 动、Debug ” Win32幣咖旦I隹DockCei B DackConhralBar.hG Qo-ckCtmlrcd BarCh ild Dlg.hl因 My_SubFuncfions.hPEi ResaurcE.h因 StdAfx.hJ国舷件&* acrxEntryPointcppl性 DacDara.cpoI* Da-ckConlrol Bair.cppl料* DcKkConhroJ BaK-h ild Dlg.q

4、pi 怦 StdAFK.cppkWJ_STRUCriJRExpipp黑*$ C1as.EDiagifam.cdReadM e.txtLQD%/ that boih ihai copyEi-gJit notice arid 七hr Liziited wacEBtry bticI/ rertrirt亡白 rijhts rioticr below appear in all swportiriF / dijcurierrtstLork/ AUTWESK PROVIDES MIS PKWFJai 佃 IStf AMD WIIH ALL FAULTS./ AUTODESK SPECIFICALLY DI

5、SCLAIMS AW? IMFLIEIi WARRAWTY OF/ JIERCHAIITAEILrrf OE FILHESE FOK A PAKTrQlLAE USE. AUTOE IW:./ ICES DOT 也EEAMT THAT IHE OPERATION OF IHE PROGRAM WILL BE/ iwinrERMiprEi| ok erfof free./ UsCj dup Heart iconj Df disclDruf e by the U. S. GDve-nrtnmt is rubjert to / lestiictLCiris set focth iri FAE 52.

6、 227-15 (CDTUiBtcial CDiiputBC/ Soflvuie 一 Krs-tiicted Rights) and DFAK Z5Z. ZZ77D13(e) (1) (ii) / (Eights: in Technical Data and Coiiputer SoftwareJj sb sriplicable, /3在 DockControlBarChildDlg 设置 CMFCOutlookBar 和 CTreeCtrl 变量函数。TURE kioTOHiTfe Viiud 1k刑牌肖!R地 4dkEJ 赠亞 SG MdHJ 4*Hd应-3 ID El ArasjWta

7、匚 Ctf MJ HlPt 命 0 - tf O肝 如冃市刖嘴BZmi+3P -H 金齐饶-Apj_4TftucruE- a* w#j rwoum *昭拆 a CcpzOala h 由 CKkCdHraiaM.h &EndLanirniawChdd3t|ji卜 A Mj-.SufcftrctkmJ & Rewtrn-h &SidAhJi * PCnfEwry円此nep 卜 * Enfuuxppb DiKarlmldw-.tppn先 CDockC氓=4备hidC*gDDdhtcWHHHIHg.hipc* 口叶口 IBrCHdHn.rpFjmctrrnriilxpppiLlic:CDBEiaUEd

8、dlKOu.EL(W 亠严口i TUiClEttCid 扎 AdtL:.!.rX R VCTr-i- rl _mdFebh2:/fill:iZti q-:LLjc TratkL: |ptnectitdi inir:erBl VlEEUhLK4- CrZ-suardGu. LTJUUI 巧亠RKMro4ihHE 1f 毎k*orin闹呎2直1中代PI* MdNipp片 VJJTRuCKEjcpp% 口aitCiH屮inv=dpcrtcqrdifc.fcre._rfr.wi md CvMsLClk-Ti-H-(NIIK-f fIMiRj 1JUS1L pfistrail) 洽 片璋 wad CY4

9、nLC3iTMi匚4石 LIE池址曲iTO.vc.c ixai OiihLCUtEiB24 ; pCiMiKTVdiWCLttE单诙 EJUfdpiLlic:MlEEUhL DM. OnInlcDjjd.ECreate (acedGetAcadFrame (), My title bar);/pInstance-EnableDocking (CBRS_ALIGN_ANY);/pInstance-RestoreControlBar ();/static CLSID clsCDockControlBar = 0xeab78c04, 0x2194, 0x47ad, 0xa4, 0xf2, 0xad,

10、 0xca, 0x3e, 0x3b, 0xb6, 0x3c;/CDockControlBar:CDockControlBar () : CAcUiDockControlBar。mChildDlg = NULL;/CDockControlBar:CDockControlBar () /#ifdef _DEBUG/- Please uncomment the 2 following lines to avoid linker error when compiling/- in release mode. But make sure to uncomment these lines only onc

11、e per project/- if you derive multiple times from CAdUiDockControlBar/CAcUiDockControlBar/- classes./void CAdUiDockControlBar:AssertValid () const /#endif/ BOOL CDockControlBar:Create (CWnd *pParent, LPCTSTR IpszTitle) CString strWndClass ;strWndClass =AfxRegisterWndClass (CS_DBLCLKS, LoadCursor (NU

12、LL, IDC_ARROW);CRect rect (0, 0, 150, 200);if (!CAcUiDockControlBar:Create (strWndClass, lpszTitle, WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN, rect, pParent, 0)return (FALSE);SetToolID (&clsCDockControlBar);/ TODO: Add your code herereturn (TRUE);/This member function is called when an application req

13、uests the window be/created by calling the Create or CreateEx member functionint CDockControlBar:OnCreate (LPCREATESTRUCT lpCreateStruct) if ( CAcUiDockControlBar:OnCreate (lpCreateStruct) = -1 )return (-1);/Point to our resourceCAcModuleResourceOverride resourceOverride;/Create it and set the paren

14、t as the dockctrl barmChildDlg = new CDockControlBarChildDlg;mChildDlg-Create (IDD_DOCKCONTROLBAR, this);/Move the window over so we can see the control linesmChildDlg-MoveWindow (0, 0, 150, 100, TRUE);return (0);/void CDockControlBar:SizeChanged (CRect *lpRect, BOOL bFloating, int flags) / If valid

15、if (:IsWindow (mChildDlg-GetSafeHwnd ()/Always point to our resource to be safeCAcModuleResourceOverride resourceOverride ;/Then update its window size relativelymChildDlg-SetWindowPos (this, lpRect-left + 4, lpRect-top + 4, lpRect-Width (), lpRect-Height (), SWP_NOZORDER);/CSize CDockControlBar:Cal

16、cFixedLayout( BOOL bStretch , BOOL bHorz )如果当前处于浮动状态if (IsFloating()CRect m_rl;GetClientRect(m_rl);m_childDlg-SetWindowPos (this, m_rl.left+2, m_r1.top, m_rl.Width (), m_rl.Height (),SWP_NOZORDER);return CSize(150,450);else 处于固定状态return CSize(150,450);/ Function called when user selects a command fr

17、om Control menu or when user/selects the Maximize or the Minimize button.void CDockControlBar:OnSysCommand (UINT nID, LPARAM lParam) CAcUiDockControlBar:OnSysCommand (nID, lParam);/The framework calls this member function after the windows size has changedvoid CDockControlBar:OnSize (UINT nType, int

18、 cx, int cy) CAcUiDockControlBar:OnSize (nType, cx, cy);/ If validif (:IsWindow (mChildDlg-GetSafeHwnd ()/Always point to our resource to be safeCAcModuleResourceOverride resourceOverride ;/then update its window position relativelymChildDlg-MoveWindow (0, 0, cx, cy); void CDockControlBar:OnClose()

19、/ TODO: Add your message handler code here and/or call default if (mChildDlg != NULL)DestroyWindow();CAcUiDockControlBar:OnClose();DockCon trolBarCh il dDlg.h/ (C) Copyright 2002-2007 by Autodesk, Inc./ Permission to use, copy, modify, and distribute this software in/ object code form for any purpos

20、e and without fee is hereby granted,/ provided that the above copyright notice appears in all copies and/ that both that copyright notice and the limited warranty and/ restricted rights notice below appear in all supporting/ documentation./ AUTODESK PROVIDES THIS PROGRAM AS IS AND WITH ALL FAULTS./

21、AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF/ MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC./ DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE/ UNINTERRUPTED OR ERROR FREE./ Use, duplication, or disclosure by the U.S. Government is subject to/ restrictions set f

22、orth in FAR 52.227-19 (Commercial Computer/ Software - Restricted Rights) and DFAR 252.227-7013(c)(l)(ii)/ (Rights in Technical Data and Computer Software), as applicable./DockControlBarChildDlg.h : Declaration of the CDockControlBarChildDlg/#pragma once/#include acui.h/ class CDockControlBarChildDl

23、g : public CAcUiDialog DECLARE_DYNAMIC (CDockControlBarChildDlg)public:CDockControlBarChildDlg (CWnd *pParent =NULL, HINSTANCE hInstance =NULL); enum IDD = IDD_DOCKCONTROLBAR;public:CMFCOutlookBarm_wndOutlookBar;/CMFCOutlookBarPane m_wndOutlookPane;CTreeCtrl m_wndTree; 结构分析CTreeCtrl m_wndTreel; 工具箱C

24、TreeCtrl m_wndTree2; 绘图CImageList Treelist;protected:virtual void DoDataExchange (CDataExchange *pDX);virtual BOOL OnCommand (WPARAM wParam, LPARAM lParam);protected:afx_msg LRESULT OnAcadKeepFocus (WPARAM wParam, LPARAM lParam);afx_msg void OnDblClkTree(NMHDR* pNMHDR, LRESULT* pResult);afx_msg void

25、 OnDblClkTree1(NMHDR* pNMHDR, LRESULT* pResult);afx_msg void OnDblClkTree2(NMHDR* pNMHDR, LRESULT* pResult);protected:DECLARE_MESSAGE_MAP()public:virtual BOOL OnInitDialog();BOOL CreateTreeControl();BOOL CreateTreeControl1();BOOL CreateTreeControl2();DockControlBarChildDlg.cpp/ (C) Copyright 2002-20

26、07 by Autodesk, Inc./ Permission to use, copy, modify, and distribute this software in/ object code form for any purpose and without fee is hereby granted,/ provided that the above copyright notice appears in all copies and/ that both that copyright notice and the limited warranty and/ restricted ri

27、ghts notice below appear in all supporting/ documentation./ AUTODESK PROVIDES THIS PROGRAM AS IS AND WITH ALL FAULTS./ AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF/ MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC./ DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE/

28、 UNINTERRUPTED OR ERROR FREE./ Use, duplication, or disclosure by the U.S. Government is subject to/ restrictions set forth in FAR 52.227-19 (Commercial Computer/ Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)/ (Rights in Technical Data and Computer Software), as applicable./- DockCon

29、trolBar.cpp : Implementation of CDockControlBarChildDlg/#include StdAfx.h#include resource.h#include DockControlBarChildDlg.h#include My_SubFunctions.h/#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE = _FILE_;#endif/IMPLEMENT_DYNAMIC (CDockControlBarChildDlg, CAcUiDialog)BEGI

30、N_MESSAGE_MAP(CDockControlBarChildDlg, CAcUiDialog)AFX_MSG_MAP(CDockControlBarChildDlg)ON_MESSAGE(WM_ACAD_KEEPFOCUS, OnAcadKeepFocus) / Needed for modeless dialog.AFX_MSG_MAPON_NOTIFY(NM_DBLCLK, ID_VIEW_TASKPANE_CTREE, OnDblClkTree)ON_NOTIFY(NM_DBLCLK, ID_VIEW_TASKPANE_CTREE1, OnDblClkTree1)ON_NOTIF

31、Y(NM_DBLCLK, ID_VIEW_TASKPANE_CTREE2, OnDblClkTree2)END_MESSAGE_MAP()/CDockControlBarChildDlg:CDockControlBarChildDlg (CWnd *pParent /*=NULL*/, HINSTANCE hInstance /*=NULL*/) : CAcUiDialog (CDockControlBarChildDlg:IDD, pParent, hInstance) AFX_DATA_INIT(CDockControlBarChildDlg)AFX_DATA_INIT/void CDoc

32、kControlBarChildDlg:DoDataExchange (CDataExchange *pDX) CAcUiDialog:DoDataExchange (pDX);AFX_DATA_MAP(CDockControlBarChildDlg)AFX_DATA_MAP/- Needed for modeless dialogs to keep focus./- Return FALSE to not keep the focus, return TRUE to keep the focusLRESULT CDockControlBarChildDlg:OnAcadKeepFocus (

33、WPARAM wParam, LPARAM lParam) return (TRUE);/- As this dialog is a child dialog we need to disable ok and cancelBOOL CDockControlBarChildDlg:OnCommand (WPARAM wParam, LPARAM lParam) switch ( wParam ) case IDOKcase IDCANCEL:return (FALSE);return (CAcUiDialog:OnCommand (wParam, lParam);BOOL CDockContr

34、olBarChildDlg:OnInitDialog()CAcUiDialog:OnInitDialog();/ TODO: Add extra initialization hereCMFCOutlookBarTabCtrl:EnableAnimation ();if (!m_wndOutlookBar.Create (_T(Shortcuts), this,CRect(0,0,150-5,450-30),ID_VIEW_OUTLOOKBAR, WS_CHILD I WS_VISIBLE I CBRS_LEFT)TRACE0(Failed to create outlook barn);re

35、turn FALSE;/ fail to createCMFCOutlookBarTabCtrl* pShortcutsBarContainer = DYNAMIC_DOWNCAST(CMFCOutlookBarTabCtrl, m_wndOutlookBar.GetUnderlyingWindow (); if (pShortcutsBarContainer = NULL)TRACEO(Cannot get outlook bar containern);return FALSE;if (!CreateTreeControl()TRACE0(Failed to create the cust

36、om windown); return -1;/ fail to createpShortcutsBarContainer-AddTab(&m_wndTree, _T(结构分析),0, FALSE);if (!CreateTreeControll()TRACE0(Failed to create the custom windown); return -1;/ fail to createpShortcutsBarContainer-AddTab(&m_wndTreel, _T(工具箱),1, FALSE);if (!CreateTreeControl2()TRACE0(Failed to c

37、reate the custom windown); return -1;/ fail to createpShortcutsBarContainer-AddTab(&m_wndTree2, _T(绘图),2, FALSE);return TRUE; / return TRUE unless you set the focus to a control/ EXCEPTION: OCX Property Pages should return FALSEBOOL CDockControlBarChildDlg:CreateTreeControl()Treelist.Create(16,16,IL

38、C_COLOR32IILC_MASK,0,0);Treelist.Add(:AfxGetApp()-LoadIconW(IDI_ICON_XY);Treelist.Add(:AfxGetApp()-LoadIconW(IDI_ICON_XY);CRect rectDummy (0, 0, 0, 0);const DWORD dwTreeStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;if(!m_wndTree.Create (dwTreeStyle, rectDummy, this,

39、 ID_VIEW_TASKPANE_CTREE)TRACEO(Failed to create the custom windown); return FALSE;m_wndTree.SetImageList (&Treelist, TVSIL_NORMAL);HTREEITEM tree;m_wndTree.ModifyStyle(NULL,TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS);tree=m_wndTree.InsertItem(_T(”结构静力计算),0,0); 0为项的图像在tree view控件的图像列表 中的索引。m_wnd

40、Tree.InsertItem(_T(矩阵位移法),l,l,tree);m_wndTree.Expand(tree,TVE_EXPAND); 必须反复调用,因为 tree直在变化。m_wndTree.RedrawWindow ();return TRUE;BOOL CDockControlBarChildDlg:CreateTreeControll()Treelist.Create(16,16,ILC_C0L0R32IILC_MASK,0,0);Treelist.Add(:AfxGetApp()-LoadIconW(IDI_ICON_XY);Treelist.Add(:AfxGetApp()-

41、LoadIconW(IDI_ICON_XY);CRect rectDummy (0, 0, 0, 0);const DWORD dwTreeStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;if(!m_wndTree1.Create (dwTreeStyle, rectDummy, this, ID_VIEW_TASKPANE_CTREE1)TRACE0(Failed to create the custom windown); return FALSE;m_wndTree1.SetI

42、mageList(&Treelist, TVSIL_NORMAL);HTREEITEM tree;m_wndTree1.ModifyStyle(NULL,TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS);tree=m_wndTree1.InsertItem(_T(钢结构),0,0); 0为项的图像在tree view控件的图像列表中的 索引。m_wndTree1.InsertItem(_T(截面特性),1,1,tree); m_wndTreel.Expand(tree,TVE_EXPAND); 必须反复调用,因为 tree直在变化。 m_wndT

43、reel.RedrawWindow ();return TRUE;BOOL CDockControlBarChildDlg:CreateTreeControl2()Treelist.Create(16,16,ILC_COLOR32IILC_MASK,O,O);Treelist.Add(:AfxGetApp()-LoadIconW(IDI_ICON_XY);Treelist.Add(:AfxGetApp()-LoadIconW(IDI_ICON_BROKEN);Treelist.Add(:AfxGetApp()-LoadIconW(IDI_ICON_COLUMN);Treelist.Add(:A

44、fxGetApp()-LoadIconW(IDI_ICON_QUALITY);Treelist.Add(:AfxGetApp()-LoadIconW(IDI_ICON_FUHAO);Treelist.Add(:AfxGetApp()-LoadIconW(IDI_ICON_CODE);Treelist.Add(:AfxGetApp()-LoadIconW(IDI_ICON_MEASURE);Treelist.Add(:AfxGetApp()-LoadIconW(IDI_ICON_TABLE);Treelist.Add(:AfxGetApp()-LoadIconW(IDI_ICON_SECTION

45、);Treelist.Add(:AfxGetApp()-LoadIconW(IDI_ICON_AREA);Treelist.Add(:AfxGetApp()-LoadIconW(IDI_ICON_HEIGHT);CRect rectDummy (0, 0, 0, 0);const DWORD dwTreeStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES |TVS_LINESATROOT | TVS_HASBUTTONS;if(!m_wndTree2.Create (dwTreeStyle, rectDummy, this, ID_VIEW_TASKPAN

46、E_CTREE2)TRACE0(Failed to create the custom windown);return FALSE;m_wndTree2.SetImageList(&Treelist,TVSIL_NORMAL);HTREEITEM treeXY,treeCode,treeMeasure;m_wndTree2.ModifyStyle(NULL,TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS);treeXY=m_wndTree2.InsertItem(_T(XY 图),0,0); 0为项的图像在tree view控件的图像列表中的 索

47、引。m_wndTree2.InsertItem(_T(折线图),1,1,treeXY);m_wndTree2.InsertItem(_T(柱状图),2,2,treeXY);m_wndTree2.InsertItem(_T (QC 缺陷统计图),3,3,treeXY);m_wndTree2.Expand(treeXY,TVE_EXPAND);treeCode=m_wndTree2.InsertItem(_T(符号),4,4); 0为项的图像在tree view控件的图像列表中的索引。m_wndTree2.InsertItem(_T(符号外框),5,5,treeCode);m_wndTree2.Expand(treeCode,TVE_EXPAND);treeMeasure=m_wndTree2.I

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!