Product Documentation
Cadence User Interface SKILL Reference
Product Version IC23.1, September 2023

hiGetListBoxFieldFit

hiGetListBoxFieldFit( 
x_numRows 
x_numColumns 
[ g_ignored ]
) 
=> l_widthHeight 

Description

Returns the width and height necessary for displaying a list box with the specified number of rows and columns and the specified font.

Arguments

x_numRows

Number of rows to display in the list box.

x_numColumns

Number of columns (characters) to display in the list box.

g_ignored

Optional. Any value that exists for backwards compatibility.

Value Returned

l_widthHeight

List of the width and height of the list box. The width for the variable width fonts is based on the size of a numeric character.

Examples

Creates a form with a list box field large enough to show four rows of values and as many columns as the largest value in the value list.

let( (lbValues (lbColumns 0) lbSize (lbPrompt "My List") lbPromptSize
(lbFont hiGetFont("text")))
    lbValues = list( "this is my first value string" 
"this is my second value string"
"this is my third value string"
"this is my fourth value string"
"this is my fifth value string"
"this is my sixth value string"
"this is my seventh value string"
"this is my eighth value string" )
    foreach( x lbValues
let( (y)
y = strlen( x )
when( y > lbColumns lbColumns = y )
)
)
lbPromptSize = hiGetTextWidth( lbFont lbPrompt )
lbSize = hiGetListBoxFieldFit( 4 lbColumns lbFont )
    MyListBoxField = hiCreateListBoxField( 
?name ’MyListBoxField
?prompt lbPrompt
?choices lbValues )
    MyListBoxForm = hiCreateAppForm(
?name ’MyListBoxForm
?fields list( list( MyListBoxField 5:5
list( car(lbSize) + lbPromptSize cadr(lbSize))
lbPromptSize ) )
)
)

Related Topics

List Box Functions

hiDisplayListBox

hiGetNumVisibleItems


Return to top
 ⠀
X