View Panes

From Apache OpenOffice Wiki
Jump to: navigation, search

The service represents a pane in a view that shows a rectangular area of the document. The exposed area of a view pane always starts at a cell boundary. The interface's getFirstVisibleColumn(), getFirstVisibleRow(), setFirstVisibleColumn() and setFirstVisibleRow() methods query and set the start of the exposed area. The getVisibleRange() method returns a struct describing which cells are shown in the pane. Columns or rows that are only partly visible at the right or lower edge of the view are not included.

The interface gives direct access to the same cell range of exposed cells that are addressed by the getVisibleRange() return value.

The interface's getControl() method gives access to a control model's control for the view pane. Refer to the chapter Models and Views for additional information.

The example below retrieves the cell range that is shown in the second pane. It is the lower left one after freezing both columns and rows, and assigns a cell background:

 // get the cell range shown in the second pane and assign a cell background to them xIndex = (
     UnoRuntime.queryInterface(, xController);
 Object aPane = xIndex.getByIndex(1); xRefer = (
     UnoRuntime.queryInterface(, aPane); xRange = xRefer.getReferredCells(); xRangeProp = (
     UnoRuntime.queryInterface(, xRange);
 xRangeProp.setPropertyValue("IsCellBackgroundTransparent", new Boolean(false));
 xRangeProp.setPropertyValue("CellBackColor", new Integer(0xFFFFCC));

The index container provides the available panes in a specific order, depending on how the view has been split.

Index No split Vertical split Horizontal split (*) Vertical and horizontal split (*)
0 Entire window Top pane Left pane Top left pane
1 -- Bottom pane Right pane Bottom left pane
2 -- -- -- Top right pane
3 -- -- -- Bottom right pane

(*) If the sheet is in right-to-left layout mode, the panes are swapped too (e.g., pane 0 would be the right pane or the top right pane).

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages