| 809 | if (ctrl->IsVisible() && ctrl->IsEnabled() && (!def || ctrl->CanBeDefault())) |
| 810 | { |
| 811 | ctrl->OnSetFocus(); |
| 812 | _indexFocused = i; |
| 813 | return true; |
| 814 | } |
| 815 | } |
| 816 | _indexFocused = -1; |
| 817 | return true; |
| 818 | } |
| 819 | } |
| 820 | |
| 821 | Control* ControlObjectContainer::LoadControl(const ParamEntry& ctrlCls) |
| 822 | { |
| 823 | int type = ResolveLegacyControlInt(ctrlCls >> "type"); |
| 824 | int idc = ResolveLegacyControlInt(ctrlCls >> "idc"); |
| 825 | Control* ctrl = _parent->OnCreateCtrl(type, idc, ctrlCls); |
| 826 | if (ctrl != nullptr) |
| 827 | { |
| 828 | int index = _controls.Add(); |
| 829 | ControlInObject& info = _controls[index]; |
| 830 | info._control = ctrl; |
| 831 | info.x = ctrl->X(); |
| 832 | info.y = ctrl->Y(); |
| 833 | info.w = ctrl->W(); |
| 834 | info.h = ctrl->H(); |
| 835 | info.selection = ctrlCls >> "selection"; |
| 836 | info.posTL = _shape->MemoryPoint(info.selection + RString(" TL")); |
| 837 | info.posTR = _shape->MemoryPoint(info.selection + RString(" TR")); |
| 838 | info.posBL = _shape->MemoryPoint(info.selection + RString(" BL")); |
| 839 | info.posBR = _shape->MemoryPoint(info.selection + RString(" BR")); |
| 840 | // Compute screen rect now so a control mounted after the notebook's |
| 841 | // initial SetPosition is visible immediately. Without this the |
nothing calls this directly
no test coverage detected