简体   繁体   English

从资源实现对话框

[英]Implementing dialogs from resource

I'm currently trying to port an application from owl to vcl. 我目前正在尝试将应用程序从owl移植到vcl。

In my old projekt-file I was able to load dialogs with something like 在我原来的projekt文件中,我能够加载类似的对话框

TBatchAcDialog(TWindow* parent) : TAPDialog(parent, BATCH_DIALOG)

However, using TTaskDialog instead it doesn't support the second argument. 但是,使用TTaskDialog而不支持第二个参数。

I have found an explanation for the user interface designer that when rightclicking on a menu you can load the first declared menu from a rc-file. 我找到了一个用户界面设计器的解释,当右键单击菜单时,您可以从rc文件加载第一个声明的菜单。

However, I don't really know how to load those dialogs as dialogs in this IDE and linking them to my classes again. 但是,我真的不知道如何在这个IDE中将这些对话框作为对话框加载,并再次将它们链接到我的类。

Does anyone of you know about this or could link me to an article about a similar problem? 你们中有谁知道这个或者可以把我链接到一篇关于类似问题的文章吗? I seem to have failed finding a proper solution although implementing rc-dialogs seems to be a common problem to me. 我似乎找不到合适的解决方案,尽管实现rc对话似乎是我常见的问题。

C++Builder does not have any native functionality that wraps resource dialogs in classes. C ++ Builder没有任何包含类中资源对话框的本机功能。 You have to set that up manually in your own code if you need it. 如果需要,您必须在自己的代码中手动设置。 Otherwise, just use Win32 API functions like CreateDialog() when working with resource dialogs, or else redesign your UI to make use of VCL TForm windows instead of resource dialogs. 否则,在使用资源对话框时,只需使用Win32 API函数(如CreateDialog() ,或者重新设计UI以使用VCL TForm窗口而不是资源对话框。

TTaskDialog is not what you think it is. TTaskDialog不是你想象的那样。 It is just a wrapper for the Win32 API TaskDialogIndirect() function (Vista and later only), which is not related to what you are attempting to accomplish. 它只是Win32 API TaskDialogIndirect()函数(仅限Vista及更高版本)的包装器,与您尝试完成的操作无关。

I'm currently trying to port an application from owl to vcl. 我目前正在尝试将应用程序从owl移植到vcl。

What is your exact goal? 你的确切目标是什么? To be able to build the application with C++ Builder, or to use VCL instead of OWL? 能够使用C ++ Builder构建应用程序,还是使用VCL代替OWL?

If you want to use VCL for the dialogs, then you cannot port them, you need to rewrite all the UI from scratch, as VCL is very different from the standard Windows dialogs. 如果要将VCL用于对话框,则无法移植它们,需要从头开始重写所有UI,因为VCL与标准Windows对话框非常不同。

If you want just to build the application with C++ Builder, then you can do so by upgrading to OWLNext - it is an open-source upgrade for the OWL framework and works with the modern compilers like C++ Builder and Visual C++. 如果您只想使用C ++ Builder构建应用程序,那么您可以通过升级到OWLNext来实现 - 它是OWL框架的开源升级,可以与C ++ Builder和Visual C ++等现代编译器一起使用。 You can also use OWLNext for a gradual migration to VCL - as VCL and OWL can co-exist in the same application, so you can migrate your old OWL application to C++ Builder, write any new UI in VCL, and gradually rewrite the old UI in VCL - it might be easier and safer than rewriting the whole application with VCL. 您还可以使用OWLNext逐步迁移到VCL - 因为VCL和OWL可以在同一个应用程序中共存,因此您可以将旧的OWL应用程序迁移到C ++ Builder,在VCL中编写任何新UI,并逐步重写旧UI在VCL中 - 它可能比用VCL重写整个应用程序更容易,更安全。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM