PEBL
2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
validator/PlatformTextBox.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/PlatformTextBox.h
4
// Purpose: Validator Platform TextBox (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_PLATFORMTEXTBOX_H__
26
#define __VALIDATOR_PLATFORMTEXTBOX_H__
27
28
#include "
PlatformWidget.h
"
29
#include "../../objects/PTextBox.h"
30
#include "../../utility/rc_ptrs.h"
31
33
class
PlatformTextBox
:
virtual
public
PlatformWidget
,
virtual
public
PTextBox
{
34
public
:
35
PlatformTextBox
(
const
std::string& text,
counted_ptr<PEBLObjectBase>
font,
36
int
width,
int
height);
37
PlatformTextBox
(
PlatformTextBox
& textbox);
38
virtual
~PlatformTextBox
();
39
40
virtual
bool
Draw
();
41
virtual
std::string
ObjectName
()
const
{
return
"PlatformTextBox (validator)"
; }
42
virtual
int
FindCursorPosition
(
long
int
x,
long
int
y) {
return
0; }
// Stub for validator
43
virtual
Variant
GetLineBreaks
() {
return
Variant
(0); }
// Stub for validator
44
virtual
void
SetFont
(
counted_ptr<PEBLObjectBase>
font) {}
// Stub for validator
45
46
// Resolve ambiguity by explicitly delegating to PTextBox
47
virtual
bool
SetProperty
(std::string name,
Variant
v) {
48
return
PTextBox::SetProperty
(name, v);
49
}
50
virtual
ObjectValidationError
ValidateProperty
(std::string name,
Variant
v)
const
{
51
return
PTextBox::ValidateProperty
(name, v);
52
}
53
virtual
ObjectValidationError
ValidateProperty
(std::string name)
const
{
54
return
PTextBox::ValidateProperty
(name);
55
}
56
57
// Resolve SetPosition ambiguity
58
virtual
void
SetPosition
(
pInt
x,
pInt
y) {
PTextBox::SetPosition
(x, y); }
59
60
protected
:
61
virtual
std::ostream&
SendToStream
(std::ostream& out)
const
;
62
63
private
:
64
counted_ptr<PEBLObjectBase>
mFontObject;
65
};
66
67
#endif
pInt
#define pInt
Definition
Defs.h:8
ObjectValidationError
ObjectValidationError
Definition
PEBLObject.h:37
PTextBox
This class is the basic generic text box.
Definition
PTextBox.h:40
PTextBox::ValidateProperty
virtual ObjectValidationError ValidateProperty(std::string, Variant v) const
Definition
PTextBox.cpp:160
PTextBox::SetProperty
virtual bool SetProperty(std::string, Variant v)
Definition
PTextBox.cpp:124
PWidget::SetPosition
virtual void SetPosition(pInt x, pInt y)
This sets the widget's position on its parent widget.
Definition
PWidget.cpp:220
PlatformTextBox
Validator platform textbox - no rendering, used only for compilation.
Definition
sdl/PlatformTextBox.h:56
PlatformTextBox::SendToStream
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.
PlatformTextBox::Draw
virtual bool Draw()
This method initiates everything needed to display the main window
PlatformTextBox::SetProperty
virtual bool SetProperty(std::string name, Variant v)
Definition
validator/PlatformTextBox.h:47
PlatformTextBox::ValidateProperty
virtual ObjectValidationError ValidateProperty(std::string name, Variant v) const
Definition
validator/PlatformTextBox.h:50
PlatformTextBox::~PlatformTextBox
virtual ~PlatformTextBox()
PlatformTextBox::ObjectName
virtual std::string ObjectName() const
Definition
validator/PlatformTextBox.h:41
PlatformTextBox::GetLineBreaks
virtual Variant GetLineBreaks()
Definition
validator/PlatformTextBox.h:43
PlatformTextBox::ValidateProperty
virtual ObjectValidationError ValidateProperty(std::string name) const
Definition
validator/PlatformTextBox.h:53
PlatformTextBox::SetPosition
virtual void SetPosition(pInt x, pInt y)
This sets the widget's position on its parent widget.
Definition
validator/PlatformTextBox.h:58
PlatformTextBox::FindCursorPosition
virtual int FindCursorPosition(long int x, long int y)
Definition
validator/PlatformTextBox.h:42
PlatformTextBox::SetFont
virtual void SetFont(counted_ptr< PEBLObjectBase > font)
Definition
validator/PlatformTextBox.h:44
PlatformWidget
Definition
sdl/PlatformWidget.h:45
Variant
Definition
Variant.h:67
counted_ptr
Definition
rc_ptrs.h:66
PlatformWidget.h
src
platforms
validator
PlatformTextBox.h
Generated by
1.9.8