## class TextShape : public Shape

> text shape class that displays a character string.

## Inheritance:

### Public Methods

  | TextShape (ShapeView *v, Grafport *g, Shape *parent)
  | TextShape (const TextShape &t)
  Shape* | Clone ()
  void | Draw ()
  void | Undraw ()
  void | DrawDuplicate () no duplicate asteriks are possible for text shapes.
  void | SetParent (Shape *shape)
  Shape* | GetParent () const
  void | SetString (const string *s) set text and recalculate the sizes.
  const string* | GetString () const
  TextShape* | ChooseTextShape (int, int)
  TextShape* | HitTextShape (int x, int y)
  bool | InTextArea (int x, int y)
  bool | IsTextShape () const
  bool | IsEmpty () const
  void | SetEmpty ()
  void | DrawOutLine (const Point *center) draws a dotted rectangle around the textshape.
  void | SetPosition (const Point *p, bool snap=False) set textshape at position (not using grid !).
  bool | ContainsPt (int x, int y) returns if (x,y) is in textshape (not empty string).
  void | TextBox (int &wd, int &ht) return text width and height (depends on font).
  void | UpdateAlignment (TextAlign::Type newtype)
  void | SetAlignment (TextAlign::Type newtype)
  TextAlign::Type | GetAlignment () const
  XFont* | GetFont () const
  void | SetFont (XFont *ft)
  void | UpdateFont (XFont *ft)
  int | GetFontHeight () const
  int | GetStringHeight () const
  int | GetStringWidth () const
  bool | IsWellPositioned () const if wellPositioned = false then current position isn't preferred.
  void | SetWellPositioned (bool b) !wellPositioned indicates parent should recalculate child position.
  const string* | GetDescription () const returns a string which describes the kind of text shape.
  void | SetDescription (const string *s)
  void | SetDescription (const char *s)
  bool | IsOneLine () const
  void | SetOneLine (bool o)
  bool | IsUnderlined () const
  void | SetUnderlined (bool b)
  void | UpdateUnderlined (bool b)
  bool | HasTextShape (TextShape *t) const return if it has t as one of the text shapes.
  bool | HasString (const string *s, bool sens, bool sub) const textshape contains s as string.
  int | ReplaceString (const string *s1, const string *s2, bool sens, bool sub) replace occurrences of s1 by s2 (if allowed by Update).
  bool | HasString (const string *s, bool caseSens, bool substring, List<TextShape *> *list) puts itself into list when text contains s
  int | GetSequence () const
  void | SetSequence (int n)

### Inherited from Shape:

### Public Fields

static const int MIN_HEIGHT
static const int MIN_WIDTH
static const int HANDLE_WIDTH

### Public Methods

bool IsShape() const
virtual void UpdatePosition(const Point *position, bool snap=True)
virtual void UpdateSize(int w, int h)
virtual void UpdateMove(const Point *delta)
virtual void UpdateSelect(bool s)
virtual void UpdateFirstSelect(bool s)
virtual void UpdateColor(string *color)
virtual void SetSelect(bool s)
virtual void SetFirstSelect(bool s)
bool IsFirstSelected() const
void SetVisible(bool s)
void SetSubject(Subject *s)
virtual void SetView(ShapeView *v)
Subject* GetSubject() const
ShapeView* GetView() const
virtual void SetGrafport(Grafport *g)
void SetColor(const string *c)
const string* GetColor() const
virtual void Move(const Point *delta)
virtual void AdjustSize()
virtual Point GiveSnp(Point) const
virtual Point GiveSnp(Point, int, int, int &)
virtual Point GiveOrthoSnp(Point to) const
void SetHandles(int n)
virtual int HitHandles(int x, int y)
const Point* GetPosition() const
const Point* GetTopLeft() const
bool IsSelected() const
bool IsVisible() const
bool IsDuplicate() const
int GetWidth() const
int GetHeight() const
void UndrawDuplicate()
void SetDuplicate(bool b)
void UpdateDuplicate(bool b)
virtual bool IsLine() const
virtual int GetLeftMost() const
virtual int GetTopMost() const
virtual int GetRightMost() const
virtual int GetBottomMost() const
void WriteMembers(OutputFile *ofile)
bool ReadMembers(InputFile *f, double format)
virtual bool SetAssocSubject(AssocList *)
bool SetAssocView(AssocList *)
bool CheckReferences()
virtual void SetTextShape()
virtual bool HasNameString(const string *, bool, bool) const
virtual void MoveRaw(const Point *delta)

### Protected Fields

static const int MIN_HANDLES

### Protected Methods

Grafport* GetGrafport() const
virtual void SetDrawAttributes()
void SetOutlineAttributes()
virtual void SetSize(int w, int h)
virtual void SnapTopleft()
virtual void SnapPosition()
void SetWidth(int w)
void SetHeight(int h)
void SetNrHandles(int n)
DiagramViewer* GetViewer() const
void PositiveCoord(const Point*)
virtual void DrawSelect()
virtual void DrawGraySelect()
virtual void UndrawSelect()
virtual void UndrawGraySelect()
void SetTopLeft(const Point *topLeft)
virtual void SetPositionHandles()
void ForcePosition(const Point *position)

### Inherited from Thing:

### Public Classes

enum AssocType

### Public Methods

unsigned long GetId()
void SetId(unsigned long val)
virtual bool IsSubject() const
virtual bool IsView() const
virtual int GetClassType() const
void Write(OutputFile *ofile)
virtual bool SetReferences(AssocList *)

## Documentation

> text shape class that displays a character string.

`TextShape(ShapeView *v, Grafport *g, Shape *parent)`

`TextShape(const TextShape &t)`

`Shape* Clone()`

`void Draw()`

`void Undraw()`

`void DrawDuplicate()`
  no duplicate asteriks are possible for text shapes.

`void SetParent(Shape *shape)`

`Shape* GetParent() const`

`void SetString(const string *s)`
  set text and recalculate the sizes.

`const string* GetString() const`

`TextShape* ChooseTextShape(int, int)`

`TextShape* HitTextShape(int x, int y)`

`bool InTextArea(int x, int y)`

`bool IsTextShape() const`

`bool IsEmpty() const`

`void SetEmpty()`

`void DrawOutLine(const Point *center)`
  draws a dotted rectangle around the textshape.

`void SetPosition(const Point *p, bool snap=False)`
  set textshape at position (not using grid !).

`bool ContainsPt(int x, int y)`
  returns if (x,y) is in textshape (not empty string).

`void TextBox(int &wd, int &ht)`
  return text width and height (depends on font).

`void UpdateAlignment(TextAlign::Type newtype)`

`void SetAlignment(TextAlign::Type newtype)`

`TextAlign::Type GetAlignment() const`

`XFont* GetFont() const`

`void SetFont(XFont *ft)`

`void UpdateFont(XFont *ft)`

`int GetFontHeight() const`

`int GetStringHeight() const`

`int GetStringWidth() const`

`bool IsWellPositioned() const`
  if wellPositioned = false then current position isn't preferred.

`void SetWellPositioned(bool b)`
  !wellPositioned indicates parent should recalculate child position.

`const string* GetDescription() const`
  returns a string which describes the kind of text shape.

`void SetDescription(const string *s)`

`void SetDescription(const char *s)`

`bool IsOneLine() const`

`void SetOneLine(bool o)`

`bool IsUnderlined() const`

`void SetUnderlined(bool b)`

`void UpdateUnderlined(bool b)`

`bool HasTextShape(TextShape *t) const`
  return if it has t as one of the text shapes.

`bool HasString(const string *s, bool sens, bool sub) const`
  textshape contains s as string.

`int ReplaceString(const string *s1, const string *s2, bool sens, bool sub)`
  replace occurrences of s1 by s2 (if allowed by Update).

`bool HasString(const string *s, bool caseSens, bool substring, List<TextShape *> *list)`
  puts itself into list when text contains s

`int GetSequence() const`

`void SetSequence(int n)`

This class has no child classes.

alphabetic index hierarchy of classes

this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de