Forum > Debugger
No break where expected
440bx:
Hello,
Please refer to the attached project and screenshot.
The project has a radio group and breakpoints have been set in TCustomRadioGroup.GetItemIndex and TCustomRadioGroup.SetItemIndex.
When one of the options in the radio group is selected the breakpoint in TCustomRadioGroup.GetItemIndex is triggered as expected but the breakpoint in TCustomRadioGroup.SetItemIndex isn't. Why is that breakpoint not triggered and where is the ItemIndex value being set ?
Thank you for your help.
Martin_fr:
Because it isn't called.
It is updated in
procedure TCustomRadioGroup.UpdateRadioButtonStates;
Set a watchpoint on FItemIndex and it will tell you.
rvk:
--- Quote from: 440bx on November 28, 2024, 10:15:12 am ---Why is that breakpoint not triggered and where is the ItemIndex value being set ?
--- End quote ---
It IS called when you set ItemIndex.
Why do you think it is not?
Do note... SetItemIndex is only used as Setter of the property ItemIndex and is only called when ItemIndex is set.
It is NOT called when the component directly set FItemIndex (which it does internally).
For example when clicking an item, SetItemIndex is not called.
When using the keyboard to select a next item, SetItemIndex IS called ::)
440bx:
Thank you Martin and rvk. That explains why the breakpoint isn't triggered.
Now my question is: How do I determine that the value is being set in procedure TCustomRadioGroup.UpdateRadioButtonStates ? Is setting a watchpoint the only way to find out ? or could this be determined simply (and ideally) by inspecting source code ?
rvk:
--- Quote from: 440bx on November 28, 2024, 11:38:35 am ---Now my question is: How do I determine that the value is being set in procedure TCustomRadioGroup.UpdateRadioButtonStates ? Is setting a watchpoint the only way to find out ? or could this be determined simply (and ideally) by inspecting source code ?
--- End quote ---
Can't you use OnSelectionChanged for that?
It's called in all the appropriate places in the source (SetItemIndex, CheckItemIndexChanged, Clicked and Changed).
Navigation
[0] Message Index
[#] Next page