• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Dynamic adaptation of size by fields upon form resize

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 14867
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Dynamic adaptation of size by fields upon form resize

Atul Dwivedi
Atul Dwivedi over 12 years ago

Hi there,

I have a small UI related question. I have a form which has a big ListBox field (almost filling the whole form). The contents are very long sometimes and the user tends to resize the form to accommodate more info without scrolling horizontally. But the resize of the form does not resize the field.

Is there a way, by which the field could occupy as much area available, upon form resize (both enlarging and shrinking)?

Thanks and Regards,

Atul 

  • Cancel
Parents
  • skillUser
    skillUser over 12 years ago

     Hi Atul,

     I have attached an example SKILL file that I wrote to show this, as well as other listBox features.  Take a look, hopefully it will address your questions?

    Code posted here for convenience also:

    
    /* CCSlistBoxTest.il
    
    Group           Custom IC, Cadence Design Systems
    Language        SKILL
    Revision No.    1.1
    Date Created    Nov 17, 2010 
    Last Modified
    Tested in       IC614
    Lint score      100 (best is 100)
    Description:
    
    A quick SKILL example to show how two list boxes on a form can be
    set up so that if the 'nth' item is selected in one list box, the
    'nth' item will also be selected in the other list box.
    
    The form is created with an "attachmentList" which controls how the
    fields will be affected when the form is resized. In this example,
    the top left corner of the first list box is anchored to the top left
    of the form, but its bottom edge and right edge are allowed to resize
    proportionally as the form changes, so the right edge remains in the
    center of the form.  Likewise the second field is anchored, but its
    top left is "attached" to the top right of the first listbox field.
    Again the bottom and right edges will grow and shrink proportionally
    as the form size changes.
    
    ***************************************************
    
    SCCS Info: @(#) CCSlistBoxTest.il 11/19/10.20:14:07 1.1
    
    ***********************************************************************
    * DISCLAIMER: This code is provided for Cadence customers to use      *
    * with Cadence tools at their own risk. The code may require          *
    * modification to satisfy the requirements of any user. The code and  *
    * any modifications to the code may not be compatible with current or *
    * future versions of Cadence products.                                *
    * THE CODE IS PROVIDED "AS IS" AND WITH NO WARRANTIES, INCLUDING      *
    * WITHOUT LIMITATION ANY EXPRESS OR IMPLIED WARRANTIES OF             *
    * MERCHANTABILITY, FITNESS FOR A PARTICULAR USE OR NON-INFRINGEMENT.  *
    * © 2010 Cadence Design Systems, Inc. All rights reserved.            *
    ***********************************************************************
    
    */
    
    procedure(CCSlistBoxTest()
      let( (form lb1 lb2 choices)
      ;; some values for the list boxes to display
      choices = list("1" "2" "3" "4" "5" "6" "7" "8" "9")
    
      ;; first listbox field, the value is returned as an integer which
      ;; denotes the position in the list of choices
      lb1 = hiCreateListBoxField(
        ?name 'lb1
        ?prompt     "List Box 1"
        ?choices    choices
        ?changeCB   "CCSlistBoxCB(CCSlistBoxForm 'lb1)"
        ?valueByPosition t
      )
    
      ;; second listbox field, the value is returned as an integer which
      ;; denotes the position in the list of choices
      lb2 = hiCreateListBoxField(
        ?name 'lb2
        ?prompt     "List Box 2"
        ?choices    reverse(choices)
        ?changeCB   "CCSlistBoxCB(CCSlistBoxForm 'lb2)"
        ?valueByPosition t
      )
    
      ;; create a 2-dimensional form with the two list boxes specified
      ;; with prompt and field sizes, the form is given an initial size
      ;; and the fields are told how they are to be affected if the form
      ;; is resized (using the attachmentList)
      form = hiCreateAppForm(
        ?name 'CCSlistBoxForm
        ?formTitle "List Box Test"
        ;; lb1 begins at the top left corner, 0:0 and is 150 wide, by
        ;; 150 tall, but 80 of the width is used for the field prompt
        ;; lb2 begins at the top middle of the form, 150:0, and is 
        ;; also 150 wide x 150 tall, again 80 of the width is used for
        ;; the field prompt
        ?fields list(
          list(lb1 0:0 150:150 80)
          list(lb2 150:0 150:150 80))
        ;; the first or'ed items relate to "lb1" and the second set of
        ;; items that are or'ed together relate to the "lb2" field.
        ;; lb1's top left corner remains anchored if the form changes,
        ;; but its lower right will vary proportionally with the form.
        ;; lb2's top left corner is allowed to move horizontally but
        ;; remains fixed to the top of the form, and the lower right
        ;; corner adjusts proportionally with the form width & height.
        ?attachmentList     list(hicLeftPositionSet |hicTopPositionSet|
          hicRightPercentSet|hicBottomPercentSet     hicLeftPercentSet|
          hicTopPositionSet | hicRightPercentSet   |hicBottomPercentSet)
        ?initialSize        list(300 150)
      )
      hiDisplayForm(form)
      ); let
    ); procedure CCSlistBoxTest
    
    procedure(CCSlistBoxCB(form field)
      ;; a simple case statement to select the same numbered field
      ;; in another list box as was selected in this list box
      caseq(field
        (lb1
          putpropq(getq(form lb2) getq(get(form field) value) value)
        )
        (lb2
          putpropq(getq(form lb1) getq(get(form field) value) value)
        )
      ); case
    ); procedure CCSlistBoxCB
    
    

    My apologies if the formatting does not look good.
    Regards,

    Lawrence.

    CCSlistBoxTest.il
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • skillUser
    skillUser over 12 years ago

     Hi Atul,

     I have attached an example SKILL file that I wrote to show this, as well as other listBox features.  Take a look, hopefully it will address your questions?

    Code posted here for convenience also:

    
    /* CCSlistBoxTest.il
    
    Group           Custom IC, Cadence Design Systems
    Language        SKILL
    Revision No.    1.1
    Date Created    Nov 17, 2010 
    Last Modified
    Tested in       IC614
    Lint score      100 (best is 100)
    Description:
    
    A quick SKILL example to show how two list boxes on a form can be
    set up so that if the 'nth' item is selected in one list box, the
    'nth' item will also be selected in the other list box.
    
    The form is created with an "attachmentList" which controls how the
    fields will be affected when the form is resized. In this example,
    the top left corner of the first list box is anchored to the top left
    of the form, but its bottom edge and right edge are allowed to resize
    proportionally as the form changes, so the right edge remains in the
    center of the form.  Likewise the second field is anchored, but its
    top left is "attached" to the top right of the first listbox field.
    Again the bottom and right edges will grow and shrink proportionally
    as the form size changes.
    
    ***************************************************
    
    SCCS Info: @(#) CCSlistBoxTest.il 11/19/10.20:14:07 1.1
    
    ***********************************************************************
    * DISCLAIMER: This code is provided for Cadence customers to use      *
    * with Cadence tools at their own risk. The code may require          *
    * modification to satisfy the requirements of any user. The code and  *
    * any modifications to the code may not be compatible with current or *
    * future versions of Cadence products.                                *
    * THE CODE IS PROVIDED "AS IS" AND WITH NO WARRANTIES, INCLUDING      *
    * WITHOUT LIMITATION ANY EXPRESS OR IMPLIED WARRANTIES OF             *
    * MERCHANTABILITY, FITNESS FOR A PARTICULAR USE OR NON-INFRINGEMENT.  *
    * © 2010 Cadence Design Systems, Inc. All rights reserved.            *
    ***********************************************************************
    
    */
    
    procedure(CCSlistBoxTest()
      let( (form lb1 lb2 choices)
      ;; some values for the list boxes to display
      choices = list("1" "2" "3" "4" "5" "6" "7" "8" "9")
    
      ;; first listbox field, the value is returned as an integer which
      ;; denotes the position in the list of choices
      lb1 = hiCreateListBoxField(
        ?name 'lb1
        ?prompt     "List Box 1"
        ?choices    choices
        ?changeCB   "CCSlistBoxCB(CCSlistBoxForm 'lb1)"
        ?valueByPosition t
      )
    
      ;; second listbox field, the value is returned as an integer which
      ;; denotes the position in the list of choices
      lb2 = hiCreateListBoxField(
        ?name 'lb2
        ?prompt     "List Box 2"
        ?choices    reverse(choices)
        ?changeCB   "CCSlistBoxCB(CCSlistBoxForm 'lb2)"
        ?valueByPosition t
      )
    
      ;; create a 2-dimensional form with the two list boxes specified
      ;; with prompt and field sizes, the form is given an initial size
      ;; and the fields are told how they are to be affected if the form
      ;; is resized (using the attachmentList)
      form = hiCreateAppForm(
        ?name 'CCSlistBoxForm
        ?formTitle "List Box Test"
        ;; lb1 begins at the top left corner, 0:0 and is 150 wide, by
        ;; 150 tall, but 80 of the width is used for the field prompt
        ;; lb2 begins at the top middle of the form, 150:0, and is 
        ;; also 150 wide x 150 tall, again 80 of the width is used for
        ;; the field prompt
        ?fields list(
          list(lb1 0:0 150:150 80)
          list(lb2 150:0 150:150 80))
        ;; the first or'ed items relate to "lb1" and the second set of
        ;; items that are or'ed together relate to the "lb2" field.
        ;; lb1's top left corner remains anchored if the form changes,
        ;; but its lower right will vary proportionally with the form.
        ;; lb2's top left corner is allowed to move horizontally but
        ;; remains fixed to the top of the form, and the lower right
        ;; corner adjusts proportionally with the form width & height.
        ?attachmentList     list(hicLeftPositionSet |hicTopPositionSet|
          hicRightPercentSet|hicBottomPercentSet     hicLeftPercentSet|
          hicTopPositionSet | hicRightPercentSet   |hicBottomPercentSet)
        ?initialSize        list(300 150)
      )
      hiDisplayForm(form)
      ); let
    ); procedure CCSlistBoxTest
    
    procedure(CCSlistBoxCB(form field)
      ;; a simple case statement to select the same numbered field
      ;; in another list box as was selected in this list box
      caseq(field
        (lb1
          putpropq(getq(form lb2) getq(get(form field) value) value)
        )
        (lb2
          putpropq(getq(form lb1) getq(get(form field) value) value)
        )
      ); case
    ); procedure CCSlistBoxCB
    
    

    My apologies if the formatting does not look good.
    Regards,

    Lawrence.

    CCSlistBoxTest.il
    • Cancel
    • Vote Up 0 Vote Down
    • 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.

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

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