ddHiLinkFields
ddHiLinkFields(o_libraryComboBox o_cellCombobox) =>t / nil
ddHiLinkFields(o_cellCombobox o_viewComboBox) =>t / nil
ddHiLinkFields(o_libraryComboBox o_cellCombobox o_viewComboBox) =>t / nil
Description
Connects the given combo boxes, where the value changes in one combo box triggers re-populating of the next combo box.
To connect the library, cell, and view combo fields in a form, the form must be instantiated. In addition, to connect the library, cell, and view combo box items in a toolbar, the toolbar must be placed in a window.
Arguments
Values Returned
Examples
The library, cell, and view combo box fields are linked successfully.
hiInstantiateForm( trForm )
ddHiLinkFields( trForm->trLibrary trForm->trCell trForm->trView )
=> t
This example shows how to open a form and toolbar which uses ddHiLinkFields:
(toplevel 'ils)
;; Create lcv widget
(defun make_lcv_widget ( widget_type purpose @key name callback viewTypes "ssggl")
"make a lcv widget of s_widget_type (ComboField or ToolbarComboBox) for
s_purpose (Library, Cell, or View). Return a combo-box defstruct."
(unless (symbolp name) name=(gensym purpose))
(when (and (memq widget_type '(ComboField ToolbarComboBox))
(memq purpose '(Library Cell View)))
(let ((fun (concat 'ddHiCreate purpose widget_type))
(args (list '?name name '?prompt (strcat " " (get_pname name) " ")
'?callback callback)))
(when (and (eq purpose 'View) viewTypes)
args= (append args (list '?viewTypes viewTypes)))
(apply fun args))))
;; use l_viewTypes to specify a view-type based filter on the view field
(defun make_lcv_form ( name @optional viewTypes "sl")
(let ((form (hiCreateLayoutForm
name (get_pname name)
(hiCreateVerticalBoxLayout
'vboxlayout ?items
(list (make_lcv_widget 'ComboField 'Library ?name 'library)
(make_lcv_widget 'ComboField 'Cell ?name 'cell)
(make_lcv_widget 'ComboField 'View ?name 'view
?viewTypes viewTypes))))))
(define (link_fields_)
(ddHiLinkFields form->library form->cell form->view))
(list form 'link_fields link_fields_)))
;; use l_viewTypes to specify a view-type based filter on the view combo
(defun make_lcv_toolbar ( @key name viewTypes "sl")
(let ((toolbar
(hiCreateToolbar
?name name ?toolTip (strcat "window(#)->hiToolbars->" name)
?items (list (make_lcv_widget 'ToolbarComboBox 'Library ?name 'library)
(make_lcv_widget 'ToolbarComboBox 'Cell ?name 'cell)
(make_lcv_widget 'ToolbarComboBox 'View ?name 'view
?viewTypes viewTypes)))))
(define (link_items_)
(ddHiLinkFields toolbar->library toolbar->cell toolbar->view))
(list toolbar 'link_fields link_items_)))
;; Displaying the form
form=(make_lcv_form 'myform)
(hiDisplayForm (car form))
form->link_fields()
;; Placing the toolbar on a window
myToolbar=(make_lcv_toolbar ?name 'test)
myWindow=(hiOpenWindow)
(hiPlaceToolbar myWindow car(myToolbar))
myToolbar->link_fields()
Related Topics
Return to top