Author Topic: [done] adding Question wether to save or not on closing of the Editor  (Read 837 times)

MuwuM

  • Ornithopter
  • *****
  • Posts: 426
  • No Game without Move(ment)
    • View Profile
    • MuwuM - Lexicons
Change in glest_editor: main.cpp

Code: [Select]
void MainWindow::onClose(wxCloseEvent &event) {
delete this;
}

to:
Code: [Select]
void MainWindow::onClose(wxCloseEvent &event) {
//Code by MuwuM
if ( MessageBox(NULL,"Do you Want to save?" ,"Closing...", MB_YESNO)==IDYES) {
wxCommandEvent ev;
MainWindow::onMenuFileSave(ev);
}
//End Code by MuwuM
delete this;
}
« Last Edit: 24 July 2016, 16:37:07 by filux »

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: adding Question wether to save or not on closing of the Editor
« Reply #1 on: 23 January 2011, 03:10:11 »
Thanks! So fast at that time...

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: adding Question wether to save or not on closing of the Editor
« Reply #2 on: 23 January 2011, 04:50:35 »
Added to svn, had to change a bit since your code was using Windows API's (which in general we try hard to avoid since we compile on numerous platforms).

Thanks MuwuM

MuwuM

  • Ornithopter
  • *****
  • Posts: 426
  • No Game without Move(ment)
    • View Profile
    • MuwuM - Lexicons
Re: adding Question wether to save or not on closing of the Editor
« Reply #3 on: 23 January 2011, 12:57:43 »
I have thought thats windows but i didn't exactly know how to aviod that... next time will be better ;-)

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: adding Question wether to save or not on closing of the Editor
« Reply #4 on: 23 January 2011, 13:03:31 »
Yeah, thanks for adding :). GJ :).
WiP Game developer.
I do danish translations.
"i break stuff"

 

anything