public void Remove(StripToolPage aPage) { if (_ToolPages.IndexOf(aPage) > -1) { _ToolPages.Remove(aPage); } }
public void Remove(StripToolPage aPage) { if (_List.IndexOf(aPage) > -1) { _List.Remove(aPage); } }
public void Add(StripToolPage aPage) { Host.Add(aPage); if (_List.IndexOf(aPage) < 0) { _List.Add(aPage); } }
public void Redraw() { ArrayList lDrawed = new ArrayList(); foreach (object iItem in _HostPages) { StripToolPage lPage = (StripToolPage)iItem; if (lPage != null && lPage.ToolStrip != null && lDrawed.IndexOf(lPage.ToolStrip) < 0) { lPage.ToolStrip.Invalidate(); lDrawed.Add(lPage.ToolStrip); } } }
public int IndexOf(string aPageTitle) { StripToolPage iItem = null; aPageTitle = aPageTitle.ToUpper(); for (int i = 0; i < _ToolPages.Count; i++) { iItem = ((StripToolPage)_ToolPages[i]); if (aPageTitle == iItem.Title.ToUpper()) { return(i); } } return(-1); }
protected internal void setPage(StripToolPage aPage, bool aAdd) { if (aAdd) { if (_HostPages.IndexOf(aPage) < 0) { _HostPages.Add(aPage); } } else { if (_HostPages.IndexOf(aPage) > -1) { _HostPages.Remove(aPage); } } }
public StripToolPage Add(StripToolPage aPage) { if (_ToolPages.IndexOf(aPage) < 0) { _ToolPages.Add(aPage); aPage.setHost(this); } if (_Selected < 0) { _Selected = 0; } Invalidate(); return(aPage); }
public void DrawGroup(Graphics aGraph, Point aLocation, StripToolPage aSender) { Pen lPen = new Pen(Color.Black); int lLeft = aLocation.X + aSender.ToolStrip.IconSpacing / 2; int lTop = aLocation.Y + aSender.ToolStrip.IconSpacing / 2; int lSpacing = aSender.ToolStrip.IconSpacing; int lHeight = aSender.ToolStrip.IconSize.Height; foreach (StripToolItem iItem in _Items) { int lWidth = iItem.GetWidth(); iItem.DrawTo( aGraph, new Point(lLeft, lTop), new Size(lWidth, aSender.ToolStrip.IconSize.Height), lSpacing, this._Highlighted == iItem ); lLeft += lWidth + aSender.ToolStrip.IconSpacing; } }
protected internal void updateByPoint(Point aPoint, int aLeft, StripToolPage aSender) { aSender.hlItem = null; _Highlighted = null; int lX = aPoint.X - aLeft; int lLeft = aSender.ToolStrip.IconSpacing / 2; for (int i = 0; i < _Items.Count && lX > lLeft; i++) { int lWidth = this[i].GetWidth(); if (lX > lLeft && lX < lLeft + lWidth) { _Highlighted = this[i]; if (aSender != null) { aSender.hlItem = this[i]; } _Highlighted.Redraw(); break; } lLeft += lWidth + aSender.ToolStrip.IconSpacing; } }
public bool Includes(StripToolPage aPage) { return(_List.IndexOf(aPage) > -1); }
protected internal void updateByPoint(Point aPoint, int aLeft, StripToolPage aSender) { aSender.hlItem = null; _Highlighted = null; int lX = aPoint.X - aLeft; int lLeft = aSender.ToolStrip.IconSpacing / 2; for (int i = 0; i < _Items.Count && lX > lLeft; i++) { int lWidth = this[i].GetWidth(); if (lX > lLeft && lX < lLeft + lWidth) { _Highlighted = this[i]; if (aSender != null) aSender.hlItem = this[i]; _Highlighted.Redraw(); break; } lLeft += lWidth + aSender.ToolStrip.IconSpacing; } }
public StripToolPage Add(StripToolPage aPage) { if (_ToolPages.IndexOf(aPage) < 0) { _ToolPages.Add(aPage); aPage.setHost(this); } if (_Selected < 0) _Selected = 0; Invalidate(); return aPage; }
public bool Includes(StripToolPage aPage) { return _List.IndexOf(aPage) > -1; }
public void Add(StripToolPage aPage) { Host.Add(aPage); if (_List.IndexOf(aPage) < 0) _List.Add(aPage); }
protected internal void setPage(StripToolPage aPage, bool aAdd) { if (aAdd) { if (_HostPages.IndexOf(aPage) < 0) _HostPages.Add(aPage); } else { if (_HostPages.IndexOf(aPage) > -1) _HostPages.Remove(aPage); } }
public void Remove(StripToolPage aPage) { if (_ToolPages.IndexOf(aPage) > -1) _ToolPages.Remove(aPage); }
protected virtual void initToolStrip() { this.SuspendLayout(); _ctlToolStrip = new CPagedToolStrip(); _ctlToolStrip.IconSize = new Size(32, 32); _ctlToolStrip.Font = new System.Drawing.Font("Arial", _FontSize, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); _ctlToolStrip.Name = "ToolStrip"; _ctlToolStrip.Anchor = (AnchorStyles)(AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top); _ctlToolStrip.Location = new Point(0, _ctlPageSelector.Bottom); //_ctlToolStrip.Location = new Point(0, 0); _ctlToolStrip.Size = new Size(_ctlPageSelector.Width, _ctlPagesHost.Top - _ctlPageSelector.Bottom); _ctlToolStrip.StripBackground = (Image)(RsViewEngine.SpecialResources.GetObject("ToolBG")); _ctlToolStrip.Dock = DockStyle.Top; // Create objects: _setCollection = new StripToolPageset(_ctlToolStrip); _setCollection.Add(_pHome = new StripToolPage(_ctlToolStrip, "home")); _setCollection.Add(_pEdit = new StripToolPage(_ctlToolStrip, "edit")); _setSettings = new StripToolPageset(_ctlToolStrip); _setSettings.Add(_pHome); _setReport = new StripToolPageset(_ctlToolStrip); _setReport.Add(_pView = new StripToolPage(_ctlToolStrip, "view")); _setReport.Add(_pExport = new StripToolPage(_ctlToolStrip, "export")); _gFile = new StripToolGroup(_ctlToolStrip); _gSpec = new StripToolGroup(_ctlToolStrip); _gCollAdd = new StripToolGroup(_ctlToolStrip); _gCollEdit = new StripToolGroup(_ctlToolStrip); _gCollRemove = new StripToolGroup(_ctlToolStrip); _gPrint = new StripToolGroup(_ctlToolStrip); _gToFile = new StripToolGroup(_ctlToolStrip); _gRefresh = new StripToolGroup(_ctlToolStrip); _gPanels = new StripToolGroup(_ctlToolStrip); _gZoom = new StripToolGroup(_ctlToolStrip); _gPages = new StripToolGroup(_ctlToolStrip); _gFile.GroupColor = ControlProperties.ColorItemInBack(); _gSpec.GroupColor = ControlProperties.ColorItemInBack(); _gCollAdd.GroupColor = ControlProperties.ColorItemInBack(); _gCollEdit.GroupColor = ControlProperties.ColorItemInBack(); _gCollRemove.GroupColor = ControlProperties.ColorItemInBack(); _gPrint.GroupColor = ControlProperties.ColorItemInBack(); _gToFile.GroupColor = ControlProperties.ColorItemInBack(); _gRefresh.GroupColor = ControlProperties.ColorItemInBack(); _gPanels.GroupColor = ControlProperties.ColorItemInBack(); _gZoom.GroupColor = ControlProperties.ColorItemInBack(); _gPages.GroupColor = ControlProperties.ColorItemInBack(); // Create icons: _iOpenRpt = _gFile.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_open_32x32")))); _iImportCollection = _gFile.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_importCollection_32x32")))); _iExportCollection = _gFile.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_exportCollection_32x32")))); _iSettings = _gSpec.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_settings_32x32")))); _iHelp = _gSpec.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_help_32x32")))); _iAddColl = _gCollAdd.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_addColl_32x32")))); _iNewFolder = _gCollAdd.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_newFolder_32x32")))); _iAddRpt = _gCollAdd.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_add_32x32")))); _iEditRpt = _gCollEdit.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_editItem_32x32")))); _iRemove = _gCollRemove.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_remove_32x32")))); _iPrint = _gPrint.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_print_32x32")))); _iMail = _gPrint.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_mail_32x32")))); _iPDF = _gToFile.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_pdf_32x32")))); _iWord = _gToFile.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_word_32x32")))); _iXLS = _gToFile.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_excel_32x32")))); _iHTML = _gToFile.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_html_32x32")))); _iXML = _gToFile.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_xml_32x32")))); _iRefresh = _gRefresh.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_refresh_32x32")))); _iOffline = _gRefresh.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_offline_32x32")))); _iGroups = _gPanels.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_groups_32x32")))); _iZoomIn = _gZoom.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_zoomIn_32x32")))); _iZoomWidth = _gZoom.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_zoomFitWidth_32x32")))); _iZoomWnd = _gZoom.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_zoomFitWindow_32x32")))); _iZoomOut = _gZoom.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_zoomOut_32x32")))); _iFirst = _gPages.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_first_32x32")))); _iPrev = _gPages.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_previous_32x32")))); _iNext = _gPages.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_next_32x32")))); _iLast = _gPages.Add(new StripToolItem(_ctlToolStrip, (Image)(RsViewEngine.Resources.GetObject("icon_last_32x32")))); // Build structure: _pHome.Add(_gFile); _pHome.Add(_gSpec); _pEdit.Add(_gFile); _pEdit.Add(_gCollAdd); _pEdit.Add(_gCollEdit); _pEdit.Add(_gCollRemove); _pExport.Add(_gFile); _pExport.Add(_gRefresh); _pExport.Add(_gPrint); _pExport.Add(_gToFile); _pView.Add(_gFile); _pView.Add(_gRefresh); _pView.Add(_gPages); _pView.Add(_gZoom); _pView.Add(_gPanels); // Add event handlers: _iOpenRpt.Action += new ToolItemAction(EH_OpenAction); _iSettings.Action += new ToolItemAction(EH_SettingsClick); _iExportCollection.Action += new ToolItemAction(EH_ExportAction); _iImportCollection.Action += new ToolItemAction(EH_ImportAction); _iEditRpt.Action += new ToolItemAction(EH_EditAction); _iAddRpt.Action += new ToolItemAction(EH_AddRptAction); _iRemove.Action += new ToolItemAction(EH_RemoveAction); _iNewFolder.Action += new ToolItemAction(EH_AddFolderAction); _iAddColl.Action += new ToolItemAction(EH_AddCollectionAction); _iPrint.Action += new ToolItemAction(EH_PrintAction); _iPDF.Action += new ToolItemAction(EH_ExportPDFAction); _iMail.Action += new ToolItemAction(EH_Mail); _iWord.Action += new ToolItemAction(EH_ExportWordAction); _iXLS.Action += new ToolItemAction(EH_ExportExcelAction); _iXML.Action += new ToolItemAction(EH_ExportXMLAction); _iHTML.Action += new ToolItemAction(EH_ExportHTMLAction); _iHelp.Action += new ToolItemAction(EH_ShowAbout); _iRefresh.Action += new ToolItemAction(EH_RefreshReport); _iOffline.Action += new ToolItemAction(EH_Offline); _iGroups.Action += new ToolItemAction(EH_ShowGroups); _iZoomIn.Action += new ToolItemAction(EH_ZoomIn); _iZoomOut.Action += new ToolItemAction(EH_ZoomOut); _iZoomWnd.Action += new ToolItemAction(EH_ZoomFitwindow); _iZoomWidth.Action += new ToolItemAction(EH_ZoomFitwidth); _iFirst.Action += new ToolItemAction(EH_Paging); _iPrev.Action += new ToolItemAction(EH_Paging); _iNext.Action += new ToolItemAction(EH_Paging); _iLast.Action += new ToolItemAction(EH_Paging); // Other statements: _ctlToolStrip.PageSet = _setCollection; _ctlToolStrip.SelectedPage = _pEdit; _iGroups.Type = StripToolItemType.Button; _iZoomWnd.Type = StripToolItemType.Button; _iZoomWidth.Type = StripToolItemType.Button; _iXLS.Type = StripToolItemType.Multifunctional; _aExcelFormatted = _iXLS.AddAction(); _aExcelFormatted.Action += new ToolItemAction(EH_ExportExcelAction); _aExcelDataOnly = _iXLS.AddAction(); _aExcelDataOnly.Action += new ToolItemAction(EH_ExportExcelDataOnlyAction); this.Controls.Add(_ctlToolStrip); //this._ctlPagesHost.Location = new System.Drawing.Point(0, _ctlToolStrip.Bottom); this.ResumeLayout(false); }
protected override void OnPaint(PaintEventArgs aPArgs) { int lCurrW = 0, lAllW = 0; GraphicsPath lPath = lPath = buildArrow(12, 0, 64, this.ClientSize.Height - _PagesH); Graphics lGraph = aPArgs.Graphics; lGraph.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; StringFormat lStrFormat = new StringFormat(); lStrFormat.Alignment = StringAlignment.Center; lStrFormat.LineAlignment = StringAlignment.Center; // Brush lbrPages = new SolidBrush(_PColor); LinearGradientBrush lbrPages = new LinearGradientBrush( new Rectangle(0, 0, this.Width, _PagesH + 16), Graph.ColorTools.SetBrightness((byte)(Graph.ColorTools.RGB2HSB(_PColor).Brightness / 3), _PColor), _PColor, 90 ); Brush lbrHlPage = new SolidBrush(_PColor); Brush lbrToolStrip = new SolidBrush(Color.White); Brush lTextBrush = new SolidBrush(Color.Black); Pen lPen = new Pen(Color.Black); lGraph.SmoothingMode = SmoothingMode.None; if (_ToolBG != null) { for (int iX = 0; iX < this.Width; iX += _ToolBG.Size.Width) { lGraph.DrawImage( _ToolBG, new Rectangle(iX, 0, _ToolBG.Width, _ToolBG.Height), new Rectangle(0, 0, _ToolBG.Width, _ToolBG.Height), GraphicsUnit.Pixel ); } } else { LinearGradientBrush lbrStrip = new LinearGradientBrush( new Rectangle(0, 0, this.ClientSize.Height - PagesHeight, this.ClientSize.Height - PagesHeight), Color.Black, Color.Black, 90, false ); ColorBlend lbrBlend = new ColorBlend(4); lbrBlend.Colors = new Color[] { Color.FromArgb(0xff, 0xff, 0xff), Color.FromArgb(0xe9, 0xe9, 0xe9), Color.FromArgb(0xb9, 0xb9, 0xb9), Color.FromArgb(0x7b, 0x7b, 0x7b) }; lbrBlend.Positions = new float[] { 0.0f, 0.45f, 0.45f, 1f }; lbrStrip.InterpolationColors = lbrBlend; lGraph.FillRectangle(lbrStrip, 0, 0, this.ClientSize.Width, this.ClientSize.Height - PagesHeight); } #if DEMO Font myFont = new Font("Arial", 20.25F, ((FontStyle)((FontStyle.Bold | FontStyle.Italic))), GraphicsUnit.Point, ((byte)(238))); Brush myBrush = new SolidBrush(Color.FromArgb(20, Color.Black)); SizeF myStrSize = lGraph.MeasureString("This is a non-commercial DEMO", myFont); int lLeft = this.ClientSize.Width - (int)(myStrSize.Width) - 32; int lTop = (this._ToolBG.Height - (int)(myStrSize.Height)) / 2; lGraph.DrawString("This is a non-commercial DEMO", myFont, myBrush, lLeft, lTop); #endif lGraph.SmoothingMode = SmoothingMode.HighQuality; lGraph.FillRectangle(lbrPages, 0, this.ClientSize.Height - PagesHeight, this.ClientSize.Width, PagesHeight); // Draw pages: lTextBrush = new SolidBrush(Color.White); for (int i = 0; i < _ToolPages.Count; i++) { StripToolPage lCurrPage = getItem(i); if (!lCurrPage.Visible) { continue; } lCurrW = (int)((lGraph.MeasureString(lCurrPage.Title, this.Font)).Width); lCurrW += 2 * DEF_ITEMMARGIN; RectangleF lLayout = new Rectangle(); lLayout.Size = new Size(lCurrW, _PagesH); lLayout.Location = new Point(lAllW + 1, this.ClientSize.Height - _PagesH + 1); if (_Highlighted == i) { Brush lbrHLighted = new SolidBrush(ColorTools.SetAlpha(ControlProperties.HiglightingRate, Color.White)); lGraph.FillRectangle(lbrHLighted, lAllW, PagesTop, lCurrW, _PagesH); } lGraph.SmoothingMode = SmoothingMode.AntiAlias; lGraph.DrawString(lCurrPage.Title, this.Font, new SolidBrush(Graph.ColorTools.SetAlpha(128, Color.Black)), lLayout, lStrFormat); lLayout.Location = new Point(lAllW, this.ClientSize.Height - _PagesH); lGraph.DrawString(lCurrPage.Title, this.Font, lTextBrush, lLayout, lStrFormat); if (_Selected == i) { lPath = buildArrow(12, lAllW, lCurrW, this.ClientSize.Height - _PagesH); } lAllW += lCurrW; } lGraph.SmoothingMode = SmoothingMode.None; lGraph.FillPath(lbrToolStrip, lPath); lGraph.SmoothingMode = SmoothingMode.HighQuality; //lGraph.DrawPath(lPen, buildBorder(lPath)); //lGraph.DrawLine(lPen, 0, 0, 0, this.Height); //lGraph.DrawLine(lPen, this.ClientRectangle.Width, 0, this.ClientRectangle.Width, this.Height); if (getItem(_Selected) != null) { getItem(_Selected).DrawPage(lGraph, new Size(this.ClientSize.Width, PagesTop)); } }
public void Remove(StripToolPage aPage) { if (_List.IndexOf(aPage) > -1) _List.Remove(aPage); }
public void DrawGroup(Graphics aGraph, Point aLocation, StripToolPage aSender) { Pen lPen = new Pen(Color.Black); int lLeft = aLocation.X + aSender.ToolStrip.IconSpacing / 2; int lTop = aLocation.Y + aSender.ToolStrip.IconSpacing / 2; int lSpacing = aSender.ToolStrip.IconSpacing; int lHeight = aSender.ToolStrip.IconSize.Height; foreach (StripToolItem iItem in _Items) { int lWidth = iItem.GetWidth(); iItem.DrawTo( aGraph, new Point(lLeft, lTop), new Size(lWidth, aSender.ToolStrip.IconSize.Height), lSpacing, this._Highlighted == iItem ); lLeft += lWidth + aSender.ToolStrip.IconSpacing; } }