Programming Question adding Dialog Boxes

Mr Martian

Orbinaut/Addon dev/Donator
Addon Developer
Donator
Joined
Jun 6, 2012
Messages
288
Reaction score
67
Points
28
Location
Sydney, Australia, Earth, Sol
Website
www.orbithangar.com
Hey there,

I am trying to make a vessel that opens a dialog box, much like the Orbiter default Atlantis spacecraft. the dialog box I want to create is really very simple; just operates a few animations. I have looked over the Atlantis dialog box code and the section in the Orbiter API guide numerous times and just cant work it out (I am a fairly inexperienced programmer, with very limited knowledge, the most complex thing I have programmed from scratch is the ISV Pegasus V2.0 addon) if someone could point me in the direction of a tutorial or code for a simple dialog box or even tell me how to go about it, even a very simple one that has one button for a simple event, that would be very much appreciated :)

thanks in advance
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,564
Reaction score
2,298
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Hey there,

I am trying to make a vessel that opens a dialog box, much like the Orbiter default Atlantis spacecraft. the dialog box I want to create is really very simple; just operates a few animations. I have looked over the Atlantis dialog box code and the section in the Orbiter API guide numerous times and just cant work it out (I am a fairly inexperienced programmer, with very limited knowledge, the most complex thing I have programmed from scratch is the ISV Pegasus V2.0 addon) if someone could point me in the direction of a tutorial or code for a simple dialog box or even tell me how to go about it, even a very simple one that has one button for a simple event, that would be very much appreciated :)

thanks in advance

Its not really easy... essentially it is about old school Windows User Interface programming. With resource files and so on... or window classes.

See here for some reference:

https://msdn.microsoft.com/en-us/library/windows/desktop/ff657751(v=vs.85).aspx

If you feel less ready to deal with low-level APIs, I recommend you to simply create a Panel2D for this.
 

Bibi Uncle

50% Orbinaut, 50% Developer
Addon Developer
Joined
Aug 12, 2010
Messages
192
Reaction score
0
Points
0
Location
Québec, QC
Orbiter has some subtilities with other dialog boxes, because it catches all Windows messages or stops receiving messages if you listen to them, making Orbiter freeze.

I wrote a post explaining what should be done in order to have proper externel dialog boxes in Orbiter here : http://www.orbiter-forum.com/showthread.php?t=28839

However, you will still need to learn how Windows programming works, and it is quite old and weird sometimes.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,624
Reaction score
2,592
Points
203
Location
Dallas, TX
I messaged you.
I have learned you have to have the right compiler version. I don't think the express version do resources well.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,564
Reaction score
2,298
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
The resource files are just a simplification - you don't really need them, but working only with CreateWindowEx and similar functions is much more effort. You just need some more manual labour in an Express version.

I am pretty sure, it would also be possible to offer something like WPF and/or XAML for defining Orbiter dialogs.

But I have no clue at all where to start there.
 

orb

O-F Administrator,
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
I don't think the express version do resources well.
If the problem is with editing resources / dialog boxes visually, then there are quite good free resource editors which can be used with the VS Express editions (however, they are standalone and don't integrate with Visual Studio IDE), like for example ResEdit.
 
Top