Ejemplo n.º 1
0
 /// <inheritdoc/>
 public override void Invoke()
 {
     foreach (DocumentWindow c in Designer.Documents)
     {
         if (c is StartPageTab)
         {
             c.Activate();
             return;
         }
     }
     Designer.AddStartPageTab();
 }
Ejemplo n.º 2
0
        public ObjectsToolbar(Designer designer) : base()
        {
            FDesigner       = designer;
            Name            = "ObjectsToolbar";
            Font            = DrawUtils.Default96Font;
            Dock            = DockStyle.Left;
            DockOrientation = eOrientation.Vertical;
            RoundCorners    = false;

            CreateSelectBtn();
            Localize();
            Parent = Designer.DotNetBarManager.ToolbarLeftDockSite;
        }
Ejemplo n.º 3
0
        /// <inheritdoc/>
        public override void Invoke()
        {
            int i = 0;

            while (i < Designer.Documents.Count)
            {
                DocumentWindow c = Designer.Documents[i];
                if (c is StartPageTab || !Designer.CloseDocument(c))
                {
                    i++;
                }
            }
        }
Ejemplo n.º 4
0
        private void button_Click(object sender, EventArgs e)
        {
            Designer.FormatPainter = false;
            if (!Designer.cmdInsert.Enabled)
            {
                return;
            }

            ResetButtons();
            if (sender is ButtonItem && (sender as ButtonItem).IsOnBar)
            {
                (sender as ButtonItem).Checked = true;
            }
            FNowInserting = (sender as ButtonItem).Tag as ObjectInfo;
            Designer.InsertObject(FNowInserting, InsertFrom.NewObject);
        }
Ejemplo n.º 5
0
        public void Redo(int actionsCount)
        {
            int i = ActivePageIndex;

            if (i == 0)
            {
                Editor.Source.Redo();
                return;
            }

            Designer.Lock();
            UndoRedo.GetRedo(actionsCount);
            Script = Report.ScriptText;
            InitPages(i);
            Designer.Unlock();
        }
Ejemplo n.º 6
0
 private void DoClickSelectButton(bool ignoreMultiInsert)
 {
     if (!btnSelect.Checked)
     {
         if (FNowInserting != null && FNowInserting.MultiInsert && !ignoreMultiInsert)
         {
             Designer.InsertObject(FNowInserting, InsertFrom.NewObject);
         }
         else
         {
             ResetButtons();
             btnSelect.Checked = true;
             Designer.ActiveReportTab.ActivePageDesigner.CancelPaste();
         }
     }
 }
Ejemplo n.º 7
0
        public bool LoadFile(string fileName)
        {
            OpenSaveDialogEventArgs e = new OpenSaveDialogEventArgs(Designer);

            // empty fileName: user pressed "Open" button, show open dialog.
            // non-empty fileName: user choosed a report from recent file list, just load the specified report.
            if (String.IsNullOrEmpty(fileName))
            {
                Config.DesignerSettings.OnCustomOpenDialog(Designer, e);
                if (e.Cancel)
                {
                    return(false);
                }
                fileName = e.FileName;
            }

            bool result = SaveCurrentFile();

            if (result)
            {
                try
                {
                    Designer.Lock();
                    OpenSaveReportEventArgs e1 = new OpenSaveReportEventArgs(Report, fileName, e.Data, false);
                    Config.DesignerSettings.OnCustomOpenReport(Designer, e1);
                    Report.FileName = fileName;
                    Designer.cmdRecentFiles.Update(fileName);
                    Config.DesignerSettings.OnReportLoaded(this, new ReportLoadedEventArgs(Report));
                    result = true;
                }
#if !DEBUG
                catch (Exception ex)
                {
                    EmptyReport(false);
                    FRMessageBox.Error(String.Format(Res.Get("Messages,CantLoadReport") + "\r\n" + ex.Message, fileName));
                    result = false;
                }
#endif
                finally
                {
                    InitReport();
                    Designer.Unlock();
                }
            }

            return(result);
        }
Ejemplo n.º 8
0
 private void FTabs_MouseUp(object sender, MouseEventArgs e)
 {
     if (FTabMoved)
     {
         // clear pages. Do not call Clear because pages will be disposed then
         while (FReport.Pages.Count > 0)
         {
             FReport.Pages.RemoveAt(0);
         }
         // add pages in new order
         foreach (TabItem tab in FTabs.Tabs)
         {
             if (tab.Tag is PageBase)
             {
                 FReport.Pages.Add(tab.Tag as PageBase);
             }
         }
         Designer.SetModified(null, "ChangePagesOrder");
     }
     FTabMoved = false;
 }
Ejemplo n.º 9
0
        internal void UpdateCaption()
        {
            Text = ReportName;
            string titleText = "";

            if (String.IsNullOrEmpty(Config.DesignerSettings.Text))
            {
                titleText = "FastReport - " + ReportName;
            }
            else
            {
                titleText = Config.DesignerSettings.Text + ReportName;
            }

            Form form = Designer.FindForm();

            if (form != null)
            {
                form.Text = titleText;
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Loads a specified report file.
        /// </summary>
        /// <param name="fileName">File to load.</param>
        public void LoadFile(string fileName)
        {
            ReportTab reportTab = null;

            if (Designer.MdiMode)
            {
                // check if file is already opened
                if (!String.IsNullOrEmpty(fileName))
                {
                    foreach (DocumentWindow c in Designer.Documents)
                    {
                        if (c is ReportTab && String.Compare((c as ReportTab).Report.FileName, fileName, true) == 0)
                        {
                            c.Activate();
                            return;
                        }
                    }
                }

                Report report = new Report();
                report.Designer = Designer;
                reportTab       = Designer.CreateReportTab(report);
            }
            else
            {
                reportTab = ActiveReportTab;
            }

            if (reportTab.LoadFile(fileName))
            {
                if (Designer.MdiMode)
                {
                    Designer.AddReportTab(reportTab);
                }
            }
            else if (Designer.MdiMode)
            {
                reportTab.Dispose();
            }
        }
Ejemplo n.º 11
0
 internal bool EmptyReport(bool askSave)
 {
     if (askSave)
     {
         if (!SaveCurrentFile())
         {
             return(false);
         }
     }
     Designer.Lock();
     try
     {
         Report.FileName = "";
         Report.Clear();
         Report.Dictionary.ReRegisterData();
         Config.DesignerSettings.OnReportLoaded(this, new ReportLoadedEventArgs(Report));
     }
     finally
     {
         InitReport();
         Designer.Unlock();
     }
     return(true);
 }
Ejemplo n.º 12
0
 internal FormatPainterCommand(Designer designer)
     : base(designer)
 {
 }
Ejemplo n.º 13
0
 internal PasteCommand(Designer designer)
     : base(designer)
 {
 }
Ejemplo n.º 14
0
 internal CopyCommand(Designer designer)
     : base(designer)
 {
 }
Ejemplo n.º 15
0
 internal CutCommand(Designer designer)
     : base(designer)
 {
 }
Ejemplo n.º 16
0
 internal RedoCommand(Designer designer)
     : base(designer)
 {
 }
Ejemplo n.º 17
0
 internal void SetModified(string action)
 {
     Designer.SetModified(FSender, action);
 }
Ejemplo n.º 18
0
 internal ReportSettingsCommand(Designer designer)
     : base(designer)
 {
 }
Ejemplo n.º 19
0
 internal FindCommand(Designer designer)
     : base(designer)
 {
     IsReplace = false;
 }
Ejemplo n.º 20
0
 internal UngroupCommand(Designer designer)
     : base(designer)
 {
 }
Ejemplo n.º 21
0
 internal SaveAllCommand(Designer designer)
     : base(designer)
 {
 }
Ejemplo n.º 22
0
 internal OpenCommand(Designer designer)
     : base(designer)
 {
 }
Ejemplo n.º 23
0
 internal DeletePageCommand(Designer designer)
     : base(designer)
 {
 }
Ejemplo n.º 24
0
 internal PrinterSettingsCommand(Designer designer)
     : base(designer)
 {
 }
Ejemplo n.º 25
0
 internal SelectAllCommand(Designer designer)
     : base(designer)
 {
 }
Ejemplo n.º 26
0
 internal NewDialogCommand(Designer designer)
     : base(designer)
 {
 }
Ejemplo n.º 27
0
 internal EditCommand(Designer designer)
     : base(designer)
 {
 }
Ejemplo n.º 28
0
 internal CloseAllCommand(Designer designer)
     : base(designer)
 {
 }
Ejemplo n.º 29
0
 internal ReplaceCommand(Designer designer)
     : base(designer)
 {
     IsReplace = true;
 }
Ejemplo n.º 30
0
 internal PreviewCommand(Designer designer)
     : base(designer)
 {
 }