示例#1
0
        /// <summary>
        /// Construye una nueva interfaz
        /// </summary>
        /// <param name="width">el ancho de la ventana principal de la interfaz</param>
        /// <param name="height">el alto de la ventana principal de la interfaz</param>
        public PicfilGui(Int32 width, Int32 height, IPicture emptyPic)
            : base(width, height)
        {
            InitializeComponent();

            renderer = new PictureFormRenderer(this, this);

            MenuItem mnuFileOpen = new MenuItem("&Open", new EventHandler(mnuFileOpen_Click));
            MenuItem mnuFileSave = new MenuItem("&Save", new EventHandler(mnuFileSave_Click));
            MenuItem mnuFileExit = new MenuItem("E&xit", new EventHandler(mnuFileExit_Click));
            MenuItem mnuFile     = new MenuItem("&File");

            mnuFile.MenuItems.Add(mnuFileOpen);
            mnuFile.MenuItems.Add(mnuFileSave);
            mnuFile.MenuItems.Add("-");
            mnuFile.MenuItems.Add(mnuFileExit);

            MenuItem mnuSaveFilters = new MenuItem("Save Filters", new EventHandler(mnuFiltersSave_Click));

            mnuFilters = new MenuItem("Fi&lters", new MenuItem[] { mnuSaveFilters });
            mnuFilters.MenuItems.Add("-");

            MenuItem mnuMacroRecord = new MenuItem("&Record", new EventHandler(mnuMacroRecord_Click));
            MenuItem mnuMacroStop   = new MenuItem("S&top Recording", new EventHandler(mnuMacroStop_Click));
            MenuItem mnuMacros      = new MenuItem("&Macros",
                                                   new MenuItem[] { mnuMacroRecord, mnuMacroStop });

            MainMenu mnu = new MainMenu(new MenuItem[]
                                        { mnuFile, mnuFilters, mnuMacros });

            Menu = mnu;
            Name = "PicFil GUI";
            Text = "PicFil GUI";
            this.guiListeners.Add(new GuiListener(this, this, new PictureProvider(), emptyPic));
        }
示例#2
0
        //private FilterMacro currentMacro;

        public GuiListener(IPicfilGui gui, IPictureRenderer renderer, IPictureProvider provider, IPicture emptyPic)
        {
            this.gui            = gui;
            this.renderer       = renderer;
            this.provider       = provider;
            this.filters        = new Dictionary <String, IFilter>();
            this.currentPicture = emptyPic;
        }