shoes 4.0.0.pre12 → 4.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -0
  3. data/ext/install/Rakefile +1 -0
  4. data/lib/rubygems_plugin.rb +1 -0
  5. data/lib/shoes/samples.rb +1 -0
  6. data/samples/README +1 -0
  7. data/samples/class_book.rb +1 -0
  8. data/samples/expert_definr.rb +1 -0
  9. data/samples/expert_funnies.rb +1 -0
  10. data/samples/expert_game_of_life.rb +1 -0
  11. data/samples/expert_irb.rb +1 -0
  12. data/samples/expert_minesweeper.rb +2 -1
  13. data/samples/expert_othello.rb +1 -0
  14. data/samples/expert_pong.rb +1 -0
  15. data/samples/expert_snake.rb +1 -0
  16. data/samples/expert_tankspank.rb +1 -0
  17. data/samples/expert_tetris.rb +1 -0
  18. data/samples/good_arc.rb +1 -0
  19. data/samples/good_bounce.rb +1 -0
  20. data/samples/good_clock.rb +1 -0
  21. data/samples/good_displace.rb +1 -0
  22. data/samples/good_follow.rb +1 -0
  23. data/samples/good_image_dl.rb +1 -0
  24. data/samples/good_potato_chopping.rb +1 -0
  25. data/samples/good_psychidelic_circles.rb +9 -3
  26. data/samples/good_reminder.rb +1 -0
  27. data/samples/good_vjot.rb +12 -11
  28. data/samples/lib/require_me.rb +1 -0
  29. data/samples/nks_booklist.rb +1 -0
  30. data/samples/nks_breadsticks.rb +1 -0
  31. data/samples/nks_dancing_circle.rb +1 -0
  32. data/samples/nks_dictionary.rb +1 -0
  33. data/samples/nks_edit_box.rb +1 -0
  34. data/samples/nks_edit_line.rb +1 -0
  35. data/samples/nks_notes.rb +1 -0
  36. data/samples/nks_poem.rb +1 -0
  37. data/samples/nks_self.rb +1 -0
  38. data/samples/nks_text_sizes.rb +1 -0
  39. data/samples/nks_trurl.rb +1 -0
  40. data/samples/shape_arc_to.rb +1 -0
  41. data/samples/simple_accordion.rb +28 -27
  42. data/samples/simple_alert.rb +1 -0
  43. data/samples/simple_altered_para.rb +1 -0
  44. data/samples/simple_anim_shapes.rb +1 -0
  45. data/samples/simple_anim_text.rb +1 -0
  46. data/samples/simple_animate.rb +1 -0
  47. data/samples/simple_arc.rb +1 -0
  48. data/samples/simple_attach.rb +1 -0
  49. data/samples/simple_border_image.rb +1 -0
  50. data/samples/simple_borderless.rb +1 -0
  51. data/samples/simple_bounce.rb +1 -0
  52. data/samples/simple_breadsticks.rb +1 -0
  53. data/samples/simple_breadsticks2.rb +1 -0
  54. data/samples/simple_brightness_transitions.rb +1 -0
  55. data/samples/simple_button_animate.rb +1 -0
  56. data/samples/simple_buttons.rb +1 -0
  57. data/samples/simple_calc.rb +2 -1
  58. data/samples/simple_calc_2.rb +2 -1
  59. data/samples/simple_clipboard.rb +1 -0
  60. data/samples/simple_color_selector.rb +1 -0
  61. data/samples/simple_color_transitions.rb +1 -0
  62. data/samples/simple_concentric_circles.rb +1 -0
  63. data/samples/simple_console.rb +2 -1
  64. data/samples/simple_control_sizes.rb +1 -0
  65. data/samples/simple_count_and_draw.rb +1 -0
  66. data/samples/simple_curve.rb +1 -0
  67. data/samples/simple_dialogs.rb +1 -0
  68. data/samples/simple_dialogs_outside.rb +1 -0
  69. data/samples/simple_displace.rb +1 -0
  70. data/samples/simple_downloader.rb +1 -0
  71. data/samples/simple_draw.rb +1 -0
  72. data/samples/simple_editor.rb +1 -0
  73. data/samples/simple_face.rb +1 -0
  74. data/samples/simple_flashing.rb +1 -0
  75. data/samples/simple_flow_wrap.rb +1 -0
  76. data/samples/simple_font.rb +5 -0
  77. data/samples/simple_form.rb +1 -0
  78. data/samples/simple_fullscreen.rb +1 -0
  79. data/samples/simple_gradient_shapes.rb +1 -0
  80. data/samples/simple_guess_game.rb +1 -0
  81. data/samples/simple_image_as_stroke.rb +1 -0
  82. data/samples/simple_image_fill.rb +1 -0
  83. data/samples/simple_image_stroke.rb +1 -0
  84. data/samples/simple_info.rb +1 -0
  85. data/samples/simple_iterated_content.rb +1 -0
  86. data/samples/simple_keypress.rb +1 -0
  87. data/samples/simple_logo_display.rb +1 -0
  88. data/samples/simple_loogink_cy.rb +1 -0
  89. data/samples/simple_lorem_ipsum.rb +9 -8
  90. data/samples/simple_manual.rb +1 -0
  91. data/samples/simple_menu.rb +1 -0
  92. data/samples/simple_mouse_follow.rb +1 -0
  93. data/samples/simple_oval.rb +1 -0
  94. data/samples/simple_polygon_line.rb +1 -0
  95. data/samples/simple_position_as_we_go.rb +1 -0
  96. data/samples/simple_progress_bar.rb +1 -0
  97. data/samples/simple_random_bubbles.rb +1 -0
  98. data/samples/simple_require.rb +1 -0
  99. data/samples/simple_sample_executor.rb +2 -1
  100. data/samples/simple_sample_executor_all.rb +1 -0
  101. data/samples/simple_scroll.rb +22 -0
  102. data/samples/simple_sesame_street_shoes.rb +1 -0
  103. data/samples/simple_shoes_intro.rb +1 -0
  104. data/samples/simple_slide.rb +1 -0
  105. data/samples/simple_stack_flow_buttons.rb +1 -0
  106. data/samples/simple_stripes.rb +1 -0
  107. data/samples/simple_system_background.rb +1 -0
  108. data/samples/simple_text_movement.rb +1 -0
  109. data/samples/simple_tictactoe.rb +1 -0
  110. data/samples/simple_timer.rb +1 -0
  111. data/samples/simple_translate.rb +1 -0
  112. data/samples/simple_visibility.rb +1 -0
  113. metadata +7 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77ce575be9989516dc40b36a1f956ab28516166362ccb96ba16549d8b59fc459
4
- data.tar.gz: 7de15b6837b858f9e53834a79ad9045074f960c61adb12f8283584aeb2be6964
3
+ metadata.gz: 872c0e4a27c3da75a607bd97b5d9d4a1472c321531029b35c22984cd7bdceb65
4
+ data.tar.gz: 2aeed04b772047a63c441c7cae7bd65802e11d1d8c236f951f14a68cbd38a975
5
5
  SHA512:
6
- metadata.gz: 245a0593404c8b8440359dfa3b6eb2f568d01482913973e32cbce631e0ad5574ec6f98e27a19ff2093478cce712f3d04db1f8bc152e935cec54f04791b3b027d
7
- data.tar.gz: f906691dc79ce05defb0efd9d6a904f0e9987a74b990613b3841ffdbad7ca5cc97bf540273a62b9d4769590736e9fe859ba75b5381c37e718e9a296fa9e5156e
6
+ metadata.gz: 0f2459aa998b24382c1820573bc8d3652ceaddeb8bd6ff7b928b860878c1251d5438cb42130abedc1c94844c346b69e94ecb4563d20f40ccc304ec615ce24bad
7
+ data.tar.gz: 4dd04356e9f5a878d949fe81d6803885c96c5b877bd00ec4ab6075f2e8c316e215f7b14d6a5722a013ec2eb564eca4e1cf00f6e49d4532219c737b96762effe9
data/LICENSE CHANGED
@@ -3,6 +3,7 @@ Copyright (c) 2008 why the lucky stiff
3
3
  Except:
4
4
  fonts/Coolvetica.ttf (c) 1999 Ray Larabie
5
5
  fonts/Lacuna.ttf (c) 2003 Glashaus, designed by Peter Hoffman
6
+ fonts/FiraMono.otf Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A.
6
7
  samples/expert-minesweeper.rb (c) 2008 que
7
8
  samples/expert-othello.rb (c) 2008 Tieg Zaharia
8
9
  samples/expert-tankspank.rb (c) 2008 Kevin C.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'rubygems'
3
4
  require 'fileutils'
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'rubygems'
3
4
  require 'fileutils'
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class Shoes
3
4
  class Samples
4
5
  def self.path
@@ -67,6 +67,7 @@ simple_random_bubbles.rb
67
67
  simple_require.rb
68
68
  simple_sample_executor_all.rb
69
69
  simple_sample_executor.rb
70
+ simple_scroll.rb
70
71
  simple_sesame_street_shoes.rb
71
72
  simple_shoes_intro.rb
72
73
  simple_slide.rb
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'yaml'
3
4
 
4
5
  class Book < Shoes
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app title: "Dictionary, powered by Definr", width: 370, height: 320 do
3
4
  stack do
4
5
  background red, height: 60
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # This example tries Nokogiri (used in Shoes 4), but falls back to
3
4
  # Hpricot for Shoes 3 compatibility
4
5
  begin
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # Simple Game of Life with Shoes
3
4
  # by fuksito
4
5
  # vitaliy@yanchuk.me
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'irb/ruby-lex'
3
4
  require 'stringio'
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  #
3
4
  # Shoes Minesweeper by que/varyform
4
5
  #
@@ -6,7 +7,7 @@ LEVELS = { beginner: [9, 9, 10], intermediate: [16, 16, 40], expert: [30, 16, 99
6
7
 
7
8
  class Field
8
9
  CELL_SIZE = 20
9
- COLORS = %w(#00A #0A0 #A00 #004 #040 #400 #000).freeze
10
+ COLORS = %w[#00A #0A0 #A00 #004 #040 #400 #000].freeze
10
11
 
11
12
  class Cell
12
13
  attr_accessor :flag
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # Othello
3
4
  # by tieg
4
5
  # 1/13/08
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  #
3
4
  # Pong in Shoes
4
5
  # a clone of http://billmill.org/pong.html
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app title: 'Snake Game v0.1' do
3
4
  def game_start
4
5
  @score = para 'Score:', stroke: white
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # Tankspank
3
4
  # kevin conner
4
5
  # connerk@gmail.com
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  #==================================================================================================
3
4
  #
4
5
  # A Tetris game for Ruby Shoes
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  #
3
4
  # a translation from a processing example
4
5
  # http://vormplus.be/weging/an-introduction-to-processing/
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # The Shoes logo/icon bounces on the screen. The logo/icon responds to menu options and if clicked on.
3
4
  xspeed = 10
4
5
  yspeed = 6
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  #
3
4
  # Shoes Clock by Thomas Bell
4
5
  # posted to the Shoes mailing list on 04 Dec 2007
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class Layout
3
4
  def initialize(app, art, elements)
4
5
  @app = app
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  trails = [[0, 0]] * 60
3
4
  Shoes.app width: 200, height: 200, resizable: false do
4
5
  nostroke
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 300, height: 200 do
3
4
  background lime..blue
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app title: 'potacho', width: 175, height: 160 do
3
4
  background tan
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  degree = 0
3
4
  color = 0
4
5
  size = 0
@@ -21,10 +22,15 @@ Shoes.app width: 537, height: 500 do
21
22
  nostroke
22
23
  # Update some variables
23
24
  degree += 1
24
- size += 1
25
25
  degree = 0 if degree >= 360
26
- size = 0 if size >= 100
27
- color = 0.0 if color >= 1.0
26
+
27
+ size += 1
28
+ if size >= 100
29
+ size = 0
30
+ # Synchronize opacity change with size change because floating points
31
+ color = 0.0 if color >= 0.75
32
+ end
33
+
28
34
  color += 0.05 if (degree % 10).zero?
29
35
 
30
36
  # Draw inner circle
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'yaml'
3
4
 
4
5
  Shoes.app title: "A Gentle Reminder",
@@ -1,18 +1,19 @@
1
1
  # frozen_string_literal: true
2
- NOTES = [['Welcome to the vJot Clone', <<-'END']].freeze
3
- This sample app is a notetaker, a clone of PJ Hyett's vjot.com.
4
2
 
5
- Creating
6
- ----------
7
- Click "Add a New Note" and the jot will be loaded into the editor for reading or editing.
3
+ NOTES = [['Welcome to the vJot Clone', <<~'END']].freeze
4
+ This sample app is a notetaker, a clone of PJ Hyett's vjot.com.
8
5
 
9
- Editing
10
- ---------
11
- Click a jot's title to load it.
6
+ Creating
7
+ ----------
8
+ Click "Add a New Note" and the jot will be loaded into the editor for reading or editing.
12
9
 
13
- Saving
14
- --------
15
- There is no save button, the jot is saved as you edit.
10
+ Editing
11
+ ---------
12
+ Click a jot's title to load it.
13
+
14
+ Saving
15
+ --------
16
+ There is no save button, the jot is saved as you edit.
16
17
 
17
18
  END
18
19
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class RequireMe
3
4
  def self.message
4
5
  "This came from another file we required"
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class BookList < Shoes
3
4
  url '/', :index
4
5
  url '/twain', :twain
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 200, height: 80 do
3
4
  para "Testing test test. ",
4
5
  strong("Breadsticks. "),
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  @o = oval top: 0, left: 0,
4
5
  radius: 40
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class Dictionary < Shoes
3
4
  url '/', :index
4
5
  url '/(\w+)', :word
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  @e = edit_box "Would that I...",
4
5
  width: 400, height: 240
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  @e = edit_line width: 400
4
5
  button "O.K." do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  stack margin: 20, width: 250 do
4
5
  subtitle "Shoes Notebook"
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 280, height: 350 do
3
4
  flow width: 280, margin: 10 do
4
5
  stack width: "100%" do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  stack do
4
5
  edit_line "Sample sample."
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 150, height: 200 do
3
4
  stack do
4
5
  title "Title"
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  button("Trurl?") do
4
5
  alert("Klapaucius!")
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  shape do
4
5
  move_to(90, 55)
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Accordion
3
4
  OPEN_HEIGHT = 240
4
5
 
@@ -62,37 +63,37 @@ Shoes.app do
62
63
  style(Shoes::Link, stroke: black, underline: nil, weight: "strong")
63
64
  style(Shoes::LinkHover, stroke: black, fill: nil, underline: nil)
64
65
 
65
- page "0.0", true, <<-'END'
66
- There is a thought
67
- I have just had
68
- Which I don’t care to pass to
69
- Anyone at all at this time.
66
+ page "0.0", true, <<~'END'
67
+ There is a thought
68
+ I have just had
69
+ Which I don’t care to pass to
70
+ Anyone at all at this time.
70
71
 
71
- I have even forgotten it now,
72
- But kept only the pleasures
73
- Of my property
74
- And of my controlled mental slippage.
72
+ I have even forgotten it now,
73
+ But kept only the pleasures
74
+ Of my property
75
+ And of my controlled mental slippage.
75
76
  END
76
- page "0.1", false, <<-'END'
77
- My eyes have blinked again
78
- And I have just realized
79
- This upright world
80
- I have been in.
77
+ page "0.1", false, <<~'END'
78
+ My eyes have blinked again
79
+ And I have just realized
80
+ This upright world
81
+ I have been in.
81
82
 
82
- My eyelids wipe
83
- My eyes hundreds of times
84
- Reseting and renovating
85
- The scenery.
83
+ My eyelids wipe
84
+ My eyes hundreds of times
85
+ Reseting and renovating
86
+ The scenery.
86
87
  END
87
- page "0.2", false, <<-'END'
88
- Sister, without you,
89
- The universe would
90
- Have such a hole through it,
91
- Where infinity has been shot.
88
+ page "0.2", false, <<~'END'
89
+ Sister, without you,
90
+ The universe would
91
+ Have such a hole through it,
92
+ Where infinity has been shot.
92
93
 
93
- This cannot be, though.
94
- There will always be room
95
- For you—all of us are
96
- Holding the way open.
94
+ This cannot be, though.
95
+ There will always be room
96
+ For you—all of us are
97
+ Holding the way open.
97
98
  END
98
99
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  para "Click somewhere"
4
5
  click do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # sample56.rb
3
4
  Para = Shoes::Para
4
5
  Shoes.app width: 200, height: 160 do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  background rgb(0, 0, 0)
4
5
  fill rgb(255, 255, 255)
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  stack top: 0.5, left: 0.5 do
4
5
  para "Counting up:"
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  fill goldenrod
4
5
  stroke tomato
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  #
3
4
  # a translation from a processing example
4
5
  # http://vormplus.be/weging/an-introduction-to-processing/
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  stack do
4
5
  background blue
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 300, height: 300 do
3
4
  fname = File.join(Shoes::DIR, 'static/shoes-icon.png')
4
5
  background yellow..orange, angle: 90
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app border: false do
3
4
  title "Look, no borders!"
4
5
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  xspeed = 8.4
3
4
  yspeed = 6.6
4
5
  xdir = 1
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # Same snippet as http://shoes-tutorial-note.heroku.com/html/00402_No.1_para.html
3
4
 
4
5
  Shoes.app width: 240, height: 95 do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # Add new method bg and fg to sample17
3
4
 
4
5
  Shoes.app width: 240, height: 95 do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 300, height: 300 do
3
4
  10.times do |i|
4
5
  # light to dark
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  flow margin: 12 do
4
5
  # Set up three buttons
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  20.times { |i| button(format("hello%02d", i)) { |s| alert s.text } }
4
5
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class Calc
3
4
  def initialize
4
5
  @number = 0
@@ -46,7 +47,7 @@ Shoes.app height: 250, width: 200, resizable: false do
46
47
  end
47
48
 
48
49
  flow width: 218, margin: 4 do
49
- %w(7 8 9 / 4 5 6 * 1 2 3 - 0 Clr = +).each do |btn|
50
+ %w[7 8 9 / 4 5 6 * 1 2 3 - 0 Clr = +].each do |btn|
50
51
  button btn, width: 46, height: 46 do
51
52
  method = case btn
52
53
  when /[0-9]/ then 'press_' + btn
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app height: 250, width: 198 do
3
4
  def clear
4
5
  @accumulator = 0
@@ -20,7 +21,7 @@ Shoes.app height: 250, width: 198 do
20
21
  background '#996'..'#333', curve: 5
21
22
  number_field = para strong(@display, ' ' * 20), stroke: white, margin: 8
22
23
  flow width: 218 do
23
- %w(7 8 9 / 4 5 6 * 1 2 3 - 0 Clr = +).each do |btn|
24
+ %w[7 8 9 / 4 5 6 * 1 2 3 - 0 Clr = +].each do |btn|
24
25
  button btn, width: 46, height: 46 do
25
26
  case btn
26
27
  when /[0-9]/
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  stack do
4
5
  @line = edit_line "Put text here"
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  lb = list_box items: Shoes::COLORS.keys.map(&:to_s), choose: 'red' do |s|
4
5
  @o.style fill: send(s.text)
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  background chocolate..black, angle: 130
4
5
  strokewidth 20
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 330, height: 300 do
3
4
  nofill
4
5
  rect 100, 20, 130, 251, stroke: red, fill: yellow
@@ -1,9 +1,10 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  para "Hit Alt + / to open the shoes console and see different message!"
4
5
 
5
6
  flow do
6
- %w(info debug warn error).each do |type|
7
+ %w[info debug warn error].each do |type|
7
8
  button type.to_s do
8
9
  public_send type, "This is a #{type} message"
9
10
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 360, height: 600, resizable: false do
3
4
  stroke "#dde"
4
5
  background "#f1f5ff"
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  button 'go' do
4
5
  p = para 0, left: 0, top: 30
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  #
3
4
  # based on the cairo curve_to example
4
5
  # http://www.cairographics.org/samples/curve_to/
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 300, height: 150, margin: 10 do
3
4
  def answer(v)
4
5
  @answer.replace v.inspect
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # testing dialog options inside and outside of Shoes.app.
3
4
  # Quite annoying, I know.
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  # Shoes 3 doesn't support button.text
4
5
  position_report = ->(button, button_text) { @position_report.replace "#{button_text}: (#{button.left}, #{button.top})" }
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  background "#eee"
4
5
  @list = stack do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  background "#999"
4
5
  stroke "#000"
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  str = ""
3
4
  t = nil
4
5
  Shoes.app height: 500, width: 450 do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  #
3
4
  # Smiling face by Coraline Clark (age 5), 2013
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 300, height: 300 do
3
4
  COLORS = Shoes::COLORS
4
5
  background cadetblue
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 200 do
3
4
  flow margin: 12, fill: red do
4
5
  background red
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app height: 200 do
3
4
  font File.join(Shoes::DIR, 'fonts/Coolvetica.ttf')
4
5
  stack do
@@ -6,6 +7,10 @@ Shoes.app height: 200 do
6
7
  title 'Good Question'
7
8
  para 'Arial (default)', left: 400, top: 20
8
9
  end
10
+ flow do
11
+ title 'Good Question', font: 'Fira Mono'
12
+ para 'Fira Mono', left: 400, top: 20
13
+ end
9
14
  flow do
10
15
  title 'Cool Question', font: 'Coolvetica'
11
16
  para 'Coolvetica', left: 400, top: 20
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 320, height: 420 do
3
4
  static_dir = File.expand_path(File.join(__FILE__, ".."))
4
5
  background File.join(static_dir, "menu-gray.png")
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  button('fullscreen') { self.fullscreen = true }
4
5
  button('turn back') { self.fullscreen = false }
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  strokewidth 3
4
5
  eles = []
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class Answer < Shoes::Widget
3
4
  attr_reader :mark
4
5
 
@@ -1,5 +1,6 @@
1
1
 
2
2
  # frozen_string_literal: true
3
+
3
4
  Shoes.app width: 400, height: 400 do
4
5
  cap [:rect, :curve, :project][rand 3]
5
6
  background yellow
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  blue_box = File.expand_path(File.join(__FILE__, '../blue-box.png'))
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  red_box = File.expand_path(File.join(__FILE__, '../red-box.png'))
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  stack do
4
5
  # para DIR # Not support. https://github.com/shoes/shoes4/issues/105
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  10.times do |i|
4
5
  button "hello#{i}"
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  s = stack do
4
5
  title 'come on press some keys'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app title: 'Shoes 4 Logo Icon!', width: 310, height: 420 do
3
4
  stack do
4
5
  path = File.join(Shoes::DIR, 'static/shoes-icon.png')
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class PhotoFrame < Shoes
3
4
  url '/', :index
4
5
  url '/cy', :cy
@@ -1,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
- TEXT = <<EOS
3
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, \
4
- sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
5
- Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris \
6
- nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in \
7
- reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
8
- Excepteur sint occaecat cupidatat non proident, sunt in \
9
- culpa qui officia deserunt mollit anim id est laborum.
2
+
3
+ TEXT = <<~EOS
4
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, \
5
+ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
6
+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris \
7
+ nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in \
8
+ reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
9
+ Excepteur sint occaecat cupidatat non proident, sunt in \
10
+ culpa qui officia deserunt mollit anim id est laborum.
10
11
  EOS
11
12
 
12
13
  NL = "\n\n"
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'shoes/manual'
3
4
 
4
5
  Shoes::Manual.run 'English'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class MenuPanel < Shoes::Widget
3
4
  def self.boxes
4
5
  @boxes ||= []
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 200, height: 200 do
3
4
  background black
4
5
  fill white
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  oval 100, 100, 100, 50
4
5
  oval 200, 200, radius: 50
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 300, height: 300 do
3
4
  COLORS = Shoes::COLORS
4
5
  i = 45
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  stack do
4
5
  @p = para "Things get placed"
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app height: 200 do
3
4
  stack margin_left: 10 do
4
5
  title 'Progress Example'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class Range
3
4
  def rand
4
5
  Random.new.rand self
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  #
3
4
  # This app tests that we are correctly setting load paths so files relative to
4
5
  # the executing directory can be required withour require_relative shenanigans.
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 650, height: 32 do
3
4
  path = File.expand_path(File.join(__FILE__, ".."))
4
- %w(simple_altered_para simple_border_image simple_breadsticks simple_buttons).each do |name|
5
+ %w[simple_altered_para simple_border_image simple_breadsticks simple_buttons].each do |name|
5
6
  button(name) { load "#{path}/#{name}.rb" }
6
7
  end
7
8
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app title: 'Samples Executor', width: 540, height: 640 do
3
4
  BUTTON_HEIGHT = 20
4
5
 
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ Shoes.app height: 150 do
4
+ @stack = stack height: 150, scroll: true do
5
+ para strong("Press arrow keys to scroll too!\n")
6
+ 20.times do |i|
7
+ para i.to_s
8
+ end
9
+
10
+ oval 50, 50, 50, 50, fill: orange
11
+ rect 50, 150, 50, 50, fill: purple
12
+ arrow 80, 250, 60, fill: green
13
+ end
14
+
15
+ keypress do |key|
16
+ if key == :up
17
+ @stack.scroll_top -= 10
18
+ else
19
+ @stack.scroll_top += 10
20
+ end
21
+ end
22
+ end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 300, height: 100 do
3
4
  background forestgreen, curve: 30
4
5
  border gold, strokewidth: 5, curve: 30
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 700, height: 600 do
3
4
  title "Shoes is a ", link("tiny") { alert "Cool!" }, " graphics toolkit. "
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  #
3
4
  # mimicking the mootools demo for Fx.Slide
4
5
  # http://demos.mootools.net/Fx.Slide
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  flow(width: 300) { 3.times { |i| button "hello#{i}" } }
4
5
  stack(width: 100) { 3.times { |i| button "hello#{i}" } }
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  spacing = 20
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  fill system_background
4
5
  title "This should be in the default system background color for your OS", align: 'center'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app width: 400, height: 300 do
3
4
  el = edit_line text: 'Hello Shoes 4' do |s|
4
5
  @msg.text = s.text
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # Size module
3
4
  # Change these constants to change the size of the board.
4
5
  module SIZE
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app height: 150, width: 250 do
3
4
  background rgb(240, 250, 208)
4
5
  stack margin: 10 do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  para "The following art elements would have shown in the top corner if not for translate!", center: true, size: 20
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Shoes.app do
3
4
  slot = stack do
4
5
  background lightsteelblue
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoes
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.pre12
4
+ version: 4.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team Shoes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-02 00:00:00.000000000 Z
11
+ date: 2017-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 4.0.0.pre12
18
+ version: 4.0.0.rc1
19
19
  name: shoes-core
20
20
  prerelease: false
21
21
  type: :runtime
@@ -23,13 +23,13 @@ dependencies:
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.0.pre12
26
+ version: 4.0.0.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - '='
31
31
  - !ruby/object:Gem::Version
32
- version: 4.0.0.pre12
32
+ version: 4.0.0.rc1
33
33
  name: shoes-swt
34
34
  prerelease: false
35
35
  type: :runtime
@@ -37,7 +37,7 @@ dependencies:
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 4.0.0.pre12
40
+ version: 4.0.0.rc1
41
41
  - !ruby/object:Gem::Dependency
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
@@ -242,6 +242,7 @@ files:
242
242
  - samples/simple_require.rb
243
243
  - samples/simple_sample_executor.rb
244
244
  - samples/simple_sample_executor_all.rb
245
+ - samples/simple_scroll.rb
245
246
  - samples/simple_sesame_street_shoes.rb
246
247
  - samples/simple_shoes_intro.rb
247
248
  - samples/simple_slide.rb