green_shoes 1.0.320 → 1.0.322
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/shoes/app.rb +2 -1
- data/lib/shoes/basic.rb +22 -0
- data/static/manual-en.txt +14 -0
- data/static/manual-ja.txt +14 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.322
|
data/lib/shoes/app.rb
CHANGED
@@ -360,8 +360,9 @@ class Shoes
|
|
360
360
|
end
|
361
361
|
|
362
362
|
def keypress &blk
|
363
|
+
win.signal_handler_disconnect @key_press_handler if @key_press_handler
|
363
364
|
win.set_events Gdk::Event::BUTTON_PRESS_MASK | Gdk::Event::BUTTON_RELEASE_MASK | Gdk::Event::POINTER_MOTION_MASK | Gdk::Event::KEY_PRESS_MASK
|
364
|
-
win.signal_connect("key_press_event") do |w, e|
|
365
|
+
@key_press_handler = win.signal_connect("key_press_event") do |w, e|
|
365
366
|
k = Gdk::Keyval.to_name e.keyval
|
366
367
|
k = case
|
367
368
|
when Shoes::KEY_NAMES.include?(k); e.keyval.chr
|
data/lib/shoes/basic.rb
CHANGED
@@ -154,6 +154,28 @@ class Shoes
|
|
154
154
|
args.merge!({hidden: true}) if @hided
|
155
155
|
@real = @app.image(name, args).move(@left, @top).real
|
156
156
|
end
|
157
|
+
|
158
|
+
def rotate angle
|
159
|
+
(@real_orig, @first_time = @real, true) unless @real_orig
|
160
|
+
len = Math.sqrt @width**2 + @height**2
|
161
|
+
surface = Cairo::ImageSurface.new Cairo::FORMAT_ARGB32, len, len
|
162
|
+
context = Cairo::Context.new surface
|
163
|
+
hlen, dleft, dtop = len/2.0, (len-width)/2.0, (len-height)/2.0
|
164
|
+
context.save do
|
165
|
+
pixbuf = @real_orig.pixbuf
|
166
|
+
context.translate hlen, hlen
|
167
|
+
context.rotate angle * Math::PI / 180
|
168
|
+
context.translate -hlen, -hlen
|
169
|
+
context.set_source_pixbuf pixbuf, dleft, dtop
|
170
|
+
context.paint
|
171
|
+
end
|
172
|
+
remove
|
173
|
+
@real = app.create_tmp_png surface
|
174
|
+
app.canvas.put @real, 0, 0
|
175
|
+
@real.show_now
|
176
|
+
(@left -= dleft; @top -= dtop; @first_time = false) if @first_time
|
177
|
+
move @left, @top
|
178
|
+
end
|
157
179
|
end
|
158
180
|
|
159
181
|
class Pattern < Basic
|
data/static/manual-en.txt
CHANGED
@@ -3399,6 +3399,20 @@ The URL or file name of the image.
|
|
3399
3399
|
|
3400
3400
|
Swaps the image with a different one, loaded from a file or URL.
|
3401
3401
|
|
3402
|
+
=== rotate(degrees: a number) » self ===
|
3403
|
+
|
3404
|
+
Rotates the Image element by a certain number of `degrees`.
|
3405
|
+
|
3406
|
+
{{{
|
3407
|
+
Shoes.app do
|
3408
|
+
img = image File.join(DIR, '../samples/cy.png')
|
3409
|
+
img.move 200, 200
|
3410
|
+
animate do |i|
|
3411
|
+
img.rotate i*10
|
3412
|
+
end
|
3413
|
+
end
|
3414
|
+
}}}
|
3415
|
+
|
3402
3416
|
== ListBox ==
|
3403
3417
|
|
3404
3418
|
List boxes (also called "combo boxes" or "drop-down boxes" or "select boxes" in
|
data/static/manual-ja.txt
CHANGED
@@ -3313,6 +3313,20 @@ Green Shoesはバックグラウンドでシステムのスレッドを使って
|
|
3313
3313
|
|
3314
3314
|
ファイルまたはURLからロードして、画像を他のものに入れ替えます。
|
3315
3315
|
|
3316
|
+
=== rotate(degrees: a number) » self ===
|
3317
|
+
|
3318
|
+
画像を`degrees`度回転させます。
|
3319
|
+
|
3320
|
+
{{{
|
3321
|
+
Shoes.app do
|
3322
|
+
img = image File.join(DIR, '../samples/cy.png')
|
3323
|
+
img.move 200, 200
|
3324
|
+
animate do |i|
|
3325
|
+
img.rotate i*10
|
3326
|
+
end
|
3327
|
+
end
|
3328
|
+
}}}
|
3329
|
+
|
3316
3330
|
== ListBox ==
|
3317
3331
|
|
3318
3332
|
リストボックス(List box)(環境によって"コンボボックス(combo box)"または
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: green_shoes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.322
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-11-02 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gtk2
|
16
|
-
requirement: &
|
16
|
+
requirement: &17004048 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *17004048
|
25
25
|
description: Green Shoes is one of colorful Shoes, written in pure Ruby with Ruby/GTK2.
|
26
26
|
email: ashbbb@gmail.com
|
27
27
|
executables: []
|