GithubHelp home page GithubHelp logo

pyro-team / bkt-toolbox Goto Github PK

View Code? Open in Web Editor NEW
22.0 6.0 2.0 195.82 MB

Business Kasper Toolbox (BKT) for Microsoft Office

Home Page: https://www.bkt-toolbox.de/

License: MIT License

Python 98.91% C# 0.96% Batchfile 0.04% Inno Setup 0.09%
toolbox toolbar office powerpoint ribbon python ironpython office-addin com-interop addin

bkt-toolbox's People

Contributors

mrflory avatar robertzb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

yanzj poa00

bkt-toolbox's Issues

Incorrect window/popup position in multi-monitor multi-dpi setup

When using multiple monitors with different dpi setting, on the seconday monitor popups and windows (like QuickEdit) are not placed correctly.

The position of the slide or shape is received using PowerPoints PointsToScreenPixelsX and PointsToScreenPixelsY function. These coordinates need to be scaled according to dpi settings. There are different methods: https://dzimchuk.net/best-way-to-get-dpi-value-in-wpf/
Currently this is implemented in the BktWindow.cs file as follows:

var ptLogicalUnits = source.CompositionTarget.TransformFromDevice.Transform(new Point(x, y));

However, this function does not work properly in the multi-dpi setup. This is probably related to the dpi awareness of PowerPoint itself and not passing the dpi change event: https://www.add-in-express.com/creating-addins-blog/2021/06/10/office-addins-dpi-awareness-research-analysis/

A solution is be to determine the dpi setting for PowerPoints window handle and use that for scaling the coordinates: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdpiforwindow

double scaling = 96.0 / GetDpiForWindow(_helper.Owner)

Excel: Consolidate sheets throws error due to comrelease

Excel consolidate sheets feature does (sometimes) not work with the typical comrelease error. This seems to be caused by adding sheets or copying data triggering a callback that initiates ComRelease.

Possible fix: Make use of application.EnableEvents = False

Agenda: Error if presentation is opened read-only

Steps to reproduce:

  • Some presentations (e.g. if protected font is embedded) are not opened in protected mode but still read-only
  • Agenda is currently iterating over each shape to find a suitable textbox on slide changes
  • Accessing the Shape.Tags property throws an error in this situation:
    EnvironmentError: System.Runtime.InteropServices.COMException (0x80048240): Shape.Tags : Invalid request. Presentation cannot be modified.

Proposed solution: Avoid iteration of all shapes on each slide change in the first place.

Many functions that use clipboard: Environment errors

When using a functions that makes use of copy-paste operations a lot, sometimes Environment error related to clipboard issues appear. For example when using "text onto shape" function for many shapes at once. This is reproducable within a PowerPoint instance.

Maybe make more use of save_paste function in helpers.py?

Excel: Workbook consolidation not working due to comrelease error

Consolidation of workbooks in Excel toolbar page 3 does not work due to comrelease error. Temporary workaround:

Change line:

fileDialog = application.FileDialog(3)

to

fileDialog = application._comobj.FileDialog(3)

in file books.py

Further investigation required.

PictureLib

Add PictureLib, like ChartLib, but based on folders with image files, e.g. for icon libraries and flag library.

Thumbnails: Error for files on OneDrive / Sharepoint

For local files within a OneDrive location, Path variable returns the Sharepoint URL and it is very difficult to determine the actual local path, see https://stackoverflow.com/questions/33734706/excels-fullname-property-with-onedrive

The thumbnail feature currently throws an error when refreshing those thumbnails as they are treated as relative path which is not correct. Easiest fix is to support the URL (check for https://) and do not open the file with the local path.

Callback Parameters transactional and cacheable are neglected

When defining a callback, you can pass a parameter transaction=False to avoid invalidation, but this has no effect as it is only stored in InvocationContext and not used anywhere. Alternatively, you can pass transactional=False. This parameter is given when initializing in CallbackType in callback.py file. However, as the python_name is None, ribbon.py will overwrite the CallbackType without copying any parameters. So the transactional=False becomes meaningless. Same behavior for cache resp. cacheable.

We use the parameter in the settings module as well as the devkit to avoid invalidation when showing the console or reloading the BKT. Starting with IPY3 this will cause a SystemError as the invalidation is triggered for a none existing object.

Potential fixes:

  1. Consequently check parameter from InvocationContext
  2. When overwriting CallbackType copy the parameters from previous one

Virus Scanner issue

Excellent addin... really appreciated. I wanted to update but Symantec Virus scanner immediately removing it.

Update Thumbnails on slides not working

Selecting multiple slides and updating all thumbnails on those slides doesn't work.
Reason is that thumbnail refresh selects picture, which is not possible is slide in not in active view.

Lines 422-431 in thumbnails.py

        if group:
            group.select()
            shape.Delete()
            new_shp.Select(False)
            group.regroup(application.ActiveWindow.Selection.ShapeRange)
            new_shp.Select()
        else:
            shape.Delete()
            new_shp.Name = shape_name
            new_shp.Select()

Solution: Select only for single refreh, not batch refreh for multiple slides.

ChartLib: Folder icons

Add possibility to define icons for subfolders in a ChartLib, e.g. by adding a "folder.png" file in that folder

Excel: Consolidate sheets by column

The current feature "consolidate sheets" always copies rows one below the other. In some situations it would be beneficial to consolidate columns next to each other.

Feature-Request Shape Lock/Unlock

We have received the feature request to lock and unlock shapes.

This feature is indeed supported by editing the raw XML files [1], but there is currently no way in the object model or via VBA.
Other addins (like ShapeLocker from OfficeOne) are editing the raw file (close, edit, save, re-open), but this is not easy to implement and might cause problem when editing files in OneDrive or Sharepoint with real-time sync.

Additionally, this feature will eventually come to PowerPoint [2] as it is already available via Insiders.

[1] https://www.brandwares.com/bestpractices/2016/09/xml-hacking-locking-graphics/
[2] https://insider.office.com/et-ee/blog/lock-objects-in-powerpoint-for-windows

ChartLib: Animations are lost due to grouping of shapes

When adding animations to shapes (e.g. for timers) these are lost when using the ChartLib feature. Reason: Shapes are grouped and child-shapes cannot be animated.

Fix options:

  • Do not group shapes when using ChartLib feature (preferred)
  • Identify animations and handle copying differently or reapply animations

Support sankey charts

Support creating sankey charts. Possible solution: Make horizontal connectors curved instead of straight.

Customized shape connector points

Add custom points that connect to shape connectors by distributing points for standard shapes (e.g. circle, rectangle). (This is similar to manually adding points using the "edit points" feature, but this can be a fragile thing destroying the original shape.)

Excel: Better way to show very hidden sheets

Very hidden sheets (xlVeryHidden) can currently only be shown by showing all sheets. Better way would be to add a dialog with a list of all very hidden sheets and select the ones to show.

Bug: Segmented circle update fails

Creating a segmented circle. Open dialog to change parameters, but nothing happens. Error is that PickupAnimation in helpers.py fails and error is not catched in IPY3.

Agenda: Import from Excel

It would be nice to have a defined Excel sheet with agenda items (and additional data like time slots) that can be imported to the agenda function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.