+1 888 340 6572

Text SetStyle: Difference between revisions

From MultiCharts
(Created page with "Sets the placement style of a text object relative to the bar and to the price value specified for the object; returns a value of 0 if the placement style of the object was su...")
 
m (Reverted edits by 176.8.90.7 (talk) to last revision by JoshM)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Sets the placement style of a text object relative to the bar and to the price value specified for the object; returns a value of 0 if the placement style of the object was successfully modified, and a value of -2 if the specified object ID number is invalid.  
Sets the placement style of a text object relative to the bar and to the price value specified for the object.
 
Text_SetStyle returns a value of 0 if the placement style of the object was successfully modified, and a value of -2 if the specified object ID number is invalid.  
   
   
==== Usage ====
== Usage ==
<syntaxhighlight>Text_SetStyle (ObjectID, HorizPl, VertPl)</syntaxhighlight>  
<syntaxhighlight>Text_SetStyle (ObjectID, HorizPl, VertPl)</syntaxhighlight>  


==== Parameters ====
== Parameters ==
[[ObjectID]] - a numerical expression specifying the object ID number  
:'''ObjectID''' - a numerical expression specifying the object ID number.


[[HorizPl]] - a numerical expression specifying the horizontal placement style for the text object:  
:'''HorizPl''' - a numerical expression specifying the horizontal placement style for the text object:  


0 - to the right of the specified bar
::'''0''' - to the right of the specified bar,
   
   
1 - to the left of the specified bar
::'''1''' - to the left of the specified bar,
   
   
2 - centered on the specified bar  
::'''2''' - centered on the specified bar .


[[VertPl]] - a numerical expression specifying the vertical placement style for the text object:  
:'''VertPl''' - a numerical expression specifying the vertical placement style for the text object:  


0 - below the specified price value
::'''0''' - below the specified price value,
   
   
1 - above the specified price value
::'''1''' - above the specified price value,
   
   
2 - centered on the specified price value  
::'''2''' - centered on the specified price value.


Price value represents the vertical position corresponding to a value on the price scale of a chart.  
Price value represents the vertical position corresponding to a value on the price scale of a chart.  
   
   
==== Notes ====  
== Notes ==  
An object-specific ID number is returned by [[Text_New]] when the text object is created.  
* An object-specific ID number is returned by [[Text_New]] when the text object is created.
* Use [[Text_GetHStyle]] and [[Text_GetVStyle]] to get the text object's horizontal and vertical placement.
==== Example ====
 
== Example ==
Center the text object with an ID number of 3 on the bar and on the price value, specified for the object:  
Center the text object with an ID number of 3 on the bar and on the price value, specified for the object:  


<syntaxhighlight>Value1=Text_SetStyle(3,2,2);</syntaxhighlight>  
<syntaxhighlight>Value1 = Text_SetStyle(3, 2, 2);</syntaxhighlight>  
   
   
[[Category:Text Drawing]]
[[Category:Text Drawing]]

Latest revision as of 13:10, 13 February 2012

Sets the placement style of a text object relative to the bar and to the price value specified for the object.

Text_SetStyle returns a value of 0 if the placement style of the object was successfully modified, and a value of -2 if the specified object ID number is invalid.

Usage

Text_SetStyle (ObjectID, HorizPl, VertPl)

Parameters

ObjectID - a numerical expression specifying the object ID number.
HorizPl - a numerical expression specifying the horizontal placement style for the text object:
0 - to the right of the specified bar,
1 - to the left of the specified bar,
2 - centered on the specified bar .
VertPl - a numerical expression specifying the vertical placement style for the text object:
0 - below the specified price value,
1 - above the specified price value,
2 - centered on the specified price value.

Price value represents the vertical position corresponding to a value on the price scale of a chart.

Notes

  • An object-specific ID number is returned by Text_New when the text object is created.
  • Use Text_GetHStyle and Text_GetVStyle to get the text object's horizontal and vertical placement.

Example

Center the text object with an ID number of 3 on the bar and on the price value, specified for the object:

Value1 = Text_SetStyle(3, 2, 2);