* misc improvements
git-svn-id: file:///home/shlomif/Backup/svn-dumps/PySolFC/svnsync-repos/pysolfc/PySolFC/trunk@86 efabe8c0-fbe8-4139-b769-b5e6d273206e
|
@ -8,6 +8,8 @@ include pysol setup.py setup.cfg MANIFEST.in Makefile COPYING README
|
|||
include pysollib/*.py pysollib/tk/*.py pysollib/tile/*.py pysollib/pysolgtk/*.py
|
||||
include pysollib/games/*.py pysollib/games/special/*.py
|
||||
include pysollib/games/ultra/*.py pysollib/games/mahjongg/*.py
|
||||
include data/tcl/*.tcl
|
||||
graft data/themes
|
||||
include scripts/build.bat scripts/create_iss.py scripts/mahjongg_utils.py
|
||||
include scripts/all_games.py scripts/cardset_viewer.py
|
||||
#graft data/plugins
|
||||
|
@ -17,7 +19,6 @@ include scripts/all_games.py scripts/cardset_viewer.py
|
|||
include docs/*
|
||||
graft data/html
|
||||
graft data/html-src
|
||||
graft data/themes
|
||||
##
|
||||
## data - images
|
||||
##
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
# this file from tkabber project
|
||||
# http://www.jabberstudio.org/projects/tkabber/
|
||||
|
||||
namespace eval :: {
|
||||
|
||||
|
@ -44,13 +45,13 @@ set myMenuMotion 0
|
|||
proc ::tk::MenuNextEntry {menu count} {
|
||||
global ::tk::Priv
|
||||
|
||||
if {[string equal [$menu index last] "none"]} {
|
||||
if {[$menu index last] eq "none"} {
|
||||
return
|
||||
}
|
||||
set length [expr {[$menu index last]+1}]
|
||||
set quitAfter $length
|
||||
set active [$menu index active]
|
||||
if {[string equal $active "none"]} {
|
||||
if {$active eq "none"} {
|
||||
set i 0
|
||||
} else {
|
||||
set i [expr {$active + $count}]
|
||||
|
@ -69,7 +70,7 @@ proc ::tk::MenuNextEntry {menu count} {
|
|||
incr i -$length
|
||||
}
|
||||
if {[catch {$menu entrycget $i -state} state] == 0} {
|
||||
if {[string compare $state "disabled"]} {
|
||||
if {$state ne "disabled"} {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
@ -81,9 +82,9 @@ proc ::tk::MenuNextEntry {menu count} {
|
|||
}
|
||||
$menu activate $i
|
||||
::tk::GenerateMenuSelect $menu
|
||||
if {[string equal [$menu type $i] "cascade"]} {
|
||||
if {[$menu type $i] eq "cascade"} {
|
||||
set cascade [$menu entrycget $i -menu]
|
||||
if {[string equal [$menu cget -type] "menubar"] && [string compare $cascade ""]} {
|
||||
if {[$menu cget -type] eq "menubar" && $cascade ne ""} {
|
||||
# Here we auto-post a cascade. This is necessary when
|
||||
# we traverse left/right in the menubar, but undesirable when
|
||||
# we traverse up/down in a menu.
|
||||
|
@ -108,22 +109,22 @@ proc ::tk::MenuNextMenu {menu direction} {
|
|||
|
||||
# First handle traversals into and out of cascaded menus.
|
||||
|
||||
if {[string equal $direction "right"]} {
|
||||
if {$direction eq "right"} {
|
||||
set count 1
|
||||
set parent [winfo parent $menu]
|
||||
set class [winfo class $parent]
|
||||
if {[string equal [$menu type active] "cascade"]} {
|
||||
if {[$menu type active] eq "cascade"} {
|
||||
$menu postcascade active
|
||||
set m2 [$menu entrycget active -menu]
|
||||
if {[string compare $m2 ""]} {
|
||||
if {$m2 ne ""} {
|
||||
::tk::MenuFirstEntry $m2
|
||||
}
|
||||
return
|
||||
} else {
|
||||
set parent [winfo parent $menu]
|
||||
while {[string compare $parent "."]} {
|
||||
if {[string equal [winfo class $parent] "Menu"] \
|
||||
&& [string equal [$parent cget -type] "menubar"]} {
|
||||
while {$parent ne "."} {
|
||||
if {[winfo class $parent] eq "Menu" && \
|
||||
[$parent cget -type] eq "menubar"} {
|
||||
tk_menuSetFocus $parent
|
||||
::tk::MenuNextEntry $parent 1
|
||||
return
|
||||
|
@ -134,8 +135,8 @@ proc ::tk::MenuNextMenu {menu direction} {
|
|||
} else {
|
||||
set count -1
|
||||
set m2 [winfo parent $menu]
|
||||
if {[string equal [winfo class $m2] "Menu"]} {
|
||||
if {[string compare [$m2 cget -type] "menubar"]} {
|
||||
if {[winfo class $m2] eq "Menu"} {
|
||||
if {[$m2 cget -type] ne "menubar"} {
|
||||
$menu activate none
|
||||
::tk::GenerateMenuSelect $menu
|
||||
tk_menuSetFocus $m2
|
||||
|
@ -155,8 +156,8 @@ proc ::tk::MenuNextMenu {menu direction} {
|
|||
# or previous menubutton, if that makes sense.
|
||||
|
||||
set m2 [winfo parent $menu]
|
||||
if {[string equal [winfo class $m2] "Menu"]} {
|
||||
if {[string equal [$m2 cget -type] "menubar"]} {
|
||||
if {[winfo class $m2] eq "Menu"} {
|
||||
if {[$m2 cget -type] eq "menubar"} {
|
||||
tk_menuSetFocus $m2
|
||||
::tk::MenuNextEntry $m2 -1
|
||||
return
|
||||
|
@ -164,7 +165,7 @@ proc ::tk::MenuNextMenu {menu direction} {
|
|||
}
|
||||
|
||||
set w $::tk::Priv(postedMb)
|
||||
if {[string equal $w ""]} {
|
||||
if {$w eq ""} {
|
||||
return
|
||||
}
|
||||
set buttons [winfo children [winfo parent $w]]
|
||||
|
@ -178,13 +179,13 @@ proc ::tk::MenuNextMenu {menu direction} {
|
|||
incr i -$length
|
||||
}
|
||||
set mb [lindex $buttons $i]
|
||||
if {[string equal [winfo class $mb] "Menubutton"] \
|
||||
&& [string compare [$mb cget -state] "disabled"] \
|
||||
&& [string compare [$mb cget -menu] ""] \
|
||||
&& [string compare [[$mb cget -menu] index last] "none"]} {
|
||||
if {[winfo class $mb] eq "Menubutton" \
|
||||
&& [$mb cget -state] ne "disabled" \
|
||||
&& [$mb cget -menu] ne "" \
|
||||
&& [[$mb cget -menu] index last] ne "none"} {
|
||||
break
|
||||
}
|
||||
if {[string equal $mb $w]} {
|
||||
if {$mb eq $w} {
|
||||
return
|
||||
}
|
||||
incr i $count
|
||||
|
@ -205,30 +206,30 @@ proc ::tk::MenuNextMenu {menu direction} {
|
|||
# menu - Name of the menu window (possibly empty).
|
||||
|
||||
proc ::tk::MenuFirstEntry menu {
|
||||
if {[string equal $menu ""]} {
|
||||
if {$menu eq ""} {
|
||||
return
|
||||
}
|
||||
tk_menuSetFocus $menu
|
||||
if {[string compare [$menu index active] "none"]} {
|
||||
if {[$menu index active] ne "none"} {
|
||||
return
|
||||
}
|
||||
set last [$menu index last]
|
||||
if {[string equal $last "none"]} {
|
||||
if {$last eq "none"} {
|
||||
return
|
||||
}
|
||||
for {set i 0} {$i <= $last} {incr i} {
|
||||
if {([catch {set state [$menu entrycget $i -state]}] == 0) \
|
||||
&& [string compare $state "disabled"]} {
|
||||
&& $state ne "disabled"} {
|
||||
#~$menu activate $i
|
||||
#~::tk::GenerateMenuSelect $menu
|
||||
# Only post the cascade if the current menu is a menubar;
|
||||
# otherwise, if the first entry of the cascade is a cascade,
|
||||
# we can get an annoying cascading effect resulting in a bunch of
|
||||
# menus getting posted (bug 676)
|
||||
if {[string equal [$menu type $i] "cascade"] && \
|
||||
[string equal [$menu cget -type] "menubar"]} {
|
||||
if {[$menu type $i] eq "cascade" && \
|
||||
[$menu cget -type] eq "menubar"} {
|
||||
set cascade [$menu entrycget $i -menu]
|
||||
if {[string compare $cascade ""]} {
|
||||
if {$cascade ne ""} {
|
||||
$menu postcascade $i
|
||||
::tk::MenuFirstEntry $cascade
|
||||
}
|
||||
|
@ -345,7 +346,7 @@ proc myMenuPostCascade {menu} {
|
|||
after cancel $myPriv(id)
|
||||
}
|
||||
}
|
||||
if {[string equal [$menu cget -type] "menubar"]} {
|
||||
if {[$menu cget -type] eq "menubar"} {
|
||||
$menu postcascade active
|
||||
} else {
|
||||
set myPriv(activeMenu) $menu
|
||||
|
|
153
data/themes/blue/blue.tcl
Normal file
|
@ -0,0 +1,153 @@
|
|||
# blue.tcl - Copyright (C) 2004 Pat Thoyts <patthoyts@users.sourceforge.net>
|
||||
#
|
||||
# blue.tcl,v 1.30 2005/12/13 23:04:25 patthoyts Exp
|
||||
#
|
||||
#
|
||||
|
||||
namespace eval tile::theme::blue {
|
||||
|
||||
package provide tile::theme::blue 0.7
|
||||
|
||||
variable I
|
||||
array set I [tile::LoadImages \
|
||||
[file join [file dirname [info script]] blue] *.gif]
|
||||
|
||||
variable colors
|
||||
array set colors {
|
||||
-frame "#6699cc"
|
||||
-lighter "#bcd2e8"
|
||||
-window "#e6f3ff"
|
||||
-selectbg "#ffff33"
|
||||
-selectfg "#000000"
|
||||
-disabledfg "#666666"
|
||||
}
|
||||
|
||||
style theme create blue -settings {
|
||||
|
||||
style configure . \
|
||||
-borderwidth 1 \
|
||||
-background $colors(-frame) \
|
||||
-fieldbackground $colors(-window) \
|
||||
-troughcolor $colors(-lighter) \
|
||||
-selectbackground $colors(-selectbg) \
|
||||
-selectforeground $colors(-selectfg) \
|
||||
;
|
||||
style map . -foreground [list disabled $colors(-disabledfg)]
|
||||
|
||||
## Buttons.
|
||||
#
|
||||
style configure TButton -padding "10 0"
|
||||
style layout TButton {
|
||||
Button.button -children {
|
||||
Button.focus -children {
|
||||
Button.padding -children {
|
||||
Button.label
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
style element create button image $I(button-n) \
|
||||
-map [list pressed $I(button-p) active $I(button-h)] \
|
||||
-border 4 -sticky ew
|
||||
|
||||
style element create Checkbutton.indicator image $I(check-nu) \
|
||||
-width 24 -sticky w -map [list \
|
||||
{!disabled active selected} $I(check-hc) \
|
||||
{!disabled active} $I(check-hu) \
|
||||
{!disabled selected} $I(check-nc) ]
|
||||
|
||||
style element create Radiobutton.indicator image $I(radio-nu) \
|
||||
-width 24 -sticky w -map [list \
|
||||
{!disabled active selected} $I(radio-hc) \
|
||||
{!disabled active} $I(radio-hu) \
|
||||
selected $I(radio-nc) ]
|
||||
|
||||
style configure TMenubutton -relief raised -padding {10 2}
|
||||
style configure TRadiobutton -padding 1
|
||||
style configure TCheckbutton -padding 1
|
||||
|
||||
## Toolbar buttons.
|
||||
#
|
||||
style configure Toolbutton \
|
||||
-width 0 -relief flat -borderwidth 2 -padding 4 \
|
||||
-background $colors(-frame) -foreground #000000 ;
|
||||
style map Toolbutton -background [list active $colors(-selectbg)]
|
||||
style map Toolbutton -foreground [list active $colors(-selectfg)]
|
||||
style map Toolbutton -relief {
|
||||
disabled flat
|
||||
selected sunken
|
||||
pressed sunken
|
||||
active raised
|
||||
}
|
||||
|
||||
## Entry widgets.
|
||||
#
|
||||
style configure TEntry \
|
||||
-selectborderwidth 1 -padding 2 -insertwidth 2 -font TkTextFont
|
||||
style configure TCombobox \
|
||||
-selectborderwidth 1 -padding 2 -insertwidth 2 -font TkTextFont
|
||||
|
||||
## Notebooks.
|
||||
#
|
||||
style configure TNotebook.Tab -padding {4 2 4 2}
|
||||
style map TNotebook.Tab \
|
||||
-background \
|
||||
[list selected $colors(-frame) active $colors(-lighter)] \
|
||||
-padding [list selected {4 4 4 2}]
|
||||
|
||||
## Labelframes.
|
||||
#
|
||||
style configure TLabelframe -borderwidth 2 -relief groove
|
||||
|
||||
## Scrollbars.
|
||||
#
|
||||
style layout Vertical.TScrollbar {
|
||||
Scrollbar.trough -children {
|
||||
Scrollbar.uparrow -side top
|
||||
Scrollbar.downarrow -side bottom
|
||||
Scrollbar.uparrow -side bottom
|
||||
Vertical.Scrollbar.thumb -side top -expand true -sticky ns
|
||||
}
|
||||
}
|
||||
|
||||
style layout Horizontal.TScrollbar {
|
||||
Scrollbar.trough -children {
|
||||
Scrollbar.leftarrow -side left
|
||||
Scrollbar.rightarrow -side right
|
||||
Scrollbar.leftarrow -side right
|
||||
Horizontal.Scrollbar.thumb -side left -expand true -sticky we
|
||||
}
|
||||
}
|
||||
|
||||
style element create Horizontal.Scrollbar.thumb image $I(sb-thumb) \
|
||||
-map [list {pressed !disabled} $I(sb-thumb-p)] -border 3
|
||||
|
||||
style element create Vertical.Scrollbar.thumb image $I(sb-vthumb) \
|
||||
-map [list {pressed !disabled} $I(sb-vthumb-p)] -border 3
|
||||
|
||||
foreach dir {up down left right} {
|
||||
style element create ${dir}arrow image $I(arrow${dir}) \
|
||||
-map [list \
|
||||
disabled $I(arrow${dir}) \
|
||||
pressed $I(arrow${dir}-p) \
|
||||
active $I(arrow${dir}-h)] \
|
||||
-border 1 -sticky {}
|
||||
}
|
||||
|
||||
## Scales.
|
||||
#
|
||||
style element create Scale.slider \
|
||||
image $I(slider) -map [list {pressed !disabled} $I(slider-p)]
|
||||
|
||||
style element create Vertical.Scale.slider \
|
||||
image $I(vslider) -map [list {pressed !disabled} $I(vslider-p)]
|
||||
|
||||
style element create Horizontal.Progress.bar \
|
||||
image $I(sb-thumb) -border 2
|
||||
style element create Vertical.Progress.bar \
|
||||
image $I(sb-vthumb) -border 2
|
||||
|
||||
}
|
||||
}
|
||||
|
BIN
data/themes/blue/blue/arrowdown-h.gif
Normal file
After Width: | Height: | Size: 315 B |
BIN
data/themes/blue/blue/arrowdown-p.gif
Normal file
After Width: | Height: | Size: 312 B |
BIN
data/themes/blue/blue/arrowdown.gif
Normal file
After Width: | Height: | Size: 313 B |
BIN
data/themes/blue/blue/arrowleft-h.gif
Normal file
After Width: | Height: | Size: 329 B |
BIN
data/themes/blue/blue/arrowleft-p.gif
Normal file
After Width: | Height: | Size: 327 B |
BIN
data/themes/blue/blue/arrowleft.gif
Normal file
After Width: | Height: | Size: 323 B |
BIN
data/themes/blue/blue/arrowright-h.gif
Normal file
After Width: | Height: | Size: 330 B |
BIN
data/themes/blue/blue/arrowright-p.gif
Normal file
After Width: | Height: | Size: 327 B |
BIN
data/themes/blue/blue/arrowright.gif
Normal file
After Width: | Height: | Size: 324 B |
BIN
data/themes/blue/blue/arrowup-h.gif
Normal file
After Width: | Height: | Size: 309 B |
BIN
data/themes/blue/blue/arrowup-p.gif
Normal file
After Width: | Height: | Size: 313 B |
BIN
data/themes/blue/blue/arrowup.gif
Normal file
After Width: | Height: | Size: 314 B |
BIN
data/themes/blue/blue/button-h.gif
Normal file
After Width: | Height: | Size: 696 B |
BIN
data/themes/blue/blue/button-n.gif
Normal file
After Width: | Height: | Size: 770 B |
BIN
data/themes/blue/blue/button-n.xcf
Normal file
BIN
data/themes/blue/blue/button-p.gif
Normal file
After Width: | Height: | Size: 769 B |
BIN
data/themes/blue/blue/check-hc.gif
Normal file
After Width: | Height: | Size: 254 B |
BIN
data/themes/blue/blue/check-hu.gif
Normal file
After Width: | Height: | Size: 234 B |
BIN
data/themes/blue/blue/check-nc.gif
Normal file
After Width: | Height: | Size: 249 B |
BIN
data/themes/blue/blue/check-nu.gif
Normal file
After Width: | Height: | Size: 229 B |
BIN
data/themes/blue/blue/radio-hc.gif
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
data/themes/blue/blue/radio-hu.gif
Normal file
After Width: | Height: | Size: 626 B |
BIN
data/themes/blue/blue/radio-nc.gif
Normal file
After Width: | Height: | Size: 389 B |
BIN
data/themes/blue/blue/radio-nu.gif
Normal file
After Width: | Height: | Size: 401 B |
BIN
data/themes/blue/blue/sb-thumb-p.gif
Normal file
After Width: | Height: | Size: 343 B |
BIN
data/themes/blue/blue/sb-thumb.gif
Normal file
After Width: | Height: | Size: 316 B |
BIN
data/themes/blue/blue/sb-vthumb-p.gif
Normal file
After Width: | Height: | Size: 333 B |
BIN
data/themes/blue/blue/sb-vthumb.gif
Normal file
After Width: | Height: | Size: 308 B |
BIN
data/themes/blue/blue/slider-p.gif
Normal file
After Width: | Height: | Size: 182 B |
BIN
data/themes/blue/blue/slider.gif
Normal file
After Width: | Height: | Size: 182 B |
BIN
data/themes/blue/blue/vslider-p.gif
Normal file
After Width: | Height: | Size: 183 B |
BIN
data/themes/blue/blue/vslider.gif
Normal file
After Width: | Height: | Size: 283 B |
6
data/themes/blue/pkgIndex.tcl
Normal file
|
@ -0,0 +1,6 @@
|
|||
# Package index for tile demo pixmap themes.
|
||||
|
||||
if {[file isdirectory [file join $dir blue]]} {
|
||||
package ifneeded tile::theme::blue 0.7 \
|
||||
[list source [file join $dir blue.tcl]]
|
||||
}
|
|
@ -1018,7 +1018,7 @@ class Game:
|
|||
return
|
||||
if self.app.debug and not self.top.winfo_ismapped():
|
||||
return
|
||||
#self.top.busyUpdate()
|
||||
##self.top.busyUpdate()
|
||||
##self.canvas.after(200)
|
||||
self.canvas.update_idletasks()
|
||||
old_a = self.app.opt.animations
|
||||
|
|
|
@ -155,7 +155,7 @@ class SoundOptionsDialog(MfxDialog):
|
|||
for n, t, v in self.samples:
|
||||
v.set(app.opt.sound_samples[n])
|
||||
w = Tkinter.Checkbutton(frame, text=t, anchor='w', variable=v)
|
||||
w.grid(row=row, column=col, sticky='ew')
|
||||
w.grid(row=row, column=col, sticky='ew', padx=3, pady=1)
|
||||
if col == 1:
|
||||
col = 0
|
||||
row += 1
|
||||
|
|
|
@ -7,9 +7,8 @@ cp -r locale dist
|
|||
cp fc-solve.exe dist
|
||||
cp smpeg.dll ogg.dll vorbis.dll vorbisfile.dll dist
|
||||
python setup.py py2exe
|
||||
cp -r d:\Python\tcl\tile0.7.8 dist\tcl
|
||||
cp -r data\music dist\data
|
||||
rem rm -rf dist\tcl\tcl8.4\encoding
|
||||
rem rm -rf dist\tcl\tk8.4\demos dist\tcl\tk8.4\images
|
||||
python scripts\create_iss.py
|
||||
"d:\Program Files\Inno Setup 5\ISCC.exe" setup.iss
|
||||
pause
|
||||
|
|
2
setup.py
|
@ -20,6 +20,8 @@ datas = [
|
|||
'sound',
|
||||
'tiles',
|
||||
'toolbar',
|
||||
'themes',
|
||||
'tcl',
|
||||
]
|
||||
for s in file('MANIFEST.in'):
|
||||
if s.startswith('graft data/cardset-'):
|
||||
|
|