shoes 3.0.1 → 4.0.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +44 -3
- data/.rspec +3 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +31 -0
- data/CHANGELOG +3 -0
- data/Gemfile +3 -0
- data/Guardfile +11 -0
- data/{COPYING → LICENSE} +1 -0
- data/README.md +160 -50
- data/Rakefile +188 -101
- data/app.yaml +59 -6
- data/benchmark/app_clear.rb +21 -0
- data/benchmark/clear.rb +69 -0
- data/benchmark/memory/text_dispose.rb +9 -0
- data/benchmark/para_creator.rb +9 -0
- data/benchmark/paras.rb +52 -0
- data/benchmark/urls.rb +40 -0
- data/bin/ruby-shoes +6 -0
- data/bin/shoes +59 -0
- data/bin/shoes-guard +8 -0
- data/bin/shoes-stub +59 -0
- data/bin/shoes.bat +6 -0
- data/ext/install/Rakefile +29 -0
- data/ext/install/shoes.bat +6 -0
- data/lib/ext/highlighter.rb +2 -0
- data/lib/ext/highlighter/common.rb +197 -0
- data/lib/ext/highlighter/lang/ruby.rb +316 -0
- data/lib/ext/highlighter/markup.rb +222 -0
- data/lib/rubygems_plugin.rb +19 -0
- data/lib/shoes.rb +114 -537
- data/lib/shoes/animation.rb +55 -0
- data/lib/shoes/app.rb +320 -0
- data/lib/shoes/arc.rb +35 -0
- data/lib/shoes/background.rb +30 -0
- data/lib/shoes/border.rb +33 -0
- data/lib/shoes/builtin_methods.rb +73 -0
- data/lib/shoes/button.rb +32 -0
- data/lib/shoes/check_button.rb +43 -0
- data/lib/shoes/cli.rb +96 -0
- data/lib/shoes/color.rb +375 -0
- data/lib/shoes/common/background_element.rb +9 -0
- data/lib/shoes/common/changeable.rb +34 -0
- data/lib/shoes/common/clickable.rb +17 -0
- data/lib/shoes/common/common_methods.rb +70 -0
- data/lib/shoes/common/fill.rb +21 -0
- data/lib/shoes/common/registration.rb +33 -0
- data/lib/shoes/common/state.rb +18 -0
- data/lib/shoes/common/stroke.rb +28 -0
- data/lib/shoes/common/style.rb +34 -0
- data/lib/shoes/common/style_normalizer.rb +16 -0
- data/lib/shoes/configuration.rb +96 -0
- data/lib/shoes/dialog.rb +27 -0
- data/lib/shoes/dimension.rb +237 -0
- data/lib/shoes/dimensions.rb +194 -0
- data/lib/shoes/download.rb +117 -0
- data/lib/shoes/dsl.rb +478 -0
- data/lib/shoes/font.rb +49 -0
- data/lib/shoes/gradient.rb +18 -0
- data/lib/shoes/help.rb +458 -391
- data/lib/shoes/image.rb +27 -19
- data/lib/shoes/image_pattern.rb +10 -0
- data/lib/shoes/input_box.rb +68 -0
- data/lib/shoes/key_event.rb +17 -0
- data/lib/shoes/line.rb +38 -0
- data/lib/shoes/link.rb +49 -0
- data/lib/shoes/link_hover.rb +5 -0
- data/lib/shoes/list_box.rb +44 -0
- data/lib/shoes/logger.rb +66 -0
- data/lib/shoes/logger/ruby.rb +18 -0
- data/lib/shoes/manual.rb +6 -0
- data/lib/shoes/mock.rb +30 -0
- data/lib/shoes/mock/animation.rb +8 -0
- data/lib/shoes/mock/app.rb +44 -0
- data/lib/shoes/mock/arc.rb +8 -0
- data/lib/shoes/mock/background.rb +10 -0
- data/lib/shoes/mock/border.rb +7 -0
- data/lib/shoes/mock/button.rb +10 -0
- data/lib/shoes/mock/check.rb +24 -0
- data/lib/shoes/mock/common_methods.rb +11 -0
- data/lib/shoes/mock/dialog.rb +13 -0
- data/lib/shoes/mock/download.rb +18 -0
- data/lib/shoes/mock/font.rb +17 -0
- data/lib/shoes/mock/image.rb +12 -0
- data/lib/shoes/mock/image_pattern.rb +9 -0
- data/lib/shoes/mock/input_box.rb +23 -0
- data/lib/shoes/mock/keypress.rb +8 -0
- data/lib/shoes/mock/keyrelease.rb +8 -0
- data/lib/shoes/mock/line.rb +14 -0
- data/lib/shoes/mock/link.rb +11 -0
- data/lib/shoes/mock/list_box.rb +16 -0
- data/lib/shoes/mock/oval.rb +11 -0
- data/lib/shoes/mock/progress.rb +10 -0
- data/lib/shoes/mock/radio.rb +26 -0
- data/lib/shoes/mock/rect.rb +13 -0
- data/lib/shoes/mock/shape.rb +19 -0
- data/lib/shoes/mock/slot.rb +14 -0
- data/lib/shoes/mock/sound.rb +8 -0
- data/lib/shoes/mock/star.rb +13 -0
- data/lib/shoes/mock/text_block.rb +29 -0
- data/lib/shoes/mock/timer.rb +8 -0
- data/lib/shoes/oval.rb +28 -0
- data/lib/shoes/point.rb +43 -0
- data/lib/shoes/progress.rb +26 -0
- data/lib/shoes/radio.rb +15 -0
- data/lib/shoes/rect.rb +28 -0
- data/lib/shoes/renamed_delegate.rb +15 -0
- data/lib/shoes/shape.rb +175 -0
- data/lib/shoes/slot.rb +232 -0
- data/lib/shoes/slot_contents.rb +56 -0
- data/lib/shoes/sound.rb +16 -0
- data/lib/shoes/span.rb +16 -0
- data/lib/shoes/star.rb +49 -0
- data/lib/shoes/swt.rb +114 -0
- data/lib/shoes/swt/animation.rb +46 -0
- data/lib/shoes/swt/app.rb +300 -0
- data/lib/shoes/swt/arc.rb +70 -0
- data/lib/shoes/swt/background.rb +31 -0
- data/lib/shoes/swt/border.rb +37 -0
- data/lib/shoes/swt/button.rb +18 -0
- data/lib/shoes/swt/check.rb +14 -0
- data/lib/shoes/swt/check_button.rb +19 -0
- data/lib/shoes/swt/color.rb +45 -0
- data/lib/shoes/swt/common/child.rb +16 -0
- data/lib/shoes/swt/common/clear.rb +24 -0
- data/lib/shoes/swt/common/clickable.rb +62 -0
- data/lib/shoes/swt/common/container.rb +28 -0
- data/lib/shoes/swt/common/fill.rb +37 -0
- data/lib/shoes/swt/common/painter.rb +83 -0
- data/lib/shoes/swt/common/painter_updates_position.rb +12 -0
- data/lib/shoes/swt/common/resource.rb +14 -0
- data/lib/shoes/swt/common/selection_listener.rb +14 -0
- data/lib/shoes/swt/common/stroke.rb +41 -0
- data/lib/shoes/swt/common/toggle.rb +13 -0
- data/lib/shoes/swt/common/update_position.rb +15 -0
- data/lib/shoes/swt/dialog.rb +89 -0
- data/lib/shoes/swt/disposed_protection.rb +23 -0
- data/lib/shoes/swt/download.rb +24 -0
- data/lib/shoes/swt/fitted_text_layout.rb +94 -0
- data/lib/shoes/swt/fitted_text_layout_collection.rb +108 -0
- data/lib/shoes/swt/font.rb +32 -0
- data/lib/shoes/swt/gradient.rb +77 -0
- data/lib/shoes/swt/image.rb +130 -0
- data/lib/shoes/swt/image_pattern.rb +19 -0
- data/lib/shoes/swt/input_box.rb +73 -0
- data/lib/shoes/swt/key_listener.rb +145 -0
- data/lib/shoes/swt/line.rb +57 -0
- data/lib/shoes/swt/link.rb +37 -0
- data/lib/shoes/swt/link_segment.rb +108 -0
- data/lib/shoes/swt/list_box.rb +49 -0
- data/lib/shoes/swt/mouse_move_listener.rb +61 -0
- data/lib/shoes/swt/oval.rb +53 -0
- data/lib/shoes/swt/progress.rb +35 -0
- data/lib/shoes/swt/radio.rb +29 -0
- data/lib/shoes/swt/radio_group.rb +54 -0
- data/lib/shoes/swt/rect.rb +31 -0
- data/lib/shoes/swt/rect_painter.rb +23 -0
- data/lib/shoes/swt/redrawing_aspect.rb +122 -0
- data/lib/shoes/swt/shape.rb +101 -0
- data/lib/shoes/swt/shoes_layout.rb +43 -0
- data/lib/shoes/swt/slot.rb +25 -0
- data/lib/shoes/swt/sound.rb +119 -0
- data/lib/shoes/swt/star.rb +51 -0
- data/lib/shoes/swt/swt_button.rb +49 -0
- data/lib/shoes/swt/text_block.rb +133 -0
- data/lib/shoes/swt/text_block_cursor_painter.rb +112 -0
- data/lib/shoes/swt/text_block_fitter.rb +180 -0
- data/lib/shoes/swt/text_block_painter.rb +49 -0
- data/lib/shoes/swt/text_font_factory.rb +27 -0
- data/lib/shoes/swt/text_style_factory.rb +88 -0
- data/lib/shoes/swt/timer.rb +19 -0
- data/lib/shoes/swt/tooling/leak_hunter.rb +84 -0
- data/lib/shoes/text.rb +14 -0
- data/lib/shoes/text_block.rb +162 -0
- data/lib/shoes/timer.rb +10 -0
- data/lib/shoes/url.rb +47 -0
- data/lib/shoes/version.rb +1 -1
- data/lib/shoes/widget.rb +73 -0
- data/lib/support/jl1.0.1.jar +0 -0
- data/lib/support/jogg-0.0.7.jar +0 -0
- data/lib/support/jorbis-0.0.15.jar +0 -0
- data/lib/support/log4j-1.2.16.jar +0 -0
- data/lib/support/mp3spi1.9.5.jar +0 -0
- data/lib/support/tritonus_share.jar +0 -0
- data/lib/support/vorbisspi1.0.3.jar +0 -0
- data/samples/README +86 -0
- data/samples/class-book-adjusted.rb +45 -0
- data/samples/class-book.rb +10 -10
- data/samples/cy.png +0 -0
- data/samples/expert-definr.rb +6 -6
- data/samples/expert-funnies.rb +23 -14
- data/samples/expert-game-of-life-adjusted.rb +249 -0
- data/samples/expert-game-of-life.rb +243 -0
- data/samples/expert-irb-adjusted.rb +110 -0
- data/samples/expert-irb.rb +7 -7
- data/samples/expert-minesweeper-adjusted.rb +272 -0
- data/samples/expert-minesweeper.rb +53 -53
- data/samples/expert-othello-adjusted.rb +325 -0
- data/samples/expert-othello.rb +38 -39
- data/samples/expert-pong.rb +10 -10
- data/samples/expert-snake.rb +78 -0
- data/samples/expert-tankspank.rb +354 -354
- data/samples/good-arc.rb +20 -12
- data/samples/good-clock-adjusted.rb +49 -0
- data/samples/good-clock.rb +5 -5
- data/samples/good-displace.rb +98 -0
- data/samples/good-follow.rb +3 -3
- data/samples/good-potato-chopping.rb +22 -0
- data/samples/good-reminder.rb +51 -51
- data/samples/good-vjot.rb +15 -13
- data/samples/loogink.png +0 -0
- data/samples/nks_poem.rb +22 -0
- data/samples/original-manual-adjusted.rb +475 -0
- data/samples/original-manual.rb +472 -0
- data/samples/potato_chopping/1258_s001.gif +0 -0
- data/samples/potato_chopping/1258_s002.gif +0 -0
- data/samples/potato_chopping/1258_s003.gif +0 -0
- data/samples/potato_chopping/1258_s004.gif +0 -0
- data/samples/potato_chopping/1258_s005.gif +0 -0
- data/samples/potato_chopping/1258_s006.gif +0 -0
- data/samples/potato_chopping/1258_s007.gif +0 -0
- data/samples/potato_chopping/1258_s008.gif +0 -0
- data/samples/potato_chopping/1258_s009.gif +0 -0
- data/samples/potato_chopping/1258_s010.gif +0 -0
- data/samples/potato_chopping/1258_s011.gif +0 -0
- data/samples/potato_chopping/1258_s012.gif +0 -0
- data/samples/potato_chopping/1258_s013.gif +0 -0
- data/samples/potato_chopping/1258_s014.gif +0 -0
- data/samples/potato_chopping/1258_s015.gif +0 -0
- data/samples/potato_chopping/1258_s016.gif +0 -0
- data/samples/potato_chopping/1258_s017.gif +0 -0
- data/samples/potato_chopping/1258_s018.gif +0 -0
- data/samples/potato_chopping/1258_s019.gif +0 -0
- data/samples/potato_chopping/1258_s020.gif +0 -0
- data/samples/potato_chopping/1258_s021.gif +0 -0
- data/samples/potato_chopping/1258_s022.gif +0 -0
- data/samples/potato_chopping/1258_s023.gif +0 -0
- data/samples/potato_chopping/1258_s024.gif +0 -0
- data/samples/potato_chopping/1258_s025.gif +0 -0
- data/samples/potato_chopping/1258_s026.gif +0 -0
- data/samples/potato_chopping/1258_s027.gif +0 -0
- data/samples/potato_chopping/1258_s028.gif +0 -0
- data/samples/potato_chopping/1258_s029.gif +0 -0
- data/samples/potato_chopping/1258_s030.gif +0 -0
- data/samples/potato_chopping/1258_s031.gif +0 -0
- data/samples/potato_chopping/1258_s032.gif +0 -0
- data/samples/potato_chopping/1258_s033.gif +0 -0
- data/samples/potato_chopping/1258_s034.gif +0 -0
- data/samples/potato_chopping/1258_s035.gif +0 -0
- data/samples/potato_chopping/1258_s036.gif +0 -0
- data/samples/potato_chopping/1258_s037.gif +0 -0
- data/samples/potato_chopping/1258_s038.gif +0 -0
- data/samples/potato_chopping/1258_s039.gif +0 -0
- data/samples/potato_chopping/1258_s040.gif +0 -0
- data/samples/potato_chopping/1258_s041.gif +0 -0
- data/samples/potato_chopping/1258_s042.gif +0 -0
- data/samples/potato_chopping/1258_s043.gif +0 -0
- data/samples/potato_chopping/1258_s044.gif +0 -0
- data/samples/potato_chopping/1258_s045.gif +0 -0
- data/samples/potato_chopping/1258_s046.gif +0 -0
- data/samples/potato_chopping/1258_s047.gif +0 -0
- data/samples/potato_chopping/1258_s048.gif +0 -0
- data/samples/potato_chopping/1258_s049.gif +0 -0
- data/samples/potato_chopping/1258_s050.gif +0 -0
- data/samples/potato_chopping/1258_s051.gif +0 -0
- data/samples/potato_chopping/1258_s052.gif +0 -0
- data/samples/potato_chopping/1258_s053.gif +0 -0
- data/samples/potato_chopping/1258_s054.gif +0 -0
- data/samples/potato_chopping/1258_s055.gif +0 -0
- data/samples/potato_chopping/1258_s056.gif +0 -0
- data/samples/potato_chopping/1258_s057.gif +0 -0
- data/samples/potato_chopping/1258_s058.gif +0 -0
- data/samples/potato_chopping/1258_s059.gif +0 -0
- data/samples/sample1.rb +30 -0
- data/samples/sample12.rb +21 -0
- data/samples/sample13.rb +13 -0
- data/samples/sample14.rb +64 -0
- data/samples/sample15.rb +18 -0
- data/samples/sample16.rb +10 -0
- data/samples/sample17.rb +10 -0
- data/samples/sample2.rb +14 -0
- data/samples/sample21.rb +5 -0
- data/samples/sample23.rb +8 -0
- data/samples/sample24.rb +21 -0
- data/samples/sample27.rb +18 -0
- data/samples/sample3.rb +14 -0
- data/samples/sample31.rb +22 -0
- data/samples/sample34.rb +27 -0
- data/samples/sample35.rb +32 -0
- data/samples/sample37.rb +8 -0
- data/samples/sample4.rb +7 -0
- data/samples/sample42.rb +14 -0
- data/samples/sample45.rb +11 -0
- data/samples/sample56.rb +10 -0
- data/samples/sample6.rb +9 -0
- data/samples/sample7.rb +3 -0
- data/samples/sample8.rb +7 -0
- data/samples/sample9.rb +10 -0
- data/samples/simple-accordion.rb +7 -7
- data/samples/simple-anim-shapes.rb +3 -3
- data/samples/simple-anim-text.rb +2 -2
- data/samples/simple-animate.rb +12 -0
- data/samples/simple-arc.rb +2 -2
- data/samples/simple-bounce.rb +4 -4
- data/samples/simple-brightness-transitions.rb +8 -0
- data/samples/simple-button-animate.rb +16 -0
- data/samples/simple-calc-2.rb +34 -0
- data/samples/simple-calc.rb +11 -11
- data/samples/simple-color-selector.rb +10 -0
- data/samples/simple-color-transitions.rb +11 -0
- data/samples/simple-control-sizes.rb +12 -12
- data/samples/simple-dialogs-outside.rb +12 -0
- data/samples/simple-dialogs.rb +4 -1
- data/samples/simple-displace.rb +15 -0
- data/samples/simple-downloader.rb +11 -11
- data/samples/simple-editor.rb +5 -5
- data/samples/simple-face.rb +14 -0
- data/samples/simple-flow-wrap.rb +11 -0
- data/samples/simple-font.rb +17 -0
- data/samples/simple-form.rb +14 -13
- data/samples/simple-fullscreen.rb +4 -0
- data/samples/simple-guess-game.rb +28 -0
- data/samples/simple-keypress.rb +14 -0
- data/samples/simple-manual.rb +2 -0
- data/samples/simple-mask.rb +4 -4
- data/samples/simple-menu.rb +28 -12
- data/samples/simple-mouse-follow.rb +8 -0
- data/samples/simple-move.rb +13 -0
- data/samples/simple-oval.rb +3 -0
- data/samples/simple-sample-executor.rb +6 -0
- data/samples/simple-shoes-intro.rb +22 -0
- data/samples/simple-slide.rb +15 -4
- data/samples/simple-sound.rb +30 -0
- data/samples/simple-sphere.rb +6 -6
- data/samples/simple-stripes.rb +8 -0
- data/samples/simple-timer.rb +4 -2
- data/samples/simple-video.rb +2 -2
- data/samples/sounds/102719__sarge4267__explosion.mp3 +0 -0
- data/samples/sounds/145622__andybrannan__train-fog-horn-long-wyomming.aiff +0 -0
- data/samples/sounds/46492__phreaksaccount__shields1.ogg +0 -0
- data/samples/sounds/61847__simon-rue__boink-v3.wav +0 -0
- data/shoes.gemspec +31 -11
- data/snapshots/sample1.png +0 -0
- data/snapshots/sample10.png +0 -0
- data/snapshots/sample11.png +0 -0
- data/snapshots/sample12.png +0 -0
- data/snapshots/sample13.png +0 -0
- data/snapshots/sample14.png +0 -0
- data/snapshots/sample15.png +0 -0
- data/snapshots/sample16.png +0 -0
- data/snapshots/sample17.png +0 -0
- data/snapshots/sample18.png +0 -0
- data/snapshots/sample19.png +0 -0
- data/snapshots/sample2.png +0 -0
- data/snapshots/sample20.png +0 -0
- data/snapshots/sample21.png +0 -0
- data/snapshots/sample22.png +0 -0
- data/snapshots/sample23.png +0 -0
- data/snapshots/sample24.png +0 -0
- data/snapshots/sample27.png +0 -0
- data/snapshots/sample28.png +0 -0
- data/snapshots/sample29.png +0 -0
- data/snapshots/sample3.png +0 -0
- data/snapshots/sample30.png +0 -0
- data/snapshots/sample31.png +0 -0
- data/snapshots/sample34.png +0 -0
- data/snapshots/sample35.png +0 -0
- data/snapshots/sample36.png +0 -0
- data/snapshots/sample37.png +0 -0
- data/snapshots/sample4.png +0 -0
- data/snapshots/sample42.png +0 -0
- data/snapshots/sample44.png +0 -0
- data/snapshots/sample45.png +0 -0
- data/snapshots/sample46.png +0 -0
- data/snapshots/sample5.png +0 -0
- data/snapshots/sample6.png +0 -0
- data/snapshots/sample7.png +0 -0
- data/snapshots/sample8.png +0 -0
- data/snapshots/sample9.png +0 -0
- data/snapshots/sample99.png +0 -0
- data/spec/async_helper.rb +21 -0
- data/spec/code_coverage.rb +11 -0
- data/spec/shoes/animation_spec.rb +65 -0
- data/spec/shoes/app_spec.rb +411 -0
- data/spec/shoes/arc_spec.rb +53 -0
- data/spec/shoes/background_spec.rb +48 -0
- data/spec/shoes/border_spec.rb +43 -0
- data/spec/shoes/builtin_methods_spec.rb +84 -0
- data/spec/shoes/button_spec.rb +41 -0
- data/spec/shoes/check_spec.rb +31 -0
- data/spec/shoes/cli_spec.rb +16 -0
- data/spec/shoes/color_spec.rb +396 -0
- data/spec/shoes/common/style_normalizer_spec.rb +28 -0
- data/spec/shoes/common/style_spec.rb +58 -0
- data/spec/shoes/configuration_spec.rb +37 -0
- data/spec/shoes/constants_spec.rb +38 -0
- data/spec/shoes/dialog_spec.rb +163 -0
- data/spec/shoes/dimension_spec.rb +381 -0
- data/spec/shoes/dimensions_spec.rb +831 -0
- data/spec/shoes/download_spec.rb +133 -0
- data/spec/shoes/flow_spec.rb +92 -0
- data/spec/shoes/font_spec.rb +38 -0
- data/spec/shoes/framework_learning_spec.rb +30 -0
- data/spec/shoes/helpers/fake_element.rb +11 -0
- data/spec/shoes/helpers/sample17_helper.rb +66 -0
- data/spec/shoes/image_spec.rb +45 -0
- data/spec/shoes/images/shoe.jpg +0 -0
- data/spec/shoes/input_box_spec.rb +44 -0
- data/spec/shoes/integration_spec.rb +20 -0
- data/spec/shoes/keypress_spec.rb +11 -0
- data/spec/shoes/keyrelease_spec.rb +12 -0
- data/spec/shoes/line_spec.rb +47 -0
- data/spec/shoes/link_spec.rb +89 -0
- data/spec/shoes/list_box_spec.rb +63 -0
- data/spec/shoes/logger/ruby_spec.rb +9 -0
- data/spec/shoes/logger_spec.rb +45 -0
- data/spec/shoes/oval_spec.rb +20 -0
- data/spec/shoes/point_spec.rb +51 -0
- data/spec/shoes/progress_spec.rb +40 -0
- data/spec/shoes/radio_spec.rb +28 -0
- data/spec/shoes/rect_spec.rb +38 -0
- data/spec/shoes/renamed_delegate_spec.rb +70 -0
- data/spec/shoes/shape_spec.rb +54 -0
- data/spec/shoes/shared_examples/button.rb +6 -0
- data/spec/shoes/shared_examples/changeable.rb +26 -0
- data/spec/shoes/shared_examples/clickable.rb +5 -0
- data/spec/shoes/shared_examples/common_methods.rb +42 -0
- data/spec/shoes/shared_examples/dimensions.rb +32 -0
- data/spec/shoes/shared_examples/dsl.rb +42 -0
- data/spec/shoes/shared_examples/dsl/animate.rb +29 -0
- data/spec/shoes/shared_examples/dsl/arc.rb +45 -0
- data/spec/shoes/shared_examples/dsl/background.rb +26 -0
- data/spec/shoes/shared_examples/dsl/border.rb +10 -0
- data/spec/shoes/shared_examples/dsl/cap.rb +6 -0
- data/spec/shoes/shared_examples/dsl/check.rb +11 -0
- data/spec/shoes/shared_examples/dsl/edit_box.rb +8 -0
- data/spec/shoes/shared_examples/dsl/edit_line.rb +8 -0
- data/spec/shoes/shared_examples/dsl/editable_element.rb +29 -0
- data/spec/shoes/shared_examples/dsl/fill.rb +27 -0
- data/spec/shoes/shared_examples/dsl/flow.rb +15 -0
- data/spec/shoes/shared_examples/dsl/gradient.rb +52 -0
- data/spec/shoes/shared_examples/dsl/image.rb +21 -0
- data/spec/shoes/shared_examples/dsl/line.rb +9 -0
- data/spec/shoes/shared_examples/dsl/nofill.rb +6 -0
- data/spec/shoes/shared_examples/dsl/nostroke.rb +6 -0
- data/spec/shoes/shared_examples/dsl/oval.rb +60 -0
- data/spec/shoes/shared_examples/dsl/pattern.rb +34 -0
- data/spec/shoes/shared_examples/dsl/progress.rb +7 -0
- data/spec/shoes/shared_examples/dsl/rect.rb +92 -0
- data/spec/shoes/shared_examples/dsl/rgb.rb +26 -0
- data/spec/shoes/shared_examples/dsl/shape.rb +21 -0
- data/spec/shoes/shared_examples/dsl/star.rb +48 -0
- data/spec/shoes/shared_examples/dsl/stroke.rb +30 -0
- data/spec/shoes/shared_examples/dsl/strokewidth.rb +19 -0
- data/spec/shoes/shared_examples/dsl/style.rb +32 -0
- data/spec/shoes/shared_examples/dsl/text_elements.rb +81 -0
- data/spec/shoes/shared_examples/dsl_app_context.rb +8 -0
- data/spec/shoes/shared_examples/hover_leave.rb +11 -0
- data/spec/shoes/shared_examples/parent.rb +6 -0
- data/spec/shoes/shared_examples/shared_element_method.rb +52 -0
- data/spec/shoes/shared_examples/slot.rb +272 -0
- data/spec/shoes/shared_examples/state.rb +19 -0
- data/spec/shoes/shared_examples/style.rb +24 -0
- data/spec/shoes/slot_spec.rb +60 -0
- data/spec/shoes/sound_spec.rb +15 -0
- data/spec/shoes/span_spec.rb +94 -0
- data/spec/shoes/spec_helper.rb +1 -0
- data/spec/shoes/stack_spec.rb +53 -0
- data/spec/shoes/star_spec.rb +30 -0
- data/spec/shoes/text_block_spec.rb +242 -0
- data/spec/shoes/url_spec.rb +66 -0
- data/spec/shoes/widget_spec.rb +34 -0
- data/spec/shoes_spec.rb +44 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/swt_shoes/animation_spec.rb +86 -0
- data/spec/swt_shoes/app_spec.rb +75 -0
- data/spec/swt_shoes/arc_spec.rb +101 -0
- data/spec/swt_shoes/background_spec.rb +56 -0
- data/spec/swt_shoes/border_spec.rb +51 -0
- data/spec/swt_shoes/button_spec.rb +101 -0
- data/spec/swt_shoes/check_spec.rb +28 -0
- data/spec/swt_shoes/color_spec.rb +67 -0
- data/spec/swt_shoes/common/painter_spec.rb +29 -0
- data/spec/swt_shoes/configuration_spec.rb +12 -0
- data/spec/swt_shoes/dialog_spec.rb +106 -0
- data/spec/swt_shoes/disposed_protection_spec.rb +49 -0
- data/spec/swt_shoes/fitted_text_layout_collection_spec.rb +174 -0
- data/spec/swt_shoes/fitted_text_layout_spec.rb +130 -0
- data/spec/swt_shoes/flow_spec.rb +26 -0
- data/spec/swt_shoes/font_spec.rb +33 -0
- data/spec/swt_shoes/gradient_spec.rb +20 -0
- data/spec/swt_shoes/image_pattern_spec.rb +19 -0
- data/spec/swt_shoes/image_spec.rb +100 -0
- data/spec/swt_shoes/input_box_spec.rb +110 -0
- data/spec/swt_shoes/integration_spec.rb +18 -0
- data/spec/swt_shoes/key_listener_spec.rb +320 -0
- data/spec/swt_shoes/line_spec.rb +43 -0
- data/spec/swt_shoes/link_segment_spec.rb +103 -0
- data/spec/swt_shoes/link_spec.rb +59 -0
- data/spec/swt_shoes/list_box_spec.rb +51 -0
- data/spec/swt_shoes/minimal.png +0 -0
- data/spec/swt_shoes/mouse_move_listener_spec.rb +129 -0
- data/spec/swt_shoes/oval_spec.rb +51 -0
- data/spec/swt_shoes/progress_spec.rb +44 -0
- data/spec/swt_shoes/radio_group_spec.rb +73 -0
- data/spec/swt_shoes/radio_spec.rb +56 -0
- data/spec/swt_shoes/rect_painter_spec.rb +45 -0
- data/spec/swt_shoes/rect_spec.rb +19 -0
- data/spec/swt_shoes/shape_spec.rb +81 -0
- data/spec/swt_shoes/shared_examples/button.rb +24 -0
- data/spec/swt_shoes/shared_examples/clearable.rb +32 -0
- data/spec/swt_shoes/shared_examples/clickable.rb +60 -0
- data/spec/swt_shoes/shared_examples/movable.rb +36 -0
- data/spec/swt_shoes/shared_examples/paintable_spec.rb +7 -0
- data/spec/swt_shoes/shared_examples/painter.rb +83 -0
- data/spec/swt_shoes/shared_examples/pattern.rb +32 -0
- data/spec/swt_shoes/shared_examples/swt_app_context.rb +17 -0
- data/spec/swt_shoes/shared_examples/togglable.rb +15 -0
- data/spec/swt_shoes/shell_control_listener_spec.rb +23 -0
- data/spec/swt_shoes/sound.rb +10 -0
- data/spec/swt_shoes/spec_helper.rb +31 -0
- data/spec/swt_shoes/star_spec.rb +47 -0
- data/spec/swt_shoes/text_block_cursor_painter_spec.rb +202 -0
- data/spec/swt_shoes/text_block_fitter_spec.rb +181 -0
- data/spec/swt_shoes/text_block_painter_spec.rb +221 -0
- data/spec/swt_shoes/text_block_spec.rb +183 -0
- data/static/PKGBUILD +47 -0
- data/static/downloading.png +0 -0
- data/static/manual-en.txt +119 -128
- data/static/manual-ja.txt +97 -93
- data/static/manual.css +19 -2
- data/static/shoes-icon-brown.png +0 -0
- data/static/shoes-manual-apps.png +0 -0
- metadata +740 -402
- data/README.old +0 -117
- data/Rakefile.bk +0 -651
- data/bin/main.skel +0 -104
- data/bugs/issue-012e9468ddc7b0cb7e1503413a8a11c4f8707b67.yaml +0 -21
- data/bugs/issue-0711ff8b67baa63586f11d0096fee9dd4436bf58.yaml +0 -23
- data/bugs/issue-07f87998d93eb401e22395c11085676389b935c4.yaml +0 -22
- data/bugs/issue-0bff2d80008803cbc7efbcdacdc60ef2163664d2.yaml +0 -22
- data/bugs/issue-0c66f223d19efbca7b692f3b91961f407ad7abec.yaml +0 -24
- data/bugs/issue-183bc3c7a8f575aff2b24e0bf22aa0dfcc8e4fc2.yaml +0 -29
- data/bugs/issue-1bad1e60a04cb3adb6a8f3ded128af2e16b56ffe.yaml +0 -18
- data/bugs/issue-1f1d43f76bf4de79d7f94adbae6dd506a9d81633.yaml +0 -41
- data/bugs/issue-320924117cadb045cc91f2a6fca922b4d81d4bb5.yaml +0 -20
- data/bugs/issue-33e5c8355fbf65252ea9e939714651df8bd8cb3b.yaml +0 -25
- data/bugs/issue-36f7c8262a72bcd5e28cfa4ed29328b8237ea79b.yaml +0 -20
- data/bugs/issue-39bf04ee50c3bef67b89b8e9beb28657805587ce.yaml +0 -18
- data/bugs/issue-3e28ba7754f73d02ef416eef989af707a8c00f01.yaml +0 -23
- data/bugs/issue-3f638cc03f41f9c3fdf217355321f1563f8fee45.yaml +0 -22
- data/bugs/issue-41e48e14f1ef4f6deb69be68165d7dd3ffd99156.yaml +0 -22
- data/bugs/issue-4c9408166a2aa5dd333bbb05520deebf4ded08e0.yaml +0 -22
- data/bugs/issue-55c687e108ecd5aeb8e0d0aeb4294984f84acd3e.yaml +0 -18
- data/bugs/issue-5811d34692cc292717a58ec1df1f8948cf30d826.yaml +0 -28
- data/bugs/issue-5a7c1f59a0526f9cea7fb366867cf1e6ed8ef69d.yaml +0 -22
- data/bugs/issue-688a2c2566bef6a03efa57a4ae1f7cfa8fc74444.yaml +0 -21
- data/bugs/issue-78b16c7988ade2ef96e716fa8cb9a004bd4ced65.yaml +0 -33
- data/bugs/issue-804ee49f9800154eddf0650690c7a9bb5626253f.yaml +0 -27
- data/bugs/issue-807dd1c610b2e941a5d454e26b2eac27e89a0ab4.yaml +0 -22
- data/bugs/issue-822ee33ec11ebd25f90ea86e8438de7891e63aee.yaml +0 -18
- data/bugs/issue-82ff7152cebb8a1cb065b864cb4fe22de2328146.yaml +0 -29
- data/bugs/issue-856afbdcdd4970ad54b8ce4a6c017fbaab45f49d.yaml +0 -31
- data/bugs/issue-8d49e32fb21522651c67490adb4d80076dbb14e1.yaml +0 -24
- data/bugs/issue-91583359653a9d530c1e32be72d874d847a306e7.yaml +0 -21
- data/bugs/issue-af41a5229613172764e7d3c98431172db337053d.yaml +0 -20
- data/bugs/issue-bd9856b3788dd429c998a5af1b2aae8221cb80b7.yaml +0 -28
- data/bugs/issue-be22aef5c564fb7b5e9938343136a9cd6a2edb7b.yaml +0 -22
- data/bugs/issue-bf8697523c77c326e7e35fc82cf3dd739ae92310.yaml +0 -27
- data/bugs/issue-cdd4b4795f34d6ff46e56ece10f8216a4a5456b2.yaml +0 -25
- data/bugs/issue-d9bfb5581d745ef9deb3b9b2e08ef74d1cd43082.yaml +0 -20
- data/bugs/issue-e0ce2f687cc096f35715d28b0af88589f4ab6cc6.yaml +0 -18
- data/bugs/issue-e4b0aca4a10a574b333aeaecaaf221dbc5ed22c6.yaml +0 -38
- data/bugs/issue-f263746594b95ba778455730478ee8df60ee639d.yaml +0 -22
- data/bugs/project.yaml +0 -72
- data/builddeps.sh +0 -102
- data/gemlib/shoes.rb +0 -1
- data/lib/shoes/cache.rb +0 -54
- data/lib/shoes/chipmunk.rb +0 -35
- data/lib/shoes/data.rb +0 -39
- data/lib/shoes/inspect.rb +0 -128
- data/lib/shoes/log.rb +0 -48
- data/lib/shoes/minitar.rb +0 -986
- data/lib/shoes/override.rb +0 -38
- data/lib/shoes/pack.rb +0 -543
- data/lib/shoes/search.rb +0 -46
- data/lib/shoes/setup.rb +0 -329
- data/lib/shoes/shy.rb +0 -131
- data/lib/shoes/shybuilder.rb +0 -44
- data/make/darwin/deps.vlc +0 -12
- data/make/darwin/dylibs.shoes +0 -22
- data/make/darwin/dylibs.video +0 -11
- data/make/darwin/env.rb +0 -81
- data/make/darwin/tasks.rb +0 -105
- data/make/linux/env.rb +0 -65
- data/make/linux/tasks.rb +0 -61
- data/make/make.rb +0 -85
- data/make/mingw/dlls +0 -19
- data/make/mingw/env.rb +0 -69
- data/make/mingw/tasks.rb +0 -70
- data/make/rakefile_common.rb +0 -8
- data/manual-snapshots/class-book.png +0 -0
- data/manual-snapshots/expert-definr.png +0 -0
- data/manual-snapshots/expert-funnies.png +0 -0
- data/manual-snapshots/expert-irb.png +0 -0
- data/manual-snapshots/expert-minesweeper.png +0 -0
- data/manual-snapshots/expert-othello.png +0 -0
- data/manual-snapshots/expert-pong.png +0 -0
- data/manual-snapshots/expert-tankspank.png +0 -0
- data/manual-snapshots/good-arc.png +0 -0
- data/manual-snapshots/good-clock.png +0 -0
- data/manual-snapshots/good-follow.png +0 -0
- data/manual-snapshots/good-reminder.png +0 -0
- data/manual-snapshots/good-vjot.png +0 -0
- data/manual-snapshots/simple-accordion.png +0 -0
- data/manual-snapshots/simple-anim-shapes.png +0 -0
- data/manual-snapshots/simple-anim-text.png +0 -0
- data/manual-snapshots/simple-arc.png +0 -0
- data/manual-snapshots/simple-bounce.png +0 -0
- data/manual-snapshots/simple-calc.png +0 -0
- data/manual-snapshots/simple-chipmunk.png +0 -0
- data/manual-snapshots/simple-control-sizes.png +0 -0
- data/manual-snapshots/simple-curve.png +0 -0
- data/manual-snapshots/simple-dialogs.png +0 -0
- data/manual-snapshots/simple-downloader.png +0 -0
- data/manual-snapshots/simple-draw.png +0 -0
- data/manual-snapshots/simple-editor.png +0 -0
- data/manual-snapshots/simple-form.png +0 -0
- data/manual-snapshots/simple-mask.png +0 -0
- data/manual-snapshots/simple-menu.png +0 -0
- data/manual-snapshots/simple-menu1.png +0 -0
- data/manual-snapshots/simple-rubygems.png +0 -0
- data/manual-snapshots/simple-slide.png +0 -0
- data/manual-snapshots/simple-sphere.png +0 -0
- data/manual-snapshots/simple-sqlite3.png +0 -0
- data/manual-snapshots/simple-timer.png +0 -0
- data/manual-snapshots/simple-video.png +0 -0
- data/platform/mac/Info.plist +0 -55
- data/platform/mac/build-deps.sh +0 -658
- data/platform/mac/command-manual.rb +0 -1
- data/platform/mac/deps-osx.patch +0 -159
- data/platform/mac/dmg_ds_store +0 -0
- data/platform/mac/pangorc +0 -2
- data/platform/mac/pkg-dmg +0 -1447
- data/platform/mac/shoes +0 -31
- data/platform/mac/shoes-launch +0 -7
- data/platform/mac/stub.m +0 -178
- data/platform/mac/version.plist +0 -14
- data/platform/msw/base.nsi +0 -644
- data/platform/msw/installer-1.bmp +0 -0
- data/platform/msw/installer-2.bmp +0 -0
- data/platform/msw/shoes.exe.manifest +0 -17
- data/platform/msw/shoes.ico +0 -0
- data/platform/msw/stub-inject.c +0 -59
- data/platform/msw/stub.c +0 -271
- data/platform/msw/stub32.h +0 -14
- data/platform/msw/stub32.rc +0 -16
- data/platform/nix/INSTALL +0 -56
- data/platform/nix/Makefile +0 -144
- data/platform/nix/shoes.launch +0 -20
- data/platform/skel.rb +0 -27
- data/rakefile_darwin.rb +0 -7
- data/rakefile_linux.rb +0 -3
- data/rakefile_mingw.rb +0 -7
- data/samples/simple-chipmunk.rb +0 -26
- data/samples/simple-menu1.rb +0 -35
- data/samples/simple-rubygems.rb +0 -29
- data/samples/simple-sqlite3.rb +0 -13
- data/shoes/app.c +0 -591
- data/shoes/app.h +0 -110
- data/shoes/appwin32.h +0 -13
- data/shoes/appwin32.rc +0 -28
- data/shoes/canvas.c +0 -2202
- data/shoes/canvas.h +0 -682
- data/shoes/code.h +0 -14
- data/shoes/config.h +0 -232
- data/shoes/effects.c +0 -243
- data/shoes/effects.h +0 -7
- data/shoes/http.h +0 -44
- data/shoes/http/common.h +0 -86
- data/shoes/http/curl.c +0 -259
- data/shoes/http/nsurl.m +0 -274
- data/shoes/http/windownload.c +0 -114
- data/shoes/http/winhttp.c +0 -216
- data/shoes/http/winhttp.h +0 -19
- data/shoes/image.c +0 -1020
- data/shoes/internal.c +0 -46
- data/shoes/internal.h +0 -63
- data/shoes/native.h +0 -110
- data/shoes/native/cocoa.h +0 -105
- data/shoes/native/cocoa.m +0 -1557
- data/shoes/native/gtk.c +0 -1257
- data/shoes/native/windows.c +0 -2392
- data/shoes/ruby.c +0 -5221
- data/shoes/ruby.h +0 -299
- data/shoes/world.c +0 -243
- data/shoes/world.h +0 -63
- data/static/stubs/blank.exe +0 -0
- data/static/stubs/blank.hfz +0 -0
- data/static/stubs/blank.run +0 -375
- data/static/stubs/cocoa-install +0 -0
- data/static/stubs/sh-install +0 -49
- data/static/stubs/shoes-stub-inject.exe +0 -0
- data/static/stubs/shoes-stub.exe +0 -0
- data/test/shoes_test.rb +0 -8
- data/test/test_helper.rb +0 -25
- data/use-deps +0 -12
- data/use-tmp-dep +0 -8
Binary file
|
data/static/manual-en.txt
CHANGED
@@ -8,18 +8,17 @@ You see, the trivial Shoes program can be just one line:
|
|
8
8
|
|
9
9
|
{{{
|
10
10
|
#!ruby
|
11
|
-
Shoes.app
|
11
|
+
Shoes.app{button("Click me!"){alert("Good job.")}}
|
12
12
|
}}}
|
13
13
|
|
14
14
|
Shoes programs are written in a language called Ruby. When Shoes is handed
|
15
15
|
this simple line of Ruby code, a window appears with a button inside reading
|
16
16
|
"Click me!" When the button is clicked, a message pops up.
|
17
17
|
|
18
|
-
On Linux, here's how this might look: !{:
|
18
|
+
On Linux, here's how this might look: !{margin_left: 100}man-shot1.png!
|
19
19
|
|
20
20
|
While lots of Shoes apps are graphical games and art programs, you can also
|
21
|
-
layout text and edit controls easily. !{:
|
22
|
-
40}shoes-manual-apps.gif!
|
21
|
+
layout text and edit controls easily. !{margin_left: 40}shoes-manual-apps.gif!
|
23
22
|
|
24
23
|
And, ideally, Shoes programs will run on any of the major platforms out there.
|
25
24
|
Microsoft Windows, Apple's Mac OS X, Linux and many others.
|
@@ -95,7 +94,7 @@ Here's how to run the installer:
|
|
95
94
|
|
96
95
|
* On '''Mac OS X''', you'll have a file ending with '''.dmg'''. Double-click this file and a window should appear with a '''Shoes''' icon and an '''Applications''' folder. Following the arrow, drag the Shoes icon into the '''Applications''' folder. !man-intro-dmg.png!
|
97
96
|
* On '''Windows''', you'll download a '''.exe''' file. Double-click this file and follow the instructions. !man-intro-exe.png!
|
98
|
-
* On '''Linux''', you'll
|
97
|
+
* On '''Linux''', you'll need to compile your own Shoes. Check out [[https://github.com/shoes/shoes/wiki/Building-Shoes-on-Linux this page]] for more. We want to provide packages eventually!
|
99
98
|
|
100
99
|
==== Step 2: Start a New Text File ====
|
101
100
|
|
@@ -229,10 +228,10 @@ the [[Element.window]] and [[Element.dialog]] methods, in addition to
|
|
229
228
|
Shoes.app.
|
230
229
|
|
231
230
|
{{{
|
232
|
-
Shoes.app :
|
231
|
+
Shoes.app title: "MAIN" do
|
233
232
|
para self
|
234
233
|
button "Spawn" do
|
235
|
-
window :
|
234
|
+
window title: "CHILD" do
|
236
235
|
para self
|
237
236
|
end
|
238
237
|
end
|
@@ -300,7 +299,7 @@ App object so you can do somefurther editing.
|
|
300
299
|
end
|
301
300
|
def add(msg)
|
302
301
|
@stack.app do
|
303
|
-
|
302
|
+
append do
|
304
303
|
para msg
|
305
304
|
end
|
306
305
|
end
|
@@ -326,11 +325,11 @@ Fixed widths on slots are great so you can split the window into columns.
|
|
326
325
|
{{{
|
327
326
|
Shoes.app do
|
328
327
|
flow do
|
329
|
-
stack :
|
328
|
+
stack width: 200 do
|
330
329
|
caption "Column one"
|
331
330
|
para "is 200 pixels wide"
|
332
331
|
end
|
333
|
-
stack :
|
332
|
+
stack width: -200 do
|
334
333
|
caption "Column two"
|
335
334
|
para "is 100% minus 200 pixels wide"
|
336
335
|
end
|
@@ -347,12 +346,12 @@ differently. To be sure that the end of the slot is chopped off perfectly, the
|
|
347
346
|
slot becomes a '''nested window'''. A new layer is created by the operating
|
348
347
|
system to keep the slot in a fixed square.
|
349
348
|
|
350
|
-
|
349
|
+
One difference between normal slots and nested window slots is that the latter
|
351
350
|
can have scrollbars.
|
352
351
|
|
353
352
|
{{{
|
354
353
|
Shoes.app do
|
355
|
-
stack :
|
354
|
+
stack width: 200, height: 200, scroll: true do
|
356
355
|
background "#DFA"
|
357
356
|
100.times do |i|
|
358
357
|
para "Paragraph No. #{i}"
|
@@ -443,8 +442,8 @@ To illustrate:
|
|
443
442
|
|
444
443
|
{{{
|
445
444
|
Shoes.app do
|
446
|
-
stack :
|
447
|
-
@edit = edit_box :
|
445
|
+
stack margin: 10 do
|
446
|
+
@edit = edit_box width: 1.0 do
|
448
447
|
@para.text = @edit.text
|
449
448
|
end
|
450
449
|
@para = para ""
|
@@ -467,7 +466,7 @@ UI Gothic'''.
|
|
467
466
|
|
468
467
|
{{{
|
469
468
|
Shoes.app do
|
470
|
-
para "てすと (te-su-to)", :
|
469
|
+
para "てすと (te-su-to)", font: case RUBY_PLATFORM
|
471
470
|
when /mingw/; "MS UI Gothic"
|
472
471
|
when /darwin/; "AppleGothic, Arial"
|
473
472
|
else "Arial"
|
@@ -709,7 +708,7 @@ you'll get back a `true`. If not, you'll get back `false`.
|
|
709
708
|
{{{
|
710
709
|
#!ruby
|
711
710
|
if confirm("Draw a circle?")
|
712
|
-
Shoes.app{ oval :
|
711
|
+
Shoes.app{ oval top: 0, left: 0, radius: 50 }
|
713
712
|
end
|
714
713
|
}}}
|
715
714
|
|
@@ -847,7 +846,7 @@ App object is created and filled up with stacks, flows and other Shoes
|
|
847
846
|
elements.
|
848
847
|
|
849
848
|
The App is the window itself. Which may be closed or cleared and filled with
|
850
|
-
new elements. !{:
|
849
|
+
new elements. !{margin_left: 100}man-app.png!
|
851
850
|
|
852
851
|
The App itself, in slot/box terminology, is a flow. See the ''Slots'' section
|
853
852
|
for more, but this just means that any elements placed directly at the
|
@@ -863,11 +862,11 @@ resizable.
|
|
863
862
|
|
864
863
|
{{{
|
865
864
|
#!ruby
|
866
|
-
Shoes.app(:
|
867
|
-
:
|
865
|
+
Shoes.app(title: "White Circle",
|
866
|
+
width: 200, height: 200, resizable: false) {
|
868
867
|
background black
|
869
868
|
fill white
|
870
|
-
oval :
|
869
|
+
oval top: 20, left: 20, radius: 160
|
871
870
|
}
|
872
871
|
}}}
|
873
872
|
|
@@ -914,7 +913,7 @@ If you attach a block to a download, it'll get called as the `finish` event.
|
|
914
913
|
#!ruby
|
915
914
|
Shoes.app do
|
916
915
|
stack do
|
917
|
-
title "Searching Google", :
|
916
|
+
title "Searching Google", size: 16
|
918
917
|
@status = para "One moment..."
|
919
918
|
|
920
919
|
# Search Google for 'shoes' and print the HTTP headers
|
@@ -936,11 +935,11 @@ Another simple use of `download` is to save some web data to a file, using the
|
|
936
935
|
#!ruby
|
937
936
|
Shoes.app do
|
938
937
|
stack do
|
939
|
-
title "Downloading Google image", :
|
938
|
+
title "Downloading Google image", size: 16
|
940
939
|
@status = para "One moment..."
|
941
940
|
|
942
941
|
download "http://www.google.com/logos/nasa50th.gif",
|
943
|
-
:
|
942
|
+
save: "nasa50th.gif" do
|
944
943
|
@status.text = "Okay, is downloaded."
|
945
944
|
end
|
946
945
|
end
|
@@ -951,29 +950,6 @@ In this case, you can still get the headers for the downloaded file, but
|
|
951
950
|
`response.body` will be `nil`, since the data wasn't saved to memory. You will
|
952
951
|
need to open the file to get the downloaded goods.
|
953
952
|
|
954
|
-
If you need to send certain headers or actions to the web server, you can use
|
955
|
-
the `:method`, `:headers` and `:body` styles to customize the HTTP request.
|
956
|
-
(And, if you need to go beyond these, you can always break out Ruby's OpenURI
|
957
|
-
class.)
|
958
|
-
|
959
|
-
{{{
|
960
|
-
#!ruby
|
961
|
-
Shoes.app do
|
962
|
-
stack do
|
963
|
-
title "GET Google", :size => 16
|
964
|
-
@status = para "One moment..."
|
965
|
-
|
966
|
-
download "http://www.google.com/search?q=shoes",
|
967
|
-
:method => "GET" do |dump|
|
968
|
-
@status.text = dump.response.body
|
969
|
-
end
|
970
|
-
end
|
971
|
-
end
|
972
|
-
}}}
|
973
|
-
|
974
|
-
As you can see from the above example, Shoes makes use of the "GET" method to
|
975
|
-
query google's search engine.
|
976
|
-
|
977
953
|
=== location() » a string ===
|
978
954
|
|
979
955
|
Gets a string containing the URL of the current app.
|
@@ -1023,8 +999,8 @@ entire class of elements. (Like giving all paragraphs a certain font.)
|
|
1023
999
|
Styles are easy to spot. They usually show up when the element is created.
|
1024
1000
|
|
1025
1001
|
{{{
|
1026
|
-
Shoes.app :
|
1027
|
-
para "Red with an underline", :
|
1002
|
+
Shoes.app title: "A Styling Sample" do
|
1003
|
+
para "Red with an underline", stroke: red, underline: "single"
|
1028
1004
|
end
|
1029
1005
|
}}}
|
1030
1006
|
|
@@ -1035,9 +1011,9 @@ The style hash can also be changed by using the [[Common.style]] method,
|
|
1035
1011
|
available on every element and slot.
|
1036
1012
|
|
1037
1013
|
{{{
|
1038
|
-
Shoes.app :
|
1014
|
+
Shoes.app title: "A Styling Sample" do
|
1039
1015
|
@text = para "Red with an underline"
|
1040
|
-
@text.style(:
|
1016
|
+
@text.style(stroke: red, underline: "single")
|
1041
1017
|
end
|
1042
1018
|
}}}
|
1043
1019
|
|
@@ -1045,7 +1021,7 @@ Most styles can also be set by calling them as methods. (I'd use the manual
|
|
1045
1021
|
search to find the method.)
|
1046
1022
|
|
1047
1023
|
{{{
|
1048
|
-
Shoes.app :
|
1024
|
+
Shoes.app title: "A Styling Sample" do
|
1049
1025
|
@text = para "Red with an underline"
|
1050
1026
|
@text.stroke = red
|
1051
1027
|
@text.underline = "single"
|
@@ -1079,9 +1055,8 @@ degrees counter-clockwise and the gradient will go from left to right.
|
|
1079
1055
|
|
1080
1056
|
For: ''flow, stack''.
|
1081
1057
|
|
1082
|
-
Pins a slot relative to another slot or element. Also, one may write
|
1083
|
-
|
1084
|
-
a bit further, the style `:top => 10, :left => 10, :attach => Window` would
|
1058
|
+
Pins a slot relative to another slot or element. Also, one may write `attach: Window` to position the slot at the window's top, left corner. Taking this
|
1059
|
+
a bit further, the style `top: 10, left: 10, attach: Window` would
|
1085
1060
|
place the slot at (10, 10) in the window's coordinates.
|
1086
1061
|
|
1087
1062
|
If a slot is attached to an element that moves, the slot will move with it. If
|
@@ -1100,7 +1075,7 @@ will start without asking the user.
|
|
1100
1075
|
For: ''all slots and elements''.
|
1101
1076
|
|
1102
1077
|
Sets the pixel coordinate of an element's lower edge. The edge is placed
|
1103
|
-
relative to its container's lower edge. So,
|
1078
|
+
relative to its container's lower edge. So, `bottom: 0` will align the
|
1104
1079
|
element so that its bottom edge and the bottom edge of its slot touch.
|
1105
1080
|
|
1106
1081
|
=== :cap » :curve or :rect or :project ===
|
@@ -1246,7 +1221,7 @@ being 100%.)
|
|
1246
1221
|
|
1247
1222
|
For: ''all slots and elements''.
|
1248
1223
|
|
1249
|
-
Hides or shows this object. Any object with
|
1224
|
+
Hides or shows this object. Any object with `hidden: true` are not
|
1250
1225
|
displayed on the screen. Neither are its children.
|
1251
1226
|
|
1252
1227
|
=== :inner » a number ===
|
@@ -1287,11 +1262,12 @@ Sets the spacing between lines in a text block. Defaults to 4 pixels.
|
|
1287
1262
|
|
1288
1263
|
For: ''all slots and elements''.
|
1289
1264
|
|
1290
|
-
Sets the left coordinate of this object to a specific pixel. Setting
|
1291
|
-
10` places the object's left edge ten pixels away from the left edge of the
|
1265
|
+
Sets the left coordinate of this object to a specific pixel. Setting `left: 10` places the object's left edge ten pixels away from the left edge of the
|
1292
1266
|
slot containing it. If this style is left unset (or set to `nil`,) the object
|
1293
1267
|
will flow in with the other objects surrounding it.
|
1294
1268
|
|
1269
|
+
You might also want to give it a :top, if it's acting a bit funny. Sometimes it needs both. :)
|
1270
|
+
|
1295
1271
|
=== :margin » a number or an array of four numbers ===
|
1296
1272
|
|
1297
1273
|
For: ''all slots and elements''.
|
@@ -1299,7 +1275,7 @@ For: ''all slots and elements''.
|
|
1299
1275
|
Margins space an element out from its surroundings. Each element has a left,
|
1300
1276
|
top, right, and bottom margin. If the `:margin` style is set to a single
|
1301
1277
|
number, the spacing around the element uniformly matches that number. In other
|
1302
|
-
words, if
|
1278
|
+
words, if `margin: 8` is set, all the margins around the element are set to
|
1303
1279
|
eight pixels in length.
|
1304
1280
|
|
1305
1281
|
This style can also be given an array of four numbers in the form `[left, top,
|
@@ -1339,7 +1315,7 @@ Sets the outer radius (half of the ''total'' width) of the star, in pixels.
|
|
1339
1315
|
|
1340
1316
|
For: ''star''.
|
1341
1317
|
|
1342
|
-
How many points does this star have? A style of
|
1318
|
+
How many points does this star have? A style of `points: 5` creates a
|
1343
1319
|
five-pointed star.
|
1344
1320
|
|
1345
1321
|
=== :radius » a number ===
|
@@ -1355,9 +1331,9 @@ double this number.
|
|
1355
1331
|
For: ''all slots and elements''.
|
1356
1332
|
|
1357
1333
|
Sets the pixel coordinate of an element's right edge. The edge is placed
|
1358
|
-
relative to its container's rightmost edge. So,
|
1334
|
+
relative to its container's rightmost edge. So, `right: 0` will align the
|
1359
1335
|
element so that its own right edge and the right edge of its slot touch.
|
1360
|
-
Whereas
|
1336
|
+
Whereas `right: 20` will position the right edge of the element off to the
|
1361
1337
|
left of its slot's right edge by twenty pixels.
|
1362
1338
|
|
1363
1339
|
=== :rise » a number ===
|
@@ -1373,7 +1349,7 @@ element has a `:rise` of -10 pixels.
|
|
1373
1349
|
|
1374
1350
|
For: ''flow, stack''.
|
1375
1351
|
|
1376
|
-
Establishes this slot as a scrolling slot. If
|
1352
|
+
Establishes this slot as a scrolling slot. If `scroll: true` is set, the
|
1377
1353
|
slot will show a scrollbar if any of its contents go past its height. The
|
1378
1354
|
scrollbar will appear and disappear as needed. It will also appear inside the
|
1379
1355
|
width of the slot, meaning the slot's width will never change, regardless of
|
@@ -1476,11 +1452,13 @@ or edit_line.
|
|
1476
1452
|
For: ''all slots and elements''.
|
1477
1453
|
|
1478
1454
|
Sets the top coordinate for an object, relative to its parent slot. If an
|
1479
|
-
object is set with
|
1455
|
+
object is set with `top: 40`, this means the object's top edge will be
|
1480
1456
|
placed 40 pixels beneath the top edge of the slot that contains it. If no
|
1481
1457
|
`:top` style is given, the object is automatically placed in the natural flow
|
1482
1458
|
of its slot.
|
1483
1459
|
|
1460
|
+
You should probably give it a :left, too, if it's acting strange. It likes to have both. :)
|
1461
|
+
|
1484
1462
|
=== :undercolor » a Shoes::Color ===
|
1485
1463
|
|
1486
1464
|
For: ''banner, caption, code, del, em, ins, inscription, link, para, span,
|
@@ -1513,6 +1491,12 @@ Vary the font for a group of text. Two choices:
|
|
1513
1491
|
* "normal" - standard font.
|
1514
1492
|
* "smallcaps" - font with the lower case characters replaced by smaller variants of the capital characters.
|
1515
1493
|
|
1494
|
+
=== :wedge » true or false ===
|
1495
|
+
|
1496
|
+
For: ''arc''.
|
1497
|
+
|
1498
|
+
Indicates how arcs are to be filled. If set to true, the arc is filled as a 'pie chart' style wedge. The default setting of false fills the arc to the chord connecting the end points of the arc.
|
1499
|
+
|
1516
1500
|
=== :weight » a string ===
|
1517
1501
|
|
1518
1502
|
For: ''banner, caption, code, del, em, ins, inscription, link, para, span,
|
@@ -1631,8 +1615,8 @@ color used to paint inside the lines.
|
|
1631
1615
|
Shoes.app do
|
1632
1616
|
stroke red
|
1633
1617
|
fill blue
|
1634
|
-
oval :
|
1635
|
-
:
|
1618
|
+
oval top: 10, left: 10,
|
1619
|
+
radius: 100
|
1636
1620
|
end
|
1637
1621
|
}}}
|
1638
1622
|
|
@@ -1747,6 +1731,10 @@ Draws a rectangle starting from coordinates (top, left) with dimensions of
|
|
1747
1731
|
width x height. Optionally, you may give the rectangle rounded corners with a
|
1748
1732
|
fifth argument: the radius of the corners in pixels.
|
1749
1733
|
|
1734
|
+
Alternate Call:
|
1735
|
+
rect(top, left, sidelength): Will draw a square with sides having the given length
|
1736
|
+
|
1737
|
+
|
1750
1738
|
As with all other shapes, the rectangle is drawn using the stroke and fill colors.
|
1751
1739
|
|
1752
1740
|
{{{
|
@@ -1804,10 +1792,10 @@ and arcs and bends.
|
|
1804
1792
|
fill red(0.2)
|
1805
1793
|
shape do
|
1806
1794
|
move_to(90, 55)
|
1807
|
-
arc_to(50, 55, 50, 50, 0, PI/2)
|
1808
|
-
arc_to(50, 55, 60, 60, PI/2, PI)
|
1809
|
-
arc_to(50, 55, 70, 70, PI, TWO_PI-PI/2)
|
1810
|
-
arc_to(50, 55, 80, 80, TWO_PI-PI/2, TWO_PI)
|
1795
|
+
arc_to(50, 55, 50, 50, 0, Shoes::PI/2)
|
1796
|
+
arc_to(50, 55, 60, 60, Shoes::PI/2, Shoes::PI)
|
1797
|
+
arc_to(50, 55, 70, 70, Shoes::PI, Shoes::TWO_PI-Shoes::PI/2)
|
1798
|
+
arc_to(50, 55, 80, 80, Shoes::TWO_PI-Shoes::PI/2, Shoes::TWO_PI)
|
1811
1799
|
end
|
1812
1800
|
end
|
1813
1801
|
}}}
|
@@ -1905,7 +1893,7 @@ Shoes layers background elements.
|
|
1905
1893
|
#!ruby
|
1906
1894
|
Shoes.app do
|
1907
1895
|
background black
|
1908
|
-
background white, :
|
1896
|
+
background white, width: 50
|
1909
1897
|
end
|
1910
1898
|
}}}
|
1911
1899
|
|
@@ -1917,7 +1905,7 @@ along the left side.
|
|
1917
1905
|
|
1918
1906
|
Creates a Banner text block. Shoes automatically styles this text to 48 pixels high.
|
1919
1907
|
|
1920
|
-
=== border(text, :
|
1908
|
+
=== border(text, strokewidth: a number) » Shoes::Border ===
|
1921
1909
|
|
1922
1910
|
Draws a Border element using a specific color (or pattern.) Patterns can be
|
1923
1911
|
colors, gradients or images. Colors and images will tile across the border.
|
@@ -1966,7 +1954,7 @@ attached here which is called any type the user changes the text in the box.
|
|
1966
1954
|
Shoes.app do
|
1967
1955
|
edit_box
|
1968
1956
|
edit_box "HORRAY EDIT ME"
|
1969
|
-
edit_box "small one", :
|
1957
|
+
edit_box "small one", width: 100, height: 160
|
1970
1958
|
end
|
1971
1959
|
}}}
|
1972
1960
|
|
@@ -2026,14 +2014,14 @@ single underline.
|
|
2026
2014
|
|
2027
2015
|
Creates an Inscription text block. Shoes styles this text at 10 pixels high.
|
2028
2016
|
|
2029
|
-
=== link(text, :
|
2017
|
+
=== link(text, click: proc or string) » Shoes::Link ===
|
2030
2018
|
|
2031
2019
|
Creates a Link text block, which Shoes styles with a single underline and
|
2032
2020
|
colors with a #06E (blue) colored stroke.
|
2033
2021
|
|
2034
2022
|
The default LinkHover style is also single-underlined with a #039 (dark blue) stroke.
|
2035
2023
|
|
2036
|
-
=== list_box(:
|
2024
|
+
=== list_box(items: [strings, ...]) » Shoes::ListBox ===
|
2037
2025
|
|
2038
2026
|
Adds a drop-down list box containing entries for everything in the `items`
|
2039
2027
|
array. An optional block may be attached, which is called if anything in the
|
@@ -2042,9 +2030,9 @@ box becomes selected by the user.
|
|
2042
2030
|
{{{
|
2043
2031
|
#!ruby
|
2044
2032
|
Shoes.app do
|
2045
|
-
stack :
|
2033
|
+
stack margin: 10 do
|
2046
2034
|
para "Pick a card:"
|
2047
|
-
list_box :
|
2035
|
+
list_box items: ["Jack", "Ace", "Joker"]
|
2048
2036
|
end
|
2049
2037
|
end
|
2050
2038
|
}}}
|
@@ -2139,7 +2127,7 @@ window. This way the child window can call the parent.
|
|
2139
2127
|
|
2140
2128
|
{{{
|
2141
2129
|
#!ruby
|
2142
|
-
Shoes.app :
|
2130
|
+
Shoes.app title: "The Owner" do
|
2143
2131
|
button "Pop up?" do
|
2144
2132
|
window do
|
2145
2133
|
para "Okay, popped up from #{owner}"
|
@@ -2167,7 +2155,7 @@ away.
|
|
2167
2155
|
{{{
|
2168
2156
|
#!ruby
|
2169
2157
|
Shoes.app do
|
2170
|
-
s = stack :
|
2158
|
+
s = stack width: 200, height: 200 do
|
2171
2159
|
background red
|
2172
2160
|
hover do
|
2173
2161
|
s.clear { background blue }
|
@@ -2258,7 +2246,7 @@ The block is handed the cursor's `left` and `top` coordinates.
|
|
2258
2246
|
|
2259
2247
|
{{{
|
2260
2248
|
#!ruby
|
2261
|
-
Shoes.app :
|
2249
|
+
Shoes.app width: 200, height: 200 do
|
2262
2250
|
background black
|
2263
2251
|
fill white
|
2264
2252
|
@circ = oval 0, 0, 100, 100
|
@@ -2278,6 +2266,12 @@ was released.
|
|
2278
2266
|
|
2279
2267
|
To catch the actual mouse click, use the [[Events.click]] event.
|
2280
2268
|
|
2269
|
+
=== resize { |self| ... } » self ===
|
2270
|
+
|
2271
|
+
The resize block runs whenever the app is resized. Be careful with this one, since
|
2272
|
+
the block will be fired with every pixel of motion, even a simple resize may call
|
2273
|
+
the block dozens of times.
|
2274
|
+
|
2281
2275
|
=== start { |self| ... } » self ===
|
2282
2276
|
|
2283
2277
|
The first time the slot is drawn, the start event fires. The block is handed
|
@@ -2366,7 +2360,7 @@ To set the width of a stack to 150 pixels:
|
|
2366
2360
|
{{{
|
2367
2361
|
#!ruby
|
2368
2362
|
Shoes.app do
|
2369
|
-
stack(:
|
2363
|
+
stack(width: 150) { para "Now that's precision." }
|
2370
2364
|
end
|
2371
2365
|
}}}
|
2372
2366
|
|
@@ -2398,7 +2392,7 @@ This is commonly used to pad elements on the right, like so:
|
|
2398
2392
|
{{{
|
2399
2393
|
#!ruby
|
2400
2394
|
Shoes.app do
|
2401
|
-
stack :
|
2395
|
+
stack margin_right: 20 + gutter do
|
2402
2396
|
para "Insert fat and ratified declaration of independence here..."
|
2403
2397
|
end
|
2404
2398
|
end
|
@@ -2474,7 +2468,7 @@ originally requested.
|
|
2474
2468
|
{{{
|
2475
2469
|
#!ruby
|
2476
2470
|
Shoes.app do
|
2477
|
-
@s = stack :
|
2471
|
+
@s = stack width: "100%"
|
2478
2472
|
para @s.style[:width]
|
2479
2473
|
end
|
2480
2474
|
}}}
|
@@ -2491,7 +2485,7 @@ example, there is a `width` method, thus there is also a `width` style.
|
|
2491
2485
|
#!ruby
|
2492
2486
|
Shoes.app do
|
2493
2487
|
@s = stack { background green }
|
2494
|
-
@s.style(:
|
2488
|
+
@s.style(width: 400, height: 200)
|
2495
2489
|
end
|
2496
2490
|
}}}
|
2497
2491
|
|
@@ -2530,7 +2524,7 @@ Gets the object for this element's container.
|
|
2530
2524
|
|
2531
2525
|
Ah, here's the stuff of Shoes. An element can be as simple as an oval shape. Or
|
2532
2526
|
as complex as a video stream. You've encountered all of these elements before
|
2533
|
-
in the Slots section of
|
2527
|
+
in the Slots section of the manual.
|
2534
2528
|
|
2535
2529
|
Shoes has seven native controls: the Button, the EditLine, the EditBox, the
|
2536
2530
|
ListBox, the Progress meter, the Check box and the Radio. By "native"
|
@@ -2570,9 +2564,9 @@ covered as the [[Position.style]] method for slots.)
|
|
2570
2564
|
@press = button "Stop your messin about!"
|
2571
2565
|
|
2572
2566
|
# And so, both can be styled.
|
2573
|
-
@text.style :
|
2574
|
-
@press.style :
|
2575
|
-
@back.style :
|
2567
|
+
@text.style size: 12, stroke: red, margin: 10
|
2568
|
+
@press.style width: 400
|
2569
|
+
@back.style height: 10
|
2576
2570
|
end
|
2577
2571
|
end
|
2578
2572
|
}}}
|
@@ -2596,7 +2590,7 @@ displace it 2 pixels left and 6 pixels on top, you end up with the coordinates
|
|
2596
2590
|
{{{
|
2597
2591
|
#!ruby
|
2598
2592
|
Shoes.app do
|
2599
|
-
flow :
|
2593
|
+
flow margin: 12 do
|
2600
2594
|
# Set up three buttons
|
2601
2595
|
button "One"
|
2602
2596
|
@two = button "Two"
|
@@ -2650,7 +2644,7 @@ positioned instead.
|
|
2650
2644
|
{{{
|
2651
2645
|
#!ruby
|
2652
2646
|
Shoes.app do
|
2653
|
-
flow :
|
2647
|
+
flow margin: 12 do
|
2654
2648
|
# Set up three buttons
|
2655
2649
|
button "One"
|
2656
2650
|
@two = button "Two"
|
@@ -2694,7 +2688,7 @@ original setting (things like "100%" for width or "10px" for top.)
|
|
2694
2688
|
#!ruby
|
2695
2689
|
Shoes.app do
|
2696
2690
|
# A button which take up the whole page
|
2697
|
-
@b = button "All of it", :
|
2691
|
+
@b = button "All of it", width: 1.0, height: 1.0
|
2698
2692
|
|
2699
2693
|
# When clicked, show the styles
|
2700
2694
|
@b.click { alert(@b.style.inspect) }
|
@@ -2729,8 +2723,8 @@ a stack which is 120 pixels wide, you'll get back `120`. However, if you call
|
|
2729
2723
|
{{{
|
2730
2724
|
#!ruby
|
2731
2725
|
Shoes.app do
|
2732
|
-
stack :
|
2733
|
-
@b = button "Click me", :
|
2726
|
+
stack width: 120 do
|
2727
|
+
@b = button "Click me", width: "100%" do
|
2734
2728
|
alert "button.width = #{@b.width}\n" +
|
2735
2729
|
"button.style[:width] = #{@b.style[:width]}"
|
2736
2730
|
end
|
@@ -2739,17 +2733,16 @@ a stack which is 120 pixels wide, you'll get back `120`. However, if you call
|
|
2739
2733
|
}}}
|
2740
2734
|
|
2741
2735
|
In order to set the width, you'll have to go through the [[Common.style]]
|
2742
|
-
method again. So, to set the button to 150 pixels wide: `@b.style(:
|
2743
|
-
150)`.
|
2736
|
+
method again. So, to set the button to 150 pixels wide: `@b.style(width: 150)`.
|
2744
2737
|
|
2745
|
-
To let Shoes pick the element's width, go with `@b.style(:
|
2738
|
+
To let Shoes pick the element's width, go with `@b.style(width: nil)` to
|
2746
2739
|
empty out the setting.
|
2747
2740
|
|
2748
2741
|
== Background ==
|
2749
2742
|
|
2750
2743
|
A background is a color, a gradient or an image that is painted across an
|
2751
2744
|
entire slot. Both backgrounds and borders are a type of Shoes::Pattern.
|
2752
|
-
!{:
|
2745
|
+
!{margin_left: 100}man-ele-background.png!
|
2753
2746
|
|
2754
2747
|
Even though it's called a ''background'', you may still place this element in
|
2755
2748
|
front of other elements. If a background comes after something else painted on
|
@@ -2776,7 +2769,7 @@ To paint a black background across the top fifty pixels of the window:
|
|
2776
2769
|
{{{
|
2777
2770
|
#!ruby
|
2778
2771
|
Shoes.app do
|
2779
|
-
background black, :
|
2772
|
+
background black, height: 50
|
2780
2773
|
end
|
2781
2774
|
}}}
|
2782
2775
|
|
@@ -2785,7 +2778,7 @@ Or, to paint a fifty pixel column on the right-side of the window:
|
|
2785
2778
|
{{{
|
2786
2779
|
#!ruby
|
2787
2780
|
Shoes.app do
|
2788
|
-
background black, :
|
2781
|
+
background black, width: 50, right: 50
|
2789
2782
|
end
|
2790
2783
|
}}}
|
2791
2784
|
|
@@ -2802,7 +2795,7 @@ backgrounds and borders. Reuse it as you like.
|
|
2802
2795
|
|
2803
2796
|
A border is a color, gradient or image painted in a line around the edge of any
|
2804
2797
|
slot. Like the Background element in the last section, a Border is a kind of
|
2805
|
-
Shoes::Pattern. !{:
|
2798
|
+
Shoes::Pattern. !{margin_left: 100}man-ele-border.png!
|
2806
2799
|
|
2807
2800
|
The first, crucial thing to know about border is that all borders paint a line
|
2808
2801
|
around the '''inside''' of a slot, not the outside. So, if you have a slot
|
@@ -2818,9 +2811,9 @@ Here is just such a slot:
|
|
2818
2811
|
{{{
|
2819
2812
|
#!ruby
|
2820
2813
|
Shoes.app do
|
2821
|
-
stack :
|
2822
|
-
border black, :
|
2823
|
-
para "=^.^=", :
|
2814
|
+
stack width: 50 do
|
2815
|
+
border black, strokewidth: 5
|
2816
|
+
para "=^.^=", stroke: green
|
2824
2817
|
end
|
2825
2818
|
end
|
2826
2819
|
}}}
|
@@ -2831,10 +2824,10 @@ that slot in another slot. Then, place the border in the outside slot.
|
|
2831
2824
|
{{{
|
2832
2825
|
#!ruby
|
2833
2826
|
Shoes.app do
|
2834
|
-
stack :
|
2835
|
-
border black, :
|
2836
|
-
stack :
|
2837
|
-
para "=^.^=", :
|
2827
|
+
stack width: 60 do
|
2828
|
+
border black, strokewidth: 5
|
2829
|
+
stack width: 50 do
|
2830
|
+
para "=^.^=", stroke: green
|
2838
2831
|
end
|
2839
2832
|
end
|
2840
2833
|
end
|
@@ -2857,7 +2850,7 @@ backgrounds.
|
|
2857
2850
|
|
2858
2851
|
Buttons are, you know, push buttons. You click them and they do something.
|
2859
2852
|
Buttons are known to say "OK" or "Are you sure?" And, then, if you're sure,
|
2860
|
-
you click the button. !{:
|
2853
|
+
you click the button. !{margin_left: 100}man-ele-button.png!
|
2861
2854
|
|
2862
2855
|
{{{
|
2863
2856
|
#!ruby
|
@@ -2925,7 +2918,7 @@ hits Enter, the button will be clicked.
|
|
2925
2918
|
|
2926
2919
|
Check boxes are clickable square boxes than can be either checked or unchecked.
|
2927
2920
|
A single checkbox usually asks a "yes" or "no" question. Sets of checkboxes
|
2928
|
-
are also seen in to-do lists. !{:
|
2921
|
+
are also seen in to-do lists. !{margin_left: 100}man-ele-check.png!
|
2929
2922
|
|
2930
2923
|
Here's a sample checklist.
|
2931
2924
|
|
@@ -2997,7 +2990,7 @@ Enter, the check will be toggled between its checked and unchecked states.
|
|
2997
2990
|
|
2998
2991
|
Edit boxes are wide, rectangular boxes for entering text. On the web, they
|
2999
2992
|
call these textareas. These are multi-line edit boxes for entering longer
|
3000
|
-
descriptions. Essays, even! !{:
|
2993
|
+
descriptions. Essays, even! !{margin_left: 100}man-ele-editbox.png!
|
3001
2994
|
|
3002
2995
|
Without any other styling, edit boxes are sized 200 pixels by 108 pixels. You
|
3003
2996
|
can also use `:width` and `:height` styles to set specific sizes.
|
@@ -3006,7 +2999,7 @@ can also use `:width` and `:height` styles to set specific sizes.
|
|
3006
2999
|
#!ruby
|
3007
3000
|
Shoes.app do
|
3008
3001
|
edit_box
|
3009
|
-
edit_box :
|
3002
|
+
edit_box width: 100, height: 100
|
3010
3003
|
end
|
3011
3004
|
}}}
|
3012
3005
|
|
@@ -3054,7 +3047,7 @@ Fills the edit box with the characters of `a string`.
|
|
3054
3047
|
|
3055
3048
|
Edit lines are a slender, little box for entering text. While the EditBox is
|
3056
3049
|
multi-line, an edit line is just one. Line, that is. Horizontal, in fact.
|
3057
|
-
!{:
|
3050
|
+
!{margin_left: 100}man-ele-editline.png!
|
3058
3051
|
|
3059
3052
|
The unstyled edit line is 200 pixels wide and 28 pixels wide. Roughly. The
|
3060
3053
|
height may vary on some platforms.
|
@@ -3064,7 +3057,7 @@ height may vary on some platforms.
|
|
3064
3057
|
Shoes.app do
|
3065
3058
|
stack do
|
3066
3059
|
edit_line
|
3067
|
-
edit_line :
|
3060
|
+
edit_line width: 400
|
3068
3061
|
end
|
3069
3062
|
end
|
3070
3063
|
}}}
|
@@ -3102,7 +3095,7 @@ Fills the edit line with the characters of `a string`.
|
|
3102
3095
|
|
3103
3096
|
An image is a picture in PNG, JPEG or GIF format. Shoes can resize images or
|
3104
3097
|
flow them in with text. Images can be loaded from a file or directly off the
|
3105
|
-
web. !{:
|
3098
|
+
web. !{margin_left: 100}man-ele-image.png!
|
3106
3099
|
|
3107
3100
|
To create an image, use the `image` method in a slot:
|
3108
3101
|
|
@@ -3163,7 +3156,7 @@ Swaps the image with a different one, loaded from a file or URL.
|
|
3163
3156
|
|
3164
3157
|
List boxes (also called "combo boxes" or "drop-down boxes" or "select boxes" in
|
3165
3158
|
some places) are a list of options that drop down when you click on the box.
|
3166
|
-
!{:
|
3159
|
+
!{margin_left: 100}man-ele-listbox.png!
|
3167
3160
|
|
3168
3161
|
A list box gets its options from an array. An array (a list) of strings,
|
3169
3162
|
passed into the `:items` style.
|
@@ -3172,7 +3165,7 @@ passed into the `:items` style.
|
|
3172
3165
|
#!ruby
|
3173
3166
|
Shoes.app do
|
3174
3167
|
para "Choose a fruit:"
|
3175
|
-
list_box :
|
3168
|
+
list_box items: ["Grapes", "Pears", "Apricots"]
|
3176
3169
|
end
|
3177
3170
|
}}}
|
3178
3171
|
|
@@ -3183,8 +3176,8 @@ You can adjust this length using the `:width` style.
|
|
3183
3176
|
#!ruby
|
3184
3177
|
Shoes.app do
|
3185
3178
|
para "Choose a fruit:"
|
3186
|
-
list_box :
|
3187
|
-
:
|
3179
|
+
list_box items: ["Grapes", "Pears", "Apricots"],
|
3180
|
+
width: 120, choose: "Apricots" do |list|
|
3188
3181
|
@fruit.text = list.text
|
3189
3182
|
end
|
3190
3183
|
|
@@ -3236,17 +3229,16 @@ now. If nothing is selected, `nil` will be the reply.
|
|
3236
3229
|
|
3237
3230
|
Progress bars show you how far along you are in an activity. Usually, a
|
3238
3231
|
progress bar represents a percentage (from 0% to 100%.) Shoes thinks of
|
3239
|
-
progress in terms of the decimal numbers 0.0 to 1.0. !{:
|
3240
|
-
100}man-ele-progress.png!
|
3232
|
+
progress in terms of the decimal numbers 0.0 to 1.0. !{margin_left: 100}man-ele-progress.png!
|
3241
3233
|
|
3242
3234
|
A simple progress bar is 200 pixels wide, but you can use the `:width` style
|
3243
3235
|
(as with all Shoes elements) to lengthen it.
|
3244
3236
|
|
3245
3237
|
{{{
|
3246
3238
|
Shoes.app do
|
3247
|
-
stack :
|
3239
|
+
stack margin: 0.1 do
|
3248
3240
|
title "Progress example"
|
3249
|
-
@p = progress :
|
3241
|
+
@p = progress width: 1.0
|
3250
3242
|
|
3251
3243
|
animate do |i|
|
3252
3244
|
@p.fraction = (i % 100) / 100.0
|
@@ -3270,8 +3262,7 @@ Sets the progress to a decimal number between 0.0 and 1.0.
|
|
3270
3262
|
|
3271
3263
|
Radio buttons are a group of clickable circles. Click a circle and it'll be
|
3272
3264
|
marked. Only one radio button can be marked at a time. (This is similar to the
|
3273
|
-
ListBox, where only one option can be selected at a time.) !{:
|
3274
|
-
100}man-ele-radio.png!
|
3265
|
+
ListBox, where only one option can be selected at a time.) !{margin_left: 100}man-ele-radio.png!
|
3275
3266
|
|
3276
3267
|
So, how do you decide when to use radio buttons and when to use list boxes?
|
3277
3268
|
Well, list boxes only show one highlighted item unless you click on the box and
|
@@ -3359,7 +3350,7 @@ Enter, the radio will be toggled between its marked and unmarked states.
|
|
3359
3350
|
== Shape ==
|
3360
3351
|
|
3361
3352
|
A shape is a path outline usually created by drawing methods like `oval` and
|
3362
|
-
`rect`. !{:
|
3353
|
+
`rect`. !{margin_left: 100}man-ele-shape.png!
|
3363
3354
|
|
3364
3355
|
See the [[Common]] methods page. Shapes respond to all of those methods.
|
3365
3356
|
|
@@ -3368,7 +3359,7 @@ See the [[Common]] methods page. Shapes respond to all of those methods.
|
|
3368
3359
|
The TextBlock object represents a group of text organized as a single element.
|
3369
3360
|
A paragraph containing bolded text, for example. A caption containing links and
|
3370
3361
|
bolded text. (So, a `caption` is a TextBlock type. However, `link` and
|
3371
|
-
`strong` are TextClass types.) !{:
|
3362
|
+
`strong` are TextClass types.) !{margin_left: 100}man-ele-textblock.png!
|
3372
3363
|
|
3373
3364
|
All of the various types of TextBlock are found on the [[Element Element
|
3374
3365
|
Creation]] page.
|
@@ -3435,7 +3426,7 @@ already running, it is stopped.
|
|
3435
3426
|
Shoes supports embedding of QuickTime, Flash video (FLV), DivX, Xvid and
|
3436
3427
|
various other popular video formats. This is all thanks to VideoLAN and ffmpeg,
|
3437
3428
|
two sensational open source libraries. Use the `video` method on a slot to
|
3438
|
-
setup a Shoes::Video object. !{:
|
3429
|
+
setup a Shoes::Video object. !{margin_left: 100}man-ele-video.png!
|
3439
3430
|
|
3440
3431
|
In addition to video formats, some audio formats are also supported, such as
|
3441
3432
|
MP3, WAV and Ogg Vorbis.
|
@@ -3528,4 +3519,4 @@ Hope this helps:
|
|
3528
3519
|
|
3529
3520
|
* You can join [[http://librelist.com/browser/shoes/ Shoes ML]] and feel free ask your questions.
|
3530
3521
|
* [[http://github.com/shoes/shoes/ Official Current Source Code]] is on GitHub.
|
3531
|
-
* [[
|
3522
|
+
* [[https://github.com/shoes/shoes/wiki Wiki]] for Shoes general info.
|