Hi
LCL has now more than a clipboard, it has three of them.
Features:
- a TClipboard object for each of the three selection types under gtk: PrimarySelection, SecondarySelection and Clipboard.
- Very similar to Delphis TClipboard.
- Internal caching. This accelerates access and makes it possible to use all three clipboards even under win32. (Although the Primary- and Secondary- Selection will only work within an application.)
- Putting data on demand. You can set the supported formats without setting the data. Just set the OnRequest event and put the data when someone requests a specific format. This makes it easy to use the PrimarySelection.
- The gtk interface automatically translates TEXT, STRING, COMPOUND_TEXT and text/plain to text and back.
Usage examples:
1. Putting text onto the clipboard:
Clipboard.AsText := 'some text';2. Getting text from the clipboard:
MyString := Clipboard.AsText;3. Registering a custom clipboard format:
var MyCustomFormatID: TClipboardFormat;
MyCustomFormatID := ClipboardRegisterFormat('My custom format');4. The IDE itself:
TSynEdit now supports the LCL clipboard.
- Paste/Copy/Cut will use text and TSynEdits own text format
- Setting the selection will also set the primary selection
- Middle mouse button will insert the primary selection.
Mattias
