public SdiWorkspaceWindow(DefaultWorkbench workbench, IViewContent content, Notebook tabControl, TabLabel tabLabel) : base()
        {
            this.workbench  = workbench;
            this.tabControl = tabControl;
            this.content    = content;
            this.tabLabel   = tabLabel;
            this.tabPage    = content.Control;

            content.WorkbenchWindow = this;

            content.ContentNameChanged += new EventHandler(SetTitleEvent);
            content.DirtyChanged       += new EventHandler(SetTitleEvent);
            content.BeforeSave         += new EventHandler(BeforeSave);
            content.ContentChanged     += new EventHandler(OnContentChanged);

            ShadowType = ShadowType.None;
            box        = new VBox();
            box.PackStart(content.Control);
            Add(box);
            box.Show();

            SetTitleEvent(null, null);

            commandHandler = new ViewCommandHandlers(this);
            Show();
        }
示例#2
0
        public SdiWorkspaceWindow(DefaultWorkbench workbench, IViewContent content, Notebook tabControl, TabLabel tabLabel) : base()
        {
            this.workbench  = workbench;
            this.tabControl = tabControl;
            this.content    = content;
            this.tabLabel   = tabLabel;
            this.tabPage    = content.Control;

            ShadowType = ShadowType.None;
            box        = new VBox();
            Add(box);
            box.PackStart(content.Control);

            fileTypeCondition.SetFileName(content.ContentName ?? content.UntitledName);
            extensionContext = AddinManager.CreateExtensionContext();
            extensionContext.RegisterCondition("FileType", fileTypeCondition);

            content.WorkbenchWindow = this;

            content.ContentNameChanged += new EventHandler(SetTitleEvent);
            content.DirtyChanged       += new EventHandler(SetTitleEvent);
            content.BeforeSave         += new EventHandler(BeforeSave);
            content.ContentChanged     += new EventHandler(OnContentChanged);

            box.Show();

            SetTitleEvent(null, null);

            commandHandler = new ViewCommandHandlers(this);
            Show();
        }
示例#3
0
        protected void Initialize(CodeActivityContext context)
        {
            doc = Document.Get(context);
            rec = Signer.Get(context);
            if (rec.RecipientType != "Signer")
            {
                throw new ArgumentException("Only Signers can have tabs added to them, not other Recipient types");
            }

            sigX = PositionX.Get(context);
            sigY = PositionY.Get(context);

            anchorText = AnchorText.Get(context);
            offsetX    = OffsetX.Get(context);
            offsetY    = OffsetY.Get(context);

            tabLabel   = TabLabel.Get(context);
            toolTip    = ToolTip.Get(context);
            pageNumber = PageNumber.Get(context);

            if (anchorText != null && anchorText != "" && Path.GetExtension(doc.filename) != ".pdf")
            {
                throw new FormatException("Can only use relative positioning on .pdf files");
            }
        }
        public bool CloseWindow(bool force, bool fromMenu, int pageNum)
        {
            bool wasActive = workbench.ActiveWorkbenchWindow == this;
            WorkbenchWindowEventArgs args = new WorkbenchWindowEventArgs(force, wasActive);

            args.Cancel = false;
            OnClosing(args);
            if (args.Cancel)
            {
                return(false);
            }
            if (fromMenu == true)
            {
                workbench.RemoveTab(tabControl.PageNum(this));
            }
            else
            {
                workbench.RemoveTab(pageNum);
            }
            OnClosed(args);

            content.ContentNameChanged -= new EventHandler(SetTitleEvent);
            content.DirtyChanged       -= new EventHandler(SetTitleEvent);
            content.BeforeSave         -= new EventHandler(BeforeSave);
            content.ContentChanged     -= new EventHandler(OnContentChanged);
            content.WorkbenchWindow     = null;

            if (subViewContents != null)
            {
                foreach (IAttachableViewContent sv in subViewContents)
                {
                    subViewNotebook.Remove(sv.Control);
                    sv.Dispose();
                }
                this.subViewContents = null;
                subViewNotebook.Remove(content.Control);
            }
            DetachFromPathedDocument();
            content.Dispose();
            box.Destroy();

            this.subViewToolbar = null;
            this.separatorItem  = null;

            this.content         = null;
            this.subViewNotebook = null;
            this.tabControl      = null;
            tabLabel.Destroy();
            this.tabLabel = null;
            this.tabPage  = null;

            Destroy();
            return(true);
        }
示例#5
0
        private void ExecuteQueryThreaded(IPooledDbConnection connection, DataSet result, object state)
        {
            connection.Release();
            TimeSpan duration = DateTime.Now.Subtract(queryStart);

            DispatchService.GuiDispatch(delegate() {
                notebook.ShowAll();
                string msg = String.Concat(
                    AddinCatalog.GetPluralString("Query executed ({0} result table)",
                                                 "Query executed ({0} result tables)", result.Tables.Count),
                    Environment.NewLine,
                    AddinCatalog.GetString("Query duration: {0}", duration.ToString())
                    );
                SetQueryState(false, String.Format(msg, result.Tables.Count));
            });

            if (stoppedQueries.Contains(state))
            {
                stoppedQueries.Remove(state);
                return;
            }

            if (result != null)
            {
                foreach (DataTable table in result.Tables)
                {
                    DispatchService.GuiDispatch(delegate() {
                        MonoDevelop.Database.Components.DataGrid grid = new MonoDevelop.Database.Components.DataGrid();
                        grid.DataSource = table;
                        grid.DataBind();

                        string msg = String.Concat(Environment.NewLine, AddinCatalog.GetString("Table"), ": ", table.TableName,
                                                   Environment.NewLine, "\t", AddinCatalog.GetString("Affected Rows"), ": ", table.Rows.Count);
                        status.Buffer.Text += msg;

                        TabLabel label      = new TabLabel(new Label(table.TableName), ImageService.GetImage("md-db-table", IconSize.Menu));
                        label.CloseClicked += new EventHandler(OnResultTabClose);
                        notebook.AppendPage(grid, label);
                        notebook.ShowAll();
                        this.Document.ReadOnly = false;
                        notebook.Page          = notebook.NPages - 1;
                    });
                }
            }

            if (result == null || result.Tables.Count == 0)
            {
                DispatchService.GuiDispatch(delegate() {
                    status.Buffer.Text    += AddinCatalog.GetString("No Results");
                    this.Document.ReadOnly = false;
                });
            }
        }
            public TabFlowLayoutPanel(Control parent)
            {
                parent.Controls.Add(this);

                FlowDirection = FlowDirection.LeftToRight;
                WrapContents  = false;
                Width         = 800;
                Height        = 27;

                for (int i = 0; i < lbs.Length; i++)
                {
                    lbs[i]      = new TabLabel(this);
                    lbs[i].Text = i.ToString();
                }
            }
示例#7
0
    public int AppendPage(ShellComponent sc)
    {
        TabLabel l = new TabLabel ("");
        int pos = AppendPage (sc, l);

        // Workaround for #72475
        ShellPager _this = this;
        ShellComponent _sc = sc;
        l.Button.Clicked += delegate {
            _sc.HideAll ();
            _this.RemovePage (pos);
            _sc.Dispose ();
        };

        return pos;
    }
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public ViewerWindow()
            : base("Download/Upload Viewer")
        {
            // Initialize Window
            SetDefaultSize(440, 300);

            // Initialize VBox
            this.vbox = new Gtk.VBox(false, 2);
            this.Add(this.vbox);

            // Initialize Notebook
            this.notebook = new Gtk.Notebook();
            this.notebook.ShowTabs = true;
            this.notebook.Scrollable = true;
            this.vbox.PackStart(this.notebook, true, true, 2);

            // Add Download Viewer
            this.tabDownloads = new TabLabel("<b>Downloads</b>", StockIcons.GetImage("Download", 22));
            this.tabDownloads.Button.Sensitive = false;
            this.downloadViewer = new DownloadViewer();
            this.notebook.AppendPage(this.downloadViewer, this.tabDownloads);

            // Add Uploads Viewer
            this.tabUploads = new TabLabel("<b>Uploads</b>", StockIcons.GetImage("Upload", 22));
            this.tabUploads.Button.Sensitive = false;
            this.uploadViewer = new UploadViewer();
            this.notebook.AppendPage(this.uploadViewer, this.tabUploads);

            // HButton Box
            this.hButtonBox = new Gtk.HButtonBox();
            this.hButtonBox.Spacing = 4;
            this.hButtonBox.Layout = ButtonBoxStyle.End;
            this.hButtonBox.LayoutStyle = ButtonBoxStyle.End;
            this.vbox.PackStart(this.hButtonBox, false, false, 2);

            Gtk.Button button;

            button = new Gtk.Button(Gtk.Stock.Clear);
            button.Clicked += new EventHandler(OnButtonClear);
            this.hButtonBox.PackStart(button, false, false, 2);

            // Show All
            this.ShowAll();
        }
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public ViewerWindow() : base("Download/Upload Viewer")
        {
            // Initialize Window
            SetDefaultSize(440, 300);

            // Initialize VBox
            this.vbox = new Gtk.VBox(false, 2);
            this.Add(this.vbox);

            // Initialize Notebook
            this.notebook            = new Gtk.Notebook();
            this.notebook.ShowTabs   = true;
            this.notebook.Scrollable = true;
            this.vbox.PackStart(this.notebook, true, true, 2);

            // Add Download Viewer
            this.tabDownloads = new TabLabel("<b>Downloads</b>", StockIcons.GetImage("Download", 22));
            this.tabDownloads.Button.Sensitive = false;
            this.downloadViewer = new DownloadViewer();
            this.notebook.AppendPage(this.downloadViewer, this.tabDownloads);

            // Add Uploads Viewer
            this.tabUploads = new TabLabel("<b>Uploads</b>", StockIcons.GetImage("Upload", 22));
            this.tabUploads.Button.Sensitive = false;
            this.uploadViewer = new UploadViewer();
            this.notebook.AppendPage(this.uploadViewer, this.tabUploads);

            // HButton Box
            this.hButtonBox             = new Gtk.HButtonBox();
            this.hButtonBox.Spacing     = 4;
            this.hButtonBox.Layout      = ButtonBoxStyle.End;
            this.hButtonBox.LayoutStyle = ButtonBoxStyle.End;
            this.vbox.PackStart(this.hButtonBox, false, false, 2);

            Gtk.Button button;

            button          = new Gtk.Button(Gtk.Stock.Clear);
            button.Clicked += new EventHandler(OnButtonClear);
            this.hButtonBox.PackStart(button, false, false, 2);

            // Show All
            this.ShowAll();
        }
        private Hashtable tabsCustom; // [TabLabel.Button] = Gtk.Widget

        #endregion Fields

        #region Constructors

        // ============================================
        // PUBLIC Constructors
        // ============================================
        public NotebookViewer()
        {
            // Initialize Notebook
            this.ShowTabs = true;
            this.Scrollable = true;

            // Initialize Notebook Members
            this.pages = Hashtable.Synchronized(new Hashtable());
            this.tabs = Hashtable.Synchronized(new Hashtable());
            this.tabsCustom = Hashtable.Synchronized(new Hashtable());
            this.pagesCustom = ArrayList.Synchronized(new ArrayList());

            // Initialize Network Viewer
            // =========================================================
            networkViewer = new NetworkViewer();
            networkViewer.ItemActivated += new PeerSelectedHandler(OnNetItemActivated);

            // Initialize Network Viewer Tab Label
            TabLabel tabLabel = new TabLabel("<b>Network</b>");
            tabLabel.Button.Sensitive = false;

            // Add Network Viewer (Default Fixed Page)
            AppendPage(this.networkViewer, tabLabel);
        }