protected override void OnCreateContextMenu(ContextMenu mnu, Point location)
        {
            base.OnCreateContextMenu(mnu, location);
            //
            MenuItemWithBitmap mi;

            if (!(this is ComponentIconEventhandle))
            {
                mi = new MenuItemWithBitmap("Create action", mi_createAction, Resources._newMethodAction.ToBitmap());
                mnu.MenuItems.Add(mi);
            }
            //
            mi = new MenuItemWithBitmap("Edit method", mi_edit, Resources._method.ToBitmap());
            mnu.MenuItems.Add(mi);
            //
            if (!(this is ComponentIconEventhandle))
            {
                mnu.MenuItems.Add("-");
                mi = new MenuItemWithBitmap("Make a new copy", mi_makeCopy, Resources._copy.ToBitmap());
                mnu.MenuItems.Add(mi);
            }
            //
            mnu.MenuItems.Add("-");
            //
            mi = new MenuItemWithBitmap("Delete method", mi_delete, Resources._cancel.ToBitmap());
            mnu.MenuItems.Add(mi);
        }
        protected override void OnCreateContextMenu(ContextMenu cm)
        {
            MenuItem mi;

            mi = new MenuItemWithBitmap("Edit event handler", miEditActions_Click, Resources._method.ToBitmap());
            cm.MenuItems.Add(mi);
        }
Ejemplo n.º 3
0
        protected override void OnCreateContextMenu(ContextMenu mnu, Point location)
        {
            MenuItemWithBitmap mi;

            mi = new MenuItemWithBitmap("Delete", mi_delete, Resources._cancel.ToBitmap());
            mnu.MenuItems.Add(mi);
        }
 public override void CreateContextMenu(Menu.MenuItemCollection mnu, EventHandler handler)
 {
     if (_children != null && _children.Count > 0)
     {
         Form    caller = null;
         WebPage wpage  = this.RootPointer.ObjectInstance as WebPage;
         if (wpage != null)
         {
             if (wpage.Parent != null)
             {
                 caller = wpage.Parent.FindForm();
             }
             else
             {
                 caller = wpage;
             }
         }
         MenuItem mi = new MenuItemWithBitmap("Menu click events", Resources._eventHandlers.ToBitmap());
         for (int i = 0; i < _children.Count; i++)
         {
             HtmlElement_menubar.AddMenuItemHandler(_children[i], mi.MenuItems, handler, caller);
         }
         mnu.Add(mi);
     }
 }
Ejemplo n.º 5
0
 protected override void OnMouseDown(MouseEventArgs e)
 {
     base.OnMouseDown(e);
     if ((e.Button & MouseButtons.Right) == MouseButtons.Right)
     {
         ContextMenu mnu = new ContextMenu();
         MenuItem    mi;
         if (_viewer.ReadOnly)
         {
         }
         else
         {
             mi        = new MenuItemWithBitmap("Add local variable", Resources._obj.ToBitmap());
             mi.Click += new EventHandler(miNewObject_Click);
             mi.Tag    = new Point(e.X, e.Y);
             mnu.MenuItems.Add(mi);
             //
             mi     = new MenuItemWithBitmap("Arrange Icons By", Resources.grid);
             mi.Tag = new Point(e.X, e.Y);
             mnu.MenuItems.Add(mi);
             MenuItem msi = new MenuItem("Name", miArrangeByName_Click);
             mi.MenuItems.Add(msi);
             msi = new MenuItem("Type", miArrangeByType_Click);
             mi.MenuItems.Add(msi);
         }
         if (mnu.MenuItems.Count > 0)
         {
             mnu.Show(this, new Point(e.X, e.Y));
         }
     }
 }
Ejemplo n.º 6
0
        public void CreateContextmenu()
        {
            ContextMenu mnu = new ContextMenu();

            mnu.MenuItems.Add(new MenuItemWithBitmap("Edit resources", mnu_editresources, Resource1.resx.ToBitmap()));
            //
            if (_resman.Languages.Count > 0)
            {
                mnu.MenuItems.Add(new MenuItem("-"));
                MenuItemWithBitmap m = new MenuItemWithBitmap("default culture", mnu_changeCulture, TreeViewObjectExplorer.GetLangaugeBitmapByName(string.Empty));
                m.Tag = "";
                mnu.MenuItems.Add(m);
                foreach (string s in _resman.Languages)
                {
                    CultureInfo c = CultureInfo.GetCultureInfo(s);
                    if (c != null)
                    {
                        m     = new MenuItemWithBitmap(ProjectResources.CultureDisplay(c), mnu_changeCulture, TreeViewObjectExplorer.GetLangaugeBitmapByName(s));
                        m.Tag = s;
                        mnu.MenuItems.Add(m);
                    }
                }
            }
            //
            this.ContextMenu    = mnu;
            lblLang.ContextMenu = mnu;
            picLang.ContextMenu = mnu;
        }
 public override MenuItem[] GetContextMenuItems(bool readOnly)
 {
     MenuItem[] mns = new MenuItem[2];
     mns[0] = new MenuItemWithBitmap("Remove", mn_remove, Resources._cancel.ToBitmap());
     mns[1] = new MenuItemWithBitmap("Rename", mn_rename, Resources._rename.ToBitmap());
     return(mns);
 }
Ejemplo n.º 8
0
        protected override void OnCreateContextMenu(ContextMenu mnu, Point location)
        {
            base.OnCreateContextMenu(mnu, location);
            MenuItem mi;

            //
            mi        = new MenuItemWithBitmap("Create Set Value Action", Resources._setVar.ToBitmap());
            mi.Click += new EventHandler(miNewInstance_Click);
            mnu.MenuItems.Add(mi);
            //
            mi = new MenuItem("-");
            mnu.MenuItems.Add(mi);
            //
            mi        = new MenuItemWithBitmap("Rename", Resources._rename.ToBitmap());
            mi.Click += new EventHandler(miRename_Click);
            mnu.MenuItems.Add(mi);
            //
            mi        = new MenuItemWithBitmap("Change Icon", Resources._changeIcon.ToBitmap());
            mi.Click += new EventHandler(miChangeIcon_Click);
            mnu.MenuItems.Add(mi);
            //
            mi = new MenuItem("-");
            mnu.MenuItems.Add(mi);
            //
            mi        = new MenuItemWithBitmap("Remove", Resources._cancel.ToBitmap());
            mi.Click += new EventHandler(miDelete_Click);
            mnu.MenuItems.Add(mi);
        }
 public MenuItem[] GetContextMenuItems(bool bReadOnly)
 {
     MenuItem[] mns = new MenuItem[2];
     mns[0] = new MenuItemWithBitmap("Select languages", mn_selLanguages, Resources._regionLanguage.ToBitmap());
     mns[1] = new MenuItemWithBitmap("Set UI language to default", mn_setToDefault, Resources._language);
     return(mns);
 }
Ejemplo n.º 10
0
        protected override void OnCreateContextMenu(ContextMenu cm)
        {
            MenuItem mi;

            mi = new MenuItemWithBitmap("Edit Repeated Actions", miEditActions_Click, Resources._condition.ToBitmap());
            cm.MenuItems.Add(mi);
            cm.MenuItems.Add("-");
        }
        public override void AddFileContextMenus(List <MenuItem> l)
        {
            l.Add(new MenuItem("-"));
            MenuItemWithBitmap m = new MenuItemWithBitmap("Set resource type", Resources._type);
            MenuItem           m1;

            if (typeof(string).Equals(_contentType))
            {
                m1         = new MenuItem("Text", mnu_setResType);
                m1.Checked = true;
            }
            else
            {
                m1 = new MenuItemWithBitmap("Text", mnu_setResType, Resources._string.ToBitmap());
            }
            m1.Tag = typeof(string);
            m.MenuItems.Add(m1);
            //
            if (typeof(byte[]).Equals(_contentType))
            {
                m1         = new MenuItem("Byte array", mnu_setResType);
                m1.Checked = true;
            }
            else
            {
                m1 = new MenuItemWithBitmap("Byte array", mnu_setResType, Resources.array);
            }
            m1.Tag = typeof(byte[]);
            m.MenuItems.Add(m1);
            //
            if (typeof(MemoryStream).Equals(_contentType))
            {
                m1         = new MenuItem("MemoryStream", mnu_setResType);
                m1.Checked = true;
            }
            else
            {
                m1 = new MenuItemWithBitmap("MemoryStream", mnu_setResType, Resources._dots.ToBitmap());
            }
            m1.Tag = typeof(MemoryStream);
            m.MenuItems.Add(m1);
            //
            if (typeof(UnmanagedMemoryStream).Equals(_contentType))
            {
                m1         = new MenuItem("UnmanagedMemoryStream", mnu_setResType);
                m1.Checked = true;
            }
            else
            {
                m1 = new MenuItemWithBitmap("UnmanagedMemoryStream", mnu_setResType, Resources._dots.ToBitmap());
            }
            m1.Tag = typeof(UnmanagedMemoryStream);
            m.MenuItems.Add(m1);
            //
            l.Add(m);
        }
 public override MenuItem[] GetContextMenuItems(bool readOnly)
 {
     if (!readOnly)
     {
         MenuItem[] mnus = new MenuItem[1];
         mnus[0] = new MenuItemWithBitmap("Database Connections", mnu_connections, Resources._connections.ToBitmap());
         return(mnus);
     }
     return(null);
 }
 public MenuItem[] GetContextMenuItems()
 {
     if (this.Parent.Nodes.Count > 1)
     {
         MenuItem[] mns = new MenuItem[1];
         mns[0] = new MenuItemWithBitmap("Remove", mnu_removeCulture, Resource1._cancel.ToBitmap());
         return(mns);
     }
     return(null);
 }
Ejemplo n.º 14
0
 public override MenuItem[] GetContextMenuItems(bool readOnly)
 {
     if (!(this.HtmlElement is HtmlElementUnknown) && this.HtmlElement.ElementGuid == Guid.Empty)
     {
         MenuItem[] mis = new MenuItem[1];
         mis[0] = new MenuItemWithBitmap("Use it in programming", mi_useIt, Resources._createEventFireAction.ToBitmap());
         return(mis);
     }
     return(null);
 }
 public MenuItem[] GetContextMenuItems(bool readOnly)
 {
     if (!readOnly)
     {
         MenuItem[] mnus = new MenuItem[1];
         mnus[0] = new MenuItemWithBitmap("Edit", mnu_editConnect, Resources._connections.ToBitmap());
         return(mnus);
     }
     return(null);
 }
Ejemplo n.º 16
0
 protected override void OnCreateContextMenu(ContextMenu mnu, Point location)
 {
     base.OnCreateContextMenu(mnu, location);
     if (!(this.ClassPointer is ClassPointer))
     {
         MenuItem mi;
         //
         mi        = new MenuItemWithBitmap("Create Set Value Action", Resources._setVar.ToBitmap());
         mi.Click += new EventHandler(miNewInstance_Click);
         mnu.MenuItems.Add(mi);
     }
 }
 protected override void OnCreateContextMenu(ContextMenu mnu, Point location)
 {
     base.OnCreateContextMenu(mnu, location);
     if (_root.ClassId != this.ClassId)
     {
         if (mnu.MenuItems.Count > 0)
         {
             mnu.MenuItems.Add("-");
         }
         MenuItem mi = new MenuItemWithBitmap("Delete", mi_delete, Resources._cancel.ToBitmap());
         mnu.MenuItems.Add(mi);
     }
 }
        public static void AddMenuItemHandler(HtmlElement_menuItem e, Menu.MenuItemCollection mnu, EventHandler handler, Form caller)
        {
            MenuItem m0 = new MenuItemWithBitmap(e.Text, Resources._event1.ToBitmap());

            mnu.Add(m0);
            EventItem ei = new EventItem(e.Text, e, new EventInfoHtmlMenu(e));

            m0.Tag         = ei;
            ei.MenuOwner   = e;
            ei.MenuInvoker = caller;
            m0.Click      += handler;
            e.CreateContextMenu(m0.MenuItems, handler);
        }
Ejemplo n.º 19
0
        private void mnu_doHtmlCopy(object sender, EventArgs e)
        {
            MenuItemWithBitmap mi = sender as MenuItemWithBitmap;

            if (mi != null && mi.Tag != null)
            {
                string s = mi.Tag.ToString();
                if (!string.IsNullOrEmpty(s))
                {
                    Clipboard.SetText(s);
                }
            }
        }
        void _button_Click(object sender, EventArgs e)
        {
            ContextMenu cm = new ContextMenu();
            Dictionary <string, Type> jsTypes = WebClientData.GetJavascriptTypes();

            foreach (KeyValuePair <string, Type> kv in jsTypes)
            {
                Image img             = VPLUtil.GetTypeIcon(kv.Value);
                MenuItemWithBitmap mi = new MenuItemWithBitmap(kv.Key, mi_click, img);
                mi.Tag = kv.Value;
                cm.MenuItems.Add(mi);
            }
            cm.Show(dataGridView1, _button.Location);
        }
 public MenuItem[] GetContextMenuItems(bool bReadOnly)
 {
     MenuItem[] mns = new MenuItem[2];
     if (string.IsNullOrEmpty(_name))
     {
         mns[0] = new MenuItemWithBitmap("Set UI language", mn_setLanguage, TreeViewObjectExplorer.GetLangaugeBitmapByName(_culture.Name));
     }
     else
     {
         mns[0] = new MenuItemWithBitmap("Set UI language", mn_setLanguage, TreeViewObjectExplorer.GetLangaugeBitmapByName(_name));
     }
     mns[1] = new MenuItemWithBitmap("Remove", mn_delLanguage, Resources._cancel.ToBitmap());
     return(mns);
 }
Ejemplo n.º 22
0
        protected override void OnCreateContextMenu(ContextMenu mnu, Point location)
        {
            base.OnCreateContextMenu(mnu, location);
            Type t = null;
            ParameterClassArrayItem      ap = this.ClassPointer as ParameterClassArrayItem;
            ParameterClassCollectionItem ci = this.ClassPointer as ParameterClassCollectionItem;

            if (ap != null)
            {
                t = ap.BaseClassType;
            }
            else if (ci != null)
            {
                t = ci.BaseClassType;
            }
            if (t != null)
            {
                if (this.Parent != null)
                {
                    List <ComponentIconLocal> list = new List <ComponentIconLocal>();
                    foreach (Control c in this.Parent.Controls)
                    {
                        ComponentIconLocal cil = c as ComponentIconLocal;
                        if (cil != null)
                        {
                            if (t.IsAssignableFrom(cil.LocalPointer.BaseClassType))
                            {
                                list.Add(cil);
                            }
                        }
                    }
                    if (list.Count > 0)
                    {
                        if (mnu.MenuItems.Count > 0)
                        {
                            mnu.MenuItems.Add("-");
                        }
                        MenuItemWithBitmap mi = new MenuItemWithBitmap("Use it as", Resources._as.ToBitmap());
                        mnu.MenuItems.Add(mi);
                        foreach (ComponentIconLocal cil in list)
                        {
                            MenuItemWithBitmap mi0 = new MenuItemWithBitmap(cil.Label.Text, mi_useAs, VPL.VPLUtil.GetTypeIcon(cil.ClassPointer.ObjectType));
                            mi0.Tag = cil;
                            mi.MenuItems.Add(mi0);
                        }
                    }
                }
            }
        }
Ejemplo n.º 23
0
        private void mnu_doHtmlPaste(object sender, EventArgs e)
        {
            MenuItemWithBitmap mi = sender as MenuItemWithBitmap;

            if (mi != null && mi.Tag != null)
            {
                if (Clipboard.ContainsText())
                {
                    string   txt = Clipboard.GetText();
                    Point    p   = (Point)mi.Tag;
                    IWebHost w   = _designPage.GetHtmlEditor();
                    w.PasteToHtmlInput(txt, p.X, p.Y);
                }
            }
        }
Ejemplo n.º 24
0
 protected override void OnCreateContextMenu(ContextMenu mnu, Point location)
 {
     base.OnCreateContextMenu(mnu, location);
     if (this.HtmlElement != null && !(this.HtmlElement is HtmlElementUnknown))
     {
         if (this.HtmlElement.ElementGuid == Guid.Empty)
         {
             if (mnu.MenuItems.Count > 0)
             {
                 mnu.MenuItems.Add("-");
             }
             MenuItem mi = new MenuItemWithBitmap("Use it in programming", mi_useIt, Resources._createEventFireAction.ToBitmap());
             mnu.MenuItems.Add(mi);
         }
     }
 }
Ejemplo n.º 25
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            bool      isWebComponent = DesignUtil.IsWebClientObject(_event.Owner);
            EventPath ep             = this.Parent as EventPath;

            if (ep != null)
            {
                ep.SelectEventIcon(this);
            }
            if (e.Button == MouseButtons.Right)
            {
                ContextMenu        menu = new ContextMenu();
                MenuItemWithBitmap mi;
                mi = new MenuItemWithBitmap("Assign actions", mi_assignActions, Resources._eventHandlers.ToBitmap());
                menu.MenuItems.Add(mi);
                if (isWebComponent)
                {
                    mi = new MenuItemWithBitmap("Add client handler actions", mi_addWebClientHandlerClientActs, Resources._handlerMethod.ToBitmap());
                    menu.MenuItems.Add(mi);
                    mi = new MenuItemWithBitmap("Add server handler actions", mi_addWebClientHandlerServerActs, Resources._webServerHandler.ToBitmap());
                    menu.MenuItems.Add(mi);
                    mi = new MenuItemWithBitmap("Add client and download handler actions", mi_addWebClientHandlerDownloadActs, Resources._webHandler2.ToBitmap());
                }
                else
                {
                    mi = new MenuItemWithBitmap("Add handler method", mi_addHandler, Resources._handlerMethod.ToBitmap());
                }
                menu.MenuItems.Add(mi);
                menu.MenuItems.Add("-");
                if (IsCustomEventForRoot)
                {
                    mi = new MenuItemWithBitmap("Create event-firing action", mi_createEventFireMethod, Resources._createEventFireAction.ToBitmap());
                    menu.MenuItems.Add(mi);
                    menu.MenuItems.Add("-");
                    mi = new MenuItemWithBitmap("Delete event", mi_removeEvent, Resources._delEvent.ToBitmap());
                    menu.MenuItems.Add(mi);
                }
                else
                {
                    mi = new MenuItemWithBitmap("Remove event handling", mi_remove, Resources._cancel.ToBitmap());
                    menu.MenuItems.Add(mi);
                }
                menu.Show(this, e.Location);
            }
        }
        protected override void OnCreateContextMenu(ContextMenu cm)
        {
            AB_Constructor     av = this.ActionObject as AB_Constructor;
            ConstructorPointer cp = av.ActionData.ActionMethod as ConstructorPointer;
            LocalVariable      lv = cp.Owner as LocalVariable;

            ConstructorInfo[] cis = lv.ObjectType.GetConstructors();
            if (cis.Length > 1)
            {
                MenuItem mi;
                //
                mi = new MenuItemWithBitmap("Select Constructor", miSelectConstructor_Click, Resources._dialog.ToBitmap());
                cm.MenuItems.Add(mi);
                //
                mi = new MenuItem("-");
                cm.MenuItems.Add(mi);
            }
        }
Ejemplo n.º 27
0
        protected override void OnCreateContextMenu(ContextMenu mnu, Point location)
        {
            base.OnCreateContextMenu(mnu, location);
            //
            MenuItemWithBitmap mi;

            mi = new MenuItemWithBitmap("Create Set-Property action", mi_createAction, Resources._newPropAction.ToBitmap());
            mnu.MenuItems.Add(mi);
            //
            mnu.MenuItems.Add("-");
            //
            if (_property.IsOverride)
            {
                mi = new MenuItemWithBitmap("Remove Override", mnu_remove, Resources._cancel.ToBitmap());
            }
            else
            {
                mi = new MenuItemWithBitmap("Delete property", mi_delete, Resources._cancel.ToBitmap());
            }
            mnu.MenuItems.Add(mi);
        }
Ejemplo n.º 28
0
        public void OnPropInputMouseDown(string selectedText, int selStart, int selEnd, int x, int y)
        {
            Point p = Point.Empty;

            if (x != 0 && y != 0)
            {
                p = new Point(x, y);
            }
            if (p.IsEmpty)
            {
                p = System.Windows.Forms.Cursor.Position;
            }
            ContextMenu        cmn = new ContextMenu();
            MenuItemWithBitmap mi  = new MenuItemWithBitmap("Copy", mnu_doHtmlCopy, Resources._copy.ToBitmap());

            mi.Tag = selectedText;
            cmn.MenuItems.Add(mi);
            mi     = new MenuItemWithBitmap("Paste", mnu_doHtmlPaste, Resources.paste);
            mi.Tag = new Point(selStart, selEnd);
            cmn.MenuItems.Add(mi);
            cmn.Show(_designPage.GetHtmlEditor() as Control, p);
        }
 public MenuItem[] GetContextMenuItems()
 {
     MenuItem[] mns;
     if (Folder.Parent != null)
     {
         mns = new MenuItem[8];
     }
     else
     {
         mns = new MenuItem[5];
     }
     mns[0] = new MenuItemWithBitmap("Add source files", mnu_addFiles, Resource1._newIcon.ToBitmap());
     mns[1] = new MenuItemWithBitmap("Add source files from a folder", mnu_addSourceFolder, Resource1._newIcon.ToBitmap());
     mns[2] = new MenuItemWithBitmap("Add source project", mnu_addSourceProject, Resource1._newIcon.ToBitmap());
     mns[3] = new MenuItem("-");
     mns[4] = new MenuItemWithBitmap("Add sub folder", mnu_addFolder, Resource1._newIcon.ToBitmap());
     if (Folder.Parent != null)
     {
         mns[5] = new MenuItemWithBitmap("Rename", mnu_rename, Resource1._rename.ToBitmap());
         mns[6] = new MenuItem("-");
         mns[7] = new MenuItemWithBitmap("Remove", mnu_delFolder, Resource1._cancel.ToBitmap());
     }
     return(mns);
 }
 public override MenuItem[] GetContextMenuItems(bool readOnly)
 {
     MenuItem[] mns = new MenuItem[1];
     mns[0] = new MenuItemWithBitmap("Add file", MenuAddResource, Resources._file.ToBitmap());
     return(mns);
 }