Window1.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Runtime.InteropServices;
  5. using Biff8Excel.Interfaces;
  6. namespace Biff8Excel.Records
  7. {
  8. [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)]
  9. struct RecordWindows1
  10. {
  11. public ushort opcode;
  12. public ushort length;
  13. public ushort h_hold;
  14. public ushort v_hold;
  15. public ushort width;
  16. public ushort height;
  17. public ushort options;
  18. public ushort selectedtab;
  19. public ushort displayedtab;
  20. public ushort numselectedtabs;
  21. public ushort tabwidthratio;
  22. }
  23. internal class Windows1 : IRecords
  24. {
  25. RecordWindows1 windows1;
  26. public Windows1()
  27. {
  28. windows1.opcode = 0x3D;
  29. windows1.length = 0x12;
  30. windows1.options = 0x0;
  31. windows1.h_hold = 0x0;
  32. windows1.v_hold = 0x0;
  33. windows1.width = 0x3C00;
  34. windows1.height = 0x2D00;
  35. windows1.selectedtab = 0x0;
  36. windows1.displayedtab = 0x0;
  37. windows1.numselectedtabs = 0x1;
  38. windows1.tabwidthratio = 0x258;
  39. }
  40. public ushort ID
  41. {
  42. get { return windows1.opcode; }
  43. }
  44. public ushort RecordSize
  45. {
  46. get { return 22; }
  47. }
  48. public ushort HorizontalPosition
  49. {
  50. set { windows1.h_hold = value; }
  51. }
  52. public ushort VerticalPosition
  53. {
  54. set { windows1.v_hold = value; }
  55. }
  56. public ushort Width
  57. {
  58. set { windows1.width = value; }
  59. }
  60. public ushort Height
  61. {
  62. set { windows1.height = value; }
  63. }
  64. public ushort ActivewWorksheet
  65. {
  66. set { windows1.selectedtab = value; }
  67. }
  68. public ushort FirstVisibleWorksheet
  69. {
  70. set { windows1.displayedtab = value; }
  71. }
  72. public ushort SelectedWorksheets
  73. {
  74. set { windows1.numselectedtabs = value; }
  75. }
  76. public ushort TabWidth
  77. {
  78. set { windows1.tabwidthratio = value; }
  79. }
  80. public bool WindowsHidden
  81. {
  82. set { if (value) windows1.options = (ushort)(windows1.options | 0x1); }
  83. }
  84. internal bool Iconic
  85. {
  86. set { if (value) windows1.options = (ushort)(windows1.options | 0x2); }
  87. }
  88. public bool HorizontalScrollBar
  89. {
  90. set { if (value) windows1.options = (ushort)(windows1.options | 0x8); }
  91. }
  92. public bool VerticalScrollBar
  93. {
  94. set { if (value) windows1.options = (ushort)(windows1.options | 0x10); }
  95. }
  96. public bool DisplayTabsAtBottom
  97. {
  98. set { if (value) windows1.options = (ushort)(windows1.options | 0x20); }
  99. }
  100. #region IRecords ³ÉÔ±
  101. public byte[] GetByte()
  102. {
  103. return Globals.GetStructToBytes(windows1);
  104. }
  105. #endregion
  106. }
  107. }