Exemplo n.º 1
0
		private void InitializeComponentEx()
		{
			InitialiseFeatures();

			if (DPIScaling.WantScaling())
			{
				int imageSize = DPIScaling.Scale(16);

				this.ToolBar.ImageScalingSize = new System.Drawing.Size(imageSize, imageSize);
				this.ContextMenu.ImageScalingSize = new System.Drawing.Size(imageSize, imageSize);
			}

			this.ToolbarDock = DockStyle.Top;
			this.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
			this.InnerText = "";
			this.TabIndex = 26;
			this.BorderSize = 0;
			this.ContentMargin = 5;

			this.BrowserPanel.Anchor = AnchorStyles.None; // we handle positioning ourselves

			this.WebBrowser.Document.AttachEventHandler("onfocusout", OnLostFocus);
			this.WebBrowser.Document.AttachEventHandler("onfocusin", OnGotFocus);

			// Place this at the end to ensure the toolbar has finished its resize
			Toolbars.FixupButtonSizes(this.ToolBar);
		}
        private void InitialiseToolbars()
        {
            // Main toolbar
            var tbRenderer = new UIThemeToolbarRenderer();

            tbRenderer.SetUITheme(new UITheme());
            tbRenderer.EnableDrawRowSeparators(true);

            this.Toolbar.Renderer  = tbRenderer;
            this.Toolbar.BackColor = BackColor;

            if (DPIScaling.WantScaling())
            {
                int imageSize = DPIScaling.Scale(16);
                this.Toolbar.ImageScalingSize = new System.Drawing.Size(imageSize, imageSize);
            }

            // Place this at the end to ensure the toolbar has finished its resize
            Toolbars.FixupButtonSizes(this.Toolbar);

            UpdateToolbar();

            // Page toolbars
            var theme = new UITheme();

            theme.SetAppDrawingColor(UITheme.AppColor.AppBackLight, headerPage.BackColor);
            theme.SetAppDrawingColor(UITheme.AppColor.ToolbarLight, headerPage.BackColor);
            theme.SetAppDrawingColor(UITheme.AppColor.ToolbarDark, headerPage.BackColor);

            this.htmlReportHeaderControl.SetUITheme(theme);
            this.htmlReportTitleControl.SetUITheme(theme);
            this.htmlReportTasksControl.SetUITheme(theme);
            this.htmlReportFooterControl.SetUITheme(theme);
        }
Exemplo n.º 3
0
        private void PrepareToolbar()
        {
            // Add preferences and help buttons to the toolbar
            m_HtmlEditControl.ToolBar.Items.Add(new ToolStripSeparator());

            var prefsBtn = new System.Windows.Forms.ToolStripButton();

            m_HtmlEditControl.ToolBar.Items.Add(prefsBtn);

            prefsBtn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            prefsBtn.Name         = "toolstripShowPrefs";
            prefsBtn.Tag          = "ShowPrefs";
            prefsBtn.ToolTipText  = m_Trans.Translate("Preferences");
            prefsBtn.Click       += new System.EventHandler(OnShowPreferences);
            prefsBtn.Size         = m_HtmlEditControl.ToolBar.Items[0].Size;
            prefsBtn.Image        = Properties.Resources.prefs.ToBitmap();

            m_HtmlEditControl.ToolBar.Items.Add(new ToolStripSeparator());

            var helpBtn = new System.Windows.Forms.ToolStripButton();

            m_HtmlEditControl.ToolBar.Items.Add(helpBtn);

            helpBtn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            helpBtn.Name         = "toolstripShowHelp";
            helpBtn.Tag          = "ShowHelp";
            helpBtn.ToolTipText  = m_Trans.Translate("Online Help");
            helpBtn.Click       += new System.EventHandler(OnShowHelp);
            helpBtn.Size         = prefsBtn.Size;
            helpBtn.Image        = Properties.Resources.help.ToBitmap();

            Toolbars.FixupButtonSizes(m_HtmlEditControl.ToolBar);
        }
Exemplo n.º 4
0
		public new void SetControlFont(Font font)
		{
			base.SetControlFont(font);

			this.ToolBar.Font = m_ControlsFont;

			Toolbars.FixupButtonSizes(this.ToolBar);
		}
Exemplo n.º 5
0
        private void InitialiseToolbars()
        {
            this.MenuBar.Renderer           = m_toolbarRenderer;
            this.RowContextMenu.Renderer    = m_toolbarRenderer;
            this.CellContextMenu.Renderer   = m_toolbarRenderer;
            this.HeaderContextMenu.Renderer = m_toolbarRenderer;
            this.ColumnContextMenu.Renderer = m_toolbarRenderer;

            this.ToolBar.Renderer   = m_toolbarRenderer;
            this.FontBar.Renderer   = m_toolbarRenderer;
            this.StatusBar.Renderer = m_toolbarRenderer;

            Toolbars.FixupButtonSizes(this.ToolBar);
            Toolbars.FixupButtonSizes(this.FontBar);

            if (m_ControlsFont != null)
            {
                this.MenuBar.Font   = m_ControlsFont;
                this.ToolBar.Font   = m_ControlsFont;
                this.StatusBar.Font = m_ControlsFont;
                this.FontBar.Font   = m_ControlsFont;

                this.FontBar.Items["fontToolStripComboBox"].Font     = m_ControlsFont;
                this.FontBar.Items["fontSizeToolStripComboBox"].Font = m_ControlsFont;

                this.RowContextMenu.Font    = m_ControlsFont;
                this.CellContextMenu.Font   = m_ControlsFont;
                this.HeaderContextMenu.Font = m_ControlsFont;
                this.ColumnContextMenu.Font = m_ControlsFont;
            }

            if (DPIScaling.WantScaling())
            {
                int imageSize   = DPIScaling.Scale(16);
                var scalingSize = new Size(imageSize, imageSize);

                this.MenuBar.ImageScalingSize = scalingSize;
                this.FontBar.ImageScalingSize = scalingSize;
                this.ToolBar.ImageScalingSize = scalingSize;

                this.RowContextMenu.ImageScalingSize    = scalingSize;
                this.CellContextMenu.ImageScalingSize   = scalingSize;
                this.HeaderContextMenu.ImageScalingSize = scalingSize;
                this.ColumnContextMenu.ImageScalingSize = scalingSize;
            }

            this.ToolBar.GripStyle    = ToolStripGripStyle.Hidden;
            this.FontBar.GripStyle    = ToolStripGripStyle.Hidden;
            this.StatusBar.SizingGrip = false;

            // After all resizing has occurred, set menu bar height to
            // match application and make its top-level items full height
            this.MenuBar.AutoSize = false;
            this.MenuBar.Height   = Win32.GetSystemMetric(15); // SM_CYMENU
            this.MenuBar.Padding  = new Padding(0);
        }
Exemplo n.º 6
0
        private void CreateToolbar()
        {
            var assembly = Assembly.GetExecutingAssembly();
            var images   = new Bitmap(assembly.GetManifestResourceStream("DayViewUIExtension.toolbar_std.bmp"));

            m_TBImageList                  = new ImageList();
            m_TBImageList.ImageSize        = new System.Drawing.Size(16, 16);
            m_TBImageList.TransparentColor = Color.Magenta;
            m_TBImageList.Images.AddStrip(images);

            m_Toolbar           = new ToolStrip();
            m_Toolbar.Anchor    = AnchorStyles.None;
            m_Toolbar.GripStyle = ToolStripGripStyle.Hidden;
            m_Toolbar.ImageList = m_TBImageList;

            if (DPIScaling.WantScaling())
            {
                int imageSize = DPIScaling.Scale(16);

                m_Toolbar.ImageScalingSize = new Size(imageSize, imageSize);
                m_Toolbar.AutoSize         = false;
                m_Toolbar.Height           = (imageSize + 10);
            }

            m_TBRenderer       = new UIThemeToolbarRenderer();
            m_Toolbar.Renderer = m_TBRenderer;

            var btn1 = new ToolStripButton();

            btn1.ImageIndex  = 0;
            btn1.Click      += new EventHandler(OnGoToToday);
            btn1.ToolTipText = m_Trans.Translate("Go to Today");
            m_Toolbar.Items.Add(btn1);

            var btn2 = new ToolStripButton();

            btn2.ImageIndex  = 1;
            btn2.Click      += new EventHandler(OnPreferences);
            btn2.ToolTipText = m_Trans.Translate("Preferences");
            m_Toolbar.Items.Add(btn2);

            var btn3 = new ToolStripButton();

            btn3.ImageIndex  = 2;
            btn3.Click      += new EventHandler(OnHelp);
            btn3.ToolTipText = m_Trans.Translate("Online Help");
            m_Toolbar.Items.Add(btn3);

            Toolbars.FixupButtonSizes(m_Toolbar);

            Controls.Add(m_Toolbar);
        }
        private void InitialiseToolbar()
        {
            m_TBRenderer = new UIThemeToolbarRenderer();
            m_TBRenderer.SetUITheme(new UITheme());
            m_TBRenderer.EnableDrawRowDividers(true);

            this.Toolbar.Renderer = m_TBRenderer;

            if (DPIScaling.WantScaling())
            {
                int imageSize = DPIScaling.Scale(16);
                this.Toolbar.ImageScalingSize = new System.Drawing.Size(imageSize, imageSize);
            }

            // Place this at the end to ensure the toolbar has finished its resize
            Toolbars.FixupButtonSizes(this.Toolbar);
        }
Exemplo n.º 8
0
        private void InitializeComponent()
        {
            InitialiseFeatures();

            this.ToolBar.Renderer = m_toolbarRenderer;
            this.ToolBar.Font     = m_ControlsFont;

            if (DPIScaling.WantScaling())
            {
                int imageSize = DPIScaling.Scale(16);

                this.ToolBar.ImageScalingSize     = new System.Drawing.Size(imageSize, imageSize);
                this.ContextMenu.ImageScalingSize = new System.Drawing.Size(imageSize, imageSize);
            }

            this.ToolbarDock    = DockStyle.Top;
            this.Anchor         = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
            this.InnerText      = "";
            this.TabIndex       = 26;
            this.BorderStyle    = System.Windows.Forms.BorderStyle.None;
            this.BorderSize     = 0;
            this.NavigateAction = MSDN.Html.Editor.NavigateActionOption.NewWindow;
            this.ContentMargin  = 8;

            this.BrowserPanel.Anchor = AnchorStyles.None;             // we handle positioning ourselves

            m_Trans.Translate(ToolBar.Items);
            m_Trans.Translate(ContextMenu.Items);

            m_TextChangeTimer.Tick    += new EventHandler(OnTextChangeTimer);
            m_TextChangeTimer.Interval = 200;
            m_TextChangeTimer.Start();

            // Dynamic tooltip handling
            this.WebBrowser.Document.MouseOver += new HtmlElementEventHandler(OnDocumentMouseOver);

            // Place this at the end to ensure the toolbar has finished its resize
            Toolbars.FixupButtonSizes(this.ToolBar);
        }
Exemplo n.º 9
0
        private void CreateToolbar()
        {
            var assembly = Assembly.GetExecutingAssembly();
            var images   = new Bitmap(assembly.GetManifestResourceStream("DayViewUIExtension.toolbar_std.bmp"));

            m_TBImageList                  = new ImageList();
            m_TBImageList.ColorDepth       = ColorDepth.Depth32Bit;
            m_TBImageList.ImageSize        = new System.Drawing.Size(16, 16);
            m_TBImageList.TransparentColor = Color.Magenta;
            m_TBImageList.Images.AddStrip(images);

            m_Toolbar           = new IIControls.ToolStripEx();
            m_Toolbar.Anchor    = AnchorStyles.None;
            m_Toolbar.GripStyle = ToolStripGripStyle.Hidden;
            m_Toolbar.ImageList = m_TBImageList;

            int imageSize = DPIScaling.Scale(16);

            m_Toolbar.ImageScalingSize = new Size(imageSize, imageSize);
            m_Toolbar.Height           = (imageSize + 7); // MFC

            m_TBRenderer       = new UIThemeToolbarRenderer();
            m_Toolbar.Renderer = m_TBRenderer;

            var btn1 = new ToolStripButton();

            btn1.ImageIndex  = 0;
            btn1.Click      += new EventHandler(OnGoToToday);
            btn1.ToolTipText = m_Trans.Translate("Go to Today");
            m_Toolbar.Items.Add(btn1);

            m_Toolbar.Items.Add(new ToolStripSeparator());

            var btn2 = new ToolStripButton();

            btn2.Name        = "Show1DayView";
            btn2.ImageIndex  = 1;
            btn2.Click      += new EventHandler(OnShow1DayView);
            btn2.ToolTipText = m_Trans.Translate("1 Day View");
            m_Toolbar.Items.Add(btn2);

            var btn3 = new ToolStripButton();

            btn3.Name        = "Show3DayView";
            btn3.ImageIndex  = 2;
            btn3.Click      += new EventHandler(OnShow3DayView);
            btn3.ToolTipText = m_Trans.Translate("3 Day View");
            m_Toolbar.Items.Add(btn3);

            var btn4 = new ToolStripButton();

            btn4.Name        = "Show7DayView";
            btn4.ImageIndex  = 3;
            btn4.Click      += new EventHandler(OnShow7DayView);
            btn4.ToolTipText = m_Trans.Translate("7 Day View");
            m_Toolbar.Items.Add(btn4);

            var btn5 = new ToolStripButton();

            btn5.Name        = "Show14DayView";
            btn5.ImageIndex  = 4;
            btn5.Click      += new EventHandler(OnShow14DayView);
            btn5.ToolTipText = m_Trans.Translate("14 Day View");
            m_Toolbar.Items.Add(btn5);

            var btn6 = new ToolStripButton();

            btn6.Name        = "Show28DayView";
            btn6.ImageIndex  = 5;
            btn6.Click      += new EventHandler(OnShow28DayView);
            btn6.ToolTipText = m_Trans.Translate("28 Day View");
            m_Toolbar.Items.Add(btn6);

            m_Toolbar.Items.Add(new ToolStripSeparator());

            var btn9 = new ToolStripButton();

            btn9.ImageIndex  = 6;
            btn9.Click      += new EventHandler(OnPreferences);
            btn9.ToolTipText = m_Trans.Translate("Preferences");
            m_Toolbar.Items.Add(btn9);

            var btn10 = new ToolStripButton();

            btn10.ImageIndex  = 7;
            btn10.Click      += new EventHandler(OnHelp);
            btn10.ToolTipText = m_Trans.Translate("Online Help");
            m_Toolbar.Items.Add(btn10);

            Toolbars.FixupButtonSizes(m_Toolbar);

            Controls.Add(m_Toolbar);
        }