Powershell GUI fronted (WPF) to run categorized console scripts

⌈⌋ branch:  ClickyColoury


Check-in [bc311320b6]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Workaround to override copy function for RichTextBox - copy selected content as text/plain instead of RTF.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:bc311320b65ec280b867e8b189d4a823472d8e31
User & Date: mario 2018-05-16 18:10:22
Context
2018-05-16
18:10
Enables little ping button - with PS Test-Connection (instead of plain ping) check-in: 2bf65ee48c user: mario tags: trunk
18:10
Workaround to override copy function for RichTextBox - copy selected content as text/plain instead of RTF. check-in: bc311320b6 user: mario tags: trunk
18:09
Keep old 3-pane CLI menu (for TextyTypey) as plugin. check-in: 7ca24d3342 user: mario tags: trunk
Changes

Added contrib/RichtextboxCopyPlainText.ps1.



































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# encoding: utf-8
# api: clicky
# type: init-gui
# version: 0.2
# title: Copy plain text
# description: override [Ctl-C] and [Ins] to copy just text/plain from color output
# category: ui
# state: stable
# hidden: 1
# nomenu: 1
#
# That's a workaround, which prevents copying RTF from RichTextBox/FlowDoc.
# Only extracts/converts from the current text selection.
#

# hook keyboard handler on FlowDocumentViewer/RichTextBox
$GUI.output.parent.Add_KeyUp({
    Param($sender, $evt)
    # Event object $evt contains .Key, and .KeyboardDevice.Modifiers
    if (
        ($evt.Key -eq "Insert") -or
        ($evt.Key -eq "C") -and ($evt.KeyboardDevice.Modifiers -eq "Control")
    ) {
        # get currently selected text(range)
        if ($s = $GUI.Output.parent.Selection) {
            $tr = New-Object System.Windows.Documents.TextRange -ArgumentList @($s.Start,$s.End)
            if ($tr) {
                Set-Clipboard ($tr.Text)
                $evt.handled = $true
            }
        }
    }
})