Ejemplo n.º 1
0
        public InputDocs()
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build ();

            FieldLables = new Dictionary<int, Label>();
            FieldWidgets = new Dictionary<int, object>();
            FieldIcons = new Dictionary<int, Gtk.Image>();
            ComboWorks.ComboFillReference (comboType, "doc_types", ComboWorks.ListMode.OnlyItems, false);
            ImageList = new ImageTreeStore(typeof(int), //0 - id
                                      typeof(string), //1 - Image Name
                                      typeof(string), //2 - full path
                                      typeof(Document), //3 - document
                                      typeof(Pixbuf), //4 - thumbnails
                                      typeof(Pixbuf), //5 - full image
                                      typeof(bool), //6 - IsImage
                                      typeof(string),//7 - Doc name
                                      typeof(string) //8 - Doc Icon Name
                                      );

            TreeViewColumn ImageColumn = new TreeViewColumn();
            var ImageCell = new ImageListCellRenderer(Pango.FontDescription.FromString ("Tahoma 10"), IconSize.Menu);
            ImageCell.Xalign = 0;
            ImageColumn.PackStart (ImageCell, true);
            ImageColumn.AddAttribute (ImageCell, "pixbuf", 4);
            ImageColumn.AddAttribute (ImageCell, "text", 7);
            ImageColumn.AddAttribute (ImageCell, "IsImageRow", 6);
            ImageColumn.AddAttribute (ImageCell, "IconName", 8);

            treeviewImages.AppendColumn (ImageColumn);
            treeviewImages.Model = ImageList;
            treeviewImages.Reorderable = true;
            treeviewImages.TooltipColumn = 1;
            treeviewImages.ShowAll ();
            treeviewImages.Selection.Changed += OnTreeviewImagesSelectionChanged;
            NextDocNumber = 1;

            //Настраиваем сканирование
            logger.Debug("Initialaze scan");
            scan = new ScanWorks();

            scan.Pulse += OnScanWorksPulse;
            scan.ImageTransfer += OnScanWorksImageTransfer;

            var scanners = scan.GetScannerList ();
            if (scanners.Length > 0) {
                comboScaner.ItemsList = scanners;
                comboScaner.Active = scan.CurrentScanner;
            } else
                comboScaner.Sensitive = ScanAction.Sensitive = false;
        }
Ejemplo n.º 2
0
        public InputDocs()
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build ();

            FieldLables = new Dictionary<int, Label>();
            FieldWidgets = new Dictionary<int, object>();
            FieldIcons = new Dictionary<int, Gtk.Image>();
            ComboWorks.ComboFillReference (comboType, "doc_types", 0, false);
            //FIXME разобраться с очищением памяти. Если закрыть окно или удалить картинки память не очищается.
            ImageList = new ImageTreeStore(typeof(int), //0 - id
                                      typeof(string), //1 - Image Name
                                      typeof(string), //2 - full path
                                      typeof(Document), //3 - document
                                      typeof(Pixbuf), //4 - thumbnails
                                      typeof(Pixbuf), //5 - full image
                                      typeof(bool), //6 - IsImage
                                      typeof(string),//7 - Doc name
                                      typeof(string) //8 - Doc Icon Name
                                      );
            ImageList.RowDeleted += OnImageListRowRemoved;
            //ImageList.RowInserted += OnImageListRowInserted;
            //ImageList.RowChanged += OnImageListRowChanged;
            TreeViewColumn ImageColumn = new TreeViewColumn();
            var ImageCell = new ImageListCellRenderer(Pango.FontDescription.FromString ("Tahoma 10"), IconSize.Menu);
            ImageCell.Xalign = 0;
            ImageColumn.PackStart (ImageCell, true);
            ImageColumn.AddAttribute (ImageCell, "pixbuf", 4);
            ImageColumn.AddAttribute (ImageCell, "text", 7);
            ImageColumn.AddAttribute (ImageCell, "IsImageRow", 6);
            ImageColumn.AddAttribute (ImageCell, "IconName", 8);

            treeviewImages.AppendColumn (ImageColumn);
            treeviewImages.Model = ImageList;
            treeviewImages.Reorderable = true;
            treeviewImages.TooltipColumn = 1;
            treeviewImages.ShowAll ();
            NextDocNumber = 1;
        }
Ejemplo n.º 3
0
        public InputDocs() :
            base(Gtk.WindowType.Toplevel)
        {
            this.Build();

            FieldLables  = new Dictionary <int, Label>();
            FieldWidgets = new Dictionary <int, object>();
            FieldIcons   = new Dictionary <int, Gtk.Image>();
            ComboWorks.ComboFillReference(comboType, "doc_types", ComboWorks.ListMode.OnlyItems, false);
            ImageList = new ImageTreeStore(typeof(int),         //0 - id
                                           typeof(string),      //1 - Image Name
                                           typeof(string),      //2 - full path
                                           typeof(Document),    //3 - document
                                           typeof(Pixbuf),      //4 - thumbnails
                                           typeof(Pixbuf),      //5 - full image
                                           typeof(bool),        //6 - IsImage
                                           typeof(string),      //7 - Doc name
                                           typeof(string)       //8 - Doc Icon Name
                                           );

            TreeViewColumn ImageColumn = new TreeViewColumn();
            var            ImageCell   = new ImageListCellRenderer(Pango.FontDescription.FromString("Tahoma 10"), IconSize.Menu);

            ImageCell.Xalign = 0;
            ImageColumn.PackStart(ImageCell, true);
            ImageColumn.AddAttribute(ImageCell, "pixbuf", 4);
            ImageColumn.AddAttribute(ImageCell, "text", 7);
            ImageColumn.AddAttribute(ImageCell, "IsImageRow", 6);
            ImageColumn.AddAttribute(ImageCell, "IconName", 8);

            treeviewImages.AppendColumn(ImageColumn);
            treeviewImages.Model         = ImageList;
            treeviewImages.Reorderable   = true;
            treeviewImages.TooltipColumn = 1;
            treeviewImages.ShowAll();
            treeviewImages.Selection.Changed += OnTreeviewImagesSelectionChanged;
            NextDocNumber = 1;

            //Настраиваем сканирование
            logger.Debug("Initialaze scan");
            //scan = new ScanAuxWorks();
            try
            {
                scan                = new ScanWorks();
                scan.ScanerSetup    = ScanerSetup.Native;
                scan.Pulse         += OnScanWorksPulse;
                scan.ImageTransfer += OnScanWorksImageTransfer;

                var scanners = scan.GetScannerList();
                if (scanners.Length > 0)
                {
                    comboScaner.ItemsList = scanners;
                    comboScaner.Active    = scan.CurrentScanner;
                }
                else
                {
                    comboScaner.Sensitive = ScanAction.Sensitive = false;
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Не удалось инициализировать подсистему сканирования.");
                comboScaner.Sensitive = ScanAction.Sensitive = false;
            }
        }