PEBL
2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PLabel.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/PLabel.h
4
// Purpose: Contains generic specs for a visually-displayed text.
5
// Author: Shane T. Mueller, Ph.D.
6
// Copyright: (c) 2004-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 __PLABEL_H__
28
#define __PLABEL_H__
29
30
31
#include "
PTextObject.h
"
32
#include "
PFont.h
"
33
#include "
PColor.h
"
34
#include "../utility/rc_ptrs.h"
35
36
#include <string>
37
42
43
44
class
PLabel
:
virtual
public
PTextObject
45
{
46
public
:
47
PLabel
();
48
PLabel
(
const
std::string & text);
49
PLabel
(
const
PLabel
& label);
50
virtual
~PLabel
();
51
52
53
//overloaded generic PObject methods
54
virtual
bool
SetProperty
(std::string,
Variant
v);
55
virtual
Variant
GetProperty
(std::string)
const
;
56
virtual
ObjectValidationError
ValidateProperty
(std::string,
Variant
v)
const
;
57
virtual
ObjectValidationError
ValidateProperty
(std::string)
const
;
58
59
void
SetPosition
(
pInt
x,
pInt
y);
60
//This overrides the default method, because labels are centered on their
61
//Position.
62
virtual
std::string
ObjectName
()
const
;
63
private
:
64
65
66
protected
:
67
68
69
virtual
std::ostream &
SendToStream
(std::ostream& out)
const
{
return
out;};
70
71
72
};
73
74
75
#endif
pInt
#define pInt
Definition
Defs.h:8
PColor.h
ObjectValidationError
ObjectValidationError
Definition
PEBLObject.h:37
PFont.h
PTextObject.h
PLabel
Definition
PLabel.h:45
PLabel::ValidateProperty
virtual ObjectValidationError ValidateProperty(std::string, Variant v) const
Definition
PLabel.cpp:89
PLabel::~PLabel
virtual ~PLabel()
Definition
PLabel.cpp:64
PLabel::GetProperty
virtual Variant GetProperty(std::string) const
Definition
PLabel.cpp:83
PLabel::SetProperty
virtual bool SetProperty(std::string, Variant v)
Definition
PLabel.cpp:69
PLabel::PLabel
PLabel()
Definition
PLabel.cpp:36
PLabel::SetPosition
void SetPosition(pInt x, pInt y)
This sets the widget's position on its parent widget.
Definition
PLabel.cpp:110
PLabel::SendToStream
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.
Definition
PLabel.h:69
PLabel::ObjectName
virtual std::string ObjectName() const
Definition
PLabel.cpp:124
PTextObject
This class simply represent an abstract text-based object.
Definition
PTextObject.h:41
Variant
Definition
Variant.h:67
src
objects
PLabel.h
Generated by
1.9.8