public void InitToolbar(bool isAskFor, string appPath)
        {
            toolbar     = this.ToolBar1;
            this.currND = new BP.WF.Node(this.FK_Node);
            BtnLab btnLab = new BtnLab(currND.NodeID);

            if (btnLab.PrintDocEnable && isAskFor == false)
            {
                /*如果不是加签 */
                if (this.currND.HisPrintDocEnable == PrintDocEnable.PrintRTF)
                {
                    string urlr = appPath + "WF/WorkOpt/PrintDoc.aspx?FK_Node=" + this.FK_Node + "&FID=" + this.FID + "&WorkID=" + this.WorkID + "&FK_Flow=" + this.FK_Flow;
                    toolbar.Add("<input type=button class=Btn value='" + btnLab.PrintDocLab + "' enable=true onclick=\"WinOpen('" + urlr + "','dsdd'); \" />");
                }

                if (this.currND.HisPrintDocEnable == PrintDocEnable.PrintWord)
                {
                    string urlr = appPath + "WF/Rpt/RptDoc.aspx?FK_Node=" + this.FK_Node + "&FID=" + this.FID + "&WorkID=" + this.WorkID + "&FK_Flow=" + this.FK_Flow + "&IsPrint=1";
                    toolbar.Add("<input type=button class=Btn value='" + btnLab.PrintDocLab + "' enable=true onclick=\"WinOpen('" + urlr + "','dsdd'); \" />");
                }

                if (this.currND.HisPrintDocEnable == PrintDocEnable.PrintHtml)
                {
                    toolbar.Add("<input type=button class=Btn value='" + btnLab.PrintDocLab + "' enable=true onclick=\"printFrom(); \" />");
                }
            }
        }
Esempio n. 2
0
        public ToolBar LoadToolBar(XmlNode toolbarNode)
        {
            var toolbar = new ToolBar();

            foreach (XmlNode node  in toolbarNode.ChildNodes)
            {
                IShape shape = null;
                switch (node.Name)
                {
                case "CIRCLE":
                    shape = new Circle();
                    break;

                case "RECTANGLE":
                    shape = new Rectangle();
                    break;

                case "GROUP":
                    shape = new GroupShapes();
                    break;
                }
                if (shape != null)
                {
                    shape.XmlToShape(node);
                    toolbar.Add(shape);
                }
            }

            return(toolbar);
        }
Esempio n. 3
0
        public override void Initialize()
        {
            var newWorkspace = new MenuItem("New Workspace...", NewWorkspace);
            //var newFile = new MenuItem("_New File...", NewFile);
            var openWorkspace = new MenuItem("Open Workspace...", OpenWorkspace);
            var openFile      = new MenuItem("_Open File...", OpenFile)
                                .WithIcon("/Resources/Icons/Open.png")
                                .WithGlobalShortcut(ModifierKeys.Control, Key.O);
            var closeWorkspace = new MenuItem("Close Workspace", CloseWorkspace)
                                 .WithActivator(workspaceActivator);
            var closeFile = new MenuItem("_Close", CloseFile);
            var save      = new MenuItem("Save", Save)
                            .WithIcon("Resources/Icons/Icons.16x16.SaveIcon.png")
                            .WithGlobalShortcut(ModifierKeys.Control, Key.S);
            var saveAs  = new MenuItem("Save As...", SaveAs);
            var saveAll = new MenuItem("Save All", SaveAll)
                          .WithIcon("Resources/Icons/Icons.16x16.SaveAllIcon.png")
                          .WithGlobalShortcut(ModifierKeys.Control | ModifierKeys.Shift, Key.S);
            var exit = new MenuItem("E_xit", Exit);

            //populate the menu
            MainMenu.First(item => item.Name == "File")
            .Add(
                newWorkspace,
                //newFile,
                MenuItemBase.Separator,
                openWorkspace,
                openFile,
                MenuItemBase.Separator,
                closeWorkspace,
                closeFile,
                MenuItemBase.Separator,
                save,
                saveAs,
                saveAll,
                MenuItemBase.Separator,
                exit
                );

            //populate the toolbar
            ToolBar.Add(
                openFile,
                save,
                saveAll
                );
        }
Esempio n. 4
0
        public override void Initialize()
        {
            //Edit
            var undo = new MenuItem("Undo", Undo).WithIcon("Resources/Icons/Icons.16x16.UndoIcon.png")
                       .WithGlobalShortcut(ModifierKeys.Control, Key.Z);
            var redo = new MenuItem("Redo", Redo).WithIcon("Resources/Icons/Icons.16x16.RedoIcon.png")
                       .WithGlobalShortcut(ModifierKeys.Control, Key.Y);
            var cut = new MenuItem("Cut", Cut).WithIcon("Resources/Icons/Icons.16x16.CutIcon.png")
                      .WithGlobalShortcut(ModifierKeys.Control, Key.X);
            var copy = new MenuItem("Copy", Copy).WithIcon("Resources/Icons/Icons.16x16.CopyIcon.png")
                       .WithGlobalShortcut(ModifierKeys.Control, Key.C);
            var paste = new MenuItem("Paste", Paste).WithIcon("Resources/Icons/Icons.16x16.PasteIcon.png")
                        .WithGlobalShortcut(ModifierKeys.Control, Key.V);
            var selectAll = new MenuItem("Select All", SelectAll)
                            .WithGlobalShortcut(ModifierKeys.Control, Key.A);
            var comment = new MenuItem("Comment Selection", Comment).WithIcon("Resources/Icons/Icons.16x16.CommentRegion.png")
                          .WithGlobalShortcut(ModifierKeys.Control, Key.K);
            var uncomment = new MenuItem("Uncomment Selection", Uncomment).WithIcon("Resources/Icons/Icons.16x16.CommentRegion.png")
                            .WithGlobalShortcut(ModifierKeys.Control, Key.U);

            //populate the menu
            MainMenu.First(item => item.Name == "Edit")
            .Add(
                undo,
                redo,
                MenuItemBase.Separator,
                cut,
                copy,
                paste,
                MenuItemBase.Separator,
                selectAll,
                MenuItemBase.Separator,
                comment,
                uncomment
                );
            //populate the toolbar
            ToolBar.Add(
                MenuItemBase.Separator,
                cut,
                copy,
                paste,
                MenuItemBase.Separator,
                undo,
                redo
                );


            //eval code
            var runFile = new MenuItem("Run", ExecuteFile)
                          .WithIcon("Resources/Icons/Icons.16x16.RunAllIcon.png")
                          .WithActivator(workspaceActivator)
                          .WithGlobalShortcut(ModifierKeys.Alt | ModifierKeys.Shift, Key.Enter);
            var runSelection = new MenuItem("Run Selection", ExecuteSelection)
                               .WithIcon("Resources/Icons/Icons.16x16.RunProgramIcon.png")
                               .WithActivator(workspaceActivator)
                               .WithGlobalShortcut(ModifierKeys.Alt, Key.Enter);

            //populate the menu
            MainMenu.First(item => item.Name == "Evaluate")
            .Add(
                runFile,
                runSelection
                );
            //populate the toolbar
            ToolBar.Add(
                MenuItemBase.Separator,
                runFile,
                runSelection
                );
        }