1

In Turbo Pascal 7 for DOS you can use the Crt unit to define a window. If you define a second window on top of the first one, like a popup, I don’t see a way to get rid of the second one except for redrawing the first one on top again.

Is there a window close technique I’m overlooking?

I’m considering keeping an array of screens in memory to make it work, but the TP IDE does popups like I want to do, so maybe it’s easy and I’m just looking in the wrong place?

Keith
  • 230
  • 1
  • 4
  • 13
  • 1
    This is not trivial to do from scratch (i.e. using the `Crt` unit as a basis). However, there are several open source libraries that provide such functionality. One example is [Object Professional](https://sourceforge.net/projects/tpopro/). – 500 - Internal Server Error Nov 28 '19 at 17:38
  • I will definitely try that out, thank you! – Keith Nov 28 '19 at 17:47
  • 1
    @500-InternalServerError: I was about to suggest OPro, but its files seem to have been removed from SourceForge, unless I'm looking in the wrong place. The only place I could easily find which still has the files (incl the source of OPWindow.Pas, OpEntry.Pas, etc) is [this one](https://ia801600.us.archive.org/view_archive.php?archive=/34/items/ObjectProfessional1.14/Object%20Professional%201.14.zip) but I'm not sure about the legality of using it, tbh. – MartynA Nov 28 '19 at 17:48
  • In this case I would not worry about legality as the library was released to the public domain and the company that made it has been defunct for close to 20 years. – 500 - Internal Server Error Nov 28 '19 at 18:05
  • @500-InternalServerError: Not arguing, but my recollection is that TurboPower was bought and taken in-house by an Australian outfit who specialised in s/ware for casinos & similar. At the time I thought the pity of it was that they were a great bunch of guys at TPower (KK, BF, JB and SS). JB is now with Devex of course and SS pops into SO every now and again. – MartynA Nov 28 '19 at 18:25
  • 1
    Note that the Turbo Pascal IDE does not use Crt, but Turbo Vision – Marco van de Voort Nov 29 '19 at 06:40

1 Answers1

4

I don't think there's a window-closing technique you're missing, if you mean one provided by the CRT unit.

The library Borland used for the TP7 IDE was called TurboVision (see https://en.wikipedia.org/wiki/Turbo_Vision) and it was eventually released to the public domain, but well before that, a number of 3rd-party screen handling/windowing libraries had become available and these were much more powerful than what could be achieved with the CRT unit. Probably the best known was Turbopower Software's Object Professional (aka OPro).

Afaik, these libraries (and, fairly obviously TurboVision) were all based on an in-memory representation of a framed window which could be rapidly copied in and out of the PC's video memory and, as in Windows with a capital W, they were treated as a stack with a z-order. So the process or closing/erasing the top level window was one of getting the window(s) that it had been covering to re-draw itself/themselves. Otoh, CRT had basically evolved from v. primitive origins similar to, if not based on, the old DEC VT100 display protocol and wasn't really up to the job of supporting independent, stackable window objects.

Although you may still be able to track down the PD release of TurboVision, it never really caught on as a library for developers. In an ideal world, a better place to start would be with OPro. It was apparently on SoureForge for a while, but seems to have been taken down sometime since about 2007, and these days even if you could get hold of a copy, there is a bit of a question mark over licensing. However ...

There was also a very popular freeware library available for TP by the name of the "Technojock's toolkit" and which had a large functionality overlap (including screen handling) with OPro and it is still available on github - see https://github.com/lallousx86/TurboPascal/tree/master/TotLib/TOTSRC11. Unlike OPro, I never used TechnoJocks myself, but devotees swore by it. Take a look.

MartynA
  • 30,454
  • 4
  • 32
  • 73
  • IMHO this answer makes the question look like off topic, by only referring to 3rd party software... You can at least include a "no" in the first paragraph as a more direct answer. – Sertac Akyuz Nov 29 '19 at 14:41
  • 1
    @SertacAkyuz: Yes I was conscious of that when I wrote the answer, so I take your point. So I've added a bit of historical + technical info which I hope makes it clear that one could certainly build a windowing system on top of CRT, but would need to be rather a masochist and with a lot of time on one's hands to do so, when there is at least one ready-rolled solution still available. – MartynA Nov 29 '19 at 16:31
  • Thank you for your detailed answer. I’m glad I wasn’t missing something obvious in crt. – Keith Nov 30 '19 at 01:49
  • Only the C++ version of Turbo Vision was put in the public domain. The Pascal version was not afaik. Afaik the only "free" TP are older (<6) versions and the French version of TP7. FPC has a somewhat compatible Pascal version, but that is probably no longer TP compilable – Marco van de Voort Aug 30 '20 at 14:46
  • TP Object Professional was published on sf.net https://sourceforge.net/projects/tpopro/ – Marco van de Voort Jan 25 '21 at 12:05
  • @MarcovandeVoort A project for it was created on sf.net but as far as I can tell no files were ever added. So it looks like TP Object Professional was never actually open-sourced - just an empty project was created. Perhaps TurboPower intended to but for some reason found out they couldn't and forgot to delete the project. Or perhaps they just forgot to upload the files. Would certainly be nice to know which of the two it was and if an open-source release of it (and its predecessor Turbo Professional plus the other DOS stuff) could still be made. – davidg Oct 31 '21 at 22:30