• 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. Customising Forms

Stats

  • Locked Locked
  • Replies 11
  • Subscribers 144
  • Views 18488
  • 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

Customising Forms

netbug
netbug over 9 years ago

Dear all,

I would like to know if, on a form, it is possible to verify the information entered in a text box as the user is writing ?

Eg.

I have a text box (I am sorry if this is not the name in SKILL) that asks the user to enter the directory where he wants to save the files. I would like to check that the directory is valid without waiting for the user to press the "OK" button.

I would like as well to know, if it is possible to customise the buttons on a form and force the buttons to use my own functions?

Thanks in advance,

José

  • Cancel
Parents
  • netbug
    netbug over 9 years ago

    Hi,

    Thanks to both of you for your inputs.

    Actually I already use a fileSelector, but the goal isn't only to browse to the path and select a directory, but to make sure that the user enters a valid address, if he decides to enter it manually.

    One way is to verify everything when the user presses OK, but I would like to do that verification before closing the form.

    Imagine that, as you enter manually the path, you'll have a label that says "invalid directory" and as you continue typing it will eventually say "Valid Directory !".

    In other languages there are events which are triggered whenever the user writes, clicks, etc.

    Please find below my code, and make any suggestions you like on it.

    Thanks in advance,

    José

    ;==============================================================================
    ;===================== Building the form "createMainForm" ======================
    ;==============================================================================

    procedure(createMainForm()
    let((myLabel myDataPathSelector myRadio1 myRadio2 sep1 mytoggle)

    ; Create the top label
    myLabel=hiCreateLabel(
    ?name 'myLabelText
    ?labelText "Settings"
    ?justification 'center
    )

    ; Create Separator
    sep1=hiCreateSeparatorField(?name 'sep1)

    ; Create Separator
    ;sep2=hiCreateSeparatorField(?name 'sep2)

    ; Allows user to select the config file
    /*myFileSelector = hiCreateFileSelectorField(
    ?name 'fileSelector
    ?mode 'anyFile
    ?prompt "Path to config file: "
    ?value "Insert the path to your config file here !"
    ?defValue "~/Desktop/config.txt"
    )*/

    ; Directory Select allows user to select the directory where to save the files
    myDataPathSelector = hiCreateFileSelectorField(
    ?name 'dataPath
    ?mode 'directoryOnly
    ?prompt "Path to saved images: "
    ?value "Insert the path to your images here !"
    ?defValue "~/Desktop/"
    )

    ;Radio Buttons
    myRadio1 = hiCreateRadioField(
    ?name 'radio1
    ?prompt "Always reload this form"
    ?defValue "No"
    ?callback list( "RadioBtnCB()")
    ?choices list("Yes" "No")
    )

    ;Radio Buttons auto naming of pictures
    myRadio2 = hiCreateRadioField(
    ?name 'radio2
    ?prompt "Image's Naming"
    ?defValue "Auto"
    ; ?callback '("dispMessage("\nConfigFilest Radio button callback\n")" "")
    ?choices list("Auto" "Manual")
    )

    mytoggle = hiCreateToggleField(
    ?name 'overwrite
    ?prompt ""
    ?choices list('(temp "Overwrite config File ?"))
    ?value '(t)
    ?numSelect 1
    ?callback list( "RadioBtnCB()")
    )

    hiCreateAppForm(
    ?name 'settingsForm
    ?formTitle "Script Configuration"
    ?callback "";
    ?fields list(myLabel sep1 myDataPathSelector myRadio1 myRadio2 mytoggle)
    ?buttonLayout `OKCancelDef
    )

    ) ; End let statment
    hiDisplayForm(settingsForm)
    ) ; End Procedure createMainForm

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • netbug
    netbug over 9 years ago

    Hi,

    Thanks to both of you for your inputs.

    Actually I already use a fileSelector, but the goal isn't only to browse to the path and select a directory, but to make sure that the user enters a valid address, if he decides to enter it manually.

    One way is to verify everything when the user presses OK, but I would like to do that verification before closing the form.

    Imagine that, as you enter manually the path, you'll have a label that says "invalid directory" and as you continue typing it will eventually say "Valid Directory !".

    In other languages there are events which are triggered whenever the user writes, clicks, etc.

    Please find below my code, and make any suggestions you like on it.

    Thanks in advance,

    José

    ;==============================================================================
    ;===================== Building the form "createMainForm" ======================
    ;==============================================================================

    procedure(createMainForm()
    let((myLabel myDataPathSelector myRadio1 myRadio2 sep1 mytoggle)

    ; Create the top label
    myLabel=hiCreateLabel(
    ?name 'myLabelText
    ?labelText "Settings"
    ?justification 'center
    )

    ; Create Separator
    sep1=hiCreateSeparatorField(?name 'sep1)

    ; Create Separator
    ;sep2=hiCreateSeparatorField(?name 'sep2)

    ; Allows user to select the config file
    /*myFileSelector = hiCreateFileSelectorField(
    ?name 'fileSelector
    ?mode 'anyFile
    ?prompt "Path to config file: "
    ?value "Insert the path to your config file here !"
    ?defValue "~/Desktop/config.txt"
    )*/

    ; Directory Select allows user to select the directory where to save the files
    myDataPathSelector = hiCreateFileSelectorField(
    ?name 'dataPath
    ?mode 'directoryOnly
    ?prompt "Path to saved images: "
    ?value "Insert the path to your images here !"
    ?defValue "~/Desktop/"
    )

    ;Radio Buttons
    myRadio1 = hiCreateRadioField(
    ?name 'radio1
    ?prompt "Always reload this form"
    ?defValue "No"
    ?callback list( "RadioBtnCB()")
    ?choices list("Yes" "No")
    )

    ;Radio Buttons auto naming of pictures
    myRadio2 = hiCreateRadioField(
    ?name 'radio2
    ?prompt "Image's Naming"
    ?defValue "Auto"
    ; ?callback '("dispMessage("\nConfigFilest Radio button callback\n")" "")
    ?choices list("Auto" "Manual")
    )

    mytoggle = hiCreateToggleField(
    ?name 'overwrite
    ?prompt ""
    ?choices list('(temp "Overwrite config File ?"))
    ?value '(t)
    ?numSelect 1
    ?callback list( "RadioBtnCB()")
    )

    hiCreateAppForm(
    ?name 'settingsForm
    ?formTitle "Script Configuration"
    ?callback "";
    ?fields list(myLabel sep1 myDataPathSelector myRadio1 myRadio2 mytoggle)
    ?buttonLayout `OKCancelDef
    )

    ) ; End let statment
    hiDisplayForm(settingsForm)
    ) ; End Procedure createMainForm

    • 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