Esempio n. 1
0
 public StripToolPage(CPagedToolStrip aToolStrip, string aTitle)
 {
     ToolStrip = aToolStrip;
     _Title = aTitle;
     _Groups = new ArrayList();
     _Visible = true;
 }
Esempio n. 2
0
 public StripToolItem(CPagedToolStrip aToolStrip, Image aImage)
 {
     Initialize(aToolStrip);
     Glyph = aImage;
 }
Esempio n. 3
0
 public StripToolItem(CPagedToolStrip aToolStrip)
 {
     Initialize(aToolStrip);
 }
Esempio n. 4
0
 protected void Initialize(CPagedToolStrip aToolStrip)
 {
     ToolStrip = aToolStrip;
     _Hosts = new ArrayList();
     Actions = new List<StripToolItem.StripToolItemAction>();
 }
Esempio n. 5
0
 public void Release()
 {
     _List.Clear();
     _Host = null;
 }
Esempio n. 6
0
 public StripToolPageset(CPagedToolStrip aHost)
 {
     _Host = aHost;
     _List = new ArrayList();
 }
Esempio n. 7
0
 protected internal void setHost(CPagedToolStrip aHost)
 {
     ToolStrip = aHost;
     UpdateControl();
 }
        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);
        }
Esempio n. 9
0
 public StripToolGroup(CPagedToolStrip aToolStrip)
 {
     ToolStrip = aToolStrip;
     _HostPages = new ArrayList();
     _Items = new List<StripToolItem>();
 }
Esempio n. 10
0
        protected int getWidth(CPagedToolStrip lToolStrip)
        {
            int lResult = lToolStrip.IconSpacing;

            for (int i = 0; i < _Items.Count; i++)
            {
                lResult += this[i].GetWidth();
            }

            lResult += (_Items.Count - 1) * lToolStrip.IconSpacing;

            return lResult;
        }
Esempio n. 11
0
 public Size GetGroupSize(CPagedToolStrip lToolStrip)
 {
     return new Size(getWidth(lToolStrip), lToolStrip.IconSize.Height + 8);
 }