Changeset 645 for trunk/CrypPlugins/CLK


Ignore:
Timestamp:
Oct 4, 2009, 11:01:05 PM (12 years ago)
Author:
Sören Rinne
Message:
  • added QuickWatchPresentation for CLK (not working right now - not getting any mouse event from QuickWatchPresentation)
  • small mods in LFSR and NLFSR
Location:
trunk/CrypPlugins/CLK
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/CLK/CLK.cs

    r560 r645  
    1212//timer
    1313using System.Timers;
    14 
    15 namespace Cryptool.Plugins.CLK
     14// for mouse click
     15using System.Windows.Input;
     16// for QuickwatchPresentaton
     17using System.Windows.Threading;
     18
     19
     20using System.Windows;
     21//using System.Windows.Data;
     22//using System.IO;
     23//using System.Runtime.CompilerServices;
     24
     25namespace Cryptool.CLK
    1626{
    1727    [Author("Soeren Rinne", "soeren.rinne@cryptool.de", "Ruhr-Universitaet Bochum, Chair for System Security", "http://www.trust.rub.de/")]
    1828  [PluginInfo(true, "CLK", "Simple clock for clock-based plugins.", null, "CLK/icon.png", "CLK/Images/true.png", "CLK/Images/false.png")]
    19   public class CLK : IInput
     29  public class CLK : DependencyObject, IInput
    2030  {
    2131    # region private variables
     32    private CLKPresentation cLKPresentation;
    2233    private bool output;
    2334    private bool eventInput;
     
    3546        settings.PropertyChanged += settings_PropertyChanged;
    3647
     48        cLKPresentation = new CLKPresentation();
     49        Presentation = cLKPresentation;
     50
     51        cLKPresentation.CLKButtonImage.MouseLeftButtonUp += cLKButton_MouseLeftButtonUp;
     52        cLKPresentation.myTextBox.TextChanged += textchanged;
     53        //cLKPresentation.CLKButtonImage.MouseEnter += mousenter;
     54
    3755        // set picture according to settings value
    3856        /* BRINGT NIX - WARUM?
    3957        if (settings.SetClockToTrue) StatusChanged((int)CLKImage.True);
    4058        else StatusChanged((int)CLKImage.False);*/
     59    }
     60
     61    void mousenter(object sender, MouseEventArgs e)
     62    {
     63        GuiLogMessage("mouse event is coming", NotificationLevel.Info);
     64        OnPropertyChanged("Output");
     65    }
     66
     67    void textchanged(object sender, TextChangedEventArgs e)
     68    {
     69        GuiLogMessage("text event is coming", NotificationLevel.Info);
     70        OnPropertyChanged("Output");
     71    }
     72
     73    void cLKButton_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
     74    {
     75        GuiLogMessage("mouse event is coming", NotificationLevel.Info);
     76        if (e.LeftButton == MouseButtonState.Released)
     77        {
     78            GuiLogMessage("Left Mouse Button released", NotificationLevel.Info);
     79            OnPropertyChanged("Output");
     80        }
    4181    }
    4282
     
    104144    }
    105145
    106     public UserControl Presentation
    107     {
    108         get { return null; }
    109     }
    110 
    111     public UserControl QuickWatchPresentation
    112     {
    113         get { return null; }
     146    public UserControl Presentation { get; private set; }
     147
     148    public System.Windows.Controls.UserControl QuickWatchPresentation
     149    {
     150        get { return Presentation; }
    114151    }
    115152
  • trunk/CrypPlugins/CLK/CLK.csproj

    r286 r645  
    5454  <ItemGroup>
    5555    <Compile Include="CLK.cs" />
     56    <Compile Include="CLKPresentation.xaml.cs">
     57      <DependentUpon>CLKPresentation.xaml</DependentUpon>
     58    </Compile>
    5659    <Compile Include="CLKSettings.cs" />
    5760    <Compile Include="Properties\AssemblyInfo.cs">
     
    9396    <Resource Include="Images\true.png" />
    9497  </ItemGroup>
     98  <ItemGroup>
     99    <Page Include="CLKPresentation.xaml">
     100      <Generator>MSBuild:Compile</Generator>
     101      <SubType>Designer</SubType>
     102    </Page>
     103  </ItemGroup>
    95104  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    96105  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • trunk/CrypPlugins/CLK/CLKSettings.cs

    r430 r645  
    99using System.Windows;
    1010
    11 namespace Cryptool.Plugins.CLK
     11namespace Cryptool.CLK
    1212{
    1313  public class CLKSettings : ISettings
Note: See TracChangeset for help on using the changeset viewer.