File: options_GUI.TCL

package info (click to toggle)
floater 1.2b1-6
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 1,612 kB
  • ctags: 1,822
  • sloc: ansic: 16,755; tcl: 4,034; sh: 1,291; makefile: 129
file content (156 lines) | stat: -rw-r--r-- 5,542 bytes parent folder | download
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/* Copyright (c) 1996--1999 Geoff Pike. */
/* All rights reserved. */

/* Floater is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */

/* This software is provided "as is" and comes with absolutely no */
/* warranties.  Geoff Pike is not liable for damages under any */
/* circumstances.  Support is not provided.  Use at your own risk. */

/* Personal, non-commercial use is allowed.  Attempting to make money */
/* from Floater or products or code derived from Floater is not allowed */
/* without prior written consent from Geoff Pike.  Anything that remotely */
/* involves commercialism, including (but not limited to) systems that */
/* show advertisements while being used and systems that collect */
/* information on users that is later sold or traded require prior */
/* written consent from Geoff Pike. */
/////////////////////////////////////////////////////////////////////////////
// Separation of the talk window
/////////////////////////////////////////////////////////////////////////////

proc copytext {old new} {
    global talktext

    set talktext $new
    catch {$new insert end [$old get 0.0 end-1c]}
}

set separateTalk_ [set talk_is_sep 0]
proc separateTalk {{toggle 0}} {
    global talk_is_sep talkfont separateTalk_

    // catch {talkmsg "separateTalk $toggle with talk_is_sep=$talk_is_sep separateTalk_=$separateTalk_"}
    if $toggle {set separateTalk_ [expr !$separateTalk_]}
    if {$talk_is_sep == $separateTalk_} return
    if [set talk_is_sep $separateTalk_] {
	catch {destroy .floaterTalk}
	toplevel .floaterTalk
	wm title .floaterTalk "Floater Talk"
	text .floaterTalk.text -wrap word -font $talkfont -relief raised -yscrollcommand ".floaterTalk.scroll set"
	pack [scrollbar .floaterTalk.scroll -command ".floaterTalk.text yview"] -side right -fill y
	pack .floaterTalk.text -side left -fill both -expand yes
	copytext .talk.text .floaterTalk.text
	.talk.text delete 0.0 end
	pack forget .talk
	.floaterTalk.text yview -pickplace end
	bind .floaterTalk.text <Configure> \
		{.floaterTalk.text yview -pickplace end}
	bind .floaterTalk.text <FocusIn> focus_cmdline
    } else {
	copytext .floaterTalk.text .talk.text
	catch {destroy .floaterTalk}
	pack .talk
    }
}	

// if {$effectiveheight < 500} {after 1000 separateTalk 1}

/////////////////////////////////////////////////////////////////////////////

set hideMatrix_ [set matrix_hidden_during_auction 0]
proc hideMatrix {{toggle 0}} {
    global hideMatrix_ matrix_hidden_during_auction needAuctionUpdate

    // catch {talkmsg "hideMatrix $toggle with matrix_hidden_during_auction=$matrix_hidden_during_auction hideMatrix_=$hideMatrix_"}
    if $toggle {set hideMatrix_ [expr !$hideMatrix_]}
    if {$hideMatrix_ == $matrix_hidden_during_auction} return
    set matrix_hidden_during_auction $hideMatrix_
    set needAuctionUpdate 1
}

// Default on a small screen is to hide the matrix during the auction.
if {$effectiveheight < 770} {hideMatrix 1}

set matrix_showing 1
proc showMatrix {b} {
    global matrix_showing canv

    // catch {talkmsg "showMatrix $b"}
    if {$b == $matrix_showing} return
    if [set matrix_showing $b] {
	$canv(c) move all 0 [expr - $canv(YMatrixHide)]
	$canv(c) configure -height $canv(height)
    } else {
	$canv(c) move all 0 $canv(YMatrixHide)
	$canv(c) configure -height $canv(matrixHiddenHeight)
    }
}

/////////////////////////////////////////////////////////////////////////////

set hideCommandLine_ 0
proc hideCommandLine {{toggle 0}} {
    global hideCommandLine_

    if $toggle {set hideCommandLine_ [expr !$hideCommandLine_]}
    if $hideCommandLine_ {
	pack forget .cmd.cmdline
	pack forget .cmd.f.labelc
    } else {
        pack .cmd.cmdline -before .cmd.talk -fill x -side top -expand yes
	pack .cmd.f.labelc -before .cmd.f.labelt -side top -anchor e
    }
}

/////////////////////////////////////////////////////////////////////////////

set bidButtons_ [set bid_buttons_during_auction 1]
proc bidButtons {{toggle 0}} {
    global bidButtons_ bid_buttons_during_auction needAuctionUpdate

    // catch {talkmsg "bidButtons $toggle with bid_...=$bid_buttons_during_auction bidButtons_=$bidButtons_"}
    if $toggle {set bidButtons_ [expr !$bidButtons_]}
    if {$bidButtons_ == $bid_buttons_during_auction} return
    set bid_buttons_during_auction $bidButtons_
    set needAuctionUpdate 1
}

// Default on a small screen is no bidButtons.
if {$effectiveheight < 700} {bidButtons 1}

/////////////////////////////////////////////////////////////////////////////
// Deiconification
/////////////////////////////////////////////////////////////////////////////

set deiconifyIfBeeped_ 1
proc deiconifyIfBeeped {{toggle 0}} {
    global deiconifyIfBeeped_

    // catch {talkmsg "deiconifyIfBeeped $toggle with deiconifyIfBeeped_=$deiconifyIfBeeped_"}
    if $toggle {set deiconifyIfBeeped_ [expr !$deiconifyIfBeeped_]}
}

proc Floater_deiconify {} {
    global deiconifyIfBeeped_

    catch {
	if {$deiconifyIfBeeped_ && [wm state .] == "iconic"} {wm deiconify .}
    }
}

/////////////////////////////////////////////////////////////////////////////
// Auction Hide Time (< 0 means after first trick, N >= 0 means N seconds
// after final pass)
/////////////////////////////////////////////////////////////////////////////

if {$effectiveheight > 770} {
    set auction_hide_time -1
} else {
    set auction_hide_time 10
}

proc Floater_bell {} { catch { bell } }