using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using Biff8Excel.Interfaces; namespace Biff8Excel.Records { [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)] struct RecordWindows1 { public ushort opcode; public ushort length; public ushort h_hold; public ushort v_hold; public ushort width; public ushort height; public ushort options; public ushort selectedtab; public ushort displayedtab; public ushort numselectedtabs; public ushort tabwidthratio; } internal class Windows1 : IRecords { RecordWindows1 windows1; public Windows1() { windows1.opcode = 0x3D; windows1.length = 0x12; windows1.options = 0x0; windows1.h_hold = 0x0; windows1.v_hold = 0x0; windows1.width = 0x3C00; windows1.height = 0x2D00; windows1.selectedtab = 0x0; windows1.displayedtab = 0x0; windows1.numselectedtabs = 0x1; windows1.tabwidthratio = 0x258; } public ushort ID { get { return windows1.opcode; } } public ushort RecordSize { get { return 22; } } public ushort HorizontalPosition { set { windows1.h_hold = value; } } public ushort VerticalPosition { set { windows1.v_hold = value; } } public ushort Width { set { windows1.width = value; } } public ushort Height { set { windows1.height = value; } } public ushort ActivewWorksheet { set { windows1.selectedtab = value; } } public ushort FirstVisibleWorksheet { set { windows1.displayedtab = value; } } public ushort SelectedWorksheets { set { windows1.numselectedtabs = value; } } public ushort TabWidth { set { windows1.tabwidthratio = value; } } public bool WindowsHidden { set { if (value) windows1.options = (ushort)(windows1.options | 0x1); } } internal bool Iconic { set { if (value) windows1.options = (ushort)(windows1.options | 0x2); } } public bool HorizontalScrollBar { set { if (value) windows1.options = (ushort)(windows1.options | 0x8); } } public bool VerticalScrollBar { set { if (value) windows1.options = (ushort)(windows1.options | 0x10); } } public bool DisplayTabsAtBottom { set { if (value) windows1.options = (ushort)(windows1.options | 0x20); } } #region IRecords ³ΙΤ± public byte[] GetByte() { return Globals.GetStructToBytes(windows1); } #endregion } }