Qbasicnews.com
September 25, 2020, 07:09:17 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: GUI/Z windowing system  (Read 2890 times)
jatos
Ancient QBer
****
Posts: 464



« on: May 25, 2004, 04:10:43 AM »

Aynone know of any good gui/z windowing tuts? I have my own working ideas for windowing system, but not very efficient ones, or ones that would run into other bugs....
Thanks, jamie.
Logged

atos-Software
http://www.datacentertalk.com - interested in how web hosting works? Here the place to go to find out.
seph
Na_th_an
*****
Posts: 1915



« Reply #1 on: May 25, 2004, 07:54:16 AM »

gee whiz tuts? HUH!?
Logged

earn.
jatos
Ancient QBer
****
Posts: 464



« Reply #2 on: May 25, 2004, 09:14:42 AM »

Seph what do you mean by that?
Logged

atos-Software
http://www.datacentertalk.com - interested in how web hosting works? Here the place to go to find out.
wildcard
*.*
Administrator
__/--\__
*****
Posts: 2370



« Reply #3 on: May 25, 2004, 09:23:10 AM »

There are loads of GUIs or "Operating systems" in QB/qbasic. There are several listed at http://www.neozones.com/Gui/, and if you search at ABC archives they have loads listed there too http://www.allbasiccode.com/newsite/abc.cgi?ACT=DQ. Z!re is also working on Novix http://www.Novix.tk

EDIT: I also forgot Sepent, which has a good list at http://www.sepent.com/prog/basic/bguios/ as well as their own GUI.
Logged
jatos
Ancient QBer
****
Posts: 464



« Reply #4 on: May 25, 2004, 12:09:57 PM »

yes but I want a tutorial cus I wanna whip the but's(or try to...) of a lot of existing qb gui's.
Logged

atos-Software
http://www.datacentertalk.com - interested in how web hosting works? Here the place to go to find out.
Z!re
*/-\*
*****
Posts: 4599


« Reply #5 on: May 25, 2004, 03:14:07 PM »

Rough code:
Code:
dim windowZ(32)

numwindows=10

for b=1 to numwindows
 for a=1 to numwindows

  If windowZ(a) = b Then
   drawwindow a
   exit for  'already found the correct window
  end if

 next
next


Or you could:
Code:
sort_all_windows_depending_on_Z_Value
for a=1 to numwindows
 drawwindow a
next


But 9 out of 10 times, the first code is fast enough.

Even with 64 max windows open, it would, in worst case, have to go through 4096 for/next's.

And that is worst case scenario.


To remove a window from the first code you would do::
Code:
window_to_remove=5
numwindows=numwindows-1

if window_to_remove < numwindows Then
 WindowZ(window_to_remove) = WindowZ(numwindows)
 'swap the last window, with the one being removed, so active
 'windows are always in front.
end if
'If it's the last one there is no need to clear it, it will be cleared
'when you add a new window anyways


Very rough code, could use some fixing, and there's prolly some spelling or minor errors in it (btw, you can't use _ in QB, i just used it here to clarify)
Logged
wildcard
*.*
Administrator
__/--\__
*****
Posts: 2370



« Reply #6 on: May 25, 2004, 03:37:30 PM »

Quote from: "jatos"
yes but I want a tutorial cus I wanna whip the but's(or try to...) of a lot of existing qb gui's.


Sorry, I missed the tutorial bit in your question. But I've found working examples the best teacher for me. I'm not aware of any good tutorials on the subject qbwise.
Logged
Nexinarus
Wandering Guru
***
Posts: 301



WWW
« Reply #7 on: May 25, 2004, 05:02:39 PM »

have a look at the source code to X or Gnome for linux, oh wait that'l give you nightmares Tongue.
Logged
jatos
Ancient QBer
****
Posts: 464



« Reply #8 on: May 25, 2004, 05:10:19 PM »

Heres an idea I had
Variable_Screencontent(screenx,screeny)
this would say what windows where on top, and these would reshown based on screen content when someone affects the active windows.
All very well but one problem? How do I find out every window that mean't to be below them and refreshing the, too slow. I wold use this if I could find an efficient way of getting which windows are below. Although I've just had an idea.... let me think about it.
Logged

atos-Software
http://www.datacentertalk.com - interested in how web hosting works? Here the place to go to find out.
Z!re
*/-\*
*****
Posts: 4599


« Reply #9 on: May 25, 2004, 05:57:27 PM »

You could do it like this..

You draw the front window first, and create a binary image of the windpw in memory

Then you take the next window based on Z value, and draw it, NOT overdrawing the already drawn content, and store it in mem

And you do that for all windows.


Then, if you update a window you simply just use the binary image of that window, edit it, then draw all binary images again, only change in the memory images, then draw them.

That way you could do like this, for example, if the 5th window (z order, from top, where 1 is front/top) change, and there are 10 windows showing, you just update the 5th window, then the 4th, then the 3rd, 2nd then finally the first one, in front.

Could be made pretty fast.


(The technique to draw in memory and only display when done is something that will be used a lot in Novix, for example [spam] )
Logged
jatos
Ancient QBer
****
Posts: 464



« Reply #10 on: May 25, 2004, 06:08:38 PM »

Ok I will look into that. Also here how I plan to write my GUI (mroe like a QB OS)
KERNEL - this will be written in qb(and basm'd for final binary) and will run the apps.

Everything else will run on SLA  apps.

The first SLA will be a shell, and this will be shown if my OS is not closed but the gui is, you cna get the gist, if gui is aactive it will claim a window.

gui.sla, this will simply handle the windows and apps will claim windows on it etc. Diagramatically

/-Kernel-\
    |
SLA APPS--------\
   |
GUI.SLA            |
   |
   |                Other sla's
   \                   /
Variables detailing windows.
Logged

atos-Software
http://www.datacentertalk.com - interested in how web hosting works? Here the place to go to find out.
Nexinarus
Wandering Guru
***
Posts: 301



WWW
« Reply #11 on: May 26, 2004, 02:57:32 AM »

Nice "fake os" Z!re. Amused me for about 10 mins Smiley. Cool little compiler too and features.
Logged
jatos
Ancient QBer
****
Posts: 464



« Reply #12 on: May 26, 2004, 03:45:26 AM »

Havn't had chance to have a good go with novix but looks good...
Logged

atos-Software
http://www.datacentertalk.com - interested in how web hosting works? Here the place to go to find out.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!