diff --git a/MANIFEST.in b/MANIFEST.in index da71a05a..22416433 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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 ## diff --git a/data/tcl/menu8.4.tcl b/data/tcl/menu8.4.tcl index 91e96f36..438322a8 100644 --- a/data/tcl/menu8.4.tcl +++ b/data/tcl/menu8.4.tcl @@ -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 diff --git a/data/themes/blue/blue.tcl b/data/themes/blue/blue.tcl new file mode 100644 index 00000000..e5c49470 --- /dev/null +++ b/data/themes/blue/blue.tcl @@ -0,0 +1,153 @@ +# blue.tcl - Copyright (C) 2004 Pat Thoyts +# +# 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 + + } +} + diff --git a/data/themes/blue/blue/arrowdown-h.gif b/data/themes/blue/blue/arrowdown-h.gif new file mode 100644 index 00000000..3c1be9d8 Binary files /dev/null and b/data/themes/blue/blue/arrowdown-h.gif differ diff --git a/data/themes/blue/blue/arrowdown-p.gif b/data/themes/blue/blue/arrowdown-p.gif new file mode 100644 index 00000000..1cb36ec5 Binary files /dev/null and b/data/themes/blue/blue/arrowdown-p.gif differ diff --git a/data/themes/blue/blue/arrowdown.gif b/data/themes/blue/blue/arrowdown.gif new file mode 100644 index 00000000..e363c362 Binary files /dev/null and b/data/themes/blue/blue/arrowdown.gif differ diff --git a/data/themes/blue/blue/arrowleft-h.gif b/data/themes/blue/blue/arrowleft-h.gif new file mode 100644 index 00000000..cbc3db27 Binary files /dev/null and b/data/themes/blue/blue/arrowleft-h.gif differ diff --git a/data/themes/blue/blue/arrowleft-p.gif b/data/themes/blue/blue/arrowleft-p.gif new file mode 100644 index 00000000..14d541b0 Binary files /dev/null and b/data/themes/blue/blue/arrowleft-p.gif differ diff --git a/data/themes/blue/blue/arrowleft.gif b/data/themes/blue/blue/arrowleft.gif new file mode 100644 index 00000000..32584a34 Binary files /dev/null and b/data/themes/blue/blue/arrowleft.gif differ diff --git a/data/themes/blue/blue/arrowright-h.gif b/data/themes/blue/blue/arrowright-h.gif new file mode 100644 index 00000000..913e9da9 Binary files /dev/null and b/data/themes/blue/blue/arrowright-h.gif differ diff --git a/data/themes/blue/blue/arrowright-p.gif b/data/themes/blue/blue/arrowright-p.gif new file mode 100644 index 00000000..d02208fc Binary files /dev/null and b/data/themes/blue/blue/arrowright-p.gif differ diff --git a/data/themes/blue/blue/arrowright.gif b/data/themes/blue/blue/arrowright.gif new file mode 100644 index 00000000..2b0f1fd0 Binary files /dev/null and b/data/themes/blue/blue/arrowright.gif differ diff --git a/data/themes/blue/blue/arrowup-h.gif b/data/themes/blue/blue/arrowup-h.gif new file mode 100644 index 00000000..6059bae0 Binary files /dev/null and b/data/themes/blue/blue/arrowup-h.gif differ diff --git a/data/themes/blue/blue/arrowup-p.gif b/data/themes/blue/blue/arrowup-p.gif new file mode 100644 index 00000000..20b6a824 Binary files /dev/null and b/data/themes/blue/blue/arrowup-p.gif differ diff --git a/data/themes/blue/blue/arrowup.gif b/data/themes/blue/blue/arrowup.gif new file mode 100644 index 00000000..58576162 Binary files /dev/null and b/data/themes/blue/blue/arrowup.gif differ diff --git a/data/themes/blue/blue/button-h.gif b/data/themes/blue/blue/button-h.gif new file mode 100644 index 00000000..0947f43b Binary files /dev/null and b/data/themes/blue/blue/button-h.gif differ diff --git a/data/themes/blue/blue/button-n.gif b/data/themes/blue/blue/button-n.gif new file mode 100644 index 00000000..d9845283 Binary files /dev/null and b/data/themes/blue/blue/button-n.gif differ diff --git a/data/themes/blue/blue/button-n.xcf b/data/themes/blue/blue/button-n.xcf new file mode 100644 index 00000000..e38ed19e Binary files /dev/null and b/data/themes/blue/blue/button-n.xcf differ diff --git a/data/themes/blue/blue/button-p.gif b/data/themes/blue/blue/button-p.gif new file mode 100644 index 00000000..e819b1b9 Binary files /dev/null and b/data/themes/blue/blue/button-p.gif differ diff --git a/data/themes/blue/blue/check-hc.gif b/data/themes/blue/blue/check-hc.gif new file mode 100644 index 00000000..b753aead Binary files /dev/null and b/data/themes/blue/blue/check-hc.gif differ diff --git a/data/themes/blue/blue/check-hu.gif b/data/themes/blue/blue/check-hu.gif new file mode 100644 index 00000000..74dbb799 Binary files /dev/null and b/data/themes/blue/blue/check-hu.gif differ diff --git a/data/themes/blue/blue/check-nc.gif b/data/themes/blue/blue/check-nc.gif new file mode 100644 index 00000000..8f3d9114 Binary files /dev/null and b/data/themes/blue/blue/check-nc.gif differ diff --git a/data/themes/blue/blue/check-nu.gif b/data/themes/blue/blue/check-nu.gif new file mode 100644 index 00000000..6f360ffd Binary files /dev/null and b/data/themes/blue/blue/check-nu.gif differ diff --git a/data/themes/blue/blue/radio-hc.gif b/data/themes/blue/blue/radio-hc.gif new file mode 100644 index 00000000..f7c21fb0 Binary files /dev/null and b/data/themes/blue/blue/radio-hc.gif differ diff --git a/data/themes/blue/blue/radio-hu.gif b/data/themes/blue/blue/radio-hu.gif new file mode 100644 index 00000000..a0066303 Binary files /dev/null and b/data/themes/blue/blue/radio-hu.gif differ diff --git a/data/themes/blue/blue/radio-nc.gif b/data/themes/blue/blue/radio-nc.gif new file mode 100644 index 00000000..0281de37 Binary files /dev/null and b/data/themes/blue/blue/radio-nc.gif differ diff --git a/data/themes/blue/blue/radio-nu.gif b/data/themes/blue/blue/radio-nu.gif new file mode 100644 index 00000000..58ec60c1 Binary files /dev/null and b/data/themes/blue/blue/radio-nu.gif differ diff --git a/data/themes/blue/blue/sb-thumb-p.gif b/data/themes/blue/blue/sb-thumb-p.gif new file mode 100644 index 00000000..6cfaa416 Binary files /dev/null and b/data/themes/blue/blue/sb-thumb-p.gif differ diff --git a/data/themes/blue/blue/sb-thumb.gif b/data/themes/blue/blue/sb-thumb.gif new file mode 100644 index 00000000..d9bfc0a7 Binary files /dev/null and b/data/themes/blue/blue/sb-thumb.gif differ diff --git a/data/themes/blue/blue/sb-vthumb-p.gif b/data/themes/blue/blue/sb-vthumb-p.gif new file mode 100644 index 00000000..930d7fd9 Binary files /dev/null and b/data/themes/blue/blue/sb-vthumb-p.gif differ diff --git a/data/themes/blue/blue/sb-vthumb.gif b/data/themes/blue/blue/sb-vthumb.gif new file mode 100644 index 00000000..060be5dd Binary files /dev/null and b/data/themes/blue/blue/sb-vthumb.gif differ diff --git a/data/themes/blue/blue/slider-p.gif b/data/themes/blue/blue/slider-p.gif new file mode 100644 index 00000000..c1c089de Binary files /dev/null and b/data/themes/blue/blue/slider-p.gif differ diff --git a/data/themes/blue/blue/slider.gif b/data/themes/blue/blue/slider.gif new file mode 100644 index 00000000..1805c2dc Binary files /dev/null and b/data/themes/blue/blue/slider.gif differ diff --git a/data/themes/blue/blue/vslider-p.gif b/data/themes/blue/blue/vslider-p.gif new file mode 100644 index 00000000..bc37b31c Binary files /dev/null and b/data/themes/blue/blue/vslider-p.gif differ diff --git a/data/themes/blue/blue/vslider.gif b/data/themes/blue/blue/vslider.gif new file mode 100644 index 00000000..d3745c7f Binary files /dev/null and b/data/themes/blue/blue/vslider.gif differ diff --git a/data/themes/blue/pkgIndex.tcl b/data/themes/blue/pkgIndex.tcl new file mode 100644 index 00000000..4facac70 --- /dev/null +++ b/data/themes/blue/pkgIndex.tcl @@ -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]] +} diff --git a/pysollib/game.py b/pysollib/game.py index fb4719f7..5cf48df3 100644 --- a/pysollib/game.py +++ b/pysollib/game.py @@ -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 diff --git a/pysollib/tile/soundoptionsdialog.py b/pysollib/tile/soundoptionsdialog.py index cc1da11a..bba93f5f 100644 --- a/pysollib/tile/soundoptionsdialog.py +++ b/pysollib/tile/soundoptionsdialog.py @@ -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 diff --git a/scripts/build.bat b/scripts/build.bat index cc9ed4cf..084532b7 100755 --- a/scripts/build.bat +++ b/scripts/build.bat @@ -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 diff --git a/setup.py b/setup.py index 2c4c6475..6acd58d6 100644 --- a/setup.py +++ b/setup.py @@ -20,6 +20,8 @@ datas = [ 'sound', 'tiles', 'toolbar', + 'themes', + 'tcl', ] for s in file('MANIFEST.in'): if s.startswith('graft data/cardset-'):