|
PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
|
Validator platform label - no rendering, used only for compilation. More...
#include <PlatformLabel.h>
Public Member Functions | |
| PlatformLabel (const std::string &text, counted_ptr< PEBLObjectBase > font) | |
| PlatformLabel (PlatformLabel &label) | |
| This copy constructor isn't const because the font is shared. | |
| virtual | ~PlatformLabel () |
| Standard Destructor. | |
| virtual bool | RenderText () |
| virtual bool | SetProperty (std::string, Variant v) |
| virtual void | SetFont (counted_ptr< PEBLObjectBase > font) |
| virtual void | SetText (const std::string &text) |
| virtual bool | Draw () |
| This method initiates everything needed to display the main window | |
| virtual counted_ptr< PEBLObjectBase > | GetFont () |
| virtual std::string | ObjectName () const |
| PlatformLabel (const std::string &text, counted_ptr< PEBLObjectBase > font) | |
| PlatformLabel (PlatformLabel &label) | |
| virtual | ~PlatformLabel () |
| virtual bool | Draw () |
| This method initiates everything needed to display the main window | |
| virtual std::string | ObjectName () const |
| virtual void | SetFont (counted_ptr< PEBLObjectBase > font) |
| virtual bool | SetProperty (std::string name, Variant v) |
| virtual ObjectValidationError | ValidateProperty (std::string name, Variant v) const |
| virtual ObjectValidationError | ValidateProperty (std::string name) const |
| virtual void | SetPosition (pInt x, pInt y) |
| This sets the widget's position on its parent widget. | |
Public Member Functions inherited from PlatformWidget | |
| PlatformWidget () | |
| virtual | ~PlatformWidget () |
| virtual SDL_Texture * | GetSDL_Texture () |
| Used to extract an SDL surface from the widget. Used by children drawing themselves on their parent. | |
| void | SetParent (PlatformWidget *parent) |
| SDL_Surface * | GetSurface () |
| virtual bool | SetRenderer (SDL_Renderer *renderer) |
| SDL_Renderer * | GetRenderer () |
| virtual bool | AddToParentWidget (PlatformWidget *parent) |
| virtual bool | AddSubWidget (PlatformWidget *widget) |
| virtual bool | RemoveSubWidget (PlatformWidget *widget) |
| virtual bool | RemoveSubWidgets () |
| virtual bool | RotoZoom (double angle, double zoomx, double zoomy, int smooth) |
| This uses the SDL_gfx package to 'rotozoom'. | |
| bool | SetPoint (int x, int y, PColor col) |
| PColor | GetPixel (int x, int y) |
| PlatformWidget () | |
| PlatformWidget (pInt x, pInt y, pInt width, pInt height, bool visible) | |
| virtual | ~PlatformWidget () |
| virtual bool | RotoZoom (pDouble angle, pDouble zoomx, pDouble zoomy, pInt smooth) |
| virtual bool | SetPoint (pInt x, pInt y, PColor col) |
| virtual PColor | GetPixel (pInt x, pInt y) |
Public Member Functions inherited from PWidget | |
| PWidget () | |
| PWidget (const PWidget &pw) | |
| PWidget (pInt x, pInt y, pInt width, pInt height, bool visible) | |
| virtual | ~PWidget () |
| virtual void | SetParent (PWidget *widget) |
| This unconditionally sets the parent widget. | |
| virtual PWidget * | GetParent () |
| virtual bool | IsParent (PWidget *parent) |
| virtual void | SetZoomX (pDouble x) |
| This sets the widget's position on its parent widget. | |
| virtual void | SetZoomY (pDouble x) |
| This sets the widget's position on its parent widget. | |
| virtual void | SetRotation (pDouble x) |
| This sets the widget's position on its parent widget. | |
| virtual void | SetWidth (pInt w) |
| virtual void | SetHeight (pInt h) |
| virtual pInt | GetX () const |
| virtual pInt | GetY () const |
| virtual pInt | GetWidth () const |
| virtual pInt | GetHeight () const |
| virtual void | SetBackgroundColor (const PColor &color) |
| virtual PColor | GetBackgroundColor () |
| virtual bool | AddSubWidget (PWidget *widget) |
| virtual bool | RemoveSubWidget (PWidget *widget) |
| virtual bool | RemoveLastSubWidget () |
| This is probably pretty useless. | |
| virtual void | Show () |
| virtual void | Hide () |
| virtual bool | IsVisible () const |
Public Member Functions inherited from PEBLObjectBase | |
| PEBLObjectBase () | |
| Standard Constructor. | |
| PEBLObjectBase (ComplexDataType cdt) | |
| Standard Constructor. | |
| PEBLObjectBase (const PEBLObjectBase &pob) | |
| virtual | ~PEBLObjectBase () |
| Standard Destructor. | |
| virtual bool | InitializeProperty (std::string name, Variant v) |
| Variant | GetProperty (std::string) const |
| ComplexDataType | GetType () |
| virtual std::ostream & | PrintProperties (std::ostream &out) |
| virtual Variant | GetPropertyList () |
Public Member Functions inherited from PLabel | |
| PLabel () | |
| PLabel (const std::string &text) | |
| PLabel (const PLabel &label) | |
| virtual | ~PLabel () |
| virtual Variant | GetProperty (std::string) const |
Public Member Functions inherited from PTextObject | |
| PTextObject () | |
| PTextObject (const std::string &text) | |
| PTextObject (PTextObject &object) | |
| virtual | ~PTextObject () |
| virtual void | SetDirection (int i) |
| virtual std::string | GetText () const |
| virtual unsigned long int | GetNumCharacters () |
Protected Member Functions | |
| virtual std::ostream & | SendToStream (std::ostream &out) const |
| An inheritable printing class used by PEBLObjectBase::operator<<. | |
| virtual std::ostream & | SendToStream (std::ostream &out) const |
| An inheritable printing class used by PEBLObjectBase::operator<<. | |
Protected Member Functions inherited from PlatformWidget | |
| virtual void | PrintSubWidgets (std::ostream &out) const |
| virtual bool | LockSurface () |
| This needs to be used on some platforms/video cards. | |
| virtual bool | UnlockSurface () |
| This needs to be used on some platforms/video cards. | |
Additional Inherited Members | |
Protected Attributes inherited from PlatformWidget | |
| pInt | mTextureWidth |
| pInt | mTextureHeight |
| bool | mNeedsTexture |
| SDL_Texture * | mTexture |
| SDL_Surface * | mSurface |
| SDL_Renderer * | mRenderer |
Protected Attributes inherited from PWidget | |
| pInt | mX |
| pInt | mY |
| pInt | mDrawX |
| pInt | mDrawY |
| pInt | mWidth |
| pInt | mHeight |
| pDouble | mZoomX |
| pDouble | mZoomY |
| pDouble | mRotation |
| PColor | mBackgroundColor |
| The background color of the widget. if alpha = 0, will not be painted. | |
| std::list< PWidget * > | mSubWidgets |
| bool | mIsVisible |
| PWidget * | mParent |
Protected Attributes inherited from PEBLObjectBase | |
| ComplexDataType | mCDT |
| std::map< std::string, Variant > | mProperties |
Protected Attributes inherited from PTextObject | |
| bool | mChanged |
| std::string | mText |
| int | mDirection |
Validator platform label - no rendering, used only for compilation.
This class defines the SDL Platform-specific representation of a text label. It uses the SDL_ttf library (a wrapper to freetype) to render words in a box.
Definition at line 49 of file sdl/PlatformLabel.h.
| PlatformLabel::PlatformLabel | ( | const std::string & | text, |
| counted_ptr< PEBLObjectBase > | font | ||
| ) |
Definition at line 56 of file sdl/PlatformLabel.cpp.
References CDT_LABEL, Draw(), PEBLObjectBase::InitializeProperty(), PEBLObjectBase::mCDT, PlatformWidget::mRenderer, PlatformWidget::mSurface, PlatformWidget::mTexture, NULL, SetFont(), and SetText().
| PlatformLabel::PlatformLabel | ( | PlatformLabel & | label | ) |
This copy constructor isn't const because the font is shared.
Definition at line 91 of file sdl/PlatformLabel.cpp.
References CDT_LABEL, Draw(), GetFont(), PWidget::GetHeight(), PWidget::GetWidth(), PEBLObjectBase::InitializeProperty(), PEBLObjectBase::mCDT, PlatformWidget::mRenderer, PlatformWidget::mSurface, PlatformWidget::mTexture, NULL, and SetFont().
|
virtual |
Standard Destructor.
Definition at line 118 of file sdl/PlatformLabel.cpp.
| PlatformLabel::PlatformLabel | ( | const std::string & | text, |
| counted_ptr< PEBLObjectBase > | font | ||
| ) |
| PlatformLabel::PlatformLabel | ( | PlatformLabel & | label | ) |
|
virtual |
|
virtual |
This method initiates everything needed to display the main window
Reimplemented from PlatformWidget.
Definition at line 377 of file sdl/PlatformLabel.cpp.
References PlatformFont::ClearChanged(), PlatformWidget::Draw(), PEBLObjectBase::InitializeProperty(), PTextObject::mChanged, PWidget::mHeight, PlatformWidget::mTexture, PWidget::mWidth, PWidget::mX, PWidget::mY, RenderText(), and SetPosition().
Referenced by PlatformLabel(), PlatformLabel(), SetFont(), and SetText().
|
virtual |
This method initiates everything needed to display the main window
Reimplemented from PlatformWidget.
|
inlinevirtual |
Definition at line 69 of file sdl/PlatformLabel.h.
Referenced by PlatformLabel().
|
inlinevirtual |
Reimplemented from PWidget.
Definition at line 70 of file sdl/PlatformLabel.h.
|
inlinevirtual |
Reimplemented from PWidget.
Definition at line 40 of file validator/PlatformLabel.h.
|
virtual |
RenderText is only called once the label is already added to a window/widget, so that it already has a renderer and a texture.
Definition at line 137 of file sdl/PlatformLabel.cpp.
References PFont::GetAntiAliased(), PFont::GetBackgroundColor(), PFont::GetFontColor(), PFont::GetFontFileName(), PFont::GetFontSize(), Variant::GetInteger(), PEBLObjectBase::GetProperty(), PlatformFont::GetTTFFont(), PEBLObjectBase::InitializeProperty(), PTextObject::mDirection, PWidget::mHeight, PlatformWidget::mRenderer, PTextObject::mText, PlatformWidget::mTexture, PlatformWidget::mTextureHeight, PlatformWidget::mTextureWidth, PWidget::mWidth, NULL, FormatParser::ParseFormattedText(), PlatformFont::RenderText(), and PEBLUtility::strrev_utf8().
Referenced by Draw().
|
protectedvirtual |
An inheritable printing class used by PEBLObjectBase::operator<<.
Reimplemented from PlatformWidget.
Definition at line 43 of file validator/PlatformLabel.cpp.
|
protectedvirtual |
An inheritable printing class used by PEBLObjectBase::operator<<.
Reimplemented from PlatformWidget.
|
virtual |
Definition at line 346 of file sdl/PlatformLabel.cpp.
References Draw(), PTextObject::mChanged, and PEBLObjectBase::SetProperty().
Referenced by PlatformLabel(), PlatformLabel(), PEBLObjects::SetFont(), and SetProperty().
|
inlinevirtual |
Definition at line 41 of file validator/PlatformLabel.h.
This sets the widget's position on its parent widget.
Sets the location of the upper left-hand corner of the image on the parent widget; unless overridden
Reimplemented from PWidget.
Definition at line 49 of file validator/PlatformLabel.h.
References PLabel::SetPosition().
Referenced by Draw(), and PEBLObjects::MakeLabel().
|
inlinevirtual |
Reimplemented from PWidget.
Definition at line 44 of file validator/PlatformLabel.h.
References PLabel::SetProperty().
|
virtual |
Reimplemented from PWidget.
Definition at line 324 of file sdl/PlatformLabel.cpp.
References Variant::GetComplexData(), PComplexData::GetObject(), SetFont(), PLabel::SetProperty(), and SetText().
|
virtual |
Reimplemented from PTextObject.
Definition at line 364 of file sdl/PlatformLabel.cpp.
References Draw(), PTextObject::mChanged, and PTextObject::SetText().
Referenced by PlatformLabel(), SetProperty(), and PEBLObjects::SetText().
|
inlinevirtual |
Reimplemented from PWidget.
Definition at line 46 of file validator/PlatformLabel.h.
References PLabel::ValidateProperty().
|
inlinevirtual |
Reimplemented from PWidget.
Definition at line 45 of file validator/PlatformLabel.h.
References PLabel::ValidateProperty().