SidePane is the main class for clients to use of the SilSidePane library. SidePane is intended to be placed on the side of an application, and allows buttons to be grouped by category, which are shown by clicking different tabs. It is similar to the Navigation Pane in Outlook. An example of its usage is in SilSidePaneTestApp.
Inheritance: System.Windows.Forms.Panel
Exemplo n.º 1
0
		/// <summary/>
		protected virtual void Dispose(bool fDisposing)
		{
			System.Diagnostics.Debug.WriteLineIf(!fDisposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
			if (fDisposing && !IsDisposed)
			{
				// dispose managed and unmanaged objects
				if (m_sidepane != null)
					m_sidepane.Dispose();
			}
			m_sidepane = null;
			IsDisposed = true;
		}
Exemplo n.º 2
0
        public TestWindow()
        {
            InitializeComponent();
            sidePane = new SidePane(this.splitContainer1.Panel1, SidePaneItemAreaStyle.List);

            // Add some tabs

            Tab scriptureTab = new Tab("Scripture");
            Tab backTab      = new Tab("Back");
            Tab printTab     = new Tab("Print");

            sidePane.AddTab(scriptureTab);
            sidePane.AddTab(backTab);
            sidePane.AddTab(printTab);

            // Add items to certain tabs

            var itemIcon = new Bitmap(32, 32);

            for (int x = 0; x < itemIcon.Width; ++x)
            {
                for (int y = 0; y < itemIcon.Height; ++y)
                {
                    itemIcon.SetPixel(x, y, Color.Blue);
                }
            }

            Item scriptureDraftItem = new Item("Draft")
            {
                Icon = itemIcon,
            };
            Item scripturePrintItem = new Item("Print Scr Layout")
            {
                Icon = itemIcon,
            };
            Item backDraftItem = new Item("Draft")
            {
                Icon = itemIcon,
            };
            Item backPrintItem = new Item("Print Back Layout")
            {
                Icon = itemIcon,
            };

            sidePane.AddItem(scriptureTab, scriptureDraftItem);
            sidePane.AddItem(scriptureTab, scripturePrintItem);
            sidePane.AddItem(backTab, backDraftItem);
            sidePane.AddItem(backTab, backPrintItem);

            // Set up click handling - make main pane look different upon item click
            sidePane.ItemClicked += new SidePane.ItemClickedEventHandler(sidePane_ItemClicked);
        }
Exemplo n.º 3
0
		public TestWindow()
		{
			InitializeComponent();
			sidePane = new SidePane(this.splitContainer1.Panel1, SidePaneItemAreaStyle.List);

			// Add some tabs

			Tab scriptureTab = new Tab("Scripture");
			Tab backTab = new Tab("Back");
			Tab printTab = new Tab("Print");

			sidePane.AddTab(scriptureTab);
			sidePane.AddTab(backTab);
			sidePane.AddTab(printTab);

			// Add items to certain tabs

			var itemIcon = new Bitmap(32, 32);
			for (int x = 0; x < itemIcon.Width; ++x)
				for (int y = 0; y < itemIcon.Height; ++y)
					itemIcon.SetPixel(x, y, Color.Blue);

			Item scriptureDraftItem = new Item("Draft")
				{
					Icon = itemIcon,
				};
			Item scripturePrintItem = new Item("Print Scr Layout")
				{
					Icon = itemIcon,
				};
			Item backDraftItem = new Item("Draft")
				{
					Icon = itemIcon,
				};
			Item backPrintItem = new Item("Print Back Layout")
				{
					Icon = itemIcon,
				};

			sidePane.AddItem(scriptureTab, scriptureDraftItem);
			sidePane.AddItem(scriptureTab, scripturePrintItem);
			sidePane.AddItem(backTab, backDraftItem);
			sidePane.AddItem(backTab, backPrintItem);

			// Set up click handling - make main pane look different upon item click
			sidePane.ItemClicked += new SidePane.ItemClickedEventHandler(sidePane_ItemClicked);
		}
Exemplo n.º 4
0
        public void MakeSidePaneWithManyItems()
        {
            // Put sidepane on a window
            using (Form window = new Form())
            {
                window.Height = 600;
                window.Width  = 600;
                SplitContainer container = new SplitContainer();
                container.Dock          = DockStyle.Fill;
                container.SplitterWidth = 100;
                window.Controls.Add(container);
                using (SidePane sidepane = new SidePane(container.Panel1, ItemAreaStyle))
                {
                    // Add a tab and a lot of items
                    Tab tab = new Tab("tabname");
                    sidepane.AddTab(tab);
                    for (int i = 0; i < 50; ++i)
                    {
                        sidepane.AddItem(tab, new Item("item" + i.ToString()));
                    }

                    try
                    {
                        // Display the window and its contents
                        window.Show();
                        Application.DoEvents();
                        Assert.IsTrue(window.Visible);
                    }
                    finally
                    {
                        window.Hide();
                        Application.DoEvents();
                    }
                }
            }
        }
Exemplo n.º 5
0
 public void SetUp()
 {
     _parent   = new Panel();
     _sidePane = new SidePane(_parent, ItemAreaStyle);
 }
Exemplo n.º 6
0
 public void SetUp()
 {
     _parent   = new Panel();
     _sidePane = new SidePane(_parent);
 }
Exemplo n.º 7
0
        /// <summary></summary>
        public void Init(Mediator mediator, XmlNode configurationParameters)
        {
            m_mediator = mediator;
            mediator.AddColleague(this);

            areasLabel = m_mediator.StringTbl.LocalizeAttributeValue("Areas");

            m_sidepane = new SidePane(MyControl, SidePaneItemAreaStyle.List);
            m_sidepane.AccessibilityObject.Name = "sidepane";
                //m_sidepane.GetType().Name;
            m_sidepane.ItemClicked += SidePaneItemClickedHandler;
            m_sidepane.TabClicked += SidePaneTabClickedHandler;
        }
Exemplo n.º 8
0
		public void MakeSidePaneWithManyItems()
		{
			// Put sidepane on a window
			using (Form window = new Form())
			{
				window.Height = 600;
				window.Width = 600;
				SplitContainer container = new SplitContainer();
				container.Dock = DockStyle.Fill;
				container.SplitterWidth = 100;
				window.Controls.Add(container);
				using (SidePane sidepane = new SidePane(container.Panel1, ItemAreaStyle))
				{
					// Add a tab and a lot of items
					Tab tab = new Tab("tabname");
					sidepane.AddTab(tab);
					for (int i = 0; i < 50; ++i)
						sidepane.AddItem(tab, new Item("item" + i.ToString()));

					try
					{
						// Display the window and its contents
						window.Show();
						Application.DoEvents();
						Assert.IsTrue(window.Visible);
					}
					finally
					{
						window.Hide();
						Application.DoEvents();
					}
				}
			}
		}
Exemplo n.º 9
0
		public void SetUp()
		{
			_parent = new Panel();
			_sidePane = new SidePane(_parent, ItemAreaStyle);
		}
Exemplo n.º 10
0
		public void SetUp()
		{
			_parent = new Panel();
			_sidePane = new SidePane(_parent);
		}
Exemplo n.º 11
0
		/// ------------------------------------------------------------------------------------
		/// <summary></summary>
		/// <param name="sbContainer">The control that contains the sidebar control.</param>
		/// <param name="ibContainer">The control that contains the information bar.</param>
		/// <param name="mediator">XCore message mediator through which messages are sent
		/// for tab and tab item clicks.</param>
		/// ------------------------------------------------------------------------------------
		public void Initialize(Control sbContainer, Control ibContainer, Mediator mediator)
		{
			if (sbContainer == null)
				return;

			m_mediator = mediator;

			// Setup context menu to allow switching between large and small icon mode.
			SetupSideBarsContextMenu();

			SetupInfoBar(ibContainer);

			m_sidePane = new SidePane(sbContainer);
			m_sidePane.ItemClicked += HandleSidePaneItemClick;
			m_sidePane.TabClicked += (HandleTabClicked);

			sbContainer.Resize += HandleParentContainerResize;
			UpdateSidebarLayout();
		}