KlassenKlassenKlassenKlassen | | | | Operatoren

disp_textT_disp_textDispTextdisp_textDispTextDispText (Operator)

Name

disp_textT_disp_textDispTextdisp_textDispTextDispText — Ausgabe von Text in ein Fenster.

Signatur

disp_text( : : WindowHandle, String, CoordSystem, Row, Column, Color, GenParamName, GenParamValue : )

Herror T_disp_text(const Htuple WindowHandle, const Htuple String, const Htuple CoordSystem, const Htuple Row, const Htuple Column, const Htuple Color, const Htuple GenParamName, const Htuple GenParamValue)

Herror disp_text(const HTuple& WindowHandle, const HTuple& String, const HTuple& CoordSystem, const HTuple& Row, const HTuple& Column, const HTuple& Color, const HTuple& GenParamName, const HTuple& GenParamValue)

void HWindow::DispText(const HTuple& String, const HTuple& CoordSystem, const HTuple& Row, const HTuple& Column, const HTuple& Color, const HTuple& GenParamName, const HTuple& GenParamValue) const

void DispText(const HTuple& WindowHandle, const HTuple& String, const HTuple& CoordSystem, const HTuple& Row, const HTuple& Column, const HTuple& Color, const HTuple& GenParamName, const HTuple& GenParamValue)

void HWindow::DispText(const HTuple& String, const HString& CoordSystem, const HTuple& Row, const HTuple& Column, const HTuple& Color, const HTuple& GenParamName, const HTuple& GenParamValue) const

void HWindow::DispText(const HString& String, const HString& CoordSystem, Hlong Row, Hlong Column, const HString& Color, const HTuple& GenParamName, const HTuple& GenParamValue) const

void HWindow::DispText(const char* String, const char* CoordSystem, Hlong Row, Hlong Column, const char* Color, const HTuple& GenParamName, const HTuple& GenParamValue) const

void HOperatorSetX.DispText(
[in] VARIANT WindowHandle, [in] VARIANT String, [in] VARIANT CoordSystem, [in] VARIANT Row, [in] VARIANT Column, [in] VARIANT Color, [in] VARIANT GenParamName, [in] VARIANT GenParamValue)

void HWindowX.DispText(
[in] VARIANT String, [in] BSTR CoordSystem, [in] VARIANT Row, [in] VARIANT Column, [in] VARIANT Color, [in] VARIANT GenParamName, [in] VARIANT GenParamValue)

static void HOperatorSet.DispText(HTuple windowHandle, HTuple stringVal, HTuple coordSystem, HTuple row, HTuple column, HTuple color, HTuple genParamName, HTuple genParamValue)

void HWindow.DispText(HTuple stringVal, string coordSystem, HTuple row, HTuple column, HTuple color, HTuple genParamName, HTuple genParamValue)

void HWindow.DispText(string stringVal, string coordSystem, int row, int column, string color, HTuple genParamName, HTuple genParamValue)

Beschreibung

disp_textdisp_textDispTextdisp_textDispTextDispText gibt Text im Grafikfenster WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle an der Position (RowRowRowRowRowrow,ColumnColumnColumnColumnColumncolumn) aus.

Wird nur eine Position übergeben, wird für jedes Element in StringStringStringStringStringstringVal eine Textzeile ausgegeben. Außerdem wird auch '\n'"\n""\n""\n""\n""\n" als Zeilenumbruch interpretiert.

Werden mehrere Positionen übergeben, ist nur ein einzelner String oder ein String für jede Position zulässig. In diesem Fall kann ein Zeilenumbruch nur über '\n'"\n""\n""\n""\n""\n" erreicht werden.

Zeilenumbrüche ('\n'"\n""\n""\n""\n""\n") am Ende von StringStringStringStringStringstringVal werden ignoriert.

Die Position des Texts kann in Fensterkoordinaten (CoordSystemCoordSystemCoordSystemCoordSystemCoordSystemcoordSystem = 'window'"window""window""window""window""window") oder in Bildkoordinaten (CoordSystemCoordSystemCoordSystemCoordSystemCoordSystemcoordSystem = 'image'"image""image""image""image""image"), was für gezoomte Bilder nützlich ist, angegeben werden.

Zusätzlich zu (RowRowRowRowRowrow,ColumnColumnColumnColumnColumncolumn) Koordinaten können auch vordefinierte Werte an RowRowRowRowRowrow und ColumnColumnColumnColumnColumncolumn übergeben werden um Text an festen Positionen im Fenster anzuzeigen (nur für CoordSystemCoordSystemCoordSystemCoordSystemCoordSystemcoordSystem = 'window'"window""window""window""window""window").:

'top'"top""top""top""top""top", 'left'"left""left""left""left""left" 'top'"top""top""top""top""top", 'center'"center""center""center""center""center" 'top'"top""top""top""top""top", 'right'"right""right""right""right""right"
'center'"center""center""center""center""center", 'left'"left""left""left""left""left" 'center'"center""center""center""center""center", 'center'"center""center""center""center""center" 'center'"center""center""center""center""center", 'right'"right""right""right""right""right"
'bottom'"bottom""bottom""bottom""bottom""bottom", 'left'"left""left""left""left""left" 'bottom'"bottom""bottom""bottom""bottom""bottom", 'center'"center""center""center""center""center" 'bottom'"bottom""bottom""bottom""bottom""bottom", 'right'"right""right""right""right""right"

Der Parameter ColorColorColorColorColorcolor akzeptiert auch Farben-Tupel. In diesem Fall werden die Farben zyklisch für jede neue Textposition (oder für jede Textzeile wenn nur eine Position angegeben wurde) verwendet.

Generische Parameter

disp_textdisp_textDispTextdisp_textDispTextDispText kann den StringStringStringStringStringstringVal innerhalb einer Box anzeigen. Dieses Verhalten und das Aussehen der Box wird mit den generischen Parametern in GenParamNameGenParamNameGenParamNameGenParamNameGenParamNamegenParamName und GenParamValueGenParamValueGenParamValueGenParamValueGenParamValuegenParamValue beeinflusst.

'box'

Ist 'box'"box""box""box""box""box" auf 'true'"true""true""true""true""true" gesetzt, wird der Text innerhalb einer Box angezeigt. Die folgenden Parameter beeinflussen das Aussehen dieser Box und des optionalen Schattens der Box.

Mögliche Werte: 'true'"true""true""true""true""true" und 'false'"false""false""false""false""false"

Vorgegebener Wert: 'true'"true""true""true""true""true"

'box_color'

Setzt die Farbe der Box.

Mögliche Werte: Ein String mit dem Namen der Farbe (z.B. 'white'"white""white""white""white""white", 'red'"red""red""red""red""red" oder '#aa00bba0'"#aa00bba0""#aa00bba0""#aa00bba0""#aa00bba0""#aa00bba0")

Vorgegebener Wert: '#fce9d4'"#fce9d4""#fce9d4""#fce9d4""#fce9d4""#fce9d4" (ein helles Orange)

'shadow'

Wird 'shadow'"shadow""shadow""shadow""shadow""shadow" auf 'true'"true""true""true""true""true" gesetzt, wird zusätzlich ein Schatten zu der Box angezeigt.

Mögliche Werte: 'true'"true""true""true""true""true" und 'false'"false""false""false""false""false"

Vorgegebener Wert: 'true'"true""true""true""true""true" wenn 'box_color'"box_color""box_color""box_color""box_color""box_color" auf eine Farbe ohne Alphawert gesetzt wurde, ansonsten 'false'"false""false""false""false""false"

'shadow_color'

Setzt die Farbe des Schattens.

Mögliche Werte: Ein String mit dem Namen der Farbe (z.B. 'black'"black""black""black""black""black", 'red'"red""red""red""red""red" oder '#aa00bba0'"#aa00bba0""#aa00bba0""#aa00bba0""#aa00bba0""#aa00bba0")

Vorgegebener Wert: '#f28d26'"#f28d26""#f28d26""#f28d26""#f28d26""#f28d26" (ein dunkleres Orange) wenn 'box_color'"box_color""box_color""box_color""box_color""box_color" nicht gesetzt wurde, ansonsten 'white'"white""white""white""white""white"

'border_radius'

Setzt die Abrundung der Ecken der Box. Für scharfe Ecken muss dieser Parameter auf 0, für abgerundete Ecken auf höhere Werte gesetzt werden.

Mögliche Werte: positive reelle Zahl oder 0

Vorgegebener Wert: 2

'box_padding'

Bestimmt, wie stark die Box über den Text hinaus geht.

Mögliche Werte: positive reelle Zahl

Vorgegebener Wert: 0

'shadow_sigma'

Bestimmt, wie stark der Schatten hinter der Box weichgezeichnet wird. Für scharfe Schatten muss dieser Parameter auf 0 gesetzt werden.

Mögliche Werte: positive reelle Zahl oder 0

Vorgegebener Wert: 1.5

'shadow_dx' and 'shadow_dy'

Der Offset des Schattens in Spalten- ('shadow_dx'"shadow_dx""shadow_dx""shadow_dx""shadow_dx""shadow_dx") und Zeilenrichtung ('shadow_dy'"shadow_dy""shadow_dy""shadow_dy""shadow_dy""shadow_dy") in Pixeln.

Mögliche Werte: reelle Zahlen

Vorgegebener Wert: 2

Achtung

disp_textdisp_textDispTextdisp_textDispTextDispText benötigt die Bibliothek libcanvas, die auf Embedded-Systemen möglicherweise nicht verfügbar ist.

Parallelisierung

Parameter

WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHTupleHWindowX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Fenster-Handle.

StringStringStringStringStringstringVal (input_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Ein Tupel von Strings mit den anzuzeigenden Texten. Jeder String wird in einer Zeile ausgegeben.

Defaultwert: 'hello' "hello" "hello" "hello" "hello" "hello"

CoordSystemCoordSystemCoordSystemCoordSystemCoordSystemcoordSystem (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Koordinatensystem für die Textposition. 'window' steht für das Fensterkoordinatensystem, 'image' für das Bildkoordinatensystem.

Defaultwert: 'window' "window" "window" "window" "window" "window"

Werteliste: 'image'"image""image""image""image""image", 'window'"window""window""window""window""window"

RowRowRowRowRowrow (input_control)  point.y(-array) HTupleHTupleHTupleVARIANTHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*) (Hlong / double / BSTR) (Hlong / double / char*)

Vertikale Textausrichtung oder Zeilenkoordinate der Textposition.

Defaultwert: 12

Werteliste: 12, 'bottom'"bottom""bottom""bottom""bottom""bottom", 'center'"center""center""center""center""center", 'top'"top""top""top""top""top"

ColumnColumnColumnColumnColumncolumn (input_control)  point.x(-array) HTupleHTupleHTupleVARIANTHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*) (Hlong / double / BSTR) (Hlong / double / char*)

Horizontale Textausrichtung oder Spaltenkoordinate der Textposition.

Defaultwert: 12

Werteliste: 12, 'center'"center""center""center""center""center", 'left'"left""left""left""left""left", 'right'"right""right""right""right""right"

ColorColorColorColorColorcolor (input_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Ein Tupel von Strings für die Farben der Texte.

Defaultwert: 'black' "black" "black" "black" "black" "black"

Werteliste: 'black'"black""black""black""black""black", 'blue'"blue""blue""blue""blue""blue", 'coral'"coral""coral""coral""coral""coral", 'cyan'"cyan""cyan""cyan""cyan""cyan", 'forest green'"forest green""forest green""forest green""forest green""forest green", 'green'"green""green""green""green""green", 'lime green'"lime green""lime green""lime green""lime green""lime green", 'magenta'"magenta""magenta""magenta""magenta""magenta", 'red'"red""red""red""red""red", 'slate blue'"slate blue""slate blue""slate blue""slate blue""slate blue", 'yellow'"yellow""yellow""yellow""yellow""yellow"

GenParamNameGenParamNameGenParamNameGenParamNameGenParamNamegenParamName (input_control)  attribute.name-array HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Namen der generischen Parameter.

Defaultwert: []

Werteliste: 'border_radius'"border_radius""border_radius""border_radius""border_radius""border_radius", 'box'"box""box""box""box""box", 'box_color'"box_color""box_color""box_color""box_color""box_color", 'box_padding'"box_padding""box_padding""box_padding""box_padding""box_padding", 'shadow'"shadow""shadow""shadow""shadow""shadow", 'shadow_color'"shadow_color""shadow_color""shadow_color""shadow_color""shadow_color", 'shadow_dx'"shadow_dx""shadow_dx""shadow_dx""shadow_dx""shadow_dx", 'shadow_dy'"shadow_dy""shadow_dy""shadow_dy""shadow_dy""shadow_dy", 'shadow_sigma'"shadow_sigma""shadow_sigma""shadow_sigma""shadow_sigma""shadow_sigma"

GenParamValueGenParamValueGenParamValueGenParamValueGenParamValuegenParamValue (input_control)  attribute.value-array HTupleHTupleHTupleVARIANTHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double) (BSTR / Hlong / double) (char* / Hlong / double)

Werte der generischen Parameter.

Defaultwert: []

Werteliste: 5.0, 'black'"black""black""black""black""black", 'blue'"blue""blue""blue""blue""blue", 'false'"false""false""false""false""false", 'forest green'"forest green""forest green""forest green""forest green""forest green", 'red'"red""red""red""red""red", 'true'"true""true""true""true""true", 'white'"white""white""white""white""white"

Beispiel (HDevelop)

dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
disp_text (WindowHandle, 'Display some text in a box', 'window', 12, 12, \
           'black', [], [])

Vorgänger

open_windowopen_windowOpenWindowopen_windowOpenWindowOpenWindow, set_fontset_fontSetFontset_fontSetFontSetFont, get_string_extentsget_string_extentsGetStringExtentsget_string_extentsGetStringExtentsGetStringExtents

Alternativen

write_stringwrite_stringWriteStringwrite_stringWriteStringWriteString

Siehe auch

get_string_extentsget_string_extentsGetStringExtentsget_string_extentsGetStringExtentsGetStringExtents, set_fontset_fontSetFontset_fontSetFontSetFont

Modul

Foundation


KlassenKlassenKlassenKlassen | | | | Operatoren