Raptor:Display Button Definition: Difference between revisions

From NewEagleWiki
Jump to navigation Jump to search
(Created page with 'Return to the main Raptor page Return to Touchscreen page [[File:RaptorDisplayButtonDefinition.png|right|frame|Raptor™ Display B…')
 
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 6: Line 6:


== Description ==
== Description ==
<p>This block prints a button onto the touchscreen.</p>
<p>This block defines a button & prints it onto the touchscreen.
Only one copy of a button will print per screen.</p>
 
<p>Please note: Unicode characters (for multilingual support) require special handling!
To print Unicode characters correctly, please use the function(s)
raptor_utf8_printf_str( unicode_dec )
or
raptor_utf8_printf_str(hex2dec( unicode_hex ))
to print a single Unicode character, where 'unicode_dec' is the Unicode value of the character as a decimal & 'unicode_hex' is the character's Unicode value as a hex string.</p>


== Inputs ==
== Inputs ==
Line 17: Line 25:
! x
! x
| int32
| int32
|  
| X position of button.
|-
|-
! y
! y
| int32
| int32
|  
| Y position of button.
|}
 
== Outputs ==
{| class="wikitable" style="width:75%;"
|-
! scope="col" style="width: 15%;"|Output
! scope="col" style="width: 15%;"|Type
! scope="col" style="width: 70%;"|Description
|-
! Next
| boolean
| Optional port used for enforcing the execution order of blocks.
|}
|}


Line 43: Line 39:
! scope="col" style="width: 70%;"|Description
! scope="col" style="width: 70%;"|Description
|-
|-
! Key
! Button Name
| String
| Name of button being defined.
|-
! Font
|  
|  
| Specify button to setup.
| Specify which font to use for all button text.
|-
|-
! Images From Ports
! Custom Font
|  
| string
| Specify images from input ports on block.
| Custom True Type font to use for all button text.
Set the Font dropdown to "-CUSTOM-" to use this option.
The font must be saved as a TTF file & must be located on the Matlab path.
|-
! Choose Font...
| button
| Opens a file picker to select a TTF file.
|-
|-
! Not Pressed Image
! Button Image
|  
| string
| Specify button image when button is not pressed.
| Specify button image when button is not pressed.
|-
|-
! Select Image
! Button Image...
|  
| button
| Opens file browser to select image file.
| Opens file browser to select image file.
|-
|-
! Pressed Image
! Button Pressed Image
|  
| string
| Specify button image when button is pressed.
| Specify button image when button is pressed.
|-
|-
! Select Image
! Button Pressed Image...
|  
| button
| Opens file browser to select image file.
| Opens file browser to select image file.
|-
|-
! Text From Ports
! Button Text Line 1
|  
| string
| Specify text from input ports on block.
| Specify first line of text to appear on the button.
|-
! Button Text Line 2
| string
| Specify second line of text to appear on the button.
You must set the first line of button text in order to have a 2nd line.
|-
! Text Near Button
| string
| Specify one line of text to appear next to the button.
|-
! Text Height - Line 1
| integer
| Specify the height in pixels for button text line 1.
Text sizes from 1-130 pixels are valid.
|-
! Text Height - Line 2
| integer
| Specify the height in pixels for button text line 2.
Text sizes from 1-130 pixels are valid.
|-
! Text Height - Near Button
| integer
| Specify the height in pixels for the text next to the button.
Text sizes from 1-130 pixels are valid.
|-
|-
! Text Line 1
! On Button - Margin Size
| String
| integer
| Specify the first line of text for the button.
| Specify the desired distance in pixels between the edge of the text & the edge of the button.
This value only matters for non-centered text alignments.
|-
|-
! Text Line 2
! On Button - Vert. Alignment
| String
|  
| Specify the second line of text for the button.
| Specify the desired vertical alignment (top/center/bottom) of the text on the button.
|-
|-
! Font
! On Button - Horiz. Alignment
|  
|  
| Font to use when drawing text.
| Specify the desired horizontal alignment (left/center/right) of the text on the button.
|-
|-
! Height
! Near Button - Margin Size
| Number
| integer
| Height of text.
| Specify the desired distance in pixels between the edge of the text & the edge of the button.
|-
|-
! Color From Port
! Near Button - Vert. Alignment
|  
|  
| Specify drawing color from input port on block.
| Specify the desired vertical alignment (top/center/bottom) of the text next to the button.
This value only matters for side alignments of Left or Right.
|-
|-
! Color
! Near Button - Horiz. Alignment
|  
|  
| Drawing color of text in hex.
| Specify the desired horizontal alignment (left/center/right) of the text next to the button.
This value only matters for side alignments of Top or Bottom.
|-
|-
! Select Color
! Near Button - Side Alignment
|  
|  
| This button opens the color chooser tool.
| Specify which side of the button (top/bottom/left/right) the text next to the button should be adjacent to.
|-
! On-Button Text Color
| string (hexadecimal)
| Specify the color of the text on the button when the button is not being pressed.
|-
! On-Button Pressed Text Color
| string (hexadecimal)
| Specify the color of the text on the button when the button is being pressed.
|-
! Near-Button Text Color
| string (hexadecimal)
| Specify the color of the text next to the button when the button is not being pressed.
|-
! Near-Button Pressed Text Color
| string (hexadecimal)
| Specify the color of the text next to the button when the button is being pressed.
|-
|-
! Show Prev/Next Ports
! Text Color...Pressed Text Color...
|  
| buttons
| Indicates whether the previous and next ports are shown.
| Opens a color picker to choose a color value for the button texts.
|}
|}
== Supported Versions ==
* [[Raptor:Versions#2013a_0.0.1|Raptor 2013a_0.0.1]] and newer

Latest revision as of 14:19, 13 September 2023

Return to the main Raptor page

Return to Touchscreen page

Raptor™ Display Button Definition

Description

This block defines a button & prints it onto the touchscreen. Only one copy of a button will print per screen.

Please note: Unicode characters (for multilingual support) require special handling! To print Unicode characters correctly, please use the function(s) raptor_utf8_printf_str( unicode_dec ) or raptor_utf8_printf_str(hex2dec( unicode_hex )) to print a single Unicode character, where 'unicode_dec' is the Unicode value of the character as a decimal & 'unicode_hex' is the character's Unicode value as a hex string.

Inputs

Input Type Description
x int32 X position of button.
y int32 Y position of button.

Parameters

Parameter Type Description
Button Name String Name of button being defined.
Font Specify which font to use for all button text.
Custom Font string Custom True Type font to use for all button text.

Set the Font dropdown to "-CUSTOM-" to use this option. The font must be saved as a TTF file & must be located on the Matlab path.

Choose Font... button Opens a file picker to select a TTF file.
Button Image string Specify button image when button is not pressed.
Button Image... button Opens file browser to select image file.
Button Pressed Image string Specify button image when button is pressed.
Button Pressed Image... button Opens file browser to select image file.
Button Text Line 1 string Specify first line of text to appear on the button.
Button Text Line 2 string Specify second line of text to appear on the button.

You must set the first line of button text in order to have a 2nd line.

Text Near Button string Specify one line of text to appear next to the button.
Text Height - Line 1 integer Specify the height in pixels for button text line 1.

Text sizes from 1-130 pixels are valid.

Text Height - Line 2 integer Specify the height in pixels for button text line 2.

Text sizes from 1-130 pixels are valid.

Text Height - Near Button integer Specify the height in pixels for the text next to the button.

Text sizes from 1-130 pixels are valid.

On Button - Margin Size integer Specify the desired distance in pixels between the edge of the text & the edge of the button.

This value only matters for non-centered text alignments.

On Button - Vert. Alignment Specify the desired vertical alignment (top/center/bottom) of the text on the button.
On Button - Horiz. Alignment Specify the desired horizontal alignment (left/center/right) of the text on the button.
Near Button - Margin Size integer Specify the desired distance in pixels between the edge of the text & the edge of the button.
Near Button - Vert. Alignment Specify the desired vertical alignment (top/center/bottom) of the text next to the button.

This value only matters for side alignments of Left or Right.

Near Button - Horiz. Alignment Specify the desired horizontal alignment (left/center/right) of the text next to the button.

This value only matters for side alignments of Top or Bottom.

Near Button - Side Alignment Specify which side of the button (top/bottom/left/right) the text next to the button should be adjacent to.
On-Button Text Color string (hexadecimal) Specify the color of the text on the button when the button is not being pressed.
On-Button Pressed Text Color string (hexadecimal) Specify the color of the text on the button when the button is being pressed.
Near-Button Text Color string (hexadecimal) Specify the color of the text next to the button when the button is not being pressed.
Near-Button Pressed Text Color string (hexadecimal) Specify the color of the text next to the button when the button is being pressed.
Text Color...Pressed Text Color... buttons Opens a color picker to choose a color value for the button texts.