Exemplo n.º 1
0
 private void InitializeLayerElement(LayerElement lec, Layer l)
 {
     lec.Height       = elementHeight;
     lec.Layer        = l;
     lec.Click       += elementClickDelegate;
     lec.DoubleClick += elementDoubleClickDelegate;
     lec.KeyUp       += keyUpDelegate;
     lec.IsSelected   = false;
 }
Exemplo n.º 2
0
        private void LayerRemovedHandler(object sender, IndexEventArgs e)
        {
            LayerElement lec = layerControls[e.Index];

            this.thumbnailManager.RemoveFromQueue(lec.Layer);
            lec.Click       -= this.elementClickDelegate;
            lec.DoubleClick -= this.elementDoubleClickDelegate;
            lec.KeyUp       -= keyUpDelegate;
            lec.Layer        = null;
            layerControls.Remove(lec);
            layerControlPanel.Controls.Remove(lec);
            lec.Dispose();
            PerformLayout();
        }
Exemplo n.º 3
0
            public void PositionLayers()
            {
                if (this.parentLayerControl != null &&
                    this.parentLayerControl.layerControls != null)
                {
                    int cursor   = this.AutoScrollPosition.Y;
                    int newWidth = this.ClientRectangle.Width;

                    for (int i = this.parentLayerControl.layerControls.Count - 1; i >= 0; --i)
                    {
                        LayerElement lec = this.parentLayerControl.layerControls[i];
                        lec.Width = newWidth;
                        lec.Top   = cursor;
                        cursor   += lec.Height;
                    }
                }
            }
Exemplo n.º 4
0
        private void ElementClickHandler(object sender, EventArgs e)
        {
            LayerElement lec = (LayerElement)sender;

            if (Control.ModifierKeys == Keys.Control)
            {
                lec.IsSelected = !lec.IsSelected;
            }
            else
            {
                ClearLayerSelection();
                lec.IsSelected = true;
            }

            SetActive(lec);
            OnClickedOnLayer(lec.Layer);
        }
Exemplo n.º 5
0
        private void LayerInsertedHandler(object sender, IndexEventArgs e)
        {
            this.SuspendLayout();
            this.layerControlPanel.SuspendLayout();
            Layer        layer = (Layer)this.document.Layers[e.Index];
            LayerElement lec   = new LayerElement();

            lec.ThumbnailManager = this.thumbnailManager;
            lec.ThumbnailSize    = this.thumbnailSize;
            InitializeLayerElement(lec, layer);
            layerControls.Insert(e.Index, lec);
            layerControlPanel.Controls.Add(lec);
            layerControlPanel.ScrollControlIntoView(lec);
            lec.Select();
            SetActive(lec);
            lec.RefreshPreview();
            this.layerControlPanel.ResumeLayout(false);
            this.ResumeLayout(false);
            this.layerControlPanel.PerformLayout();
            PerformLayout();
        }
Exemplo n.º 6
0
 private void SetActive(LayerElement lec)
 {
     SetActive(lec.Layer);
 }
Exemplo n.º 7
0
 private void SetActive(LayerElement lec)
 {
     SetActive(lec.Layer);
 }
Exemplo n.º 8
0
 private void LayerInsertedHandler(object sender, IndexEventArgs e)
 {
     this.SuspendLayout();
     this.layerControlPanel.SuspendLayout();
     Layer layer = (Layer)this.document.Layers[e.Index];
     LayerElement lec = new LayerElement();
     lec.ThumbnailManager = this.thumbnailManager;
     lec.ThumbnailSize = this.thumbnailSize;
     InitializeLayerElement(lec, layer);
     layerControls.Insert(e.Index, lec);
     layerControlPanel.Controls.Add(lec);
     layerControlPanel.ScrollControlIntoView(lec);
     lec.Select();
     SetActive(lec);
     lec.RefreshPreview();
     this.layerControlPanel.ResumeLayout(false);
     this.ResumeLayout(false);
     this.layerControlPanel.PerformLayout();
     PerformLayout();
 }
Exemplo n.º 9
0
 private void InitializeLayerElement(LayerElement lec, Layer l)
 {
     lec.Height = elementHeight;
     lec.Layer = l;
     lec.Click += elementClickDelegate;
     lec.DoubleClick += elementDoubleClickDelegate;
     lec.KeyUp += keyUpDelegate;
     lec.IsSelected = false;
 }