DocumentWindow.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using FastReport.DevComponents.DotNetBar;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4. namespace FastReport.Design
  5. {
  6. internal class DocumentWindow : TabItem
  7. {
  8. public Control ParentControl
  9. {
  10. get { return AttachedControl; }
  11. }
  12. public void AddToTabControl(FastReport.DevComponents.DotNetBar.TabControl tabs)
  13. {
  14. TabControlPanel panel = AttachedControl as TabControlPanel;
  15. tabs.Tabs.Add(this);
  16. tabs.Controls.Add(panel);
  17. tabs.ApplyDefaultPanelStyle(panel);
  18. panel.Padding = new System.Windows.Forms.Padding(0);
  19. if (tabs.Style == eTabStripStyle.VS2005Document)
  20. {
  21. panel.Style.BorderSide = eBorderSide.Bottom;
  22. panel.Padding = new System.Windows.Forms.Padding(0, 0, 0, 1);
  23. panel.Style.BorderColor.Color = SystemColors.ControlDark;
  24. }
  25. }
  26. public void Activate()
  27. {
  28. Parent.SelectedTab = this;
  29. }
  30. public void Close()
  31. {
  32. Parent.Tabs.Remove(this);
  33. Dispose();
  34. }
  35. public virtual void Localize()
  36. {
  37. }
  38. public virtual void UpdateDpiDependencies()
  39. {
  40. }
  41. public virtual void UpdateUIStyle()
  42. {
  43. }
  44. public DocumentWindow()
  45. {
  46. TabControlPanel panel = new TabControlPanel();
  47. // size is required in order to restore splitter distance correctly
  48. panel.Size = new Size(1000, 500);
  49. panel.Dock = DockStyle.Fill;
  50. panel.TabItem = this;
  51. AttachedControl = panel;
  52. }
  53. }
  54. }