示例#1
0
        public Window()
        {
            InitializeComponent();

            m_mainPaneText      = new Label();
            m_mainPaneText.Text = "No item was yet clicked.";
            m_mainPaneText.Dock = DockStyle.Right;

            string[] iconLabels = { "iconName" };
            var      imagelist  = new ImageList();
            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);
                }
            }

            imagelist.Images.Add(itemIcon);

            m_smallImages.AddList(imagelist, iconLabels);
            m_largeImages.AddList(imagelist, iconLabels);

            m_mediator           = new Mediator();
            m_mediator.StringTbl = new SIL.Utils.StringTable("../../DistFiles/Language Explorer/Configuration");
            m_sidebarAdapter     = new SidebarAdapter();
            m_sidebar            = m_sidebarAdapter.Init(this, m_smallImages, m_largeImages, m_mediator);

            m_sidebarChoiceGroupCollection = new MyChoiceGroupCollection(m_mediator, m_sidebarAdapter, null);
            m_sidebarChoiceGroupCollection.Init();

            this.Controls.Add(m_sidebar);
            this.Controls.Add(m_mainPaneText);
            m_sidebarAdapter.FinishInit();

            ((IUIAdapter)m_sidebarAdapter).OnIdle();
            m_mediator.SendMessage("Idle", null);

            m_mediator.AddColleague(new MyCoreColleague(m_mainPaneText));
        }
示例#2
0
		public Window()
		{
			InitializeComponent();

			m_mainPaneText = new Label();
			m_mainPaneText.Text = "No item was yet clicked.";
			m_mainPaneText.Dock = DockStyle.Right;

			string[] iconLabels = { "iconName" };
			var imagelist = new ImageList();
			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);

			imagelist.Images.Add(itemIcon);

			m_smallImages.AddList(imagelist, iconLabels);
			m_largeImages.AddList(imagelist, iconLabels);

			m_mediator = new Mediator();
			m_mediator.StringTbl = new SIL.Utils.StringTable("../../DistFiles/Language Explorer/Configuration");
			m_sidebarAdapter = new SidebarAdapter();
			m_sidebar = m_sidebarAdapter.Init(this, m_smallImages, m_largeImages, m_mediator);

			m_sidebarChoiceGroupCollection = new MyChoiceGroupCollection(m_mediator, m_sidebarAdapter, null);
			m_sidebarChoiceGroupCollection.Init();

			this.Controls.Add(m_sidebar);
			this.Controls.Add(m_mainPaneText);
			m_sidebarAdapter.FinishInit();

			((IUIAdapter)m_sidebarAdapter).OnIdle();
			m_mediator.SendMessage("Idle", null);

			m_mediator.AddColleague(new MyCoreColleague(m_mainPaneText));
		}