(defun c:dictBrowser
( / *error* dch dcl des lst rtn
) ; Based on http://www.lee-mac.com/listtiledependency.html
)
)
)
)
)
'(
"lbx : list_box"
"{"
" alignment = centered;"
" fixed_width = true;"
" fixed_height = true;"
" width = 30;"
" height = 30;"
"}"
"test : dialog"
"{"
" label = \"Dictionaries in current drawing: \";"
" spacer;"
" : row"
" {"
" : lbx { key = \"lb0\"; label = \"Dictionary\"; }"
" : lbx { key = \"lb1\"; label = \"Items\"; }"
" }"
" spacer;"
" ok_cancel;"
"}"
)
)
)
(LM:dcld:action '("lb0" "lb1") 'lst 'rtn)
(strcat "\nThe user selected:" (LM:dcld:getitems rtn lst)
)
)
2
)
)
)
)
)
)
(*error* nil)
)
(defun getDict
(lst
/ itm rtn ed
) (mapcar-remove-nil
))
)
)
)
)
)
(defun ALE_Fix_Dictionaries
(EntDct
/ OutLst
) )
)
)
(defun ALE_Fix_DelDictionaries
(DctNms
) (p
"Dict Deleted" (car ForElm
)) )
)
)
)
(defun mapcar
-remove
-nil (func lst
/ item rtn
) ;; ---------------------------------------------------------------- ;;
;; mapcar-remove-nil - dexus ;;
;; ---------------------------------------------------------------- ;;
;; A combination of (vl-remove nil (mapcar ... )) in one function. ;;
;; This function will apply the provided function to all elements ;;
;; of a list, if the return of the function is true than the item ;;
;; will be added, otherwise it will be removed. ;;
;; ---------------------------------------------------------------- ;;
;; func: [list] Function to apply to all elements in list, if ;;
;; result is nil the item will be removed ;;
;; lst: [list] List of items to process ;;
;; returns: [list] List of all returns from func that were not nil ;;
;; ---------------------------------------------------------------- ;;
)
)
)
;; DCL List-Tile Dependency - V2.1 (2019-04-27) - Lee Mac
;; Configures action_tile statements for the list of keys to enabled dependency between the DCL tiles.
;; key - [lst] List of DCL tile keys in order of dependency
;; lst-sym - [sym] Quoted variable containing list data
;; rtn-sym - [sym] Quoted variable containing initial selection indexes
(defun LM:dcld:action
( key lst
-sym rtn
-sym
)
(defun LM:dcld:addlist
( key lst
) )
(defun LM:dcld:getlists
( idx lst
) lst
)
)
(defun LM:substnth
( itm idx lst
) )
)
)
(defun LM:dcld:actions
( key lst
-sym rtn
-sym lvl
/ fun
) (LM:dcld:actions
(cdr key
) lst
-sym rtn
-sym
(1+ lvl
)) )
)
)
)
)
fun
)
(mapcar 'LM:dcld:addlist key
(LM:dcld:getlists
(eval rtn
-sym
) (eval lst
-sym
)))
(
(eval (LM:dcld:actions key lst
-sym rtn
-sym
0)) )
)
;; DCL List-Tile Dependency - Get Items - Lee Mac
;; Returns a list of the items selected from each dependent list tile.
;; idx - [lst] List of selection indexes
;; lst - [lst] List data
(defun LM:dcld:getitems
( idx lst
/ tmp
) )
)