• 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. how to change buttontext/icon

Stats

  • Locked Locked
  • Replies 11
  • Subscribers 149
  • Views 7070
  • 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

how to change buttontext/icon

mantis
mantis over 14 years ago

test1 = hiCreateButton(
             ?name 'test1
             ?buttonText "test button"
             ?callback "println(\"hello pressed\")"

)

I want to change buttonText to any other words.how ?

and I find I can't access the buttonText attribute through ~> operator, why?

  • Cancel
Parents
  • mantis
    mantis over 14 years ago
    hi Andrew,
    here is my skill.
    /* define the button array */
    procedure( buttonareaArray( nRows nCols )
    let( ( rowArray row )
    declare( rowArray[ nRows ] )
    for(i 0 nRows-1
    declare( row[ nCols ] )
    rowArray[ i ] = row
    )
    rowArray
    )
    )

    /* change the button x y */
    procedure( change_form_x_y( )
    for(i (getdx~>value)+1 storeofx
    for(j 1 storeofy
    sprintf( buttonname "button%d%d" i j)
    hiDeleteField( MatchCreater stringToSymbol( buttonname ))
    )
    )
    for(i 1 storeofx
    for(j (getdy~>value)+1 storeofy
    sprintf( buttonname "button%d%d" i j)
    hiDeleteField( MatchCreater stringToSymbol( buttonname ))
    )
    )
    for(i storeofx+1 getdx~>value
    for(j 1 getdy~>value
    dnx=115+(i-1)*80
    dny=45+(j-1)*35
    buttonaddxlist = list( buttonarray[i][j] list(dnx dny) list(75 30) )
    hiAddField( MatchCreater buttonaddxlist )
    )
    )
    for(i 1 storeofx
    for(j storeofy+1 getdy~>value
    dnx=115+(i-1)*80
    dny=45+(j-1)*35
    buttonaddylist = list( buttonarray[i][j] list(dnx dny) list(75 30) )
    hiAddField( MatchCreater buttonaddylist )
    )
    )

    storeofx = getdx~>value
    printf( "%d" storeofx)
    storeofy = getdy~>value
    printf( "%d" storeofy)

    )

    /* initial the form coord */
    procedure( buttoncoordcal( buttoncoordlistorg getdx getdy )
    i = j = dx = dy = 0
    buttonWid = 75
    buttonHig = 30
    buttonPitchx = 80
    buttonPitchy = 35
    buttoncoordlist = buttoncoordlistorg
    for(i 1 getdx~>value
    for(j 1 getdy~>value
    dx=115+(i-1)*80
    dy=45+(j-1)*35
    button2dlist = list( buttonarray[i][j] list(dx dy) list(buttonWid buttonHig) )
    buttoncoordlist = append(buttoncoordlist cons( button2dlist nil ))
    )
    )
    buttoncoordlist
    )

    procedure( changelabel( field )
    listselectstatus = mylist~>value
    labeltoadd = nthelem(1 listselectstatus)
    hiSetButtonLabel(field labeltoadd)
    )



    /* create the button area */
    procedure( createbuttonarea( )
    for( i 0 29
    for( j 0 29
    sprintf( buttonname "button%d%d" i j)
    buttonarray[ i ][ j ] = hiCreateButton(
    ?name stringToSymbol( buttonname )
    ?buttonText buttonname
    ?callback sprintf(buttoncount "changelabel( hiGetCurrentForm()~>%s )" buttonname)
    )
    )
    )
    )



    strlist =list("aaa" "bbb" "ccc" "ddd" "eee" "fff")
    mylist = hiCreateListBoxField( ?name 'devicelist
    ?choices strlist
    ?callback "println(\"list changed\")"
    )
    listselectstatus = mylist~>value
    getdx = hiCreateIntField(
    ?name 'getintx
    ?prompt "X"
    ?value 3
    ?defValue 1
    ?format "%d"
    ?callback "change_form_x_y( )"
    ?range 0:100000
    )
    getdy = hiCreateIntField(
    ?name 'getinty
    ?prompt "Y"
    ?value 2
    ?defValue 1
    ?format "%d"
    ?callback "change_form_x_y( )"
    ?range 0:100000
    )
    buttoncoordlistorg = list(
    list( mylist 15:45 90:100 10 )
    list( getdx 15:5 55:30 10 )
    list( getdy 80:5 55:30 10 )
    )
    buttoncoordlist = list( )
    storeofx = getdx~>value
    storeofy = getdy~>value
    buttonarray = buttonareaArray( 30 30 )
    createbuttonarea
    buttoncoordcal( buttoncoordlistorg getdx getdy )
    change_form_x_y( )

    hiCreateAppForm( ?name 'MatchCreater
    ?formTitle "Match Creater"
    ?fields buttoncoordlist
    ?initialSize list( 500 500)
    ?callback ""
    ?help "formHelp" )
    hiSetFormPosition( 500:0)
    hiDisplayForm( MatchCreater )




    I think you can get all the script.
    Regards,
    Tommi
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • mantis
    mantis over 14 years ago
    hi Andrew,
    here is my skill.
    /* define the button array */
    procedure( buttonareaArray( nRows nCols )
    let( ( rowArray row )
    declare( rowArray[ nRows ] )
    for(i 0 nRows-1
    declare( row[ nCols ] )
    rowArray[ i ] = row
    )
    rowArray
    )
    )

    /* change the button x y */
    procedure( change_form_x_y( )
    for(i (getdx~>value)+1 storeofx
    for(j 1 storeofy
    sprintf( buttonname "button%d%d" i j)
    hiDeleteField( MatchCreater stringToSymbol( buttonname ))
    )
    )
    for(i 1 storeofx
    for(j (getdy~>value)+1 storeofy
    sprintf( buttonname "button%d%d" i j)
    hiDeleteField( MatchCreater stringToSymbol( buttonname ))
    )
    )
    for(i storeofx+1 getdx~>value
    for(j 1 getdy~>value
    dnx=115+(i-1)*80
    dny=45+(j-1)*35
    buttonaddxlist = list( buttonarray[i][j] list(dnx dny) list(75 30) )
    hiAddField( MatchCreater buttonaddxlist )
    )
    )
    for(i 1 storeofx
    for(j storeofy+1 getdy~>value
    dnx=115+(i-1)*80
    dny=45+(j-1)*35
    buttonaddylist = list( buttonarray[i][j] list(dnx dny) list(75 30) )
    hiAddField( MatchCreater buttonaddylist )
    )
    )

    storeofx = getdx~>value
    printf( "%d" storeofx)
    storeofy = getdy~>value
    printf( "%d" storeofy)

    )

    /* initial the form coord */
    procedure( buttoncoordcal( buttoncoordlistorg getdx getdy )
    i = j = dx = dy = 0
    buttonWid = 75
    buttonHig = 30
    buttonPitchx = 80
    buttonPitchy = 35
    buttoncoordlist = buttoncoordlistorg
    for(i 1 getdx~>value
    for(j 1 getdy~>value
    dx=115+(i-1)*80
    dy=45+(j-1)*35
    button2dlist = list( buttonarray[i][j] list(dx dy) list(buttonWid buttonHig) )
    buttoncoordlist = append(buttoncoordlist cons( button2dlist nil ))
    )
    )
    buttoncoordlist
    )

    procedure( changelabel( field )
    listselectstatus = mylist~>value
    labeltoadd = nthelem(1 listselectstatus)
    hiSetButtonLabel(field labeltoadd)
    )



    /* create the button area */
    procedure( createbuttonarea( )
    for( i 0 29
    for( j 0 29
    sprintf( buttonname "button%d%d" i j)
    buttonarray[ i ][ j ] = hiCreateButton(
    ?name stringToSymbol( buttonname )
    ?buttonText buttonname
    ?callback sprintf(buttoncount "changelabel( hiGetCurrentForm()~>%s )" buttonname)
    )
    )
    )
    )



    strlist =list("aaa" "bbb" "ccc" "ddd" "eee" "fff")
    mylist = hiCreateListBoxField( ?name 'devicelist
    ?choices strlist
    ?callback "println(\"list changed\")"
    )
    listselectstatus = mylist~>value
    getdx = hiCreateIntField(
    ?name 'getintx
    ?prompt "X"
    ?value 3
    ?defValue 1
    ?format "%d"
    ?callback "change_form_x_y( )"
    ?range 0:100000
    )
    getdy = hiCreateIntField(
    ?name 'getinty
    ?prompt "Y"
    ?value 2
    ?defValue 1
    ?format "%d"
    ?callback "change_form_x_y( )"
    ?range 0:100000
    )
    buttoncoordlistorg = list(
    list( mylist 15:45 90:100 10 )
    list( getdx 15:5 55:30 10 )
    list( getdy 80:5 55:30 10 )
    )
    buttoncoordlist = list( )
    storeofx = getdx~>value
    storeofy = getdy~>value
    buttonarray = buttonareaArray( 30 30 )
    createbuttonarea
    buttoncoordcal( buttoncoordlistorg getdx getdy )
    change_form_x_y( )

    hiCreateAppForm( ?name 'MatchCreater
    ?formTitle "Match Creater"
    ?fields buttoncoordlist
    ?initialSize list( 500 500)
    ?callback ""
    ?help "formHelp" )
    hiSetFormPosition( 500:0)
    hiDisplayForm( MatchCreater )




    I think you can get all the script.
    Regards,
    Tommi
    • 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