Class: Axlsx::Pane

Inherits:
Object
  • Object
show all
Includes:
OptionsParser, SerializedAttributes
Defined in:
lib/axlsx/workbook/worksheet/pane.rb

Overview

Note:

The recommended way to manage the pane options is via SheetView#pane

Pane options for a worksheet.

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SerializedAttributes

included, #serialized_attributes, #serialized_element_attributes, #serialized_tag

Methods included from OptionsParser

#parse_options

Constructor Details

#initialize(options = {}) ⇒ Pane

Creates a new Axlsx::Pane object

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • active_pane (Symbol)

    Active Pane

  • state (Symbol)

    Split State

  • top_left_cell (Cell, String)

    Top Left Visible Cell

  • x_split (Integer)

    Horizontal Split Position

  • y_split (Integer)

    Vertical Split Position



17
18
19
20
21
22
# File 'lib/axlsx/workbook/worksheet/pane.rb', line 17

def initialize(options = {})
  # defaults
  @active_pane = @state = @top_left_cell = nil
  @x_split = @y_split = 0
  parse_options options
end

Instance Attribute Details

#active_paneSymbol

Active Pane The pane that is active. Options are

  • bottom_left: Bottom left pane, when both vertical and horizontal splits are applied. This value is also used when only a horizontal split has been applied, dividing the pane into upper and lower regions. In that case, this value specifies the bottom pane.
  • bottom_right: Bottom right pane, when both vertical and horizontal splits are applied.
  • top_left: Top left pane, when both vertical and horizontal splits are applied. This value is also used when only a horizontal split has been applied, dividing the pane into upper and lower regions. In that case, this value specifies the top pane. This value is also used when only a vertical split has been applied, dividing the pane into right and left regions. In that case, this value specifies the left pane
  • top_right: Top right pane, when both vertical and horizontal splits are applied. This value is also used when only a vertical split has been applied, dividing the pane into right and left regions. In that case, this value specifies the right pane. default nil

Returns:

  • (Symbol)

See Also:

  • type


51
52
53
# File 'lib/axlsx/workbook/worksheet/pane.rb', line 51

def active_pane
  @active_pane
end

#stateSymbol

Split State Indicates whether the pane has horizontal / vertical splits, and whether those splits are frozen. Options are

  • frozen: Panes are frozen, but were not split being frozen. In this state, when the panes are unfrozen again, a single pane results, with no split. In this state, the split bars are not adjustable.
  • frozen_split: Panes are frozen and were split before being frozen. In this state, when the panes are unfrozen again, the split remains, but is adjustable.
  • split: Panes are split, but not frozen. In this state, the split bars are adjustable by the user. default nil

Returns:

  • (Symbol)

See Also:

  • type


69
70
71
# File 'lib/axlsx/workbook/worksheet/pane.rb', line 69

def state
  @state
end

#top_left_cellString

Top Left Visible Cell Location of the top left visible cell in the bottom right pane (when in Left-To-Right mode). default nil

Returns:

  • (String)

See Also:

  • type


77
78
79
# File 'lib/axlsx/workbook/worksheet/pane.rb', line 77

def top_left_cell
  @top_left_cell
end

#x_splitInteger

Horizontal Split Position Horizontal position of the split, in 1/20th of a point; 0 (zero) if none. If the pane is frozen, this value indicates the number of columns visible in the top pane. default 0

Returns:

  • (Integer)

See Also:

  • type


86
87
88
# File 'lib/axlsx/workbook/worksheet/pane.rb', line 86

def x_split
  @x_split
end

#y_splitInteger

Vertical Split Position Vertical position of the split, in 1/20th of a point; 0 (zero) if none. If the pane is frozen, this value indicates the number of rows visible in the left pane. default 0

Returns:

  • (Integer)

See Also:

  • type


95
96
97
# File 'lib/axlsx/workbook/worksheet/pane.rb', line 95

def y_split
  @y_split
end

Instance Method Details

#to_xml_string(str = +'')) ⇒ String

Serializes the data validation

Parameters:

  • str (String) (defaults to: +''))

Returns:

  • (String)


131
132
133
134
# File 'lib/axlsx/workbook/worksheet/pane.rb', line 131

def to_xml_string(str = +'')
  finalize
  serialized_tag 'pane', str
end