使用类向导或其他一些方法创建从中子类化的选项卡。在对话框的属性中,将对话框的样式更改为“子项”,将边框更改为“调整大小”。实现覆盖。替换对话框的所有源文件中出现的所有项。对于选项卡扩展,删除已分配的选项卡对象(请参阅下面的示例)。CDialogPostNcDestroy()CDialogCAdUiTabExtensionPostNcDestroy() 在处理程序中添加调用中,其中 是应用程序的基本文件名,是要添加到的可扩展选项卡式对话框的已发布名称。AcRx::kInitAppMsgacrxEntryPoint()acedRegisterExtendedTab("MYAPPNAME.ARX", "DIALOGNAME")MYAPPNAMEDIALOGNAME 实现一个处理程序并在那里添加选项卡。论点是点。使用 member 函数以获取正在初始化的对话框的名称,如果应用程序要添加到此对话框,请调用 的成员函数来添加选项卡。如果对话框可调整大小,并且您希望调整某些控件的大小,请在调用 to 后添加调整大小代码。AcRx::kInitDialogMsgacrxEntryPoint()(void*)appIdacrxEntryPoint()CAdUiTabExtensionManagerGetDialogName()CAdUiTabExtensionManagerAddTab()CAdUiTabExtensionManagerAddTab() 例如: extern "C" AcRx::AppRetCode acrxEntryPoint( AcRx::AppMsgCode msg, void* appId) { switch (msg) { case AcRx::kInitAppMsg: acrxDynamicLinker->unlockApplication(appId); acrxDynamicLinker->registerAppMDIAware(appId); initApp(); break; case AcRx::kUnloadAppMsg: unloadApp(); break; case AcRx::kInitDialogMsg: // A dialog is initializing that we are interested in adding // tabs to. addMyTabs((CAdUiTabExtensionManager*)pkt); break; default: break; } return AcRx::kRetOK; } void initApp() { InitMFC(); // Do other initialization tasks here. acedRegCmds->addCommand( "MYARXAPP", "MYARXAPP", "MYARXAPP", ACRX_CMD_MODAL, &MyArxAppCreate); // Here is where we register the fact that we want to add // a tab to the Options dialog. acedRegisterExtendedTab("MYARXAPP.ARX", "OptionsDialog"); } // CMyTab1 is subclassed from CAcUiTabExtension. static CMyTab1* pTab1; void addMyTabs(CAdUiTabExtensionManager* pXtabManager) { // Allocate an extended tab if it has not been done already // and add it through the CAdUiTabExtensionManager. pTab1 = new CMyTab1; pXtabManager->AddTab(_hdllInstance, IDD_TAB1, "My Tab1", pTab1); // If the main dialog is resizable, add your control // resizing directives here. pTab1->StretchControlXY(IDC_EDIT1, 100, 100); } 然后,对于类实现:CMyTab1 void CMyTab1::PostNcDestroy() // Override to delete added tab. { delete pTab1; pTab1 = NULL; CAcUiTabExtension::PostNcDestroy(); } |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:17
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.