PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PWindow Class Reference

#include <PWindow.h>

Inheritance diagram for PWindow:
PWidget PEBLObjectBase PlatformWindow PlatformWindow

Public Member Functions

 PWindow (PEnvironment *penv)
 
virtual ~PWindow ()
 
virtual bool Draw ()
 
virtual std::string ObjectName () const
 
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
 
- Public Member Functions inherited from PWidget
 PWidget ()
 
 PWidget (const PWidget &pw)
 
 PWidget (pInt x, pInt y, pInt width, pInt height, bool visible)
 
virtual ~PWidget ()
 
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 PWidgetGetParent ()
 
virtual bool IsParent (PWidget *parent)
 
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
 
- 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

PEnvironmentmEnv
 
- Protected Attributes inherited from PWidget
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
 
PWidgetmParent
 
- Protected Attributes inherited from PEBLObjectBase
ComplexDataType mCDT
 
std::map< std::string, VariantmProperties
 

Detailed Description

This class, a subtype of PWidget, is the base window class It is an 'abstract' class, and needs to be inherited by a PlatformClass with its methods overridden to be used. Specifically, abstract methods from PWidget need to be instantiated.

Definition at line 42 of file PWindow.h.

Constructor & Destructor Documentation

◆ PWindow()

PWindow::PWindow ( PEnvironment penv)

Definition at line 37 of file PWindow.cpp.

37 :
38 mEnv(penv)
39{
40 InitializeProperty("NAME",Variant("<WINDOW>"));
41
42}
virtual bool InitializeProperty(std::string name, Variant v)
PEnvironment * mEnv
Definition PWindow.h:61

References PEBLObjectBase::InitializeProperty().

◆ ~PWindow()

PWindow::~PWindow ( )
virtual

Definition at line 44 of file PWindow.cpp.

45{
46 //this should remove itself from the environment.
47 // Check if environment still exists (it may have been destroyed during program exit)
48 if(mEnv != NULL)
49 {
50 mEnv->RemoveWindow(this);
51 }
52 //cout << "Deleting PWindow\n";
53
54}
#define NULL
Definition BinReloc.cpp:317
virtual bool RemoveWindow(PWindow *window)

References mEnv, NULL, and PEnvironment::RemoveWindow().

Member Function Documentation

◆ Draw()

virtual bool PWindow::Draw ( )
inlinevirtual

This draws the subwidgets. It doesn't need a 'parent' argument, because 'this' is it.

Reimplemented from PWidget.

Reimplemented in PlatformWindow, and PlatformWindow.

Definition at line 48 of file PWindow.h.

48{return true;}

◆ GetProperty()

Variant PWindow::GetProperty ( std::string  name) const
virtual

Reimplemented from PWidget.

Definition at line 71 of file PWindow.cpp.

72{
73 return PEBLObjectBase::GetProperty(name);
74}
Variant GetProperty(std::string) const

References PEBLObjectBase::GetProperty().

◆ ObjectName()

virtual std::string PWindow::ObjectName ( ) const
inlinevirtual

Reimplemented from PWidget.

Reimplemented in PlatformWindow, and PlatformWindow.

Definition at line 50 of file PWindow.h.

50{return "PWindow";};

◆ SendToStream()

virtual std::ostream & PWindow::SendToStream ( std::ostream &  out) const
inlineprotectedvirtual

An inheritable printing class used by PEBLObjectBase::operator<<.

Reimplemented from PWidget.

Reimplemented in PlatformWindow, and PlatformWindow.

Definition at line 60 of file PWindow.h.

60{return out;};

◆ SetProperty()

bool PWindow::SetProperty ( std::string  name,
Variant  v 
)
virtual

Reimplemented from PWidget.

Reimplemented in PlatformWindow.

Definition at line 56 of file PWindow.cpp.

57{
58
59
60 if(PWidget::SetProperty(name,v))
61 {
62 return true;
63 }
64 else
65 {
66 return PWidget::SetProperty(name,v);
67 }
68}
virtual bool SetProperty(std::string, Variant v)
Definition PWidget.cpp:142

References PWidget::SetProperty().

Referenced by PlatformWindow::SetProperty().

◆ ValidateProperty() [1/2]

ObjectValidationError PWindow::ValidateProperty ( std::string  name) const
virtual

Reimplemented from PWidget.

Reimplemented in PlatformWindow.

Definition at line 82 of file PWindow.cpp.

83{
84
86
87 if(ove == OVE_VALID)
88 return ove;
89
90 else
92
93}
ObjectValidationError
Definition PEBLObject.h:37
@ OVE_INVALID_PROPERTY_NAME
Definition PEBLObject.h:40
@ OVE_VALID
Definition PEBLObject.h:39
virtual ObjectValidationError ValidateProperty(std::string, Variant v) const
Definition PWidget.cpp:188

References OVE_INVALID_PROPERTY_NAME, OVE_VALID, and PWidget::ValidateProperty().

◆ ValidateProperty() [2/2]

ObjectValidationError PWindow::ValidateProperty ( std::string  name,
Variant  v 
) const
virtual

Reimplemented from PWidget.

Reimplemented in PlatformWindow.

Definition at line 77 of file PWindow.cpp.

78{
79 return ValidateProperty(name);
80}
virtual ObjectValidationError ValidateProperty(std::string, Variant v) const
Definition PWindow.cpp:77

References ValidateProperty().

Referenced by PlatformWindow::ValidateProperty(), PlatformWindow::ValidateProperty(), and ValidateProperty().

Member Data Documentation

◆ mEnv

PEnvironment* PWindow::mEnv
protected

Definition at line 61 of file PWindow.h.

Referenced by ~PWindow().


The documentation for this class was generated from the following files: