static/manual-en.txt in green_shoes-0.150.0 vs static/manual-en.txt in green_shoes-0.164.0

- old
+ new

@@ -549,11 +549,11 @@ So, the rule is: '''keep your temporary classes in the code with the app and keep your permanent classes in requires.''' = Shoes = -Shoes is all about drawing windows and the stuff inside those windows. Let's +Green Shoes is all about drawing windows and the stuff inside those windows. Let's focus on the window itself, for now. The other sections [[Slots]] and [[Elements]] cover everything that goes inside the window. For here on, the manual reads more like a dictionary. Each page is mostly a list of methods you can use for each topic covered. The idea is to be very @@ -566,19 +566,21 @@ ==== Finding Your Way ==== This section covers: - * [[Built-in Built-in methods]] - general methods available anywhere in a Shoes program. - * [[App The App window]] - methods found attached to every main Shoes window. - * [[Styles The Styles Master List]] - a complete list of every style in Shoes. - * [[Classes The Classes list]] - a chart showing what Shoes classes subclass what. + * [[Built-in Built-in methods]] - general methods available anywhere in a Green Shoes program. + * [[App The App window]] - methods found attached to every main Green Shoes window. + * [[Styles The Styles Master List]] - a complete list of every style in Green Shoes. + * [[Classes The Classes list]] - a chart showing what Green Shoes classes subclass what. * [[Colors The Colors list]] - a chart of all built-in colors and the [[Built-in.rgb]] numbers for each. If you find yourself paging around a lot and not finding something, give the [[Search]] page a try. It's the quickest way to get around. +'''Note:''' Green Shoes doesn't support Search page so far. + After this general reference, there are two other more specific sections: * [[Slots]] - covering [[Element.stack]] and [[Element.flow]], the two types of slots. * [[Elements]] - documentation for all the buttons, shapes, images, and so on. @@ -586,11 +588,11 @@ (which lists all the elements you can add) and the [[Common Common Methods]] page (which lists methods you'll find on any slot or element.) == Built-in Methods == -These methods can be used anywhere throughout Shoes programs. +These methods can be used anywhere throughout Green Shoes programs. All of these commands are unusual because you don't attach them with a dot. '''Every other method in this manual must be attached to an object with a dot.''' But these are built-in methods (also called: Kernel methods.) Which means no dot! @@ -614,11 +616,11 @@ para [:dogs, :cows, :snakes].reverse #=> [:snakes, :cows, :dogs] end }}} -Most Shoes methods for drawing and making buttons and so on are attached to +Most Green Shoes methods for drawing and making buttons and so on are attached to slots. See the section on [[Slots]] for more. ==== Built-in Constants ==== Green Shoes also has a handful of built-in constants which may prove useful if you @@ -649,11 +651,11 @@ Shoes.app{ alert("I'm afraid I must interject!") } }}} Please use alerts sparingly, as they are incredibly annoying! If you are using alerts to show messages to help you debug your program, try checking out the -[[Built-in.debug]] or [[Built-in.info]] methods. +standard Ruby method `puts` or `p` methods. === ask(message: a string) » a string === Pops up a window and asks a question. For example, you may want to ask someone their name. @@ -747,33 +749,10 @@ if confirm("Draw a circle?") Shoes.app{ oval :top => 0, :left => 0, :radius => 50 } end }}} -=== debug(message: a string) » nil === - -Sends a debug message to the Shoes console. You can bring up the Shoes console -by pressing `Alt-/` on any Shoes window (or `⌘-/` on OS X.) - -{{{ - #!ruby - # Not yet available - debug("Running Shoes on " + RUBY_PLATFORM) -}}} - -Also check out the [[Built-in.error]], [[Built-in.warn]] and [[Built-in.info]] -methods. - -=== error(message: a string) » nil === - -Sends an error message to the Shoes console. This method should only be used -to log errors. Try the [[Built-in.debug]] method for logging messages to -yourself. - -Oh, and, rather than a string, you may also hand exceptions directly to this -method and they'll be formatted appropriately. - === exit() === Stops your program. Call this anytime you want to suddenly call it quits. '''PLEASE NOTE:''' If you need to use Ruby's own `exit` method (like in a @@ -783,10 +762,12 @@ Loads a TrueType (or other type of font) from a file. While TrueType is supported by all platforms, your platform may support other types of fonts. Shoes uses each operating system's built-in font system to make this work. +'''Note:''' Green Shoes doesn't support font method so far. + Here's a rough idea of what fonts work on which platforms: * Bitmap fonts (.bdf, .pcf, .snf) - Linux * Font resource (.fon) - Windows * Windows bitmap font file (.fnt) - Linux, Windows @@ -803,27 +784,23 @@ Also of interest: the `Shoes::FONTS` constant is a complete list of fonts available to you on this platform. You can check for a certain font by using `include?`. {{{ - # Not yet available - if Shoes::FONTS.include? "Helvetica" - alert "Helvetica is available on this system." - else - alert "You do not have the Helvetica font." - end + Shoes.app do + if Shoes::FONTS.include? "Coolvetica" + alert "Coolvetica is available on this system." + else + alert "You do not have the Coolvetica font." + end +end }}} If you have trouble with fonts showing up, make sure your app loads the font before it is used. Especially on OS X, if fonts are used before they are loaded, the font cache will tend to ignore loaded fonts. -=== gradient(color1, color2) » Shoes::Pattern === - -Builds a linear gradient from two colors. For each color, you may pass in a -Shoes::Color object or a string describing the color. - === gray(the numbers: darkness, alpha) » Shoes::Color === Create a grayscale color from a level of darkness and, optionally, an alpha level. @@ -831,36 +808,22 @@ # Not yet available black = gray(0.0) white = gray(1.0) }}} -=== info(message: a string) » nil === -Logs an informational message to the user in the Shoes console. So, where -debug messages are designed to help the program figure out what's happening, -`info` messages tell the user extra information about the program. +=== rgb(red, green, blue, alpha) » an array of decimal numbers === -{{{ - #!ruby - # Not yet available - info("You just ran the info example on Shoes #{Shoes::RELEASE_NAME}.") -}}} - -For example, whenever a Shy file loads, Shoes prints an informational message -in the console describing the author of the Shy and its version. - -=== rgb(a series of numbers: red, green, blue, alpha) » Shoes::Color === - Create a color from red, green and blue components. An alpha level (indicating transparency) can also be added, optionally. When passing in a whole number, use values from 0 to 255. {{{ Shoes.app do - blueviolet = rgb(138, 43, 226) - darkgreen = rgb(0, 100, 0) + blueviolet = rgb(138, 43, 226, 0.5) + darkgreen = rgb(0, 100, 0, 0.5) oval 100, 100, 100, fill: [blueviolet, darkgreen].sample(1) end }}} Or, use a decimal number from 0.0 to 1.0. @@ -871,67 +834,60 @@ darkgreen = rgb(0, 0.4, 0) oval 100, 100, 100, fill: [blueviolet, darkgreen].sample(1) end }}} -This method may also be called as `Shoes.rgb`. - -=== warn(message: a string) » nil === - -Logs a warning for the user. A warning is not a catastrophic error (see -[[Built-in.error]] for that.) It is just a notice that the program will be -changing in the future or that certain parts of the program aren't reliable -yet. - -To view warnings and errors, open the Shoes console with `Alt-/` (or `⌘-/` on -OS X.) - == The App Object == An App is a single window running code at a URL. When you switch URLs, a new -App object is created and filled up with stacks, flows and other Shoes +App object is created and filled up with stacks, flows and other Green Shoes elements. The App is the window itself. Which may be closed or cleared and filled with -new elements. !{:margin_left => 100}man-app.png! +new elements. !{:margin_left => 100}../snapshots/sample46.png! The App itself, in slot/box terminology, is a flow. See the ''Slots'' section for more, but this just means that any elements placed directly at the top-level will flow. === Shoes.app(styles) { ... } » Shoes::App === -Starts up a Shoes app window. This is the starting place for making a Shoes -program. Inside the block, you fill the window with various Shoes elements -(buttons, artwork, etc.) and, outside the block, you use the `styles` to -describe how big the window is. Perhaps also the name of the app or if it's -resizable. +Starts up a Green Shoes app window. This is the starting place for making a Green +Shoes program. Inside the block, you fill the window with various Green Shoes +elements (buttons, artwork, etc.) and, outside the block, you use the `styles` to +describe how big the window is. Perhaps also the name of the app. {{{ #!ruby - Shoes.app(:title => "White Circle", - :width => 200, :height => 200, :resizable => false) { - background black - fill white - oval :top => 20, :left => 20, :radius => 160 - } + Shoes.app title: "White Circle", width: 200, height: 200 do + background black + fill white + oval top: 20, left: 20, radius: 160 + end }}} -In the case above, a small window is built. 200 pixels by 200 pixels. It's -not resizable. And, inside the window, two elements: a black background and a +In the case above, a small window is built. 200 pixels by 200 pixels. +And, inside the window, two elements: a black background and a white circle. Once an app is created, it is added to the [[App.Shoes.APPS]] list. If you want an app to spawn more windows, see the [[Element.window]] method and the [[Element.dialog]] method. === Shoes.APPS() » An array of Shoes::App objects === -Builds a complete list of all the Shoes apps that are open right now. Once an +Builds a complete list of all the Green Shoes apps that are open right now. Once an app is closed, it is removed from the list. Yes, you can run many apps at once -in Shoes. It's completely encouraged. +in Green Shoes. It's completely encouraged. +{{{ + Shoes.app do + button('Open a new app'){Shoes.app{}} + button('Print Shoes.APPS'){p Shoes.APPS} + end +}}} + === clipboard() » a string === Returns a string containing all of the text that's on the system clipboard. This is the global clipboard that every program on the computer cuts and pastes into. @@ -943,10 +899,25 @@ === close() === Closes the app window. If multiple windows are open and you want to close the entire application, use the built-in method `exit`. +{{{ + Shoes.app do + para 'hello' + button 'spawn' do + Shoes.app do + para 'hello' + button('close: close this window only'){close} + button('exit: quit Green Shoes'){exit} + end + end + button('close: close this window only'){close} + button('exit: quit Green Shoes'){exit} + end +}}} + === download(url: a string, styles) === Starts a download thread (much like XMLHttpRequest, if you're familiar with JavaScript.) This method returns immediately and runs the download in the background. Each download thread also fires `start`, `progress` and `finish` @@ -954,63 +925,55 @@ `finish` event.) If you attach a block to a download, it'll get called as the `finish` event. {{{ - #!ruby - # Not yet available Shoes.app do stack do - title "Searching Google", :size => 16 + title "Searching Google", size: 16 @status = para "One moment..." # Search Google for 'shoes' and print the HTTP headers download "http://www.google.com/search?q=shoes" do |goog| - @status.text = "Headers: " + goog.response.headers.inspect + @status.text = "Headers: #{goog.meta}" end end end }}} -And, if we wanted to use the downloaded data, we'd get it using -`goog.response.body`. This example is truly the simplest form of `download`: +This example is truly the simplest form of `download`: pulling some web data down into memory and handling it once it's done. Another simple use of `download` is to save some web data to a file, using the `:save` style. {{{ - #!ruby - # Not yet available Shoes.app do stack do - title "Downloading Google image", :size => 16 + title "Downloading Google image", size: 16 @status = para "One moment..." download "http://www.google.com/logos/nasa50th.gif", :save => "nasa50th.gif" do - @status.text = "Okay, is downloaded." + @status.text = "Okay, is downloaded." + image "nasa50th.gif", top: 100 end end end }}} -In this case, you can still get the headers for the downloaded file, but -`response.body` will be `nil`, since the data wasn't saved to memory. You will -need to open the file to get the downloaded goods. - If you need to send certain headers or actions to the web server, you can use the `:method`, `:headers` and `:body` styles to customize the HTTP request. (And, if you need to go beyond these, you can always break out Ruby's OpenURI class.) {{{ #!ruby # Not yet available Shoes.app do stack do - title "GET Google", :size => 16 + title "GET Google", size: 16 @status = para "One moment..." download "http://www.google.com/search?q=shoes", :method => "GET" do |dump| @status.text = dump.response.body @@ -1020,14 +983,18 @@ }}} As you can see from the above example, Shoes makes use of the "GET" method to query google's search engine. +'''Note:''' Green Shoes doesn't support the `:method`, `:headers` and `:body` styles. + === location() » a string === Gets a string containing the URL of the current app. +'''Note:''' Green Shoes doesn't support location method so far. + === mouse() » an array of numbers: button, left, top === Identifies the mouse cursor's location, along with which button is being pressed. @@ -1046,82 +1013,89 @@ Gets the app which launched this app. In most cases, this will be `nil`. But if this app was launched using the [[Element.window]] method, the owner will be the app which called `window`. +'''Note:''' Green Shoes doesn't support owner method so far. + === started?() » true or false === Has the window been fully constructed and displayed? This is useful for threaded code which may try to use the window before it is completely built. (Also see the `start` event which fires once the window is open.) +'''Note:''' Green Shoes doesn't support started? method so far. + === visit(url: a string) === Changes the location, in order to view a different Shoes URL. -Absolute URLs (such as http://google.com) are okay, but Shoes will be expecting -a Shoes application to be at that address. (So, google.com won't work, as it's +Absolute URLs (such as http://google.com) are okay, but Green Shoes will be expecting +a Green Shoes application to be at that address. (So, google.com won't work, as it's an HTML app.) == The Styles Master List == -You want to mess with the look of things? Well, throughout Shoes, styles are +You want to mess with the look of things? Well, throughout Green Shoes, styles are used to change the way elements appear. In some cases, you can even style an -entire class of elements. (Like giving all paragraphs a certain font.) +entire class of elements. (Like giving all links without an underline.) Styles are easy to spot. They usually show up when the element is created. {{{ - Shoes.app :title => "A Styling Sample" do - para "Red with an underline", :stroke => red, :underline => "single" + Shoes.app title: "A Styling Sample" do + para 'Green Shoes', align: 'center', size: 50 end }}} Here we've got a `:title` style on the app. And on the paragraph inside the -app, a red `:stroke` style and an `:underline` style. +app, a center `:align` style and 50 font `:size` style. The style hash can also be changed by using the [[Common.style]] method, available on every element and slot. +'''Note:''' Green Shoes can change style hash on Shape element only so far. + {{{ - # Not yet available - Shoes.app :title => "A Styling Sample" do - @text = para "Red with an underline" - @text.style(:stroke => red, :underline => "single") + Shoes.app title: "A Styling Sample" do + choose = lambda{[red, blue, green, yellow].sample} + s = star 100, 50, 30, 200, 180, strokewidth: 5 + button('change colors'){s.style stroke: choose.call, fill: choose.call} end }}} Most styles can also be set by calling them as methods. (I'd use the manual search to find the method.) +'''Note:''' Green Shoes doesn't support them as methods. + {{{ # Not yet available - Shoes.app :title => "A Styling Sample" do - @text = para "Red with an underline" - @text.stroke = red - @text.underline = "single" + Shoes.app title: "A Styling Sample" do + choose = lambda{[red, blue, green, yellow].sample} + s = star 100, 50, 30, 200, 180, strokewidth: 5 + button('change colors'){s.stroke = choose.call; s.fill = choose.call} end }}} Rather than making you plow through the whole manual to figure out what styles -go where, this helpful page speeds through every style in Shoes and suggests +go where, this helpful page speeds through every style in Green Shoes and suggests where that style is used. === :align » a string === -For: ''banner, caption, code, del, em, ins, inscription, link, para, span, -strong, sub, sup, subtitle, tagline, title'' +For: ''banner, caption, inscription, para, subtitle, tagline, title'' The alignment of the text. It is either: * "left" - Align the text to the left. * "center" - Align the text in the center. * "right" - Align the text to the right. === :angle » a number === -For: ''background, border, gradient''. +For: ''background, border, line, oval, rect, shape, star''. The angle at which to apply a gradient. Normally, gradient colors range from top to bottom. If the `:angle` is set to 90, the gradient will rotate 90 degrees counter-clockwise and the gradient will go from left to right. @@ -1136,54 +1110,68 @@ If a slot is attached to an element that moves, the slot will move with it. If the attachment is reset to `nil`, the slot will flow in with the other objects that surround, as normal. +'''Note:''' Green Shoes doesn't support `:attach` style. + === :autoplay » true or false === For: ''video''. Should this video begin playing after it appears? If set to `true`, the video will start without asking the user. +'''Note:''' Green Shoes doesn't support ''video''. + === :bottom » a number === For: ''all slots and elements''. Sets the pixel coordinate of an element's lower edge. The edge is placed relative to its container's lower edge. So, `:bottom => 0` will align the element so that its bottom edge and the bottom edge of its slot touch. +'''Note:''' Green Shoes doesn't support `:bottom` style. + === :cap » :curve or :rect or :project === For: ''arc, arrow, border, flow, image, mask, rect, star, shape, stack''. Sets the shape of the line endpoint, whether curved or square. See the [[Art.cap]] method for more explanation. +'''Note:''' Green Shoes doesn't support `:cap` style. + === :center » true or false === For: ''arc, image, oval, rect, shape''. Indicates whether the `:top` and `:left` coordinates refer to the center of the shape or not. If set to `true`, this is similar to setting the [[Art.transform]] method to `:center`. +'''Note:''' Green Shoes doesn't support `:center` style. + === :change » a proc === For: ''edit_box, edit_line, list_box''. The `change` event handler is stored in this style. See the [[EditBox.change]] method for the edit_box, as an example. +'''Note:''' Green Shoes doesn't support `:change` style. + === :checked » true or false === For: ''check, radio''. Is this checkbox or radio button checked? If set to `true`, the box is checked. Also see the [[Check.checked=]] method. +'''Note:''' Green Shoes doesn't support ''check'' and ''radio''. + === :choose » a string === For: ''list_box''. Sets the currently chosen item in the list. More information at @@ -1196,10 +1184,12 @@ tagline, title''. The `click` event handler is stored in this style. See the [[Events.click]] method for a description. +'''Note:''' Green Shoes doesn't support `:click` style. + === :curve » a number === For: ''background, border, rect''. The radius of curved corners on each of these rectangular elements. As an @@ -1214,20 +1204,24 @@ positive number displaces to the right by the given number of pixels; a negative number displaces to the left. Displacing an object doesn't effect the actual layout of the page. Before using this style, be sure to read the [[Position.displace]] docs, since its behavior can be a bit surprising. +'''Note:''' Green Shoes doesn't support `:displace_left` style. + === :displace_top » a number === For: ''all slots and elements''. Moves a shape, text block or any other kind of object up or down. A positive number moves the object down by this number of pixels; a negative number moves it up. Displacing doesn't effect the actual layout of the page or the object's true coordinates. Read the [[Position.displace]] docs, since its behavior can be a bit surprising. +'''Note:''' Green Shoes doesn't support `:displace_top` style. + === :emphasis » a string === For: ''banner, caption, code, del, em, ins, inscription, link, para, span, strong, sub, sup, subtitle, tagline, title''. @@ -1237,32 +1231,32 @@ * "normal" - the font is upright. * "oblique" - the font is slanted, but in a roman style. * "italic" - the font is slanted in an italic style. +'''Note:''' Green Shoes doesn't support `:emphasis` style. + === :family » a string === For: ''banner, caption, code, del, em, ins, inscription, link, para, span, strong, sub, sup, subtitle, tagline, title''. Styles the text with a given font family. The string should contain the family name or a comma-separated list of families. -=== :fill » a hex code, a Shoes::Color or a range of either === +'''Note:''' Green Shoes doesn't support `:family` style. -For: ''arc, arrow, background, banner, caption, code, del, em, flow, image, -ins, inscription, line, link, mask, oval, para, rect, shape, span, stack, star, -strong, sub, sup, subtitle, tagline, title''. +=== :fill » a hex code, a rgb array or a range of either === +For: ''background, border, line, oval, rect, shape, star''. + The color of the background pen. For shapes, this is the fill color, the paint -inside the shape. For text stuffs, this color is painted in the background (as -if marked with a highlighter pen.) +inside the shape. === :font » a string === -For: ''banner, caption, code, del, em, ins, inscription, link, para, span, -strong, sub, sup, subtitle, tagline, title''. +For: ''banner, caption, inscription, para, subtitle, tagline, title''. Styles the text with a font description. The string is pretty flexible, but can take the form "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]", where FAMILY-LIST is a comma separated list of families optionally terminated by a comma, STYLE_OPTIONS is a whitespace separated list of words where each WORD describes @@ -1282,10 +1276,12 @@ at a time. By giving this style a string, the radio button will be grouped with other radio buttons that have the same group name. +'''Note:''' Green Shoes doesn't support ''radio''. + === :height » a number === For: ''all slots and elements''. Sets the pixel height of this object. If the number is a decimal number, the @@ -1297,10 +1293,12 @@ For: ''all slots and elements''. Hides or shows this object. Any object with `:hidden => true` are not displayed on the screen. Neither are its children. +'''Note:''' Green Shoes doesn't support `:hidden` style. + === :inner » a number === For: ''star''. The size of the inner radius (in pixels.) The inner radius describes the solid @@ -1318,40 +1316,46 @@ For: ''banner, caption, code, del, em, ins, inscription, link, para, span, strong, sub, sup, subtitle, tagline, title'' Evenly spaces the text horizontally. +'''Note:''' Green Shoes doesn't support `:justify` style. + === :kerning » a number === For: ''banner, caption, code, del, em, ins, inscription, link, para, span, strong, sub, sup, subtitle, tagline, title''. Adds to the natural spacing between letters, in pixels. +'''Note:''' Green Shoes doesn't support `:kerning` style. + === :leading » a number === For: ''banner, caption, inscription, para, subtitle, tagline, title''. Sets the spacing between lines in a text block. Defaults to 4 pixels. +'''Note:''' Green Shoes doesn't support `:leading` style. + === :left » a number === For: ''all slots and elements''. -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 +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 slot containing it. If this style is left unset (or set to `nil`,) the object will flow in with the other objects surrounding it. === :margin » a number or an array of four numbers === For: ''all slots and elements''. Margins space an element out from its surroundings. Each element has a left, top, right, and bottom margin. If the `:margin` style is set to a single number, the spacing around the element uniformly matches that number. In other -words, if `:margin => 8` is set, all the margins around the element are set to +words, if `margin: 8` is set, all the margins around the element are set to eight pixels in length. This style can also be given an array of four numbers in the form `[left, top, right, bottom]`. @@ -1387,16 +1391,16 @@ === :points » a number === For: ''star''. -How many points does this star have? A style of `:points => 5` creates a +How many points does this star have? A style of `points: 5` creates a five-pointed star. === :radius » a number === -For: ''arc, arrow, background, border, gradient, oval, rect, shape''. +For: ''oval''. Sets the radius (half of the diameter or total width) for each of these elements. Setting this is equivalent to setting both `:width` and `:height` to double this number. @@ -1408,43 +1412,50 @@ relative to its container's rightmost edge. So, `:right => 0` will align the element so that its own right edge and the right edge of its slot touch. Whereas `:right => 20` will position the right edge of the element off to the left of its slot's right edge by twenty pixels. +'''Note:''' Green Shoes doesn't support `:right` style. + === :rise » a number === For: ''banner, caption, code, del, em, ins, inscription, link, para, span, strong, sub, sup, subtitle, tagline, title''. Lifts or plunges the font baseline for some text. For example, a [[Element.sup]] has a `:rise` of 10 pixels. Conversely, the [[Element.sub]] element has a `:rise` of -10 pixels. +'''Note:''' Green Shoes doesn't support `:rise` style. + === :scroll » true or false === For: ''flow, stack''. Establishes this slot as a scrolling slot. If `:scroll => true` is set, the slot will show a scrollbar if any of its contents go past its height. The scrollbar will appear and disappear as needed. It will also appear inside the width of the slot, meaning the slot's width will never change, regardless of whether there is a scrollbar or not. +'''Note:''' Green Shoes doesn't support `:scroll` style. + === :secret » true or false === For: ''ask, edit_line''. Used for password fields, this setting keeps any characters typed in from becoming visible on the screen. Instead, a replacement character (such as an asterisk) is show for each letter typed. +'''Note:''' Green Shoes doesn't support `:secret` style. + === :size » a number === -For: ''banner, caption, code, del, em, ins, inscription, link, para, span, -strong, sub, sup, subtitle, tagline, title''. +For: ''banner, caption, inscription, para, subtitle, tagline, title''. -Sets the pixel size for the font used inside this text block or text fragment. +Sets the pixel size for the font used inside this text block. Font size may also be augmented, through use of the following strings: * "xx-small" - 57% of present size. * "x-small" - 64% of present size. @@ -1452,10 +1463,12 @@ * "medium" - no change in size. * "large" - 120% of present size. * "x-large" - 143% of present size. * "xx-large" - 173% of present size. +'''Note:''' Green Shoes doesn't support as the above string style settings. + === :state » a string === For: ''button, check, edit_box, edit_line, list_box, radio''. The `:state` style is for disabling or locking certain controls, if you don't @@ -1465,10 +1478,12 @@ * nil - the control is active and editable. * "readonly" - the control is active but cannot be edited. * "disabled" - the control is not active (grayed out) and cannot be edited. +'''Note:''' Green Shoes doesn't support `:state` style. + === :stretch » a string === For: ''banner, caption, code, del, em, ins, inscription, link, para, span, strong, sub, sup, subtitle, tagline, title''. @@ -1478,68 +1493,72 @@ * "condensed" - a smaller width of letters. * "normal" - the standard width of letters. * "expanded" - a larger width of letters. +'''Note:''' Green Shoes doesn't support `:stretch` style. + === :strikecolor » a Shoes::Color === For: ''banner, caption, code, del, em, ins, inscription, link, para, span, strong, sub, sup, subtitle, tagline, title''. The color used to paint any lines stricken through this text. +'''Note:''' Green Shoes doesn't support `:strikecolor` style. + === :strikethrough » a string === For: ''banner, caption, code, del, em, ins, inscription, link, para, span, strong, sub, sup, subtitle, tagline, title''. Is this text stricken through? Two options here: * "none" - no strikethrough * "single" - a single-line strikethrough. -=== :stroke » a hex code, a Shoes::Color or a range of either === +'''Note:''' Green Shoes doesn't support `:strikethrough` style. -For: ''arc, arrow, banner, border, caption, code, del, em, flow, image, ins, -inscription, line, link, mask, oval, para, rect, shape, span, stack, star, -strong, sub, sup, subtitle, tagline, title''. +=== :stroke » a hex code, a rgb array or a range of either === +For: ''background, border, line, oval, rect, shape, star''. + The color of the foreground pen. In the case of shapes, this is the color the -lines are drawn with. For paragraphs and other text, the letters are printed -in this color. +lines are drawn with. === :strokewidth » a number === -For: ''arc, arrow, border, flow, image, line, mask, oval, rect, shape, star, stack''. +For: ''background, border, line, oval, rect, shape, star''. The thickness of the stroke, in pixels, of the line defining each of these shapes. For example, the number two would set the strokewidth to 2 pixels. === :text » a string === -For: ''button, edit_box, edit_line''. +For: ''edit_box, edit_line''. -Sets the message displayed on a button control, or the contents of an edit_box -or edit_line. +Sets the message displayed on the contents of edit_box or edit_line. === :top » a number === For: ''all slots and elements''. -Sets the top coordinate for an object, relative to its parent slot. If an -object is set with `:top => 40`, this means the object's top edge will be -placed 40 pixels beneath the top edge of the slot that contains it. If no +Sets the top coordinate for an object, relative to the top slot (window). If an +object is set with `top: 40`, this means the object's top edge will be +placed 40 pixels beneath the top edge of the top slot (window). If no `:top` style is given, the object is automatically placed in the natural flow -of its slot. +of the slot it contains. === :undercolor » a Shoes::Color === For: ''banner, caption, code, del, em, ins, inscription, link, para, span, strong, sub, sup, subtitle, tagline, title''. The color used to underline text. +'''Note:''' Green Shoes doesn't support `:undercolor` style. + === :underline » a string === For: ''banner, caption, code, del, em, ins, inscription, link, para, span, strong, sub, sup, subtitle, tagline, title''. @@ -1551,20 +1570,24 @@ * "single" - a continuous underline. * "double" - two continuous parallel underlines. * "low" - a lower underline, beneath the font baseline. (This is generally recommended only for single characters, particularly when showing keyboard accelerators.) * "error" - a wavy underline, usually found indicating a misspelling. +'''Note:''' Green Shoes doesn't support `:underline` style. + === :variant » a string === For: ''banner, caption, code, del, em, ins, inscription, link, para, span, strong, sub, sup, subtitle, tagline, title''. Vary the font for a group of text. Two choices: * "normal" - standard font. * "smallcaps" - font with the lower case characters replaced by smaller variants of the capital characters. +'''Note:''' Green Shoes doesn't support `:variant` style. + === :weight » a string === For: ''banner, caption, code, del, em, ins, inscription, link, para, span, strong, sub, sup, subtitle, tagline, title''. @@ -1579,10 +1602,12 @@ * "ultrabold" - the ultrabold weight (= 800) * "heavy" - the heavy weight (= 900) However, you may also pass in the numerical weight directly. +'''Note:''' Green Shoes doesn't support `:weight` style. + === :width » a number === For: ''all slots and elements''. Sets the pixel width for the element. If the number is a decimal, the width is @@ -1598,10 +1623,12 @@ * "word" - Break lines at word breaks. * "char" - Break lines between characters, thus breaking some words. * "trim" - Cut the line off with an ellipsis if it goes too long. +'''Note:''' Green Shoes doesn't support `:wrap` style. + == Classes List == Here is a complete list of all the classes introduced by Shoes. This chart is laid out according to how classes inherits from each other. Subclasses are indented one level to the right, beneath their parent class. @@ -2993,16 +3020,15 @@ Here's a sample checklist. {{{ #!ruby - # Not yet available Shoes.app do stack do - flow { check; para "Frances Johnson" } - flow { check; para "Ignatius J. Reilly" } - flow { check; para "Winston Niles Rumfoord" } + flow { check; para "Frances Johnson", width: 200 } + flow { check; para "Ignatius J. Reilly", width: 200 } + flow { check; para "Winston Niles Rumfoord", width: 200 } end end }}} You basically have two ways to use a check. You can attach a block to the @@ -3011,18 +3037,17 @@ Okay, let's add to the above example. {{{ #!ruby - # Not yet available Shoes.app do @list = ['Frances Johnson', 'Ignatius J. Reilly', 'Winston Niles Rumfoord'] stack do @list.map! do |name| - flow { @c = check; para name } + flow { @c = check; para name, width: 200 } [@c, name] end button "What's been checked?" do selected = @list.map { |c, name| name if c.checked? }.compact @@ -3341,33 +3366,31 @@ the drop-down appears. But radio buttons are all shown, regardless of which is marked. {{{ #!ruby - # Not yet available Shoes.app do para "Among these films, which do you prefer?\n" - radio; para strong("The Taste of Tea"), " by Katsuhito Ishii\n" - radio; para strong("Kin-Dza-Dza"), " by Georgi Danelia\n" - radio; para strong("Children of Heaven"), " by Majid Majidi\n" + radio; para strong("The Taste of Tea"), " by Katsuhito Ishii\n", width: 570 + radio; para strong("Kin-Dza-Dza"), " by Georgi Danelia\n", width: 570 + radio; para strong("Children of Heaven"), " by Majid Majidi\n", width: 570 end }}} Only one of these three radios can be checked at a time, since they are grouped together in the same slot (along with a bunch of `para`.) If we move them each into their own slot, the example breaks. {{{ #!ruby - # Not yet available Shoes.app do stack do para "Among these films, which do you prefer?" - flow { radio; para "The Taste of Tea by Katsuhito Ishii" } - flow { radio; para "Kin-Dza-Dza by Georgi Danelia" } - flow { radio; para "Children of Heaven by Majid Majidi" } + flow { radio; para "The Taste of Tea by Katsuhito Ishii", width: 300 } + flow { radio; para "Kin-Dza-Dza by Georgi Danelia", width: 300 } + flow { radio; para "Children of Heaven by Majid Majidi", width: 300 } end end }}} This can be fixed, though. You can group together radios from different slots, @@ -3375,24 +3398,23 @@ Here, let's group all these radios in the `:films` group. {{{ #!ruby - # Not yet available Shoes.app do stack do para "Among these films, which do you prefer?" flow do radio :films - para "The Taste of Tea by Katsuhito Ishii" + para "The Taste of Tea by Katsuhito Ishii", width: 300 end flow do radio :films - para "Kin-Dza-Dza by Georgi Danelia" + para "Kin-Dza-Dza by Georgi Danelia", width: 300 end flow do radio :films - para "Children of Heaven by Majid Majidi" + para "Children of Heaven by Majid Majidi", width: 300 end end end }}}