123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- using System.Windows.Forms;
- using System.ComponentModel;
- using FastReport.Forms;
- namespace FastReport.Design.PageDesigners
- {
- #if !DEBUG
- [DesignTimeVisible(false)]
- #endif
- internal class PageDesignerBase : Panel, IDesignerPlugin
- {
- #region Fields
- private Designer designer;
- private PageBase page;
- private bool locked;
- private bool isInsertingObject;
- #endregion
- #region Properties
- public PageBase Page
- {
- get { return page; }
- set { page = value; }
- }
- public Designer Designer
- {
- get { return designer; }
- }
- public bool Locked
- {
- get { return locked; }
- }
- public bool IsInsertingObject
- {
- get { return isInsertingObject; }
- set { isInsertingObject = value; }
- }
- public Report Report
- {
- get { return Page.Report; }
- }
- public string PluginName
- {
- get { return Name; }
- }
- public virtual float Zoom
- {
- get { return 1; }
- set { }
- }
- #endregion
- #region Public Methods
- // this method is called when the page becomes active. You may, for example, modify the main menu
- // in this method.
- public virtual void PageActivated()
- {
- }
- // this method is called when the page becomes inactive. You should remove items added to the main menu
- // in this method.
- public virtual void PageDeactivated()
- {
- }
- public virtual void FillObjects(bool resetSelection)
- {
- Designer.Objects.Clear();
- Designer.Objects.Add(Page.Report);
- Designer.Objects.Add(Page);
- foreach (Base b in Page.AllObjects)
- {
- Designer.Objects.Add(b);
- }
- if (resetSelection)
- {
- Designer.SelectedObjects.Clear();
- Designer.SelectedObjects.Add(Page);
- }
- }
- public virtual void Paste(ObjectCollection list, InsertFrom source)
- {
- }
- public virtual void CancelPaste()
- {
- }
- public virtual void SelectAll()
- {
- }
- public virtual void ZoomPageWidth()
- {
- }
- public virtual void ZoomWholePage()
- {
- }
- protected override void Dispose(bool disposing)
- {
- base.Dispose(disposing);
- if (disposing)
- SaveState();
- }
- #endregion
- #region IDesignerPlugin
- public virtual void Localize()
- {
- }
- public virtual void SaveState()
- {
- }
- public virtual void RestoreState()
- {
- }
- public virtual void SelectionChanged()
- {
- }
- public virtual void UpdateContent()
- {
- }
- public virtual void Lock()
- {
- locked = true;
- }
- public virtual void Unlock()
- {
- locked = false;
- UpdateContent();
- }
- public virtual DesignerOptionsPage GetOptionsPage()
- {
- return null;
- }
- public virtual void UpdateUIStyle()
- {
- }
- public virtual void UpdateDpiDependencies()
- {
- }
- #endregion
- public PageDesignerBase(Designer designer) : base()
- {
- this.designer = designer;
- isInsertingObject = false;
- }
- }
- }
|