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

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

问题描述

我想要一个3D"电子表格,目的是在普通 2D 单元格中包含主要条目,然后在每个单元格上方的第三维中(可能同样重要)条目.这是多张纸已经允许的,问题是我不能轻易地一次看到所有的第 3 维单元格.

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.

如果这是不可能的,但有人对不同的解决方案有建议(即使使用不同的程序(在 Linux 上))那就太好了.

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

要使其工作,请转到 Tools ->自定义.在事件"选项卡中,将 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<的监听器/a> 界面.

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

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

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