mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-07-08 13:04:21 +00:00
d1f2c399ce
* Add documentation to various widget messages. The following widget messages now have documentation: * tm-edit-bitmap-operation * tm-edit-text-operation * tm-fold-all-tiddlers * tm-fold-other-tiddlers * tm-fold-tiddler * tm-unfold-all-tiddlers * tm-load-plugin-from-library * tm-load-plugin-library * tm-open-window * tm-scroll * Fixed alignment error.
69 lines
1.9 KiB
Plaintext
69 lines
1.9 KiB
Plaintext
caption: tm-edit-bitmap-operation
|
|
created: 20160424204236050
|
|
modified: 20160424215219517
|
|
tags: Messages
|
|
title: WidgetMessage: tm-edit-bitmap-operation
|
|
type: text/vnd.tiddlywiki
|
|
|
|
\define resizeDescription()
|
|
<div>
|
|
|
|
Resizes the image to the specified width and height. Parameters include:
|
|
|
|
|!Name |!Description |
|
|
|width |Specifies the width the image is resized to |
|
|
|height |Specifies the height the image is resized to |
|
|
|
|
</div>
|
|
\end
|
|
|
|
\define clearDescription()
|
|
<div>
|
|
|
|
Clears the contents of the image and fills it with a solid colour. Parameters include:
|
|
|
|
|!Name |!Description |
|
|
|colour |Colour the image should be filled with, defaults to <<.value "White">> |
|
|
|
|
<<.tip "The colour field can take any normal CSS colour value, including the hexadecimal representation or the RGB format.">>
|
|
</div>
|
|
\end
|
|
|
|
|
|
|
|
A `tm-edit-bitmap-operation` invokes one of the available operations on a __surrounding__ bitmap editor. Therefore the message has to be dispatched within the editor in order for it to catch it. The following properties on the `event` object are required:
|
|
|
|
|!Name |!Description |
|
|
|param |Name of the operation to be executed, see ''below'' for a list of possible operations |
|
|
|paramObject| Hashmap of additional parameters required by the operation top be executed |
|
|
|
|
The `tm-edit-bitmap-operation` message is usually generated by a ButtonWidget or an ActionWidget and is handled by the surrounding bitmap editor.
|
|
|
|
! Bitmap Operations
|
|
|
|
At this point the following bitmap operations have been implemented:
|
|
|
|
|!Name |!Description |
|
|
|<<.def "resize">>|<<resizeDescription>> |
|
|
|<<.def "clear">>|<<clearDescription>> |
|
|
|
|
|
|
!Example
|
|
|
|
An example can be seen in [[$:/core/ui/EditorToolbar/size-dropdown]]:
|
|
|
|
```
|
|
<$button>
|
|
<$action-sendmessage
|
|
$message="tm-edit-bitmap-operation"
|
|
$param="resize"
|
|
width={{$(config-title)$/new-width}}
|
|
height={{$(config-title)$/new-height}}
|
|
/>
|
|
...
|
|
Resize
|
|
</$button>
|
|
```
|
|
|
|
|