Exemplo n.º 1
0
        /// <summary>
        /// Creates menu item.
        /// </summary>
        /// <param name="engine">ui engine.</param>
        /// <param name="menu">menu it belongs to.</param>
        /// <param name="text">menu item text.</param>
        /// <param name="icon">menu item icon.</param>
        /// <param name="name">menu item name.</param>
        /// <param name="parent">parent menu item.</param>
        /// <param name="topItem">is this top menu item.</param>
        internal MenuItem(UIEngine engine, Menu menu, String text, String icon, String name, MenuItem parent, bool topItem)
            : base("menuItem")
        {
            this.engine = engine;
            this.icon = icon;
            this.text = text;
            this.topItem = topItem;
            this.parent = parent;
            this.menu = menu;
            this.Name = name;

            for (int i = 0; i < 8; i++)
            {
                this.borders[i] = null;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Open menu item clicked.
        /// </summary>
        /// <param name="sender">clicked button</param>
        /// <param name="args">arguments</param>
        private void OpenClicked(MenuItem sender, EventArgs args)
        {
            List<String> filter = new List<String>();
            filter.Add(".window.xml");

            FileChooser fileChooserWindow = (FileChooser)(this.Desktop.NewRegisteredWindow(FileChooser.TypeName));
            fileChooserWindow.Name = "fileChooserOpenFile";
            fileChooserWindow.ActiveFilter = fileChooserWindow.AddFilter("Windows (*.window.xml)", filter);
            fileChooserWindow.FileMustExist = true;
            fileChooserWindow.Text = "Open Window...";
            fileChooserWindow.SelectButtonText = "Open";
            fileChooserWindow.Closing += this.OpenFileWindowClosing;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Handles window close event.
        /// </summary>
        /// <param name="sender">clicked menu item</param>
        /// <param name="args">arguments</param>
        private void DesignWindowCloseClicked(MenuItem sender, EventArgs args)
        {
            Close();

            if (null != this.Engine.ScriptsHandler)
            {
                this.Engine.ScriptsHandler.OnUIEvent("uidesigner.exit", this);
            }
        }