mxgraph copy & paste at cursor position - mxgraph

Need help with code paste Ctrl+v Cells at the mouse cursor position on the graph.
I studied the code example: https://jgraph.github.io/mxgraph/javascript/examples/clipboard.html
but do not understand how to change code to paste the copied Cells in the place where the position (x,y) of the mouse cursor on the graph (not at the offset point relative to the copied cells)

Related

Google sheet: Is it possible to use app script to change a cell's dimension to certain numbers?

What I can find so far is "autoresize", but what I want is to increase the current cell to a certain dimension, for example 300x200. Is there anyway to do this?
This is part of an effort to make google sheet more image friendly. I have a sheet for products, people insert the product images "in cell", but it is by default very small. I've been trying to find a way to "click to enlarge" the image but to no avail. So I am thinking if there is a custom function that can increase the cell's dimension to certain numbers, then I can make a macro for that function so after users select the image cell, they can press the hotkey for the macro to enlarge the cell, in turn enlarge the picture, and then they can press another hotkey to return the cell to its normal size. Is this possible at all? Or is there any other better way to make google sheet more image friendly?
You can use sheet.setColumnWidth() and sheet.setRowHeight() to change the cells dimension.
If you have standard dimensions for both the normal size and enlarged size, you can set them on your code.
You can do it throught onSelectionChange(e) to automatically run the change when the user changes the selected cell(which will require you to check if that cell should be resized or not) or manually run it as a macro like you suggested.
References:
https://developers.google.com/apps-script/guides/triggers
https://developers.google.com/apps-script/reference/spreadsheet/sheet#setcolumnwidthcolumnposition,-width
https://developers.google.com/apps-script/reference/spreadsheet/sheet#setrowheightrowposition,-height

Double clicking Google Sheet Drawing with attached script opens Drawing editor - how to avoid?

I'm using a Drawing as a way to call a script. My use case expects this button to be pressed in rapid succession sometimes (two or three times at once).
I simply want the button to call the script multiple times (it does) without opening the edit drawing dialog.
Are there permissions I can set to prevent the user from opening this dialog?
Or is there a way to lock the drawing?
Or is there a different way to create a button that can be used in this way? (I looked at onSelectionChange(e) but this doesn't solve my multiple click need.)
Thank you.
A simple solution is to not use a drawing at all. Here's how:
Make a nice snip of the UP arrow, and copy it to the clipboard
Select the cell where the arrow is now and delete the Drawing.
In the same cell paste the snip from the clipboard
Right click on the pasted Arrow image and assign the script to it.
Notice that you can click many times and it will work as you expect.
Repeat for the DOWN arrow.

how to display pictures in columns on the same page

This is what I'd like to do. I'd like to be able to display several pics in columns (2,3) on the same webpage to compare them on the right hand side of the menu which would be in the margin on the left. Many thanks for your help.
(I've got a scalar.edu site which uses html)
On a http://scalar.usc.edu/ book site in the page edit mode on the toolbar at top of the text edit area there is an option to "Paste from Word". You can create the table you want in MS Word or Libre Office and copy the entire table to clipboard, then paste it using this button. Worked for me with Libre Office 5 Write.
The table borders are by default not visible in Scalar and one way to make this positioning easier is that while in word editor add a letter of text to each cell in the table. Once copied and pasted into scalar you can select the letter with your mouse and delete it and the cursor will be positioned so you can use the toolbar option on the right to Insert Inline Scalar Media Link. You will need to import content to be able to use it.

Google App Script Get Selected Image Cell

Hi I would like to know if its possible to scale the size of an image in a spreadsheet via Google App Script.
Basically i would like to reduce the size an image so it fits in a cell nicely then simply click on the image to see it at a viewable size.
So far i cant even get the actual cell i've clicked on.
SpreadsheetApp.getActiveSheet().getActiveRange().getValue()
Only gives me the the last selected cell and not the cell of the image i actually clicked.
Any advice would be highly appreciated.
Cheers
When you do an Insert > Image, the image just sits on top of all the cells in the sheet and I don't think we can access it.
If your images are inside of cells as a result of using the =Image() spreadsheet formula, then sure you could control the re-sizing options by changing the formula with .setFormula().

Write text in image inside picturebox

I'm a noob in MSAccess, but I only need to make aspecific task.
I've a picture (a map) and a PictureBox. I load the map into the picturebox and now I need to write some text in some coordinates inside the map. I can't do it positioning a label because later the image has to be available to be saved with this text.
Could you give me please some Ideas about how can I do it?
Thanks.
You can only accomplish this by really modifying the image itself.
Positioning a label on top of the map works for you if you print the form or report after you do that. This way you can save it as PDF for example and still have your test on top of the map.