OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: BazzaCAD on January 29, 2013, 03:30:03 PM

Title: OptionList SetButtonEnabled not refreshing correctly.
Post by: BazzaCAD on January 29, 2013, 03:30:03 PM
When I do this:
Code (autolisp) Select

(defun c:dclBolts_optViewNut_OnClicked (nValue /)
  (dcl_Control_SetVisible TMaBolts_dclBolts_OptionList1 T)
  (dcl_OptionList_SetButtonEnabled TMaBolts_dclBolts_OptionList1 3 nil)
  (dcl_OptionList_SetButtonEnabled TMaBolts_dclBolts_OptionList1 4 nil)
)

(defun c:dclBolts_optViewHead_OnClicked (nValue /)
  (dcl_Control_SetVisible TMaBolts_dclBolts_OptionList1 T)
  (dcl_OptionList_SetButtonEnabled TMaBolts_dclBolts_OptionList1 3 T)
  (dcl_OptionList_SetButtonEnabled TMaBolts_dclBolts_OptionList1 4 T)
)


The buttons aren't refreshing when the should. Only when I mouse over & off of them do they refresh.

thx,
Barry
Title: Re: OptionList SetButtonEnabled not refreshing correctly.
Post by: BazzaCAD on January 29, 2013, 03:48:36 PM
I'm also able to select the disabled button.....
Title: Re: OptionList SetButtonEnabled not refreshing correctly.
Post by: owenwengerd on January 29, 2013, 04:42:21 PM
Can you reproduce this in one of the samples by any chance?
Title: Re: OptionList SetButtonEnabled not refreshing correctly.
Post by: BazzaCAD on January 29, 2013, 05:24:40 PM
In short, not.

The long answer:
The only sample I could find with OptionLists in it, was the MessageBox, so I tried adding this code:

Code (autolisp) Select

(defun c:MessageBox_MessageBoxes_optIcons_OnSelChanged (ItemIndexOrCount Value /)
(cond
    ((= ItemIndexOrCount 0)
      (dcl_OptionList_SetButtonEnabled MessageBox_MessageBoxes_optButtons 3 T)
      (dcl_OptionList_SetButtonEnabled MessageBox_MessageBoxes_optButtons 4 T)
    )
    ((= ItemIndexOrCount 1)
      (dcl_OptionList_SetButtonEnabled MessageBox_MessageBoxes_optButtons 3 nil)
      (dcl_OptionList_SetButtonEnabled MessageBox_MessageBoxes_optButtons 4 nil)
             
    )
)
)


But it didn't even look like it was firing.... (yes, I checked the OnSelChanged event & saved the project.)
Remember this sample also has the issue of the OptionLists getting bolder every time the mouse passes over them, so I guess this isn't a good test.

I guess I could try making a new test case from scratch....