PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
validator/PlatformLabel.h
Go to the documentation of this file.
1//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3// Name: platforms/validator/PlatformLabel.h
4// Purpose: Validator Platform Label (no rendering stub)
5// Author: Shane T. Mueller, Ph.D.
6// Copyright: (c) 2025 Shane T. Mueller <smueller@obereed.net>
7// License: GPL 2
8//
9// This file is part of the PEBL project.
10//
11// PEBL is free software; you can redistribute it and/or modify
12// it under the terms of the GNU General Public License as published by
13// the Free Software Foundation; either version 2 of the License, or
14// (at your option) any later version.
15//
16// PEBL is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with PEBL; if not, write to the Free Software
23// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25#ifndef __VALIDATOR_PLATFORMLABEL_H__
26#define __VALIDATOR_PLATFORMLABEL_H__
27
28#include "PlatformWidget.h"
29#include "../../objects/PLabel.h"
30#include "../../utility/rc_ptrs.h"
31
33class PlatformLabel : virtual public PlatformWidget, virtual public PLabel {
34public:
35 PlatformLabel(const std::string& text, counted_ptr<PEBLObjectBase> font);
37 virtual ~PlatformLabel();
38
39 virtual bool Draw();
40 virtual std::string ObjectName() const { return "PlatformLabel (validator)"; }
41 virtual void SetFont(counted_ptr<PEBLObjectBase> font) {} // Stub for validator
42
43 // Resolve ambiguity by explicitly delegating to PLabel
44 virtual bool SetProperty(std::string name, Variant v) { return PLabel::SetProperty(name, v); }
45 virtual ObjectValidationError ValidateProperty(std::string name, Variant v) const { return PLabel::ValidateProperty(name, v); }
46 virtual ObjectValidationError ValidateProperty(std::string name) const { return PLabel::ValidateProperty(name); }
47
48 // Resolve SetPosition ambiguity
49 virtual void SetPosition(pInt x, pInt y) { PLabel::SetPosition(x, y); }
50
51protected:
52 virtual std::ostream& SendToStream(std::ostream& out) const;
53
54private:
56};
57
58#endif
#define pInt
Definition Defs.h:8
ObjectValidationError
Definition PEBLObject.h:37
virtual ObjectValidationError ValidateProperty(std::string, Variant v) const
Definition PLabel.cpp:89
virtual bool SetProperty(std::string, Variant v)
Definition PLabel.cpp:69
void SetPosition(pInt x, pInt y)
This sets the widget's position on its parent widget.
Definition PLabel.cpp:110
Validator platform label - no rendering, used only for compilation.
virtual ObjectValidationError ValidateProperty(std::string name, Variant v) const
virtual bool SetProperty(std::string name, Variant v)
virtual ~PlatformLabel()
PlatformLabel(const std::string &text, counted_ptr< PEBLObjectBase > font)
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.
PlatformLabel(PlatformLabel &label)
virtual void SetPosition(pInt x, pInt y)
This sets the widget's position on its parent widget.
virtual std::string ObjectName() const
virtual bool Draw()
This method initiates everything needed to display the main window
virtual ObjectValidationError ValidateProperty(std::string name) const
virtual void SetFont(counted_ptr< PEBLObjectBase > font)