* improved Tile.py
* added `clearlooks' theme for tile-binding * added dialogs for tile-binding: File Selecton and Color Chooser (for x11) * refactoring: tile: replaced Tkinter to Tile * refactoring: tile: removed non-used imports git-svn-id: https://pysolfc.svn.sourceforge.net/svnroot/pysolfc/PySolFC/trunk@174 39dd0a4e-7c14-0410-91b3-c4f2d318f732
700
data/tcl/clrpick.tcl
Normal file
|
@ -0,0 +1,700 @@
|
|||
# clrpick.tcl --
|
||||
#
|
||||
# Color selection dialog for platforms that do not support a
|
||||
# standard color selection dialog.
|
||||
#
|
||||
# RCS: @(#) $Id: clrpick.tcl,v 1.20.2.2 2006/03/17 10:50:11 patthoyts Exp $
|
||||
#
|
||||
# Copyright (c) 1996 Sun Microsystems, Inc.
|
||||
#
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# ToDo:
|
||||
#
|
||||
# (1): Find out how many free colors are left in the colormap and
|
||||
# don't allocate too many colors.
|
||||
# (2): Implement HSV color selection.
|
||||
#
|
||||
|
||||
# Make sure namespaces exist
|
||||
namespace eval ::tk {}
|
||||
namespace eval ::tk::dialog {}
|
||||
namespace eval ::tk::dialog::color {
|
||||
namespace import ::tk::msgcat::*
|
||||
}
|
||||
|
||||
# ::tk::dialog::color:: --
|
||||
#
|
||||
# Create a color dialog and let the user choose a color. This function
|
||||
# should not be called directly. It is called by the tk_chooseColor
|
||||
# function when a native color selector widget does not exist
|
||||
#
|
||||
proc ::tk::dialog::color:: {args} {
|
||||
variable ::tk::Priv
|
||||
set dataName __tk__color
|
||||
upvar ::tk::dialog::color::$dataName data
|
||||
set w .$dataName
|
||||
|
||||
# The lines variables track the start and end indices of the line
|
||||
# elements in the colorbar canvases.
|
||||
set data(lines,red,start) 0
|
||||
set data(lines,red,last) -1
|
||||
set data(lines,green,start) 0
|
||||
set data(lines,green,last) -1
|
||||
set data(lines,blue,start) 0
|
||||
set data(lines,blue,last) -1
|
||||
|
||||
# This is the actual number of lines that are drawn in each color strip.
|
||||
# Note that the bars may be of any width.
|
||||
# However, NUM_COLORBARS must be a number that evenly divides 256.
|
||||
# Such as 256, 128, 64, etc.
|
||||
set data(NUM_COLORBARS) 16
|
||||
|
||||
# BARS_WIDTH is the number of pixels wide the color bar portion of the
|
||||
# canvas is. This number must be a multiple of NUM_COLORBARS
|
||||
set data(BARS_WIDTH) 160
|
||||
|
||||
# PLGN_WIDTH is the number of pixels wide of the triangular selection
|
||||
# polygon. This also results in the definition of the padding on the
|
||||
# left and right sides which is half of PLGN_WIDTH. Make this number even.
|
||||
set data(PLGN_HEIGHT) 10
|
||||
|
||||
# PLGN_HEIGHT is the height of the selection polygon and the height of the
|
||||
# selection rectangle at the bottom of the color bar. No restrictions.
|
||||
set data(PLGN_WIDTH) 10
|
||||
|
||||
Config $dataName $args
|
||||
InitValues $dataName
|
||||
|
||||
set sc [winfo screen $data(-parent)]
|
||||
set winExists [winfo exists $w]
|
||||
if {!$winExists || $sc ne [winfo screen $w]} {
|
||||
if {$winExists} {
|
||||
destroy $w
|
||||
}
|
||||
toplevel $w -class TkColorDialog -screen $sc
|
||||
BuildDialog $w
|
||||
}
|
||||
|
||||
# Dialog boxes should be transient with respect to their parent,
|
||||
# so that they will always stay on top of their parent window. However,
|
||||
# some window managers will create the window as withdrawn if the parent
|
||||
# window is withdrawn or iconified. Combined with the grab we put on the
|
||||
# window, this can hang the entire application. Therefore we only make
|
||||
# the dialog transient if the parent is viewable.
|
||||
|
||||
if {[winfo viewable [winfo toplevel $data(-parent)]] } {
|
||||
wm transient $w $data(-parent)
|
||||
}
|
||||
|
||||
# 5. Withdraw the window, then update all the geometry information
|
||||
# so we know how big it wants to be, then center the window in the
|
||||
# display and de-iconify it.
|
||||
|
||||
::tk::PlaceWindow $w widget $data(-parent)
|
||||
wm title $w $data(-title)
|
||||
|
||||
# 6. Set a grab and claim the focus too.
|
||||
|
||||
::tk::SetFocusGrab $w $data(okBtn)
|
||||
|
||||
# 7. Wait for the user to respond, then restore the focus and
|
||||
# return the index of the selected button. Restore the focus
|
||||
# before deleting the window, since otherwise the window manager
|
||||
# may take the focus away so we can't redirect it. Finally,
|
||||
# restore any grab that was in effect.
|
||||
|
||||
vwait ::tk::Priv(selectColor)
|
||||
::tk::RestoreFocusGrab $w $data(okBtn)
|
||||
unset data
|
||||
|
||||
return $Priv(selectColor)
|
||||
}
|
||||
|
||||
# ::tk::dialog::color::InitValues --
|
||||
#
|
||||
# Get called during initialization or when user resets NUM_COLORBARS
|
||||
#
|
||||
proc ::tk::dialog::color::InitValues {dataName} {
|
||||
upvar ::tk::dialog::color::$dataName data
|
||||
|
||||
# IntensityIncr is the difference in color intensity between a colorbar
|
||||
# and its neighbors.
|
||||
set data(intensityIncr) [expr {256 / $data(NUM_COLORBARS)}]
|
||||
|
||||
# ColorbarWidth is the width of each colorbar
|
||||
set data(colorbarWidth) \
|
||||
[expr {$data(BARS_WIDTH) / $data(NUM_COLORBARS)}]
|
||||
|
||||
# Indent is the width of the space at the left and right side of the
|
||||
# colorbar. It is always half the selector polygon width, because the
|
||||
# polygon extends into the space.
|
||||
set data(indent) [expr {$data(PLGN_WIDTH) / 2}]
|
||||
|
||||
set data(colorPad) 2
|
||||
set data(selPad) [expr {$data(PLGN_WIDTH) / 2}]
|
||||
|
||||
#
|
||||
# minX is the x coordinate of the first colorbar
|
||||
#
|
||||
set data(minX) $data(indent)
|
||||
|
||||
#
|
||||
# maxX is the x coordinate of the last colorbar
|
||||
#
|
||||
set data(maxX) [expr {$data(BARS_WIDTH) + $data(indent)-1}]
|
||||
|
||||
#
|
||||
# canvasWidth is the width of the entire canvas, including the indents
|
||||
#
|
||||
set data(canvasWidth) [expr {$data(BARS_WIDTH) + $data(PLGN_WIDTH)}]
|
||||
|
||||
# Set the initial color, specified by -initialcolor, or the
|
||||
# color chosen by the user the last time.
|
||||
set data(selection) $data(-initialcolor)
|
||||
set data(finalColor) $data(-initialcolor)
|
||||
set rgb [winfo rgb . $data(selection)]
|
||||
|
||||
set data(red,intensity) [expr {[lindex $rgb 0]/0x100}]
|
||||
set data(green,intensity) [expr {[lindex $rgb 1]/0x100}]
|
||||
set data(blue,intensity) [expr {[lindex $rgb 2]/0x100}]
|
||||
}
|
||||
|
||||
# ::tk::dialog::color::Config --
|
||||
#
|
||||
# Parses the command line arguments to tk_chooseColor
|
||||
#
|
||||
proc ::tk::dialog::color::Config {dataName argList} {
|
||||
variable ::tk::Priv
|
||||
upvar ::tk::dialog::color::$dataName data
|
||||
|
||||
# 1: the configuration specs
|
||||
#
|
||||
if {[info exists Priv(selectColor)] && $Priv(selectColor) ne ""} {
|
||||
set defaultColor $Priv(selectColor)
|
||||
} else {
|
||||
set defaultColor [. cget -background]
|
||||
}
|
||||
|
||||
set specs [list \
|
||||
[list -initialcolor "" "" $defaultColor] \
|
||||
[list -parent "" "" "."] \
|
||||
[list -title "" "" [mc "Color"]] \
|
||||
]
|
||||
|
||||
# 2: parse the arguments
|
||||
#
|
||||
tclParseConfigSpec ::tk::dialog::color::$dataName $specs "" $argList
|
||||
|
||||
if {$data(-title) eq ""} {
|
||||
set data(-title) " "
|
||||
}
|
||||
if {[catch {winfo rgb . $data(-initialcolor)} err]} {
|
||||
error $err
|
||||
}
|
||||
|
||||
if {![winfo exists $data(-parent)]} {
|
||||
error "bad window path name \"$data(-parent)\""
|
||||
}
|
||||
}
|
||||
|
||||
# ::tk::dialog::color::BuildDialog --
|
||||
#
|
||||
# Build the dialog.
|
||||
#
|
||||
proc ::tk::dialog::color::BuildDialog {w} {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
# TopFrame contains the color strips and the color selection
|
||||
#
|
||||
set topFrame [ttk::frame $w.top]
|
||||
|
||||
# StripsFrame contains the colorstrips and the individual RGB entries
|
||||
set stripsFrame [ttk::frame $topFrame.colorStrip]
|
||||
|
||||
set maxWidth [::tk::mcmaxamp &Red &Green &Blue]
|
||||
incr maxWidth
|
||||
set maxWidth [expr {$maxWidth<6?6:$maxWidth}]
|
||||
set colorList [list \
|
||||
red [mc "&Red"] \
|
||||
green [mc "&Green"] \
|
||||
blue [mc "&Blue"] \
|
||||
]
|
||||
foreach {color l} $colorList {
|
||||
# each f frame contains an [R|G|B] entry and the equiv. color strip.
|
||||
set f [ttk::frame $stripsFrame.$color]
|
||||
|
||||
# The box frame contains the label and entry widget for an [R|G|B]
|
||||
set box [ttk::frame $f.box]
|
||||
|
||||
bind [::tk::AmpWidget ttk::label $box.label -text $l: -width $maxWidth \
|
||||
-anchor ne] <<AltUnderlined>> [list focus $box.entry]
|
||||
|
||||
ttk::entry $box.entry -textvariable \
|
||||
::tk::dialog::color::[winfo name $w]($color,intensity) \
|
||||
-width 4
|
||||
pack $box.label -side left -fill y -padx 2 -pady 2
|
||||
pack $box.entry -side left -anchor n -padx 2 -pady 1
|
||||
pack $box -side left -fill both
|
||||
|
||||
set height [expr {[winfo reqheight $box.entry] - 4}]
|
||||
|
||||
canvas $f.color -height $height -width $data(BARS_WIDTH) \
|
||||
-relief sunken -bd 2 -highlightthickness 0
|
||||
canvas $f.sel -height $data(PLGN_HEIGHT) \
|
||||
-width $data(canvasWidth) -highlightthickness 0 \
|
||||
-bg [style lookup . -background]
|
||||
pack $f.color
|
||||
pack $f.sel -expand yes -fill both
|
||||
|
||||
pack $f -side top -fill x -padx 0 -pady 2
|
||||
|
||||
set data($color,entry) $box.entry
|
||||
set data($color,col) $f.color
|
||||
set data($color,sel) $f.sel
|
||||
|
||||
bind $data($color,col) <Configure> \
|
||||
[list tk::dialog::color::DrawColorScale $w $color 1]
|
||||
bind $data($color,col) <Enter> \
|
||||
[list tk::dialog::color::EnterColorBar $w $color]
|
||||
bind $data($color,col) <Leave> \
|
||||
[list tk::dialog::color::LeaveColorBar $w $color]
|
||||
|
||||
bind $data($color,sel) <Enter> \
|
||||
[list tk::dialog::color::EnterColorBar $w $color]
|
||||
bind $data($color,sel) <Leave> \
|
||||
[list tk::dialog::color::LeaveColorBar $w $color]
|
||||
|
||||
bind $box.entry <Return> [list tk::dialog::color::HandleRGBEntry $w]
|
||||
}
|
||||
|
||||
pack $stripsFrame -side left -fill both -padx 4 -pady 10
|
||||
|
||||
# The selFrame contains a frame that demonstrates the currently
|
||||
# selected color
|
||||
#
|
||||
set selFrame [ttk::frame $topFrame.sel]
|
||||
set lab [::tk::AmpWidget ttk::label $selFrame.lab -text [mc "&Selection:"] \
|
||||
-anchor sw]
|
||||
set ent [ttk::entry $selFrame.ent \
|
||||
-textvariable ::tk::dialog::color::[winfo name $w](selection) \
|
||||
-width 16]
|
||||
set f1 [frame $selFrame.f1 -relief sunken -bd 2]
|
||||
set data(finalCanvas) [canvas $f1.demo -relief flat \
|
||||
-width 100 -height 70 -highlightthickness 0]
|
||||
|
||||
pack $lab $ent -side top -fill x -padx 4 -pady 2
|
||||
pack $f1 -expand yes -anchor nw -fill both -padx 6 -pady 10
|
||||
pack $data(finalCanvas) -expand yes -fill both
|
||||
|
||||
bind $ent <Return> [list tk::dialog::color::HandleSelEntry $w]
|
||||
|
||||
pack $selFrame -side left -fill none -anchor nw
|
||||
pack $topFrame -side top -expand yes -fill both -anchor nw
|
||||
|
||||
# the botFrame frame contains the buttons
|
||||
#
|
||||
set sep [ttk::separator $w.sep]
|
||||
set botFrame [ttk::frame $w.bot]
|
||||
|
||||
set maxWidth [::tk::mcmaxamp &OK &Cancel]
|
||||
set maxWidth [expr {$maxWidth<8?8:$maxWidth}]
|
||||
|
||||
::tk::AmpWidget ttk::button $botFrame.ok -text [mc "&OK"] \
|
||||
-command [list tk::dialog::color::OkCmd $w] -width $maxWidth
|
||||
::tk::AmpWidget ttk::button $botFrame.cancel -text [mc "&Cancel"] \
|
||||
-command [list tk::dialog::color::CancelCmd $w] -width $maxWidth
|
||||
|
||||
set data(okBtn) $botFrame.ok
|
||||
set data(cancelBtn) $botFrame.cancel
|
||||
|
||||
grid x $botFrame.ok x $botFrame.cancel x -sticky e
|
||||
grid configure $botFrame.ok -pady 8
|
||||
grid configure $botFrame.cancel -padx 10 -pady 8
|
||||
grid columnconfigure $botFrame 0 -weight 1
|
||||
pack $botFrame $sep -side bottom -fill x
|
||||
|
||||
|
||||
# Accelerator bindings
|
||||
bind $lab <<AltUnderlined>> [list focus $ent]
|
||||
bind $w <KeyPress-Escape> [list tk::ButtonInvoke $data(cancelBtn)]
|
||||
bind $w <Alt-Key> [list tk::AltKeyInDialog $w %A]
|
||||
|
||||
wm protocol $w WM_DELETE_WINDOW [list tk::dialog::color::CancelCmd $w]
|
||||
}
|
||||
|
||||
# ::tk::dialog::color::SetRGBValue --
|
||||
#
|
||||
# Sets the current selection of the dialog box
|
||||
#
|
||||
proc ::tk::dialog::color::SetRGBValue {w color} {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
set data(red,intensity) [lindex $color 0]
|
||||
set data(green,intensity) [lindex $color 1]
|
||||
set data(blue,intensity) [lindex $color 2]
|
||||
|
||||
RedrawColorBars $w all
|
||||
|
||||
# Now compute the new x value of each colorbars pointer polygon
|
||||
foreach color [list red green blue ] {
|
||||
set x [RgbToX $w $data($color,intensity)]
|
||||
MoveSelector $w $data($color,sel) $color $x 0
|
||||
}
|
||||
}
|
||||
|
||||
# ::tk::dialog::color::XToRgb --
|
||||
#
|
||||
# Converts a screen coordinate to intensity
|
||||
#
|
||||
proc ::tk::dialog::color::XToRgb {w x} {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
set x [expr {($x * $data(intensityIncr))/ $data(colorbarWidth)}]
|
||||
if {$x > 255} { set x 255 }
|
||||
return $x
|
||||
}
|
||||
|
||||
# ::tk::dialog::color::RgbToX
|
||||
#
|
||||
# Converts an intensity to screen coordinate.
|
||||
#
|
||||
proc ::tk::dialog::color::RgbToX {w color} {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
return [expr {($color * $data(colorbarWidth)/ $data(intensityIncr))}]
|
||||
}
|
||||
|
||||
|
||||
# ::tk::dialog::color::DrawColorScale --
|
||||
#
|
||||
# Draw color scale is called whenever the size of one of the color
|
||||
# scale canvases is changed.
|
||||
#
|
||||
proc ::tk::dialog::color::DrawColorScale {w c {create 0}} {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
# col: color bar canvas
|
||||
# sel: selector canvas
|
||||
set col $data($c,col)
|
||||
set sel $data($c,sel)
|
||||
|
||||
# First handle the case that we are creating everything for the first time.
|
||||
if {$create} {
|
||||
# First remove all the lines that already exist.
|
||||
if { $data(lines,$c,last) > $data(lines,$c,start)} {
|
||||
for {set i $data(lines,$c,start)} \
|
||||
{$i <= $data(lines,$c,last)} { incr i} {
|
||||
$sel delete $i
|
||||
}
|
||||
}
|
||||
# Delete the selector if it exists
|
||||
if {[info exists data($c,index)]} {
|
||||
$sel delete $data($c,index)
|
||||
}
|
||||
|
||||
# Draw the selection polygons
|
||||
CreateSelector $w $sel $c
|
||||
$sel bind $data($c,index) <ButtonPress-1> \
|
||||
[list tk::dialog::color::StartMove $w $sel $c %x $data(selPad) 1]
|
||||
$sel bind $data($c,index) <B1-Motion> \
|
||||
[list tk::dialog::color::MoveSelector $w $sel $c %x $data(selPad)]
|
||||
$sel bind $data($c,index) <ButtonRelease-1> \
|
||||
[list tk::dialog::color::ReleaseMouse $w $sel $c %x $data(selPad)]
|
||||
|
||||
set height [winfo height $col]
|
||||
# Create an invisible region under the colorstrip to catch mouse clicks
|
||||
# that aren't on the selector.
|
||||
set data($c,clickRegion) [$sel create rectangle 0 0 \
|
||||
$data(canvasWidth) $height -fill {} -outline {}]
|
||||
|
||||
bind $col <ButtonPress-1> \
|
||||
[list tk::dialog::color::StartMove $w $sel $c %x $data(colorPad)]
|
||||
bind $col <B1-Motion> \
|
||||
[list tk::dialog::color::MoveSelector $w $sel $c %x $data(colorPad)]
|
||||
bind $col <ButtonRelease-1> \
|
||||
[list tk::dialog::color::ReleaseMouse $w $sel $c %x $data(colorPad)]
|
||||
|
||||
$sel bind $data($c,clickRegion) <ButtonPress-1> \
|
||||
[list tk::dialog::color::StartMove $w $sel $c %x $data(selPad)]
|
||||
$sel bind $data($c,clickRegion) <B1-Motion> \
|
||||
[list tk::dialog::color::MoveSelector $w $sel $c %x $data(selPad)]
|
||||
$sel bind $data($c,clickRegion) <ButtonRelease-1> \
|
||||
[list tk::dialog::color::ReleaseMouse $w $sel $c %x $data(selPad)]
|
||||
} else {
|
||||
# l is the canvas index of the first colorbar.
|
||||
set l $data(lines,$c,start)
|
||||
}
|
||||
|
||||
# Draw the color bars.
|
||||
set highlightW [expr {[$col cget -highlightthickness] + [$col cget -bd]}]
|
||||
for {set i 0} { $i < $data(NUM_COLORBARS)} { incr i} {
|
||||
set intensity [expr {$i * $data(intensityIncr)}]
|
||||
set startx [expr {$i * $data(colorbarWidth) + $highlightW}]
|
||||
if {$c eq "red"} {
|
||||
set color [format "#%02x%02x%02x" \
|
||||
$intensity \
|
||||
$data(green,intensity) \
|
||||
$data(blue,intensity)]
|
||||
} elseif {$c eq "green"} {
|
||||
set color [format "#%02x%02x%02x" \
|
||||
$data(red,intensity) \
|
||||
$intensity \
|
||||
$data(blue,intensity)]
|
||||
} else {
|
||||
set color [format "#%02x%02x%02x" \
|
||||
$data(red,intensity) \
|
||||
$data(green,intensity) \
|
||||
$intensity]
|
||||
}
|
||||
|
||||
if {$create} {
|
||||
set index [$col create rect $startx $highlightW \
|
||||
[expr {$startx +$data(colorbarWidth)}] \
|
||||
[expr {[winfo height $col] + $highlightW}]\
|
||||
-fill $color -outline $color]
|
||||
} else {
|
||||
$col itemconfigure $l -fill $color -outline $color
|
||||
incr l
|
||||
}
|
||||
}
|
||||
$sel raise $data($c,index)
|
||||
|
||||
if {$create} {
|
||||
set data(lines,$c,last) $index
|
||||
set data(lines,$c,start) [expr {$index - $data(NUM_COLORBARS) + 1}]
|
||||
}
|
||||
|
||||
RedrawFinalColor $w
|
||||
}
|
||||
|
||||
# ::tk::dialog::color::CreateSelector --
|
||||
#
|
||||
# Creates and draws the selector polygon at the position
|
||||
# $data($c,intensity).
|
||||
#
|
||||
proc ::tk::dialog::color::CreateSelector {w sel c } {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
set data($c,index) [$sel create polygon \
|
||||
0 $data(PLGN_HEIGHT) \
|
||||
$data(PLGN_WIDTH) $data(PLGN_HEIGHT) \
|
||||
$data(indent) 0]
|
||||
set data($c,x) [RgbToX $w $data($c,intensity)]
|
||||
$sel move $data($c,index) $data($c,x) 0
|
||||
}
|
||||
|
||||
# ::tk::dialog::color::RedrawFinalColor
|
||||
#
|
||||
# Combines the intensities of the three colors into the final color
|
||||
#
|
||||
proc ::tk::dialog::color::RedrawFinalColor {w} {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
set color [format "#%02x%02x%02x" $data(red,intensity) \
|
||||
$data(green,intensity) $data(blue,intensity)]
|
||||
|
||||
$data(finalCanvas) configure -background $color
|
||||
set data(finalColor) $color
|
||||
set data(selection) $color
|
||||
set data(finalRGB) [list \
|
||||
$data(red,intensity) \
|
||||
$data(green,intensity) \
|
||||
$data(blue,intensity)]
|
||||
}
|
||||
|
||||
# ::tk::dialog::color::RedrawColorBars --
|
||||
#
|
||||
# Only redraws the colors on the color strips that were not manipulated.
|
||||
# Params: color of colorstrip that changed. If color is not [red|green|blue]
|
||||
# Then all colorstrips will be updated
|
||||
#
|
||||
proc ::tk::dialog::color::RedrawColorBars {w colorChanged} {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
switch $colorChanged {
|
||||
red {
|
||||
DrawColorScale $w green
|
||||
DrawColorScale $w blue
|
||||
}
|
||||
green {
|
||||
DrawColorScale $w red
|
||||
DrawColorScale $w blue
|
||||
}
|
||||
blue {
|
||||
DrawColorScale $w red
|
||||
DrawColorScale $w green
|
||||
}
|
||||
default {
|
||||
DrawColorScale $w red
|
||||
DrawColorScale $w green
|
||||
DrawColorScale $w blue
|
||||
}
|
||||
}
|
||||
RedrawFinalColor $w
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# Event handlers
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
# ::tk::dialog::color::StartMove --
|
||||
#
|
||||
# Handles a mousedown button event over the selector polygon.
|
||||
# Adds the bindings for moving the mouse while the button is
|
||||
# pressed. Sets the binding for the button-release event.
|
||||
#
|
||||
# Params: sel is the selector canvas window, color is the color of the strip.
|
||||
#
|
||||
proc ::tk::dialog::color::StartMove {w sel color x delta {dontMove 0}} {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
if {!$dontMove} {
|
||||
MoveSelector $w $sel $color $x $delta
|
||||
}
|
||||
}
|
||||
|
||||
# ::tk::dialog::color::MoveSelector --
|
||||
#
|
||||
# Moves the polygon selector so that its middle point has the same
|
||||
# x value as the specified x. If x is outside the bounds [0,255],
|
||||
# the selector is set to the closest endpoint.
|
||||
#
|
||||
# Params: sel is the selector canvas, c is [red|green|blue]
|
||||
# x is a x-coordinate.
|
||||
#
|
||||
proc ::tk::dialog::color::MoveSelector {w sel color x delta} {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
incr x -$delta
|
||||
|
||||
if { $x < 0 } {
|
||||
set x 0
|
||||
} elseif { $x > $data(BARS_WIDTH)} {
|
||||
set x $data(BARS_WIDTH)
|
||||
}
|
||||
set diff [expr {$x - $data($color,x)}]
|
||||
$sel move $data($color,index) $diff 0
|
||||
set data($color,x) [expr {$data($color,x) + $diff}]
|
||||
|
||||
# Return the x value that it was actually set at
|
||||
return $x
|
||||
}
|
||||
|
||||
# ::tk::dialog::color::ReleaseMouse
|
||||
#
|
||||
# Removes mouse tracking bindings, updates the colorbars.
|
||||
#
|
||||
# Params: sel is the selector canvas, color is the color of the strip,
|
||||
# x is the x-coord of the mouse.
|
||||
#
|
||||
proc ::tk::dialog::color::ReleaseMouse {w sel color x delta} {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
set x [MoveSelector $w $sel $color $x $delta]
|
||||
|
||||
# Determine exactly what color we are looking at.
|
||||
set data($color,intensity) [XToRgb $w $x]
|
||||
|
||||
RedrawColorBars $w $color
|
||||
}
|
||||
|
||||
# ::tk::dialog::color::ResizeColorbars --
|
||||
#
|
||||
# Completely redraws the colorbars, including resizing the
|
||||
# colorstrips
|
||||
#
|
||||
proc ::tk::dialog::color::ResizeColorBars {w} {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
if { ($data(BARS_WIDTH) < $data(NUM_COLORBARS)) ||
|
||||
(($data(BARS_WIDTH) % $data(NUM_COLORBARS)) != 0)} {
|
||||
set data(BARS_WIDTH) $data(NUM_COLORBARS)
|
||||
}
|
||||
InitValues [winfo name $w]
|
||||
foreach color [list red green blue ] {
|
||||
$data($color,col) configure -width $data(canvasWidth)
|
||||
DrawColorScale $w $color 1
|
||||
}
|
||||
}
|
||||
|
||||
# ::tk::dialog::color::HandleSelEntry --
|
||||
#
|
||||
# Handles the return keypress event in the "Selection:" entry
|
||||
#
|
||||
proc ::tk::dialog::color::HandleSelEntry {w} {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
set text [string trim $data(selection)]
|
||||
# Check to make sure that the color is valid
|
||||
if {[catch {set color [winfo rgb . $text]} ]} {
|
||||
set data(selection) $data(finalColor)
|
||||
return
|
||||
}
|
||||
|
||||
set R [expr {[lindex $color 0]/0x100}]
|
||||
set G [expr {[lindex $color 1]/0x100}]
|
||||
set B [expr {[lindex $color 2]/0x100}]
|
||||
|
||||
SetRGBValue $w "$R $G $B"
|
||||
set data(selection) $text
|
||||
}
|
||||
|
||||
# ::tk::dialog::color::HandleRGBEntry --
|
||||
#
|
||||
# Handles the return keypress event in the R, G or B entry
|
||||
#
|
||||
proc ::tk::dialog::color::HandleRGBEntry {w} {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
foreach c [list red green blue] {
|
||||
if {[catch {
|
||||
set data($c,intensity) [expr {int($data($c,intensity))}]
|
||||
}]} {
|
||||
set data($c,intensity) 0
|
||||
}
|
||||
|
||||
if {$data($c,intensity) < 0} {
|
||||
set data($c,intensity) 0
|
||||
}
|
||||
if {$data($c,intensity) > 255} {
|
||||
set data($c,intensity) 255
|
||||
}
|
||||
}
|
||||
|
||||
SetRGBValue $w "$data(red,intensity) \
|
||||
$data(green,intensity) $data(blue,intensity)"
|
||||
}
|
||||
|
||||
# mouse cursor enters a color bar
|
||||
#
|
||||
proc ::tk::dialog::color::EnterColorBar {w color} {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
$data($color,sel) itemconfigure $data($color,index) -fill red
|
||||
}
|
||||
|
||||
# mouse leaves enters a color bar
|
||||
#
|
||||
proc ::tk::dialog::color::LeaveColorBar {w color} {
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
$data($color,sel) itemconfigure $data($color,index) -fill black
|
||||
}
|
||||
|
||||
# user hits OK button
|
||||
#
|
||||
proc ::tk::dialog::color::OkCmd {w} {
|
||||
variable ::tk::Priv
|
||||
upvar ::tk::dialog::color::[winfo name $w] data
|
||||
|
||||
set Priv(selectColor) $data(finalColor)
|
||||
}
|
||||
|
||||
# user hits Cancel button
|
||||
#
|
||||
proc ::tk::dialog::color::CancelCmd {w} {
|
||||
variable ::tk::Priv
|
||||
set Priv(selectColor) ""
|
||||
}
|
||||
|
1766
data/tcl/fsdialog.tcl
Normal file
322
data/themes/clearlooks/clearlooks.tcl
Normal file
|
@ -0,0 +1,322 @@
|
|||
# clearlooks.tcl
|
||||
|
||||
namespace eval tile::theme::clearlooks {
|
||||
|
||||
package provide tile::theme::clearlooks 0.1
|
||||
|
||||
variable I
|
||||
array set I [tile::LoadImages \
|
||||
[file join [file dirname [info script]] clearlooks] *.gif]
|
||||
|
||||
variable colors
|
||||
|
||||
array set colors {
|
||||
-frame "#efebe7"
|
||||
-lighter "#f5f3f0"
|
||||
-dark "#cfcdc8"
|
||||
-darker "#9e9a9e"
|
||||
-darkest "#d4cfca"
|
||||
-selectbg "#7c99ad"
|
||||
-selectfg "#ffffff"
|
||||
-disabledfg "#b5b3ac"
|
||||
-entryfocus "#6f9dc6"
|
||||
-tabbg "#c9c1bc"
|
||||
-tabborder "#b5aca7"
|
||||
-troughcolor "#d7cbbe"
|
||||
-troughborder "#ae9e8e"
|
||||
-checklight "#f5f3f0"
|
||||
}
|
||||
|
||||
|
||||
style theme create clearlooks -parent clam -settings {
|
||||
|
||||
style configure . \
|
||||
-borderwidth 1 \
|
||||
-background $colors(-frame) \
|
||||
-foreground black \
|
||||
-bordercolor $colors(-darkest) \
|
||||
-darkcolor $colors(-dark) \
|
||||
-lightcolor $colors(-lighter) \
|
||||
-troughcolor $colors(-troughcolor) \
|
||||
-selectforeground $colors(-selectfg) \
|
||||
-selectbackground $colors(-selectbg) \
|
||||
-font TkDefaultFont \
|
||||
;
|
||||
|
||||
style map . \
|
||||
-background [list disabled $colors(-frame) \
|
||||
active $colors(-lighter)] \
|
||||
-foreground [list disabled $colors(-disabledfg)] \
|
||||
-selectbackground [list !focus $colors(-darker)] \
|
||||
-selectforeground [list !focus white] \
|
||||
;
|
||||
|
||||
|
||||
# style configure Frame.border -relief groove
|
||||
|
||||
## Treeview.
|
||||
#
|
||||
style element create Treeheading.cell image $I(tree-n) \
|
||||
-map [list \
|
||||
selected $I(tree-p) \
|
||||
disabled $I(tree-d) \
|
||||
pressed $I(tree-p) \
|
||||
active $I(tree-h) \
|
||||
] \
|
||||
-border 4 -sticky ew
|
||||
|
||||
#style configure Treeview -fieldbackground white
|
||||
style configure Row -background "#efefef"
|
||||
style map Row -background [list \
|
||||
{focus selected} "#71869e" \
|
||||
selected "#969286" \
|
||||
alternate white]
|
||||
style map Item -foreground [list selected white]
|
||||
style map Cell -foreground [list selected white]
|
||||
|
||||
|
||||
## 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) \
|
||||
{selected active} $I(button-pa) \
|
||||
selected $I(button-p) \
|
||||
active $I(button-a) \
|
||||
disabled $I(button-d) \
|
||||
] \
|
||||
-border 4 -sticky ew
|
||||
|
||||
|
||||
## Checkbuttons.
|
||||
#
|
||||
style element create Checkbutton.indicator image $I(check-nu) \
|
||||
-width 24 -sticky w -map [list \
|
||||
{disabled selected} $I(check-dc) \
|
||||
disabled $I(check-du) \
|
||||
{pressed selected} $I(check-pc) \
|
||||
pressed $I(check-pu) \
|
||||
{active selected} $I(check-ac) \
|
||||
active $I(check-au) \
|
||||
selected $I(check-nc) ]
|
||||
|
||||
style map TCheckbutton -background [list active $colors(-checklight)]
|
||||
style configure TCheckbutton -padding 1
|
||||
|
||||
|
||||
## Radiobuttons.
|
||||
#
|
||||
style element create Radiobutton.indicator image $I(radio-nu) \
|
||||
-width 24 -sticky w \
|
||||
-map [list \
|
||||
{disabled selected} $I(radio-dc) \
|
||||
disabled $I(radio-du) \
|
||||
{pressed selected} $I(radio-pc) \
|
||||
pressed $I(radio-pu) \
|
||||
{active selected} $I(radio-ac) \
|
||||
active $I(radio-au) \
|
||||
selected $I(radio-nc) ]
|
||||
|
||||
style map TRadiobutton -background [list active $colors(-checklight)]
|
||||
style configure TRadiobutton -padding 1
|
||||
|
||||
|
||||
## Menubuttons.
|
||||
#
|
||||
#style configure TMenubutton -relief raised -padding {10 2}
|
||||
# style element create Menubutton.border image $I(toolbutton-n) \
|
||||
# -map [list \
|
||||
# pressed $I(toolbutton-p) \
|
||||
# selected $I(toolbutton-p) \
|
||||
# active $I(toolbutton-a) \
|
||||
# disabled $I(toolbutton-n)] \
|
||||
# -border {4 7 4 7} -sticky nsew
|
||||
|
||||
style element create Menubutton.border image $I(button-n) \
|
||||
-map [list \
|
||||
selected $I(button-p) \
|
||||
disabled $I(button-d) \
|
||||
active $I(button-a) \
|
||||
] \
|
||||
-border 4 -sticky ew
|
||||
|
||||
|
||||
## Toolbar buttons.
|
||||
#
|
||||
style configure Toolbutton -padding -5 -relief flat
|
||||
style configure Toolbutton.label -padding 0 -relief flat
|
||||
|
||||
style element create Toolbutton.border image $I(blank) \
|
||||
-map [list \
|
||||
pressed $I(toolbutton-p) \
|
||||
{selected active} $I(toolbutton-pa) \
|
||||
selected $I(toolbutton-p) \
|
||||
active $I(toolbutton-a) \
|
||||
disabled $I(blank)] \
|
||||
-border 11 -sticky nsew
|
||||
|
||||
|
||||
## Entry widgets.
|
||||
#
|
||||
style configure TEntry -padding 1 -insertwidth 1 \
|
||||
-fieldbackground white
|
||||
|
||||
style map TEntry \
|
||||
-fieldbackground [list readonly $colors(-frame)] \
|
||||
-bordercolor [list focus $colors(-selectbg)] \
|
||||
-lightcolor [list focus $colors(-entryfocus)] \
|
||||
-darkcolor [list focus $colors(-entryfocus)] \
|
||||
;
|
||||
|
||||
|
||||
## Combobox.
|
||||
#
|
||||
style configure TCombobox -selectbackground
|
||||
|
||||
style element create Combobox.downarrow image $I(comboarrow-n) \
|
||||
-map [list \
|
||||
disabled $I(comboarrow-d) \
|
||||
pressed $I(comboarrow-p) \
|
||||
active $I(comboarrow-a) \
|
||||
] \
|
||||
-border 1 -sticky {}
|
||||
|
||||
style element create Combobox.field image $I(combo-n) \
|
||||
-map [list \
|
||||
{readonly disabled} $I(combo-rd) \
|
||||
{readonly pressed} $I(combo-rp) \
|
||||
{readonly focus} $I(combo-rf) \
|
||||
readonly $I(combo-rn)
|
||||
] \
|
||||
-border 4 -sticky ew
|
||||
|
||||
|
||||
## Notebooks.
|
||||
#
|
||||
# style element create tab image $I(tab-a) -border {2 2 2 0} \
|
||||
# -map [list selected $I(tab-n)]
|
||||
|
||||
style configure TNotebook.Tab -padding {6 2 6 2}
|
||||
style map TNotebook.Tab \
|
||||
-padding [list selected {6 4 6 2}] \
|
||||
-background [list selected $colors(-frame) {} $colors(-tabbg)] \
|
||||
-lightcolor [list selected $colors(-lighter) {} $colors(-dark)] \
|
||||
-bordercolor [list selected $colors(-darkest) {} $colors(-tabborder)] \
|
||||
;
|
||||
|
||||
## Labelframes.
|
||||
#
|
||||
style configure TLabelframe -borderwidth 2 -relief groove
|
||||
|
||||
|
||||
## Scrollbars.
|
||||
#
|
||||
style layout Vertical.TScrollbar {
|
||||
Scrollbar.trough -sticky ns -children {
|
||||
Scrollbar.uparrow -side top
|
||||
Scrollbar.downarrow -side bottom
|
||||
Vertical.Scrollbar.thumb -side top -expand true -sticky ns
|
||||
}
|
||||
}
|
||||
|
||||
style layout Horizontal.TScrollbar {
|
||||
Scrollbar.trough -sticky we -children {
|
||||
Scrollbar.leftarrow -side left
|
||||
Scrollbar.rightarrow -side right
|
||||
Horizontal.Scrollbar.thumb -side left -expand true -sticky we
|
||||
}
|
||||
}
|
||||
|
||||
style element create Horizontal.Scrollbar.thumb image $I(sbthumb-hn) \
|
||||
-map [list \
|
||||
disabled $I(sbthumb-hd) \
|
||||
pressed $I(sbthumb-ha) \
|
||||
active $I(sbthumb-ha)] \
|
||||
-border 3
|
||||
|
||||
style element create Vertical.Scrollbar.thumb image $I(sbthumb-vn) \
|
||||
-map [list \
|
||||
disabled $I(sbthumb-vd) \
|
||||
pressed $I(sbthumb-va) \
|
||||
active $I(sbthumb-va)] \
|
||||
-border 3
|
||||
|
||||
foreach dir {up down left right} {
|
||||
style element create ${dir}arrow image $I(arrow${dir}-n) \
|
||||
-map [list \
|
||||
disabled $I(arrow${dir}-d) \
|
||||
pressed $I(arrow${dir}-p) \
|
||||
active $I(arrow${dir}-a)] \
|
||||
-border 1 -sticky {}
|
||||
}
|
||||
|
||||
style configure TScrollbar -bordercolor $colors(-troughborder)
|
||||
|
||||
|
||||
## Scales.
|
||||
#
|
||||
style element create Scale.slider image $I(scale-hn) \
|
||||
-map [list \
|
||||
disabled $I(scale-hd) \
|
||||
active $I(scale-ha) \
|
||||
]
|
||||
|
||||
style element create Scale.trough image $I(scaletrough-h) \
|
||||
-border 2 -sticky ew -padding 0
|
||||
|
||||
style element create Vertical.Scale.slider image $I(scale-vn) \
|
||||
-map [list \
|
||||
disabled $I(scale-vd) \
|
||||
active $I(scale-va) \
|
||||
]
|
||||
style element create Vertical.Scale.trough image $I(scaletrough-v) \
|
||||
-border 2 -sticky ns -padding 0
|
||||
|
||||
style configure TScale -bordercolor $colors(-troughborder)
|
||||
|
||||
|
||||
## Progressbar.
|
||||
#
|
||||
style element create Horizontal.Progressbar.pbar image $I(progress-h) \
|
||||
-border {2 2 1 1}
|
||||
style element create Vertical.Progressbar.pbar image $I(progress-v) \
|
||||
-border {2 2 1 1}
|
||||
|
||||
style configure TProgressbar -bordercolor $colors(-troughborder)
|
||||
|
||||
|
||||
## Statusbar parts.
|
||||
#
|
||||
style element create sizegrip image $I(sizegrip)
|
||||
|
||||
|
||||
## Paned window parts.
|
||||
#
|
||||
# style element create hsash image $I(hseparator-n) -border {2 0} \
|
||||
# -map [list {active !disabled} $I(hseparator-a)]
|
||||
# style element create vsash image $I(vseparator-n) -border {0 2} \
|
||||
# -map [list {active !disabled} $I(vseparator-a)]
|
||||
|
||||
style configure Sash -sashthickness 6 -gripcount 16
|
||||
|
||||
|
||||
## Separator.
|
||||
#
|
||||
#style element create separator image $I(sep-h)
|
||||
#style element create hseparator image $I(sep-h)
|
||||
#style element create vseparator image $I(sep-v)
|
||||
|
||||
}
|
||||
}
|
||||
|
BIN
data/themes/clearlooks/clearlooks/arrowdown-a.gif
Normal file
After Width: | Height: | Size: 245 B |
BIN
data/themes/clearlooks/clearlooks/arrowdown-d.gif
Normal file
After Width: | Height: | Size: 230 B |
BIN
data/themes/clearlooks/clearlooks/arrowdown-n.gif
Normal file
After Width: | Height: | Size: 246 B |
BIN
data/themes/clearlooks/clearlooks/arrowdown-p.gif
Normal file
After Width: | Height: | Size: 248 B |
BIN
data/themes/clearlooks/clearlooks/arrowleft-a.gif
Normal file
After Width: | Height: | Size: 248 B |
BIN
data/themes/clearlooks/clearlooks/arrowleft-d.gif
Normal file
After Width: | Height: | Size: 234 B |
BIN
data/themes/clearlooks/clearlooks/arrowleft-n.gif
Normal file
After Width: | Height: | Size: 252 B |
BIN
data/themes/clearlooks/clearlooks/arrowleft-p.gif
Normal file
After Width: | Height: | Size: 251 B |
BIN
data/themes/clearlooks/clearlooks/arrowright-a.gif
Normal file
After Width: | Height: | Size: 250 B |
BIN
data/themes/clearlooks/clearlooks/arrowright-d.gif
Normal file
After Width: | Height: | Size: 235 B |
BIN
data/themes/clearlooks/clearlooks/arrowright-n.gif
Normal file
After Width: | Height: | Size: 252 B |
BIN
data/themes/clearlooks/clearlooks/arrowright-p.gif
Normal file
After Width: | Height: | Size: 251 B |
BIN
data/themes/clearlooks/clearlooks/arrowup-a.gif
Normal file
After Width: | Height: | Size: 244 B |
BIN
data/themes/clearlooks/clearlooks/arrowup-d.gif
Normal file
After Width: | Height: | Size: 228 B |
BIN
data/themes/clearlooks/clearlooks/arrowup-n.gif
Normal file
After Width: | Height: | Size: 248 B |
BIN
data/themes/clearlooks/clearlooks/arrowup-p.gif
Normal file
After Width: | Height: | Size: 247 B |
BIN
data/themes/clearlooks/clearlooks/blank.gif
Normal file
After Width: | Height: | Size: 63 B |
BIN
data/themes/clearlooks/clearlooks/button-a.gif
Normal file
After Width: | Height: | Size: 661 B |
BIN
data/themes/clearlooks/clearlooks/button-d.gif
Normal file
After Width: | Height: | Size: 590 B |
BIN
data/themes/clearlooks/clearlooks/button-n.gif
Normal file
After Width: | Height: | Size: 656 B |
BIN
data/themes/clearlooks/clearlooks/button-p.gif
Normal file
After Width: | Height: | Size: 519 B |
BIN
data/themes/clearlooks/clearlooks/button-pa.gif
Normal file
After Width: | Height: | Size: 394 B |
BIN
data/themes/clearlooks/clearlooks/check-ac.gif
Normal file
After Width: | Height: | Size: 331 B |
BIN
data/themes/clearlooks/clearlooks/check-au.gif
Normal file
After Width: | Height: | Size: 96 B |
BIN
data/themes/clearlooks/clearlooks/check-dc.gif
Normal file
After Width: | Height: | Size: 223 B |
BIN
data/themes/clearlooks/clearlooks/check-du.gif
Normal file
After Width: | Height: | Size: 96 B |
BIN
data/themes/clearlooks/clearlooks/check-nc.gif
Normal file
After Width: | Height: | Size: 331 B |
BIN
data/themes/clearlooks/clearlooks/check-nu.gif
Normal file
After Width: | Height: | Size: 96 B |
BIN
data/themes/clearlooks/clearlooks/check-pc.gif
Normal file
After Width: | Height: | Size: 332 B |
BIN
data/themes/clearlooks/clearlooks/check-pu.gif
Normal file
After Width: | Height: | Size: 96 B |
BIN
data/themes/clearlooks/clearlooks/combo-n.gif
Normal file
After Width: | Height: | Size: 100 B |
BIN
data/themes/clearlooks/clearlooks/combo-ra.gif
Normal file
After Width: | Height: | Size: 527 B |
BIN
data/themes/clearlooks/clearlooks/combo-rd.gif
Normal file
After Width: | Height: | Size: 512 B |
BIN
data/themes/clearlooks/clearlooks/combo-rf.gif
Normal file
After Width: | Height: | Size: 550 B |
BIN
data/themes/clearlooks/clearlooks/combo-rn.gif
Normal file
After Width: | Height: | Size: 533 B |
BIN
data/themes/clearlooks/clearlooks/combo-rp.gif
Normal file
After Width: | Height: | Size: 402 B |
BIN
data/themes/clearlooks/clearlooks/comboarrow-a.gif
Normal file
After Width: | Height: | Size: 441 B |
BIN
data/themes/clearlooks/clearlooks/comboarrow-d.gif
Normal file
After Width: | Height: | Size: 432 B |
BIN
data/themes/clearlooks/clearlooks/comboarrow-n.gif
Normal file
After Width: | Height: | Size: 451 B |
BIN
data/themes/clearlooks/clearlooks/comboarrow-p.gif
Normal file
After Width: | Height: | Size: 450 B |
BIN
data/themes/clearlooks/clearlooks/progress-h.gif
Normal file
After Width: | Height: | Size: 281 B |
BIN
data/themes/clearlooks/clearlooks/progress-v.gif
Normal file
After Width: | Height: | Size: 304 B |
BIN
data/themes/clearlooks/clearlooks/radio-ac.gif
Normal file
After Width: | Height: | Size: 356 B |
BIN
data/themes/clearlooks/clearlooks/radio-au.gif
Normal file
After Width: | Height: | Size: 223 B |
BIN
data/themes/clearlooks/clearlooks/radio-dc.gif
Normal file
After Width: | Height: | Size: 362 B |
BIN
data/themes/clearlooks/clearlooks/radio-du.gif
Normal file
After Width: | Height: | Size: 226 B |
BIN
data/themes/clearlooks/clearlooks/radio-nc.gif
Normal file
After Width: | Height: | Size: 359 B |
BIN
data/themes/clearlooks/clearlooks/radio-nu.gif
Normal file
After Width: | Height: | Size: 226 B |
BIN
data/themes/clearlooks/clearlooks/radio-pc.gif
Normal file
After Width: | Height: | Size: 359 B |
BIN
data/themes/clearlooks/clearlooks/radio-pu.gif
Normal file
After Width: | Height: | Size: 225 B |
BIN
data/themes/clearlooks/clearlooks/sbthumb-ha.gif
Normal file
After Width: | Height: | Size: 276 B |
BIN
data/themes/clearlooks/clearlooks/sbthumb-hd.gif
Normal file
After Width: | Height: | Size: 263 B |
BIN
data/themes/clearlooks/clearlooks/sbthumb-hn.gif
Normal file
After Width: | Height: | Size: 278 B |
BIN
data/themes/clearlooks/clearlooks/sbthumb-hp.gif
Normal file
After Width: | Height: | Size: 278 B |
BIN
data/themes/clearlooks/clearlooks/sbthumb-va.gif
Normal file
After Width: | Height: | Size: 266 B |
BIN
data/themes/clearlooks/clearlooks/sbthumb-vd.gif
Normal file
After Width: | Height: | Size: 262 B |
BIN
data/themes/clearlooks/clearlooks/sbthumb-vn.gif
Normal file
After Width: | Height: | Size: 271 B |
BIN
data/themes/clearlooks/clearlooks/sbthumb-vp.gif
Normal file
After Width: | Height: | Size: 271 B |
BIN
data/themes/clearlooks/clearlooks/scale-ha.gif
Normal file
After Width: | Height: | Size: 474 B |
BIN
data/themes/clearlooks/clearlooks/scale-hd.gif
Normal file
After Width: | Height: | Size: 336 B |
BIN
data/themes/clearlooks/clearlooks/scale-hn.gif
Normal file
After Width: | Height: | Size: 477 B |
BIN
data/themes/clearlooks/clearlooks/scale-va.gif
Normal file
After Width: | Height: | Size: 526 B |
BIN
data/themes/clearlooks/clearlooks/scale-vd.gif
Normal file
After Width: | Height: | Size: 342 B |
BIN
data/themes/clearlooks/clearlooks/scale-vn.gif
Normal file
After Width: | Height: | Size: 511 B |
BIN
data/themes/clearlooks/clearlooks/scaletrough-h.gif
Normal file
After Width: | Height: | Size: 87 B |
BIN
data/themes/clearlooks/clearlooks/scaletrough-v.gif
Normal file
After Width: | Height: | Size: 111 B |
BIN
data/themes/clearlooks/clearlooks/sep-h.gif
Normal file
After Width: | Height: | Size: 40 B |
BIN
data/themes/clearlooks/clearlooks/sep-v.gif
Normal file
After Width: | Height: | Size: 40 B |
BIN
data/themes/clearlooks/clearlooks/sizegrip.gif
Normal file
After Width: | Height: | Size: 77 B |
BIN
data/themes/clearlooks/clearlooks/tab-a.gif
Normal file
After Width: | Height: | Size: 536 B |
BIN
data/themes/clearlooks/clearlooks/tab-n.gif
Normal file
After Width: | Height: | Size: 549 B |
BIN
data/themes/clearlooks/clearlooks/toolbutton-a.gif
Normal file
After Width: | Height: | Size: 554 B |
BIN
data/themes/clearlooks/clearlooks/toolbutton-d.gif
Normal file
After Width: | Height: | Size: 499 B |
BIN
data/themes/clearlooks/clearlooks/toolbutton-n.gif
Normal file
After Width: | Height: | Size: 557 B |
BIN
data/themes/clearlooks/clearlooks/toolbutton-p.gif
Normal file
After Width: | Height: | Size: 527 B |
BIN
data/themes/clearlooks/clearlooks/toolbutton-pa.gif
Normal file
After Width: | Height: | Size: 333 B |
BIN
data/themes/clearlooks/clearlooks/tree-d.gif
Normal file
After Width: | Height: | Size: 509 B |
BIN
data/themes/clearlooks/clearlooks/tree-h.gif
Normal file
After Width: | Height: | Size: 519 B |
BIN
data/themes/clearlooks/clearlooks/tree-n.gif
Normal file
After Width: | Height: | Size: 528 B |
BIN
data/themes/clearlooks/clearlooks/tree-p.gif
Normal file
After Width: | Height: | Size: 420 B |
28
data/themes/clearlooks/convert_imgs.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
|
||||
from_dir=images
|
||||
to_dir=clearlooks
|
||||
|
||||
|
||||
# transpose
|
||||
for t in $from_dir/sbthumb-v*.png; do
|
||||
echo transpose $t
|
||||
mv -f $t tmp.png
|
||||
convert tmp.png -transpose $t
|
||||
rm -f tmp.png
|
||||
done
|
||||
for t in progress scaletrough; do
|
||||
echo transpose $t
|
||||
convert $from_dir/$t-h.png -transpose $from_dir/$t-v.png
|
||||
done
|
||||
|
||||
|
||||
# convert to gif
|
||||
for f in $from_dir/*.png; do
|
||||
t=`basename $f .png`
|
||||
echo convert $t
|
||||
pngtopnm images/$t.png | ppmtogif -transparent==red > $to_dir/$t.gif
|
||||
done
|
||||
|
||||
|
||||
|
442
data/themes/clearlooks/create_imgs.py
Executable file
|
@ -0,0 +1,442 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- mode: python; coding: koi8-r; -*-
|
||||
|
||||
import os
|
||||
import gtk, gobject
|
||||
|
||||
imdir = 'images'
|
||||
imtype = 'png'
|
||||
background = '#efebe7'
|
||||
|
||||
#fill_color = 0xff000000 # red
|
||||
fill_color = int('ff000000', 16)
|
||||
|
||||
if not os.path.exists(imdir):
|
||||
os.mkdir(imdir)
|
||||
|
||||
gc = None
|
||||
def draw_rect():
|
||||
global gc
|
||||
if gc is None:
|
||||
gc = drawing_area.window.new_gc()
|
||||
colormap = gtk.gdk.colormap_get_system()
|
||||
gc.set_colormap(colormap)
|
||||
color = gtk.gdk.color_parse('red')
|
||||
colormap.alloc_color(color)
|
||||
gc.set_rgb_fg_color(color)
|
||||
drawing_area.window.draw_rectangle(gc, True, 0,0, 800,800)
|
||||
|
||||
|
||||
def save_image(fn, w, h, x=0, y=0):
|
||||
pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, w, h)
|
||||
pixbuf.fill(fill_color)
|
||||
pb = pixbuf.get_from_drawable(drawing_area.window,
|
||||
drawing_area.get_colormap(),
|
||||
x,y, 0,0, w,h)
|
||||
pb.save(os.path.join(imdir, fn+"."+imtype), imtype)
|
||||
drawing_area.window.clear()
|
||||
draw_rect()
|
||||
|
||||
|
||||
done = False
|
||||
def save_callback(*args):
|
||||
global done
|
||||
|
||||
|
||||
|
||||
if done: return
|
||||
done = True
|
||||
print 'create images'
|
||||
|
||||
style = drawing_area.get_style()
|
||||
draw_rect()
|
||||
|
||||
# separator
|
||||
w = 20
|
||||
style.paint_vline(drawing_area.window, gtk.STATE_NORMAL, None,
|
||||
drawing_area, "frame", 0, w, 0)
|
||||
save_image('sep-v', 2, w)
|
||||
style.paint_hline(drawing_area.window, gtk.STATE_NORMAL, None,
|
||||
drawing_area, "frame", 0, w, 0)
|
||||
save_image('sep-h', w, 2)
|
||||
|
||||
|
||||
# tree
|
||||
w, h = 32, 32
|
||||
w, h = 24, 24
|
||||
for fn, state, shadow in (
|
||||
("tree-n", gtk.STATE_NORMAL, gtk.SHADOW_OUT),
|
||||
("tree-h", gtk.STATE_PRELIGHT, gtk.SHADOW_OUT),
|
||||
("tree-p", gtk.STATE_ACTIVE, gtk.SHADOW_IN),
|
||||
("tree-d", gtk.STATE_INSENSITIVE, gtk.SHADOW_IN),
|
||||
):
|
||||
style.paint_box(drawing_area.window, state, shadow,
|
||||
None, drawing_area, "stepper", 0,0, w,h)
|
||||
save_image(fn, w, h)
|
||||
|
||||
|
||||
# sizegrip
|
||||
w, h = 16, 16
|
||||
fn = 'sizegrip'
|
||||
style.paint_resize_grip(drawing_area.window, gtk.STATE_NORMAL, None,
|
||||
drawing_area, "statusbar",
|
||||
gtk.gdk.WINDOW_EDGE_SOUTH_EAST, 0,0, w,h)
|
||||
save_image(fn, w, h)
|
||||
|
||||
|
||||
# progress
|
||||
w, h = 37+3, 16+3
|
||||
progress_style = progress.get_style()
|
||||
fn = 'progress-h'
|
||||
progress_style.paint_box(drawing_area.window,
|
||||
gtk.STATE_PRELIGHT, gtk.SHADOW_NONE,
|
||||
None, progress, "bar", 0,0, w,h)
|
||||
save_image(fn, w, h)
|
||||
|
||||
|
||||
# button
|
||||
w, h = 32, 32
|
||||
w, h = 28, 28
|
||||
for fn, state, shadow in (
|
||||
("button-n", gtk.STATE_NORMAL, gtk.SHADOW_OUT),
|
||||
("button-a", gtk.STATE_PRELIGHT, gtk.SHADOW_OUT),
|
||||
("button-p", gtk.STATE_ACTIVE, gtk.SHADOW_IN),
|
||||
("button-d", gtk.STATE_INSENSITIVE, gtk.SHADOW_OUT),
|
||||
):
|
||||
style.paint_box(drawing_area.window, state, shadow,
|
||||
None, drawing_area, "buttondefault", 0,0, w,h)
|
||||
save_image(fn, w, h)
|
||||
|
||||
style.paint_box(drawing_area.window, gtk.STATE_PRELIGHT, gtk.SHADOW_IN,
|
||||
None, togglebutton, "buttondefault", 0,0, w,h)
|
||||
save_image("button-pa", w, h)
|
||||
|
||||
|
||||
# toolbar
|
||||
w, h = 16, 16
|
||||
w, h = 24, 24
|
||||
|
||||
fn = "blank"
|
||||
pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, w, h)
|
||||
pixbuf.fill(fill_color)
|
||||
pixbuf.save(os.path.join(imdir, fn+"."+imtype), imtype)
|
||||
|
||||
for fn, state, shadow in (
|
||||
("toolbutton-n", gtk.STATE_NORMAL, gtk.SHADOW_OUT),
|
||||
("toolbutton-a", gtk.STATE_PRELIGHT, gtk.SHADOW_OUT),
|
||||
("toolbutton-p", gtk.STATE_ACTIVE, gtk.SHADOW_IN),
|
||||
("toolbutton-d", gtk.STATE_INSENSITIVE, gtk.SHADOW_IN),
|
||||
):
|
||||
style.paint_box(drawing_area.window, state, shadow,
|
||||
None, drawing_area, "buttondefault", 0,0, w,h)
|
||||
save_image(fn, w, h)
|
||||
|
||||
style.paint_box(drawing_area.window, gtk.STATE_PRELIGHT, gtk.SHADOW_IN,
|
||||
None, togglebutton, "buttondefault", 0,0, w,h)
|
||||
save_image("toolbutton-pa", w, h)
|
||||
|
||||
|
||||
# slider
|
||||
msl = hscroll.style_get_property("min_slider_length")
|
||||
msl = 20
|
||||
sw = hscroll.style_get_property("slider_width")
|
||||
print '>>', msl, sw
|
||||
for t, w, h, state, orient in (
|
||||
('hn', msl,sw, gtk.STATE_NORMAL, gtk.ORIENTATION_HORIZONTAL),
|
||||
('ha', msl,sw, gtk.STATE_PRELIGHT, gtk.ORIENTATION_HORIZONTAL),
|
||||
('hp', msl,sw, gtk.STATE_NORMAL, gtk.ORIENTATION_HORIZONTAL),
|
||||
('hd', msl,sw, gtk.STATE_INSENSITIVE, gtk.ORIENTATION_HORIZONTAL),
|
||||
|
||||
('vn', sw,msl, gtk.STATE_NORMAL, gtk.ORIENTATION_VERTICAL),
|
||||
('va', sw,msl, gtk.STATE_PRELIGHT, gtk.ORIENTATION_VERTICAL),
|
||||
('vp', sw,msl, gtk.STATE_NORMAL, gtk.ORIENTATION_VERTICAL),
|
||||
('vd', sw,msl, gtk.STATE_INSENSITIVE, gtk.ORIENTATION_VERTICAL),
|
||||
):
|
||||
fn = 'sbthumb-'+t
|
||||
if 0:
|
||||
style.paint_slider(drawing_area.window, state, gtk.SHADOW_OUT,
|
||||
None, drawing_area, "slider", 0,0, w,h, orient)
|
||||
else:
|
||||
if orient == gtk.ORIENTATION_VERTICAL:
|
||||
w, h = h, w
|
||||
style.paint_box(drawing_area.window, state, shadow,
|
||||
None, drawing_area, "stepper", 0,0, w,h)
|
||||
save_image(fn, w, h)
|
||||
|
||||
|
||||
msl = hscroll.style_get_property("min_slider_length")
|
||||
sw = hscroll.style_get_property("slider_width")
|
||||
# scale
|
||||
for t, w, h, state, orient in (
|
||||
('hn', msl,sw, gtk.STATE_NORMAL, gtk.ORIENTATION_HORIZONTAL),
|
||||
('ha', msl,sw, gtk.STATE_PRELIGHT, gtk.ORIENTATION_HORIZONTAL),
|
||||
('hd', msl,sw, gtk.STATE_INSENSITIVE, gtk.ORIENTATION_HORIZONTAL),
|
||||
('vn', sw,msl, gtk.STATE_NORMAL, gtk.ORIENTATION_VERTICAL),
|
||||
('va', sw,msl, gtk.STATE_PRELIGHT, gtk.ORIENTATION_VERTICAL),
|
||||
('vd', sw,msl, gtk.STATE_INSENSITIVE, gtk.ORIENTATION_VERTICAL),
|
||||
):
|
||||
fn = 'scale-'+t
|
||||
if orient == gtk.ORIENTATION_HORIZONTAL:
|
||||
detail = "hscale"
|
||||
else:
|
||||
detail = "vscale"
|
||||
style.paint_slider(drawing_area.window, state, gtk.SHADOW_OUT,
|
||||
None, drawing_area, detail, 0,0, w+2,h+2, orient)
|
||||
save_image(fn, w, h, 1, 1)
|
||||
|
||||
w, h = msl, sw
|
||||
fn = 'scaletrough-h'
|
||||
style.paint_box(drawing_area.window, gtk.STATE_ACTIVE, gtk.SHADOW_IN,
|
||||
None, scale, "trough", 0,0, w,h)
|
||||
save_image(fn, w, h)
|
||||
|
||||
|
||||
# arrow
|
||||
w = h = hscroll.style_get_property("stepper_size")
|
||||
#w = h = 15
|
||||
arrow_width = w / 2
|
||||
arrow_height = h / 2
|
||||
arrow_x = (w - arrow_width) / 2
|
||||
arrow_y = (h - arrow_height) / 2
|
||||
|
||||
alloc = hscroll.get_allocation()
|
||||
x0 = alloc.x
|
||||
x1 = alloc.x+alloc.width-w
|
||||
alloc = vscroll.get_allocation()
|
||||
y0 = alloc.y
|
||||
y1 = alloc.y+alloc.height-h
|
||||
|
||||
sn = gtk.STATE_NORMAL
|
||||
sp = gtk.STATE_PRELIGHT
|
||||
sa = gtk.STATE_ACTIVE
|
||||
si = gtk.STATE_INSENSITIVE
|
||||
|
||||
for fn, x, y, state, shadow, arrow_type, widget in (
|
||||
("arrowleft-n", x0, 0, sn, gtk.SHADOW_OUT, gtk.ARROW_LEFT, hscroll),
|
||||
("arrowleft-a", x0, 0, sp, gtk.SHADOW_OUT, gtk.ARROW_LEFT, hscroll),
|
||||
("arrowleft-p", x0, 0, sa, gtk.SHADOW_IN, gtk.ARROW_LEFT, hscroll),
|
||||
("arrowleft-d", x0, 0, si, gtk.SHADOW_OUT, gtk.ARROW_LEFT, hscroll),
|
||||
|
||||
("arrowright-n", x1, 0, sn, gtk.SHADOW_OUT, gtk.ARROW_RIGHT, hscroll),
|
||||
("arrowright-a", x1, 0, sp, gtk.SHADOW_OUT, gtk.ARROW_RIGHT, hscroll),
|
||||
("arrowright-p", x1, 0, sa, gtk.SHADOW_IN, gtk.ARROW_RIGHT, hscroll),
|
||||
("arrowright-d", x1, 0, si, gtk.SHADOW_OUT, gtk.ARROW_RIGHT, hscroll),
|
||||
|
||||
("arrowup-n", 0, y0, sn, gtk.SHADOW_OUT, gtk.ARROW_UP, vscroll),
|
||||
("arrowup-a", 0, y0, sp, gtk.SHADOW_OUT, gtk.ARROW_UP, vscroll),
|
||||
("arrowup-p", 0, y0, sa, gtk.SHADOW_IN, gtk.ARROW_UP, vscroll),
|
||||
("arrowup-d", 0, y0, si, gtk.SHADOW_OUT, gtk.ARROW_UP, vscroll),
|
||||
|
||||
("arrowdown-n", 0, y1, sn, gtk.SHADOW_OUT, gtk.ARROW_DOWN, vscroll),
|
||||
("arrowdown-a", 0, y1, sp, gtk.SHADOW_OUT, gtk.ARROW_DOWN, vscroll),
|
||||
("arrowdown-p", 0, y1, sa, gtk.SHADOW_IN, gtk.ARROW_DOWN, vscroll),
|
||||
("arrowdown-d", 0, y1, si, gtk.SHADOW_OUT, gtk.ARROW_DOWN, vscroll),
|
||||
):
|
||||
if 0:
|
||||
detail = 'hscrollbar'
|
||||
if widget is vscroll:
|
||||
detail = 'vscrollbar'
|
||||
else:
|
||||
x, y = 0, 0
|
||||
detail = 'stepper'
|
||||
widget = drawing_area
|
||||
style.paint_box(drawing_area.window, state, shadow,
|
||||
None, widget, detail, x,y, w,h)
|
||||
style.paint_arrow(drawing_area.window, state, shadow,
|
||||
None, widget, detail, arrow_type, True,
|
||||
x+arrow_x, y+arrow_y, arrow_width, arrow_height)
|
||||
save_image(fn, w, h, x, y)
|
||||
|
||||
|
||||
# combobox
|
||||
w, h = w, 24
|
||||
w, h = 16, 24
|
||||
alloc = hscroll.get_allocation()
|
||||
x1 = alloc.x+alloc.width-w
|
||||
arrow_width = w / 2
|
||||
arrow_height = h / 2
|
||||
arrow_x = (w - arrow_width) / 2
|
||||
arrow_y = (h - arrow_height) / 2
|
||||
detail = 'hscrollbar'
|
||||
widget = hscroll
|
||||
for fn, state, shadow, arrow_type in (
|
||||
("comboarrow-n", gtk.STATE_NORMAL, gtk.SHADOW_OUT, gtk.ARROW_DOWN),
|
||||
("comboarrow-a", gtk.STATE_PRELIGHT, gtk.SHADOW_OUT, gtk.ARROW_DOWN),
|
||||
("comboarrow-p", gtk.STATE_ACTIVE, gtk.SHADOW_IN, gtk.ARROW_DOWN),
|
||||
("comboarrow-d", gtk.STATE_INSENSITIVE, gtk.SHADOW_IN, gtk.ARROW_DOWN),
|
||||
):
|
||||
style.paint_box(drawing_area.window, state, shadow,
|
||||
None, widget, detail, x1,0, w,h)
|
||||
style.paint_arrow(drawing_area.window, state, shadow,
|
||||
None, drawing_area, "stepper", arrow_type, True,
|
||||
x1+arrow_x, arrow_y, arrow_width, arrow_height)
|
||||
save_image(fn, w, h, x1, 0)
|
||||
|
||||
w = 24
|
||||
for fn, state, shadow in (
|
||||
("combo-rn", gtk.STATE_NORMAL, gtk.SHADOW_OUT),
|
||||
("combo-ra", gtk.STATE_PRELIGHT, gtk.SHADOW_OUT),
|
||||
("combo-rp", gtk.STATE_ACTIVE, gtk.SHADOW_IN),
|
||||
("combo-rd", gtk.STATE_INSENSITIVE, gtk.SHADOW_OUT),
|
||||
):
|
||||
style.paint_box(drawing_area.window, state, shadow,
|
||||
None, drawing_area, "button", 0,0, w+2,h)
|
||||
save_image(fn, w, h)
|
||||
|
||||
style.paint_box(drawing_area.window, gtk.STATE_NORMAL, gtk.SHADOW_OUT,
|
||||
None, drawing_area, "button", 0,0, w+2,h)
|
||||
d = 3
|
||||
style.paint_focus(drawing_area.window, gtk.STATE_NORMAL,
|
||||
None, drawing_area, "button", d,d, w-2*d,h-2*d)
|
||||
save_image('combo-rf', w, h)
|
||||
|
||||
style.paint_shadow(drawing_area.window, gtk.STATE_NORMAL, gtk.SHADOW_IN,
|
||||
None, drawing_area, "entry", 0,0, w+2,h)
|
||||
save_image('combo-n', w, h)
|
||||
|
||||
|
||||
# checkbutton
|
||||
#define INDICATOR_SIZE 13
|
||||
#define INDICATOR_SPACING 2
|
||||
x, y = 2, 2
|
||||
w, h = 13, 13
|
||||
#w = h = checkbutton.style_get_property("indicator_size")
|
||||
for fn, state, shadow in (
|
||||
("check-nc", gtk.STATE_NORMAL, gtk.SHADOW_IN),
|
||||
("check-nu", gtk.STATE_NORMAL, gtk.SHADOW_OUT),
|
||||
("check-ac", gtk.STATE_PRELIGHT, gtk.SHADOW_IN),
|
||||
("check-au", gtk.STATE_PRELIGHT, gtk.SHADOW_OUT),
|
||||
("check-pc", gtk.STATE_ACTIVE, gtk.SHADOW_IN),
|
||||
("check-pu", gtk.STATE_ACTIVE, gtk.SHADOW_OUT),
|
||||
("check-dc", gtk.STATE_INSENSITIVE, gtk.SHADOW_IN),
|
||||
("check-du", gtk.STATE_INSENSITIVE, gtk.SHADOW_OUT),
|
||||
):
|
||||
## style.paint_flat_box(drawing_area.window,
|
||||
## gtk.STATE_PRELIGHT,
|
||||
## gtk.SHADOW_ETCHED_OUT,
|
||||
## gtk.gdk.Rectangle(0,0,w,h), drawing_area,
|
||||
## "checkbutton", 0,0, w,h)
|
||||
|
||||
style.paint_check(drawing_area.window, state, shadow,
|
||||
None, drawing_area, "checkbutton", x,y, w,h)
|
||||
save_image(fn, w+2*x, h+2*y)
|
||||
|
||||
|
||||
# radiobutton
|
||||
for fn, state, shadow in (
|
||||
("radio-nc", gtk.STATE_NORMAL, gtk.SHADOW_IN),
|
||||
("radio-nu", gtk.STATE_NORMAL, gtk.SHADOW_OUT),
|
||||
("radio-ac", gtk.STATE_PRELIGHT, gtk.SHADOW_IN),
|
||||
("radio-au", gtk.STATE_PRELIGHT, gtk.SHADOW_OUT),
|
||||
("radio-pc", gtk.STATE_ACTIVE, gtk.SHADOW_IN),
|
||||
("radio-pu", gtk.STATE_ACTIVE, gtk.SHADOW_OUT),
|
||||
("radio-dc", gtk.STATE_INSENSITIVE, gtk.SHADOW_IN),
|
||||
("radio-du", gtk.STATE_INSENSITIVE, gtk.SHADOW_OUT),
|
||||
):
|
||||
## style.paint_flat_box(drawing_area.window,
|
||||
## gtk.STATE_PRELIGHT,
|
||||
## gtk.SHADOW_ETCHED_OUT,
|
||||
## gtk.gdk.Rectangle(0,0,w,h), drawing_area,
|
||||
## "checkbutton", 0,0, w,h)
|
||||
style.paint_option(drawing_area.window, state, shadow,
|
||||
None, drawing_area, "radiobutton", x,y, w,h)
|
||||
save_image(fn, w+2*x, h+2*y)
|
||||
|
||||
|
||||
# notebook
|
||||
w, h = 28, 22
|
||||
state = gtk.STATE_NORMAL
|
||||
shadow = gtk.SHADOW_OUT
|
||||
|
||||
for fn, gap_h, state in (
|
||||
("tab-n", 0, gtk.STATE_NORMAL),
|
||||
("tab-a", 2, gtk.STATE_ACTIVE),
|
||||
):
|
||||
## style.paint_box_gap(drawing_area.window, state, shadow,
|
||||
## gtk.gdk.Rectangle(0,0,w,gap_h), drawing_area,
|
||||
## "notebook", 0,0, w,gap_h, gtk.POS_TOP, 0, w)
|
||||
y = gap_h
|
||||
hh = h - y
|
||||
style.paint_extension(drawing_area.window, state, gtk.SHADOW_OUT,
|
||||
None, drawing_area, "tab",
|
||||
0,y, w,hh, gtk.POS_BOTTOM)
|
||||
save_image(fn, w, h+2)
|
||||
|
||||
|
||||
|
||||
print 'done'
|
||||
|
||||
gtk.main_quit()
|
||||
|
||||
|
||||
def pack(w, row, col):
|
||||
table.attach(w,
|
||||
col, col+1, row, row+1,
|
||||
gtk.EXPAND | gtk.FILL, gtk.EXPAND | gtk.FILL,
|
||||
0, 0)
|
||||
|
||||
win = gtk.Window()
|
||||
win.connect("destroy", gtk.main_quit)
|
||||
|
||||
table = gtk.Table()
|
||||
win.add(table)
|
||||
|
||||
row, col = 0, 0
|
||||
|
||||
drawing_area = gtk.DrawingArea()
|
||||
#drawing_area.set_size_request(100, 100)
|
||||
pack(drawing_area, row, col)
|
||||
row += 1
|
||||
|
||||
vscroll = gtk.VScrollbar()
|
||||
pack(vscroll, 0, 1)
|
||||
|
||||
hscroll = gtk.HScrollbar()
|
||||
pack(hscroll, row, col)
|
||||
row += 1
|
||||
|
||||
|
||||
notebook = gtk.Notebook()
|
||||
label = gtk.Label("Label")
|
||||
notebook.append_page(label)
|
||||
label = gtk.Label("Label")
|
||||
notebook.append_page(label)
|
||||
pack(notebook, row, col)
|
||||
row += 1
|
||||
|
||||
button = gtk.Button("Button")
|
||||
pack(button, row, col)
|
||||
row += 1
|
||||
|
||||
checkbutton = gtk.CheckButton("CheckButton")
|
||||
pack(checkbutton, row, col)
|
||||
row += 1
|
||||
|
||||
progress = gtk.ProgressBar()
|
||||
pack(progress, row, col)
|
||||
row += 1
|
||||
|
||||
scale = gtk.HScale()
|
||||
pack(scale, row, col)
|
||||
row += 1
|
||||
|
||||
entry = gtk.Entry()
|
||||
pack(entry, row, col)
|
||||
row += 1
|
||||
|
||||
togglebutton = gtk.ToggleButton()
|
||||
pack(togglebutton, row, col)
|
||||
togglebutton.set_active(True)
|
||||
row += 1
|
||||
|
||||
|
||||
drawing_area.connect("expose-event", save_callback)
|
||||
#gobject.timeout_add(2000, save_callback)
|
||||
|
||||
win.show_all()
|
||||
#drawing_area.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('red'))
|
||||
|
||||
gtk.main()
|
||||
|
||||
|
||||
|
7
data/themes/clearlooks/pkgIndex.tcl
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Package index for tile demo pixmap themes.
|
||||
|
||||
if {[file isdirectory [file join $dir clearlooks]]} {
|
||||
package ifneeded tile::theme::clearlooks 0.1 \
|
||||
[list source [file join $dir clearlooks.tcl]]
|
||||
}
|
||||
|
|
@ -281,8 +281,8 @@ class Options:
|
|||
|
||||
def setDefaults(self, top=None):
|
||||
# toolbar
|
||||
if WIN_SYSTEM == 'win32':
|
||||
self.toolbar_style = 'crystal'
|
||||
#if WIN_SYSTEM == 'win32':
|
||||
# self.toolbar_style = 'crystal'
|
||||
# fonts
|
||||
if WIN_SYSTEM == 'win32':
|
||||
self.fonts["sans"] = ("times new roman", 12)
|
||||
|
|
|
@ -120,10 +120,13 @@ class CustomGame(Game):
|
|||
'waste' : False,
|
||||
'texts' : True,
|
||||
}
|
||||
playcards = 0
|
||||
if s['talon'] is InitialDealTalonStack:
|
||||
layout_kw['texts'] = False
|
||||
layout_kw['playcards'] = max(
|
||||
16, 12+s['deal_face_down']+s['deal_face_up'])
|
||||
playcards = 12 + 52 * s['decks'] / s['rows_num']
|
||||
else:
|
||||
playcards = 12 + s['deal_face_down'] + s['deal_face_up']
|
||||
layout_kw['playcards'] = max(16, playcards)
|
||||
if s['talon'] in (DealRowRedealTalonStack,
|
||||
SpiderTalonStack,
|
||||
GroundForADivorceTalonStack):
|
||||
|
|
|
@ -193,14 +193,16 @@ class Game:
|
|||
##self.top.bind('<ButtonPress>', self.top._sleepEvent)
|
||||
##self.top.bind('<3>', self.top._sleepEvent)
|
||||
# update display properties
|
||||
self.top.wm_geometry("") # cancel user-specified geometry
|
||||
self.canvas.busy = True
|
||||
self.canvas.setInitialSize(self.width, self.height)
|
||||
if self.app.opt.save_games_geometry and \
|
||||
self.id in self.app.opt.games_geometry:
|
||||
# restore game geometry
|
||||
w, h = self.app.opt.games_geometry[self.id]
|
||||
self.canvas.config(width=w, height=h)
|
||||
self.top.update_idletasks() # apply geometry now
|
||||
self.top.wm_geometry("") # cancel user-specified geometry
|
||||
self.top.update_idletasks()
|
||||
self.canvas.busy = False
|
||||
if DEBUG >= 4:
|
||||
MfxCanvasRectangle(self.canvas, 0, 0, self.width, self.height,
|
||||
width=2, fill=None, outline='green')
|
||||
|
@ -2665,7 +2667,6 @@ for %d moves.
|
|||
self.updatePlayTime(do_after=0)
|
||||
reset_solver_dialog()
|
||||
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
|
@ -2694,6 +2695,7 @@ for %d moves.
|
|||
self.updateText()
|
||||
self.updateStatus(moves=(self.moves.index, self.stats.total_moves))
|
||||
self.updateMenus()
|
||||
reset_solver_dialog()
|
||||
|
||||
def redo(self):
|
||||
assert self.canRedo()
|
||||
|
@ -2718,6 +2720,7 @@ for %d moves.
|
|||
self.updateText()
|
||||
self.updateStatus(moves=(self.moves.index, self.stats.total_moves))
|
||||
self.updateMenus()
|
||||
reset_solver_dialog()
|
||||
|
||||
|
||||
#
|
||||
|
|
|
@ -110,8 +110,8 @@ def init():
|
|||
sys.argv.remove('--tile')
|
||||
if settings.TOOLKIT == 'tk':
|
||||
import Tkinter
|
||||
from Tkinter import TclError
|
||||
root = Tkinter.Tk(className='PySol')
|
||||
root.withdraw()
|
||||
settings.WIN_SYSTEM = root.tk.call('tk', 'windowingsystem')
|
||||
if settings.WIN_SYSTEM == 'aqua':
|
||||
# TkAqua displays the console automatically in application
|
||||
|
@ -119,13 +119,12 @@ def init():
|
|||
from macosx.appSupport import hideTkConsole
|
||||
hideTkConsole(root)
|
||||
#
|
||||
root.withdraw()
|
||||
if settings.USE_TILE == 'auto':
|
||||
# check tile
|
||||
# check Tile
|
||||
settings.USE_TILE = False
|
||||
try:
|
||||
root.tk.call('package', 'require', 'tile', '0.7.8')
|
||||
except TclError:
|
||||
except Tkinter.TclError:
|
||||
pass
|
||||
else:
|
||||
settings.USE_TILE = True
|
||||
|
|
|
@ -1,28 +1,25 @@
|
|||
|
||||
from pysollib.settings import WIN_SYSTEM
|
||||
# http://tkinter.unpythonic.net/wiki/TileWrapper
|
||||
|
||||
import Tkinter
|
||||
from Tkconstants import *
|
||||
|
||||
|
||||
BooleanVar = Tkinter.BooleanVar
|
||||
IntVar = Tkinter.IntVar
|
||||
DoubleVar = Tkinter.DoubleVar
|
||||
StringVar = Tkinter.StringVar
|
||||
def initialize(root=None):
|
||||
if root is None:
|
||||
root = Tkinter._default_root
|
||||
root.tk.call("package", "require", "tile", "0.7.8")
|
||||
# This forces an update of the available packages list.
|
||||
# It's required for package names to find the themes in data/themes/
|
||||
root.tk.call('eval', '[package unknown]', 'Tcl', '[package provide Tcl]')
|
||||
|
||||
Tk = Tkinter.Tk
|
||||
Toplevel = Tkinter.Toplevel
|
||||
Menu = Tkinter.Menu
|
||||
Message = Tkinter.Message
|
||||
Listbox = Tkinter.Listbox
|
||||
Text = Tkinter.Text
|
||||
Canvas = Tkinter.Canvas
|
||||
Spinbox = Tkinter.Spinbox
|
||||
def availableThemes(root=None):
|
||||
if root is None:
|
||||
root = Tkinter._default_root
|
||||
return root.tk.call("tile::availableThemes")
|
||||
|
||||
PhotoImage = Tkinter.PhotoImage
|
||||
Event = Tkinter.Event
|
||||
TkVersion = Tkinter.TkVersion
|
||||
TclError = Tkinter.TclError
|
||||
def setTheme(root=None, theme=None):
|
||||
if root is None:
|
||||
root = Tkinter._default_root
|
||||
return root.tk.call("tile::setTheme", theme)
|
||||
|
||||
|
||||
class Style(Tkinter.Misc):
|
||||
|
@ -33,18 +30,21 @@ class Style(Tkinter.Misc):
|
|||
|
||||
def default(self, style, **kw):
|
||||
"""Sets the default value of the specified option(s) in style"""
|
||||
pass
|
||||
opts = self._options(kw)
|
||||
return self.tk.call("style", "default", style, *opts)
|
||||
|
||||
def map_style(self, **kw):
|
||||
"""Sets dynamic values of the specified option(s) in style. See
|
||||
"STATE MAPS", below."""
|
||||
pass
|
||||
"STATE MAPS", below.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def layout(self, style, layoutSpec):
|
||||
"""Define the widget layout for style style. See "LAYOUTS" below
|
||||
for the format of layoutSpec. If layoutSpec is omitted, return the
|
||||
layout specification for style style. """
|
||||
pass
|
||||
layout specification for style style.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def element_create(self, name, type, *args):
|
||||
"""Creates a new element in the current theme of type type. The
|
||||
|
@ -52,11 +52,11 @@ class Style(Tkinter.Misc):
|
|||
themes may define other element types (see
|
||||
Ttk_RegisterElementFactory).
|
||||
"""
|
||||
pass
|
||||
raise NotImplementedError()
|
||||
|
||||
def element_names(self):
|
||||
"""Returns a list of all elements defined in the current theme. """
|
||||
pass
|
||||
"""Returns a list of all elements defined in the current theme."""
|
||||
return self.tk.call("style", "elements", "names")
|
||||
|
||||
def theme_create(self, name, parent=None, basedon=None):
|
||||
"""Creates a new theme. It is an error if themeName already exists.
|
||||
|
@ -65,17 +65,17 @@ class Style(Tkinter.Misc):
|
|||
script is evaluated in the context of the new theme as per style theme
|
||||
settings.
|
||||
"""
|
||||
pass
|
||||
raise NotImplementedError()
|
||||
|
||||
def theme_settings(self, name, script):
|
||||
"""Temporarily sets the current theme to themeName, evaluate script,
|
||||
then restore the previous theme. Typically script simply defines styles
|
||||
and elements, though arbitrary Tcl code may appear.
|
||||
"""Temporarily sets the current theme to themeName, evaluate script,
|
||||
then restore the previous theme. Typically script simply defines
|
||||
styles and elements, though arbitrary Tcl code may appear.
|
||||
"""
|
||||
pass
|
||||
raise NotImplementedError()
|
||||
|
||||
def theme_names(self):
|
||||
"""Returns a list of the available themes. """
|
||||
"""Returns a list of the available themes."""
|
||||
return self.tk.call("style", "theme", "names")
|
||||
|
||||
def theme_use(self, theme):
|
||||
|
@ -263,6 +263,7 @@ class Notebook(Widget):
|
|||
properly if all panes are direct children of the notebook."""
|
||||
return self.tk.call("ttk::notebook::enableTraversal", self._w)
|
||||
|
||||
|
||||
class Paned(Widget):
|
||||
"""
|
||||
WIDGET OPTIONS
|
||||
|
@ -300,10 +301,11 @@ class Paned(Widget):
|
|||
self.tk.call(self._w, "forget", pane)
|
||||
|
||||
def insert(self, pos, subwindow, **kw):
|
||||
"""Inserts a pane at the specified position. pos is either the string
|
||||
end, an integer index, or the name of a managed subwindow. If subwindow
|
||||
is already managed by the paned window, moves it to the specified
|
||||
position. See PANE OPTIONS for the list of available options.
|
||||
"""Inserts a pane at the specified position. pos is either the string
|
||||
end, an integer index, or the name of a managed subwindow. If
|
||||
subwindow is already managed by the paned window, moves it to the
|
||||
specified position. See PANE OPTIONS for the list of available
|
||||
options.
|
||||
"""
|
||||
return self.tk.call((self._w, "insert", pos, subwindow) + self._options(kw))
|
||||
|
||||
|
@ -325,13 +327,21 @@ class Progressbar(Widget):
|
|||
|
||||
def step(self, amount=1.0):
|
||||
"""Increments the -value by amount. amount defaults to 1.0
|
||||
if omitted. """
|
||||
if omitted.
|
||||
"""
|
||||
return self.tk.call(self._w, "step", amount)
|
||||
|
||||
def start(self):
|
||||
self.tk.call("ttk::progressbar::start", self._w)
|
||||
def start(self, interval=None):
|
||||
"""Begin autoincrement mode: schedules a recurring timer event that
|
||||
calls step every interval milliseconds. If omitted, interval defaults
|
||||
to 50 milliseconds (20 steps/second).
|
||||
"""
|
||||
self.tk.call("ttk::progressbar::start", self._w, interval)
|
||||
|
||||
def stop(self):
|
||||
"""Stop autoincrement mode: cancels any recurring timer event
|
||||
initiated by pathName start.
|
||||
"""
|
||||
self.tk.call("ttk::progressbar::stop", self._w)
|
||||
|
||||
|
||||
|
@ -344,11 +354,6 @@ class Scrollbar(Widget, Tkinter.Scrollbar):
|
|||
def __init__(self, master=None, cnf={}, **kw):
|
||||
Widget.__init__(self, master, "ttk::scrollbar", cnf, kw)
|
||||
|
||||
# from http://tkinter.unpythonic.net/wiki/PyLocateTile :
|
||||
# standard Tk scrollbars work on OS X, but Tile ones look weird
|
||||
if WIN_SYSTEM == "aqua":
|
||||
Scrollbar = Tkinter.Scrollbar
|
||||
|
||||
|
||||
class Separator(Widget):
|
||||
def __init__(self, master=None, cnf={}, **kw):
|
||||
|
@ -369,6 +374,9 @@ class Treeview(Widget, Tkinter.Listbox):
|
|||
the items in newchildren may be an ancestor of item.
|
||||
"""
|
||||
return self.tk.call(self._w, "children", item, newchildren)
|
||||
# Workaround: `children' overwrite in Tkinter.BaseWidget.__init__
|
||||
child = children
|
||||
tree_children = children
|
||||
|
||||
def column(self, column, **kw):
|
||||
"""Query or modify the options for the specified column.
|
||||
|
@ -433,35 +441,35 @@ class Treeview(Widget, Tkinter.Listbox):
|
|||
"""
|
||||
return self.tk.call((self._w, 'heading', column) + self._options(kw))
|
||||
|
||||
def identify(self, x, y):
|
||||
"""Returns a description of the widget component under the point given
|
||||
by x and y. The return value is a list with one of the following forms:
|
||||
def identify(self, component, x, y):
|
||||
"""Returns a description of the specified component under the point
|
||||
given by x and y, or the empty string if no such component is
|
||||
present at that position. The following subcommands are
|
||||
supported:
|
||||
|
||||
heading #n
|
||||
The column heading for display column #n.
|
||||
separator #n
|
||||
The border to the right of display column #n.
|
||||
cell itemid #n
|
||||
The data value for item itemid in display column #n.
|
||||
item itemid element
|
||||
The tree label for item itemid; element is one of text, image, or
|
||||
indicator, or another element name depending on the style.
|
||||
row itemid
|
||||
The y position is over the item but x does not identify any element
|
||||
or displayed data value.
|
||||
nothing
|
||||
The coordinates are not over any identifiable object.
|
||||
pathname identify row x y
|
||||
Returns the item ID of the item at position y.
|
||||
|
||||
See COLUMN IDENTIFIERS for a discussion of display columns and data
|
||||
pathname identify column x y
|
||||
Returns the data column identifier of the cell at position x.
|
||||
The tree column has ID #0.
|
||||
|
||||
See COLUMN IDENTIFIERS for a discussion of display columns and data
|
||||
columns.
|
||||
"""
|
||||
pass
|
||||
return self.tk.call(self._w, "identify", component, x, y)
|
||||
|
||||
def identify_row(self, x, y):
|
||||
return self.identify('row', x, y)
|
||||
|
||||
def identify_column(self, x, y):
|
||||
return self.identify('column', x, y)
|
||||
|
||||
def index(self, item):
|
||||
"""Returns the integer index of item within its parent's list of
|
||||
children.
|
||||
"""
|
||||
pass
|
||||
return self.tk.call(self._w, "index", item)
|
||||
|
||||
def insert(self, parent, index, id=None, **kw):
|
||||
"""Creates a new item. parent is the item ID of the parent item, or
|
||||
|
@ -488,7 +496,7 @@ class Treeview(Widget, Tkinter.Listbox):
|
|||
item's options are updated with the specified values. See ITEM OPTIONS
|
||||
for the list of available options.
|
||||
"""
|
||||
pass
|
||||
return self.tk.call((self._w, 'item') + self._options(kw))
|
||||
|
||||
def move(self, item, parent, index):
|
||||
"""Moves item to position index in parent's list of children. It is
|
||||
|
@ -498,148 +506,105 @@ class Treeview(Widget, Tkinter.Listbox):
|
|||
beginning; if greater than or equal to the number of children, it's
|
||||
moved to the end.
|
||||
"""
|
||||
pass
|
||||
return self.tk.call(self._w, 'move', item, parent, index)
|
||||
|
||||
def next(self, item):
|
||||
"""Returns the identifier of item's next sibling, or {} if item is the
|
||||
last child of its parent.
|
||||
"""
|
||||
pass
|
||||
return self.tk.call(self._w, 'next', item)
|
||||
|
||||
def parent(self, item):
|
||||
"""Returns the ID of the parent of item, or {} if item is at the top
|
||||
level of the hierarchy.
|
||||
"""
|
||||
pass
|
||||
return self.tk.call(self._w, 'parent', item)
|
||||
|
||||
def prev(self, item):
|
||||
"""Returns the identifier of item's previous sibling, or {} if item is
|
||||
the first child of its parent.
|
||||
"""
|
||||
pass
|
||||
return self.tk.call(self._w, 'prev', item)
|
||||
|
||||
def selection(self):
|
||||
"""Returns the list of selected items"""
|
||||
"""Returns the list of selected items."""
|
||||
return self.tk.call(self._w, "selection")
|
||||
|
||||
def selection_set(self, items):
|
||||
"""items becomes the new selection. """
|
||||
pass
|
||||
"""items becomes the new selection."""
|
||||
return self.tk.call(self._w, "selection", "set", items)
|
||||
|
||||
def selection_add(self, items):
|
||||
"""Add items to the selection """
|
||||
pass
|
||||
"""Add items to the selection."""
|
||||
return self.tk.call(self._w, "selection", "add", items)
|
||||
|
||||
def selection_remove(self, items):
|
||||
"""Remove items from the selection """
|
||||
pass
|
||||
"""Remove items from the selection."""
|
||||
return self.tk.call(self._w, "selection", "remove", items)
|
||||
|
||||
def selection_toggle(self, items):
|
||||
"""Toggle the selection state of each item in items. """
|
||||
pass
|
||||
"""Toggle the selection state of each item in items."""
|
||||
return self.tk.call(self._w, "selection", "toggle", items)
|
||||
|
||||
def set(self, item, column, value=None):
|
||||
"""If value is specified, sets the value of column column in item item,
|
||||
otherwise returns the current value. See COLUMN IDENTIFIERS.
|
||||
"""If value is specified, sets the value of column column in item
|
||||
item, otherwise returns the current value. See COLUMN IDENTIFIERS.
|
||||
"""
|
||||
pass
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
|
||||
if __name__=="__main__":
|
||||
def callback():
|
||||
print "Hello"
|
||||
|
||||
def test():
|
||||
import sys
|
||||
root = Tkinter.Tk()
|
||||
root.tk.call("package", "require", "tile")
|
||||
|
||||
b = Button(root, text="Tile Button", command=callback)
|
||||
b.pack()
|
||||
|
||||
#~ c = Checkbutton(root)
|
||||
#~ c.pack()
|
||||
#~ print b.theme_names()
|
||||
|
||||
#~ cb = Combobox(root)
|
||||
#~ cb.pack()
|
||||
|
||||
#~ e = Entry(root)
|
||||
#~ e.validate()
|
||||
#~ e.pack()
|
||||
|
||||
#~ l = Label(root, text="Tile Label")
|
||||
#~ l.pack()
|
||||
|
||||
|
||||
#~ mb = Menubutton(root)
|
||||
#~ mb.pack()
|
||||
|
||||
|
||||
#~ nb = Notebook(root)
|
||||
|
||||
#~ f1 = Label(nb, text="page1")
|
||||
#~ nb.add(f1, text="Page1")
|
||||
#~ f1.pack()
|
||||
|
||||
#~ f2 = Label(nb, text="page2")
|
||||
#~ nb.add(f2, text="Page 2")
|
||||
#~ f2.pack()
|
||||
|
||||
#~ nb.pack()
|
||||
|
||||
|
||||
pb = Progressbar(root, mode="indeterminate")
|
||||
pb.pack()
|
||||
|
||||
|
||||
pb.start()
|
||||
b = Button(root, text="Start", command=pb.start)
|
||||
b.pack()
|
||||
b = Button(root, text="Stop", command=pb.stop)
|
||||
b.pack()
|
||||
|
||||
#~ rb = Radiobutton(root)
|
||||
#~ rb.pack()
|
||||
|
||||
#~ text = Tkinter.Text(root)
|
||||
#~ scrol = Scrollbar(root)
|
||||
#~ text.pack(side="left", fill="both", expand="yes")
|
||||
#~ scrol.pack(side="left", fill="y")
|
||||
#~ text['yscrollcommand'] = scrol.set
|
||||
#~ scrol['command'] = text.yview
|
||||
|
||||
|
||||
#~ l = Label(root, text="Label1")
|
||||
#~ l.pack()
|
||||
#~ s = Separator(root)
|
||||
#~ s.pack(fill="x")
|
||||
#~ l = Label(root, text="Label2")
|
||||
#~ l.pack()
|
||||
|
||||
|
||||
b.theme_use("default")
|
||||
|
||||
#~ b1 = Tkinter.Button(root, text="Tk Button", command=callback)
|
||||
#~ b1.pack()
|
||||
|
||||
|
||||
panes = Paned(root)
|
||||
panes.pack(fill="both", expand="yes")
|
||||
|
||||
label1 = Label(panes, text="pane1")
|
||||
label2 = Label(panes, text="Pane2")
|
||||
|
||||
|
||||
panes.add(label1)
|
||||
panes.add(label2)
|
||||
|
||||
|
||||
|
||||
|
||||
#~ tree = Treeview(root, columns=("One", "Two", "Three"))
|
||||
|
||||
#~ tree.insert(None, "end", text="Hello")
|
||||
|
||||
#~ tree.pack()
|
||||
|
||||
initialize()
|
||||
root.option_add('*Toolbar.relief', 'groove')
|
||||
root.option_add('*Toolbar.borderWidth', 2)
|
||||
root.option_add('*Toolbar.Button.Pad', 2)
|
||||
base = Frame(root)
|
||||
base.pack(expand=True, fill='both')
|
||||
tb_frame = Frame(base, class_='Toolbar')
|
||||
tb_frame.pack(side='top', expand=False, fill='x')
|
||||
b = Button(tb_frame, text='Open', style='Toolbutton')
|
||||
b.grid(row=0, column=0, sticky='news')
|
||||
b = Button(tb_frame, text='Save', style='Toolbutton')
|
||||
b.grid(row=0, column=1, sticky='news')
|
||||
b = Checkbutton(tb_frame, text='Bold', style='Toolbutton')
|
||||
b.grid(row=0, column=2, sticky='news')
|
||||
b = Checkbutton(tb_frame, text='Italic', style='Toolbutton')
|
||||
b.grid(row=0, column=3, sticky='news')
|
||||
tb_frame.grid_columnconfigure(4, weight=1)
|
||||
theme_frame = LabelFrame(base, text='Theme')
|
||||
theme_frame.pack(side='left', expand=False, fill='y', padx=4, pady=4)
|
||||
theme_var = Tkinter.StringVar()
|
||||
theme_var.set('default')
|
||||
for theme in availableThemes():
|
||||
command = lambda theme=theme: setTheme(theme=theme)
|
||||
b = Radiobutton(theme_frame, text=theme, variable=theme_var,
|
||||
value=theme, command=command)
|
||||
b.pack(side='top', expand=False, fill='x', padx=4)
|
||||
right_frame = Frame(base)
|
||||
right_frame.pack(side='right', expand=True, fill='both')
|
||||
b = Checkbutton(right_frame, text='Checkbutton')
|
||||
b.pack(expand=False, fill='x')
|
||||
b = Button(right_frame, text='Button')
|
||||
b.pack(expand=False, fill='x')
|
||||
text_frame = Frame(right_frame)
|
||||
text_frame.pack(expand=True, fill='both')
|
||||
text = Tkinter.Text(text_frame, width=40, height=20,
|
||||
fg='black', bg='white', wrap='none')
|
||||
hsb = Scrollbar(text_frame, orient='horizontal', command=text.xview)
|
||||
vsb = Scrollbar(text_frame, orient='vertical', command=text.yview)
|
||||
text.grid(row=0, column=0, sticky='nwse')
|
||||
hsb.grid(row=1, column=0, sticky='we')
|
||||
vsb.grid(row=0, column=1, sticky='ns')
|
||||
text.configure(xscrollcommand=hsb.set)
|
||||
text.configure(yscrollcommand=vsb.set)
|
||||
text.insert('end', open(sys.argv[0]).read())
|
||||
grip = Sizegrip(text_frame)
|
||||
grip.grid(row=1, column=1, sticky='se')
|
||||
text_frame.grid_columnconfigure(0, weight=1)
|
||||
text_frame.grid_rowconfigure(0, weight=1)
|
||||
root.mainloop()
|
||||
|
||||
if __name__ == '__main__':
|
||||
test()
|
||||
|
|
|
@ -22,16 +22,14 @@
|
|||
__all__ = ['ColorsDialog']
|
||||
|
||||
# imports
|
||||
import os, sys
|
||||
import Tkinter as Tk
|
||||
import Tile as Tkinter
|
||||
import Tkinter
|
||||
import Tile
|
||||
from tkColorChooser import askcolor
|
||||
|
||||
# PySol imports
|
||||
from pysollib.mfxutil import destruct, kwdefault, KwStruct, Struct
|
||||
from pysollib.mfxutil import KwStruct
|
||||
|
||||
# Toolkit imports
|
||||
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
||||
from tkwidget import MfxDialog
|
||||
|
||||
# /***********************************************************************
|
||||
|
@ -45,7 +43,7 @@ class ColorsDialog(MfxDialog):
|
|||
top_frame, bottom_frame = self.createFrames(kw)
|
||||
self.createBitmaps(top_frame, kw)
|
||||
|
||||
frame = Tkinter.Frame(top_frame)
|
||||
frame = Tile.Frame(top_frame)
|
||||
frame.pack(expand=True, fill='both', padx=5, pady=10)
|
||||
frame.columnconfigure(0, weight=1)
|
||||
|
||||
|
@ -77,13 +75,13 @@ class ColorsDialog(MfxDialog):
|
|||
(_('Hint arrow:'), self.hintarrow_var),
|
||||
(_('Highlight not matching:'), self.not_matching_var),
|
||||
):
|
||||
Tkinter.Label(frame, text=title, anchor='w',
|
||||
).grid(row=row, column=0, sticky='we')
|
||||
l = Tk.Label(frame, width=10, height=2,
|
||||
Tile.Label(frame, text=title, anchor='w',
|
||||
).grid(row=row, column=0, sticky='we')
|
||||
l = Tkinter.Label(frame, width=10, height=2,
|
||||
bg=var.get(), textvariable=var)
|
||||
l.grid(row=row, column=1, padx=5)
|
||||
b = Tkinter.Button(frame, text=_('Change...'), width=10,
|
||||
command=lambda l=l: self.selectColor(l))
|
||||
b = Tile.Button(frame, text=_('Change...'), width=10,
|
||||
command=lambda l=l: self.selectColor(l))
|
||||
b.grid(row=row, column=2)
|
||||
row += 1
|
||||
#
|
||||
|
@ -100,7 +98,7 @@ class ColorsDialog(MfxDialog):
|
|||
self.not_matching_color = self.not_matching_var.get()
|
||||
|
||||
def selectColor(self, label):
|
||||
c = askcolor(master=self.top, initialcolor=label.cget('bg'),
|
||||
c = askcolor(parent=self.top, initialcolor=label.cget('bg'),
|
||||
title=_("Select color"))
|
||||
if c and c[1]:
|
||||
label.configure(bg=c[1])
|
||||
|
|
|
@ -36,11 +36,11 @@
|
|||
__all__ = ['EditTextDialog']
|
||||
|
||||
# imports
|
||||
import os, sys
|
||||
import Tile as Tkinter
|
||||
import Tkinter
|
||||
import Tile
|
||||
|
||||
# PySol imports
|
||||
from pysollib.mfxutil import destruct, kwdefault, KwStruct, Struct
|
||||
from pysollib.mfxutil import KwStruct
|
||||
|
||||
# Toolkit imports
|
||||
from tkwidget import MfxDialog
|
||||
|
@ -61,7 +61,7 @@ class EditTextDialog(MfxDialog):
|
|||
wrap="word", width=64, height=16)
|
||||
self.text_w.pack(side='left', fill="both", expand=True)
|
||||
###self.text_w.pack(side='top', padx=kw.padx, pady=kw.pady)
|
||||
vbar = Tkinter.Scrollbar(top_frame)
|
||||
vbar = Tile.Scrollbar(top_frame)
|
||||
vbar.pack(side='right', fill='y')
|
||||
self.text_w["yscrollcommand"] = vbar.set
|
||||
vbar["command"] = self.text_w.yview
|
||||
|
|
|
@ -27,9 +27,6 @@ __all__ = ['create_find_card_dialog',
|
|||
# imports
|
||||
import os
|
||||
import Tkinter
|
||||
import traceback
|
||||
|
||||
# PySol imports
|
||||
|
||||
# Toolkit imports
|
||||
from tkutil import after, after_cancel
|
||||
|
|
|
@ -22,16 +22,14 @@
|
|||
__all__ = ['FontsDialog']
|
||||
|
||||
# imports
|
||||
import os, sys
|
||||
import types
|
||||
import Tile as Tkinter
|
||||
import Tkinter
|
||||
import Tile
|
||||
import tkFont
|
||||
|
||||
# PySol imports
|
||||
from pysollib.mfxutil import destruct, kwdefault, KwStruct, Struct
|
||||
from pysollib.mfxutil import KwStruct
|
||||
|
||||
# Toolkit imports
|
||||
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
||||
from tkwidget import MfxDialog
|
||||
from tkutil import bind
|
||||
from tkwidget import PysolScale
|
||||
|
@ -81,28 +79,28 @@ class FontChooserDialog(MfxDialog):
|
|||
self.size_var = Tkinter.IntVar()
|
||||
self.size_var.set(self.font_size)
|
||||
#
|
||||
frame = Tkinter.Frame(top_frame)
|
||||
frame = Tile.Frame(top_frame)
|
||||
frame.pack(expand=True, fill='both', padx=5, pady=10)
|
||||
frame.columnconfigure(0, weight=1)
|
||||
#frame.rowconfigure(1, weight=1)
|
||||
self.entry = Tkinter.Entry(frame)
|
||||
self.entry = Tile.Entry(frame)
|
||||
self.entry.grid(row=0, column=0, columnspan=2, sticky='news')
|
||||
self.entry.insert('end', _('abcdefghABCDEFGH'))
|
||||
self.list_box = Tkinter.Listbox(frame, width=36, exportselection=False)
|
||||
sb = Tkinter.Scrollbar(frame)
|
||||
sb = Tile.Scrollbar(frame)
|
||||
self.list_box.configure(yscrollcommand=sb.set)
|
||||
sb.configure(command=self.list_box.yview)
|
||||
self.list_box.grid(row=1, column=0, sticky='news') # rowspan=4
|
||||
sb.grid(row=1, column=1, sticky='ns')
|
||||
bind(self.list_box, '<<ListboxSelect>>', self.fontupdate)
|
||||
##self.list_box.focus()
|
||||
cb1 = Tkinter.Checkbutton(frame, text=_('Bold'),
|
||||
command=self.fontupdate,
|
||||
variable=self.weight_var)
|
||||
cb1 = Tile.Checkbutton(frame, text=_('Bold'),
|
||||
command=self.fontupdate,
|
||||
variable=self.weight_var)
|
||||
cb1.grid(row=2, column=0, columnspan=2, sticky='we')
|
||||
cb2 = Tkinter.Checkbutton(frame, text=_('Italic'),
|
||||
command=self.fontupdate,
|
||||
variable=self.slant_var)
|
||||
cb2 = Tile.Checkbutton(frame, text=_('Italic'),
|
||||
command=self.fontupdate,
|
||||
variable=self.slant_var)
|
||||
cb2.grid(row=3, column=0, columnspan=2, sticky='we')
|
||||
|
||||
sc = PysolScale(frame, from_=6, to=40, resolution=1,
|
||||
|
@ -157,7 +155,7 @@ class FontsDialog(MfxDialog):
|
|||
top_frame, bottom_frame = self.createFrames(kw)
|
||||
self.createBitmaps(top_frame, kw)
|
||||
|
||||
frame = Tkinter.Frame(top_frame)
|
||||
frame = Tile.Frame(top_frame)
|
||||
frame.pack(expand=True, fill='both', padx=5, pady=10)
|
||||
frame.columnconfigure(0, weight=1)
|
||||
|
||||
|
@ -174,16 +172,16 @@ class FontsDialog(MfxDialog):
|
|||
):
|
||||
font = app.opt.fonts[fn]
|
||||
self.fonts[fn] = font
|
||||
Tkinter.Label(frame, text=title, anchor='w'
|
||||
).grid(row=row, column=0, sticky='we')
|
||||
Tile.Label(frame, text=title, anchor='w'
|
||||
).grid(row=row, column=0, sticky='we')
|
||||
if font:
|
||||
title = ' '.join([str(i) for i in font if i not in ('roman', 'normal')])
|
||||
elif font is None:
|
||||
title = 'Default'
|
||||
l = Tkinter.Label(frame, font=font, text=title)
|
||||
l = Tile.Label(frame, font=font, text=title)
|
||||
l.grid(row=row, column=1, padx=8)
|
||||
b = Tkinter.Button(frame, text=_('Change...'), width=10,
|
||||
command=lambda l=l, fn=fn: self.selectFont(l, fn))
|
||||
b = Tile.Button(frame, text=_('Change...'), width=10,
|
||||
command=lambda l=l, fn=fn: self.selectFont(l, fn))
|
||||
b.grid(row=row, column=2)
|
||||
row += 1
|
||||
#
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
__all__ = ['GameInfoDialog']
|
||||
|
||||
# imports
|
||||
import os, sys
|
||||
import Tile as Tkinter
|
||||
import Tile
|
||||
|
||||
# PySol imports
|
||||
from pysollib.mfxutil import KwStruct
|
||||
|
@ -44,7 +43,7 @@ class GameInfoDialog(MfxDialog):
|
|||
top_frame, bottom_frame = self.createFrames(kw)
|
||||
self.createBitmaps(top_frame, kw)
|
||||
|
||||
frame = Tkinter.Frame(top_frame)
|
||||
frame = Tile.Frame(top_frame)
|
||||
frame.pack(expand=True, fill='both', padx=5, pady=10)
|
||||
frame.columnconfigure(0, weight=1)
|
||||
|
||||
|
@ -108,10 +107,10 @@ class GameInfoDialog(MfxDialog):
|
|||
('Hint:', hint),
|
||||
):
|
||||
if t:
|
||||
Tkinter.Label(frame, text=n, anchor='w'
|
||||
).grid(row=row, column=0, sticky='nw')
|
||||
Tkinter.Label(frame, text=t, anchor='w', justify='left'
|
||||
).grid(row=row, column=1, sticky='nw')
|
||||
Tile.Label(frame, text=n, anchor='w'
|
||||
).grid(row=row, column=0, sticky='nw')
|
||||
Tile.Label(frame, text=t, anchor='w', justify='left'
|
||||
).grid(row=row, column=1, sticky='nw')
|
||||
row += 1
|
||||
|
||||
if game.s.talon:
|
||||
|
@ -134,8 +133,8 @@ class GameInfoDialog(MfxDialog):
|
|||
self.mainloop(focus, kw.timeout)
|
||||
|
||||
def showStacks(self, frame, row, title, stacks):
|
||||
Tkinter.Label(frame, text=title, anchor='w'
|
||||
).grid(row=row, column=0, sticky='nw')
|
||||
Tile.Label(frame, text=title, anchor='w'
|
||||
).grid(row=row, column=0, sticky='nw')
|
||||
if isinstance(stacks, (list, tuple)):
|
||||
fs = {}
|
||||
for f in stacks:
|
||||
|
@ -147,8 +146,8 @@ class GameInfoDialog(MfxDialog):
|
|||
t = '\n'.join(['%s (%d)' % (i[0], i[1]) for i in fs.items()])
|
||||
else:
|
||||
t = stacks.__class__.__name__
|
||||
Tkinter.Label(frame, text=t, anchor='w', justify='left'
|
||||
).grid(row=row, column=1, sticky='nw')
|
||||
Tile.Label(frame, text=t, anchor='w', justify='left'
|
||||
).grid(row=row, column=1, sticky='nw')
|
||||
|
||||
def initKw(self, kw):
|
||||
kw = KwStruct(kw,
|
||||
|
|
|
@ -38,15 +38,15 @@ __all__ = ['PysolMenubar']
|
|||
|
||||
# imports
|
||||
import math, os, sys, re, traceback
|
||||
import Tile as Tkinter
|
||||
import Tile
|
||||
import Tkinter
|
||||
import tkFileDialog
|
||||
|
||||
# PySol imports
|
||||
from pysollib.mfxutil import destruct, Struct, kwdefault
|
||||
from pysollib.mfxutil import Struct, kwdefault
|
||||
from pysollib.mfxutil import Image
|
||||
from pysollib.util import CARDSET
|
||||
from pysollib.settings import PACKAGE, WIN_SYSTEM
|
||||
from pysollib.settings import TOP_TITLE
|
||||
from pysollib.settings import SELECT_GAME_MENU
|
||||
from pysollib.settings import USE_FREECELL_SOLVER
|
||||
from pysollib.settings import DEBUG
|
||||
|
@ -1035,6 +1035,8 @@ class PysolMenubar(PysolMenubarActions):
|
|||
self.updateMenus()
|
||||
|
||||
def mPause(self, *args):
|
||||
if not self.game:
|
||||
return
|
||||
if not self.game.pause:
|
||||
if self._cancelDrag(): return
|
||||
self.game.doPause()
|
||||
|
@ -1350,8 +1352,7 @@ the next time you restart """)+PACKAGE,
|
|||
|
||||
def createThemesMenu(self, menu):
|
||||
submenu = MfxMenu(menu, label=n_("Set t&heme"))
|
||||
style = Tkinter.Style(self.top)
|
||||
all_themes = list(style.theme_names())
|
||||
all_themes = list(Tile.availableThemes())
|
||||
all_themes.sort()
|
||||
#
|
||||
tn = {
|
||||
|
|
|
@ -36,16 +36,14 @@
|
|||
__all__ = ['PlayerOptionsDialog']
|
||||
|
||||
# imports
|
||||
import os, sys
|
||||
import Tile as Tkinter
|
||||
import Tkinter
|
||||
import Tile
|
||||
|
||||
# PySol imports
|
||||
from pysollib.mfxutil import destruct, kwdefault, KwStruct, Struct
|
||||
from pysollib.mfxutil import KwStruct
|
||||
|
||||
# Toolkit imports
|
||||
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
||||
from tkwidget import MfxDialog
|
||||
from tkutil import bind
|
||||
|
||||
|
||||
# /***********************************************************************
|
||||
|
@ -67,25 +65,25 @@ class PlayerOptionsDialog(MfxDialog):
|
|||
self.win_animation_var = Tkinter.BooleanVar()
|
||||
self.win_animation_var.set(app.opt.win_animation != 0)
|
||||
#
|
||||
frame = Tkinter.Frame(top_frame)
|
||||
frame = Tile.Frame(top_frame)
|
||||
frame.pack(expand=True, fill='both', padx=5, pady=10)
|
||||
widget = Tkinter.Label(frame, text=_("\nPlease enter your name"),
|
||||
takefocus=0)
|
||||
widget = Tile.Label(frame, text=_("\nPlease enter your name"),
|
||||
takefocus=0)
|
||||
widget.grid(row=0, column=0, columnspan=2, sticky='ew', padx=0, pady=5)
|
||||
#
|
||||
w = kw.get("e_width", 30) # width in characters
|
||||
names = self.app.getAllUserNames()
|
||||
self.player_var = Tkinter.Combobox(frame, width=w, values=tuple(names))
|
||||
self.player_var = Tile.Combobox(frame, width=w, values=tuple(names))
|
||||
self.player_var.current(names.index(app.opt.player))
|
||||
self.player_var.grid(row=1, column=0, sticky='ew', padx=0, pady=5)
|
||||
#
|
||||
widget = Tkinter.Checkbutton(frame, variable=self.confirm_var,
|
||||
text=_("Confirm quit"))
|
||||
widget = Tile.Checkbutton(frame, variable=self.confirm_var,
|
||||
text=_("Confirm quit"))
|
||||
widget.grid(row=2, column=0, columnspan=2, sticky='ew', padx=0, pady=5)
|
||||
widget = Tkinter.Checkbutton(frame, variable=self.update_stats_var,
|
||||
text=_("Update statistics and logs"))
|
||||
widget = Tile.Checkbutton(frame, variable=self.update_stats_var,
|
||||
text=_("Update statistics and logs"))
|
||||
widget.grid(row=3, column=0, columnspan=2, sticky='ew', padx=0, pady=5)
|
||||
### widget = Tkinter.Checkbutton(frame, variable=self.win_animation_var,
|
||||
### widget = Tile.Checkbutton(frame, variable=self.win_animation_var,
|
||||
### text="Win animation")
|
||||
### widget.pack(side='top', padx=kw.padx, pady=kw.pady)
|
||||
frame.columnconfigure(0, weight=1)
|
||||
|
|
|
@ -36,11 +36,11 @@
|
|||
__all__ = ['PysolProgressBar']
|
||||
|
||||
# imports
|
||||
import os, sys
|
||||
import Tile as Tkinter
|
||||
import Tkinter
|
||||
import Tile
|
||||
|
||||
# Toolkit imports
|
||||
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
||||
from tkconst import EVENT_HANDLED
|
||||
from tkutil import makeToplevel, setTransient
|
||||
|
||||
|
||||
|
@ -59,15 +59,15 @@ class PysolProgressBar:
|
|||
self.top.wm_resizable(0, 0)
|
||||
self.top.config(cursor="watch")
|
||||
#
|
||||
self.frame = Tkinter.Frame(self.top, relief='flat', borderwidth=0)
|
||||
self.progress = Tkinter.Progressbar(self.frame, maximum=100, length=250)
|
||||
##style = Tkinter.Style(self.progress)
|
||||
self.frame = Tile.Frame(self.top, relief='flat', borderwidth=0)
|
||||
self.progress = Tile.Progressbar(self.frame, maximum=100, length=250)
|
||||
##style = Tile.Style(self.progress)
|
||||
##style.configure('TProgressbar', background=color)
|
||||
if images:
|
||||
self.f1 = Tkinter.Label(self.frame, image=images[0])
|
||||
self.f1 = Tile.Label(self.frame, image=images[0])
|
||||
self.f1.pack(side='left', ipadx=8, ipady=4)
|
||||
self.progress.pack(side='left', expand=True, fill='x')
|
||||
self.f2 = Tkinter.Label(self.frame, image=images[1])
|
||||
self.f2 = Tile.Label(self.frame, image=images[1])
|
||||
self.f2.pack(side='left', ipadx=8, ipady=4)
|
||||
else:
|
||||
self.progress.pack(expand=True, fill='x')
|
||||
|
|
|
@ -36,11 +36,12 @@
|
|||
__all__ = ['SelectCardsetDialogWithPreview']
|
||||
|
||||
# imports
|
||||
import os, re, sys, types
|
||||
import Tile as Tkinter
|
||||
import os
|
||||
import Tkinter
|
||||
import Tile
|
||||
|
||||
# PySol imports
|
||||
from pysollib.mfxutil import destruct, Struct, KwStruct
|
||||
from pysollib.mfxutil import KwStruct
|
||||
from pysollib.util import CARDSET
|
||||
from pysollib.resource import CSI
|
||||
|
||||
|
@ -200,10 +201,10 @@ class SelectCardsetDialogWithPreview(MfxDialog):
|
|||
w1, w2 = 216, 400
|
||||
else:
|
||||
w1, w2 = 200, 300
|
||||
paned_window = Tkinter.PanedWindow(top_frame)
|
||||
paned_window = Tile.PanedWindow(top_frame)
|
||||
paned_window.pack(expand=True, fill='both')
|
||||
left_frame = Tkinter.Frame(paned_window)
|
||||
right_frame = Tkinter.Frame(paned_window)
|
||||
left_frame = Tile.Frame(paned_window)
|
||||
right_frame = Tile.Frame(paned_window)
|
||||
paned_window.add(left_frame)
|
||||
paned_window.add(right_frame)
|
||||
font = app.getFont("default")
|
||||
|
@ -307,11 +308,11 @@ class CardsetInfoDialog(MfxDialog):
|
|||
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||
top_frame, bottom_frame = self.createFrames(kw)
|
||||
self.createBitmaps(top_frame, kw)
|
||||
frame = Tkinter.Frame(top_frame)
|
||||
frame = Tile.Frame(top_frame)
|
||||
frame.pack(fill="both", expand=True, padx=5, pady=10)
|
||||
#
|
||||
#
|
||||
info_frame = Tkinter.LabelFrame(frame, text=_('About cardset'))
|
||||
info_frame = Tile.LabelFrame(frame, text=_('About cardset'))
|
||||
info_frame.grid(row=0, column=0, columnspan=2, sticky='ew',
|
||||
padx=0, pady=5, ipadx=5, ipady=5)
|
||||
styles = nationalities = year = None
|
||||
|
@ -333,11 +334,11 @@ class CardsetInfoDialog(MfxDialog):
|
|||
(_('Size:'), '%d x %d' % (cardset.CARDW, cardset.CARDH)),
|
||||
):
|
||||
if t is not None:
|
||||
l = Tkinter.Label(info_frame, text=n,
|
||||
anchor='w', justify='left')
|
||||
l = Tile.Label(info_frame, text=n,
|
||||
anchor='w', justify='left')
|
||||
l.grid(row=row, column=0, sticky='nw', padx=4)
|
||||
l = Tkinter.Label(info_frame, text=t,
|
||||
anchor='w', justify='left')
|
||||
l = Tile.Label(info_frame, text=t,
|
||||
anchor='w', justify='left')
|
||||
l.grid(row=row, column=1, sticky='nw', padx=4)
|
||||
row += 1
|
||||
if images:
|
||||
|
@ -346,10 +347,10 @@ class CardsetInfoDialog(MfxDialog):
|
|||
im = choice(images)
|
||||
f = os.path.join(cardset.dir, cardset.backname)
|
||||
self.back_image = loadImage(file=f) # store the image
|
||||
l = Tkinter.Label(info_frame, image=im, padding=5)
|
||||
l = Tile.Label(info_frame, image=im, padding=5)
|
||||
l.grid(row=0, column=2, rowspan=row+1, sticky='ne')
|
||||
l = Tkinter.Label(info_frame, image=self.back_image,
|
||||
padding=(0,5,5,5)) # left margin = 0
|
||||
l = Tile.Label(info_frame, image=self.back_image,
|
||||
padding=(0,5,5,5)) # left margin = 0
|
||||
l.grid(row=0, column=3, rowspan=row+1, sticky='ne')
|
||||
|
||||
info_frame.columnconfigure(2, weight=1)
|
||||
|
@ -361,7 +362,7 @@ class CardsetInfoDialog(MfxDialog):
|
|||
text_w = Tkinter.Text(frame, bd=1, relief="sunken", wrap="word",
|
||||
padx=4, width=64, height=16, bg=bg)
|
||||
text_w.grid(row=1, column=0, sticky='nsew')
|
||||
sb = Tkinter.Scrollbar(frame)
|
||||
sb = Tile.Scrollbar(frame)
|
||||
sb.grid(row=1, column=1, sticky='ns')
|
||||
text_w.configure(yscrollcommand=sb.set)
|
||||
sb.configure(command=text_w.yview)
|
||||
|
|