public override void OnChildLayoutChanges(object sender, LayoutingEventArgs arg) { //children can't stretch in a wrapper GraphicObject go = sender as GraphicObject; //System.Diagnostics.Debug.WriteLine ("wrapper child layout change: " + go.LastSlots.ToString() + " => " + go.Slot.ToString()); switch (arg.LayoutType) { case LayoutingType.Width: if (Orientation == Orientation.Horizontal && go.Width.Units == Unit.Percent) { go.Width = Measure.Fit; return; } this.RegisterForLayouting(LayoutingType.Width); break; case LayoutingType.Height: if (Orientation == Orientation.Vertical && go.Height.Units == Unit.Percent) { go.Height = Measure.Fit; return; } this.RegisterForLayouting(LayoutingType.Height); break; default: return; } this.RegisterForLayouting(LayoutingType.ArrangeChildren); }
void OnChildLayoutChanges(object sender, LayoutingEventArgs arg) { //Debug.WriteLine ("scroller childLayoutChanges"); int maxScroll = MaximumScroll; //Debug.WriteLine ("maxscroll={0}", maxScroll); if (_verticalScrolling) { if (arg.LayoutType == LayoutingType.Height) { if (maxScroll < ScrollY) { //Debug.WriteLine ("scrolly={0} maxscroll={1}", ScrollY, maxScroll); ScrollY = maxScroll; } NotifyValueChanged("MaximumScroll", maxScroll); } } else if (arg.LayoutType == LayoutingType.Width) { if (maxScroll < ScrollX) { //Debug.WriteLine ("scrolly={0} maxscroll={1}", ScrollY, maxScroll); ScrollX = maxScroll; } NotifyValueChanged("MaximumScroll", maxScroll); } }
void Ti_TabTitle_LayoutChanged(object sender, LayoutingEventArgs e) { if (e.LayoutType == LayoutingType.X) { RegisterForLayouting(LayoutingType.ArrangeChildren); } }
protected void _content_LayoutChanged(object sender, LayoutingEventArgs e) { if (e.LayoutType.HasFlag(LayoutingType.Width)) { positionContent(LayoutingType.X); } if (e.LayoutType.HasFlag(LayoutingType.Height)) { positionContent(LayoutingType.Y); } }
public virtual void OnChildLayoutChanges(object sender, LayoutingEventArgs arg) { GraphicObject g = sender as GraphicObject; if (arg.LayoutType == LayoutingType.Width) { if (Width != Measure.Fit) return; contentSize.Width = g.Slot.Width; this.RegisterForLayouting (LayoutingType.Width); }else if (arg.LayoutType == LayoutingType.Height){ if (Height != Measure.Fit) return; contentSize.Height = g.Slot.Height; this.RegisterForLayouting (LayoutingType.Height); } }
protected void _list_LayoutChanged(object sender, LayoutingEventArgs e) { #if DEBUG_LAYOUTING Debug.WriteLine("list_LayoutChanged"); #endif if (_gsList.Orientation == Orientation.Horizontal) { if (e.LayoutType == LayoutingType.Width) { _gsList.Width = approxSize; } } else if (e.LayoutType == LayoutingType.Height) { _gsList.Height = approxSize; } }
public virtual void OnChildLayoutChanges(object sender, LayoutingEventArgs arg) { GraphicObject g = sender as GraphicObject; switch (arg.LayoutType) { case LayoutingType.Width: if (Width != Measure.Fit) { return; } if (g.Slot.Width > contentSize.Width) { largestChild = g; contentSize.Width = g.Slot.Width; } else if (g == largestChild) { searchLargestChild(); } this.RegisterForLayouting(LayoutingType.Width); break; case LayoutingType.Height: if (Height != Measure.Fit) { return; } if (g.Slot.Height > contentSize.Height) { tallestChild = g; contentSize.Height = g.Slot.Height; } else if (g == tallestChild) { searchTallestChild(); } this.RegisterForLayouting(LayoutingType.Height); break; } }
public virtual void OnChildLayoutChanges(object sender, LayoutingEventArgs arg) { GraphicObject g = sender as GraphicObject; if (arg.LayoutType == LayoutingType.Width) { if (Width != Measure.Fit) { return; } contentSize.Width = g.Slot.Width; this.RegisterForLayouting(LayoutingType.Width); } else if (arg.LayoutType == LayoutingType.Height) { if (Height != Measure.Fit) { return; } contentSize.Height = g.Slot.Height; this.RegisterForLayouting(LayoutingType.Height); } }
public override void OnChildLayoutChanges(object sender, LayoutingEventArgs arg) { //base.OnChildLayoutChanges (sender, arg); }
void OnChildLayoutChanges(object sender, LayoutingEventArgs arg) { int maxScroll = MaximumScroll; if (_verticalScrolling) { if (arg.LayoutType == LayoutingType.Height) { if (maxScroll < ScrollY) { Debug.WriteLine ("scrolly={0} maxscroll={1}", ScrollY, maxScroll); ScrollY = 0; } NotifyValueChanged("MaximumScroll", maxScroll); } } else if (arg.LayoutType == LayoutingType.Width) { if (maxScroll < ScrollX) ScrollX = 0; NotifyValueChanged("MaximumScroll", maxScroll); } }
public override void OnChildLayoutChanges(object sender, LayoutingEventArgs arg) { GraphicObject go = sender as GraphicObject; //Debug.WriteLine ("child layout change: " + go.LastSlots.ToString() + " => " + go.Slot.ToString()); switch (arg.LayoutType) { case LayoutingType.Width: if (Orientation == Orientation.Horizontal) { if (go.Width == Measure.Stretched) { if (stretchedGO == null && Width != Measure.Fit) { stretchedGO = go; } else if (stretchedGO != go) { go.Slot.Width = 0; go.Width = Measure.Fit; return; } } else { contentSize.Width += go.Slot.Width - go.LastSlots.Width; } adjustStretchedGo(LayoutingType.Width); if (Width == Measure.Fit) { this.RegisterForLayouting(LayoutingType.Width); } this.RegisterForLayouting(LayoutingType.ArrangeChildren); return; } break; case LayoutingType.Height: if (Orientation == Orientation.Vertical) { if (go.Height == Measure.Stretched) { if (stretchedGO == null && Height != Measure.Fit) { stretchedGO = go; } else if (stretchedGO != go) { go.Slot.Height = 0; go.Height = Measure.Fit; return; } } else { contentSize.Height += go.Slot.Height - go.LastSlots.Height; } adjustStretchedGo(LayoutingType.Height); if (Height == Measure.Fit) { this.RegisterForLayouting(LayoutingType.Height); } this.RegisterForLayouting(LayoutingType.ArrangeChildren); return; } break; } base.OnChildLayoutChanges(sender, arg); }
public override void OnChildLayoutChanges(object sender, LayoutingEventArgs arg) { GraphicObject go = sender as GraphicObject; //Debug.WriteLine ("child layout change: " + go.LastSlots.ToString() + " => " + go.Slot.ToString()); switch (arg.LayoutType) { case LayoutingType.Width: if (Orientation == Orientation.Horizontal) { if (go.Width == Measure.Stretched) { if (stretchedGO == null && Width != Measure.Fit) stretchedGO = go; else if (stretchedGO != go) { go.Slot.Width = 0; go.Width = Measure.Fit; return; } } else contentSize.Width += go.Slot.Width - go.LastSlots.Width; if (stretchedGO != null) { int newW = Math.Max ( this.ClientRectangle.Width - contentSize.Width - Spacing * (Children.Count - 1), stretchedGO.MinimumSize.Width); if (stretchedGO.MaximumSize.Width > 0) newW = Math.Min (newW, stretchedGO.MaximumSize.Width); if (newW != stretchedGO.Slot.Width) { stretchedGO.Slot.Width = newW; stretchedGO.IsDirty = true; #if DEBUG_LAYOUTING Debug.WriteLine ("\tAdjusting Width of " + stretchedGO.ToString()); #endif stretchedGO.LayoutChanged -= OnChildLayoutChanges; stretchedGO.OnLayoutChanges (LayoutingType.Width); stretchedGO.LayoutChanged += OnChildLayoutChanges; stretchedGO.LastSlots.Width = stretchedGO.Slot.Width; } } if (Width == Measure.Fit) this.RegisterForLayouting (LayoutingType.Width); this.RegisterForLayouting (LayoutingType.ArrangeChildren); return; } break; case LayoutingType.Height: if (Orientation == Orientation.Vertical) { if (go.Height == Measure.Stretched) { if (stretchedGO == null && Height != Measure.Fit) stretchedGO = go; else if (stretchedGO != go){ go.Slot.Height = 0; go.Height = Measure.Fit; return; } } else contentSize.Height += go.Slot.Height - go.LastSlots.Height; if (stretchedGO != null) { int newH = Math.Max ( this.ClientRectangle.Height - contentSize.Height - Spacing * (Children.Count - 1), stretchedGO.MinimumSize.Height); if (stretchedGO.MaximumSize.Height > 0) newH = Math.Min (newH, stretchedGO.MaximumSize.Height); if (newH != stretchedGO.Slot.Height) { stretchedGO.Slot.Height = newH; stretchedGO.IsDirty = true; #if DEBUG_LAYOUTING Debug.WriteLine ("\tAdjusting Height of " + stretchedGO.ToString()); #endif stretchedGO.LayoutChanged -= OnChildLayoutChanges; stretchedGO.OnLayoutChanges (LayoutingType.Height); stretchedGO.LayoutChanged += OnChildLayoutChanges; stretchedGO.LastSlots.Height = stretchedGO.Slot.Height; } } if (Height == Measure.Fit) this.RegisterForLayouting (LayoutingType.Height); this.RegisterForLayouting (LayoutingType.ArrangeChildren); return; } break; } base.OnChildLayoutChanges (sender, arg); }
public override void OnChildLayoutChanges(object sender, LayoutingEventArgs arg) { //children can't stretch in a wrapper GraphicObject go = sender as GraphicObject; //Debug.WriteLine ("child layout change: " + go.LastSlots.ToString() + " => " + go.Slot.ToString()); switch (arg.LayoutType) { case LayoutingType.Width: if (Orientation == Orientation.Horizontal && go.Width.Units == Unit.Percent) { go.Width = Measure.Fit; return; } break; case LayoutingType.Height: if (Orientation == Orientation.Vertical && go.Height.Units == Unit.Percent) { go.Height = Measure.Fit; return; } break; default: return; } this.RegisterForLayouting (LayoutingType.ArrangeChildren); }
public override void OnChildLayoutChanges(object sender, LayoutingEventArgs arg) { GraphicObject go = sender as GraphicObject; //Debug.WriteLine ("child layout change: " + go.LastSlots.ToString() + " => " + go.Slot.ToString()); switch (arg.LayoutType) { case LayoutingType.Width: if (Orientation == Orientation.Horizontal) { if (go.Width == Measure.Stretched) { if (stretchedGO == null && Width != Measure.Fit) { stretchedGO = go; } else if (stretchedGO != go) { go.Slot.Width = 0; go.Width = Measure.Fit; return; } } else { contentSize.Width += go.Slot.Width - go.LastSlots.Width; } if (stretchedGO != null) { int newW = Math.Max( this.ClientRectangle.Width - contentSize.Width - Spacing * (Children.Count - 1), stretchedGO.MinimumSize.Width); if (stretchedGO.MaximumSize.Width > 0) { newW = Math.Min(newW, stretchedGO.MaximumSize.Width); } if (newW != stretchedGO.Slot.Width) { stretchedGO.Slot.Width = newW; stretchedGO.bmp = null; #if DEBUG_LAYOUTING Debug.WriteLine("\tAdjusting Width of " + stretchedGO.ToString()); #endif stretchedGO.LayoutChanged -= OnChildLayoutChanges; stretchedGO.OnLayoutChanges(LayoutingType.Width); stretchedGO.LayoutChanged += OnChildLayoutChanges; stretchedGO.LastSlots.Width = stretchedGO.Slot.Width; } } if (Width == Measure.Fit) { this.RegisterForLayouting(LayoutingType.Width); } this.RegisterForLayouting(LayoutingType.ArrangeChildren); return; } break; case LayoutingType.Height: if (Orientation == Orientation.Vertical) { if (go.Height == Measure.Stretched) { if (stretchedGO == null && Height != Measure.Fit) { stretchedGO = go; } else if (stretchedGO != go) { go.Slot.Height = 0; go.Height = Measure.Fit; return; } } else { contentSize.Height += go.Slot.Height - go.LastSlots.Height; } if (stretchedGO != null) { int newH = Math.Max( this.ClientRectangle.Height - contentSize.Height - Spacing * (Children.Count - 1), stretchedGO.MinimumSize.Height); if (stretchedGO.MaximumSize.Height > 0) { newH = Math.Min(newH, stretchedGO.MaximumSize.Height); } if (newH != stretchedGO.Slot.Height) { stretchedGO.Slot.Height = newH; stretchedGO.bmp = null; #if DEBUG_LAYOUTING Debug.WriteLine("\tAdjusting Height of " + stretchedGO.ToString()); #endif stretchedGO.LayoutChanged -= OnChildLayoutChanges; stretchedGO.OnLayoutChanges(LayoutingType.Height); stretchedGO.LayoutChanged += OnChildLayoutChanges; stretchedGO.LastSlots.Height = stretchedGO.Slot.Height; } } if (Height == Measure.Fit) { this.RegisterForLayouting(LayoutingType.Height); } this.RegisterForLayouting(LayoutingType.ArrangeChildren); return; } break; } base.OnChildLayoutChanges(sender, arg); }
public virtual void OnChildLayoutChanges(object sender, LayoutingEventArgs arg) { GraphicObject g = sender as GraphicObject; switch (arg.LayoutType) { case LayoutingType.Width: if (Width != Measure.Fit) return; if (g.Slot.Width > contentSize.Width) { largestChild = g; contentSize.Width = g.Slot.Width; } else if (g == largestChild) searchLargestChild (); this.RegisterForLayouting (LayoutingType.Width); break; case LayoutingType.Height: if (Height != Measure.Fit) return; if (g.Slot.Height > contentSize.Height) { tallestChild = g; contentSize.Height = g.Slot.Height; } else if (g == tallestChild) searchTallestChild (); this.RegisterForLayouting (LayoutingType.Height); break; } }
protected void _content_LayoutChanged(object sender, LayoutingEventArgs e) { ILayoutable tc = Content.Parent; if (tc == null) return; Rectangle r = this.ScreenCoordinates (this.Slot); if (e.LayoutType.HasFlag(LayoutingType.Width)) { if (popDirection.HasFlag (Alignment.Right)) { if (r.Right + Content.Slot.Width > tc.ClientRectangle.Right) Content.Left = r.Left - Content.Slot.Width; else Content.Left = r.Right; } else if (popDirection.HasFlag (Alignment.Left)) { if (r.Left - Content.Slot.Width < tc.ClientRectangle.Left) Content.Left = r.Right; else Content.Left = r.Left - Content.Slot.Width; } else { if (Content.Slot.Width < tc.ClientRectangle.Width) { if (r.Left + Content.Slot.Width > tc.ClientRectangle.Right) Content.Left = tc.ClientRectangle.Right - Content.Slot.Width; else Content.Left = r.Left; } else Content.Left = 0; } } if (e.LayoutType.HasFlag(LayoutingType.Height)) { if (Content.Slot.Height < tc.ClientRectangle.Height) { if (PopDirection.HasFlag (Alignment.Bottom)) { if (r.Bottom + Content.Slot.Height > tc.ClientRectangle.Bottom) Content.Top = r.Top - Content.Slot.Height; else Content.Top = r.Bottom; } else if (PopDirection.HasFlag (Alignment.Top)) { if (r.Top - Content.Slot.Height < tc.ClientRectangle.Top) Content.Top = r.Bottom; else Content.Top = r.Top - Content.Slot.Height; } else Content.Top = r.Top; }else Content.Top = 0; } }
protected void _content_LayoutChanged(object sender, LayoutingEventArgs e) { ILayoutable tc = Content.Parent as ILayoutable; if (tc == null) { return; } Rectangle r = this.ScreenCoordinates(this.Slot); if (e.LayoutType.HasFlag(LayoutingType.Width)) { if (popDirection.HasFlag(Alignment.Right)) { if (r.Right + Content.Slot.Width > tc.ClientRectangle.Right) { Content.Left = r.Left - Content.Slot.Width; } else { Content.Left = r.Right; } } else if (popDirection.HasFlag(Alignment.Left)) { if (r.Left - Content.Slot.Width < tc.ClientRectangle.Left) { Content.Left = r.Right; } else { Content.Left = r.Left - Content.Slot.Width; } } else { if (Content.Slot.Width < tc.ClientRectangle.Width) { if (r.Left + Content.Slot.Width > tc.ClientRectangle.Right) { Content.Left = tc.ClientRectangle.Right - Content.Slot.Width; } else { Content.Left = r.Left; } } else { Content.Left = 0; } } } if (e.LayoutType.HasFlag(LayoutingType.Height)) { if (Content.Slot.Height < tc.ClientRectangle.Height) { if (PopDirection.HasFlag(Alignment.Bottom)) { if (r.Bottom + Content.Slot.Height > tc.ClientRectangle.Bottom) { Content.Top = r.Top - Content.Slot.Height; } else { Content.Top = r.Bottom; } } else if (PopDirection.HasFlag(Alignment.Top)) { if (r.Top - Content.Slot.Height < tc.ClientRectangle.Top) { Content.Top = r.Bottom; } else { Content.Top = r.Top - Content.Slot.Height; } } else { Content.Top = r.Top; } } else { Content.Top = 0; } } }
public override void OnChildLayoutChanges(object sender, LayoutingEventArgs arg) { base.OnChildLayoutChanges(sender, arg); updateMaxScroll(arg.LayoutType); }
internal protected void raiseLayoutChanged(LayoutingEventArgs e){ LayoutChanged.Raise (this, e); }