public override void Draw(IPlatformDrawer platform, float scale) { DrawBackground(platform, scale); var b = new Rect(Bounds); b.x += 10; b.width -= 20; //base.Draw(platform, scale); platform.DrawColumns(b.Scale(scale), new float[] { _typeSize.x + 5, _nameSize.x }, _ => { platform.DoButton(_, _cachedTypeName, CachedStyles.ClearItemStyle, OptionClicked, OptionRightClicked); }, _ => { DrawName(_, platform, scale, DrawingAlignment.MiddleRight); platform.DoButton(_, "", CachedStyles.ClearItemStyle, () => { if (ItemViewModel.IsSelected) { //TODO: Eliminate hack: due to the inconsistent input mechanisms, I cannot fix: when clicking on type, type window appear, then click on the property, //editing will begin, but type window will stay there. So here is a hack of signaling HideSelection event. InvertApplication.SignalEvent <IHideSelectionMenu>(__ => __.HideSelection()); ItemViewModel.BeginEditing(); } else { ItemViewModel.Select(); } }, OptionRightClicked); }); }
public override void Draw(IPlatformDrawer platform, float scale) { DrawBackground(platform, scale); var b = new Rect(Bounds); b.x += 10; b.width -= 20; //base.Draw(platform, scale); platform.DrawColumns(b.Scale(scale), new float[] { _typeSize.x + 5, _nameSize.x }, _ => { platform.DoButton(_, _cachedTypeName, CachedStyles.ClearItemStyle, OptionClicked, OptionRightClicked); }, _ => { DrawName(_, platform, scale, DrawingAlignment.MiddleRight); platform.DoButton(_, "", CachedStyles.ClearItemStyle, () => { if (ItemViewModel.IsSelected) { //TODO: Eliminate hack: due to the inconsistent input mechanisms, I cannot fix: when clicking on type, type window appear, then click on the property, //editing will begin, but type window will stay there. So here is a hack of signaling HideSelection event. InvertApplication.SignalEvent<IHideSelectionMenu>(__ => __.HideSelection()); ItemViewModel.BeginEditing(); } else ItemViewModel.Select(); }, OptionRightClicked); }); }