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> 2005-06-05 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* sample/tkextlib/tile/demo.rb: fix TypeError & create Console * 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']) # Tk::Tile::Style.map(nil, :background=>[:active, '#694418'])
# or # or
Tk::Tile::Style.map(:background=>[:active, '#694418']) 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('TButton', :padding=>[10,4])
Tk::Tile::Style.default(Tk::Tile::TButton, :padding=>[10,4]) Tk::Tile::Style.default(Tk::Tile::TButton, :padding=>[10,4])
@ -89,32 +89,62 @@ def kroc_rb_settings
# #
# Elements: # Elements:
# #
Tk::Tile::Style.element_create('Button.button', :pixmap, if TkPackage.vcompare(Tk::Tile.package_version, '0.5') >= 0
:images=>[
:pressed, $images['button-p'],
:active, $images['button-h'],
'', $images['button-n']
], :border=>3, :tiling=>:tile)
Tk::Tile::Style.element_create('Checkbutton.indicator', :pixmap, Tk::Tile::Style.element_create('Button.button', :image, $images['button-n'],
:images=>[ :map=>[
[:pressed, :selected], $images['check-nc'], :pressed, $images['button-p'],
:pressed, $images['check-nu'], :active, $images['button-h'],
[:active, :selected], $images['check-hc'], ], :border=>3, :sticky=>:ew)
:active, $images['check-hu'],
:selected, $images['check-nc'],
'', $images['check-nu'],
], :tiling=>:fixed)
Tk::Tile::Style.element_create('Radiobutton.indicator', :pixmap, Tk::Tile::Style.element_create('Checkbutton.indicator', :image, $images['check-nu'],
:images=>[ :map=>[
[:pressed, :selected], $images['radio-nc'], [:pressed, :selected], $images['check-nc'],
:pressed, $images['radio-nu'], :pressed, $images['check-nu'],
[:active, :selected], $images['radio-hc'], [:active, :selected], $images['check-hc'],
:active, $images['radio-hu'], :active, $images['check-hu'],
:selected, $images['radio-nc'], :selected, $images['check-nc'],
'', $images['radio-nu'], ], :sticky=>:w)
], :tiling=>:fixed)
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: # Settings:

View file

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