Example #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;
 }
Example #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();
        }
Example #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;
                    }
                }
            }
Example #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);
        }
Example #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();

            Refresh();
        }
Example #6
0
 private void SetActive(LayerElement lec)
 {
     SetActive(lec.Layer);
 }