GUI in Pascal

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Igor
Posts: 2
Joined: Tue Jan 02, 2007 9:29 am

GUI in Pascal

Post by Igor »

Hi all! I want to ask you how to writing Gui in pascal?

Excuse for my English! I living in Ukraine! :(
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

http://osdever.net/tutorials/GUI_tut.php
Although it is in C, the theory remains the same.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
87ASC
Posts: 18
Joined: Wed Dec 20, 2006 11:07 pm
Location: Coupeville, WA

Post by 87ASC »

I was wondering how to do a GUI in PASCAL also :lol: .
Beginning OS Developer.
Have any suggestions for my post here:
http://www.osdev.org/phpBB2/viewtopic.php?t=12490
User avatar
carbonBased
Member
Member
Posts: 382
Joined: Sat Nov 20, 2004 12:00 am
Location: Wellesley, Ontario, Canada
Contact:

Post by carbonBased »

You should search for general GUI theory -- the language you implement it in is irrelevant.

A GUI, imo, can be described as a hierarchy of drawable elements. This is how I designed my first GUI. A tree structure was used to contain windows (I implemented an MDI-ish system where each window had a collection of 0 to many subwindows, recursively).

Each window then contained a tree of widgets. Each widget could contain 0 to many sub-widgets.

I used a relatively simple algorithm to figure out which parts of each window are visible. Effectively, each window contained a list of visible rectangles. To repaint the screen, I would loop through all windows, and draw the rectangles that are visible per each window. This was a simple method that was acceptable to me. There are definitely other more efficient ways.

One other thing I did with my windowing system was create a backbuffer for each window. This meant each window was always occupying some area in memory, even if not visible. This area could, potentially, be as large as the entire screen. This is not overly efficient in memory use. The advantage, however, is that is can be drawn incredibly quickly using a bit blit.

--Jeff
Igor
Posts: 2
Joined: Tue Jan 02, 2007 9:29 am

Post by Igor »

Thanks all for the theory!
I have found source codes GUI for Dos in Pascal!
http://bespin.org/~polit/h001src.zip
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

Post Reply