コード例 #1
0
		public ApplicationMenuRow()
			: base(FlowDirection.LeftToRight)
		{
			linkButtonFactory.textColor = ActiveTheme.Instance.PrimaryTextColor;
			linkButtonFactory.fontSize = 8;

			this.HAnchor = HAnchor.ParentLeftRight;
			this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;

			// put in the file menu
			MenuOptionFile menuOptionFile = new MenuOptionFile();
			this.AddChild(menuOptionFile);

			MenuOptionSettings menuOptionSettings = new MenuOptionSettings();
			this.AddChild(menuOptionSettings);

			// put in the help menu
			MenuOptionHelp menuOptionHelp = new MenuOptionHelp();
			this.AddChild(menuOptionHelp);

			//linkButtonFactory.textColor = ActiveTheme.Instance.SecondaryAccentColor;
			linkButtonFactory.fontSize = 10;

			Button updateStatusMessage = linkButtonFactory.Generate("Update Available");
			UpdateControlData.Instance.UpdateStatusChanged.RegisterEvent(SetUpdateNotification, ref unregisterEvents);
			popUpAboutPage = new FlowLayoutWidget();
			popUpAboutPage.Margin = new BorderDouble(30, 0, 0, 0);
			popUpAboutPage.HAnchor = HAnchor.FitToChildren;
			popUpAboutPage.VAnchor = VAnchor.FitToChildren | VAnchor.ParentCenter;
			popUpAboutPage.AddChild(updateStatusMessage);
			updateStatusMessage.Click += (sender, e) =>
			{
				UiThread.RunOnIdle(CheckForUpdateWindow.Show);
			};
			this.AddChild(popUpAboutPage);
			SetUpdateNotification(this, null);

			// put in a spacer
			this.AddChild(new HorizontalSpacer());

			// make an object that can hold custom content on the right (like the sign in)
			rightElement = new FlowLayoutWidget(FlowDirection.LeftToRight);
			rightElement.Height = 24;
			rightElement.Margin = new BorderDouble(bottom: 4);
			this.AddChild(rightElement);

			this.Padding = new BorderDouble(0, 0, 6, 0);

			if (AddRightElement != null)
			{
				AddRightElement(rightElement);
			}

			// When the application is first started, plugins are loaded after the MainView control has been initialize,
			// and such they not around when this constructor executes. In that case, we run the AddRightElement 
			// delegate after the plugins get initialized via the PluginsLoaded event
			ApplicationController.Instance.PluginsLoaded.RegisterEvent(PluginsLoaded, ref unregisterEvents);
		}
コード例 #2
0
		public ApplicationMenuRow()
			: base(FlowDirection.LeftToRight)
		{
			linkButtonFactory.textColor = ActiveTheme.Instance.PrimaryTextColor;
			linkButtonFactory.fontSize = 8;

			Button signInLink = linkButtonFactory.Generate("(Sign Out)");
			signInLink.VAnchor = Agg.UI.VAnchor.ParentCenter;
			signInLink.Margin = new BorderDouble(top: 0);

			this.HAnchor = HAnchor.ParentLeftRight;
			this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;

			// put in the file menu
			MenuOptionFile menuOptionFile = new MenuOptionFile();
			this.AddChild(menuOptionFile);

			MenuOptionSettings menuOptionSettings = new MenuOptionSettings();
			this.AddChild(menuOptionSettings);

			// put in the help menu
			MenuOptionHelp menuOptionHelp = new MenuOptionHelp();
			this.AddChild(menuOptionHelp);

			//linkButtonFactory.textColor = ActiveTheme.Instance.SecondaryAccentColor;
			linkButtonFactory.fontSize = 10;

			Button updateStatusMessage = linkButtonFactory.Generate("Update Available");
			UpdateControlData.Instance.UpdateStatusChanged.RegisterEvent(SetUpdateNotification, ref unregisterEvents);
			popUpAboutPage = new FlowLayoutWidget();
			popUpAboutPage.Margin = new BorderDouble(30, 0, 0, 0);
			popUpAboutPage.HAnchor = HAnchor.FitToChildren;
			popUpAboutPage.VAnchor = VAnchor.FitToChildren | VAnchor.ParentCenter;
			popUpAboutPage.AddChild(updateStatusMessage);
			updateStatusMessage.Click += (sender, e) =>
			{
				UiThread.RunOnIdle(AboutWindow.Show);
			};
			this.AddChild(popUpAboutPage);
			SetUpdateNotification(this, null);

			// put in a spacer
			this.AddChild(new HorizontalSpacer());

			// make an object that can hold custom content on the right (like the sign in)
			rightElement = new FlowLayoutWidget(FlowDirection.LeftToRight);
			rightElement.Height = 24;
			rightElement.Margin = new BorderDouble(bottom: 4);
			this.AddChild(rightElement);

			this.Padding = new BorderDouble(0, 0, 6, 0);

			if (privateAddRightElement != null)
			{
				privateAddRightElement(rightElement);
			}
		}
コード例 #3
0
        public ApplicationMenuRow()
            : base(FlowDirection.LeftToRight)
        {
            LinkButtonFactory linkButtonFactory = new LinkButtonFactory();

            linkButtonFactory.textColor = ActiveTheme.Instance.PrimaryTextColor;
            linkButtonFactory.fontSize  = 8;

            Button signInLink = linkButtonFactory.Generate("(Sign Out)");

            signInLink.VAnchor = Agg.UI.VAnchor.ParentCenter;
            signInLink.Margin  = new BorderDouble(top: 0);

            this.HAnchor         = HAnchor.ParentLeftRight;
            this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;

            // put in the file menu
            MenuOptionFile menuOptionFile = new MenuOptionFile();

            this.AddChild(menuOptionFile);

#if false
            // put in the view menu
            MenuOptionView menuOptionView = new MenuOptionView();
            this.AddChild(menuOptionView);
#endif

            // put in the help menu
            MenuOptionHelp menuOptionHelp = new MenuOptionHelp();
            this.AddChild(menuOptionHelp);

            // put in a spacer
            this.AddChild(new HorizontalSpacer());

            // make an object that can hold custom content on the right (like the sign in)
            rightElement        = new FlowLayoutWidget(FlowDirection.LeftToRight);
            rightElement.Height = 24;
            rightElement.Margin = new BorderDouble(bottom: 4);
            this.AddChild(rightElement);

            this.Padding = new BorderDouble(0, 0, 6, 0);

            if (privateAddRightElement != null)
            {
                privateAddRightElement(rightElement);
            }
        }
コード例 #4
0
        public ApplicationMenuRow()
            : base(FlowDirection.LeftToRight)
        {
            LinkButtonFactory linkButtonFactory = new LinkButtonFactory();

            linkButtonFactory.textColor = ActiveTheme.Instance.PrimaryTextColor;
            linkButtonFactory.fontSize  = 8;

            Button signInLink = linkButtonFactory.Generate("(Sign Out)");

            signInLink.VAnchor = Agg.UI.VAnchor.ParentCenter;
            signInLink.Margin  = new BorderDouble(top: 0);

            this.HAnchor         = HAnchor.ParentLeftRight;
            this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;

            MenuOptionFile menuOptionFile = new MenuOptionFile();

            //TextWidget menuOptionFile = new TextWidget("FILE", pointSize: 10);

            //menuOptionFile.TextColor = ActiveTheme.Instance.PrimaryTextColor;

            MenuOptionHelp menuOptionHelp = new MenuOptionHelp();

            rightElement        = new FlowLayoutWidget(FlowDirection.LeftToRight);
            rightElement.Height = 24;
            rightElement.Margin = new BorderDouble(bottom: 4);
            //rightElement.VAnchor = Agg.UI.VAnchor.ParentCenter;

            this.AddChild(menuOptionFile);
            this.AddChild(menuOptionHelp);
            this.AddChild(new HorizontalSpacer());
            this.AddChild(rightElement);

            this.Padding = new BorderDouble(0, 0, 6, 0);

            if (privateAddRightElement != null)
            {
                privateAddRightElement(rightElement);
            }
        }
コード例 #5
0
        public ApplicationMenuRow()
            :base(FlowDirection.LeftToRight)
        {
            LinkButtonFactory linkButtonFactory = new LinkButtonFactory();
            linkButtonFactory.textColor = ActiveTheme.Instance.PrimaryTextColor;
            linkButtonFactory.fontSize = 8;
            
            Button signInLink = linkButtonFactory.Generate("(Sign Out)");
            signInLink.VAnchor = Agg.UI.VAnchor.ParentCenter;            
            signInLink.Margin = new BorderDouble(top: 0);
            
            this.HAnchor = HAnchor.ParentLeftRight;
            this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;

            MenuOptionFile menuOptionFile = new MenuOptionFile();         

            //TextWidget menuOptionFile = new TextWidget("FILE", pointSize: 10);
            
            //menuOptionFile.TextColor = ActiveTheme.Instance.PrimaryTextColor;

            MenuOptionHelp menuOptionHelp = new MenuOptionHelp();

            rightElement = new FlowLayoutWidget(FlowDirection.LeftToRight);
            rightElement.Height = 24;
            rightElement.Margin = new BorderDouble(bottom: 4);
            //rightElement.VAnchor = Agg.UI.VAnchor.ParentCenter;

            this.AddChild(menuOptionFile);
            this.AddChild(menuOptionHelp);
            this.AddChild(new HorizontalSpacer());
            this.AddChild(rightElement);

            this.Padding = new BorderDouble(0, 0, 6, 0);

            if (privateAddRightElement != null)
            {
                privateAddRightElement(rightElement);
            }
        }
コード例 #6
0
        public ApplicationMenuRow()
            : base(FlowDirection.LeftToRight)
        {
            linkButtonFactory.textColor = ActiveTheme.Instance.PrimaryTextColor;
            linkButtonFactory.fontSize  = 8;

            Button signOutLink = linkButtonFactory.Generate("(Sign Out)");

            signOutLink.Name        = "Authentication Sign Out";
            signOutLink.ToolTipText = "Sign out of your MatterControl account".Localize();
            signOutLink.VAnchor     = Agg.UI.VAnchor.ParentCenter;
            signOutLink.Margin      = new BorderDouble(top: 0);

            this.HAnchor         = HAnchor.ParentLeftRight;
            this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;

            // put in the file menu
            MenuOptionFile menuOptionFile = new MenuOptionFile();

            this.AddChild(menuOptionFile);

            MenuOptionSettings menuOptionSettings = new MenuOptionSettings();

            this.AddChild(menuOptionSettings);

            // put in the help menu
            MenuOptionHelp menuOptionHelp = new MenuOptionHelp();

            this.AddChild(menuOptionHelp);

            //linkButtonFactory.textColor = ActiveTheme.Instance.SecondaryAccentColor;
            linkButtonFactory.fontSize = 10;

            Button updateStatusMessage = linkButtonFactory.Generate("Update Available");

            UpdateControlData.Instance.UpdateStatusChanged.RegisterEvent(SetUpdateNotification, ref unregisterEvents);
            popUpAboutPage         = new FlowLayoutWidget();
            popUpAboutPage.Margin  = new BorderDouble(30, 0, 0, 0);
            popUpAboutPage.HAnchor = HAnchor.FitToChildren;
            popUpAboutPage.VAnchor = VAnchor.FitToChildren | VAnchor.ParentCenter;
            popUpAboutPage.AddChild(updateStatusMessage);
            updateStatusMessage.Click += (sender, e) =>
            {
                UiThread.RunOnIdle(CheckForUpdateWindow.Show);
            };
            this.AddChild(popUpAboutPage);
            SetUpdateNotification(this, null);

            // put in a spacer
            this.AddChild(new HorizontalSpacer());

            // make an object that can hold custom content on the right (like the sign in)
            rightElement        = new FlowLayoutWidget(FlowDirection.LeftToRight);
            rightElement.Height = 24;
            rightElement.Margin = new BorderDouble(bottom: 4);
            this.AddChild(rightElement);

            this.Padding = new BorderDouble(0, 0, 6, 0);

            if (AddRightElement != null)
            {
                AddRightElement(rightElement);
            }

            // When the application is first started, plugins are loaded after the MainView control has been initialize,
            // and such they not around when this constructor executes. In that case, we run the AddRightElement
            // delegate after the plugins get initialized via the PluginsLoaded event
            ApplicationController.Instance.PluginsLoaded.RegisterEvent(PluginsLoaded, ref unregisterEvents);
        }
コード例 #7
0
        public ApplicationMenuRow()
            : base(FlowDirection.LeftToRight)
        {
            linkButtonFactory.textColor = ActiveTheme.Instance.PrimaryTextColor;
            linkButtonFactory.fontSize  = 8;

            Button signInLink = linkButtonFactory.Generate("(Sign Out)");

            signInLink.VAnchor = Agg.UI.VAnchor.ParentCenter;
            signInLink.Margin  = new BorderDouble(top: 0);

            this.HAnchor         = HAnchor.ParentLeftRight;
            this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;

            // put in the file menu
            MenuOptionFile menuOptionFile = new MenuOptionFile();

            this.AddChild(menuOptionFile);

            MenuOptionSettings menuOptionSettings = new MenuOptionSettings();

            this.AddChild(menuOptionSettings);

            // put in the help menu
            MenuOptionHelp menuOptionHelp = new MenuOptionHelp();

            this.AddChild(menuOptionHelp);

            //linkButtonFactory.textColor = ActiveTheme.Instance.SecondaryAccentColor;
            linkButtonFactory.fontSize = 10;

            Button updateStatusMessage = linkButtonFactory.Generate("Update Available");

            UpdateControlData.Instance.UpdateStatusChanged.RegisterEvent(SetUpdateNotification, ref unregisterEvents);
            popUpAboutPage         = new FlowLayoutWidget();
            popUpAboutPage.Margin  = new BorderDouble(30, 0, 0, 0);
            popUpAboutPage.HAnchor = HAnchor.FitToChildren;
            popUpAboutPage.VAnchor = VAnchor.FitToChildren | VAnchor.ParentCenter;
            popUpAboutPage.AddChild(updateStatusMessage);
            updateStatusMessage.Click += (sender, e) =>
            {
                UiThread.RunOnIdle(AboutWindow.Show);
            };
            this.AddChild(popUpAboutPage);
            SetUpdateNotification(this, null);

            // put in a spacer
            this.AddChild(new HorizontalSpacer());

            // make an object that can hold custom content on the right (like the sign in)
            rightElement        = new FlowLayoutWidget(FlowDirection.LeftToRight);
            rightElement.Height = 24;
            rightElement.Margin = new BorderDouble(bottom: 4);
            this.AddChild(rightElement);

            this.Padding = new BorderDouble(0, 0, 6, 0);

            if (privateAddRightElement != null)
            {
                privateAddRightElement(rightElement);
            }
        }