Make the restore of the window background conditionally.

This commit is contained in:
Mark de Wever 2008-08-24 18:25:23 +00:00
parent bafcd9cdb5
commit be54f822a0
2 changed files with 16 additions and 2 deletions

View File

@ -45,7 +45,7 @@ void tdialog::show(CVideo& video)
pre_show(video, window);
retval_ = window.show(true);
retval_ = window.show(restore_);
if(retval_ == twindow::OK) {
finalize_fields(window);

View File

@ -37,7 +37,8 @@ class tdialog
public:
tdialog() :
retval_(0),
fields_()
fields_(),
restore_(true)
{}
virtual ~tdialog();
@ -45,8 +46,12 @@ public:
/** Shows the window */
void show(CVideo& video);
/***** ***** ***** setters / getters for members ***** ****** *****/
int get_retval() const { return retval_; }
void set_restore(const bool restore) { restore_ = restore; }
protected:
/**
@ -106,6 +111,15 @@ private:
*/
std::vector<tfield_*> fields_;
/**
* Restore the screen after showing?
*
* Most windows should restore the display after showing so this value
* defaults to true. Toplevel windows (like the titlescreen don't want this
* behaviour so they can change it in pre_show().
*/
bool restore_;
/**
* Builds the window.
*