Скрипт случайного выбора :) wive d-link dwl-g700ap
Создано: 02-06-2009 17:28:40 изменено: 17-06-2012 20:08:22  Метки: tcl
package require Tk
wm geometry . "480x640"
catch {
        package require wce
        set platform [wce platform]
        wm geometry . [concat [lindex [wce sipinfo] 2]x[expr [lindex [wce sipinfo] 3] - 104]+0+[lindex [wce sipinfo] 1]]
        bind . <ConfigureRequest> {::etcl::autofit .}
}

set about [concat "minEd - a minimal editor
original by Richard Suchenwirth 2003
extended by volcas 2006
build " [file tail [info script]]]

set fname ""
wm title . minEdit
set enc utf-8
set hmod txt
set fmod 0

set oldpos 1

set font_family Tahoma
set font_size 9
set font [font create -family $font_family -size $font_size]

pack [scrollbar .y -width 20 -command "parse .t 0; .t yview"] -side right -fill y
pack [text .t -wrap word -yscrollc ".y set" -undo 1 -exportselection 1 -tabs {0.25c left} -font $font -padx 5 -pady 5 -foreground black] -side right -fill both -expand 1

catch {
        if {$::platform ne ""} {
                bind .t <Key-Up> {event generate .t <Key-Prior>; break}
                bind .t <Key-Down> {event generate .t <Key-Next>; break}
                bind .t <Key-Return> {if $::fmod {.mb.view invoke "Fullscreen"; break}}
        }
}

bind .t <Key> {
        set c [encoding convertfrom unicode %A]
        if {$c ne ""}  {.t insert insert $c; break}
        parse .t 0
}

bind .t <MouseWheel> {parse .t 0}

bind .t <<Modified>> {
        if {[string index [wm title .] end] ne "*" } {
                 wm title . [concat minEdit - [concat [file tail  $fname] *]]
        }
}

# popup menue
catch {wce tapandhold .t on}
bind .t <ButtonPress-3> {if {$::fmod} {tk_popup .mb %X %Y} else {tk_popup .mb.edit %X %Y}}

# menue
menu .mb
. configure -menu .mb

# file menu
.mb add cascade -label "File" -menu [menu .mb.file -tearoff 0]
.mb.file add command -label "New" -command {newText .t}
.mb.file add command -label "Open..." -command {loadText .t [tk_getOpenFile -initialdir ebooks]}
.mb.file add command -label "Save as..." -command {saveText .t [tk_getSaveFile -initialdir ebooks]}
.mb.file add command -label "Save" -command {saveText .t $fname}
.mb.file add separator
.mb.file add command -label "Exit" -command {exit}
.mb.file add separator
.mb.file add command -label "About" -command {tk_messageBox -title About -message $about -type ok}

# edit menu
.mb add cascade -label "Edit" -menu [menu .mb.edit -tearoff 0]
.mb.edit add command -label "Undo" -command {catch {.t edit undo}}
.mb.edit add command -label "Redo" -command {catch {.t edit redo}}
.mb.edit add separator
.mb.edit add command -label "Cut" -command {tk_textCut .t}
.mb.edit add command -label "Copy" -command {tk_textCopy .t}
.mb.edit add command -label "Paste" -command {tk_textPaste .t}
.mb.edit add separator
.mb.edit add command -label "Find" -command {searchrep .t 0}
.mb.edit add command -label "Replace" -command {searchrep .t 1}

# edit format menu
.mb.edit add separator
.mb.edit add cascade -label "Format" -menu [menu .mb.edit.format -tearoff 0]
foreach {fo} [list emphasis strong epigraph cite text-author annotation poem v] {
        .mb.edit.format add command -label $fo -command [list formatText .t $fo]
}

# option menu
.mb add cascade -label "Options" -menu [menu .mb.options -tearoff 0]
.mb.options add cascade -label "Color" -menu [menu .mb.options.color -tearoff 0]

.mb.options add cascade -label "Fonts" -menu [menu .mb.options.fonts -tearoff 0]
.mb.options.fonts add cascade -label "Famlies" -menu [menu .mb.options.fonts.families -tearoff 0]
foreach f [lsort -dictionary [font families]] {
        .mb.options.fonts.families add radiobutton -variable font_family -value $f -label $f -font [font create -family $f -size $font_size] -command {.t configure -font [font create -family $font_family -size $font_size]}
}
.mb.options.fonts add cascade -label "Sizes" -menu [menu .mb.options.fonts.sizes -tearoff 0]
foreach s {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20} {
        .mb.options.fonts.sizes add radiobutton -variable font_size -value $s -label $s -command {.t configure -font [font create -family $font_family -size $font_size]}
}

.mb.options add cascade -label "Encoding" -menu [menu .mb.enc -tearoff 0]
foreach n [lsort {unicode utf-8 cp1251 cp1252 iso8859-1 iso8859-5}] {
        .mb.enc add radiobutton -variable enc -value $n -label $n -command {setEnc .t}
}

# view menue
.mb add cascade -label "View" -menu [menu .mb.view -tearoff 0]
foreach h {txt markup hidemarkup fb2} {
        .mb.view add radiobutton -variable hmod -value $h -label [string toupper $h 0] -command {parse .t 1}
}
catch {
        if {$::platform ne ""} {
        .mb.view add separator
        .mb.view add checkbutton -variable fmod -onvalue 1 -offvalue 0 -label "Fullscreen" -command {fscreen .t}
        }
}

# end menue

proc formatText {w fo} {
        if {[$w tag ranges sel] ne "" && $fo ne ""} {
                set selrange [$w tag ranges sel]
                $w insert [lindex $selrange 1] [concat </$fo>]
                $w insert [lindex $selrange 0] [concat <$fo>]
        } else {return}
        parse $w 1
}

# fullscreen
proc fscreen {w} {
        catch {
                if {$::platform eq ""} return
                if {$::fmod}    {
                        . configure -menu {}
                        .y configure -width 0
                        wm geometry . [concat [lindex [wce sipinfo] 2]x[lindex [wce sipinfo] 3]+0+0]
                        wce fullscreen .
                        wce sip buttonoff .
                        ::etcl::autofit .
                } else {
                        . configure -menu .mb
                        .y configure -width 20
                        wm geometry . [concat [lindex [wce sipinfo] 2]x[expr [lindex [wce sipinfo] 3] - 104]+0+[lindex [wce sipinfo] 1]]
                        wce normalscreen .
                        wce sipbuttonon .
                        ::etcl::autofit .
                }
        } {tk_messageBox -message "Fullscreen error" -type ok}
}

# text i/o operations
proc newText {w} {
        global fname
        set fname ""
        wm title . minEdit
        $w configure -state normal
        $w delete 1.0 end
}

proc loadText {w fn} {
        catch {
                if {$fn eq ""} return
                $w configure -state normal
                autoFormat $fn
                set fp [open $fn]
                fconfigure $fp -encoding $::enc
                $w delete 1.0 end
                $w insert end [read $fp]
                close $fp
                parse $w 1
                global fname
                set fname $fn
                wm title . [concat minEdit - [file tail $fname]]
        }  {tk_messageBox -message "FileOpen error" -type ok}
}

proc saveText {w fn} {
        catch {
                if {$fn eq "New*"} {
                        set $fn [tk_getSaveFile -initialdir ebooks]
                        if {{$fn eq "New*"} || {$fn eq ""}} return
                }
                global fname
                set fp [open $fn w]
                fconfigure $fp -encoding $::enc
                puts -nonewline $fp [$w get 1.0 "end - 1 c"]
                close $fp
                set fname $fn
                wm title . [concat minEdit - [file tail $fn]]
        } {tk_messageBox -message "FileSave error" -type ok}
}

proc pretty-print {xml} {
        set ident 0
        set idx1 0
        set idx2 0
        set buffer ""
        set result ""

        regsub -all {>\s+<} $xml {><} xml; # remove whitespace (newlines and tabs between tags)

        while {1} {
                 set idx2 [string first >< $xml $idx1]
                 if {$idx2 != -1} {
                        set buffer [string range $xml $idx1 $idx2]
                        # pre decrement if this is a closing tag
                        if {[string index $buffer 1] == "/"} { incr ident -1 }
                        append result "[string repeat \t $ident]$buffer\n"
                        if {![regexp {^<\?|</|/>$} $buffer]} { incr ident }
                        set idx1 [expr $idx2+1]
                } else {
                        break
                }
        }
        append result [string range $xml $idx1 end]

        return $result
 }

proc autoFormat {fn} {
        if {$fn eq ""} return
        global hmod
        catch {
                if {[lsearch {.xml .xslt .xsl .html .htm .shtml} [file extension $fn]] ne ""} {set hmod markup  }
                if {[lsearch {.fb2} [file extension $fn]] ne ""} {      set hmod fb2}

                set fp [open $fn]
                regexp {(encoding=\")(.+)(\")} [read $fp 50] str str1 str2 str3
                close $fp

                if {$str2 ne ""} {
                        global enc
                        switch [string tolower $str2] {
                                windows-1251 {set enc cp1251}
                                windows-1252 {set enc cp1252}
                                iso-8859-1 {set enc iso8859-1}
                                iso-8859-5 {set enc iso8859-5}
                                default {set enc utf-8}
                        }
                }
        }
}
# end file i/o "

# search and replace
proc searchrep {w replace} {
        foreach sb {.sf .cancel .prev .next .replace .replaceall} {
                if {[winfo exists $sb]} {destroy $sb}
        }

        labelframe .sf -text Search -height 135

        set bw 20

        button .cancel -image [image create photo -data $::imgdata(cancel)] -width $bw -height $bw -command [list destroy .sf .cancel .prev .next .replace .replaceall]
        button .prev -image [image create photo -data $::imgdata(prev)] -width $bw -height $bw -command [list next $w 1 0]
        button .next -image [image create photo -data $::imgdata(next)] -width $bw -height $bw -command [list next $w 0 0]

        bind .sf <Double-1> {
                foreach sb {.sf .cancel .prev .next .replace .replaceall} {
                        if {[winfo exists $sb]} {destroy $sb}
                }
        }

        place .cancel -in .sf -x 5 -y 5
        place .prev -in .sf -x 35 -y 5
        place .next -in .sf -x 65 -y 5

        place [entry .sf.f -textvar Find] -in .sf -x 5 -y 35 -relwidth 0.95
        bind .sf.f <Key> {
                set c [encoding convertfrom unicode %A]
                if {$c ne ""}  {.sf.f insert insert $c; break}
        }

        if {$replace} {
                .sf configure -text "Replace" -height 165
                button .replace -image [image create photo -data $::imgdata(replace)] -width $bw -height $bw -command [list next $w 0 1]
                button .replaceall -image [image create photo -data $::imgdata(replaceall)] -width $bw -height $bw -command [list replace_all $w]

                place .replace -in .sf -x 95 -y 5
                place .replaceall -in .sf -x 125 -y 5

                place [entry .sf.r -textvar Replace] -in .sf -x 5 -y 65 -relwidth 0.95
                bind .sf.r <Key> {
                        set c [encoding convertfrom unicode %A]
                        if {$c ne ""}  {.sf.r insert insert $c; break}
                }
        }

        place [checkbutton .sf.reg -text "RegExp" -variable RegExpression] -in .sf -x 5 -y [expr [.sf cget -height] - 70]
        place [checkbutton .sf.ic -text "Ignore case" -variable IgnoreCase] -in .sf -x 120 -y [expr [.sf cget -height] - 70]

        place .sf -in $w  -x 20 -y 40 -relwidth 0.9

        focus -force .sf.f

        catch {
                set str [$w get sel.first sel.last]
                if {$str ne ""} {
                        .sf.f delete 0 end
                        .sf.f insert end $str
                }
        }
}

proc next {w back replace} {
        if {[winfo exists .sf]} {destroy .sf}

        focus -force $w

        foreach {from to} [$w tag ranges hilite] {
                $w tag remove hilite $from $to
        }

        set cmd [list $w search -count n -- $::Find insert+2c]
        if {$::IgnoreCase} {set cmd [linsert $cmd 2 -nocase]}
        if {$::RegExpression} {set cmd [linsert $cmd 2 -regexp]}
        if {$back} {set cmd [linsert $cmd 2 -backwards]; set cmd [lreplace $cmd end end insert-2c] }

        set pos [eval $cmd]
        if {$pos ne ""} {
                $w tag config hilite -background yellow -foreground darkgreen
                $w mark set insert $pos
                $w see insert
                $w tag add hilite $pos $pos+${n}c
                parse $w 1

                set line [lindex [$w bbox $pos] 1]
                if {$line > [$w cget -height]} {
                        set line [expr $line - 25]
                }
                if {$line < 25} {
                        set line [expr [lindex [$w bbox $pos] 1] + 25]
                }

                place .cancel -in $w -x 5 -y $line
                place .prev -in $w -x 30 -y $line
                place .next -in $w -x 55 -y $line
                if {$replace} {
                        place .replace -in $w -x 80 -y $line
                        .replace configure -command [list replace $w $pos $n]
                        place .replaceall -in $w -x 105 -y $line
#                       .replaceall configure -command [replace $w $pos $n]
                }
        } else { tk_messageBox -message [concat "$::Find" not found. Please try another expression.] -type ok
        }
}

proc replace {w pos n} {
        $w configure -state normal
        $w delete $pos $pos+${n}c
        $w insert $pos $::Replace
        next $w 0 1
}

proc replace_all {w} {
        set counter 0

        if {$::Find eq $::Replace} {return}
        set cmd [list $w search -count n -- $::Find insert+2c]
        if {$::IgnoreCase} {set cmd [linsert $cmd 2 -nocase]}
        if {$::RegExpression} {set cmd [linsert $cmd 2 -regexp]}

        while {1} {
                set pos [eval $cmd]
                if {$pos ne ""} {
                        $w delete $pos $pos+[string length $::Find]c
                        $w insert $pos $::Replace
                        incr counter
                } else {break}
        }

        if {$counter == 0} {
                tk_messageBox -message [concat "$::Find" not found.\nPlease try another expression.] -type ok
        } else {
                destroy .sf .cancel .prev .next .replace .replaceall
                tk_messageBox -message [concat "$::Find" $counter time(s) replaced.] -type ok
        }
}
# end search

# encoding
proc setEnc {w} {
        set tpos [$w index @1,1]
        set ttext [$w get 1.0 "end - 1 c"]
        $w configure -state normal
        $w delete 1.0 end
        $w insert 1.0 [encoding convertfrom $::enc $ttext]
        $w yview $tpos
        parse $w 1
}
# end encoding

# parsing
proc parse {w u} {
        if {$::hmod eq "txt" || $::hmod eq "markup"} {
                $w configure -state normal
        } else {
                $w configure -state disabled
        }

        # remove all hilight infos
        if {$::hmod eq "txt"} {
                foreach ttags [$w tag names] {
                        $w tag delete $ttags
                }
                return
        }

        global oldpos
        set tpos [lindex [split [$w index @1,1] . ] 0]
        set dist [expr $tpos - $oldpos]
        if {abs($dist) > 50 || $u == 1} {
                set oldpos $tpos


        } else {return}

        set first [concat [expr $tpos-100].0]
        set last [concat [expr $tpos+100].0]

        # hiligth markup tags
        if {$::hmod eq "markup" || $::hmod eq "hidemarkup" || $::hmod eq "fb2"} {
                foreach ttags [$w tag names] {
                        $w tag delete $ttags $first $last
                }

                set re {\<[^\<]+\>}
                set newpos $first

                while {1} {
                        set pos [eval [list $w search -elide -regexp -count n -- $re $newpos $last]]
                        if {$pos ne ""} {
                                set newpos $pos+${n}c
                                $w tag add mltag $pos $newpos

                                if {[$w get $pos+1c $pos+2c] ne "/"} {

                                        set atag [lindex [split [$w get $pos+1c $newpos-1c] { }] 0]

                                        if {[lsearch {p emphasis strong title v poem subtitle annotation text-author cite epigraph binary a} $atag] > -1} {
                                                set pos2 [getNext $w \</$atag\> $pos+2c]
                                                $w tag add tagstyle($atag) $pos+${n}c $pos2
                                        }
                                }
                        } else {break}
                }

                # correct non tagged values
                set re {\>[^\>]+\<}
                set newpos $first
                while {1} {
                        set pos [eval [list $w search -regexp -count n -- $re $newpos $last]]
                        if {$pos ne ""} {
                                set newpos $pos+${n}c
                                $w tag remove mltag $pos+1c $newpos-1c
                        } else {break}
                }

                if {$::hmod eq "hidemarkup" || $::hmod eq "fb2"} {
                        $w tag configure mltag -elide 1
                } else {
                        $w tag configure mltag -elide 0 -foreground blue
                }

                if {$::hmod eq "fb2"} {
                        $w tag configure tagstyle(annotation) -justify right -elide 0 -font [font create -family $::font_family -size $::font_size -slant italic]
                        $w tag configure tagstyle(binary) -elide 1
                        $w tag configure tagstyle(a) -foreground blue
                        $w tag configure tagstyle(cite) -elide 0 -lmargin1 20
                        $w tag configure tagstyle(epigraph) -elide 0 -lmargin1 20 -rmargin 20 -justify right
                        $w tag configure tagstyle(text-author) -elide 0 -lmargin1 20 -rmargin 20

                        $w tag configure tagstyle(p) -elide 0 -lmargin1 10
                        $w tag configure tagstyle(emphasis) -elide 0 -font [font create -family $::font_family -size $::font_size -slant italic]
                        $w tag configure tagstyle(strong) -elide 0 -font [font create -family $::font_family -size $::font_size -weight bold]
                        $w tag configure tagstyle(title) -elide 0 -justify center -font [font create -family $::font_family -size [expr $::font_size + 2] -weight bold]
                        $w tag configure tagstyle(subtitle) -elide 0 -justify center -font [font create -family $::font_family -size [expr $::font_size + 1] -weight bold]
                        $w tag configure tagstyle(v) -elide 0 -lmargin1 20 -font [font create -family $::font_family -size $::font_size -slant italic]

                        $w tag raise tagstyle(p)
                        $w tag raise tagstyle(v)
                        $w tag raise tagstyle(emphasis)
                        $w tag raise tagstyle(strong)
                        $w tag raise tagstyle(title)

                        $w tag raise tagstyle(text-author)
                        $w tag raise tagstyle(cite)
                        $w tag raise tagstyle(epigraph)
                        $w tag raise tagstyle(annotation)
                        $w tag raise tagstyle(binary)

                        $w tag raise tagstyle(a)
                        $w tag raise mltag
                }
        }
}

proc getNext {w str pos} {
        set pos2 [$w search -regexp -elide -count n -- $str $pos end]
        if {$pos2 ne ""} {return $pos2} else {return -1}
}
# end parse

focus -force .t

#wce siphide
catch {
        wce siphide
        ::etcl::autofit .
}

set imgdata(cancel) "
iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
BGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VG
AAACiUlEQVR42mL8//8/AzUBQAAxMVAZAAQQC7pAcv0asJPfvP3CsHFKAiOxcjAAEEBYXTijJpDh
0tX7DKTKgQBAAFHdywABxIgcKSAvgbzz8cs3hocPXzLoaSuCvfbuzIX/pZvvMGCTQzcQIIAwXLim
P5ahKMWTwdRMD+w1kGGc/t4MXD++YsiBwPv1m/6/vX0f7iqAAMKIlJDCxXBXgMCG4m6GqI8fGWwu
HQDK/YfLaX99yfDNwvI/55XLDP90dBkYThwHqwcIIAaQl0E4qW71fxB4+uLj/4OX3v0PLVvzX8Gh
7v/qomn/v3Nz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AKK6gQABBgBZu5YMn5VoEwAAAABJRU5ErkJggg==
"
1530 просмотров комментировать

Скрипт случайного выбора :) wive d-link dwl-g700ap