Changeset 1583


Ignore:
Timestamp:
Jun 4, 2010, 6:05:07 AM (12 years ago)
Author:
matkovic
Message:

-Zoom implemented
-PluginContainerView delete function added
-Several Style changes
-added images

Location:
trunk/CrypPlugins/WorkspaceManager
Files:
6 added
4 edited

Legend:

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

    r1570 r1583  
    1414using WorkspaceManager.View.Interface;
    1515using System.ComponentModel;
     16using WorkspaceManager.Model;
    1617
    1718namespace WorkspaceManager.View.Container
     
    2627
    2728        public event EventHandler<ConnectorViewEventArgs> OnConnectorMouseLeftButtonDown;
    28         public Model.ConnectorModel cModel;
     29        public ConnectorModel cModel;
    2930
    3031        [TypeConverter(typeof(LengthConverter))]
  • trunk/CrypPlugins/WorkspaceManager/View/Container/PluginContainerView.xaml.cs

    r1570 r1583  
    4444            InitializeComponent();
    4545
    46             if(model.PluginPresentation != null)
    47                 this.PresentationPanel.Children.Add(model.PluginPresentation);
     46            if(model.Plugin.QuickWatchPresentation != null)
     47                this.PresentationPanel.Children.Add(model.Plugin.QuickWatchPresentation);
    4848        }
    4949
     
    5151        {
    5252            //TODO: Better-> Bindings
     53            Image img = model.getImage();
     54            img.Stretch = Stretch.Uniform;
     55            PresentationPanel.Children.Add(img);
    5356            PluginName.Content = model.PluginType.Name.ToString();
    5457            foreach (ConnectorModel cModel in model.InputConnectors)
     
    140143
    141144        #endregion
     145
     146        private void Button_Click(object sender, RoutedEventArgs e)
     147        {
     148            this.delete();
     149        }
     150
     151        private void delete()
     152        {
     153            if (Parent is Panel)
     154            {
     155                (this.Parent as Panel).Children.Remove(this);
     156                this.model.WorkspaceModel.deletePluginModel(this.model);
     157            }
     158        }
    142159    }
    143160}
  • trunk/CrypPlugins/WorkspaceManager/View/Container/WorkSpaceEditorView.xaml.cs

    r1570 r1583  
    127127        void shape_OnConnectorMouseLeftButtonDown(object sender, ConnectorViewEventArgs e)
    128128        {
    129             if (selectedConnector != null)
     129            if (selectedConnector != null && e.connector.cModel.ConnectorType.Name == selectedConnector.cModel.ConnectorType.Name)
    130130            {
    131131                this.root.Children.Remove(dummyLine);
     
    158158            {
    159159                p = selectedPluginContainer.GetPosition();
    160                 this.selectedPluginContainer.SetPosition(new Point(p.X + (Mouse.GetPosition(sender as WorkSpaceEditorView).X - previousDragPoint.X), p.Y + (Mouse.GetPosition(sender as WorkSpaceEditorView).Y - previousDragPoint.Y)));
     160                this.selectedPluginContainer.SetPosition(new Point(p.X + Mouse.GetPosition(root).X - previousDragPoint.X, p.Y + Mouse.GetPosition(root).Y - previousDragPoint.Y));
    161161            }
    162162
    163163            if (selectedConnector != null && root.Children.Contains(dummyLine))
    164164            {
    165                 this.dummyLine.EndPoint = Mouse.GetPosition(sender as WorkSpaceEditorView);
    166             }
    167             this.previousDragPoint = Mouse.GetPosition(sender as WorkSpaceEditorView);
     165                this.dummyLine.EndPoint = Mouse.GetPosition(root);
     166            }
     167            this.previousDragPoint = Mouse.GetPosition(root);
    168168        }
    169169
     
    192192            DragDropDataObject obj = e.Data.GetData("Cryptool.PluginBase.Editor.DragDropDataObject") as DragDropDataObject;
    193193            if(obj != null)
    194                 this.AddPluginContainerView(e.GetPosition(this), WorkspaceModel.newPluginModel(DragDropDataObjectToPluginConverter.CreatePluginInstance(obj.AssemblyFullName, obj.TypeFullName)));
     194                this.AddPluginContainerView(e.GetPosition(root), WorkspaceModel.newPluginModel(DragDropDataObjectToPluginConverter.CreatePluginInstance(obj.AssemblyFullName, obj.TypeFullName)));
    195195        }
    196196
  • trunk/CrypPlugins/WorkspaceManager/WorkspaceManager.csproj

    r1570 r1583  
    100100    <Compile Include="View\Converter\ConnectorBindingConverter.cs" />
    101101    <Compile Include="View\Converter\DragDropDataObjectToPluginConverter.cs" />
     102    <Compile Include="View\Converter\ScaleToPercentageConverter.cs" />
    102103    <Compile Include="View\Interface\IConnectable.cs" />
    103104    <Compile Include="View\Interface\IConnection.cs" />
     
    168169    </None>
    169170  </ItemGroup>
     171  <ItemGroup>
     172    <Resource Include="View\Image\delete.png" />
     173    <Resource Include="View\Image\setting.png" />
     174  </ItemGroup>
     175  <ItemGroup>
     176    <Resource Include="View\Image\increase.png" />
     177    <Resource Include="View\Image\reduce.png" />
     178  </ItemGroup>
    170179  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    171180  <!--<PropertyGroup>
Note: See TracChangeset for help on using the changeset viewer.