How to properly use the horiz_align arguments for an UI form ? – Custom IC SKILL – Cadence Technology Forums


Hello, 

I’m writing my first SKILL program. So far so good, but I now running into some trouble with the application form. Especially one of the frame within the form:

The frame consist of:

  • One radio field with 2 choices.
  • Two verticalBoxLayout with 4 fields each (boolean buttons on the left, float fields on the right side). They are wrapped together within an horizontalBoxLayout. 

First problem is that the float fields are either too large or too small. Only 2-3 digits will be entered there so I don’t need the fields to extend when the form is stretched by the user.

Secondly the horiz_align arguments do not seem to have any effect.

Ideally I would want the buttons and fields centered and close together. Un-ticking the button would disable the corresponding field (still need to make the proper callbacks for that).

Here is the code :

findFrame = hiCreateFormLayout(

‘findFormLayout
?frame “Find Vias”
?items
list(

hiCreateRadioField(

?name ‘searchFor
?choices ‘(“Vias derived from techfile” “Customized vias”)
?prompt “Look for :”
?callback list(“println(\”Techvias selecetd\”)” “println(\”Custom via selected\”)”)

)

hiCreateHorizontalBoxLayout(

‘boolsAndValues
?items
list(
hiCreateVerticalBoxLayout(

‘bools
?items
list(

hiCreateBooleanButton( ?name ‘bool0 ?buttonText “cutWidth” ?callback nil )
hiCreateBooleanButton( ?name ‘bool1 ?buttonText “cutHeight” ?callback nil )
hiCreateBooleanButton( ?name ‘bool2 ?buttonText “cutRows” ?callback nil )
hiCreateBooleanButton( ?name ‘bool3 ?buttonText “cutColums” ?callback nil )

)
?spacing list( 0 0 )
?horiz_align ‘right ; trying to align the elements within the V-box??

)
hiCreateVerticalBoxLayout(

‘values
?items
list(

list( hiCreateFloatField( ?name ‘param0 ?callback nil ) ‘horiz_align ‘right )
hiCreateFloatField( ?name ‘param1 ?callback nil )
hiCreateFloatField( ?name ‘param2 ?callback nil )
hiCreateFloatField( ?name ‘param3 ?callback nil )

)
?spacing list( 0 0 )
?horiz_align ‘left

)
)
)
)
)

gridTest = hiCreateLayoutForm(

‘gridTest
“Grid Test”
findFrame
?sizePolicy ‘expanding
?buttonLayout ‘Close
)

hiDisplayForm( gridTest )

I have also tried replacing the hiCreateHorizontalBoxLayout() function above with a Grid Layout, but the result is rather similar :

hiCreateGridLayout(

‘findViaParams
?frame nil
?items
list(

list( hiCreateBooleanButton( ?name ‘bool0 ?buttonText “cutWidth” ?callback nil ) ‘row 0 ‘col 0 ‘horiz_align ‘right )
list( hiCreateBooleanButton( ?name ‘bool1 ?buttonText “cutHeight” ?callback nil ) ‘row 1 ‘col 0 )
list( hiCreateBooleanButton( ?name ‘bool2 ?buttonText “cutRows” ?callback nil ) ‘row 2 ‘col 0 )
list( hiCreateBooleanButton( ?name ‘bool3 ?buttonText “cutColums” ?callback nil ) ‘row 3 ‘col 0 )
list( hiCreateFloatField( ?name ‘param0 ?callback nil ) ‘row 0 ‘col 1 ‘horiz_align ‘left )
list( hiCreateFloatField( ?name ‘param1 ?callback nil ) ‘row 1 ‘col 1 )
list( hiCreateFloatField( ?name ‘param2 ?callback nil ) ‘row 2 ‘col 1 )
list( hiCreateFloatField( ?name ‘param3 ?callback nil ) ‘row 3 ‘col 1 )

;list( ‘col_stretch 0 1 )
;list( ‘col_stretch 1 0 )
;list( ‘col_min_width 1 40)
)
)

When de-comenting the last 3 lists I can achieve fixed size for the float fields but they move to the left edge of the form for some reason.

Any Idea why the horiz_align has no effect in this case ? (button and field of the first row)

PS: sorry for the weird formatting of the code but I couldn’t find how to make proper code quotation.

Regards,

Pierre



Source link

Leave a Comment