Product Documentation
Virtuoso Studio Design Environment SKILL Reference
Product Version IC23.1, November 2023

ddsSyncWithForm

ddsSyncWithForm( 
g_form 
s_action 
s_libField 
[ s_cellField [ s_viewField [ l_viewTypes ] ] ] 
)
=> t / nil

Description

Registers the given form and fields of that form for synchronization with the Library Browser. The Library Browser is seeded with the current values of the library, cell, and view names from the fields in the form if they are not blank. The field value is not updated by ddsSyncWithForm when its enabled or editable attribute is set to nil. From this point until ddsEndSyncWithForm, selections in the Library Browser seed the given form fields.

Applications must call ddsEndSyncWithForm (or dmbLibBrowserFormDone, which is retained for compatibility) when they are done with the browser, using Cancel or OK. Not doing so could result in unusual browser interactions for the user.

Arguments

g_form

Accepts a form or a page from a tab field.

s_action

Specifies an action to further control starting the Library Browser

    • design or open ddserv.browser onOpen: Opens automatically, when the Open Design form is displayed in the DFII software.
    • place ddserv.browser onPlace: Opens automatically, when a Place Instance form appears. (There are several types of Place Instance forms.)
    • other ddserv.browser onOther: Opens automatically, when any other type of linked form is displayed in the DFII software.

s_libField

The symbol of the form text field that is to hold the name of the library selected. It is the same as the library form field name specified in hiCreateForm.

s_cellField

The symbol of the form text field that is to hold the cell name. It is the same as the cell form field name specified in hiCreateForm.

s_viewField

The symbol of the form text field that is to hold the view name. It is the same as the view form field name specified in hiCreateForm.

l_viewTypes

A list of viewType strings if s_viewField is specified. This list directs the Library Browser to display only views matching the list of view types when a cell is expanded.

Value Returned

t

The execution of the function succeeds.

nil

No library is selected or if the Library Browser is not synchronized with any particular form.

Examples

This example creates the synchronization between form and Library Browser, where form is created by  exampleOpenForm() and the Library Browser is created by exampleBrowser().

exampleLibName = hiCreateStringField(
 ?name 'exampleLibName
 ?prompt "Library Name"
 ?value ""
 ?callback "ddsUpdateSyncWithForm( )"
 )
exampleCellName = hiCreateStringField(
 ?name 'exampleCellName
 ?prompt "Cell Name"
 ?callback "ddsUpdateSyncWithForm( )"
 )
exampleViewName = hiCreateStringField(
 ?name 'exampleViewName
 ?prompt "View Name"
 ?callback "ddsUpdateSyncWithForm( )"
 )
exampleBrowser = hiCreateButtonBoxField(
 ?name 'exampleBrowser
 ?prompt " "
 ?choices '(" Browse ")
 ?callback list("exampleBrowser( )")
 )
hiCreateForm(
 'exampleOpenForm "Synched Form Example"
 "exampleOpenForm( )"
 list( exampleLibName
       exampleCellName
       exampleViewName
 exampleBrowser )
 ""
)
procedure( exampleBrowser( )
    ddsSyncWithForm( exampleOpenForm 'browse 'exampleLibName
   'exampleCellName 'exampleViewName )
)
procedure( exampleOpenForm( )
    ddsSyncWithForm( exampleOpenForm 'other 'exampleLibName
 'exampleCellName 'exampleViewName )
    hiDisplayForm( 'exampleOpenForm )
)
    ddsEndSyncWithForm() 

This example creates a browse button for selecting a library. The browse button is placed in a HI Tab field. The eval function has been used to seed the proper argument for ddsSyncWithForm.

libBrowseBtn = hiCreateFormButton(
   ?name 'libBrowseBtn
   ?buttonText "Browse..."
   ?callback "ddsSyncWithForm(eval(browseForm->tabs->page1) 'libname 'libname)"
  )
; Create a browse button for selecting a file. This browse button is placed in a HI Tab field. 
 field1 = hiCreateStringField( ?name 'libname ?prompt "Library Name")
 field2 = hiCreateStringField( ?name 'filename ?prompt "File Name")
 fileBrowseBtn = hiCreateFormButton(
     ?name 'fileBrowseBtn
     ?buttonText "Browse..."
     ?callback "ddsFileBrowseCB(browseForm->tabs->page1 'filename)"
 )
     
; Create a HI Tab field where the previous browse fields are placed within it.
 tabs = hiCreateTabField(
     ?name 'tabs
     ?notebookStyle 'nil 
     ?tabPlacement 'top 
     ?tabs list("TEST")
     ?value 1
     ?fields list( list(
  list(field1 0:0 200:0 100)
  list(libBrowseBtn 210:0 80:30)
  list(field2 0:40 200:0 100)
  list(fileBrowseBtn 210:40 80:30))
     )
 )
 form=hiCreateAppForm(
     ?name    'browseForm
     ?formTitle "Example Form"
     ?callback     ""
     ?dontBlock t
     ?fields    list(list(tabs 0:0 300:100))
 )
 hiInstantiateForm(form)
 hiDisplayForm(form)

Return to top
 ⠀
X