예제 #1
0
        private void CreatePopupMenu()
        {
            DevComponents.DotNetBar.ButtonItem item;

            m_PopupFromCode = new DevComponents.DotNetBar.ButtonItem();

            // Create items
            item      = new DevComponents.DotNetBar.ButtonItem("bCut");
            item.Text = "Cu&t";
            // To remember: cannot use the ImageIndex for items that we create from code
            item.Image = imageList1.Images[0];
            m_PopupFromCode.SubItems.Add(item);

            item       = new DevComponents.DotNetBar.ButtonItem("bCopy");
            item.Text  = "&Copy";
            item.Image = imageList1.Images[1];
            m_PopupFromCode.SubItems.Add(item);

            item       = new DevComponents.DotNetBar.ButtonItem("bPaste");
            item.Text  = "&Paste";
            item.Image = imageList1.Images[2];
            m_PopupFromCode.SubItems.Add(item);

            item            = new DevComponents.DotNetBar.ButtonItem("bOpenFile");
            item.Text       = "&Open File";
            item.Enabled    = false;
            item.BeginGroup = true;
            m_PopupFromCode.SubItems.Add(item);

            item            = new DevComponents.DotNetBar.ButtonItem("bInsertBreakpoint");
            item.Text       = "Insert B&reakpoint";
            item.BeginGroup = true;
            m_PopupFromCode.SubItems.Add(item);

            item      = new DevComponents.DotNetBar.ButtonItem("bNewBreakpoint");
            item.Text = "New &Breakpoint...";
            m_PopupFromCode.SubItems.Add(item);

            item            = new DevComponents.DotNetBar.ButtonItem("bRunToCursor");
            item.Text       = "&Run To Cursor";
            item.BeginGroup = true;
            m_PopupFromCode.SubItems.Add(item);

            item            = new DevComponents.DotNetBar.ButtonItem("bAddTask");
            item.Text       = "Add Task List S&hortcut";
            item.BeginGroup = true;
            m_PopupFromCode.SubItems.Add(item);

            // Setup side-bar, make sure that image that is used fits, or exceeds the height
            // Side-bar will be displayed only for popup menus
            DevComponents.DotNetBar.SideBarImage si = new DevComponents.DotNetBar.SideBarImage();
            si.Picture = new Bitmap(typeof(Popup.Form1), "devco.jpg");
            // If image exceeds the size of the popup menu this specifies the image alignment
            si.Alignment = DevComponents.DotNetBar.eAlignment.Bottom;
            // If there is no image specified gradient can be used
            si.GradientColor1            = Color.Orange;
            si.GradientColor2            = Color.Black;
            m_PopupFromCode.PopUpSideBar = si;
        }
예제 #2
0
		/// <summary>
		/// Creates new instance of PopupItem and assigns the name and text to it.
		/// </summary>
		/// <param name="sName">Item name.</param>
		/// <param name="ItemText">Item text.</param>
		public PopupItem(string sName, string ItemText):base(sName, ItemText)
		{
			m_PopupMenu=null;
			m_PopupBar=null;
			m_FilterInstalled=false;
			m_PopupType=ePopupType.Menu;
			m_SideBar=new SideBarImage();
			m_WasParentFocused=false;
			m_OldSubItemsImageSize=Size.Empty;
		}
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the Bar class.
        /// </summary>
        public Bar()
        {
            if (!ColorFunctions.ColorsLoaded)
            {
                NativeFunctions.RefreshSettings();
                NativeFunctions.OnDisplayChange();
                ColorFunctions.LoadColors();
            }

            m_ColorScheme = new ColorScheme();
            m_ParentItem = null;
            m_OldContainer = null;
            m_ClientRect = Rectangle.Empty;
            m_SideBarRect = Rectangle.Empty;
            m_SideBarImage = new SideBarImage();
            m_ItemContainer = new GenericItemContainer();
            m_ItemContainer.GlobalItem = false;
            m_ItemContainer.ContainerControl = this;
            m_ItemContainer.WrapItems = true;
            m_ItemContainer.Stretch = false;
            m_ItemContainer.Displayed = true;
            m_ItemContainer.SystemContainer = true;
            //m_ItemContainer.SetSystemItem(true);
            //m_OldParent=null;
            m_InitialContainerWidth = 164;
            //m_BarState=eBarState.Popup;
            m_BarState = eBarState.Docked;

            m_DockOffset = 0;
            m_DockLine = 0;
            m_GrabHandleStyle = eGrabHandleStyle.None;
            m_GrabHandleRect = Rectangle.Empty;
            m_Owner = null;
            m_MouseDownPt = Point.Empty;
            m_MouseDownSize = new Size(0, 0);
            m_MoveWindow = false;
            m_FloatingRect = Rectangle.Empty;
            m_SizeWindow = 0;

            m_LastDragRect = Rectangle.Empty;

            m_WrapItemsDock = false;
            m_WrapItemsFloat = true;
            m_DockStretch = false;
            m_MenuBar = false;
            this.Text = "";

            m_Float = null;
            m_DockingInProgress = false;

            this.SetStyle(ControlStyles.Selectable, false);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.Opaque, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(DisplayHelp.DoubleBufferFlag, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);

            this.TabStop = false;
            base.Font = SystemFonts.MenuFont; // System.Windows.Forms.SystemInformation.MenuFont.Clone() as Font;

            m_CanDockLeft = true;
            m_CanDockRight = true;
            m_CanDockTop = true;
            m_CanDockBottom = true;
            m_CanUndock = true;

            Microsoft.Win32.SystemEvents.UserPreferenceChanged += new Microsoft.Win32.UserPreferenceChangedEventHandler(PreferenceChanged);

            this.IsAccessible = true;

            m_SystemButtons.MouseDownAutoHideChanged += new EventHandler(this.SysButtonHideTooltip);
            m_SystemButtons.MouseDownCloseChanged += new EventHandler(this.SysButtonHideTooltip);
            m_SystemButtons.MouseDownCustomizeChanged += new EventHandler(this.SysButtonHideTooltip);
            m_SystemButtons.MouseOverAutoHideChanged += new EventHandler(this.SysButtonMouseOverAutoHide);
            m_SystemButtons.MouseOverCustomizeChanged += new EventHandler(this.SysButtonMouseOverCustomize);
            m_SystemButtons.MouseOverCloseChanged += new EventHandler(this.SysButtonMouseOverClose);
        }
예제 #4
0
        public MenuPanel():base()
        {
			m_ParentItem=null;
			//m_OldContainer=null;
			m_HotSubItem=null;
			m_Hover=false;
			m_Scroll=false;
			m_TopScroll=false;
			m_BottomScroll=false;
			m_ScrollTopPosition=0;
			m_TopScrollHeight=0;
			m_BottomScrollHeight=0;
			m_ClientRect=new Rectangle();
			m_SideRect=new Rectangle();
			m_SideBarImage=new SideBarImage();
			m_IsCustomizeMenu=false;
			m_Owner=null;
			this.Font=System.Windows.Forms.SystemInformation.MenuFont;//.Clone() as Font;
			this.SetStyle(ControlStyles.Selectable,false);
			this.SetStyle(ControlStyles.AllPaintingInWmPaint,true);
			this.SetStyle(ControlStyles.UserPaint,true);
			this.SetStyle(ControlStyles.Opaque,true);
			this.SetStyle(ControlStyles.ResizeRedraw,true);
			this.SetStyle(DisplayHelp.DoubleBufferFlag,true);
			this.IsAccessible=true;
			this.AccessibleRole=AccessibleRole.MenuPopup;
        }