Jump to content
Sign in to follow this  
Guest JeffB

Can someone provide a working example of using a window

Recommended Posts

Guest JeffB

...with the SDK (C++) and pressing the buttons. I just can't seem to get this to work. It obviously does as there are many programs (Squawk Box) that uses many UI windows. If I can just get ONE working example of entering text, clicking a button (with the *.win) to close the file, I know I can take it from there.Jeff

Share this post


Link to post
Share on other sites
Guest JeffB

I'm using the the DLLEventNotice to capture any button presses, etc. I DO capture the Main menu clicks (such as File->Exit Fly!), but it doesn't appear to capture any my window BUTTON clicks!Also, I can display my own windows by capturing keystrokes. I can get text from a user entering data into an edit text area (using APIGetUIText or something like this...), so I know I'm on the right path.I just cannot press a button and capture it! I know it can be done, would someone simply provide an example of that? How do I capture a button press? If it's through the DLLEventNotice routine, would someone provide enough detail that I can work with?Jeff

Share this post


Link to post
Share on other sites

Hey Jeff-was my email helpful on this? If not, I can answer more questions if you have them... ;-)Cheers,


Lefteris Kalamaras - Founder

www.flightsimlabs.com

 

sig_fsldeveloper.jpg

Share this post


Link to post
Share on other sites
Guest JeffB

Lefteris,Yes, you're email was very helpful! Thank you! I capture button presses now. However, I can't get the APIOpenFileDialog to close it's window!I can get the file name, etc. but the darn thing will not close!If I add a close window (X), it will close, but I doubt this is the correct way to close. This same dialog box appears when choosing a metar file, and it closes automatically after choosing a metar file.I can't get it to act the same way!I could use APICreateWindow2, which allows me to close using APICloseWindow2, but I'd have to add all the file functions (yech!).Have you any luck using APIOpenFileDialog?Cheers,Jeff

Share this post


Link to post
Share on other sites

Jeff-I've never used APIOpenFileDialog, but from what I see in the SDK, there is a SDLLObject* in the parameters. This means that the dialog must be passing a button press event to that DLLObject whenever the user presses the Open or the Cancel button. (I am thinking aloud here).This also means you could possibly get the window ID from that event, and try to close its corresponding window, which must be the dialog box.Would that work?


Lefteris Kalamaras - Founder

www.flightsimlabs.com

 

sig_fsldeveloper.jpg

Share this post


Link to post
Share on other sites
Guest JeffB

Thanks Lefteris,I understand what you're saying. There are two APICloseWindow's. The first uses a pointer to the window object, the second uses a window ID. By capturing the window ID and using APICloseWindow2(long window id), I could try and close the APIOpenFileDialog window. Is this what you mean?Cheers,Jeff

Share this post


Link to post
Share on other sites

Jeff-either way - you could try getting the SDLLObject pointer from the DLLEventNotice that gets called with the button push, and see what the window ID for that is. Then, you could close it with CloseWindow() or CloseWindow2(). Try it out.


Lefteris Kalamaras - Founder

www.flightsimlabs.com

 

sig_fsldeveloper.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...