Skip to content

Commit

Permalink
Add Shoes app to make x.y coord for each seat
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Girard committed Jan 6, 2009
1 parent b59f413 commit be8cd14
Show file tree
Hide file tree
Showing 4 changed files with 612 additions and 0 deletions.
29 changes: 29 additions & 0 deletions seat_map/click_seat.rb
@@ -0,0 +1,29 @@
seat_file = "/Users/alx/dev/politimap/seat_map/seatmap.txt"

Shoes.app :title => "Seat Map" , :width => 459 do

current = 642
last_log=""

image("seat_map.jpg")

@p = para
animate do
button, left, top = self.mouse
@p.replace "mouse: #{button}, #{left}, #{top}\ncurrent seat: #{current}\nlast log: #{last_log}"
end

click do |button, x, y|
# Do not log if superior at seats height
if y < 260
last_log = "#{current}, #{x}, #{y}"
File.open(seat_file, 'a') do |f|
f.puts "#{last_log}\n"
end
end

# Update in all case, allow to pass missing numbers by clicking in grey area
current += 1
end

end
Binary file added seat_map/seat_map.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added seat_map/seat_map_frame.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit be8cd14

Please sign in to comment.