Lines Matching refs:w

39 proc sqlitecon::create {w prompt title db} {
41 if {[winfo exists $w]} {destroy $w}
43 toplevel $w
44 wm title $w $title
45 wm iconname $w $title
52 $m add command -label {Close} -command "destroy $w"
53 sqlitecon::create_child $w $prompt $w.mb.edit.m
62 proc sqlitecon::create_child {w prompt editmenu} {
66 $m add command -label Cut -command "sqlitecon::Cut $w.t"
67 $m add command -label Copy -command "sqlitecon::Copy $w.t"
68 $m add command -label Paste -command "sqlitecon::Paste $w.t"
69 $m add command -label {Clear Screen} -command "sqlitecon::Clear $w.t"
71 $m add command -label {Save As...} -command "sqlitecon::SaveFile $w.t"
72 catch {$editmenu config -postcommand "sqlitecon::EnableEditMenu $w"}
74 scrollbar $w.sb -orient vertical -command "$w.t yview"
76 text $w.t -font fixed -yscrollcommand "$w.sb set"
95 after idle "focus $w.t"
130 proc sqlitecon::Insert {w a} {
131 $w insert insert $a
132 $w yview insert
137 proc sqlitecon::Left {w} { argument
139 scan [$w index insert] %d.%d row col
141 $w mark set insert "insert -1c"
147 proc sqlitecon::Backspace {w} { argument
149 scan [$w index insert] %d.%d row col
151 $w delete {insert -1c}
157 proc sqlitecon::EraseEOL {w} { argument
159 scan [$w index insert] %d.%d row col
161 $w delete insert {insert lineend}
167 proc sqlitecon::Right {w} { argument
168 $w mark set insert "insert +1c"
173 proc sqlitecon::Delete w { argument
174 $w delete insert
179 proc sqlitecon::Home w { argument
181 scan [$w index insert] %d.%d row col
182 $w mark set insert $row.$v(plength)
187 proc sqlitecon::End w { argument
188 $w mark set insert {insert lineend}
193 proc sqlitecon::addHistory {w line} {
211 proc sqlitecon::Enter w { argument
213 scan [$w index insert] %d.%d row col
215 set line [$w get $start "$start lineend"]
216 $w insert end \n
217 $w mark set out end
225 addHistory $w $cmd2
226 set rc [catch {DoCommand $w $cmd} res]
227 if {![winfo exists $w]} return
229 $w insert end $res\n err
231 $w insert end $res\n ok
234 $w insert end $v(prompt)
238 $w insert end $x
240 $w mark set insert end
241 $w mark set out {insert linestart}
242 $w yview insert
251 proc sqlitecon::DoCommand {w cmd} {
260 destroy [winfo toplevel $w]
401 proc sqlitecon::Prior w { argument
406 sqlitecon::SetLine $w $line
411 proc sqlitecon::Next w { argument
416 sqlitecon::SetLine $w $line
421 proc sqlitecon::SetLine {w line} {
423 scan [$w index insert] %d.%d row col
425 $w delete $start end
426 $w insert end $line
427 $w mark set insert end
428 $w yview insert
434 proc sqlitecon::Button1 {w x y} {
439 set p [sqlitecon::nearestBoundry $w $x $y]
440 scan [$w index insert] %d.%d ix iy
443 $w mark set insert $p
445 $w mark set anchor $p
446 focus $w
452 proc sqlitecon::nearestBoundry {w x y} {
453 set p [$w index @$x,$y]
454 set bb [$w bbox $p]
457 $w index "$p + 1 char"
462 proc sqlitecon::SelectTo {w x y} {
464 set cur [sqlitecon::nearestBoundry $w $x $y]
465 if {[catch {$w index anchor}]} {
466 $w mark set anchor $cur
468 set anchor [$w index anchor]
469 if {[$w compare $cur != $anchor] || (abs($v(pressX) - $x) >= 3)} {
471 $w tag remove sel 0.0 end
475 if {[$w compare $cur < anchor]} {
483 $w tag remove sel 0.0 $first
484 $w tag add sel $first $last
485 $w tag remove sel $last end
492 proc sqlitecon::B1Motion {w x y} {
496 sqlitecon::SelectTo $w $x $y
502 proc sqlitecon::B1Leave {w x y} {
506 sqlitecon::motor $w
512 proc sqlitecon::motor w { argument
514 if {![winfo exists $w]} return
515 if {$v(y)>=[winfo height $w]} {
516 $w yview scroll 1 units
518 $w yview scroll -1 units
522 sqlitecon::SelectTo $w $v(x) $v(y)
523 set v(timer) [after 50 sqlitecon::motor $w]
528 proc sqlitecon::cancelMotor w { argument
536 proc sqlitecon::Copy w { argument
537 if {![catch {set text [$w get sel.first sel.last]}]} {
538 clipboard clear -displayof $w
539 clipboard append -displayof $w $text
548 proc sqlitecon::canCut w { argument
550 scan [$w index sel.first] %d.%d s1x s1y
551 scan [$w index sel.last] %d.%d s2x s2y
552 scan [$w index insert] %d.%d ix iy
563 proc sqlitecon::Cut w { argument
564 if {[sqlitecon::canCut $w]==1} {
565 sqlitecon::Copy $w
566 $w delete sel.first sel.last
572 proc sqlitecon::Paste w { argument
573 if {[sqlitecon::canCut $w]==1} {
574 $w delete sel.first sel.last
576 if {[catch {selection get -displayof $w -selection CLIPBOARD} topaste]
577 && [catch {selection get -displayof $w -selection PRIMARY} topaste]} {
584 sqlitecon::Enter $w
588 $w insert insert $line
591 $w insert insert $topaste
597 proc sqlitecon::EnableEditMenu w { argument
620 proc sqlitecon::SaveFile w { argument
627 if {[catch {open $f w} fd]} {
630 puts $fd [string trimright [$w get 1.0 end] \n]
638 proc sqlitecon::Clear w { argument
639 $w delete 1.0 {insert linestart}
646 set w .ed$i
647 toplevel $w
648 wm protocol $w WM_DELETE_WINDOW "$w.b.can invoke"
649 wm title $w {Inline SQL Editor}
677 destroy $w