I just tried posting a response in this thread (a long one) and it seems to have gone awol when I clicked on 'Post message'. I didn't see any error messages. This DCForum is quite irritaing at times. No easy formatting, refuses to stay in linear viewing mode (I hate threaded mode's indent-ad-infinitum style) :)
So here it is again, hopefully my original post won't magically appear and create a repeat post.
Anyway. I stumbled across Arne Bartel's sdkbugs.zip file today that had some pertinent information regarding service_id sequences. I've pasted an excerpt at the bottom of this post.
Arne used tabs in the word document for his listing but I couldn't figure out how to apply tab formatting using DCForums poor formatting abilities, so I simply used --- to indent the appropriate lines.
I'm also not sure of the line '// aircraft change' in the document at the end of the two service_id blocks. Should there be another listing showing how things are called when an aircraft is changed. I would have thought 'aircraft change' is the same as 'aircraft selected...or is there a difference?
The information also appears to have been written during the FS2000 era, so the question is whether any changes in FS2004 may mean the information needs to be updated? Can anyone confirm?
My stumbling on sdkbugs.zip also raises the question of whether the gauge programming community really needs a single place to come to in order to find the name and location of all informational material relating to gauge programming. Maybe Bill or one of the other forum moderators could start a 'sticky' thread that brings together a listing of known filenames and locations for all such files? They all seem sequestered away all over the Internet :)
The only information files I know of in addition to sdkbugs.zip are:
idehowto.zip
sd2gau17.zip
Can anyone point me towards any others?
Finally, do all these service_id values actually compare to standard Win32 message ID values as used in general Windows programming? A gauge does exist within a resieable window after all, so I was wondering if, behind all those cryptic macros in the panel SDK that insist on hiding plain C code, the gauge DLL code structure is in fact simply the same as that found when programming your own window code and message handling in Win32?
Thanks for the help guys
- Darren
**** Excerpt from sdkbugs.zip / Author: Arne Bartels****
service_id sequence:
An FS2000 gauge runs through a specific sequence of service_ids (like the FS98 gauges ran through the initialize_routine(),install_routine().....kill_routine() sequence); below is an example of such a sequence:
//aircraft selected
PANEL_SERVICE_CONNECT_TO_WINDOW
PANEL_SERVICE_PRE_INSTALL
PANEL_SERVICE_POST_INSTALL
PANEL_SERVICE_PRE_INITIALIZE
PANEL_SERVICE_POST_INITIALIZE
---PANEL_SERVICE_PRE_UPDATE
---PANEL_SERVICE_POST_UPDATE
PANEL_SERVICE_PRE_GENERATE
PANEL_SERVICE_POST_GENERATE
---PANEL_SERVICE_PRE_DRAW
---PANEL_SERVICE_POST_DRAW
---PANEL_SERVICE_PRE_UPDATE
---PANEL_SERVICE_POST_UPDATE
...//(_DRAW_, _UPDATE_ constantly repeated)
---PANEL_SERVICE_PRE_DRAW
---PANEL_SERVICE_POST_DRAW
---PANEL_SERVICE_PRE_UPDATE
---PANEL_SERVICE_POST_UPDATE
PANEL_SERVICE_PRE_KILL
PANEL_SERVICE_POST_KILL
// window resize
PANEL_SERVICE_PRE_INSTALL
PANEL_SERVICE_POST_INSTALL
PANEL_SERVICE_PRE_INITIALIZE
PANEL_SERVICE_POST_INITIALIZE
---PANEL_SERVICE_PRE_UPDATE
---PANEL_SERVICE_POST_UPDATE
PANEL_SERVICE_PRE_GENERATE
PANEL_SERVICE_POST_GENERATE
---PANEL_SERVICE_PRE_DRAW
---PANEL_SERVICE_POST_DRAW
---PANEL_SERVICE_PRE_UPDATE
---PANEL_SERVICE_POST_UPDATE
...//(_DRAW_, _UPDATE_ constantly repeated)
---PANEL_SERVICE_PRE_UPDATE
---PANEL_SERVICE_POST_UPDATE
---PANEL_SERVICE_PRE_UPDATE
---PANEL_SERVICE_POST_UPDATE
PANEL_SERVICE_PRE_KILL
PANEL_SERVICE_POST_KILL
PANEL_SERVICE_DISCONNECT
//aircraft change
This example shows that the gauge will run on every window resizing through a 'kill','install/initialize' sequence (just like in FS98). Unlike FS98, it is possible to distinguish an aircraft change from a window resize: with FS2000 there is PANEL_SERVICE_CONNECT_TO_WINDOW at startup and PANEL_SERVICE_DISCONNECT at shutdown.
Also the whole gauge is loaded at startup and released at a change to the next aircraft, which is not like FS98 where a gauge is reloaded on every window resize. The ..._UPDATE service_ids occur in a fixed cycle at 18Hz, the ..._DRAW service_ids are synchronous with the frame rate (sounds logical: why draw when no one can see it, but it didn't stop FS98 using the same fixed 18Hz cycle both for drawing and updating).