def store_window2   #:nodoc:
    record         = 0x023E     # Record identifier
    length         = 0x0012     # Number of bytes to follow

    grbit          = 0x00B6     # Option flags
    rwTop          = @first_row   # Top visible row
    colLeft        = @first_col   # Leftmost visible column
    rgbHdr         = 0x00000040            # Row/col heading, grid color

    wScaleSLV      = 0x0000                # Zoom in page break preview
    wScaleNormal   = 0x0000                # Zoom in normal view
    reserved       = 0x00000000


    # The options flags that comprise $grbit
    fDspFmla       = @display_formulas # 0 - bit
    fDspGrid       = @screen_gridlines # 1
    fDspRwCol      = @display_headers  # 2
    fFrozen        = frozen? ? 1 : 0   # 3
    fDspZeros      = display_zeros? ? 1 : 0   # 4
    fDefaultHdr    = 1                 # 5
    fArabic        = @display_arabic || 0  # 6
    fDspGuts       = @outline.visible? ? 1 : 0       # 7
    fFrozenNoSplit = @frozen_no_split  # 0 - bit
    fSelected      = selected? ? 1 : 0 # 1
    fPaged         = active? ?   1 : 0 # 2
    fBreakPreview  = 0                # 3

    grbit             = fDspFmla
    grbit            |= fDspGrid       << 1
    grbit            |= fDspRwCol      << 2
    grbit            |= fFrozen        << 3
    grbit            |= fDspZeros      << 4
    grbit            |= fDefaultHdr    << 5
    grbit            |= fArabic        << 6
    grbit            |= fDspGuts       << 7
    grbit            |= fFrozenNoSplit << 8
    grbit            |= fSelected      << 9
    grbit            |= fPaged         << 10
    grbit            |= fBreakPreview  << 11

    header = [record, length].pack("vv")
    data    =[grbit, rwTop, colLeft, rgbHdr, wScaleSLV, wScaleNormal, reserved].pack("vvvVvvV")

    append(header, data)
  end
def store_window2   #:nodoc:
    record         = 0x023E     # Record identifier
    length         = 0x0012     # Number of bytes to follow

    grbit          = 0x00B6     # Option flags
    rwTop          = @first_row   # Top visible row
    colLeft        = @first_col   # Leftmost visible column
    rgbHdr         = 0x00000040            # Row/col heading, grid color

    wScaleSLV      = 0x0000                # Zoom in page break preview
    wScaleNormal   = 0x0000                # Zoom in normal view
    reserved       = 0x00000000


    # The options flags that comprise $grbit
    fDspFmla       = @display_formulas # 0 - bit
    fDspGrid       = @screen_gridlines # 1
    fDspRwCol      = @display_headers  # 2
    fFrozen        = frozen? ? 1 : 0   # 3
    fDspZeros      = display_zeros? ? 1 : 0   # 4
    fDefaultHdr    = 1                 # 5
    fArabic        = @display_arabic || 0  # 6
    fDspGuts       = @outline.visible? ? 1 : 0       # 7
    fFrozenNoSplit = @frozen_no_split  # 0 - bit
    fSelected      = selected? ? 1 : 0 # 1
    fPaged         = active? ?   1 : 0 # 2
    fBreakPreview  = 0                # 3

    grbit             = fDspFmla
    grbit            |= fDspGrid       << 1
    grbit            |= fDspRwCol      << 2
    grbit            |= fFrozen        << 3
    grbit            |= fDspZeros      << 4
    grbit            |= fDefaultHdr    << 5
    grbit            |= fArabic        << 6
    grbit            |= fDspGuts       << 7
    grbit            |= fFrozenNoSplit << 8
    grbit            |= fSelected      << 9
    grbit            |= fPaged         << 10
    grbit            |= fBreakPreview  << 11

    header = [record, length].pack("vv")
    data    =[grbit, rwTop, colLeft, rgbHdr, wScaleSLV, wScaleNormal, reserved].pack("vvvVvvV")

    append(header, data)
  end
Write BIFF record Window2.