public void Remove(StripToolGroup aGroup) { if (_Groups.IndexOf(aGroup) >= 0) { _Groups.Remove(aGroup); } UpdateControl(); }
public void Redraw() { foreach (object iGroup in _Hosts) { StripToolGroup lGroup = (StripToolGroup)iGroup; lGroup.Redraw(); } }
public StripToolGroup Add(StripToolGroup aGroup) { if (_Groups.IndexOf(aGroup) < 0) { _Groups.Add(aGroup); aGroup.setPage(this, true); } UpdateControl(); return(aGroup); }
protected internal void setGroup(StripToolGroup aGroup, bool aAdd) { if (aAdd) { if (_Hosts.IndexOf(aGroup) < 0) { _Hosts.Add(aGroup); } } else { if (_Hosts.IndexOf(aGroup) > -1) { _Hosts.Remove(aGroup); aGroup.Remove(this); } } }
protected internal void setGroup(StripToolGroup aGroup, bool aAdd) { if (aAdd) { if (_Hosts.IndexOf(aGroup) < 0) _Hosts.Add(aGroup); } else { if (_Hosts.IndexOf(aGroup) > -1) { _Hosts.Remove(aGroup); aGroup.Remove(this); } } }
public StripToolGroup Add(StripToolGroup aGroup) { if (_Groups.IndexOf(aGroup) < 0) { _Groups.Add(aGroup); aGroup.setPage(this, true); } UpdateControl(); return aGroup; }
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); }