after my nap ...
Thanks for the nudge in the correct direction Owen.
;; (vlisp-compile 'st (findfile "N:\\kdub-listboxSource.lsp") "N:\\kdub-listbox.fas")
(defun c:doit (/ ui-captionString ui-promptString ui-listContent UIReturn)
;; Proof of concept code for listbox Single Selection
(setq ui-captionString nil
ui-promptString nil
ui-listContent
(list
"N:\\Project_XYZ\\10_Drawings\\02_Xref\\03_SubFolder\\XR_AR_N+00.dwg"
"Another Option ... pick me pick me"
"Yet another option"
)
ui-SelectedList nil
)
;;
(if (not (member "kdub-ListBox" (dcl_getprojects)))
(dcl_project_load "kdub-ListBox")
)
(if dcl_hideerrormsgbox
(setq UIReturn (dcl-form-show kdub-ListBox/Form))
(alert "The OpenDCL arx module did not load!")
)
(cond
((and (= UIReturn 100)
ui-SelectedList
)
;; display for multi Selection Style ( for later )
(dcl-messagebox (apply
'strcat
(mapcar
'(lambda (x)
(strcat "\n" x)
)
ui-SelectedList
)
)
"Result of ui-SelectedList"
)
)
(t
;;for clean up later
(princ)
)
)
(setq ui-SelectedList nil)
(princ)
)
;;----------------------------------------
(defun c:kdub-ListBox/Form#OnInitialize (/)
(if ui-captionString
(dcl-control-setcaption
kdub-ListBox/Form/xrefName
ui-captionString
)
)
(if ui-promptString
(dcl-control-setcaption kdub-ListBox/Form/prompt ui-promptstring)
)
(dcl-listbox-clear kdub-ListBox/Form/ListBox)
(dcl-listbox-addlist
kdub-ListBox/Form/ListBox
ui-listContent
)
)
;;----------------------------------------
(defun c:kdub-ListBox/Form/OK#OnClicked (/)
(setq ui-SelectedList (dcl-listbox-getselecteditems
kdub-ListBox/Form/ListBox
)
)
(dcl-form-close kdub-ListBox/Form 100)
)
;;----------------------------------------
(defun c:kdub-ListBox/Form/Cancel#OnClicked (/)
;; do nothing here at the moment
(dcl-form-close kdub-ListBox/Form 99)
(princ)
)
;;;--------------------------------------------------------------------------------
(if (not (vl-bb-ref 'kdubListBoxUI))
(vl-bb-set
'kdubListBoxUI
(dcl_project_import
'("Refer the attached file for dialog code .. "
"The message exceeds the maximum allowed length (20000 characters)"
)
)
)
)
(princ
"\n kdub-ListBox Build 2014.12.10-v0.1\nTo run App enter: DOIT at the command line\n"
)
(princ)
BTW:
It would be nice if the
dcl-MessageBox was re-sizable.
Added : and even nicer if it could AutoSize for long display strings ;) ;D