MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / LoadControl

Method LoadControl

engine/Poseidon/UI/Controls/UIControlsBase.cpp:811–838  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
821Control* 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

Callers

nothing calls this directly

Calls 8

RStringClass · 0.50
OnCreateCtrlMethod · 0.45
AddMethod · 0.45
XMethod · 0.45
YMethod · 0.45
WMethod · 0.45
HMethod · 0.45
UpdateInfoMethod · 0.45

Tested by

no test coverage detected