Home
  • Products
  • Solutions
  • Support
  • Company
  • Products
  • Solutions
  • Support
  • Company
Community Forums Custom IC SKILL "Fixed"+"scalable" stretch form

Stats

  • Replies 2
  • Subscribers 136
  • Views 326
  • Members are here 0

"Fixed"+"scalable" stretch form

Martinsh
Martinsh 2 months ago

Dear Sir,

A form has two parts, the left panal and the right panal. There are some fields on the left panal and a report field on the right panal. When stretch the form, the fields on the left panal keep their position and size no change, but the report field scales with stretch. How to realize this form?

Regards,

Martin

  • Reply
  • Cancel
  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett 2 months ago

    Martin,

    This example of using nested layouts should show you how to do this - it's a silly made up example that shows the contents of analogLib on the right, and the left fields show the last selected item in the report field. As you resize the form, the report field expands right and downwards, but the left fields stay where they are.

    procedure(CCFcreateFormWithReportField()
      let((report lib lcvList libField cellField viewField libLabel cellLabel 
          viewLabel leftGrid)
        ; create some contents for a report field
        lib=ddGetObj("analogLib")
        foreach(cell lib~>cells
          foreach(view cell~>views
            lcvList=cons(list(lib~>name cell~>name view~>name) lcvList)
          )
        )
        lcvList=sort(lcvList 
          lambda((a b)
            cond(
              (alphalessp(cadr(a) cadr(b)) t)
              (equal(cadr(a) cadr(b)) && alphalessp(caddr(a) caddr(b)) t)
              (t nil)
            )
          ))
        report=hiCreateReportField(
          ?name 'report
          ?headers list(
            list("Library" 100 'left 'string t)
            list("Cell" 100 'left 'string t)
            list("View" 100 'left 'string t)
          )
          ?choices lcvList
          ?selectMode 'single
          ?callback lambda((field _scope selectedItems)
            let((choice (form hiGetCurrentForm()))
              choice=nth(car(selectedItems) field->choices)
              form->lib->value=car(choice)
              form->cell->value=cadr(choice)
              form->view->value=caddr(choice)
            )
          )
        )
        libField=hiCreateStringField(
          ?name 'lib
        )
        cellField=hiCreateStringField(
          ?name 'cell
        )
        viewField=hiCreateStringField(
          ?name 'view
        )
        libLabel=hiCreateLabel(
          ?name 'libLabel
          ?labelText "Library"
          ?justification 'right
        )
        cellLabel=hiCreateLabel(
          ?name 'cellLabel
          ?labelText "Cell"
          ?justification 'right
        )
        viewLabel=hiCreateLabel(
          ?name 'viewLabel
          ?labelText "View"
          ?justification 'right
        )
        ;--------------------------------------------------------------------
        ; Create the left panel as a grid layout
        ;--------------------------------------------------------------------
        leftGrid=hiCreateGridLayout(
          'leftGrid
          ?items list(
            list(libLabel 'row 0 'col 0)
            list(libField 'row 0 'col 1)
            list(cellLabel 'row 1 'col 0)
            list(cellField 'row 1 'col 1)
            list(viewLabel 'row 2 'col 0)
            list(viewField 'row 2 'col 1)
            list('col_min_width 0 80)
            list('col_min_width 1 100)
            list('col_stretch 0 0)
            list('col_stretch 1 0)
          )
        )
        hiCreateLayoutForm(
          'CCFformWithReportFieldForm
          "Form with Report"
          ;------------------------------------------------------------------
          ; use a horizontal box layout for the left grid (non-stretchy)
          ; and the report (stretchy)
          ;------------------------------------------------------------------
          hiCreateHorizontalBoxLayout(
            'all
            ?items list(
              list(
                ;------------------------------------------------------------
                ; The vertical box layout is to add a stretch item below
                ; the leftGrid which will expand to fill the vertical space;
                ; This keeps the left fields in the same place vertically
                ;------------------------------------------------------------
                hiCreateVerticalBoxLayout(
                  'vbox
                  ?items list(
                    leftGrid
                    list('stretch_item 1)
                  )
                )
                'stretch 0)
              list(report 'stretch 1)
            )
          )
        )
      )
    )
    
    procedure(CCFformWithReportField()
      unless(boundp('CCFformWithReportFieldForm)
        CCFcreateFormWithReportField()
      )
      hiDisplayForm(inSkill(CCFformWithReportFieldForm))
    )

    Regards,

    Andrew

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • Martinsh
    Martinsh 1 month ago in reply to Andrew Beckett

    Thanks Andrew! It works.

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
Reply
  • Martinsh
    Martinsh 1 month ago in reply to Andrew Beckett

    Thanks Andrew! It works.

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2023 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information