PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PCanvas.h
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/PCanvas.h
4// Purpose: Contains specs for a drawable canvas
5// Author: Shane T. Mueller, Ph.D.
6// Copyright: (c) 2010-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#ifndef __PCANVAS_H__
28#define __PCANVAS_H__
29
30#include "../utility/rc_ptrs.h"
31#include "PWidget.h"
32#include "PColor.h"
33
34
37
38class PCanvas: virtual public PWidget
39{
40public:
41 PCanvas();
42 PCanvas(int width, int height, Variant color);
43 PCanvas(int width, int height);
44 PCanvas(PCanvas & canvas);
45 virtual ~PCanvas();
46
47
48 //overloaded generic PObject methods
49 virtual bool SetProperty(std::string, Variant v);
50 virtual Variant GetProperty(std::string)const;
51 virtual ObjectValidationError ValidateProperty(std::string, Variant v)const;
52 virtual ObjectValidationError ValidateProperty(std::string)const;
53
54 virtual void SetPosition(pInt x, pInt y);
55 virtual void SetHeight(int h);
56 virtual void SetWidth(int w);
57 virtual void SetColor(Variant col);
58 virtual std::string ObjectName() const;
59
60 virtual bool GetDrawBackground()const{return mDrawBackground;};
61private:
62
63
64protected:
65
67 bool mReset;
68 virtual std::ostream & SendToStream(std::ostream& out) const{return out;};
69
70};
71
72
73#endif
74
#define pInt
Definition Defs.h:8
ObjectValidationError
Definition PEBLObject.h:37
This class is the basic generic text box.
Definition PCanvas.h:39
virtual ~PCanvas()
Definition PCanvas.cpp:79
virtual void SetWidth(int w)
Definition PCanvas.cpp:153
bool mReset
Definition PCanvas.h:67
virtual void SetColor(Variant col)
Definition PCanvas.cpp:112
virtual bool SetProperty(std::string, Variant v)
Definition PCanvas.cpp:84
virtual void SetHeight(int h)
Definition PCanvas.cpp:145
virtual void SetPosition(pInt x, pInt y)
This sets the widget's position on its parent widget.
Definition PCanvas.cpp:102
virtual std::string ObjectName() const
Definition PCanvas.cpp:162
virtual ObjectValidationError ValidateProperty(std::string, Variant v) const
Definition PCanvas.cpp:128
bool mDrawBackground
Definition PCanvas.h:66
virtual Variant GetProperty(std::string) const
Definition PCanvas.cpp:122
PCanvas()
Definition PCanvas.cpp:39
virtual bool GetDrawBackground() const
Definition PCanvas.h:60
PCanvas(PCanvas &canvas)
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.
Definition PCanvas.h:68