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.

DarkBASIC Professional Discussion / BBB GUI - How to make anchored child windows/views?

Author
Message
CodeTrasher
12
Years of Service
User Offline
Joined: 18th Jul 2012
Location: Tampere, Finland
Posted: 8th Feb 2015 22:59 Edited at: 8th Feb 2015 23:09
Hello all,

the software company I currently work for is hosting an in-house AI programming challenge. I have weighed my programming skills and I taught it would be nice to show my colleagues what DBPro is capable of by creating a simple client with nice GUI without using sprites. So I downloaded BBB GUI dll, installed it and started experimenting.

The problem here is that I haven't been able to find a comprehensive tutorial for it and the documentation seems a bit unfinished. What I'd wish to do with my client app is to add a small anchored child view/window for connecting and disconnecting to a server; add another smaller child view for log messages and the third view would be for the game view with health bars etc.

If there's some one more experienced with BBB GUI plugin and could share some ideas with me, it would be extremely appreciated. Please note that I don't want to create those floating child views like the ones in provided examples but my goal is to create fixed-sized anchored windows within the main DBPro window.

Thank you very much!

EDIT: I gave this a little further thought and think it would be easier for me to just add some lines to divide the screen a bit and add the other GUI elements on their own separate areas. But please, tell me what do you guys think would be a neater solution to this.
Admiral MH
14
Years of Service
User Offline
Joined: 10th Feb 2011
Location: TX, USA
Posted: 13th Feb 2015 20:07 Edited at: 13th Feb 2015 20:15
Hello CodeTrasher,

Although the documentation for BBB GUI is incomplete, BBB GUI is essentially a wrapper library of the Win32/Windows API. Here are some general resources that could help you out.

Controls library: Here is a good place to start for learning about specific controls.
Windows and Messages: Here is the place to learn about windows controls and the message queue.
Control Spy: A useful sandbox for learning how various styles, notifications, and messages effect controls.

In regards to your situation, what you need is to add the 'WS_CHILD' style to the window you want to anchor. In addition to that, the window that is being anchored must not have WS_CAPTION, WS_OVERLAPPEDWINDOW, or WS_TILEDWINDOW styles (By default, all windows with title bars can be moved by the user). Here is the documentation for all the window styles.

Here is a quick example for you.



If you want a child window with a title bar that can't be moved, I could elaborate how you could accomplish that if you are interested.

Good luck with your AI programming challenge. Feel free to ask me more questions if you need help.

CodeTrasher
12
Years of Service
User Offline
Joined: 18th Jul 2012
Location: Tampere, Finland
Posted: 14th Feb 2015 02:18
Thank you very much, Admiral MH, those examples were very helpful, although I accidentally managed to create an anchored window by trying almost every single WS_* constant and - as you showed me too - the WS_CHILD was the one. I just used wrong (I guess) ex-style parameter which prevented my child window from showing.

Although the BBB GUI has proven to be a very powerful library I may have to change my language to Java/C++/C#. As far as I know DarkBasic doesn't have a plugin for manipulating and parsing JSON data which will be used to transfer game data between server and a client.

I'm a huge fan and a proud owner of AGKv1. I could use Tier 2 to build the client but I'm not very talented in C++. I just found an outdated .NET wrapper for AppGameKit in Codeplex which I'd be thrilled to try bring up to date.

Decisions, decisions...

Login to post a reply

Server time is: 2025-05-12 08:18:04
Your offset time is: 2025-05-12 08:18:04