/**********************************************************************
 *
 *   FreeDoko a Doppelkopf-Game
 *    
 *   Copyright (C) 2001-2004  by Diether Knof and Borg Enders
 *
 *   This program is free software; you can redistribute it and/or 
 *   modify it under the terms of the GNU General Public FileMenuFilterFile as 
 *   published by the Free Software Foundation; either version 2 of 
 *   the FileMenuFilterFile, or (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public FileMenuFilterFile for more details. 
 *   You can find this license in the file 'gpl.txt'.
 *
 *   You should have received a copy of the GNU General Public FileMenuFilterFile
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
 *   MA  02111-1307  USA
 *
 *  Contact:
 *    Diether Knof dknof@gmx.de
 *    Borg Enders  borg@borgsoft.de
 *
 **********************************************************************/

#ifdef USE_UI_GTKMM

#ifndef GTKMM_WIDGET_STICKY_DIALOG_HEADER
#define GTKMM_WIDGET_STICKY_DIALOG_HEADER

#include <gtkmm/dialog.h>

/**
 **
 ** @brief	a dialog which remembers its place
 **		(workaround)
 **
 ** @author	Diether Knof
 **
 **/
namespace Gtk {

  class StickyDialog : public Dialog {
    public:
      StickyDialog(Glib::ustring const& title,
		   bool const modal = false,
		   bool const use_separator = false) :
	Dialog(title, modal, use_separator),
	x(INT_MAX),
	y(INT_MAX)
      { return ; }

      StickyDialog(Glib::ustring const& title,
		   Gtk::Window& parent,
		   bool const modal = false,
		   bool const use_separator = false) :
	Dialog(title, parent, modal, use_separator),
	x(INT_MAX),
	y(INT_MAX)
      { return ; }

      ~StickyDialog()
      { return ; }



    private:
      void on_hide()
      {
	this->get_position(this->x, this->y);
	this->Dialog::on_hide();
	return ;
      } // void on_hide()
      void on_show()
      {
	if (this->x != INT_MAX)
	  this->move(this->x, this->y);
	this->Dialog::on_show();
	return ;
      } // void on_show()

    private:
      int x, y;

    private: // unused
      StickyDialog();
      StickyDialog(StickyDialog const&);
      StickyDialog& operator=(StickyDialog const&);
  }; // class StickyDialog : public Dialog

} // namespace Gtk

#endif // #ifdef GTKMM_WIDGET_STICKY_DIALOG_HEADER

#endif // #ifdef USE_UI_GTKMM
