23.11.2012 Views

2 Visual Components Manuals

2 Visual Components Manuals

2 Visual Components Manuals

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Introduction to <strong>Visual</strong> <strong>Components</strong> 2.3<br />

if (!ready)<br />

{<br />

VC_HANDLE = VA_Setup(1 , "vga");<br />

if (VC_HANDLE)<br />

ready = 1;<br />

}<br />

if (ready)<br />

{<br />

switch(selection)<br />

{<br />

case 1:Status=VA_StopProject(1,VC_HANDLE);break; /* Project is stopped */<br />

case 2: AccessStatus=VA_Saccess(1,VC_HANDLE);<br />

if (AccessStatus==0)<br />

{<br />

VA_Line(1,VC_HANDLE,10,10,100,100,1);<br />

VA_Srelease(1,VC_HANDLE);<br />

}<br />

break;<br />

case 3:Status=VA_StartProject(1,VC_HANDLE);break; /* Project is started */<br />

default: break;<br />

}<br />

selection = 0;<br />

}<br />

}<br />

3.3.8.36 Graphics and Text Output − VA_Textout<br />

Writes a text on the screen.<br />

The text is placed at the x and y coordinates. (For graphic displays, these are in pixels. For text displays, the<br />

coordinates refer to the current character size). The background color can be changed with the bC variable, and<br />

the foreground color with the fC variable. If '......' appears on the display, then the font index is invalid.<br />

PP41: The foreground (fC) and background (bC) can only be 0, 1, or 255.<br />

3.3.8.36.1 Parameter<br />

I/O Parameter Type Meaning<br />

IN enable BOOL This function is only executed if enable is TRUE.<br />

IN VCHandle UDINT The handle returned by VA_Setup.<br />

IN font_index UINT<br />

Index of the font to be used<br />

IN x/y UINT Upper left corner of the text<br />

IN fC USINT Foreground color of the text<br />

IN bC USINT Background color of the text<br />

IN str STRING[80] Text to be output<br />

OUT Return<br />

Value<br />

The font index corresponds to the font number used in the VC editor (beginning<br />

with 0).<br />

UINT Not equal to 0 if error occurs<br />

3.3.8.36 Graphics and Text Output − VA_Textout 171

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!