Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) WtQuestionDialog

 

WtQuestionDialog is a Wt dialog for QuestionDialog.

 

 

 

 

 

wtquestiondialog.h

 

//---------------------------------------------------------------------------
/*
WtQuestionDialog, Wt dialog for QuestionDialog
Copyright (C) 2011 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, 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 License for more details.
You should have received a copy of the GNU General Public License
along with this program.If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/CppWtQuestionDialog.htm
//---------------------------------------------------------------------------
#ifndef WTQUESTIONDIALOG_H
#define WTQUESTIONDIALOG_H
//---------------------------------------------------------------------------
#include <boost/shared_ptr.hpp>
#include <boost/signals2.hpp>
//---------------------------------------------------------------------------
#include <Wt/WContainerWidget>
struct Question;
struct QuestionDialog;
//---------------------------------------------------------------------------
///Qt dialog for QuestionDialog
struct WtQuestionDialog : public Wt::WContainerWidget
{
  WtQuestionDialog(const boost::shared_ptr<QuestionDialog>& dialog);

  ///Obtain a read-only pointer to the dialog
  const QuestionDialog * GetDialog() const { return m_dialog.get(); }

  ///Obtain the version of this class
  static const std::string GetVersion();

  ///Obtain the version history of this class
  static const std::vector<std::string> GetVersionHistory();

  ///This signal is emitted when the client submits an answer
  mutable boost::signals2::signal<void ()> m_signal_submitted;

  protected:
  virtual ~WtQuestionDialog() {}

  boost::shared_ptr<QuestionDialog> m_dialog;
};
//---------------------------------------------------------------------------


#endif // WTQUESTIONDIALOG_H

 

 

 

 

 

wtquestiondialog.cpp

 

//---------------------------------------------------------------------------
/*
WtQuestionDialog, Wt dialog for QuestionDialog
Copyright (C) 2011 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, 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 License for more details.
You should have received a copy of the GNU General Public License
along with this program.If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/CppWtQuestionDialog.htm
//---------------------------------------------------------------------------
#include "wtquestiondialog.h"
//---------------------------------------------------------------------------
WtQuestionDialog::WtQuestionDialog(
  const boost::shared_ptr<QuestionDialog>& dialog)
  :  m_dialog(dialog)
{
  assert(m_dialog);
}
//---------------------------------------------------------------------------
const std::string WtQuestionDialog::GetVersion()
{
  return "1.0";
}
//---------------------------------------------------------------------------
const std::vector<std::string> WtQuestionDialog::GetVersionHistory()
{
  std::vector<std::string> v;
  v.push_back("2011-06-30: version 1.0: initial version");
  return v;
}
//---------------------------------------------------------------------------


 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml