How do they Do It? - Onscreen list
How do they Do It? - Onscreen list
Hi All,
I have been watching a lot of viedos about old compters and software and I was wondering if someone could explain something for me
When a user shows a list (like pic below)
what happens to the information that was behind the list? does the app store it some where or just overrides it and re display the screen once the menu / list was done with???
and how would a list like above acutally get made (a basic sample code would helpful just so I could study it to understand how it works)
I ask as I am not sure what happens to the data would the software copy the screen and all the data into memory before displaying the list and how would the "text" boxes be made and handled (A lot to ask But I am really curious as to how it may have been done) I think once I understand how it would have been done in older software I should be able to impolite it in my application
I would be most grateful even if someone can show me a few website to read up on this "function" as I am totally new to this sort of interface (been using Visual basic for to long now)
I have been watching a lot of viedos about old compters and software and I was wondering if someone could explain something for me
When a user shows a list (like pic below)
what happens to the information that was behind the list? does the app store it some where or just overrides it and re display the screen once the menu / list was done with???
and how would a list like above acutally get made (a basic sample code would helpful just so I could study it to understand how it works)
I ask as I am not sure what happens to the data would the software copy the screen and all the data into memory before displaying the list and how would the "text" boxes be made and handled (A lot to ask But I am really curious as to how it may have been done) I think once I understand how it would have been done in older software I should be able to impolite it in my application
I would be most grateful even if someone can show me a few website to read up on this "function" as I am totally new to this sort of interface (been using Visual basic for to long now)
Re: How do they Do It? - Onscreen list
Wow a blast from the past. Remember the "exploding" pop ups where the window would kind of zoom in? Anyway, there were several BASIC routines back in the day for popping up menus like that. Many of them actually saved the contents of the character cells to a buffer for redrawing after the menu pop up was done. For any procedural system (not event-driven), this would probably be the way most would do it.
Another way to do it is just repaint (regenerate) the entire screen after the pop up was finished. I've done it this way before. With faster computers it is nearly imperceptible. In 1981, however, with slow BIOS screen printing, it would have been intolerably slow. Unix terminal-based programs would do this too, and on a slow terminal it would be noticeable as the pop up was slowly cleared away. But on a serial terminal that was really the only way to do it, since it's not possible to read the contents of the terminal's screen buffer (it's remote after all).
Another way to do it is just repaint (regenerate) the entire screen after the pop up was finished. I've done it this way before. With faster computers it is nearly imperceptible. In 1981, however, with slow BIOS screen printing, it would have been intolerably slow. Unix terminal-based programs would do this too, and on a slow terminal it would be noticeable as the pop up was slowly cleared away. But on a serial terminal that was really the only way to do it, since it's not possible to read the contents of the terminal's screen buffer (it's remote after all).
Re: How do they Do It? - Onscreen list
Yes, one of the reasons to use assembly in those days, writing straight to VRAM (on VGA card).caseih wrote:... however, with slow BIOS screen printing, it would have been intolerably slow.
Obviously, not well liked by MS: "... strongly discouraged ..." (in DOS manuals).
Re: How do they Do It? - Onscreen list
Turbo Vision, each object has a (virtual) method for drawing. Either entirely or a specific rectangle. It is up to the object if it caches or not. Usually there is a double buffering derivative of the base object, so if your window is too complex you just derive from that.
For modal popups, sometimes a complete copy of the screen is kept, but most systems don't do it, because old screens are often already outdated by then (e.g. many TV clones had a running clock in the bottom left corner, since there was no way to see the clock if you are in an application on dos, unless the app provides it)
These systems walk the window stack and try to minimize drawing. It works slightly different than e.g. ncurses based systems though.
The old systems are optimized for execution performance and will rather paint a few characters extra if its cheap (e.g. the code to figure out to exactly what to redraw is potentially more expensive than the drawing). While ncurses tries to optimize for minimal number of characters sent over the wire, even if it takes longer to calculate that.
For modal popups, sometimes a complete copy of the screen is kept, but most systems don't do it, because old screens are often already outdated by then (e.g. many TV clones had a running clock in the bottom left corner, since there was no way to see the clock if you are in an application on dos, unless the app provides it)
These systems walk the window stack and try to minimize drawing. It works slightly different than e.g. ncurses based systems though.
The old systems are optimized for execution performance and will rather paint a few characters extra if its cheap (e.g. the code to figure out to exactly what to redraw is potentially more expensive than the drawing). While ncurses tries to optimize for minimal number of characters sent over the wire, even if it takes longer to calculate that.
Re: How do they Do It? - Onscreen list
That is intresting. So when it generates the list would is populate the list at once or does it do it in stages? (As the user presses the up and down key)
-
- Posts: 862
- Joined: May 05, 2015 5:35
- Location: Germany
Re: How do they Do It? - Onscreen list
A simple example, quick & dirty (to be elaborated :-) ):
Code: Select all
Sub mask
Color 7, 1 'lt grey / blue
Cls
Print Chr(218); String(20, 196); Chr(194); String(10, 196); Chr(194); String(10, 196); Chr(194); String(10, 196); Chr(191)
For x As Integer = 1 To 20
Print Chr(179); String(20, " "); Chr(179); String(10, " "); Chr(179); String(10, " "); Chr(179); String(10, " "); Chr(179)
Next
Print Chr(192); String(20, 196); Chr(193); String(10, 196); Chr(193); String(10, 196); Chr(193); String(10, 196); Chr(217)
End Sub
Function popup As String
Dim As Integer itemhi, colrem = Color
Dim As String g
Dim As String itemlist(1 To ...) = {"1 - One", _
"2 - Two", _
"3 - Three", _
"4 - Four"}
itemhi = LBound(itemlist) 'select 1st item
Do
Color 7, 2 'lt grey / green
'draw popup box
Locate 10, 3
Print Chr(201); String(60, 205); Chr(187) 'top line
For x As Integer = 1 To 5
Locate CsrLin, 3
Print Chr(186); String(60, " "); Chr(186)
Next
Locate CsrLin, 3
Print Chr(200); String(60, 205); Chr(188) 'bottom line
'print items
For x As Integer = LBound(itemlist) To UBound(itemlist)
If itemhi = x Then
Color 2, 7 'highlight selected item
Else
Color 7, 2
EndIf
Locate 10 + x, 6
Print Left(itemlist(x) & String(30, " "), 30)
Next
Do
Select Case InKey
Case Chr(255, 72) 'up
If itemhi > LBound(itemlist) Then 'one item up
itemhi -= 1
Exit Do
EndIf
Case Chr(255, 80) 'down
If itemhi < UBound(itemlist) Then 'one item down
itemhi += 1
Exit Do
EndIf
Case Chr(13) 'return
Exit Do, Do
End Select
Loop
Loop
Color colrem And 16, (colrem Shr 16) And 16 'reset color
Return itemlist(itemhi) 'return selected item
End Function
Dim As String item = "none"
mask 'draw screen
Locate 2,3
Print item
Locate 23, 2, 0
Print "P = popup"
Do
Select Case InKey
Case "p"
item = popup 'get new item from popup window
mask 'redraw screen
Locate 2,3
Print item
Locate 23, 2, 0
Print "P = popup"
Case Chr(27)
Exit Do
End Select
Loop
Re: How do they Do It? - Onscreen list
That usually is done, depending on available resources (e.g. RAM),
total size list e.t.c. (this is called SW engineering).
Could be any way ...
total size list e.t.c. (this is called SW engineering).
Could be any way ...
Re: How do they Do It? - Onscreen list
That all depends. Probably most lists are either already populated internally, or done so at the time the menu is displayed. Or it could be a hybrid approach where a certain number of items are loaded into memory at any one time. If the data source is fast, it could be populated on the fly. Clearly browsing a large, multi-GB database is going to require either the hybrid approach or the on-demand approach.Gablea wrote:That is intresting. So when it generates the list would is populate the list at once or does it do it in stages? (As the user presses the up and down key)
Was the Turbo Vision port for FreePascal a binding to the C++ library, or was it reimplemented in Pascal? Turbo Vision would be a neat fit for FB if it wasn't C++.
Re: How do they Do It? - Onscreen list
Depends. Some have a callback only, some have a simple datastructure, and a callback to get the exact details, and must preload all visible info into the widgetGablea wrote:That is intresting. So when it generates the list would is populate the list at once or does it do it in stages? (As the user presses the up and down key)
Re: How do they Do It? - Onscreen list
so would the menu items be loaded into a array and then displayed on screen as when needed?
Re: How do they Do It? - Onscreen list
Just one, of the possible options ...Gablea wrote:so would the menu items be loaded into a array and then displayed on screen as when needed?
Load from file or using Data statements (just what comes to mind, at the moment).
Re: How do they Do It? - Onscreen list
Usually these systems are object oriented. So every item is an object which has enough data to create the line that you see (possibly from multiple fields).Gablea wrote:so would the menu items be loaded into a array and then displayed on screen as when needed?
A very select number are "virtual", where the system dynamically only generates the data when needed as the list is scrolled. So not all data needs to be available when the list initializes.
But that is a newer concept to speed up e.g. treeviews with hundreds of thousands of entries, that is not really something that happened back in the dos age.
Re: How do they Do It? - Onscreen list
So something like a till back Office that had 100,000 record in the product database would not have loaded them all in to memory.
Would I have loaded the first 100 in to memory and looped though them when the user got near to the last entry?
Would I have loaded the first 100 in to memory and looped though them when the user got near to the last entry?
Re: How do they Do It? - Onscreen list
Think of chunks of data, like a query of, let's say 50 entry's a piece.
When user get's to say 40th, load the next chunk of 50, releasing the top 30,
then, on the next step, load 50, release oldest 50 (having a max. of 70 any time).
(viewport is to be less thant that, of course e.g. <= 20 lines)
That's the way old editors could handle large files (being very small themselfs).
When user get's to say 40th, load the next chunk of 50, releasing the top 30,
then, on the next step, load 50, release oldest 50 (having a max. of 70 any time).
(viewport is to be less thant that, of course e.g. <= 20 lines)
That's the way old editors could handle large files (being very small themselfs).
Last edited by MrSwiss on Aug 09, 2018 0:55, edited 1 time in total.
-
- Posts: 3906
- Joined: Jan 01, 2009 7:03
- Location: Australia
Re: How do they Do It? - Onscreen list
.deleted
Last edited by BasicCoder2 on Aug 09, 2018 11:48, edited 1 time in total.