OO-Snippets: SplitView

Commons

Keywords
LanguageooRexx
ApplicationCalc
AuthorsMichael hinz (initial)
Supported Versions2.0.x  
Supported OSWin32  
QuestionHow can i split the view in four tiles
Answer

Code-Snippet-Listing (snippet-source)

/* get the desktop  (an Xdesktop object) */
oDesktop = UNO.createDesktop()   
xComponentLoader = oDesktop~XDesktop~XComponentLoader      --get componentLoader interface
                                                      
/* open a blank calc file */
url = "private:factory/scalc"
xCalcComponent = xComponentLoader~loadComponentFromURL(url, "_blank", 0, .UNO~noProps)


/* get first  and third sheet in spreadsheet */
xDocument = xCalcComponent~XSpreadSheetDocument
xSheet = xDocument~getSheets~XIndexAccess~getByIndex(0)~XSpreadSheet
xSheet1 = xDocument~getSheets~XIndexAccess~getByIndex(2)~XSpreadSheet

/*get controller from the Xmodel to manipulate view*/
xController = xDocument~XModel~getCurrentController

CALL syssleep 5

/*focus on new sheet and split view*/
xSpreadsheetView = xController~xSpreadsheetView~setActiveSheet(xSheet1)
xSpreadsheetsplit = xController~XViewSplitable~splitAtPosition(400, 200)

::requires UNO.CLS                    -- get UNO support

Changelog

DateUserModification

and