Ignore:
Timestamp:
Jun 11, 2010, 5:53:30 AM (11 years ago)
Author:
matkovic
Message:
  • Plugin resize now working
  • each PluginType now distinguish in color
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/WorkspaceManager/View/Container/WorkSpaceEditorView.xaml.cs

    r1620 r1621  
    3636        private PluginContainerView selectedPluginContainer;
    3737        private CryptoLineView dummyLine = new CryptoLineView();
    38         private Point p;
     38        private Point point;
    3939
    4040        public EditorState State;
     
    7575        void WorkSpaceEditorView_Loaded(object sender, RoutedEventArgs e)
    7676        {
    77 
    7877        }
    7978
    8079        public void AddPluginContainerView(Point position, PluginModel model)
    8180        {
    82             PluginContainerView shape = new PluginContainerView(model);
    83             shape.Delete += new EventHandler<PluginContainerViewDeleteViewEventArgs>(PluginDelete);
    84             shape.ShowSettings += new EventHandler<PluginContainerViewSettingsViewEventArgs>(shape_ShowSettings);
    85             shape.OnConnectorMouseLeftButtonDown += new EventHandler<ConnectorViewEventArgs>(shape_OnConnectorMouseLeftButtonDown);
    86             shape.MouseLeftButtonDown += new MouseButtonEventHandler(shape_MouseLeftButtonDown);
    87             shape.MouseLeftButtonUp += new MouseButtonEventHandler(shape_MouseLeftButtonUp);
    88             shape.SetPosition(position);
    89             this.root.Children.Add(shape);
    90             Canvas.SetZIndex(shape, 100);
     81            PluginContainerView newPluginContainerView = new PluginContainerView(model);
     82            newPluginContainerView.Delete += new EventHandler<PluginContainerViewDeleteViewEventArgs>(PluginDelete);
     83            newPluginContainerView.ShowSettings += new EventHandler<PluginContainerViewSettingsViewEventArgs>(shape_ShowSettings);
     84            newPluginContainerView.OnConnectorMouseLeftButtonDown += new EventHandler<ConnectorViewEventArgs>(shape_OnConnectorMouseLeftButtonDown);
     85            newPluginContainerView.MouseLeftButtonDown += new MouseButtonEventHandler(shape_MouseLeftButtonDown);
     86            newPluginContainerView.MouseLeftButtonUp += new MouseButtonEventHandler(shape_MouseLeftButtonUp);
     87            newPluginContainerView.SetPosition(position);
     88            this.root.Children.Add(newPluginContainerView);
     89            Canvas.SetZIndex(newPluginContainerView, 100);
    9190        }
    9291
     
    122121        private void AddConnectionSource(IConnectable source, CryptoLineView conn)
    123122        {
    124             Color color = ColorHelper.getColor((source as ConnectorView).Model.ConnectorType);
     123            Color color = ColorHelper.GetDataColor((source as ConnectorView).Model.ConnectorType);
    125124            conn.Stroke = new SolidColorBrush(color);
    126125            conn.SetBinding(CryptoLineView.StartPointProperty, CreateConnectorBinding(source));
     
    196195            if (e.LeftButton == MouseButtonState.Pressed && selectedPluginContainer != null)
    197196            {
    198                 p = selectedPluginContainer.GetPosition();
    199                 this.selectedPluginContainer.SetPosition(new Point(p.X + Mouse.GetPosition(root).X - previousDragPoint.X, p.Y + Mouse.GetPosition(root).Y - previousDragPoint.Y));
     197                point = selectedPluginContainer.GetPosition();
     198                this.selectedPluginContainer.SetPosition(new Point(point.X + Mouse.GetPosition(root).X - previousDragPoint.X, point.Y + Mouse.GetPosition(root).Y - previousDragPoint.Y));
    200199            }
    201200
Note: See TracChangeset for help on using the changeset viewer.