/// <inheritdoc/> public override void Invoke() { foreach (DocumentWindow c in Designer.Documents) { if (c is StartPageTab) { c.Activate(); return; } } Designer.AddStartPageTab(); }
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; }
/// <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++; } } }
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); }
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(); }
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(); } } }
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); }
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; }
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; } }
/// <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(); } }
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); }
internal FormatPainterCommand(Designer designer) : base(designer) { }
internal PasteCommand(Designer designer) : base(designer) { }
internal CopyCommand(Designer designer) : base(designer) { }
internal CutCommand(Designer designer) : base(designer) { }
internal RedoCommand(Designer designer) : base(designer) { }
internal void SetModified(string action) { Designer.SetModified(FSender, action); }
internal ReportSettingsCommand(Designer designer) : base(designer) { }
internal FindCommand(Designer designer) : base(designer) { IsReplace = false; }
internal UngroupCommand(Designer designer) : base(designer) { }
internal SaveAllCommand(Designer designer) : base(designer) { }
internal OpenCommand(Designer designer) : base(designer) { }
internal DeletePageCommand(Designer designer) : base(designer) { }
internal PrinterSettingsCommand(Designer designer) : base(designer) { }
internal SelectAllCommand(Designer designer) : base(designer) { }
internal NewDialogCommand(Designer designer) : base(designer) { }
internal EditCommand(Designer designer) : base(designer) { }
internal CloseAllCommand(Designer designer) : base(designer) { }
internal ReplaceCommand(Designer designer) : base(designer) { IsReplace = true; }
internal PreviewCommand(Designer designer) : base(designer) { }