Project

General

Profile

[Script] Editbox History Overview v0.2 » Editbox History Overview v0.2.ini

Mr. BS, 03/31/2016 07:18 PM

 
1
; Editbox History Overview
2
; http://dev.adiirc.com/boards/5/topics/584
3
; v0.2 by pereba
4

    
5
alias EditboxHistory {
6
  if ($dialog(EditboxHistory)) dialog -x EditboxHistory
7
  dialog -ma EditboxHistory EditboxHistory
8
}
9

    
10
menu status,channel,query {
11
  -
12
  Editbox History: /EditboxHistory
13
  -
14
}
15

    
16
dialog EditboxHistory {
17
  title "Editbox History"
18
  size -1 -1 200 160
19
  option dbu
20
  text "Filter", 6, 135 2 12 8
21
  edit "", 4, 149 1 50 9
22
  list 11, -1 11 202 90, size hide
23
  list 1, -1 11 202 90, size
24
  edit "", 2, -1 100 202 45, read multi vsbar
25
  button "Copy", 3, 0 145 200 15, disable flat
26
  tab "$active ( $+ $editboxhistory($active,0) $+ )", 5, 0 0 99 47
27
}
28

    
29
on *:DIALOG:EditboxHistory:*:*: {
30
  if ($devent == init) {
31
    var %i $editboxhistory($active,0)
32
    while (%i) {
33
      did -a $dname 1 $editboxhistory($active,%i)
34
      dec %i
35
    }
36
  }
37

    
38
  ; Filter field
39
  if ($devent == edit && $did == 4) {
40
    if ($did($dname,$did) == $null) {
41
      did -h $dname 11 | did -v $dname 1 | did -r $dname 2
42
      return
43
    }
44
    filter -ioc $dname 1 $dname 11 * $+ $did($dname,$did) $+ *
45
    did -v $dname 11 | did -h $dname 1
46
  }
47

    
48
  if ($devent == sclick) {
49
    ; List item
50
    if ($did == 1 || $did == 11) {
51
      did -e $dname 3
52
      did -ra $dname 2 $replace($did($dname,$did).seltext,$chr(13),$crlf)
53
    }
54
    ; Copy button
55
    if ($did($dname,2).lines && $did == 3) {
56
      clipboard
57
      filter -ikr 1- $dname 2 _copyline
58
    }
59
  }
60
}
61

    
62
alias -l _copyline {
63
  clipboard -an $1
64
}
(3-3/3)