; add the following items into all popup sections
menu * {
-
Find Text in current window:/dialog -m SearchInActive SearchInActive
}
; Add the selected ( $1 ) item to the front of the list if it isn't
; already in there then, if we have reached 7 items in the list delete
; the 7th to keep the list to only 6 items
Alias -l UpdateSearchList {
var %localitem = $1
var %NewTexts = %SearchTexts
if (%SearchTexts == $null) { %NewTexts = %localitem }
else {
if ($istok(%NewTexts,%localitem,44)) { %NewTexts = %SearchTexts }
else { %NewTexts = $instok(%NewTexts,%localitem, 1, 44) }
}
if ($gettok(%NewTexts,0,44) == 7) { %NewTexts = $deltok(%NewTexts,-1,44) }
Return %NewTexts
}
; -------------------------------------------------
; search for text in current/active window dialogue
; -------------------------------------------------
dialog SearchInActive {
title "Find Text"
size -1 -1 168 62
option dbu
text "Find Text:", 10, 12 15 28 10
combo 20, 42 14 80 10, drop, edit
button "Up" 30, 128 14 38 12
button "Down" 40, 128 30 38 12
button "Cancel" 50, 128 46 38 12, cancel
}
; Up button clicked
on *:dialog:SearchInActive:sclick:30: {
var %SearchItem = $did($dname, 20, 0).text
%SearchTexts = $UpdateSearchList(%SearchItem)
/findtext %SearchItem
}
; Down button clicked
on *:dialog:SearchInActive:sclick:40: {
var %SearchItem = $did($dname, 20, 0).text
%SearchTexts = $UpdateSearchList(%SearchItem)
/findtext -n %SearchItem
}
; SearchInActive Dialogue initialisation
on *:dialog:SearchInActive:init:0:{
didtok $dname 20 44 %SearchTexts
; did -c $dname 20 1
}