示例#1
0
        private void ShowDocumentMenu()
        {
            if (this.documentMenu == null)
            {
                this.documentMenu = new DocumentMenu(menuHandler);
            }

            this.documentMenu.Test();
        }
示例#2
0
            public TextDocument(uint objectID) : base(objectID)
            {
                // Set the window title via its Title property.
                Title = "CSharp Toolbox Window - Scale: " + Scale + "%";

                DocMenu = Toolbox.Object.CreateInstance <DocumentMenu> ("WindowMenu");
                // Attach the menu to the window.
                Menu = DocMenu;

                font = new Font.Instance(FontID,
                                         ((FontHeight * FontAspectRatio) / 100) << 4,
                                         FontHeight << 4);

                DocMenu.SaveAsDBox.FileType           = 0xfff;
                DocMenu.SaveAsDBox.SelectionAvailable = false;
                DocMenu.SaveAsDBox.SaveToFile        += save_data;
                DocMenu.SaveAsDBox.FillBuffer        += fill_buffer;

                DocMenu.FileInfoDBox.AboutToBeShown += fileinfo_Show;

                // The AboutToBeShown events for ColourMenu and ColourDialogue don't seem to
                // be reliable, so use the SubMenuShow events instead. This is a Toolbox issue,
                // not a Mono/C# issue.
                DocMenu.ColourDBoxEntry.SubMenu += colourdbox_SubMenuShow;
                DocMenu.ColourMenuEntry.SubMenu += colourmenu_SubMenuShow;

                Toolbox.ColourDialogue colour_dbox =
                    DocMenu.ColourDBoxEntry.GetSubMenuShow <Toolbox.ColourDialogue> ();
                colour_dbox.ColourSelected += colourdbox_Selected;

                Toolbox.ColourMenu colour_menu =
                    DocMenu.ColourMenuEntry.GetSubMenuShow <Toolbox.ColourMenu> ();
                colour_menu.Selection += colourmenu_Selected;

                DocMenu.FontDBox.AboutToBeShown += fontdbox_Show;
                DocMenu.FontDBox.ApplyFont      += fontdbox_ApplyFont;

                DocMenu.FontMenu.AboutToBeShown += fontmenu_Show;
                DocMenu.FontMenu.FontSelection  += fontmenu_Selection;

                DocMenu.ScaleDBox.AboutToBeShown += scaledbox_Shown;
                DocMenu.ScaleDBox.ApplyFactor    += scaledbox_ApplyFactor;

                DocMenu.PrintDBox.ClickSave  += printdbox_SavePrint;
                DocMenu.PrintDBox.ClickPrint += printdbox_SavePrint;
            }