Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
A widget/control is a user interface element, like a button or checkbox.
Widget is a GUI independent widget class
and servers as a base class for others (incomplete list):
Similar widget classes are
QWidget and Wt::WWidget.
widget.h
widget.cpp
//---------------------------------------------------------------------------
/*
Widget, GUI independent widget class
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/CppWidget.htm
//---------------------------------------------------------------------------
#include "widget.h"
//---------------------------------------------------------------------------
const std::string Widget::GetVersion()
{
return "1.1";
}
//---------------------------------------------------------------------------
const std::vector<std::string> Widget::GetVersionHistory()
{
std::vector<std::string> v;
v.push_back("YYYY-MM-DD: version X.Y: [description]");
v.push_back("2011-07-03: version 1.0: initial version");
v.push_back("2011-08-07: version 1.1: added signal that is emitted when geometry changes");
return v;
}
//---------------------------------------------------------------------------
void Widget::SetGeometry(const Rect& geometry)
{
if (geometry != m_geometry)
{
m_geometry = geometry;
m_signal_geometry_changed();
}
}
//---------------------------------------------------------------------------
|
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.

This page has been created by the tool CodeToHtml