如何将所有工作表一起滚动(或其他类似3D的想法) [英] How to scroll all sheets together (or other ~3D-like ideas)

查看:123
本文介绍了如何将所有工作表一起滚动(或其他类似3D的想法)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个 3D电子表格,其目的是在普通2D单元格中具有主要条目,然后在每个单元格上方的第三维中具有(可能是重要的)条目。这就是多张工作表已经允许的问题,问题是我无法轻易一次看到所有3D单元。

I would like a "3D" spreadsheet, with the aim of having main entries in the normal 2D cells and then (potentially just-as-important) entries in a third dimension above each cell. This is what the multiple sheets already allow for, the problem is that I cannot easily see all the 3rd dimension cells at once.

我最初是希望找到一些复杂的方法使用实际的3D图纸,但到目前为止还没有运气。我意识到,如果我只能确保其他工作表与我的第一工作表对齐,那么这已经足够了,因此我可以通过在工作表之间进行切换来沿第三个维度滚动。

I was first hoping to find some sophisticated method of using actual 3D sheets but with no luck so far. I realised that if I could only make sure the other sheets would line up with my first sheet then that would be good enough, so I could "scroll" along the third dimension by switching between sheets.

那么,有什么办法可以将所有工作表一起滚动吗?

So, is there any way to scroll all the sheets together?

如果我向下滚动工作表1看到单元格123 A,那么我切换到工作表2,单元格123 A在屏幕上的相同位置,依此类推,在工作表3及更高版本上保持不变。

Such that if I scroll down on sheet 1 to see cell 123 A, when I switch to sheet 2, cell 123 A is in the same position on the screen, and so on for sheets 3 and up.

如果这不可能,但有人提出建议

If this is impossible but anyone has suggestions for a different solution (even using a different program (on Linux)) that would be great.

推荐答案

这是一个完整的工作OpenOffice Basic中的解决方案:

Here is a complete working solution in OpenOffice Basic:

Global OldSheet As Object
Global HandlingActivationEvent As Boolean

Sub RegisterMyActivationEventListener
    oListener = CreateUnoListener( _
        "ActivListener_", "com.sun.star.sheet.XActivationEventListener" )
    oController = ThisComponent.CurrentController
    oController.addActivationEventListener(oListener)
    OldSheet = oController.ActiveSheet
    HandlingActivationEvent = False
    MsgBox "Now Listening"
End Sub

Sub ActivListener_activeSpreadsheetChanged( oEvent )
    If HandlingActivationEvent Then
        Exit Sub
    End If
    HandlingActivationEvent = True
    oController = ThisComponent.CurrentController
    newSheet = oController.ActiveSheet
    oController.setActiveSheet(OldSheet)

    col = oController.getFirstVisibleColumn()
    row = oController.getFirstVisibleRow()
    oController.setActiveSheet(newSheet)
    oController.setFirstVisibleColumn(col)
    oController.setFirstVisibleRow(row)

    'MsgBox col & ", " & row
    OldSheet = newSheet
    HandlingActivationEvent = False
End Sub

要使其正常运行,请转到工具->自定义。在事件选项卡中,将 RegisterMyActivationEventListener 分配给 Open Document 事件。

To make it work, go to Tools -> Customize. In the Events tab, assign RegisterMyActivationEventListener to the Open Document event.

代码解释

不要在同一页面上滚动工作表时间,只要激活其他工作表,它就会滚动到相应的单元格。它使用 XViewPane 界面

Instead of scrolling the sheets at the same time, it just scrolls to the appropriate cell whenever a different sheet is activated. It uses the XViewPane interface to see where the previous sheet is scrolled, and scrolls the next sheet to that same spot.

要了解何时激活工作表,代码使用事件监听器,用于 XActivationEventListener 接口。

To find out when a sheet gets activated, the code uses an event listener for the XActivationEventListener interface.

这篇关于如何将所有工作表一起滚动(或其他类似3D的想法)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆