View Full Version : Docking, Resizing and Moving Panels with SimConnect
06-19-2007, 03:06 PM
I have created a panel in C++ to go in the FSX game. I was wondering if it might be possible to perform such functions on that window as one might do using the mouse and pop-up menus, such as moving, resizing, and docking/undocking that panel/window. It would be under control of my SimConnect client. Thanks in advance for any clues.
06-20-2007, 03:08 PM
I know next to nothing about SimConnect.
I would however suggest the "SimConnect" forum at http://www.fsdeveloper.com/ as a good place for help. You'll find - among others - Pete Dawson of FSUIPC fame hanging their hat there... ;)
06-20-2007, 06:37 PM
Thanks Bill - yes indeed, Mr. Dowson and the SimConnect forum are good resources. However, for all I know, it might be possible to have one XML or C++ gauge affect its own or another gauge's window aspects (eg. docking, size, position) through gauge-related controls, independent of SimConnect, but I must admit I haven't come across anything.
06-21-2007, 04:07 PM
Kim, Bill can correct me here if need be as I may well be wrong. I know very little about gauge construction, but I'm a Windows technical programmer and I will make an educated guess as follows:
I know of no reason why a gauge couldn't create, display, resize and close another window. Not the kind of window mentioned in panel.cfg but a Windows API window. In other words, I suspect that, in principle, all gauge and panel windows could be created unknown to the FS runtime, just as sounds are played back via FSSound without the knowledge of the FS runtime.
Becaue of the cyclic nature of the FS runtime engine there are limits on amount of time that a gauge can retain control safely, but the Windows API is fairly quick. There are issues regarding loss and restoration of mouse/keyboard focus, but these probably could be worked.
But I'm really guessing. I hope this helps.
06-22-2007, 11:46 AM
That is absolutely, 100% correct with regards to C type gauges, which are - in actual fact - simply .dll files.
XML on the other hand isn't even a "language" at all, and depends entirely on running inside the "XML parsing engine's wrapper," which is of course why XML "gauges" have no file I/O or sound abilities directly*.
Since any C gauge is a .dll running inside of FS's space, it has full access to anything the Windows API will allow any .dll to utilize. The real issue as you mentioned is the matter of the time required to "do stuff" outside of the FS environment.
*Note: The FSX SDK now contains an example showing how to code a "helper .dll" for an XML gauge that will allow one to extend the functionality of their XML "code" to provide the missing features. This is - in fact - precisely how the fs9gps works. It issues a call to C:fs9gps:ClassName to request data or send data...
However, all that aside, I have no direct experience beyond simple file I/O and sound file management... Such discussion is way above my paygrade... ;)
07-05-2007, 03:24 PM
NEW PROBLEM: Alpha-blending an individual panel on the fly
Thanks for your comments, Mike and Bill. A few months ago I did a lot of experimenting with avoiding the gauges interface completely and going directly to the Windows API for drawing right on top of FSX frames. Naturally, a DLL was my starting point, but it was a SimConnect DLL, not a gauges GAU file. Anyway, I had only limited success, because I wanted a heads-up, largely transparent -- and even alpha-blended -- data display. The gauges interface and FSX configuration parameters allow me to get what I wanted, for the most part. Not perfect, but adequate.
I return to this subject again, because now I'd like to adjust the alpha-blending of my heads-up display on the fly. (As well as dock, resize, and move!) FSX (and SimConnect) allow variable alpha-blending, but it seems to apply to ALL the panels. I would like to adjust just the one panel, dynamically.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.