简体   繁体   English

windows命令提示符中的伪环境

[英]Pseudographical environment in windows Command Prompt

actually i'm thinking of creating a cool interface for my programming assignment , so i go around searching on how to do it so that such an effect can be create , below is the image .实际上我正在考虑为我的编程任务创建一个很酷的界面,所以我四处寻找如何做到这一点,以便可以创建这样的效果,下面是图像。

在此处输入图片说明

The Question问题

1.)What is needed in order to create a program that run pseudographic(semigraphic or whatever they called it) that has menu like BIOS wizard did??I always see some program run in console but it could have graphical-like looking , for example blue environment , and user can use keyboard to choose a list of setting in a menu. 1.) 创建一个运行伪图形(半图形或他们称之为什么)的程序需要什么,它有像 BIOS 向导那样的菜单?我总是看到一些程序在控制台中运行,但它可能具有类似图形的外观,因为例如蓝色环境,用户可以使用键盘在菜单中选择设置列表。

Thanks for spending time reading my question.感谢您花时间阅读我的问题。

It's called Text-based user interface.它被称为基于文本的用户界面。 There're several libraries for doing this.有几个库可以做到这一点。 I think this is what you're looking for.我想这就是你要找的。 :) Cross platform, Interactive text-based interface with command completion :) 跨平台、基于文本的交互式界面,带有命令完成功能

http://www.gnu.org/s/ncurses/ Ncurses(or maybe pdcurses) is probably what you need. http://www.gnu.org/s/ncurses/ Ncurses(或者可能是 pdcurses)可能就是你所需要的。

In the days of 16-bit Windows console windows used to support ANSI escape sequences (via the ansi.sys driver), but they no longer do.在 16 位 Windows 控制台窗口曾经支持 ANSI 转义序列(通过ansi.sys驱动程序)的时代,但它们不再支持。

For the apparent line graphics you need to use a platform specific solution anyway, so I recommend just writing an abstraction (functions, class) over the Windows APIs console functions .对于明显的线条图形,您无论如何都需要使用特定于平台的解决方案,因此我建议只在 Windows API 控制台函数上编写抽象(函数、类)。

The line graphics is done by using characters from the original IBM PC character set, codepage 437. At first you can just hardcode the various patterns.线条图形是通过使用原始 IBM PC 字符集代码页 437 中的字符完成的。首先,您可以对各种模式进行硬编码。 In order to make it seem more like line drawing to the code, or from the code's perspective, so to speak, you'll have to abstract things again.为了使它看起来更像是代码的线条绘制,或者从代码的角度来看,可以这么说,您将不得不再次抽象事物。 As I remember there is some partial but not complete system in the original codepage 437 character codes.我记得在原始代码页 437 字符代码中有一些部分但不完整的系统。 But for Windows console you will need to use the Unicode character codes, which probably do not preserve the original system, so perhaps just define a map where these graphics characters are placed more systematically.但是对于 Windows 控制台,您将需要使用 Unicode 字符代码,这可能不会保留原始系统,因此也许只需定义一个地图,在其中更系统地放置这些图形字符。

Possibly that already exists.可能已经存在了。

If you don't care about portability, the Windows API for this can be found here.如果您不关心可移植性,可以在此处找到用于此的 Windows API It will supply all the functions you need, without the need to pack additional libraries with your application.它将提供您需要的所有功能,而无需在您的应用程序中打包额外的库。

You can also look in to graphics.h, a non-standard Borland extension that a lot of older graphical games used to use.您还可以查看 graphics.h,这是许多较旧的图形游戏曾经使用的非标准 Borland 扩展。 It goes far beyond the normal limits of the console, but is only supported by 16 bit systems, of which Microsoft has all but removed support for from Windows.它远远超出了控制台的正常限制,但仅受 16 位系统支持,其中 Microsoft 几乎从 Windows 中删除了对这些系统的支持。 You'd also need an ancient Borland compiler, or an emulation, though you probably want the original look and feel.您还需要一个古老的 Borland 编译器或一个仿真器,尽管您可能想要原始的外观和感觉。

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

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