private void MenuAPI_ControlAdded(object sender, MenuAPI.MenuAPIEventArgs e) { if (e.MenuName != this.Name || !Active) { return; } RegisterControl(e); }
protected virtual void RegisterControl(MenuAPI.MenuAPIEventArgs ctlInfo) { LayoutContainer container = GetContainerForAPIButton(ctlInfo.Row, ctlInfo.Col); if (container == null) { return; } int col = ctlInfo.Col; if (col < 0) { col = 0; } if (col > 1) { col = 1; } ctlInfo.Element.Rect = new RelativeRect(); ctlInfo.Element.Rect.Width = container.Rect.Width.Clone(); container.AddChild(ctlInfo.Element); }