public override void Apply(Component component) { base.Apply(component); Window window = (Window)component; window.Title = Title; }
/*protected override void CommitProperties() // TODO: why this doesn't work??? * { * base.CommitProperties(); * * //Debug.Log("!"); * if (_componentsSet) * { * _componentsSet = false; * foreach (Component component in _components) * { * //Debug.Log(" component.Bounds: " + component.Bounds); * //Debug.Log("component.Transform.GlobalPosition: " + component.Transform.GlobalPosition); * * Rectangle bounds = null != component.Parent ? component.Parent.LocalToGlobal(component.Bounds) : component.Bounds; // Bounds = stage only * //Debug.Log(" bounds: " + bounds); * * _shape = new StylingOverlayRectShape * { * X = bounds.X, * Y = bounds.Y, * Width = bounds.Width, * Height = bounds.Height * }; * * AddChild(_shape); * //_shape.ValidateNow(); * } * InvalidateDisplayList(); * ValidateDisplayList(); * //ValidateNow(); * } * }*/ protected override void UpdateDisplayList(float width, float height) { base.UpdateDisplayList(width, height); //Debug.Log("!"); if (_componentsSet) { _componentsSet = false; foreach (Component component in _components) { //Debug.Log(" component.Bounds: " + component.Bounds); //Debug.Log("component.Transform.GlobalPosition: " + component.Transform.GlobalPosition); Rectangle bounds = null != component.Parent ? component.Parent.LocalToGlobal(component.Bounds) : component.Bounds; // Bounds = stage only //Debug.Log(" bounds: " + bounds); _shape = new StylingOverlayRectShape { X = bounds.X, Y = bounds.Y, Width = bounds.Width, Height = bounds.Height }; AddChild(_shape); //_shape.ValidateNow(); } /*InvalidateDisplayList(); * ValidateDisplayList();*/ //ValidateNow(); } }
void ComponentInstantiated(Component descriptor) // ReSharper restore UnusedMember.Local { DataGroup dataGroup = descriptor as DataGroup; if (null != dataGroup) { //Debug.Log("Setting dataprovider on combo: " + combo); } else { Debug.Log("No dataGroup found"); } if (null != dataGroup) { List<object> list = new List<object>(); foreach (string s in Data) { list.Add(new ListItem(s, s)); } dataGroup.DataProvider = new ArrayList(list); } }
void ComponentInstantiated(Component descriptor) // ReSharper restore UnusedMember.Local { DataGroup dataGroup = descriptor as DataGroup; if (null != dataGroup) { //Debug.Log("Setting dataprovider on combo: " + combo); } else { Debug.Log("No dataGroup found"); } if (null != dataGroup) { List <object> list = new List <object>(); foreach (string s in Data) { list.Add(new ListItem(s, s)); } dataGroup.DataProvider = new ArrayList(list); } }
public override void Apply(Component component) { base.Apply(component); Window window = (Window)component; window.Title = Title; }
void InitializeComponent(Component component) // ReSharper restore UnusedMember.Local { if (!enabled) { Debug.Log("ListItemDataProvider not enabled"); return; } Apply(component); }
public override void Apply(Component component) { base.Apply(component); Dialog dialog = (Dialog)component; dialog.Title = Title; dialog.Draggable = Draggable; dialog.Resizable = Resizable; dialog.CloseOnEsc = CloseOnEsc; }
void InitializeComponent(Component component) // ReSharper restore UnusedMember.Local { if (!enabled) { Debug.Log("ListItemDataProvider not enabled"); return; } Apply(component); }
public void SelectionChangeSlot(params object[] parameters) { DraggableList.StopDrag(); // solves the bug of still dragging when view changed Transform selectedTransform = (Transform)parameters[0]; bool shouldDeselect = false; if (null != selectedTransform) { /** * When the game object is selected (in the hierarchy window) we need to select the component on screen * The component might not be created by this time, so we need to defer the component selection * until the hierarchy change and delta processing * */ if (null != EditorState.Instance.Adapter && null != DesignerOverlay.Instance) { var selectedComponent = EditorState.Instance.Adapter.Component; if (null != selectedComponent) { //Debug.Log("Immediate selection: " + _selectedComponent); DesignerOverlay.Instance.Select(selectedComponent); } else { shouldDeselect = true; _doDefferedSelection = true; } } else { _selectedComponent = null; shouldDeselect = true; } } else { shouldDeselect = true; } if (shouldDeselect) { if (null != DesignerOverlay.Instance) { DesignerOverlay.Instance.Deselect(); } } HierarchyViewDecorator.Instance.ReScan(); PlayModeStateChangeEmitter.Instance.SelectionChangedSignal.Emit(); }
public override void Apply(Component component) { DataGroup dataProviderClient = component as DataGroup; if (null == dataProviderClient) { Debug.LogWarning("GUI component is not a IDataProviderClient"); return; } List<object> list = new List<object>(); int count = Keys.Length; for (int i = 0; i < count; i++) { list.Add(new ListItem(Keys[i], Values[i])); } dataProviderClient.DataProvider = new ArrayList(list); }
public override void Apply(Component component) { DataGroup dataProviderClient = component as DataGroup; if (null == dataProviderClient) { Debug.LogWarning("GUI component is not a IDataProviderClient"); return; } List <object> list = new List <object>(); int count = Keys.Length; for (int i = 0; i < count; i++) { list.Add(new ListItem(Keys[i], Values[i])); } dataProviderClient.DataProvider = new ArrayList(list); }
/// <summary> /// After the new component is created and immediatelly selected (creating with holding the CTRL key) /// we have to process it here (this is run after the delta processing, so components are already instantiated) /// </summary> public void SelectCreatedComponent() { if (_doDefferedSelection) { _doDefferedSelection = false; if (!EditorSettings.InspectorEnabled) { return; } if (null != EditorState.Instance.Adapter) { _selectedComponent = EditorState.Instance.Adapter.Component; //Debug.Log("Deffered selection: " + _selectedComponent); if (null != _selectedComponent && null != DesignerOverlay.Instance) { DesignerOverlay.Instance.Select(_selectedComponent); } } } }
public abstract void Apply(Component component);
public override void Apply(Component component) { base.Apply(component); Dialog dialog = (Dialog)component; dialog.Title = Title; dialog.Draggable = Draggable; dialog.Resizable = Resizable; dialog.CloseOnEsc = CloseOnEsc; }
/*protected override void CommitProperties() // TODO: why this doesn't work??? { base.CommitProperties(); //Debug.Log("!"); if (_componentsSet) { _componentsSet = false; foreach (Component component in _components) { //Debug.Log(" component.Bounds: " + component.Bounds); //Debug.Log("component.Transform.GlobalPosition: " + component.Transform.GlobalPosition); Rectangle bounds = null != component.Parent ? component.Parent.LocalToGlobal(component.Bounds) : component.Bounds; // Bounds = stage only //Debug.Log(" bounds: " + bounds); _shape = new StylingOverlayRectShape { X = bounds.X, Y = bounds.Y, Width = bounds.Width, Height = bounds.Height }; AddChild(_shape); //_shape.ValidateNow(); } InvalidateDisplayList(); ValidateDisplayList(); //ValidateNow(); } }*/ protected override void UpdateDisplayList(float width, float height) { base.UpdateDisplayList(width, height); //Debug.Log("!"); if (_componentsSet) { _componentsSet = false; foreach (Component component in _components) { //Debug.Log(" component.Bounds: " + component.Bounds); //Debug.Log("component.Transform.GlobalPosition: " + component.Transform.GlobalPosition); Rectangle bounds = null != component.Parent ? component.Parent.LocalToGlobal(component.Bounds) : component.Bounds; // Bounds = stage only //Debug.Log(" bounds: " + bounds); _shape = new StylingOverlayRectShape { X = bounds.X, Y = bounds.Y, Width = bounds.Width, Height = bounds.Height }; AddChild(_shape); //_shape.ValidateNow(); } /*InvalidateDisplayList(); ValidateDisplayList();*/ //ValidateNow(); } }
void ComponentInstantiated(Component component) // ReSharper restore UnusedMember.Local { _component = component; }
public abstract void Apply(Component component);
/// <summary> /// Applies changes /// </summary> /// <param name="component"></param> public override void Apply(Component component) { base.Apply(component); Panel panel = (Panel)component; panel.Title = Title; panel.Icon = Icon; switch (Layout) { case LayoutEnum.Absolute: panel.Layout = new AbsoluteLayout(); break; case LayoutEnum.Horizontal: panel.Layout = new HorizontalLayout { Gap = Gap, HorizontalAlign = HorizontalAlign, VerticalAlign = VerticalAlign, PaddingLeft = PaddingLeft, PaddingRight = PaddingRight, PaddingTop = PaddingTop, PaddingBottom = PaddingBottom }; break; case LayoutEnum.Vertical: panel.Layout = new VerticalLayout { Gap = Gap, HorizontalAlign = HorizontalAlign, VerticalAlign = VerticalAlign, PaddingLeft = PaddingLeft, PaddingRight = PaddingRight, PaddingTop = PaddingTop, PaddingBottom = PaddingBottom }; break; case LayoutEnum.Tile: panel.Layout = new TileLayout { Orientation = TileOrientation, HorizontalGap = Gap, VerticalGap = Gap, HorizontalAlign = HorizontalAlign, VerticalAlign = VerticalAlign, RowHeight = UseRowHeight ? RowHeight : (float?)null, ColumnWidth = UseColumnWidth ? ColumnWidth : (float?)null, RequestedRowCount = RequestedRowCount, RequestedColumnCount = RequestedColumnCount, RowAlign = RowAlign, ColumnAlign = ColumnAlign }; break; default: panel.Layout = null; break; } }
public void SelectionChangeSlot(params object[] parameters) { DraggableList.StopDrag(); // solves the bug of still dragging when view changed Transform selectedTransform = (Transform) parameters[0]; bool shouldDeselect = false; if (null != selectedTransform) { /** * When the game object is selected (in the hierarchy window) we need to select the component on screen * The component might not be created by this time, so we need to defer the component selection * until the hierarchy change and delta processing * */ if (null != EditorState.Instance.Adapter && null != DesignerOverlay.Instance) { var selectedComponent = EditorState.Instance.Adapter.Component; if (null != selectedComponent) { //Debug.Log("Immediate selection: " + _selectedComponent); DesignerOverlay.Instance.Select(selectedComponent); } else { shouldDeselect = true; _doDefferedSelection = true; } } else { _selectedComponent = null; shouldDeselect = true; } } else { shouldDeselect = true; } if (shouldDeselect) { if (null != DesignerOverlay.Instance) DesignerOverlay.Instance.Deselect(); } HierarchyViewDecorator.Instance.ReScan(); PlayModeStateChangeEmitter.Instance.SelectionChangedSignal.Emit(); }
/// <summary> /// Fires when in-game GUI element clicked /// </summary> /// <param name="parameters"></param> internal static void ClickSlot(object[] parameters) { if (!EditorSettings.InspectorEnabled) { return; } /** * 1. No component with adapter selected -> remove the hierarchy selection * */ if (parameters.Length == 0) { // ReSharper disable ConditionIsAlwaysTrueOrFalse if (DipSwitches.DeselectHierarchyOnNonAdaptedComponentSelection) // ReSharper restore ConditionIsAlwaysTrueOrFalse #pragma warning disable 162 { Selection.activeTransform = null; } #pragma warning restore 162 return; } Component comp = parameters[0] as Component; #if DEBUG if (DebugMode) { Debug.Log(string.Format("Component clicked in the game view: {0}", comp)); } #endif DraggableList.StopDrag(); // solves the bug of still dragging when view changed /** * 2. The adapted component selected * */ if (null != comp) { /** * 2.a) Get game object having adapter for this component attached<br/> * If no adapter found, it means that this component is not bound to an adapter<br/> * For instance Alert (created from code), or component created by an adapter working in factory mode * */ GameObject gameObject = GuiLookup.GetGameObject(comp); /** * 2.b) Check if game object found * If not, nullify the selection and return * */ if (null == gameObject) { Selection.activeTransform = null; return; } /** * 2.c) If game object found, ping it (highlight it) and select it * Selecting it will in turn execute all the mechanisms for processing the selection change * */ //EditorGUIUtility.PingObject(gameObject); // ping Selection.activeTransform = gameObject.transform; // select if (parameters.Length > 1) { MouseEvent me = (MouseEvent)parameters[1]; ProcessMouseEvent(me); } } }
void ComponentInstantiated(Component component) // ReSharper restore UnusedMember.Local { _component = component; }
/// <summary> /// Applies changes /// </summary> /// <param name="component"></param> public override void Apply(Component component) { base.Apply(component); Panel panel = (Panel)component; panel.Title = Title; panel.Icon = Icon; switch (Layout) { case LayoutEnum.Absolute: panel.Layout = new AbsoluteLayout(); break; case LayoutEnum.Horizontal: panel.Layout = new HorizontalLayout { Gap = Gap, HorizontalAlign = HorizontalAlign, VerticalAlign = VerticalAlign, PaddingLeft = PaddingLeft, PaddingRight = PaddingRight, PaddingTop = PaddingTop, PaddingBottom = PaddingBottom }; break; case LayoutEnum.Vertical: panel.Layout = new VerticalLayout { Gap = Gap, HorizontalAlign = HorizontalAlign, VerticalAlign = VerticalAlign, PaddingLeft = PaddingLeft, PaddingRight = PaddingRight, PaddingTop = PaddingTop, PaddingBottom = PaddingBottom }; break; case LayoutEnum.Tile: panel.Layout = new TileLayout { Orientation = TileOrientation, HorizontalGap = Gap, VerticalGap = Gap, HorizontalAlign = HorizontalAlign, VerticalAlign = VerticalAlign, RowHeight = UseRowHeight ? RowHeight : (float?)null, ColumnWidth = UseColumnWidth ? ColumnWidth : (float?)null, RequestedRowCount = RequestedRowCount, RequestedColumnCount = RequestedColumnCount, RowAlign = RowAlign, ColumnAlign = ColumnAlign }; break; default: panel.Layout = null; break; } }
/// <summary> /// After the new component is created and immediatelly selected (creating with holding the CTRL key) /// we have to process it here (this is run after the delta processing, so components are already instantiated) /// </summary> public void SelectCreatedComponent() { if (_doDefferedSelection) { _doDefferedSelection = false; if (!EditorSettings.InspectorEnabled) return; if (null != EditorState.Instance.Adapter) { _selectedComponent = EditorState.Instance.Adapter.Component; //Debug.Log("Deffered selection: " + _selectedComponent); if (null != _selectedComponent && null != DesignerOverlay.Instance) DesignerOverlay.Instance.Select(_selectedComponent); } } }