123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Windows.Forms;
- using System.Drawing;
- #if !MONO
- using FastReport.DevComponents.DotNetBar;
- #else
- using FastReport.Controls;
- #endif
- namespace FastReport.Design
- {
- #if !MONO
- internal class DocumentWindow : TabItem
- {
- public Control ParentControl
- {
- get { return AttachedControl; }
- }
- public void AddToTabControl(FastReport.DevComponents.DotNetBar.TabControl tabs)
- {
- TabControlPanel panel = AttachedControl as TabControlPanel;
- tabs.Tabs.Add(this);
- tabs.Controls.Add(panel);
- tabs.ApplyDefaultPanelStyle(panel);
- panel.Padding = new System.Windows.Forms.Padding(0);
- if (tabs.Style == eTabStripStyle.VS2005Document)
- {
- panel.Style.BorderSide = eBorderSide.Bottom;
- panel.Padding = new System.Windows.Forms.Padding(0, 0, 0, 1);
- panel.Style.BorderColor.Color = SystemColors.ControlDark;
- }
- }
- public void Activate()
- {
- Parent.SelectedTab = this;
- }
- public void Close()
- {
- Parent.Tabs.Remove(this);
- Dispose();
- }
- public virtual void Localize()
- {
- }
- public virtual void UpdateDpiDependencies()
- {
- }
- public virtual void UpdateUIStyle()
- {
- }
- public DocumentWindow()
- {
- TabControlPanel panel = new TabControlPanel();
- // size is required in order to restore splitter distance correctly
- panel.Size = new Size(1000, 500);
- panel.Dock = DockStyle.Fill;
- panel.TabItem = this;
- AttachedControl = panel;
- }
- }
- #else
- internal class DocumentWindow : PageControlPage
- {
- private FRTabControl parent;
- public Control ParentControl
- {
- get { return parent; }
- }
- public void AddToTabControl(FRTabControl tabs)
- {
- tabs.Tabs.Add(this);
- parent = tabs;
- }
- public void Activate()
- {
- parent.SelectedTab = this;
- }
- public void Close()
- {
- parent.Tabs.Remove(this);
- Dispose();
- }
- public virtual void Localize()
- {
- }
- public virtual void UpdateDpiDependencies()
- {
- }
- public virtual void UpdateUIStyle()
- {
- }
- public DocumentWindow()
- {
- Dock = DockStyle.Fill;
- }
- }
- #endif
- }
|