QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: Aureal on July 17, 2017, 07:31:10 pm

Title: Aureal's Windows-like Windowing system Announcement (qws)
Post by: Aureal on July 17, 2017, 07:31:10 pm
Hey! First of all, I wanted to say.. It feels kinda weird that you can actually choose any username, due to the fact that there are almost no accounts created yet!

And well, I've been working on a "clone" of the Microsoft Windows windowing system, at this point, it is almost identical. Its quite buggy tho, but with some work, it may become something nice. In the RAR file I'll share with you through this post, you will find many things. Please read the 'readme.txt' file to get more information. I included that to encourage you to help with the development.

Features (up to this date):
Code: QB64: [Select]
  1.         - Icons
  2.         - Custom Cursors
  3.         - Custom Fonts
  4.         - Native Resolution
  5.         - Exception trapping
  6.         - Wallpapers
  7.         - Search Windows by title
  8.         - Window handles
  9.         - FPS and frame counters
  10.         - (WIP) Buttons, collision detection
  11.         - (WIP) Antialising
  12.         - (WIP) Sounds
  13.         - (WIP) Animations
  14.         - (WIP) Focus
  15.         - (WIP) Animated cursors *this will be the hardest-to-code feature of all the WIPs :D*

There is a screenshot, you can check it out!
Title: Re: Aureal's Windows-like Windowing system Announcement (qws)
Post by: STxAxTIC on July 17, 2017, 09:34:56 pm
Hiya Aureal,

I had to double-take your name cause there is a guy around going by "Aurel". Anyway, welcome aboard and nice program. A handful of folks work on similar things, some right this minute for all I know. Keybone works in a very similar direction in particular.

If you can bear to integrate IRC into your culture, we hang out a #qb64 on freenode.
Use http://www.qb64.org/ircpage.html for starters if you don't have a client.

Anyway, keep up the good work and keep us in the LOOP (no pun, but yes pun).
Title: Re: Aureal's Windows-like Windowing system Announcement (qws)
Post by: keybone on July 17, 2017, 09:42:35 pm
Well I tried to run it, but got C++ compilation failed. Maybe because i'm on Linux? Don't have a windows computer to test on.
Title: Re: Aureal's Windows-like Windowing system Announcement (qws)
Post by: FellippeHeitor on July 17, 2017, 09:55:36 pm
I just ran it on macOS and the following had to be modified:

You may want to load the font first and then apply it if loading was successful, even in Windows:

Code: QB64: [Select]
  1. TheFont& = _LOADFONT(ENVIRON$("windir") + "/Fonts/segoeui.ttf", 12)
  2. IF TheFont& > 0 THEN _FONT TheFont& 'when loading fails, the handle will be -1

Another suggestion (this is new): if you have the latest build of QB64, you won't need a skip: label in the code below:
Code: QB64: [Select]
  1. SUB updateWindows
  2.     FOR i = 0 TO MAX_WINDOWS
  3.         updateMouse
  4.         IF windows(i).wHandle = 0 THEN GOTO skip
  5.         w2x = windows(i).wX + windows(i).wWidth
  6.         w2y = windows(i).wY + windows(i).wHeight
  7.         wh = windows(i).wY - windows(i).wBarheight
  8.         LINE (windows(i).wX - wFrames, wh)-(w2x + wFrames, w2y + wFrames), windows(i).wFgcolor, BF
  9.         LINE (windows(i).wX, windows(i).wY)-(w2x, w2y), windows(i).wBgcolor, BF
  10.         _PUTIMAGE (windows(i).wX + 5, wh + 5)-(windows(i).wX + 25, windows(i).wY - 5), windows(i).wBarIcon
  11.         _PRINTSTRING (windows(i).wX + 30, windows(i).wY - (windows(i).wBarheight / 2) - 5), windows(i).wName
  12.  
  13.         skip:
  14.     NEXT

Try it like this (notice the new _CONTINUE statement):
Code: QB64: [Select]
  1. SUB updateWindows
  2.     FOR i = 0 TO MAX_WINDOWS
  3.         updateMouse
  4.         IF windows(i).wHandle = 0 THEN _CONTINUE
  5.         w2x = windows(i).wX + windows(i).wWidth
  6.         w2y = windows(i).wY + windows(i).wHeight
  7.         wh = windows(i).wY - windows(i).wBarheight
  8.         LINE (windows(i).wX - wFrames, wh)-(w2x + wFrames, w2y + wFrames), windows(i).wFgcolor, BF
  9.         LINE (windows(i).wX, windows(i).wY)-(w2x, w2y), windows(i).wBgcolor, BF
  10.         _PUTIMAGE (windows(i).wX + 5, wh + 5)-(windows(i).wX + 25, windows(i).wY - 5), windows(i).wBarIcon
  11.         _PRINTSTRING (windows(i).wX + 30, windows(i).wY - (windows(i).wBarheight / 2) - 5), windows(i).wName
  12.     NEXT

The above is available starting with build 20170628/55.
Title: Re: Aureal's Windows-like Windowing system Announcement (qws)
Post by: Aureal on July 17, 2017, 10:21:48 pm
Thanks Felippe, I will review the code, anyways it is a mess right now :D

Keybone, can you recompile and post the errors?

STxAxTIC I'm checking the IRC right now!
Title: Re: Aureal's Windows-like Windowing system Announcement (qws)
Post by: keybone on July 17, 2017, 10:40:03 pm
Thanks Felippe, I will review the code, anyways it is a mess right now :D

Keybone, can you recompile and post the errors?

STxAxTIC I'm checking the IRC right now!

I just upgraded my qb64 version and now it works. Could also be a mistake with how i extracted it before.
Nice job, I'll take a better look sometime later, I work on something similar.
Title: Re: Aureal's Windows-like Windowing system Announcement (qws)
Post by: Aureal on July 17, 2017, 10:47:45 pm
Quote
I just upgraded my qb64 version and now it works. Could also be a mistake with how i extracted it before.
Nice job, I'll take a better look sometime later, I work on something similar.

Nice! I would like to see some of that too!
Title: Re: Aureal's Windows-like Windowing system Announcement (qws)
Post by: Ashish on July 18, 2017, 05:02:33 am
Nice work, Aureal! :)
Can we make window movable?
Title: Re: Aureal's Windows-like Windowing system Announcement (qws)
Post by: Aureal on July 18, 2017, 02:07:48 pm
Yeah sure, I'm working on movable windows!
Title: Re: Aureal's Windows-like Windowing system Announcement (qws)
Post by: keybone on July 19, 2017, 12:29:51 pm
Yeah sure, I'm working on movable windows!

At one point, my windowing system consisted of only a single window, and the window was movable and resizeable. You can check it out if you want.
This code was a hack, so dont expect anything neatly written, i know a piece of software is never bugless, but I am pretty confident that there are no *major* bugs.

One thing though, it is kinda counterintuitive because of the way GUIs have been written for a while. In order to drag the icon, you need to drag its titlebar.
The titlebar is kinda small, but is easy to aim at if you move the cursor up through the icon, you get used to it. :)

I am in the process of putting all this functionality into the multiwindow version, last time i tried though it was slow as molasses. :D

download the cloudswide.bmp attached to make it work or replace with an image of your choosing. (change line 66)
Title: Re: Aureal's Windows-like Windowing system Announcement (qws)
Post by: Aureal on July 19, 2017, 08:25:13 pm
WHAT IN THE WORLD ARE THOSE HUGE ELSE IFs?????
Title: Re: Aureal's Windows-like Windowing system Announcement (qws)
Post by: FellippeHeitor on July 19, 2017, 09:56:39 pm
What is life if not a big IF?
Title: Re: Aureal's Windows-like Windowing system Announcement (qws)
Post by: keybone on July 20, 2017, 12:50:59 am
WHAT IN THE WORLD ARE THOSE HUGE ELSE IFs?????

Like i said the code isnt the greatest but it works. :)
Title: Re: Aureal's Windows-like Windowing system Announcement (qws)
Post by: keybone on July 20, 2017, 12:52:13 am
What is life if not a big IF?

an ELSE? :D