|
PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
|
#include <PWidget.h>
Public Member Functions | |
| PWidget () | |
| PWidget (const PWidget &pw) | |
| PWidget (pInt x, pInt y, pInt width, pInt height, bool visible) | |
| virtual | ~PWidget () |
| virtual bool | SetProperty (std::string, Variant v) |
| virtual Variant | GetProperty (std::string) const |
| virtual ObjectValidationError | ValidateProperty (std::string, Variant v) const |
| virtual ObjectValidationError | ValidateProperty (std::string) const |
| virtual bool | RotoZoom (pDouble angle, pDouble zoomx, pDouble zoomy, pInt smooth) |
| virtual bool | SetPoint (pInt x, pInt y, PColor col) |
| virtual PColor | GetPixel (pInt x, pInt y) |
| virtual void | SetParent (PWidget *widget) |
| This unconditionally sets the parent widget. | |
| virtual PWidget * | GetParent () |
| virtual bool | IsParent (PWidget *parent) |
| virtual bool | Draw () |
| virtual void | SetPosition (pInt x, pInt y) |
| This sets the widget's position on its parent widget. | |
| virtual void | SetZoomX (pDouble x) |
| This sets the widget's position on its parent widget. | |
| virtual void | SetZoomY (pDouble x) |
| This sets the widget's position on its parent widget. | |
| virtual void | SetRotation (pDouble x) |
| This sets the widget's position on its parent widget. | |
| virtual void | SetWidth (pInt w) |
| virtual void | SetHeight (pInt h) |
| virtual pInt | GetX () const |
| virtual pInt | GetY () const |
| virtual pInt | GetWidth () const |
| virtual pInt | GetHeight () const |
| virtual void | SetBackgroundColor (const PColor &color) |
| virtual PColor | GetBackgroundColor () |
| virtual bool | AddSubWidget (PWidget *widget) |
| virtual bool | RemoveSubWidget (PWidget *widget) |
| virtual bool | RemoveSubWidgets () |
| virtual bool | RemoveLastSubWidget () |
| This is probably pretty useless. | |
| virtual void | Show () |
| virtual void | Hide () |
| virtual bool | IsVisible () const |
| virtual std::string | ObjectName () const |
Public Member Functions inherited from PEBLObjectBase | |
| PEBLObjectBase () | |
| Standard Constructor. | |
| PEBLObjectBase (ComplexDataType cdt) | |
| Standard Constructor. | |
| PEBLObjectBase (const PEBLObjectBase &pob) | |
| virtual | ~PEBLObjectBase () |
| Standard Destructor. | |
| virtual bool | InitializeProperty (std::string name, Variant v) |
| Variant | GetProperty (std::string) const |
| ComplexDataType | GetType () |
| virtual std::ostream & | PrintProperties (std::ostream &out) |
| virtual Variant | GetPropertyList () |
Protected Member Functions | |
| virtual std::ostream & | SendToStream (std::ostream &out) const |
| An inheritable printing class used by PEBLObjectBase::operator<<. | |
Protected Attributes | |
| pInt | mX |
| pInt | mY |
| pInt | mDrawX |
| pInt | mDrawY |
| pInt | mWidth |
| pInt | mHeight |
| pDouble | mZoomX |
| pDouble | mZoomY |
| pDouble | mRotation |
| PColor | mBackgroundColor |
| The background color of the widget. if alpha = 0, will not be painted. | |
| std::list< PWidget * > | mSubWidgets |
| bool | mIsVisible |
| PWidget * | mParent |
Protected Attributes inherited from PEBLObjectBase | |
| ComplexDataType | mCDT |
| std::map< std::string, Variant > | mProperties |
This class is the main visual gui base class. It is an abstract class, containing methods that need to be overriden by an inherited class (i.e., Platform*) to be used.
| PWidget::PWidget | ( | ) |
Definition at line 37 of file PWidget.cpp.
References PEBLObjectBase::InitializeProperty(), mHeight, mIsVisible, mRotation, mWidth, mX, mY, mZoomX, and mZoomY.
| PWidget::PWidget | ( | const PWidget & | pw | ) |
Definition at line 91 of file PWidget.cpp.
References PEBLObjectBase::InitializeProperty(), mHeight, mIsVisible, mRotation, mWidth, mX, mY, mZoomX, and mZoomY.
Definition at line 64 of file PWidget.cpp.
References PEBLObjectBase::InitializeProperty(), mHeight, mIsVisible, mRotation, mWidth, mX, mY, mZoomX, and mZoomY.
|
virtual |
Definition at line 111 of file PWidget.cpp.
|
virtual |
AddSubWidget takes care of adding a widget to a current parent widget, and setting the parent field of the child widget to the parent widget.
Definition at line 330 of file PWidget.cpp.
References GetParent(), mSubWidgets, NULL, RemoveSubWidget(), and SetParent().
Referenced by PlatformWidget::AddSubWidget().
|
inlinevirtual |
This draws the subwidgets. It doesn't need a 'parent' argument, because 'this' is it.
Reimplemented in PWindow, PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, PlatformWidget, PlatformWindow, PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, PlatformWidget, and PlatformWindow.
Definition at line 68 of file PWidget.h.
Referenced by PRectangle::SetSize().
|
inlinevirtual |
Definition at line 92 of file PWidget.h.
References mBackgroundColor.
Referenced by PlatformTextBox::Draw(), and PlatformTextBox::SetFont().
|
inlinevirtual |
Reimplemented in PLine, PRectangle, PSquare, PEllipse, PCircle, PPolygon, PBezier, and PlatformWindow.
Definition at line 86 of file PWidget.h.
References mHeight.
Referenced by PlatformWindow::GetHeight(), PEBLObjects::GetSize(), PlatformCanvas::PlatformCanvas(), PlatformLabel::PlatformLabel(), PlatformTextBox::PlatformTextBox(), PMovie::SetPosition(), PCanvas::SetPosition(), PImageBox::SetPosition(), and PLabel::SetPosition().
|
inlinevirtual |
Definition at line 63 of file PWidget.h.
References mParent.
Referenced by AddSubWidget(), PEBLObjects::GetParent(), and IsParent().
Reimplemented in PlatformWidget.
Definition at line 133 of file PWidget.cpp.
|
virtual |
Reimplemented in PlatformTextBox, PCanvas, PDrawObject, PLine, PThickLine, PRectangle, PSquare, PEllipse, PCircle, PPolygon, PBezier, PImageBox, PLabel, PMovie, PTextBox, PTextObject, and PWindow.
Definition at line 181 of file PWidget.cpp.
References PEBLObjectBase::GetProperty().
Referenced by PCanvas::GetProperty().
|
inlinevirtual |
Reimplemented in PLine, PRectangle, PSquare, PEllipse, PCircle, PPolygon, PBezier, and PlatformWindow.
Definition at line 85 of file PWidget.h.
References mWidth.
Referenced by PEBLObjects::GetSize(), PlatformWindow::GetWidth(), PlatformCanvas::PlatformCanvas(), PlatformLabel::PlatformLabel(), PlatformTextBox::PlatformTextBox(), PMovie::SetPosition(), PCanvas::SetPosition(), PImageBox::SetPosition(), and PLabel::SetPosition().
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
Definition at line 402 of file PWidget.cpp.
References mIsVisible, and PEBLObjectBase::SetProperty().
Referenced by PEBLObjects::Hide(), PImageBox::SetProperty(), PMovie::SetProperty(), and SetProperty().
|
virtual |
Definition at line 323 of file PWidget.cpp.
References GetParent().
Referenced by PEBLObjects::RemoveObject().
|
inlinevirtual |
Definition at line 113 of file PWidget.h.
References mIsVisible.
Referenced by PlatformWidget::Draw().
|
inlinevirtual |
Reimplemented from PEBLObjectBase.
Reimplemented in PCanvas, PImageBox, PLabel, PMovie, PTextBox, PTextObject, PWindow, PlatformCanvas, PlatformImageBox, PlatformLabel, PlatformTextBox, PlatformWindow, PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, and PlatformWindow.
Definition at line 115 of file PWidget.h.
Referenced by PlatformWidget::AddSubWidget().
|
virtual |
This is probably pretty useless.
Definition at line 388 of file PWidget.cpp.
References mSubWidgets.
|
virtual |
This method iterates through the subwidgets and sees if any are equal to the argument. If so, it removes it. It does not delete it.
Definition at line 375 of file PWidget.cpp.
References mSubWidgets, NULL, and SetParent().
Referenced by AddSubWidget(), PlatformWidget::RemoveSubWidget(), and PlatformWidget::~PlatformWidget().
|
virtual |
Reimplemented in PlatformWidget.
Definition at line 353 of file PWidget.cpp.
References mSubWidgets, and NULL.
Reimplemented in PlatformWidget.
Definition at line 118 of file PWidget.cpp.
|
protectedvirtual |
An inheritable printing class used by PEBLObjectBase::operator<<.
Reimplemented from PEBLObjectBase.
Reimplemented in PCanvas, PImageBox, PLabel, PMovie, PTextBox, PTextObject, PWindow, PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, PlatformWidget, PlatformWindow, PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, PlatformWidget, PlatformWindow, and PDrawObject.
Definition at line 280 of file PWidget.cpp.
|
virtual |
Reimplemented in PlatformWindow.
Definition at line 287 of file PWidget.cpp.
References PColor::GetAlpha(), PColor::GetBlue(), PColor::GetGreen(), PColor::GetRed(), mBackgroundColor, PColor::SetAlpha(), PColor::SetBlue(), PColor::SetGreen(), PEBLObjectBase::SetProperty(), and PColor::SetRed().
Referenced by PlatformTextBox::Draw(), PlatformWindow::PlatformWindow(), PlatformWindow::SetBackgroundColor(), PCanvas::SetColor(), PlatformTextBox::SetFont(), and SetProperty().
|
virtual |
Reimplemented in PlatformCanvas.
Definition at line 258 of file PWidget.cpp.
References mHeight, and PEBLObjectBase::SetProperty().
Referenced by SetProperty().
|
virtual |
This unconditionally sets the parent widget.
Definition at line 315 of file PWidget.cpp.
References mParent, and PEBLObjectBase::SetProperty().
Referenced by AddSubWidget(), RemoveSubWidget(), and PlatformWidget::SetParent().
Reimplemented in PlatformWidget.
Definition at line 125 of file PWidget.cpp.
This sets the widget's position on its parent widget.
Sets the location of the upper left-hand corner of the image on the parent widget; unless overridden
Reimplemented in PCanvas, PThickLine, PImageBox, PLabel, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformLabel, PlatformTextBox, and PlatformWindow.
Definition at line 220 of file PWidget.cpp.
References mDrawX, mDrawY, mX, mY, and PEBLObjectBase::SetProperty().
Referenced by PlatformWidget::Draw(), PEBLObjects::Move(), PBezier::PBezier(), PCircle::PCircle(), PEllipse::PEllipse(), PLine::PLine(), PPolygon::PPolygon(), PRectangle::PRectangle(), PMovie::SetPosition(), PThickLine::SetPosition(), PlatformLine::SetPosition(), PlatformRectangle::SetPosition(), PlatformSquare::SetPosition(), PlatformEllipse::SetPosition(), PlatformCircle::SetPosition(), PlatformPolygon::SetPosition(), PlatformBezier::SetPosition(), PlatformTextBox::SetPosition(), PlatformWindow::SetPosition(), and SetProperty().
|
virtual |
Reimplemented from PEBLObjectBase.
Reimplemented in PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, PlatformWindow, PCanvas, PDrawObject, PLine, PThickLine, PRectangle, PSquare, PEllipse, PCircle, PPolygon, PBezier, PImageBox, PLabel, PMovie, PTextBox, PTextObject, PWindow, PlatformCanvas, PlatformLabel, and PlatformTextBox.
Definition at line 142 of file PWidget.cpp.
References Hide(), mX, mY, OVE_SUCCESS, pDouble, pInt, SetBackgroundColor(), SetHeight(), SetPosition(), PEBLObjectBase::SetProperty(), SetRotation(), SetWidth(), SetZoomX(), SetZoomY(), Show(), PError::SignalFatalError(), and ValidateProperty().
Referenced by PEBLObjects::AddObject(), PlatformWidget::Draw(), PlatformWindow::Initialize(), PlatformImageBox::LoadImage(), PlatformWidget::RotoZoom(), PCanvas::SetProperty(), PDrawObject::SetProperty(), PImageBox::SetProperty(), PMovie::SetProperty(), PTextObject::SetProperty(), PWindow::SetProperty(), SetZoomX(), and SetZoomY().
|
virtual |
This sets the widget's position on its parent widget.
Definition at line 273 of file PWidget.cpp.
References mRotation, and PEBLObjectBase::SetProperty().
Referenced by SetProperty().
|
virtual |
Reimplemented in PlatformCanvas.
Definition at line 265 of file PWidget.cpp.
References mWidth, and PEBLObjectBase::SetProperty().
Referenced by SetProperty().
|
virtual |
This sets the widget's position on its parent widget.
Reimplemented in PlatformImageBox.
Definition at line 236 of file PWidget.cpp.
References mX, mZoomX, PEBLObjectBase::SetProperty(), and SetProperty().
Referenced by PImageBox::SetProperty(), and SetProperty().
|
virtual |
This sets the widget's position on its parent widget.
Reimplemented in PlatformImageBox.
Definition at line 247 of file PWidget.cpp.
References mY, mZoomY, PEBLObjectBase::SetProperty(), and SetProperty().
Referenced by PImageBox::SetProperty(), and SetProperty().
|
virtual |
These change the visibility state. If invisible, the widget gets skipped over when drawn.
Definition at line 396 of file PWidget.cpp.
References mIsVisible, and PEBLObjectBase::SetProperty().
Referenced by PImageBox::SetProperty(), PMovie::SetProperty(), SetProperty(), and PEBLObjects::Show().
|
virtual |
Reimplemented from PEBLObjectBase.
Reimplemented in PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, PlatformWindow, PCanvas, PDrawObject, PLine, PThickLine, PRectangle, PSquare, PEllipse, PCircle, PPolygon, PBezier, PImageBox, PLabel, PMovie, PTextBox, PTextObject, and PWindow.
Definition at line 194 of file PWidget.cpp.
References OVE_INVALID_PROPERTY_NAME, and OVE_VALID.
|
virtual |
Reimplemented from PEBLObjectBase.
Reimplemented in PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, PlatformWindow, PCanvas, PDrawObject, PLine, PThickLine, PRectangle, PSquare, PEllipse, PCircle, PPolygon, PBezier, PImageBox, PLabel, PMovie, PTextBox, PTextObject, and PWindow.
Definition at line 188 of file PWidget.cpp.
References ValidateProperty().
Referenced by SetProperty(), PCanvas::ValidateProperty(), PDrawObject::ValidateProperty(), PImageBox::ValidateProperty(), PMovie::ValidateProperty(), PTextObject::ValidateProperty(), PWindow::ValidateProperty(), and ValidateProperty().
|
protected |
The background color of the widget. if alpha = 0, will not be painted.
Definition at line 144 of file PWidget.h.
Referenced by PlatformWindow::Draw(), GetBackgroundColor(), PlatformCanvas::Reset(), and SetBackgroundColor().
|
protected |
Definition at line 129 of file PWidget.h.
Referenced by PlatformWidget::Draw(), PMovie::SetPosition(), PCanvas::SetPosition(), PImageBox::SetPosition(), PLabel::SetPosition(), and SetPosition().
|
protected |
Definition at line 130 of file PWidget.h.
Referenced by PlatformWidget::Draw(), PMovie::SetPosition(), PCanvas::SetPosition(), PImageBox::SetPosition(), PLabel::SetPosition(), and SetPosition().
|
protected |
Definition at line 136 of file PWidget.h.
Referenced by PlatformLabel::Draw(), PlatformWidget::Draw(), PlatformTextBox::FindCursorPosition(), PPolygon::GetHeight(), PBezier::GetHeight(), GetHeight(), PlatformImageBox::LoadImage(), PlatformCanvas::PlatformCanvas(), PlatformCanvas::PlatformCanvas(), PlatformTextBox::PlatformTextBox(), PWidget(), PWidget(), PWidget(), PlatformLabel::RenderText(), PlatformTextBox::RenderText(), PlatformWidget::RotoZoom(), PCanvas::SetHeight(), PTextBox::SetHeight(), SetHeight(), PlatformCanvas::SetHeight(), PImageBox::SetProperty(), PMovie::SetProperty(), PImageBox::SetSize(), PMovie::SetSize(), and PlatformCanvas::SetZoomY().
|
protected |
Definition at line 150 of file PWidget.h.
Referenced by Hide(), IsVisible(), PlatformBezier::PlatformBezier(), PlatformCircle::PlatformCircle(), PlatformEllipse::PlatformEllipse(), PlatformLine::PlatformLine(), PlatformPolygon::PlatformPolygon(), PlatformRectangle::PlatformRectangle(), PlatformSquare::PlatformSquare(), PlatformThickLine::PlatformThickLine(), PWidget(), PWidget(), PWidget(), PlatformSquare::SendToStream(), and Show().
|
protected |
The parent widget. If null (0), this has no parent (top-level window). or is currently unattached.
Definition at line 154 of file PWidget.h.
Referenced by PlatformLine::Draw(), PlatformThickLine::Draw(), PlatformRectangle::Draw(), PlatformSquare::Draw(), PlatformEllipse::Draw(), PlatformCircle::Draw(), PlatformPolygon::Draw(), PlatformBezier::Draw(), PlatformWidget::Draw(), GetParent(), PlatformBezier::PlatformBezier(), PlatformCircle::PlatformCircle(), PlatformEllipse::PlatformEllipse(), PlatformLine::PlatformLine(), PlatformPolygon::PlatformPolygon(), PlatformRectangle::PlatformRectangle(), PlatformSquare::PlatformSquare(), PlatformThickLine::PlatformThickLine(), SetParent(), and PlatformWidget::~PlatformWidget().
|
protected |
Definition at line 141 of file PWidget.h.
Referenced by PlatformWidget::Draw(), PWidget(), PWidget(), PWidget(), PlatformWidget::RotoZoom(), and SetRotation().
|
protected |
Definition at line 147 of file PWidget.h.
Referenced by AddSubWidget(), PlatformWidget::Draw(), PlatformWindow::Draw(), PlatformWidget::PrintSubWidgets(), RemoveLastSubWidget(), PlatformWidget::RemoveSubWidget(), RemoveSubWidget(), RemoveSubWidgets(), PlatformWidget::RemoveSubWidgets(), and PlatformWidget::SetRenderer().
|
protected |
The height and width, in pixels, of the loaded widget. This is the actual size displayed on the screen, not the texture size
Definition at line 136 of file PWidget.h.
Referenced by PlatformLabel::Draw(), PlatformWidget::Draw(), PlatformTextBox::FindCursorPosition(), PPolygon::GetWidth(), PBezier::GetWidth(), GetWidth(), PlatformTextBox::HandleKeyPress(), PlatformImageBox::LoadImage(), PlatformCanvas::PlatformCanvas(), PlatformCanvas::PlatformCanvas(), PlatformTextBox::PlatformTextBox(), PWidget(), PWidget(), PWidget(), PlatformLabel::RenderText(), PlatformTextBox::RenderText(), PlatformWidget::RotoZoom(), PImageBox::SetProperty(), PMovie::SetProperty(), PImageBox::SetSize(), PMovie::SetSize(), PCanvas::SetWidth(), PTextBox::SetWidth(), PlatformCanvas::SetWidth(), SetWidth(), and PlatformCanvas::SetZoomX().
|
protected |
The x and y coordinates, in pixels, from the upper left corner of the parent screen
Definition at line 125 of file PWidget.h.
Referenced by PlatformLine::Draw(), PlatformRectangle::Draw(), PlatformSquare::Draw(), PlatformEllipse::Draw(), PlatformCircle::Draw(), PlatformPolygon::Draw(), PlatformBezier::Draw(), PlatformLabel::Draw(), PlatformWidget::Draw(), GetX(), PWidget(), PWidget(), PWidget(), PlatformLine::SendToStream(), PlatformRectangle::SendToStream(), PlatformSquare::SendToStream(), PlatformEllipse::SendToStream(), PlatformCircle::SendToStream(), PlatformPolygon::SendToStream(), PlatformBezier::SendToStream(), PThickLine::SetEnds(), PCanvas::SetPosition(), PThickLine::SetPosition(), PImageBox::SetPosition(), PLabel::SetPosition(), SetPosition(), PImageBox::SetProperty(), PMovie::SetProperty(), SetProperty(), PImageBox::SetSize(), PlatformCanvas::SetZoomX(), SetZoomX(), and PlatformImageBox::SetZoomX().
|
protected |
Definition at line 125 of file PWidget.h.
Referenced by PlatformLine::Draw(), PlatformRectangle::Draw(), PlatformSquare::Draw(), PlatformEllipse::Draw(), PlatformCircle::Draw(), PlatformPolygon::Draw(), PlatformBezier::Draw(), PlatformLabel::Draw(), PlatformWidget::Draw(), GetY(), PWidget(), PWidget(), PWidget(), PlatformLine::SendToStream(), PlatformRectangle::SendToStream(), PlatformSquare::SendToStream(), PlatformEllipse::SendToStream(), PlatformCircle::SendToStream(), PlatformPolygon::SendToStream(), PlatformBezier::SendToStream(), PThickLine::SetEnds(), PCanvas::SetPosition(), PThickLine::SetPosition(), PImageBox::SetPosition(), PLabel::SetPosition(), SetPosition(), PImageBox::SetProperty(), PMovie::SetProperty(), SetProperty(), PImageBox::SetSize(), PlatformCanvas::SetZoomY(), SetZoomY(), and PlatformImageBox::SetZoomY().
|
protected |
Definition at line 139 of file PWidget.h.
Referenced by PlatformWidget::Draw(), PWidget(), PWidget(), PWidget(), PlatformWidget::RotoZoom(), PlatformCanvas::SetZoomX(), SetZoomX(), and PlatformImageBox::SetZoomX().
|
protected |
Definition at line 140 of file PWidget.h.
Referenced by PlatformWidget::Draw(), PWidget(), PWidget(), PWidget(), PlatformWidget::RotoZoom(), PlatformCanvas::SetZoomY(), SetZoomY(), and PlatformImageBox::SetZoomY().