PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PWindow.cpp
Go to the documentation of this file.
1//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3// Name: src/objects/PWindow.cpp
4// Purpose: Contains generic specification for a main window class.
5// Author: Shane T. Mueller, Ph.D.
6// Copyright: (c) 2003-2026 Shane T. Mueller <smueller@obereed.net>
7// License: GPL 2
8//
9//
10//
11// This file is part of the PEBL project.
12//
13// PEBL is free software; you can redistribute it and/or modify
14// it under the terms of the GNU General Public License as published by
15// the Free Software Foundation; either version 2 of the License, or
16// (at your option) any later version.
17//
18// PEBL is distributed in the hope that it will be useful,
19// but WITHOUT ANY WARRANTY; without even the implied warranty of
20// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21// GNU General Public License for more details.
22//
23// You should have received a copy of the GNU General Public License
24// along with PEBL; if not, write to the Free Software
25// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27#include "PWindow.h"
28#include "PWidget.h"
29#include "PEnvironment.h"
30
31#include <string>
32#include <iostream>
33using std::cout;
34using std::endl;
35
36
38 mEnv(penv)
39{
40 InitializeProperty("NAME",Variant("<WINDOW>"));
41
42}
43
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}
55
56bool PWindow::SetProperty(std::string name, Variant v)
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}
69
70
71Variant PWindow::GetProperty(std::string name)const
72{
73 return PEBLObjectBase::GetProperty(name);
74}
75
76
78{
79 return ValidateProperty(name);
80}
81
83{
84
86
87 if(ove == OVE_VALID)
88 return ove;
89
90 else
92
93}
94
#define NULL
Definition BinReloc.cpp:317
ObjectValidationError
Definition PEBLObject.h:37
@ OVE_INVALID_PROPERTY_NAME
Definition PEBLObject.h:40
@ OVE_VALID
Definition PEBLObject.h:39
virtual bool InitializeProperty(std::string name, Variant v)
Variant GetProperty(std::string) const
virtual bool RemoveWindow(PWindow *window)
virtual ObjectValidationError ValidateProperty(std::string, Variant v) const
Definition PWidget.cpp:188
virtual bool SetProperty(std::string, Variant v)
Definition PWidget.cpp:142
virtual bool SetProperty(std::string, Variant v)
Definition PWindow.cpp:56
virtual Variant GetProperty(std::string) const
Definition PWindow.cpp:71
virtual ~PWindow()
Definition PWindow.cpp:44
virtual ObjectValidationError ValidateProperty(std::string, Variant v) const
Definition PWindow.cpp:77
PEnvironment * mEnv
Definition PWindow.h:61
PWindow(PEnvironment *penv)
Definition PWindow.cpp:37