示例#1
0
        public XStageListTab(XStageProject xstage, Uri fileUri, ExportListController exportListController)
        {
            this.Build();
            _xstage = xstage;
            this.exportListController = exportListController;


            nodestore = new NodeStore(typeof(ElementExportSettings));

            FileTree.RulesHint      = true;
            FileTree.Selection.Mode = SelectionMode.Multiple;
            FileTree.AppendColumn("Name", new Gtk.CellRendererText(), "text", 1);
            FileTree.AppendColumn("Path", new Gtk.CellRendererText(), "text", 0);

            FileTree.NodeStore = nodestore;
            AddButton.Clicked += (sender, e) => {
                NodeSelection selection = FileTree.NodeSelection;
                foreach (ITreeNode node in selection.SelectedNodes)
                {
                    //Add selected VectorFilePath to the active export list
                    ElementExportSettings current = (ElementExportSettings)node;
                    ElementExportSettings tvg     = new ElementExportSettings();
                    tvg.Name     = current.Name;
                    tvg.FilePath = current.FilePath;
                    exportListController.AddTvg(tvg);
                }
            };



            foreach (XStageElement element in xstage.elements)
            {
                Uri xstageDirectory = new Uri(fileUri, "./");

                foreach (XStageDrawing d in element.drawings)
                {
                    ElementExportSettings vfp = new ElementExportSettings();
                    vfp.FilePath = new Uri(xstageDirectory.LocalPath + element.rootFolder + "/" + element.elementFolder + "/" + element.elementName + "-" + d.name + ".tvg");
                    vfp.Name     = element.elementName + "-" + d.name;
                    nodestore.AddNode(vfp);
                }
            }
        }
示例#2
0
        public void InitTable()
        {
            foreach (TreeViewColumn col in FileTree.Columns)
            {
                FileTree.RemoveColumn(col);
            }
            TreeViewTable = new ListStore(typeof(string), typeof(bool), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));

            TreeViewColumn NrColumn         = new TreeViewColumn();
            TreeViewColumn FileColumn       = new TreeViewColumn();
            TreeViewColumn BrightnessColumn = new TreeViewColumn();
            TreeViewColumn AVColumn         = new TreeViewColumn();
            TreeViewColumn TVColumn         = new TreeViewColumn();
            TreeViewColumn ISOColumn        = new TreeViewColumn();
            TreeViewColumn KeyframeColumn   = new TreeViewColumn();

            CellRendererText   NrCell         = new CellRendererText();
            CellRendererText   FileCell       = new CellRendererText();
            CellRendererText   BrightnessCell = new CellRendererText();
            CellRendererText   AVCell         = new CellRendererText();
            CellRendererText   TVCell         = new CellRendererText();
            CellRendererText   ISOCell        = new CellRendererText();
            CellRendererToggle KeyframeCell   = new CellRendererToggle();

            NrColumn.Title     = Message.GetString("Nr");
            NrColumn.MinWidth  = 35;
            NrColumn.Resizable = false;
            NrColumn.PackStart(NrCell, true);

            FileColumn.Title     = Message.GetString("Filename");
            FileColumn.MinWidth  = 100;
            FileColumn.Resizable = true;
            FileColumn.PackStart(FileCell, true);

            BrightnessColumn.Title     = Message.GetString("Brightness");
            BrightnessColumn.MinWidth  = 70;
            BrightnessColumn.Resizable = true;
            BrightnessColumn.PackStart(BrightnessCell, true);
            BrightnessCell.Editable = true;
            BrightnessCell.Edited  += CellEdited;

            AVColumn.Title     = Message.GetString("AV");
            AVColumn.MinWidth  = 40;
            AVColumn.Resizable = true;
            AVColumn.PackStart(AVCell, true);

            TVColumn.Title     = Message.GetString("TV");
            TVColumn.MinWidth  = 40;
            TVColumn.Resizable = true;
            TVColumn.PackStart(TVCell, true);

            ISOColumn.Title     = Message.GetString("ISO");
            ISOColumn.MinWidth  = 40;
            ISOColumn.Resizable = true;
            ISOColumn.PackStart(ISOCell, true);

            KeyframeColumn.Title    = Message.GetString("KF");
            KeyframeColumn.MinWidth = 30;
            KeyframeColumn.MaxWidth = 40;
            KeyframeColumn.PackStart(KeyframeCell, true);
            KeyframeColumn.AddAttribute(KeyframeCell, "active", (int)TableLocation.Keyframe);
            KeyframeCell.Activatable = true;
            KeyframeCell.Active      = false;
            KeyframeCell.Toggled    += KeyframeCell_Toggled;

            NrColumn.AddAttribute(NrCell, "text", (int)TableLocation.Nr);
            FileColumn.AddAttribute(FileCell, "text", (int)TableLocation.Filename);
            BrightnessColumn.AddAttribute(BrightnessCell, "text", (int)TableLocation.Brightness);
            AVColumn.AddAttribute(AVCell, "text", (int)TableLocation.AV);
            TVColumn.AddAttribute(TVCell, "text", (int)TableLocation.TV);
            ISOColumn.AddAttribute(ISOCell, "text", (int)TableLocation.ISO);


            FileTree.AppendColumn(NrColumn);
            FileTree.AppendColumn(KeyframeColumn);
            FileTree.AppendColumn(FileColumn);
            FileTree.AppendColumn(BrightnessColumn);
            FileTree.AppendColumn(AVColumn);
            FileTree.AppendColumn(TVColumn);
            FileTree.AppendColumn(ISOColumn);

            FileTree.Model = TreeViewTable;
        }