Esempio n. 1
0
        public void AddReleaseOptions(FlowLayoutWidget controlsTopToBottom)
        {
            AltGroupBox releaseOptionsGroupBox = new AltGroupBox(LocalizedString.Get("Update Feed"));

            releaseOptionsGroupBox.Margin      = new BorderDouble(0);
            releaseOptionsGroupBox.TextColor   = ActiveTheme.Instance.PrimaryTextColor;
            releaseOptionsGroupBox.BorderColor = ActiveTheme.Instance.PrimaryTextColor;
            releaseOptionsGroupBox.HAnchor     = Agg.UI.HAnchor.ParentLeftRight;
            releaseOptionsGroupBox.VAnchor     = Agg.UI.VAnchor.ParentTop;
            releaseOptionsGroupBox.Height      = 68;

            FlowLayoutWidget controlsContainer = new FlowLayoutWidget();

            controlsContainer.HAnchor |= HAnchor.ParentCenter;

            AnchoredDropDownList releaseOptionsDropList = new AnchoredDropDownList("Development");

            releaseOptionsDropList.Margin = new BorderDouble(0, 3);

            MenuItem releaseOptionsDropDownItem = releaseOptionsDropList.AddItem("Release", "release");

            releaseOptionsDropDownItem.Selected += new EventHandler(FixTabDot);

            MenuItem preReleaseDropDownItem = releaseOptionsDropList.AddItem("Pre-Release", "pre-release");

            preReleaseDropDownItem.Selected += new EventHandler(FixTabDot);

            MenuItem developmentDropDownItem = releaseOptionsDropList.AddItem("Development", "development");

            developmentDropDownItem.Selected += new EventHandler(FixTabDot);

            releaseOptionsDropList.MinimumSize = new Vector2(releaseOptionsDropList.LocalBounds.Width, releaseOptionsDropList.LocalBounds.Height);

            List <string> acceptableUpdateFeedTypeValues = new List <string> ()
            {
                "release", "pre-release", "development"
            };
            string currentUpdateFeedType = UserSettings.Instance.get("UpdateFeedType");

            if (acceptableUpdateFeedTypeValues.IndexOf(currentUpdateFeedType) == -1)
            {
                UserSettings.Instance.set("UpdateFeedType", "release");
            }

            releaseOptionsDropList.SelectedValue = UserSettings.Instance.get("UpdateFeedType");

            releaseOptionsDropList.SelectionChanged += new EventHandler(ReleaseOptionsDropList_SelectionChanged);

            controlsContainer.AddChild(releaseOptionsDropList);
            releaseOptionsGroupBox.AddChild(controlsContainer);
            controlsTopToBottom.AddChild(releaseOptionsGroupBox);
        }
		public void AddReleaseOptions(FlowLayoutWidget controlsTopToBottom)
		{
			AltGroupBox releaseOptionsGroupBox = new AltGroupBox(LocalizedString.Get("Update Feed"));

			releaseOptionsGroupBox.Margin = new BorderDouble(0);
			releaseOptionsGroupBox.TextColor = ActiveTheme.Instance.PrimaryTextColor;
			releaseOptionsGroupBox.BorderColor = ActiveTheme.Instance.PrimaryTextColor;
			releaseOptionsGroupBox.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
			releaseOptionsGroupBox.VAnchor = Agg.UI.VAnchor.ParentTop;
			releaseOptionsGroupBox.Height = 68;

			FlowLayoutWidget controlsContainer = new FlowLayoutWidget();
			controlsContainer.HAnchor |= HAnchor.ParentCenter;

			AnchoredDropDownList releaseOptionsDropList = new AnchoredDropDownList("Development");
			releaseOptionsDropList.Margin = new BorderDouble(0, 3);

			MenuItem releaseOptionsDropDownItem = releaseOptionsDropList.AddItem("Release", "release");
			releaseOptionsDropDownItem.Selected += new EventHandler(FixTabDot);

			MenuItem preReleaseDropDownItem = releaseOptionsDropList.AddItem("Pre-Release", "pre-release");
			preReleaseDropDownItem.Selected += new EventHandler(FixTabDot);

			MenuItem developmentDropDownItem = releaseOptionsDropList.AddItem("Development", "development");
			developmentDropDownItem.Selected += new EventHandler(FixTabDot);

			releaseOptionsDropList.MinimumSize = new Vector2(releaseOptionsDropList.LocalBounds.Width, releaseOptionsDropList.LocalBounds.Height);

			List<string> acceptableUpdateFeedTypeValues = new List<string>() { "release", "pre-release", "development" };
			string currentUpdateFeedType = UserSettings.Instance.get("UpdateFeedType");

			if (acceptableUpdateFeedTypeValues.IndexOf(currentUpdateFeedType) == -1)
			{
				UserSettings.Instance.set("UpdateFeedType", "release");
			}

			releaseOptionsDropList.SelectedValue = UserSettings.Instance.get("UpdateFeedType");

			releaseOptionsDropList.SelectionChanged += new EventHandler(ReleaseOptionsDropList_SelectionChanged);

			controlsContainer.AddChild(releaseOptionsDropList);
			releaseOptionsGroupBox.AddChild(controlsContainer);
			controlsTopToBottom.AddChild(releaseOptionsGroupBox);
		}