1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* sample/tkextlib/tile/themes/kroc.{rb,tcl}: support tile 0.5 or later.

("pixmap" element constructor replaced by "image")


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2005-06-07 05:11:55 +00:00
parent 261f8e0f73
commit 7eef190796
3 changed files with 114 additions and 50 deletions

View file

@ -1,3 +1,8 @@
2005-06-07 ocean <ocean@ruby-lang.org>
* sample/tkextlib/tile/themes/kroc.{rb,tcl}: support tile 0.5 or later.
("pixmap" element constructor replaced by "image")
2005-06-05 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* sample/tkextlib/tile/demo.rb: fix TypeError & create Console

View file

@ -46,7 +46,7 @@ def kroc_rb_settings
# Tk::Tile::Style.map(nil, :background=>[:active, '#694418'])
# or
Tk::Tile::Style.map(:background=>[:active, '#694418'])
Tk::Tile::Style.map(:foreground=>[:disabled, 'B2B2B2', :active, '#FFE7CB'])
Tk::Tile::Style.map(:foreground=>[:disabled, '#B2B2B2', :active, '#FFE7CB'])
# Tk::Tile::Style.default('TButton', :padding=>[10,4])
Tk::Tile::Style.default(Tk::Tile::TButton, :padding=>[10,4])
@ -89,32 +89,62 @@ def kroc_rb_settings
#
# Elements:
#
Tk::Tile::Style.element_create('Button.button', :pixmap,
:images=>[
:pressed, $images['button-p'],
:active, $images['button-h'],
'', $images['button-n']
], :border=>3, :tiling=>:tile)
if TkPackage.vcompare(Tk::Tile.package_version, '0.5') >= 0
Tk::Tile::Style.element_create('Checkbutton.indicator', :pixmap,
:images=>[
[:pressed, :selected], $images['check-nc'],
:pressed, $images['check-nu'],
[:active, :selected], $images['check-hc'],
:active, $images['check-hu'],
:selected, $images['check-nc'],
'', $images['check-nu'],
], :tiling=>:fixed)
Tk::Tile::Style.element_create('Button.button', :image, $images['button-n'],
:map=>[
:pressed, $images['button-p'],
:active, $images['button-h'],
], :border=>3, :sticky=>:ew)
Tk::Tile::Style.element_create('Radiobutton.indicator', :pixmap,
:images=>[
[:pressed, :selected], $images['radio-nc'],
:pressed, $images['radio-nu'],
[:active, :selected], $images['radio-hc'],
:active, $images['radio-hu'],
:selected, $images['radio-nc'],
'', $images['radio-nu'],
], :tiling=>:fixed)
Tk::Tile::Style.element_create('Checkbutton.indicator', :image, $images['check-nu'],
:map=>[
[:pressed, :selected], $images['check-nc'],
:pressed, $images['check-nu'],
[:active, :selected], $images['check-hc'],
:active, $images['check-hu'],
:selected, $images['check-nc'],
], :sticky=>:w)
Tk::Tile::Style.element_create('Radiobutton.indicator', :image, $images['radio-nu'],
:map=>[
[:pressed, :selected], $images['radio-nc'],
:pressed, $images['radio-nu'],
[:active, :selected], $images['radio-hc'],
:active, $images['radio-hu'],
:selected, $images['radio-nc'],
], :sticky=>:w)
else # tile 0.4 or earlier
Tk::Tile::Style.element_create('Button.button', :pixmap,
:images=>[
:pressed, $images['button-p'],
:active, $images['button-h'],
'', $images['button-n']
], :border=>3, :tiling=>:tile)
Tk::Tile::Style.element_create('Checkbutton.indicator', :pixmap,
:images=>[
[:pressed, :selected], $images['check-nc'],
:pressed, $images['check-nu'],
[:active, :selected], $images['check-hc'],
:active, $images['check-hu'],
:selected, $images['check-nc'],
'', $images['check-nu'],
], :tiling=>:fixed)
Tk::Tile::Style.element_create('Radiobutton.indicator', :pixmap,
:images=>[
[:pressed, :selected], $images['radio-nc'],
:pressed, $images['radio-nu'],
[:active, :selected], $images['radio-hc'],
:active, $images['radio-hu'],
:selected, $images['radio-nc'],
'', $images['radio-nu'],
], :tiling=>:fixed)
end
#
# Settings:

View file

@ -57,31 +57,60 @@ namespace eval tile::kroc {
#
# Elements:
#
style element create Button.button pixmap -images [list \
pressed $Images(button-p) \
active $Images(button-h) \
{} $Images(button-n) \
] -border 3 -tiling tile
style element create Checkbutton.indicator pixmap -images [list \
{pressed selected} $Images(check-nc) \
pressed $Images(check-nu) \
{active selected} $Images(check-hc) \
active $Images(check-hu) \
selected $Images(check-nc) \
{} $Images(check-nu) \
] -tiling fixed
style element create Radiobutton.indicator pixmap -images [list \
{pressed selected} $Images(radio-nc) \
pressed $Images(radio-nu) \
{active selected} $Images(radio-hc) \
active $Images(radio-hu) \
selected $Images(radio-nc) \
{} $Images(radio-nu) \
] -tiling fixed
if {[package vsatisfies [package provide tile] 0.5]} {
style element create Button.button image $Images(button-n) \
-map [list \
pressed $Images(button-p) \
active $Images(button-h) \
] -border 3 -sticky ew
style element create Checkbutton.indicator image $Images(check-nu) \
-map [list \
{pressed selected} $Images(check-nc) \
pressed $Images(check-nu) \
{active selected} $Images(check-hc) \
active $Images(check-hu) \
selected $Images(check-nc) \
] -sticky w
style element create Radiobutton.indicator image $Images(radio-nu) \
-map [list \
{pressed selected} $Images(radio-nc) \
pressed $Images(radio-nu) \
{active selected} $Images(radio-hc) \
active $Images(radio-hu) \
selected $Images(radio-nc) \
] -sticky w
} else {
style element create Button.button pixmap -images [list \
pressed $Images(button-p) \
active $Images(button-h) \
{} $Images(button-n) \
] -border 3 -tiling tile
style element create Checkbutton.indicator pixmap -images [list \
{pressed selected} $Images(check-nc) \
pressed $Images(check-nu) \
{active selected} $Images(check-hc) \
active $Images(check-hu) \
selected $Images(check-nc) \
{} $Images(check-nu) \
] -tiling fixed
style element create Radiobutton.indicator pixmap -images [list \
{pressed selected} $Images(radio-nc) \
pressed $Images(radio-nu) \
{active selected} $Images(radio-hc) \
active $Images(radio-hu) \
selected $Images(radio-nc) \
{} $Images(radio-nu) \
] -tiling fixed
}
#
# Settings:
#