2008-07-16 23:08 UTC
I'm having problems clearing and replacing the Strings in an Option List.
The Clear Method only works if I select (give focus to) the Option Control first, then select the button.
The AddString Method works as expected.
The DeleteString Method appears to not work.
The AddList Method works as expected
Note the Row count displays as if the items were removed :-)
This option is probably not used much, but I'd like to have the options dynamic, dependant on run-time conditions.
Any ideas ?
;;;----------------------------------------------------------------------------
(defun c:doit () (clearoptionstest) (princ))
;;--------------------
(defun clearoptionstest ()
(dcl_project_load "ClearOptionsTest.odcl" t)
(dcl_form_show clearoptionstest_form1)
(princ)
)
;;;----------------------------------------------------------------------------
(defun _setcountlabel ()
(dcl_control_setcaption
clearoptionstest_form1_countlabel
(strcat
"Row Count is "
(itoa
(dcl_optionlist_getcount clearoptionstest_form1_optionlist1)
)
)
)
)
;;;----------------------------------------------------------------------------
;;; API EVENTS
;;;----------------------------------------------------------------------------
(defun c:clearoptionstest_form1_oninitialize (/)
(dcl_optionlist_clear clearoptionstest_form1_optionlist1)
(dcl_optionlist_addlist clearoptionstest_form1_optionlist1
(list "1" "2" "3")
)
(_setcountlabel)
)
;;--------------------
(defun c:clearoptionstest_form1_addstringbtn_onclicked (/)
(dcl_optionlist_addstring clearoptionstest_form1_optionlist1
"Roses are Red, Violets are Blue ... "
)
(_setcountlabel)
)
;;--------------------
(defun c:clearoptionstest_form1_removefirstbtn_onclicked (/)
(dcl_optionlist_deletestring clearoptionstest_form1_optionlist1 0)
(_setcountlabel)
)
;;--------------------
(defun c:clearoptionstest_form1_clearbtn_onclicked (/)
(dcl_optionlist_clear clearoptionstest_form1_optionlist1)
(_setcountlabel)
)
;;--------------------
(defun c:clearoptionstest_form1_addlistbtn_onclicked (/)
(dcl_optionlist_clear clearoptionstest_form1_optionlist1)
(dcl_optionlist_addlist clearoptionstest_form1_optionlist1
(list "First Option Field"
"Second Option Field"
"Third Option Field"
)
)
(_setcountlabel)
)
;;;----------------------------------------------------------------------------
The Clear Method only works if I select (give focus to) the Option Control first, then select the button.
The AddString Method works as expected.
The DeleteString Method appears to not work.
The AddList Method works as expected
Note the Row count displays as if the items were removed :-)
This option is probably not used much, but I'd like to have the options dynamic, dependant on run-time conditions.
Any ideas ?
;;;----------------------------------------------------------------------------
(defun c:doit () (clearoptionstest) (princ))
;;--------------------
(defun clearoptionstest ()
(dcl_project_load "ClearOptionsTest.odcl" t)
(dcl_form_show clearoptionstest_form1)
(princ)
)
;;;----------------------------------------------------------------------------
(defun _setcountlabel ()
(dcl_control_setcaption
clearoptionstest_form1_countlabel
(strcat
"Row Count is "
(itoa
(dcl_optionlist_getcount clearoptionstest_form1_optionlist1)
)
)
)
)
;;;----------------------------------------------------------------------------
;;; API EVENTS
;;;----------------------------------------------------------------------------
(defun c:clearoptionstest_form1_oninitialize (/)
(dcl_optionlist_clear clearoptionstest_form1_optionlist1)
(dcl_optionlist_addlist clearoptionstest_form1_optionlist1
(list "1" "2" "3")
)
(_setcountlabel)
)
;;--------------------
(defun c:clearoptionstest_form1_addstringbtn_onclicked (/)
(dcl_optionlist_addstring clearoptionstest_form1_optionlist1
"Roses are Red, Violets are Blue ... "
)
(_setcountlabel)
)
;;--------------------
(defun c:clearoptionstest_form1_removefirstbtn_onclicked (/)
(dcl_optionlist_deletestring clearoptionstest_form1_optionlist1 0)
(_setcountlabel)
)
;;--------------------
(defun c:clearoptionstest_form1_clearbtn_onclicked (/)
(dcl_optionlist_clear clearoptionstest_form1_optionlist1)
(_setcountlabel)
)
;;--------------------
(defun c:clearoptionstest_form1_addlistbtn_onclicked (/)
(dcl_optionlist_clear clearoptionstest_form1_optionlist1)
(dcl_optionlist_addlist clearoptionstest_form1_optionlist1
(list "First Option Field"
"Second Option Field"
"Third Option Field"
)
)
(_setcountlabel)
)
;;;----------------------------------------------------------------------------
