oapiOpenInputBox problem

computerex

Addon Developer
Addon Developer
Joined
Oct 16, 2007
Messages
1,282
Reaction score
17
Points
0
Location
Florida
Hello. I am having a slight problem with the oapiOpenInputBox function.

Code:
// in consumekeybuffered

case OAPI_KEY_R:
        {
            oapiOpenInputBox("Enter new ref", VectorInput, 0, 20, &v->tV);
            v->resetRef();
            return true;
        }

resetRef() simply updates the reference of a thruster. The problem is, tV DOES get inputed with the vector the user enters, however resetRef() doesn't update the thruster position until the next time you press SHIFT + R. This makes me wonder if oapiOpenInputBox really opens the modal dialog at the end of the timestep or something. How does this exactly work?
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,667
Reaction score
795
Points
128
Hello. I am having a slight problem with the oapiOpenInputBox function.

Code:
// in consumekeybuffered
 
case OAPI_KEY_R:
        {
            oapiOpenInputBox("Enter new ref", VectorInput, 0, 20, &v->tV);
            v->resetRef();
            return true;
        }

resetRef() simply updates the reference of a thruster. The problem is, tV DOES get inputed with the vector the user enters, however resetRef() doesn't update the thruster position until the next time you press SHIFT + R. This makes me wonder if oapiOpenInputBox really opens the modal dialog at the end of the timestep or something. How does this exactly work?

I haven't had any problems with Input Box. But execution of the program doesn't stop in oapiOpenInputBox(). When the user is entered the data in the input box it will call VectorInput subroutine. You must call resetRef() in VectorInput subroutine and pass the pointer "v" into the VectorInput (Not v->tV) so you can access them both.
 

computerex

Addon Developer
Addon Developer
Joined
Oct 16, 2007
Messages
1,282
Reaction score
17
Points
0
Location
Florida
Oooooooh...So the simulation continues while the user is entering the string. Thanks! :)
 
Top