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.

Dark GDK / Change the GDK DirectX Surface Size possible ?

Author
Message
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 16th Jul 2009 02:04 Edited at: 16th Jul 2009 02:15
Hey, Im wondering if its possible to resize the GDK surface, much like you would by getting a RECT value for an MDI client surface, to keep it resized properly to the window you have it stuck into.

I know ill more than likely be able to figure it out after some experimenting, but I thought that I'd ask incase anybody had done it before to maybe save myself some time

Anyway, the purpose of why im wanting to do it, is to enable the main window to have a Menubar(placed ok on its own through SetMenu api call) aswell as a Toolbar(created with CreateWindowEX and manually setup with passed structures for buttons etc) and a status bar at the bottom of the window(also created with CreateWindowEX as the toolbar)... The creation of those controls and the placing of them is no problem, they are done and inplace, the problem, is that while they are there, and I can send them to stay ontop of the GDK surface, the GDK surface itself like to takeup the entire window... so at the moment my toolsbar and statusbar are kind of "overlapping" the top and bottom of the GDK surface which i dont want.

Please note that I can get it to work kind of, by placing the GDK surface into another window and docking that window(essentially an MDI interface).... the problem with that approach is that the cursor positions for dbMouseX and dbMouseMove etc get all screwed up and involved api calls are required to keep track of the screen position of the mouse in relation to the client surface etc, and I would like to keep the GDK surface in its own window rather than forcing it into another one.

Im thinking that there would have to be a WM_SIZE or something being caught by GDK internally to keep the GDK surface sized in the window as its resized... Can that be done to the GDK surface by getting its pointer or would I possibly hose some internal calculations if I accessed its sizing myself ?

EDIT : Before anybody suggests it, ill probably get GDK.Net eventually and learn c#'s syntax aswell for tools dev, but I personally prefer cpp.

If it ain't broke.... DONT FIX IT !!!
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 16th Jul 2009 03:56
Here is a small app that I threw together to demonstrate the problem visually...

It creates a menubar(file, edit, help etc), a button toolbar and a status bar inside the gdk window. The menubar is correctly placed as its placed into the window with an api function SetMenu..

The status bar and toolbar are created with CreateWindowEx and work differently, resize the window to see the problem, as you drag it, the toolbar and status bar will flicker through to the top.

Here is the code for the main program, note that if you want to compile this, you will need to add a resource menu to your program called IDC_MAINMENUBAR :



If it ain't broke.... DONT FIX IT !!!

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-10-01 08:15:41
Your offset time is: 2024-10-01 08:15:41