简体   繁体   English

手工编码的GUI应用程序设计和可视化

[英]Handcoded GUI application Design & Visualization

We've tools like Netbeans/Visual studio to do the GUI app for our project in java/C#. 我们拥有Netbeans / Visual Studio之类的工具,可以在Java / C#中为我们的项目执行GUI应用程序。 But when we're creating apps by writing code on Text-editor/IDE without using components. 但是,当我们通过在文本编辑器/ IDE上编写代码而不使用组件来创建应用程序时。 then how to visualize the GUI app project ? 然后如何可视化GUI应用程序项目? I mean let's say i want to build a contact manager app in C#/java. 我的意思是说我想用C#/ java构建联系人管理器应用程序。 now with GUI builder tools i can manage multiple files but with hardcoding i've to think about every file seperatley. 现在,使用GUI构建器工具,我可以管理多个文件,但是通过硬编码,我必须考虑每个文件的分隔符。

Now How one should visualize the project and go working on it ? 现在该如何可视化该项目并继续进行呢? What design programmer need to keep in mind ? 设计程序员需要记住什么?

In the past there were no RAD tools like Delphi and VB (and later C#), so there were object oriented or non-OO frameworks to build screens only using code. 在过去,没有像Delphi和VB(以及后来的C#)这样的RAD工具,因此存在面向对象的框架或非OO框架,仅使用代码即可构建屏幕。

I specifically remember Borland Turbo Pascal's object based text UI, where to create a dialog you had to inherit from TDialog and fill its OnDraw manually with which components to create and where to place them, and give them their callbacks to OnClick etc in runtime. 我特别记得Borland Turbo Pascal基于对象的文本UI,在其中创建您必须从TDialog继承的对话框并手动填充其OnDraw以及要创建的组件以及在何处放置它们,并在运行时将它们的回调传递给OnClick等。

I'm not sure why you ask your question, because I would certainly recommend using a RAD tool. 我不确定为什么要问您的问题,因为我当然建议您使用RAD工具。 However if you must create everything manually, you can certainly do so. 但是,如果必须手动创建所有内容,则可以这样做。

In this case I would recommend creating a separate file and class for each dialog, and holding a logic manager to create all the screens as you wish. 在这种情况下,我建议为每个对话框创建一个单独的文件和类,并持有一个逻辑管理器来根据需要创建所有屏幕。 You will probably also need a "main screen" that will contain all the rest, which would probably be the first one to be created by that logical manager. 您可能还需要一个“主屏幕”,其中将包含所有其余屏幕,这可能是该逻辑管理器创建的第一个屏幕。

I hope that helps. 希望对您有所帮助。

This depends on the library you're using, and the widgets provided... Some provide layout classes that allow putting other control in them in an ordered manner, while others don't. 这取决于您正在使用的库以及提供的小部件...有些提供了布局类,这些类允许按顺序将其他控件放入其中,而另一些则没有。

You need a convention in naming your files/classes/methods/functions, so that they are consistent across files. 在命名文件/类/方法/函数时,需要一个约定,以便它们在文件之间保持一致。 This will ease using something from one file in another file. 这样可以轻松地将一个文件中的内容用于另一个文件中。

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

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