Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / ViewGUI - Fast, customizeable, open source DBP GUI with events!

Author
Message
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th Oct 2007 15:04 Edited at: 29th Oct 2007 21:19
ViewGUI


Current version: 0.1b

Speed:
ViewGUI is incredibly fast due to an efficient window sorting method, and Cloggy's amazingly fast d3d plugin.
Here is a screenshot of over 100 overlapped, depth sorted, draggable windows with alpha, and all generating dynamic events running at ~60fps:



Customizeable:
With the dynamic event system, you can tap into the 'window painted' event to draw whatever you want to that particular window, and it will appear in the correct z-depth Also, each window has its own properties so you can control the entire look of a window without using a single draw command.



Open source:
Download source HERE

Dynamic events:
Utilising IanM's function pointer plugin allows each window to have their own event function which can be changed easily at run-time. A function can handle events of multiple windows and use the sender argument to get a handle on the window that raised the event.
Events that can only happen once per update (such as mousedown) can also be retreived as a variable to avoid complexity.

External DLLs required:
IanM's Matrix1 Utility plugin for function pointers and peek/poke commands
Cloggy's d3d plugin for fast 2d drawing

Todo:
Add more types of window than just form and button
Add more events

Done:
Main engine
Depth sorting
Parent/child window sorting
Border styles
Colours
Cursors (on a per-window basis)
Form windows
Button windows
Window OOP
Common events for all classes of window
Different events for each class
Draw window text
Text align
Form title text is automatically cut to fit form
Different cursors for each window (including screen)

Extra info:
A hwnd of 0 means the screen.

Current windows:
Form
Button

Line count:
1,269 lines

Please post how many windows you get when you run the example (it only creates windows when the framerate is above 60fps)

Attachments

Login to view attachments
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 29th Oct 2007 17:00
Impressive!

I stopped working on my gui because I couldn't figure out how to do the windows and depth sorting.

At the moment I don't have a need for a gui but this thread is definitely bookmarked.

I allways afraided from a clowns. aww..
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Oct 2007 17:08
Very cool looking. I'm just wondering what you mean by Window OOP. Is that just the events handling?

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th Oct 2007 17:27 Edited at: 29th Oct 2007 17:28
Thanks

@Zotoaster
The window OOP is the fact that every kind of window (form/button/scrollbar/etc.) is a window, and has all the properties and events associated with a window, but it also has its own properties and events, specific to its type. For example, a form has a color property, just like a button will have, and both a button's colour property and a form's colour property are set by the same function, but a form also has a draggable property as well. This is part of OOP

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Oct 2007 17:53
Instead of them all inheriting the same properties as a window, would it not make sense to make a universal 'Gadget' object that can be inherited from?

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th Oct 2007 17:56 Edited at: 29th Oct 2007 17:57
@Zotoaster
That is what a 'window' is All the controls on any windows platform are... windows. It's just that the term window came to mean what is actually an 'over-lapping window' or 'form'. That is why windows is called windows So when I say window, it is the same as a blueGUI gadget, or a .net control.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Oct 2007 18:02
Ah, so you get windows, and actual windows

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th Oct 2007 21:11
Updated to v1.0b
Added button windows
Windows now draw their text
Text align
Added click event

UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 29th Oct 2007 23:10
Wow, this looks really neat!

Just wondering, how do you make these plugins? In DBP? or another programming language? Thanks

Your signature has been erased by a bad joke
Deathead
18
Years of Service
User Offline
Joined: 14th Oct 2006
Location:
Posted: 29th Oct 2007 23:51
C++. Thats how you make them in C++.

TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 30th Oct 2007 01:03 Edited at: 30th Oct 2007 01:07
I'm confused. It gets to the line 'msgbox value$ + " , " + str$(value),0,0' (line 176) and can't compile.

[Edit]Well I remarked that line and it ran fine. Got 110 windows before dipping below 60fps.[/Edit]

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 30th Oct 2007 01:41
@TEH_CODERER
Forgot to remove the debug command

@Everyone
Glad you liked it!

TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 30th Oct 2007 11:00
Ah, lol. Well as I said I got it to work and it is awesome! Nice work.

Alquerian
18
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 30th Oct 2007 20:18
Very cool Diggs I think you are on to a unique and useful solution here. I like your approach with this and how you are using cloggy's plugin!

I hope some of the windowing images I am sending to you end up working well with theming windows. Good work

Support the indi!

Login to post a reply

Server time is: 2024-11-27 20:33:42
Your offset time is: 2024-11-27 20:33:42