Esempio n. 1
0
        protected void updateByPoint(Point aPoint)
        {
            StripToolItem lLastItem = HighlightedItem;

            setHiglightIcon(null);
            if (aPoint.Y > PagesTop)
            {
                _Highlighted    = getItemAt(aPoint.X);
                _ToolTip.Active = false;
            }
            else
            {
                _Highlighted = -1;
                if (getItem(_Selected) != null)
                {
                    getItem(_Selected).updateByPoint(aPoint);
                }

                if (HighlightedItem != null && HighlightedItem.Hint != "" && lLastItem != HighlightedItem)
                {
                    _ToolTip.SetToolTip(this, HighlightedItem.Hint);
                }
                _ToolTip.Active = HighlightedItem != null;
            }



            Invalidate();
        }
Esempio n. 2
0
 // Methods:
 protected internal void setHighLighted(StripToolItem aItem)
 {
     foreach (object iItem in _Groups)
     {
         ((StripToolGroup)iItem).setHighlight(aItem);
     }
 }
Esempio n. 3
0
 public void Remove(StripToolItem aItem)
 {
     if (_Items.IndexOf(aItem) > -1)
     {
         _Items.Remove(aItem);
         aItem.setGroup(this, false);
     }
 }
Esempio n. 4
0
        public StripToolItem Add(StripToolItem aItem)
        {
            if (_Items.IndexOf(aItem) < 0)
            {
                _Items.Add(aItem);
                aItem.setGroup(this, true);
            }

            return(aItem);
        }
Esempio n. 5
0
 // Methods:
 protected void setHiglightIcon(StripToolItem aIcon)
 {
     foreach (object iPage in _ToolPages)
     {
         if (getItem(_Selected) == iPage)
         {
             ((StripToolPage)iPage).setHighLighted(aIcon);
         }
         else
         {
             ((StripToolPage)iPage).setHighLighted(null);
         }
     }
 }
Esempio n. 6
0
        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;
            }
        }
        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 void EH_ZoomOut(StripToolItem aSender)
 {
     if (_CurrentView != null) _CurrentView.RptZoomOut(); UpdateRptView();
 }
Esempio n. 9
0
        public StripToolItem Add(StripToolItem aItem)
        {
            if (_Items.IndexOf(aItem) < 0)
            {
                _Items.Add(aItem);
                aItem.setGroup(this, true);
            }

            return aItem;
        }
 protected void EH_ExportXMLAction(StripToolItem aSender)
 {
     if (_CurrentView != null) _CurrentView.ExportToXML();
 }
Esempio n. 11
0
 // Methods:
 protected internal void setHighLighted(StripToolItem aItem)
 {
     foreach (object iItem in _Groups)
         ((StripToolGroup)iItem).setHighlight(aItem);
 }
 protected void EH_ExportExcelDataOnlyAction(StripToolItem aSender)
 {
     if (_CurrentView != null) _CurrentView.ExportToExcelDataOnly();
 }
 protected void EH_EditAction(StripToolItem aSender)
 {
     CollectionManagement.DoModify();
 }
 protected void EH_PrintAction(StripToolItem aSender)
 {
     if (_CurrentView != null)
         _CurrentView.PrintReport();
 }
 protected void EH_Paging(StripToolItem aSender)
 {
     if (_CurrentView != null)
     {
         if (aSender == _iFirst) { _CurrentView.ShowPage(TShowPage.spFirst); return; }
         if (aSender == _iPrev) { _CurrentView.ShowPage(TShowPage.spPrev); return; }
         if (aSender == _iNext) { _CurrentView.ShowPage(TShowPage.spNext); return; }
         if (aSender == _iLast) { _CurrentView.ShowPage(TShowPage.spLast); return; }
     }
 }
 protected void EH_OpenAction(StripToolItem aSender)
 {
     if (RsViewEngine.dlgOpenReport.ShowDialog() == DialogResult.OK)
     {
         OpenReport(
                     FileSystem.NameOf(RsViewEngine.dlgOpenReport.FileName),
                     RsViewEngine.dlgOpenReport.FileName
                 );
     }
 }
 protected void EH_Offline(StripToolItem aSender)
 {
     if (_CurrentView != null)
     {
         _CurrentView.SwitchToOffline();
         _iOffline.Enabled = false;
         _iOffline.Pushed = true;
     }
 }
 protected void EH_Mail(StripToolItem aSender)
 {
     if (_CurrentView != null) _CurrentView.SendEmail();
 }
 protected void EH_ImportAction(StripToolItem aSender)
 {
     if (RsViewEngine.dlgOpenCollection.ShowDialog() == DialogResult.OK)
         RsViewEngine.LoadCollection(RsViewEngine.dlgOpenCollection.FileName);
 }
 protected void EH_AddFolderAction(StripToolItem aSender)
 {
     CollectionManagement.DoAddFolder();
 }
 protected void EH_AddRptAction(StripToolItem aSender)
 {
     CollectionManagement.DoAddReport();
 }
 protected void EH_RefreshReport(StripToolItem aSender)
 {
     if (_CurrentView != null)
         _CurrentView.RefreshReport();
 }
 protected void EH_ExportAction(StripToolItem aSender)
 {
     //RsCollectionControl.ExportCollection(CollectionManagement.CurrentCollection);
 }
Esempio n. 24
0
        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;
            }
        }
Esempio n. 25
0
 public void Remove(StripToolItem aItem)
 {
     if (_Items.IndexOf(aItem) > -1)
     {
         _Items.Remove(aItem);
         aItem.setGroup(this, false);
     }
 }
Esempio n. 26
0
 protected internal void setHighlight(StripToolItem aItem)
 {
     _Highlighted = aItem;
 }
 protected void EH_RemoveAction(StripToolItem aSender)
 {
     CollectionManagement.DoRemove();
 }
Esempio n. 28
0
 // Methods:
 protected void setHiglightIcon(StripToolItem aIcon)
 {
     foreach (object iPage in _ToolPages)
     {
         if (getItem(_Selected) == iPage)
             ((StripToolPage)iPage).setHighLighted(aIcon);
         else
             ((StripToolPage)iPage).setHighLighted(null);
     }
 }
Esempio n. 29
0
 public StripToolItemAction(StripToolItem aItem)
 {
     Item = aItem;
 }
 protected void EH_SettingsClick(StripToolItem aSender)
 {
     _ctlPageSelector.VisiblePage = _pgSettings;
 }
        protected void EH_ShowAbout(StripToolItem aSender)
        {
            CRSAbout lAbout = new CRSAbout();

            lAbout.ShowDialog();
        }
 protected void EH_ShowGroups(StripToolItem aSender)
 {
     if (_CurrentView != null)
         _CurrentView.ShowGroups(aSender.Pushed);
 }
Esempio n. 33
0
 protected internal void setHighlight(StripToolItem aItem)
 {
     _Highlighted = aItem;
 }
Esempio n. 34
0
 public StripToolItemAction(StripToolItem aItem)
 {
     Item = aItem;
 }