diff options
Diffstat (limited to 'ext/tk/sample')
179 files changed, 0 insertions, 25021 deletions
diff --git a/ext/tk/sample/demos-en/ChangeLog b/ext/tk/sample/demos-en/ChangeLog deleted file mode 100644 index c3f66cf409..0000000000 --- a/ext/tk/sample/demos-en/ChangeLog +++ /dev/null @@ -1,64 +0,0 @@ -2002-08-29 16:30 matt - - * ChangeLog: ChangeLog is auto-generated *from* CVS log. - -2002-08-29 16:27 matt - - * ChangeLog.prev: [no log message] - -2002-08-28 18:07 matt - - * browse1, browse2, hello, ixset, rmt, rolodex, rolodex-j, square, - tcolor, timer, widget: Changed #! lines to the slightly more - portable '#!/usr/bin/env ruby'. - -2002-08-28 17:56 matt - - * icon.rb, items.rb, label.rb, menu.rb, ruler.rb: Changed bitmap - file extensions from .bmp to .xbm. - -2002-08-28 17:55 matt - - * images/: face.bmp, face.xbm, flagdown.bmp, flagdown.xbm, - flagup.bmp, flagup.xbm, gray25.bmp, gray25.xbm, letters.bmp, - letters.xbm, noletter.bmp, noletter.xbm, pattern.bmp, pattern.xbm: - Changed X bitmap file extensions from .bmp to the more intuitive - .xbm. - -2002-08-28 17:35 matt - - * bitmap.rb, colors.rb, cscroll.rb, ctext.rb, hello, ixset, - menubu.rb, patch_1.1c1, rmt, style.rb, timer, ChangeLog, README, - README.tkencoding, arrow.rb, bind.rb, browse1, browse2, button.rb, - check.rb, clrpick.rb, dialog1.rb, dialog2.rb, entry1.rb, entry2.rb, - filebox.rb, floor.rb, form.rb, hscale.rb, icon.rb, image1.rb, - image2.rb, items.rb, label.rb, menu.rb, msgbox.rb, plot.rb, - puzzle.rb, radio.rb, rolodex, rolodex-j, ruler.rb, sayings.rb, - search.rb, square, states.rb, tcolor, text.rb, tkencoding.rb, - twind.rb, vscale.rb, widget, doc.org/README, doc.org/README.JP, - doc.org/README.tk80, doc.org/license.terms, - doc.org/license.terms.tk80, images/earth.gif, images/earthris.gif, - images/face.bmp, images/flagdown.bmp, images/flagup.bmp, - images/gray25.bmp, images/grey.25, images/grey.5, - images/letters.bmp, images/noletter.bmp, images/pattern.bmp, - images/tcllogo.gif, images/teapot.ppm: Initial revision - -2002-08-28 17:35 matt - - * bitmap.rb, colors.rb, cscroll.rb, ctext.rb, hello, ixset, - menubu.rb, patch_1.1c1, rmt, style.rb, timer, ChangeLog, README, - README.tkencoding, arrow.rb, bind.rb, browse1, browse2, button.rb, - check.rb, clrpick.rb, dialog1.rb, dialog2.rb, entry1.rb, entry2.rb, - filebox.rb, floor.rb, form.rb, hscale.rb, icon.rb, image1.rb, - image2.rb, items.rb, label.rb, menu.rb, msgbox.rb, plot.rb, - puzzle.rb, radio.rb, rolodex, rolodex-j, ruler.rb, sayings.rb, - search.rb, square, states.rb, tcolor, text.rb, tkencoding.rb, - twind.rb, vscale.rb, widget, doc.org/README, doc.org/README.JP, - doc.org/README.tk80, doc.org/license.terms, - doc.org/license.terms.tk80, images/earth.gif, images/earthris.gif, - images/face.bmp, images/flagdown.bmp, images/flagup.bmp, - images/gray25.bmp, images/grey.25, images/grey.5, - images/letters.bmp, images/noletter.bmp, images/pattern.bmp, - images/tcllogo.gif, images/teapot.ppm: Taking over demo package - from Jonathan Conway. - diff --git a/ext/tk/sample/demos-en/ChangeLog.prev b/ext/tk/sample/demos-en/ChangeLog.prev deleted file mode 100644 index 536ce30abe..0000000000 --- a/ext/tk/sample/demos-en/ChangeLog.prev +++ /dev/null @@ -1,9 +0,0 @@ -2001-07-26 <rise@leannan.knavery.net> - - * Moved files to directory ruby-tk81-demos-english in tarball. - -2001-07-26 <rise@knavery.net> - - * Added test to widget and hello versus Tk::TCL_VERSION & Tk::JAPANIZED_TK (per Guy Decoux in [ruby-talk:18559]) before requiring tkencoding.rb. - -
\ No newline at end of file diff --git a/ext/tk/sample/demos-en/README b/ext/tk/sample/demos-en/README deleted file mode 100644 index 2908aa38e4..0000000000 --- a/ext/tk/sample/demos-en/README +++ /dev/null @@ -1,138 +0,0 @@ -Current Maintainer: - Jonathan Conway - rise@knavery.net - - Please direct all bug reports/requests/suggestions to the above - address. - - -Notes: - -* The files hello and widget have been changed to test Tk::TCL_VERSION - and Tk::JAPANIZED_TK before requiring tkencoding.rb to prevent an - infinite loop. This test was taken from a message in - [ruby-talk:18559] by Guy Decoux. - -* The .bmp files in the images directory are X bitmaps (i.e. XBM to many - graphics packages), not Windows bitmaps (.bmp). You will not be - able to use images exported by a graphics program as Windows - bitmaps with this demo collection nor will you be able to edit the - included images without setting the file type correctly. - --- Jonathan Conway, 2001-07-26 - - -#------------------------------------------------------------------------------ -# ==== Introduction. ==== -# -# To create this version of the Ruby/Tk widget demo, I took the -# ruby-tk81-demos and removed all the Kanji strings and comments. I -# have tried to restore the original English strings and comments -# using the Tcl/Tk8.2.2 version of the widget demo. -# -# When I tried running the Kanji version, all I got was a mostly blank -# panel with a non-functional "File" button. I disovered that if all -# non-ASCII characters were replaced with blanks, then I could get the -# gutted stuff running. -# -# Since English Ruby/Tk documentation is lacking and I needed this -# code to see how it worked and to use as the basis of my try-it -# prototype (The Ruby Yielding Interactive Toolkit), plus the fact -# that no help was forthcoming for making the Kanji version work (plus -# the fact that I can't read Kanji anyway), I decided to embark on -# this English restoration project. -# -# Thanks to everyone who worked on the original Ruby/Tk widget demo -# (and the preceding Tcl/Tk version for that matter). The -# comparatively simple task of changing text strings and comments has -# made me appreciate the great amount of original work that went into -# this. -# -# -- Conrad Schneiker, 2000-07-23. -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# ==== Known bugs. ==== -# -# ^C-ing the demo gives Ruby interrupt and stack message; clean exit needed. -# Font settings don't work correctly. -# Dismissing the embedded windows demo (tkwind.rb) kills the widget demo. -# Rerunning the canvas item demo from the code widow get errors. -# The "press me" button in the canvas item demo doesn't time out. -# The simple 2 d plot starts up extremely slow compared to the Tcl version. -# The first item message on the icon menu on the menu and cascades demo doesn't work. -#------------------------------------------------------------------------------ - - -###################### Original README ######################################## - - Ruby/Tk81 widget-demo 1999/08/13 - - ËÌΦÀèüÂç¾ðÊó²Ê³Ø¸¦µæ²Ê - ΩÀÐ <ttate@jaist.ac.jp> - -Tcl/Tk8.1¤Ç¤Ïunicode(UTF8)¤¬ºÎÍѤµ¤ì¡¢unicode¤ËÊÑ´¹¤µ¤ì¤¿ÆüËܸì¤Ç¤¢¤ì¤Ð -Widget¤Ëɽ¼¨¤µ¤»¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£ËÜ¥¢¡¼¥«¥¤¥Ö¤Ë¤Ï°ÊÁ°¤Ë±Ê°æ¤µ¤ó¤¬Ãæ¿´¤È -¤Ê¤é¤ì¤ÆºîÀ®¤µ¤ì¤¿Ruby/Tk¤Î¥µ¥ó¥×¥ë¤Ë½¤Àµ¤ò²Ã¤¨¡¢°Ê²¼¤Î´Ä¶¤Ë¤ª¤¤¤Æ¤Çưºî -¤ò³Îǧ¤·¤¿¤â¤Î¤Ç¤¹¡£ - -* ruby-1.3.7,ruby-1.4.0 -* tcl8.1, tk8.1 -* linux-2.2 - -Windows(Cygwin)¤Ë¤ª¤¤¤Æ¡¢¥µ¥ó¥×¥ë¤òư¤«¤¹¤Ë¤Ïruby¤ò-Ke¤È¤¤¤¦¥ª¥×¥·¥ç¥ó¤òÉÕ -¤±¤Æµ¯Æ°¤µ¤»¤ë¤ÈÎɤ¤¤½¤¦¤Ç¤¹¡£ - ¾ðÊóÄó¶¡¡§ÅÏÊÕ¤µ¤ó - <eban@os.rim.or.jp> - ----------------------------------------------------------------------------- - Ruby/Tk widget-demo - version 1.1 ( 1998/07/24 ) - ±Ê°æ¡÷ÃÎǽ¡¥¶å¹©Âç (nagai@ai.kyutech.ac.jp) - -ɸ½àÇÛÉۤΠTcl/Tk ³ÈÄ¥¥Ñ¥Ã¥±¡¼¥¸¤ò¼è¤ê¹þ¤ó¤À Ruby (°Ê²¼ Ruby/Tk ¤È¸Æ¤Ó¤Þ¤¹) -¤Ç¤Ï¡¤Tk widget ¤òÍѤ¤¤¿ GUI ¤ÎºîÀ®¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤¤Þ¤¹¡¥¼ÂºÝ¤Ë GUI ¤òºîÀ® -¤·¤Æ¤¤¤¯¾ì¹ç¤Ë¤ÏÍÍ¡¹¤Ê¼ÂÎ㤬¥µ¥ó¥×¥ë¤È¤·¤ÆÂ¸ºß¤¹¤ë¤ÈÊØÍø¤Ê¤Î¤Ç¤¹¤¬¡¤Ruby/Tk -¤Ë¤Ï¤½¤Î¤è¤¦¤ÊŬÅö¤Ê¥µ¥ó¥×¥ë¥¹¥¯¥ê¥×¥È½¸¹ç¤Ï¸ºß¤·¤Þ¤»¤ó¤Ç¤·¤¿¡¥¤½¤ì¤ËÂФ·¡¤ -³ÈÄ¥¥Ñ¥Ã¥±¡¼¥¸¤Î¸µ¤Ç¤¢¤ë Tcl/Tk ¤Ë¤Ï¡¤Tk widget ¤òÍѤ¤¤Æ¤É¤Î¤è¤¦¤Ê¤³¤È¤¬¤Ç -¤¤ë¤«¤ò¼¨¤¹¤â¤Î¤È¤·¤Æ widget-demo ¤¬Â¸ºß¤·¤ª¤ê¡¤Tcl/Tk ¤òÍѤ¤¤¿ GUI ¤ÎºîÀ® -¤ò½¬ÆÀ¤¹¤ëºÝ¤ÎÂåɽŪ¥µ¥ó¥×¥ë¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡¥ËÜ¥¢¡¼¥«¥¤¥Ö¤Ï¡¤Ruby/Tk ¤Î½¬ÆÀ¤Î -¤¿¤á¤ÎÂåɽŪ¤Ê¥µ¥ó¥×¥ë¥¹¥¯¥ê¥×¥È¤È¤¹¤Ù¤¯¡¤Tcl/Tk ¤Î widget-demo ¤ò°Ü¿¢¤·¤¿¤â -¤Î¤Ç¤¹¡¥ - -ËÜ¥¢¡¼¥«¥¤¥Ö¤Ë´Þ¤Þ¤ì¤ë¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Ë¤Ï¡¤ruby-1.1c2 °Ê¾å¤Ç¤¢¤ë¤³ -¤È¤¬É¬ÍפǤ¹¡¥1.1c1 ¤Î¾ì¹ç¤Ï¡¤ËÜ¥¢¡¼¥«¥¤¥Ö¤Ë´Þ¤Þ¤ì¤ë patck_1.1c1 ¤ò Ruby ¤Î -¥é¥¤¥Ö¥é¥ê¤Ë¤¢¤Æ¤Æ¤¯¤À¤µ¤¤¡¥ÁȤ߹þ¤à Tk ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï¡¤4.2 ¤Ç¤â 8.0 ¤Ç¤â½¤ -Àµ¤Ê¤¯Æ°¤«¤»¤ë¤Ï¤º¤Ç¤¹¡¥¤¿¤À¤·¡¤ÆüËܸìÈǤǤΰܿ¢¤È¤Ê¤Ã¤Æ¤¤¤ë¤¿¤á¡¤ÆüËܸ첽¤µ -¤ì¤¿ Tk ¤ò¤´ÍøÍѤ¯¤À¤µ¤¤¡¥¥¹¥¯¥ê¥×¥È¤Î¥Æ¥¹¥È¤Ï¡¤Tk4.2jp ¤È Tk8.0jp ¤Î¾å¤Ç¹Ô -¤¤¤Þ¤·¤¿ (´°àú¤Ë¤Ç¤Ï¤Ê¤¤¤Ç¤¹¤¬)¡¥ - -ËÜ¥¢¡¼¥«¥¤¥Ö¤Ë´Þ¤Þ¤ì¤ë¥¹¥¯¥ê¥×¥È¤Î¿¤¯¤Ï¡¤¸µ¤È¤Ê¤Ã¤Æ¤¤¤ë Tcl/Tk ÈǤËÈæ³ÓŪ¶á -¤¤¥¹¥¯¥ê¥×¥Èµ½Ò¤È¤Ê¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤Þ¤¹¡¥¤½¤Î¤¿¤á¡¤Ruby/Tk ¤Î¥µ¥ó¥×¥ë¤È¸À¤¦¤Ë -¤Ï¡¤¤¢¤Þ¤ê Ruby ¤é¤·¤¯¤Ê¤¤¤È¤â¸À¤¨¤ë¤Ç¤·¤ç¤¦¡¥¤Ë¤â¤«¤«¤ï¤é¤º¡¤¤½¤Î¤è¤¦¤Êµ½Ò -¤ò¼è¤Ã¤Æ¤¤¤ëÍýͳ¤Ï¡¤Ruby/Tk ¤Î¥É¥¥å¥á¥ó¥ÈÉÔ¤ˤ¢¤ê¤Þ¤¹¡¥ - -Tcl/Tk ¤Ë¤ÏŬÅö¤Ê»²¹Í½ñ¤¬²¿ºý¤«Â¸ºß¤·¤Æ¤¤¤Þ¤¹¤«¤é¡¤Ruby/Tk ¥¹¥¯¥ê¥×¥È¤òºîÀ® -¤¹¤ëºÝ¤Ï¡¤¤½¤Î¤è¤¦¤Ê Tcl/Tk ¤Î»²¹Í½ñ¤Ç¾ðÊó¤òÊ䤤¤Ê¤¬¤éºîÀ®¤¹¤ë¤³¤È¤Ë¤Ê¤ë¤È»× -¤¤¤Þ¤¹¡¥³Æ widget ¤Î»ÈÍÑÎã¤È¤·¤Æ¡¤Tcl/Tk ¤Î widget-demo ¤ò»²¾È¤¹¤ë¤³¤È¤â¤¢¤ë -¤Ç¤·¤ç¤¦¡¥Ruby/Tk ÈǤε½Ò¤ò widget-demo ¤ò Tcl/Tk ÈǤε½Ò¤Ë¶á¤¤¤â¤Î¤Ë¤·¤Æ -¤ª¤±¤Ð¡¤¤½¤ÎÂÐÈæ¤Ë¤è¤Ã¤Æ¡¤Ruby/Tk ¤ÎÍý²ò¤òÁá¤á¤ë¤³¤È¤¬¤Ç¤¤ë¤È¹Í¤¨¤é¤ì¤Þ¤¹¡¥ -°ìö Ruby/Tk ¤Ç¤Î ³Æ widget ¤Î»ÈÍÑÊýË¡¤ò½¬ÆÀ¤·¤Æ¤·¤Þ¤¨¤Ð¡¤Ruby ¤é¤·¤¤¥¹¥¯¥ê -¥×¥È¤òºîÀ®¤¹¤ë¤³¤È¤ÏÆñ¤·¤¯¤Ê¤¤¤Ç¤·¤ç¤¦¡¥ËÜ¥¢¡¼¥«¥¤¥Ö¤Î¥¹¥¯¥ê¥×¥È¤Ï¡¤Ruby/Tk -¤òºÇ½é¤Ë½¬ÆÀ¤¹¤ë¤Þ¤Ç¤ÎÆ§Âæ¤È¤·¤ÆÍøÍѤ·¤Æ¤¤¤¿¤À¤±¤ì¤Ð¹¬¤¤¤Ç¤¹¡¥ - -widget-demo ¤Î°Ü¿¢¤Ë¤¢¤¿¤Ã¤Æ¤Ï¡¤¼¡¤ÎÊý¤Ë¤â°Ü¿¢¤·¤¿¥¹¥¯¥ê¥×¥È¤òÄ󶡤·¤Æ¤¤¤¿¤À -¤¤Þ¤·¤¿¡¥¤³¤³¤Ë´¶¼Õ¤Î°Õ¤òɽ¤·¤Þ¤¹¡¥ - - ΩÀС÷JAIST (ttate@jaist.ac.jp) ¤µ¤ó - Ê¿¾¾¾Í»Ë (hiramatu@cdrom.co.jp) ¤µ¤ó - -Ê¿¾¾¤µ¤ó¤Ë¤è¤ë Ruby/Tk ÆþÌç¤Î Web page (http://www.cdrom.co.jp/~hiramatu/) -¤â Ruby/Tk ¤Î½¬ÆÀ¤ËÍÍѤȻפ¨¤Þ¤¹¤Î¤Ç¡¤¤¼¤Ò¤´»²¾È¤¯¤À¤µ¤¤¡¥ - -¤Þ¤¿¡¤Á°¶¶ (maebashi@iij.ad.jp) ¤µ¤ó¤ò¤Ï¤¸¤á¤È¤·¤Æ¡¤widget-demo ¤Î°Ü¿¢¤ËºÝ¤· -¤ÆÉ¬ÍפȤʤä¿ Ruby ¤Î Tk ´ØÏ¢¥é¥¤¥Ö¥é¥ê½¤Àµ¤Ë¤Ä¤¤¤Æ¡¤ÌäÂêÅÀ¡¤¥Ð¥°¤Î»ØÅ¦¤ò¤· -¤Æ¤¤¤¿¤À¤¤¤¿Êý¡¹¤Ë¤â´¶¼ÕÃפ·¤Þ¤¹¡¥ - -¤½¤·¤ÆºÇ¸å¤ËºÇÂç¤Î´¶¼Õ¤ò Ruby À߷׼ԤΠ¤Þ¤Ä¤â¤È ¤æ¤¤Ò¤í (matz@netlab.co.jp) -¤µ¤ó¤ËÊû¤²¤¿¤¤¤È»×¤¤¤Þ¤¹¡¥ diff --git a/ext/tk/sample/demos-en/README.tkencoding b/ext/tk/sample/demos-en/README.tkencoding deleted file mode 100644 index 8fcb494c03..0000000000 --- a/ext/tk/sample/demos-en/README.tkencoding +++ /dev/null @@ -1,24 +0,0 @@ -tkencoding.rb¤òÍѤ¤¤¿ÆüËܸì¤Îɽ¼¨¤Ë¤Ä¤¤¤Æ - -Copyright (C) 1999/07, Takaaki Tateishi <ttate@jaist.ac.jp> - - -1. tkencoding.rb¤È¤Ï¡© - -tkencoding.rb¤ÏTcl/Tk8.1¤òÍøÍѤ·¤¿Ruby/Tk¤Î¤¿¤á¤Î¥é¥¤¥Ö¥é¥ê -¤Ç¤¹¡£tkencoding.rb¤òrequire¤¹¤ë¤³¤È¤Ë¤è¤Ã¤ÆWedget¤Ëɽ¼¨¤µ -¤ì¤ë¥Æ¥¥¹¥È¤ÏÁ´¤Æunicode(UTF8)¤ØÊÑ´¹¤µ¤ì¤Þ¤¹¡£ - - -2. »È¤¤Êý - -tkencoding.rb¤òrequire¤·¤ÆTk.encoding¤Ç»ÈÍѤ·¤Æ¤¤¤ëʸ»ú¥³¡¼¥É -¤ò»ØÄꤷ¤Æ²¼¤µ¤¤¡£Î㤨¤Ð°Ê²¼¤Î¤è¤¦¤Ê´¶¤¸¤Ë¤Ê¤ê¤Þ¤¹¡£ - ----- -require 'tk' -require 'tkencoding' - -Tk.encoding = "euc-jp" -# Tk.encoding = "shiftjis" ---- diff --git a/ext/tk/sample/demos-en/arrow.rb b/ext/tk/sample/demos-en/arrow.rb deleted file mode 100644 index 8ee13254ea..0000000000 --- a/ext/tk/sample/demos-en/arrow.rb +++ /dev/null @@ -1,239 +0,0 @@ -# arrow.rb -# -# This demonstration script creates a canvas widget that displays a -# large line with an arrowhead whose shape can be edited interactively. -# -# arrowhead widget demo (called by 'widget') -# - -# arrowSetup -- -# This method regenerates all the text and graphics in the canvas -# window. It's called when the canvas is initially created, and also -# whenever any of the parameters of the arrow head are changed -# interactively. -# -# Arguments: -# c - Name of the canvas widget. - -def arrowSetup(c) - v = $demo_arrowInfo - - # Remember the current box, if there is one. - tags = c.gettags('current') - if tags != [] - cur = tags.find{|t| t.kind_of?(String) && t =~ /^box[1-3]$/ } - else - cur = nil - end - - # Create the arrow and outline. - c.delete('all') - TkcLine.new(c, v.x1, v.y, v.x2, v.y, - { 'width'=>10 * v.width, - 'arrowshape'=>[10*v.a, 10*v.b, 10*v.c], - 'arrow'=>'last' - }.update(v.bigLineStyle) ) - xtip = v.x2 - 10*v.b - deltaY = 10*v.c + 5*v.width - TkcLine.new(c, v.x2, v.y, xtip, v.y + deltaY, - v.x2 - 10*v.a, v.y, xtip, v.y - deltaY, v.x2, v.y, - 'width'=>2, 'capstyle'=>'round', 'joinstyle'=>'round') - - # Create the boxes for reshaping the line and arrowhead. - TkcRectangle.new(c, v.x2-10*v.a-5, v.y-5, v.x2-10*v.a+5, v.y+5, - {'tags'=>['box1', $arrowTag_box]}.update(v.boxStyle) ) - TkcRectangle.new(c, xtip-5, v.y-deltaY-5, xtip+5, v.y-deltaY+5, - {'tags'=>['box2', $arrowTag_box]}.update(v.boxStyle) ) - TkcRectangle.new(c, v.x1-5, v.y-5*v.width-5, v.x1+5, v.y-5*v.width+5, - {'tags'=>['box3', $arrowTag_box]}.update(v.boxStyle) ) - c.itemconfigure cur, v.activeStyle if cur - - # Create three arrows in actual size with the same parameters - TkcLine.new(c, v.x2+50, 0, v.x2+50, 1000, 'width'=>2) - tmp = v.x2+100 - TkcLine.new(c, tmp, v.y-125, tmp, v.y-75, 'width'=>v.width, - 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) - TkcLine.new(c, tmp-25, v.y, tmp+25, v.y, 'width'=>v.width, - 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) - TkcLine.new(c, tmp-25, v.y+75, tmp+25, v.y+125, 'width'=>v.width, - 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) - - # Create a bunch of other arrows and text items showing the - # current dimensions. - tmp = v.x2+10 - TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y-deltaY, - 'arrow'=>'both', 'arrowshape'=>v.smallTips) - TkcText.new(c, v.x2+15, v.y-deltaY+5*v.c, 'text'=>v.c, 'anchor'=>'w') - tmp = v.x1-10 - TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y+5*v.width, - 'arrow'=>'both', 'arrowshape'=>v.smallTips) - TkcText.new(c, v.x1-15, v.y, 'text'=>v.width, 'anchor'=>'e') - tmp = v.y+5*v.width+10*v.c+10 - TkcLine.new(c, v.x2-10*v.a, tmp, v.x2, tmp, - 'arrow'=>'both', 'arrowshape'=>v.smallTips) - TkcText.new(c, v.x2-5*v.a, tmp+5, 'text'=>v.a, 'anchor'=>'n') - tmp = tmp+25 - TkcLine.new(c, v.x2-10*v.b, tmp, v.x2, tmp, - 'arrow'=>'both', 'arrowshape'=>v.smallTips) - TkcText.new(c, v.x2-5*v.b, tmp+5, 'text'=>v.b, 'anchor'=>'n') - - TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*') - TkcText.new(c, v.x1, 330, - 'text'=>"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]", 'anchor'=>'w', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*') - - v.count += 1 -end - -# toplevel widget -if defined?($arrow_demo) && $arrow_demo - $arrow_demo.destroy - $arrow_demo = nil -end - -# demo toplevel widget -$arrow_demo = TkToplevel.new {|w| - title("Arrowhead Editor Demonstration") - iconname("arrow") - positionWindow(w) -} - -# label -TkLabel.new($arrow_demo, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', - 'text'=>"This widget allows you to experiment with different widths and arrowhead shapes for lines in canvases. To change the line width or the shape of the arrowhead, drag any of the three boxes attached to the oversized arrow. The arrows on the right give examples at normal scale. The text at the bottom shows the configuration options as you'd enter them for a canvas line item."){ - pack('side'=>'top') -} - -# frame -$arrow_buttons = TkFrame.new($arrow_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $arrow_demo - $arrow_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'arrow'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$arrow_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# canvas -$arrow_canvas = TkCanvas.new($arrow_demo, 'width'=>500, 'height'=>350, - 'relief'=>'sunken', 'borderwidth'=>2) -$arrow_canvas.pack('expand'=>'yes', 'fill'=>'both') - -# -unless Struct.const_defined?("ArrowInfo") - $demo_arrowInfo = Struct.new("ArrowInfo", :a, :b, :c, :width, :motionProc, - :x1, :x2, :y, :smallTips, :count, - :bigLineStyle, :boxStyle, :activeStyle).new -end -$demo_arrowInfo.a = 8 -$demo_arrowInfo.b = 10 -$demo_arrowInfo.c = 3 -$demo_arrowInfo.width = 2 -$demo_arrowInfo.motionProc = proc{} -$demo_arrowInfo.x1 = 40 -$demo_arrowInfo.x2 = 350 -$demo_arrowInfo.y = 150 -$demo_arrowInfo.smallTips = [5, 5, 2] -$demo_arrowInfo.count = 0 -if TkWinfo.depth($arrow_canvas) > 1 - $demo_arrowInfo.bigLineStyle = {'fill'=>'SkyBlue1'} - $demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1} - $demo_arrowInfo.activeStyle = {'fill'=>'red', 'outline'=>'black', 'width'=>1} -else - $demo_arrowInfo.bigLineStyle = {'fill'=>'black', - 'stipple'=>'@'+[$demo_dir, 'images', 'grey.25'].join(File::Separator)} - $demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1} - $demo_arrowInfo.activeStyle = {'fill'=>'black','outline'=>'black','width'=>1} -end -$arrowTag_box = TkcTag.new($arrow_canvas) -arrowSetup $arrow_canvas -$arrowTag_box.bind('Enter', proc{$arrow_canvas.itemconfigure('current', $demo_arrowInfo.activeStyle)}) -$arrowTag_box.bind('Leave', proc{$arrow_canvas.itemconfigure('current', $demo_arrowInfo.boxStyle)}) -$arrowTag_box.bind('B1-Enter', proc{}) -$arrowTag_box.bind('B1-Leave', proc{}) -$arrow_canvas.itembind('box1', '1', - proc{$demo_arrowInfo.motionProc \ - = proc{|x,y| arrowMove1 $arrow_canvas, x, y}}) -$arrow_canvas.itembind('box2', '1', - proc{$demo_arrowInfo.motionProc \ - = proc{|x,y| arrowMove2 $arrow_canvas, x, y}}) -$arrow_canvas.itembind('box3', '1', - proc{$demo_arrowInfo.motionProc \ - = proc{|x,y| arrowMove3 $arrow_canvas, x, y}}) -$arrowTag_box.bind('B1-Motion', - proc{|x,y| $demo_arrowInfo.motionProc.call(x,y)}, "%x %y") -$arrow_canvas.bind('Any-ButtonRelease-1', proc{arrowSetup $arrow_canvas}) - -# arrowMove1 -- -# This method is called for each mouse motion event on box1 (the -# one at the vertex of the arrow). It updates the controlling parameters -# for the line and arrowhead. -# -# Arguments: -# c - The name of the canvas window. -# x, y - The coordinates of the mouse. - -def arrowMove1(c,x,y) - v = $demo_arrowInfo - newA = (v.x2+5-c.canvasx(x).round)/10 - newA = 0 if newA < 0 - newA = 25 if newA > 25 - if newA != v.a - c.move('box1', 10*(v.a-newA), 0) - v.a = newA - end -end - -# arrowMove2 -- -# This method is called for each mouse motion event on box2 (the -# one at the trailing tip of the arrowhead). It updates the controlling -# parameters for the line and arrowhead. -# -# Arguments: -# c - The name of the canvas window. -# x, y - The coordinates of the mouse. - -def arrowMove2(c,x,y) - v = $demo_arrowInfo - newB = (v.x2+5-c.canvasx(x).round)/10 - newB = 0 if newB < 0 - newB = 25 if newB > 25 - newC = (v.y+5-c.canvasy(y).round-5*v.width)/10 - newC = 0 if newC < 0 - newC = 20 if newC > 20 - if newB != v.b || newC != v.c - c.move('box2', 10*(v.b-newB), 10*(v.c-newC)) - v.b = newB - v.c = newC - end -end - -# arrowMove3 -- -# This method is called for each mouse motion event on box3 (the -# one that controls the thickness of the line). It updates the -# controlling parameters for the line and arrowhead. -# -# Arguments: -# c - The name of the canvas window. -# x, y - The coordinates of the mouse. - -def arrowMove3(c,x,y) - v = $demo_arrowInfo - newWidth = (v.y+2-c.canvasy(y).round)/5 - newWidth = 0 if newWidth < 0 - newWidth = 20 if newWidth > 20 - if newWidth != v.width - c.move('box3', 0, 5*(v.width-newWidth)) - v.width = newWidth - end -end - diff --git a/ext/tk/sample/demos-en/bind.rb b/ext/tk/sample/demos-en/bind.rb deleted file mode 100644 index 5d30d228f0..0000000000 --- a/ext/tk/sample/demos-en/bind.rb +++ /dev/null @@ -1,110 +0,0 @@ -# bind.rb -# -# This demonstration script creates a text widget with bindings set -# up for hypertext-like effects. -# -# text (tag bindings) widget demo (called by 'widget') -# - -# toplevel widget -if defined?($bind_demo) && $bind_demo - $bind_demo.destroy - $bind_demo = nil -end - -# demo toplevel widget -$bind_demo = TkToplevel.new {|w| - title("Text Demonstration - Tag Bindings") - iconname("bind") - positionWindow(w) -} - -# frame -TkFrame.new($bind_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $bind_demo - $bind_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'bind'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# bind -def tag_binding_for_bind_demo(tag, enter_style, leave_style) - tag.bind('Any-Enter', proc{tag.configure enter_style}) - tag.bind('Any-Leave', proc{tag.configure leave_style}) -end - -# text -TkText.new($bind_demo){|t| - # - setgrid 'true' - width 60 - height 24 - font $font - wrap 'word' - TkScrollbar.new($bind_demo) {|s| - pack('side'=>'right', 'fill'=>'y') - command proc{|*args| t.yview(*args)} - t.yscrollcommand proc{|first,last| s.set first,last} - } - pack('expand'=>'yes', 'fill'=>'both') - - # - if TkWinfo.depth($root).to_i > 1 - tagstyle_bold = {'background'=>'#43ce80', 'relief'=>'raised', - 'borderwidth'=>1} - tagstyle_normal = {'background'=>'', 'relief'=>'flat'} - else - tagstyle_bold = {'foreground'=>'white', 'background'=>'black'} - tagstyle_normal = {'foreground'=>'', 'background'=>''} - end - - # ¥Æ¥¥¹¥ÈÁÞÆþ - insert 'insert', "The same tag mechanism that controls display styles in text widgets can also be used to associate Tcl commands with regions of text, so that mouse or keyboard actions on the text cause particular Tcl commands to be invoked. For example, in the text below the descriptions of the canvas demonstrations have been tagged. When you move the mouse over a demo description the description lights up, and when you press button 1 over a description then that particular demonstration is invoked. - -" - insert('end', '1. Samples of all the different types of items that can be created in canvas widgets.', (d1 = TkTextTag.new(t)) ) - insert('end', "\n\n") - insert('end', '2. A simple two-dimensional plot that allows you to adjust the positions of the data points.', (d2 = TkTextTag.new(t)) ) - insert('end', "\n\n") - insert('end', '3. Anchoring and justification modes for text items.', - (d3 = TkTextTag.new(t)) ) - insert('end', "\n\n") - insert('end', '4. An editor for arrow-head shapes for line items.', - (d4 = TkTextTag.new(t)) ) - insert('end', "\n\n") - insert('end', '5. A ruler with facilities for editing tab stops.', - (d5 = TkTextTag.new(t)) ) - insert('end', "\n\n") - insert('end', - '6. A grid that demonstrates how canvases can be scrolled.', - (d6 = TkTextTag.new(t)) ) - - # binding - [d1, d2, d3, d4, d5, d6].each{|tag| - tag_binding_for_bind_demo(tag, tagstyle_bold, tagstyle_normal) - } - d1.bind('1', - proc{eval `cat #{[$demo_dir,'items.rb'].join(File::Separator)}`}) - d2.bind('1', - proc{eval `cat #{[$demo_dir,'plot.rb'].join(File::Separator)}`}) - d3.bind('1', - proc{eval `cat #{[$demo_dir,'ctext.rb'].join(File::Separator)}`}) - d4.bind('1', - proc{eval `cat #{[$demo_dir,'arrow.rb'].join(File::Separator)}`}) - d5.bind('1', - proc{eval `cat #{[$demo_dir,'ruler.rb'].join(File::Separator)}`}) - d6.bind('1', - proc{eval `cat #{[$demo_dir,'cscroll.rb'].join(File::Separator)}`}) - - TkTextMarkInsert.new(t, '0.0') - configure('state','disabled') -} diff --git a/ext/tk/sample/demos-en/bitmap.rb b/ext/tk/sample/demos-en/bitmap.rb deleted file mode 100644 index c81e4ac595..0000000000 --- a/ext/tk/sample/demos-en/bitmap.rb +++ /dev/null @@ -1,73 +0,0 @@ -# bitmap.rb -# -# This demonstration script creates a toplevel window that displays -# all of Tk's built-in bitmaps.# -# bitmap widget demo (called by 'widget') -# - -# bitmapRow -- -# Create a row of bitmap items in a window. -# -# Arguments: -# w - The parent window that is to contain the row. -# args - The names of one or more bitmaps, which will be displayed -# in a new row across the bottom of w along with their -# names. - -def bitmapRow(w,*args) - TkFrame.new(w){|row| - pack('side'=>'top', 'fill'=>'both') - for bitmap in args - TkFrame.new(row){|base| - pack('side'=>'left', 'fill'=>'both', 'pady'=>'.25c', 'padx'=>'.25c') - TkLabel.new(base, 'text'=>bitmap, 'width'=>9).pack('side'=>'bottom') - TkLabel.new(base, 'bitmap'=>bitmap).pack('side'=>'bottom') - } - end - } -end - -# toplevel widget -if defined?($bitmap_demo) && $bitmap_demo - $bitmap_demo.destroy - $bitmap_demo = nil -end - -# demo toplevel widget -$bitmap_demo = TkToplevel.new {|w| - title("Bitmap Demonstration") - iconname("bitmap") - positionWindow(w) -} - -# label -TkLabel.new($bitmap_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left', - 'text'=>"This window displays all of Tk's built-in bitmaps, along with the names you can use for them in Tcl scripts."){ - pack('side'=>'top') -} - -# frame -$bitmap_buttons = TkFrame.new($bitmap_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $bitmap_demo - $bitmap_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'bitmap'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$bitmap_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame -TkFrame.new($bitmap_demo){|f| - bitmapRow(f,'error','gray25','gray50','hourglass') - bitmapRow(f,'info','question','questhead','warning') - pack('side'=>'top', 'expand'=>'yes', 'fill'=>'both') -} - diff --git a/ext/tk/sample/demos-en/browse1 b/ext/tk/sample/demos-en/browse1 deleted file mode 100644 index 03e251035a..0000000000 --- a/ext/tk/sample/demos-en/browse1 +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env ruby - -# browse -- -# This script generates a directory browser, which lists the working -# directory and allow you to open files or subdirectories by -# double-clicking. - -require 'tk' - -# Create a scrollbar on the right side of the main window and a listbox -# on the left side. - -listbox = TkListbox.new(nil, 'relief'=>'sunken', - 'width'=>20, 'height'=>20, 'setgrid'=>'yes') {|l| - TkScrollbar.new(nil, 'command'=>proc{|*args| l.yview *args}) {|s| - pack('side'=>'right', 'fill'=>'y') - l.yscrollcommand(proc{|first,last| s.set(first,last)}) - } - - pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes') -} - -root = TkRoot.new -root.minsize(1,1) - -# The procedure below is invoked to open a browser on a given file; if the -# file is a directory then another instance of this program is invoked; if -# the file is a regular file then the Mx editor is invoked to display -# the file. - -def browse (dir, file) - file = dir + File::Separator + file if dir != '.' - type = File.ftype(file) - if type == 'directory' - system($0 + ' ' + file + ' &') - else - if type == 'file' - if ENV['EDITOR'] - system(ENV['EDITOR'] + ' ' + file + ' &') - else - system('xedit ' + file + ' &') - end - else - STDOUT.print "\"#{file}\" isn't a directory or regular file" - end - end -end - -# Fill the listbox with a list of all the files in the directory (run -# the "ls" command to get that information). - -dir = ARGV[0] ? ARGV[0] : '.' -open("|ls -a #{dir}", 'r'){|fid| fid.readlines}.each{|fname| - listbox.insert('end', fname.chomp) -} - -# Set up bindings for the browser. - -Tk.bind_all('Control-c', proc{root.destroy}) -listbox.bind('Double-Button-1', - proc{TkSelection.get.each{|f| browse dir, f}}) - -Tk.mainloop diff --git a/ext/tk/sample/demos-en/browse2 b/ext/tk/sample/demos-en/browse2 deleted file mode 100644 index 304a5f547e..0000000000 --- a/ext/tk/sample/demos-en/browse2 +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env ruby - -# browse -- -# This script generates a directory browser, which lists the working -# directory and allow you to open files or subdirectories by -# double-clicking. - -require 'tk' - -class Browse - BROWSE_WIN_COUNTER = TkVariable.new(0) - - def initialize(dir) - BROWSE_WIN_COUNTER.value = BROWSE_WIN_COUNTER.to_i + 1 - - # create base frame - base = TkToplevel.new { - minsize(1,1) - title('Browse : ' + dir) - } - - # Create a scrollbar on the right side of the main window and a listbox - # on the left side. - list = TkListbox.new(base, 'relief'=>'sunken', - 'width'=>20, 'height'=>20, 'setgrid'=>'yes') {|l| - TkScrollbar.new(base, 'command'=>proc{|*args| l.yview *args}) {|s| - pack('side'=>'right', 'fill'=>'y') - l.yscrollcommand(proc{|first,last| s.set(first,last)}) - } - - pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes') - - # Fill the listbox with a list of all the files in the directory (run - # the "ls" command to get that information). - open("|ls -a #{dir}", 'r'){|fid| fid.readlines}.each{|fname| - l.insert('end', fname.chomp) - } - - } - - # Set up bindings for the browser. - base.bind('Control-c', - proc{ - base.destroy - Browse::BROWSE_WIN_COUNTER.value = \ - Browse::BROWSE_WIN_COUNTER.to_i - 1}) - list.bind('Double-Button-1', - proc{TkSelection.get.each{|f| self.browse dir, f}}) - end - - # The method below is invoked to open a browser on a given file; if the - # file is a directory then another instance of this program is invoked; if - # the file is a regular file then the Mx editor is invoked to display - # the file. - def browse (dir, file) - file = dir + File::Separator + file if dir != '.' - type = File.ftype(file) - if type == 'directory' - Browse.new(file) - else - if type == 'file' - if ENV['EDITOR'] - system(ENV['EDITOR'] + ' ' + file + ' &') - else - system('xedit ' + file + ' &') - end - else - STDOUT.print "\"#{file}\" isn't a directory or regular file" - end - end - end - -end - -Browse.new(ARGV[0] ? ARGV[0] : '.') - -TkRoot.new { - withdraw - Browse::BROWSE_WIN_COUNTER.trace('w', proc{exit if Browse::BROWSE_WIN_COUNTER.to_i == 0}) -} - -Tk.mainloop diff --git a/ext/tk/sample/demos-en/button.rb b/ext/tk/sample/demos-en/button.rb deleted file mode 100644 index 6614d99c92..0000000000 --- a/ext/tk/sample/demos-en/button.rb +++ /dev/null @@ -1,84 +0,0 @@ -# button.rb -# -# This demonstration script creates a toplevel window containing -# several button widgets. -# -# button widget demo (called by 'widget') -# - -# toplevel widget -if defined?($button_demo) && $button_demo - $button_demo.destroy - $button_demo = nil -end - -# demo toplevel widget -$button_demo = TkToplevel.new {|w| - title("Button Demonstration") - iconname("button") - positionWindow(w) -} - -# label -msg = TkLabel.new($button_demo) { - font $kanji_font - wraplength '4i' - justify 'left' - text "If you click on any of the four buttons below, the background of the button area will change to the color indicated in the button. You can press Tab to move among the buttons, then press Space to invoke the current button." -} -msg.pack('side'=>'top') - -# frame -$button_buttons = TkFrame.new($button_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $button_demo - $button_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'See Code' - command proc{showCode 'button'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# button -TkButton.new($button_demo){ - text "Peach Puff" - width 10 - command proc{ - $button_demo.configure('bg','PeachPuff1') - $button_buttons.configure('bg','PeachPuff1') - } -}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2) - -TkButton.new($button_demo){ - text "Light Blue" - width 10 - command proc{ - $button_demo.configure('bg','LightBlue1') - $button_buttons.configure('bg','LightBlue1') - } -}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2) - -TkButton.new($button_demo){ - text "Sea Green" - width 10 - command proc{ - $button_demo.configure('bg','SeaGreen2') - $button_buttons.configure('bg','SeaGreen2') - } -}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2) - -TkButton.new($button_demo){ - text "Yellow" - width 10 - command proc{ - $button_demo.configure('bg','Yellow1') - $button_buttons.configure('bg','Yellow1') - } -}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2) diff --git a/ext/tk/sample/demos-en/check.rb b/ext/tk/sample/demos-en/check.rb deleted file mode 100644 index b5def6a89b..0000000000 --- a/ext/tk/sample/demos-en/check.rb +++ /dev/null @@ -1,70 +0,0 @@ -# check.rb -# -# This demonstration script creates a toplevel window containing -# several checkbuttons. -# -# checkbutton widget demo (called by 'widget') -# - -# toplevel widget -if defined?($check_demo) && $check_demo - $check_demo.destroy - $check_demo = nil -end - -# demo toplevel widget -$check_demo = TkToplevel.new {|w| - title("Checkbutton Demonstration") - iconname("check") - positionWindow(w) -} - -# label -msg = TkLabel.new($check_demo) { - font $font - wraplength '4i' - justify 'left' - text "Three checkbuttons are displayed below. If you click on a button, it will toggle the button's selection state and set a Tcl variable to a value indicating the state of the checkbutton. Click the \"See Variables\" button to see the current values of the variables." -} -msg.pack('side'=>'top') - -# -wipers = TkVariable.new(0) -brakes = TkVariable.new(0) -sober = TkVariable.new(0) - -# frame -TkFrame.new($check_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $check_demo - $check_demo = nil - $showVarsWin[tmppath.path] = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'check'} - }.pack('side'=>'left', 'expand'=>'yes') - - - TkButton.new(frame) { - text 'See Variables' - command proc{ - showVars($check_demo, - ['wipers', wipers], ['brakes', brakes], ['sober', sober]) - } - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - - -# checkbutton -[ TkCheckButton.new($check_demo, 'text'=>'Wipers OK', 'variable'=>wipers), - TkCheckButton.new($check_demo, 'text'=>'Brakes OK', 'variable'=>brakes), - TkCheckButton.new($check_demo, 'text'=>'Driver Sober', 'variable'=>sober) -].each{|w| w.relief('flat'); w.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')} - diff --git a/ext/tk/sample/demos-en/clrpick.rb b/ext/tk/sample/demos-en/clrpick.rb deleted file mode 100644 index 72c52a4394..0000000000 --- a/ext/tk/sample/demos-en/clrpick.rb +++ /dev/null @@ -1,77 +0,0 @@ -# clrpick.rb -# -# This demonstration script prompts the user to select a color. -# -# widget demo prompts the user to select a color (called by 'widget') -# - -# toplevel widget -if defined?($clrpick_demo) && $clrpick_demo - $clrpick_demo.destroy - $clrpick_demo = nil -end - -# demo toplevel widget -$clrpick_demo = TkToplevel.new {|w| - title("Color Selection Dialogs") - iconname("colors") - positionWindow(w) -} - -# label -TkLabel.new($clrpick_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left', - 'text'=>"Press the buttons below to choose the foreground and background colors for the widgets in this window.").pack('side'=>'top') - -# frame -TkFrame.new($clrpick_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $clrpick_demo - $clrpick_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'clrpick'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# button -TkButton.new($clrpick_demo, 'text'=>'Set background color ...') {|b| - command(proc{setColor $clrpick_demo, b, 'background', - ['background', 'highlightbackground']}) - pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m') -} - -TkButton.new($clrpick_demo, 'text'=>'Set foreground color ...') {|b| - command(proc{setColor $clrpick_demo, b, 'foreground', ['foreground']}) - pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m') -} - -def setColor(w,button,name,options) - w.grab - initialColor = button[name] - color = Tk.chooseColor('title'=>"Choose a #{name} color", 'parent'=>w, - 'initialcolor'=>initialColor) - if color != "" - setColor_helper(w,options,color) - end - - w.grab('release') -end - -def setColor_helper(w, options, color) - options.each{|opt| - begin - w[opt] = color - rescue - end - } - TkWinfo.children(w).each{|child| - setColor_helper child, options, color - } -end - diff --git a/ext/tk/sample/demos-en/colors.rb b/ext/tk/sample/demos-en/colors.rb deleted file mode 100644 index 66fb0afa36..0000000000 --- a/ext/tk/sample/demos-en/colors.rb +++ /dev/null @@ -1,148 +0,0 @@ -# colors.rb -# -# This demonstration script creates a listbox widget that displays -# many of the colors from the X color database. You can click on -# a color to change the application's palette. -# -# listbox widget demo 'colors' (called by 'widget') -# - -# toplevel widget -if defined?($colors_demo) && $colors_demo - $colors_demo.destroy - $colors_demo = nil -end - -# demo toplevel widget -$colors_demo = TkToplevel.new {|w| - title("Listbox Demonstration (colors)") - iconname("colors") - positionWindow(w) -} - -# label -msg = TkLabel.new($colors_demo) { - font $font - wraplength '4i' - justify 'left' - text "A listbox containing several color names is displayed below, along with a scrollbar. You can scan the list either using the scrollbar or by dragging in the listbox window with button 2 pressed. If you double-click button 1 on a color, then the application's color palette will be set to match that color" -} -msg.pack('side'=>'top') - -# frame -TkFrame.new($colors_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $colors_demo - $colors_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'colors'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame -colors_lbox = nil -TkFrame.new($colors_demo, 'borderwidth'=>10) {|w| - s = TkScrollbar.new(w) - colors_lbox = TkListbox.new(w) { - setgrid 1 - width 10 - height 12 - yscrollcommand proc{|first,last| s.set first,last} - } - s.command(proc{|*args| colors_lbox.yview(*args)}) - s.pack('side'=>'right', 'fill'=>'y') - colors_lbox.pack('side'=>'left', 'expand'=>1, 'fill'=>'both') -}.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y') - -colors_lbox.bind('Double-1', proc{TkPalette.setPalette TkSelection.get}) - -ins_data = [ - 'gray60','gray70','gray80','gray85','gray90','gray95', - 'snow1','snow2','snow3','snow4','seashell1','seashell2', - 'seashell3','seashell4','AntiqueWhite1','AntiqueWhite2', - 'AntiqueWhite3','AntiqueWhite4','bisque1','bisque2', - 'bisque3','bisque4','PeachPuff1','PeachPuff2', - 'PeachPuff3','PeachPuff4','NavajoWhite1','NavajoWhite2', - 'NavajoWhite3','NavajoWhite4','LemonChiffon1', - 'LemonChiffon2','LemonChiffon3','LemonChiffon4', - 'cornsilk1','cornsilk2','cornsilk3','cornsilk4', - 'ivory1','ivory2','ivory3','ivory4','honeydew1', - 'honeydew2','honeydew3','honeydew4','LavenderBlush1', - 'LavenderBlush2','LavenderBlush3','LavenderBlush4', - 'MistyRose1','MistyRose2','MistyRose3','MistyRose4', - 'azure1','azure2','azure3','azure4','SlateBlue1', - 'SlateBlue2','SlateBlue3','SlateBlue4','RoyalBlue1', - 'RoyalBlue2','RoyalBlue3','RoyalBlue4','blue1','blue2', - 'blue3','blue4','DodgerBlue1','DodgerBlue2', - 'DodgerBlue3','DodgerBlue4','SteelBlue1','SteelBlue2', - 'SteelBlue3','SteelBlue4','DeepSkyBlue1','DeepSkyBlue2', - 'DeepSkyBlue3','DeepSkyBlue4','SkyBlue1','SkyBlue2', - 'SkyBlue3','SkyBlue4','LightSkyBlue1','LightSkyBlue2', - 'LightSkyBlue3','LightSkyBlue4','SlateGray1', - 'SlateGray2','SlateGray3','SlateGray4', - 'LightSteelBlue1','LightSteelBlue2','LightSteelBlue3', - 'LightSteelBlue4','LightBlue1','LightBlue2', - 'LightBlue3','LightBlue4','LightCyan1','LightCyan2', - 'LightCyan3','LightCyan4','PaleTurquoise1', - 'PaleTurquoise2','PaleTurquoise3','PaleTurquoise4', - 'CadetBlue1','CadetBlue2','CadetBlue3','CadetBlue4', - 'turquoise1','turquoise2','turquoise3','turquoise4', - 'cyan1','cyan2','cyan3','cyan4','DarkSlateGray1', - 'DarkSlateGray2','DarkSlateGray3','DarkSlateGray4', - 'aquamarine1','aquamarine2','aquamarine3','aquamarine4', - 'DarkSeaGreen1','DarkSeaGreen2','DarkSeaGreen3', - 'DarkSeaGreen4','SeaGreen1','SeaGreen2','SeaGreen3', - 'SeaGreen4','PaleGreen1','PaleGreen2','PaleGreen3', - 'PaleGreen4','SpringGreen1','SpringGreen2', - 'SpringGreen3','SpringGreen4','green1','green2', - 'green3','green4','chartreuse1','chartreuse2', - 'chartreuse3','chartreuse4','OliveDrab1','OliveDrab2', - 'OliveDrab3','OliveDrab4','DarkOliveGreen1', - 'DarkOliveGreen2','DarkOliveGreen3','DarkOliveGreen4', - 'khaki1','khaki2','khaki3','khaki4','LightGoldenrod1', - 'LightGoldenrod2','LightGoldenrod3','LightGoldenrod4', - 'LightYellow1','LightYellow2','LightYellow3', - 'LightYellow4','yellow1','yellow2','yellow3','yellow4', - 'gold1','gold2','gold3','gold4','goldenrod1', - 'goldenrod2','goldenrod3','goldenrod4','DarkGoldenrod1', - 'DarkGoldenrod2','DarkGoldenrod3','DarkGoldenrod4', - 'RosyBrown1','RosyBrown2','RosyBrown3','RosyBrown4', - 'IndianRed1','IndianRed2','IndianRed3','IndianRed4', - 'sienna1','sienna2','sienna3','sienna4','burlywood1', - 'burlywood2','burlywood3','burlywood4','wheat1', - 'wheat2','wheat3','wheat4','tan1','tan2','tan3','tan4', - 'chocolate1','chocolate2','chocolate3','chocolate4', - 'firebrick1','firebrick2','firebrick3','firebrick4', - 'brown1','brown2','brown3','brown4','salmon1','salmon2', - 'salmon3','salmon4','LightSalmon1','LightSalmon2', - 'LightSalmon3','LightSalmon4','orange1','orange2', - 'orange3','orange4','DarkOrange1','DarkOrange2', - 'DarkOrange3','DarkOrange4','coral1','coral2','coral3', - 'coral4','tomato1','tomato2','tomato3','tomato4', - 'OrangeRed1','OrangeRed2','OrangeRed3','OrangeRed4', - 'red1','red2','red3','red4','DeepPink1','DeepPink2', - 'DeepPink3','DeepPink4','HotPink1','HotPink2', - 'HotPink3','HotPink4','pink1','pink2','pink3','pink4', - 'LightPink1','LightPink2','LightPink3','LightPink4', - 'PaleVioletRed1','PaleVioletRed2','PaleVioletRed3', - 'PaleVioletRed4','maroon1','maroon2','maroon3', - 'maroon4','VioletRed1','VioletRed2','VioletRed3', - 'VioletRed4','magenta1','magenta2','magenta3', - 'magenta4','orchid1','orchid2','orchid3','orchid4', - 'plum1','plum2','plum3','plum4','MediumOrchid1', - 'MediumOrchid2','MediumOrchid3','MediumOrchid4', - 'DarkOrchid1','DarkOrchid2','DarkOrchid3', - 'DarkOrchid4','purple1','purple2','purple3','purple4', - 'MediumPurple1','MediumPurple2','MediumPurple3', - 'MediumPurple4','thistle1','thistle2','thistle3', 'thistle4' -] - -colors_lbox.insert(0, *ins_data) diff --git a/ext/tk/sample/demos-en/cscroll.rb b/ext/tk/sample/demos-en/cscroll.rb deleted file mode 100644 index 2f2be60da2..0000000000 --- a/ext/tk/sample/demos-en/cscroll.rb +++ /dev/null @@ -1,134 +0,0 @@ -# cscroll.rb -# -# This demonstration script creates a simple canvas that can be -# scrolled in two dimensions. -# -# simple scrollable canvas widget demo (called by 'widget') -# - -# toplevel widget -if defined?($cscroll_demo) && $cscroll_demo - $cscroll_demo.destroy - $cscroll_demo = nil -end - -# demo toplevel widget -$cscroll_demo = TkToplevel.new {|w| - title("Scrollable Canvas Demonstration") - iconname("cscroll") - positionWindow(w) -} - -# label -TkLabel.new($cscroll_demo, 'font'=>$font, 'wraplength'=>'4i', - 'justify'=>'left', 'text'=>"This window displays a canvas widget that can be scrolled either using the scrollbars or by dragging with button 2 in the canvas. If you click button 1 on one of the rectangles, its indices will be printed on stdout."){ - pack('side'=>'top') -} - -# frame -$cscroll_buttons = TkFrame.new($cscroll_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $cscroll_demo - $cscroll_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'cscroll'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$cscroll_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame -unless $tk_version =~ /^4\.[01]/ - $cscroll_grid = TkFrame.new($cscroll_demo) { - pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1) - } - TkGrid.rowconfigure($cscroll_grid, 0, 'weight'=>1, 'minsize'=>0) - TkGrid.columnconfigure($cscroll_grid, 0, 'weight'=>1, 'minsize'=>0) -end - -# canvas ÀßÄê -$cscroll_canvas = TkCanvas.new($cscroll_demo, - 'relief'=>'sunken', 'borderwidth'=>2, - 'scrollregion'=>['-11c', '-11c', '50c', '20c'] - ) {|c| - if $tk_version =~ /^4\.[01]/ - pack('expand'=>'yes', 'fill'=>'both') - else - grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - end - - TkScrollbar.new($cscroll_demo, 'command'=>proc{|*args| c.yview(*args)}) {|vs| - c.yscrollcommand(proc{|first,last| vs.set first,last}) - if $tk_version =~ /^4\.[01]/ - pack('side'=>'right', 'fill'=>'y') - else - grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - end - } - - TkScrollbar.new($cscroll_demo, 'orient'=>'horiz', - 'command'=>proc{|*args| c.xview(*args)}) {|hs| - c.xscrollcommand(proc{|first,last| hs.set first,last}) - if $tk_version =~ /^4\.[01]/ - pack('side'=>'bottom', 'fill'=>'x') - else - grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - end - } -} - -bg = $cscroll_canvas.configinfo('bg')[4] -(0..19).each{|i| - x = -10+3*i - y = -10 - (0..9).each{|j| - TkcRectangle.new($cscroll_canvas, "#{x}c", "#{y}c", "#{x+2}c", "#{y+2}c", - 'outline'=>'black', 'fill'=>bg, 'tags'=>'rect') - TkcText.new($cscroll_canvas, "#{x+1}c", "#{y+1}c", - 'text'=>"#{i},#{j}", 'anchor'=>'center', 'tags'=>'text') - y += 3 - } -} - -$cscroll_canvas.itembind('all', 'Any-Enter', proc{scrollEnter $cscroll_canvas}) -$cscroll_canvas.itembind('all', 'Any-Leave', proc{scrollLeave $cscroll_canvas}) -$cscroll_canvas.itembind('all', '1', proc{scrollButton $cscroll_canvas}) -$cscroll_canvas.itembind('all', 'Any-Enter', proc{scrollEnter $cscroll_canvas}) -$cscroll_canvas.bind('2', proc{|x,y| $cscroll_canvas.scan_mark(x,y)}, '%x %y') -$cscroll_canvas.bind('B2-Motion', - proc{|x,y| $cscroll_canvas.scan_dragto(x,y)}, '%x %y') - -def scrollEnter(c) - id = c.find_withtag('current')[0].id - id -= 1 if c.gettags('current').include?('text') - $oldFill = c.itemconfiginfo(id, 'fill')[4] - if TkWinfo.depth(c) > 1 - c.itemconfigure(id, 'fill'=>'SeaGreen1') - else - c.itemconfigure(id, 'fill'=>'black') - c.itemconfigure(id+1, 'fill'=>'white') - end -end - -def scrollLeave(c) - id = c.find_withtag('current')[0].id - id -= 1 if c.gettags('current').include?('text') - c.itemconfigure(id, 'fill'=>$oldFill) - c.itemconfigure(id+1, 'fill'=>'black') -end - -def scrollButton(c) - id = c.find_withtag('current')[0].id - id += 1 unless c.gettags('current').include?('text') - print "You buttoned at #{c.itemconfiginfo(id,'text')[4]}\n" -end - diff --git a/ext/tk/sample/demos-en/ctext.rb b/ext/tk/sample/demos-en/ctext.rb deleted file mode 100644 index 13f8de7218..0000000000 --- a/ext/tk/sample/demos-en/ctext.rb +++ /dev/null @@ -1,186 +0,0 @@ -# ctext.rb -# -# This demonstration script creates a canvas widget with a text -# item that can be edited and reconfigured in various ways. -# -# Canvas Text widget demo (called by 'widget') -# - -# toplevel widget -if defined?($ctext_demo) && $ctext_demo - $ctext_demo.destroy - $ctext_demo = nil -end - -# demo toplevel widget -$ctext_demo = TkToplevel.new {|w| - title("Canvas Text Demonstration") - iconname("Text") - positionWindow(w) -} - -# label -TkLabel.new($ctext_demo, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', - 'text'=>"This window displays a string of text to demonstrate the text facilities of canvas widgets. You can click in the boxes to adjust the position of the text relative to its positioning point or change its justification. The text also supports the following simple bindings for editing: - 1. You can point, click, and type. - 2. You can also select with button 1. - 3. You can copy the selection to the mouse position with button 2. - 4. Backspace and Control+h delete the selection if there is one; - otherwise they delete the character just before the insertion cursor. - 5. Delete deletes the selection if there is one; otherwise it deletes - the character just after the insertion cursor."){ - pack('side'=>'top') -} - -# frame -$ctext_buttons = TkFrame.new($ctext_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $ctext_demo - $ctext_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'ctext'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$ctext_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# canvas -$ctext_canvas = TkCanvas.new($ctext_demo, 'relief'=>'flat', - 'borderwidth'=>0, 'width'=>500, 'height'=>350) -$ctext_canvas.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'both') - -# font -textFont = '-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*' - -# canvas -TkcRectangle.new($ctext_canvas, 245, 195, 255, 205, - 'outline'=>'black', 'fill'=>'red') - -$ctag_text = TkcTag.new($ctext_canvas) -$ctag_text.withtag(TkcText.new($ctext_canvas, 250, 200, - 'text'=>"This is just a string of text to demonstrate the text facilities of canvas widgets. Bindings have been been defined to support editing (see above).", - 'width'=>440, 'anchor'=>'n', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*', - 'kanjifont'=>'-*--24-*-jisx0208.1983-0', - 'justify'=>'left') ) - -$ctag_text.bind('1', proc{|x,y| textB1Press $ctext_canvas,x,y}, "%x %y") -$ctag_text.bind('B1-Motion', proc{|x,y| textB1Move $ctext_canvas,x,y}, "%x %y") -$ctag_text.bind('Shift-1', - proc{|x,y| $ctext_canvas.seleect_adjust 'current', "@#{x},#{y}"}, - "%x %y") -$ctag_text.bind('Shift-B1-Motion', - proc{|x,y| textB1Move $ctext_canvas,x,y}, "%x %y") -$ctag_text.bind('KeyPress', proc{|a| textInsert $ctext_canvas,a}, "%A") -$ctag_text.bind('Return', proc{textInsert $ctext_canvas,"\n"}) -$ctag_text.bind('Control-h', proc{textBs $ctext_canvas}) -$ctag_text.bind('BackSpace', proc{textBs $ctext_canvas}) -$ctag_text.bind('Delete', proc{textDel $ctext_canvas}) -$ctag_text.bind('2', proc{|x,y| textPaste $ctext_canvas, "@#{x},#{y}"}, - "%x %y") - -# Next, create some items that allow the text's anchor position -# to be edited. - -def mkTextConfig(w,x,y,option,value,color) - item = TkcRectangle.new(w, x, y, x+30, y+30, - 'outline'=>'black', 'fill'=>color, 'width'=>1) - item.bind('1', proc{$ctag_text.configure option, value}) - w.addtag_withtag('config', item) -end - -x = 50 -y = 50 -color = 'LightSkyBlue1' -mkTextConfig $ctext_canvas, x, y, 'anchor', 'se', color -mkTextConfig $ctext_canvas, x+30, y, 'anchor', 's', color -mkTextConfig $ctext_canvas, x+60, y, 'anchor', 'sw', color -mkTextConfig $ctext_canvas, x, y+30, 'anchor', 'e', color -mkTextConfig $ctext_canvas, x+30, y+30, 'anchor', 'center', color -mkTextConfig $ctext_canvas, x+60, y+30, 'anchor', 'w', color -mkTextConfig $ctext_canvas, x, y+60, 'anchor', 'ne', color -mkTextConfig $ctext_canvas, x+30, y+60, 'anchor', 'n', color -mkTextConfig $ctext_canvas, x+60, y+60, 'anchor', 'nw', color -item = TkcRectangle.new($ctext_canvas, x+40, y+40, x+50, y+50, - 'outline'=>'black', 'fill'=>'red') -item.bind('1', proc{$ctag_text.configure 'anchor', 'center'}) -TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position', 'anchor'=>'s', - 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', - 'fill'=>'brown') - -# Lastly, create some items that allow the text's justification to be -# changed. - -x = 350 -y = 50 -color = 'SeaGreen2' -mkTextConfig $ctext_canvas, x, y, 'justify', 'left', color -mkTextConfig $ctext_canvas, x+30, y, 'justify', 'center', color -mkTextConfig $ctext_canvas, x+60, y, 'justify', 'right', color -TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Justification', 'anchor'=>'s', - 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', - 'fill'=>'brown') - -$ctext_canvas.itembind('config', 'Enter', proc{textEnter $ctext_canvas}) -$ctext_canvas.itembind('config', 'Leave', - proc{$ctext_canvas\ - .itemconfigure('current', - 'fill'=>$textConfigFill)}) - -$textConfigFill = '' - -def textEnter(w) - $textConfigFill = (w.itemconfiginfo 'current', 'fill')[4] - w.itemconfigure 'current', 'fill', 'black' -end - -def textInsert(w, string) - return if string == "" - begin - $ctag_text.dchars 'sel.first', 'sel.last' - rescue - end - $ctag_text.insert 'insert', string -end - -def textPaste(w, pos) - begin - $ctag_text.insert pos, TkSelection.get - rescue - end -end - -def textB1Press(w,x,y) - w.icursor 'current', "@#{x},#{y}" - w.itemfocus 'current' - w.focus - w.select_from 'current', "@#{x},#{y}" -end - -def textB1Move(w,x,y) - w.select_to 'current', "@#{x},#{y}" -end - -def textBs(w) - begin - $ctag_text.dchars 'sel.first', 'sel.last' - rescue - char = $ctag_text.index('insert').to_i - 1 - $ctag_text.dchars(char) if char >= 0 - end -end - -def textDel(w) - begin - $ctag_text.dchars 'sel.first', 'sel.last' - rescue - $ctag_text.dchars 'insert' - end -end - diff --git a/ext/tk/sample/demos-en/dialog1.rb b/ext/tk/sample/demos-en/dialog1.rb deleted file mode 100644 index 374fedc985..0000000000 --- a/ext/tk/sample/demos-en/dialog1.rb +++ /dev/null @@ -1,38 +0,0 @@ -# -# a dialog box with a local grab (called by 'widget') -# -class TkDialog_Demo1 < TkDialog - ############### - private - ############### - def title - "Dialog with local grab" - end - - def message - 'This is a modal dialog box. It uses Tk\'s "grab" command to create a "local grab" on the dialog box. The grab prevents any pointer-related events from getting to any other windows in the application until you have answered the dialog by invoking one of the buttons below. However, you can still interact with other applications.' - end - - def bitmap - 'info' - end - - def default_button - 0 - end - - def buttons - ["Dismiss", "", "Show Code"] - ["OK", "Cancel", "Show Code"] - end -end - -ret = TkDialog_Demo1.new('message_config'=>{'wraplength'=>'4i'}).value -case ret -when 0 - print "You pressed OK\n" -when 1 - print "You pressed Cancel\n" -when 2 - showCode 'dialog1' -end diff --git a/ext/tk/sample/demos-en/dialog2.rb b/ext/tk/sample/demos-en/dialog2.rb deleted file mode 100644 index 21bf25c88d..0000000000 --- a/ext/tk/sample/demos-en/dialog2.rb +++ /dev/null @@ -1,41 +0,0 @@ -# -# a dialog box with a global grab (called by 'widget') -# -class TkDialog_Demo2 < TkDialog - ############### - private - ############### - def title - "Dialog with global grab" - end - - def message - "This dialog box uses a global grab, so it prevents you from interacting with anything on your display until you invoke one of the buttons below. Global grabs are almost always a bad idea; don't use them unless you're truly desperate." - end - - def bitmap - 'info' - end - - def default_button - 0 - end - - def buttons - ["OK", "Cancel", "Show Code"] - end -end - -ret = TkDialog_Demo2.new('message_config'=>{'wraplength'=>'4i'}, - 'prev_command'=>proc{|dialog| - Tk.after 100, proc{dialog.grab('global')} - }).value -case ret -when 0 - print "\You pressed OK\n" -when 1 - print "You pressed Cancel\n" -when 2 - showCode 'dialog2' -end - diff --git a/ext/tk/sample/demos-en/doc.org/README b/ext/tk/sample/demos-en/doc.org/README deleted file mode 100644 index 90677d3316..0000000000 --- a/ext/tk/sample/demos-en/doc.org/README +++ /dev/null @@ -1,7 +0,0 @@ -This directory contains a collection of demonstration programs that -are translated into Japanese. You need to use a Japanized "wish" to -see these Japanese-translated demonstration programs. You also need -to put this directory ("demos.jp") at the next to "demos" since some -of the programs refer to the image files at "demos". - -Please refer to the README file at "demos" for more detail. diff --git a/ext/tk/sample/demos-en/doc.org/README.JP b/ext/tk/sample/demos-en/doc.org/README.JP deleted file mode 100644 index 42b4929378..0000000000 --- a/ext/tk/sample/demos-en/doc.org/README.JP +++ /dev/null @@ -1,14 +0,0 @@ -This directory contains "widget" demo for the Japanized Tcl7.6/Tk4.2. -Most of the messages in the original are translated to Japanese. -But other tools in this directory are not translated. - -Following 2 kanji fonts are defined at the beginning of the file "widget." - - -*--24-*-jisx0208.1983-0 - -*--16-*-jisx0208.1983-0 - -These fonts are all part of the core distribution of X11R5, so -if you are running X11R5, you don't have to modify the file. - -But if you don't have these fonts, replace them with appropriate ones. -"-*--14-*-jisx0208.1983-0" will be a good choice. diff --git a/ext/tk/sample/demos-en/doc.org/README.tk80 b/ext/tk/sample/demos-en/doc.org/README.tk80 deleted file mode 100644 index c71f977d74..0000000000 --- a/ext/tk/sample/demos-en/doc.org/README.tk80 +++ /dev/null @@ -1,46 +0,0 @@ -This directory contains a collection of programs to demonstrate -the features of the Tk toolkit. The programs are all scripts for -"wish", a windowing shell. If wish has been installed in /usr/local -then you can invoke any of the programs in this directory just -by typing its file name to your command shell. Otherwise invoke -wish with the file as its first argument, e.g., "wish hello". -The rest of this file contains a brief description of each program. -Files with names ending in ".tcl" are procedure packages used by one -or more of the demo programs; they can't be used as programs by -themselves so they aren't described below. - -hello - Creates a single button; if you click on it, a message - is typed and the application terminates. - -widget - Contains a collection of demonstrations of the widgets - currently available in the Tk library. Most of the .tcl - files are scripts for individual demos available through - the "widget" program. - -ixset - A simple Tk-based wrapper for the "xset" program, which - allows you to interactively query and set various X options - such as mouse acceleration and bell volume. Thanks to - Pierre David for contributing this example. - -rolodex - A mock-up of a simple rolodex application. It has much of - the user interface for such an application but no back-end - database. This program was written in response to Tom - LaStrange's toolkit benchmark challenge. - -tcolor - A color editor. Allows you to edit colors in several - different ways, and will also perform automatic updates - using "send". - -rmt - Allows you to "hook-up" remotely to any Tk application - on the display. Select an application with the menu, - then just type commands: they'll go to that application. - -timer - Displays a seconds timer with start and stop buttons. - Control-c and control-q cause it to exit. - -browse - A simple directory browser. Invoke it with and argument - giving the name of the directory you'd like to browse. - Double-click on files or subdirectories to browse them. - Control-c and control-q cause the program to exit. - -sccs id = SCCS: @(#) README 1.3 96/02/16 10:49:14 diff --git a/ext/tk/sample/demos-en/doc.org/license.terms b/ext/tk/sample/demos-en/doc.org/license.terms deleted file mode 100644 index 03ca6fcb31..0000000000 --- a/ext/tk/sample/demos-en/doc.org/license.terms +++ /dev/null @@ -1,39 +0,0 @@ -This software is copyrighted by the Regents of the University of -California, Sun Microsystems, Inc., and other parties. The following -terms apply to all files associated with the software unless explicitly -disclaimed in individual files. - -The authors hereby grant permission to use, copy, modify, distribute, -and license this software and its documentation for any purpose, provided -that existing copyright notices are retained in all copies and that this -notice is included verbatim in any distributions. No written agreement, -license, or royalty fee is required for any of the authorized uses. -Modifications to this software may be copyrighted by their authors -and need not follow the licensing terms described here, provided that -the new terms are clearly indicated on the first page of each file where -they apply. - -IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -MODIFICATIONS. - -GOVERNMENT USE: If you are acquiring this software on behalf of the -U.S. government, the Government shall have only "Restricted Rights" -in the software and related documentation as defined in the Federal -Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you -are acquiring the software on behalf of the Department of Defense, the -software shall be classified as "Commercial Computer Software" and the -Government shall have only "Restricted Rights" as defined in Clause -252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the -authors grant the U.S. Government and others acting in its behalf -permission to use and distribute the software in accordance with the -terms specified in this license. diff --git a/ext/tk/sample/demos-en/doc.org/license.terms.tk80 b/ext/tk/sample/demos-en/doc.org/license.terms.tk80 deleted file mode 100644 index 03ca6fcb31..0000000000 --- a/ext/tk/sample/demos-en/doc.org/license.terms.tk80 +++ /dev/null @@ -1,39 +0,0 @@ -This software is copyrighted by the Regents of the University of -California, Sun Microsystems, Inc., and other parties. The following -terms apply to all files associated with the software unless explicitly -disclaimed in individual files. - -The authors hereby grant permission to use, copy, modify, distribute, -and license this software and its documentation for any purpose, provided -that existing copyright notices are retained in all copies and that this -notice is included verbatim in any distributions. No written agreement, -license, or royalty fee is required for any of the authorized uses. -Modifications to this software may be copyrighted by their authors -and need not follow the licensing terms described here, provided that -the new terms are clearly indicated on the first page of each file where -they apply. - -IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -MODIFICATIONS. - -GOVERNMENT USE: If you are acquiring this software on behalf of the -U.S. government, the Government shall have only "Restricted Rights" -in the software and related documentation as defined in the Federal -Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you -are acquiring the software on behalf of the Department of Defense, the -software shall be classified as "Commercial Computer Software" and the -Government shall have only "Restricted Rights" as defined in Clause -252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the -authors grant the U.S. Government and others acting in its behalf -permission to use and distribute the software in accordance with the -terms specified in this license. diff --git a/ext/tk/sample/demos-en/entry1.rb b/ext/tk/sample/demos-en/entry1.rb deleted file mode 100644 index 29bc693395..0000000000 --- a/ext/tk/sample/demos-en/entry1.rb +++ /dev/null @@ -1,56 +0,0 @@ -# -# entry (no scrollbars) widget demo (called by 'widget') -# - -# toplevel widget -if defined?($entry1_demo) && $entry1_demo - $entry1_demo.destroy - $entry1_demo = nil -end - -# demo toplevel widget -$entry1_demo = TkToplevel.new {|w| - title("Entry Demonstration (no scrollbars)") - iconname("entry1") - positionWindow(w) -} - -# label -msg = TkLabel.new($entry1_demo) { - font $font - wraplength '5i' - justify 'left' - text "Three different entries are displayed below. You can add characters by pointing, clicking and typing. The normal Motif editing characters are supported, along with many Emacs bindings. For example, Backspace and Control-h delete the character to the left of the insertion cursor and Delete and Control-d delete the chararacter to the right of the insertion cursor. For entries that are too large to fit in the window all at once, you can scan through the entries by dragging with mouse button2 pressed." -} -msg.pack('side'=>'top') - -# frame -TkFrame.new($entry1_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $entry1_demo - $entry1_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'entry1'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# -e1 = TkEntry.new($entry1_demo, 'relief'=>'sunken') -e2 = TkEntry.new($entry1_demo, 'relief'=>'sunken') -e3 = TkEntry.new($entry1_demo, 'relief'=>'sunken') -[e1,e2,e3].each{|w| w.pack('side'=>'top', 'padx'=>10, 'pady'=>5, 'fill'=>'x')} - -# -e1.insert(0, 'Initial value') -e2.insert('end', "This entry contains a long value, much too long ") -e2.insert('end', "to fit in the window at one time, so long in fact ") -e2.insert('end', "that you'll have to scan or scroll to see the end.") -e2.insert('end', "") - diff --git a/ext/tk/sample/demos-en/entry2.rb b/ext/tk/sample/demos-en/entry2.rb deleted file mode 100644 index d4e58d7dd5..0000000000 --- a/ext/tk/sample/demos-en/entry2.rb +++ /dev/null @@ -1,91 +0,0 @@ -# entry2.rb -# -# This demonstration script is the same as the entry1.tcl script -# except that it creates scrollbars for the entries. -# -# entry (with scrollbars) widget demo (called by 'widget') -# - -# toplevel widget -if defined?($entry2_demo) && $entry2_demo - $entry2_demo.destroy - $entry2_demo = nil -end - -# demo toplevel widget -$entry2_demo = TkToplevel.new {|w| - title("Entry Demonstration (with scrollbars)") - iconname("entry2") - positionWindow(w) -} - -# label -msg = TkLabel.new($entry2_demo) { - font $font - wraplength '5i' - justify 'left' - text "Three different entries are displayed below, with a scrollbar for each entry. You can add characters by pointing, clicking and typing. The normal Motif editing characters are supported, along with many Emacs bindings. For example, Backspace and Control-h delete the character to the left of the insertion cursor and Delete and Control-d delete the chararacter to the right of the insertion cursor. For entries that are too large to fit in the window all at once, you can scan through the entries with the scrollbars, or by dragging with mouse button2 pressed." -} -msg.pack('side'=>'top') - -# frame -TkFrame.new($entry2_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $entry2_demo - $entry2_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'entry2'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame -TkFrame.new($entry2_demo, 'borderwidth'=>10) {|w| - # entry 1 - s1 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz') - e1 = TkEntry.new(w, 'relief'=>'sunken') { - xscrollcommand proc{|first,last| s1.set first,last} - } - s1.command(proc{|*args| e1.xview(*args)}) - e1.pack('side'=>'top', 'fill'=>'x') - s1.pack('side'=>'top', 'fill'=>'x') - - # spacer - TkFrame.new(w, 'width'=>20, 'height'=>10).pack('side'=>'top', 'fill'=>'x') - - # entry 2 - s2 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz') - e2 = TkEntry.new(w, 'relief'=>'sunken') { - xscrollcommand proc{|first,last| s2.set first,last} - } - s2.command(proc{|*args| e2.xview(*args)}) - e2.pack('side'=>'top', 'fill'=>'x') - s2.pack('side'=>'top', 'fill'=>'x') - - # spacer - TkFrame.new(w, 'width'=>20, 'height'=>10).pack('side'=>'top', 'fill'=>'x') - - # entry 3 - s3 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz') - e3 = TkEntry.new(w, 'relief'=>'sunken') { - xscrollcommand proc{|first,last| s3.set first,last} - } - s3.command(proc{|*args| e3.xview(*args)}) - e3.pack('side'=>'top', 'fill'=>'x') - s3.pack('side'=>'top', 'fill'=>'x') - - # - e1.insert(0, 'Initial value') - e2.insert('end', "This entry contains a long value, much too long ") - e2.insert('end', "to fit in the window at one time, so long in fact ") - e2.insert('end', "that you'll have to scan or scroll to see the end.") - e2.insert('end', "") - -}.pack('side'=>'top', 'fill'=>'x', 'expand'=>'yes') - diff --git a/ext/tk/sample/demos-en/entry3.rb b/ext/tk/sample/demos-en/entry3.rb deleted file mode 100644 index 44f788225c..0000000000 --- a/ext/tk/sample/demos-en/entry3.rb +++ /dev/null @@ -1,198 +0,0 @@ -# entry3.rb -- -# -# This demonstration script creates several entry widgets whose -# permitted input is constrained in some way. It also shows off a -# password entry. -# -# based on Tcl/Tk8.4.4 widget demos - -if defined?($entry3_demo) && $entry3_demo - $entry3_demo.destroy - $entry3_demo = nil -end - -$entry3_demo = TkToplevel.new {|w| - title("Constrained Entry Demonstration") - iconname("entry3") - positionWindow(w) -} - -TkLabel.new($entry3_demo, - :font=>$font, :wraplength=>'5i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) -Four different entries are displayed below. You can add characters \ -by pointing, clicking and typing, though each is constrained in what \ -it will accept. The first only accepts integers or the empty string \ -(checking when focus leaves it) and will flash to indicate any \ -problem. The second only accepts strings with fewer than ten \ -characters and sounds the bell when an attempt to go over the limit \ -is made. The third accepts US phone numbers, mapping letters to \ -their digit equivalent and sounding the bell on encountering an \ -illegal character or if trying to type over a character that is not \ -a digit. The fourth is a password field that accepts up to eight \ -characters (silently ignoring further ones), and displaying them as \ -asterisk characters. -EOL - -TkFrame.new($entry3_demo){|f| - pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - - TkButton.new(f, :text=>'Dismiss', :width=>15, :command=>proc{ - $entry3_demo.destroy - $entry3_demo = nil - }).pack(:side=>:left, :expand=>true) - - TkButton.new(f, :text=>'See Code', :width=>15, :command=>proc{ - showCode 'entry3' - }).pack(:side=>:left, :expand=>true) -} - -# focusAndFlash -- -# Error handler for entry widgets that forces the focus onto the -# widget and makes the widget flash by exchanging the foreground and -# background colours at intervals of 200ms (i.e. at approximately -# 2.5Hz). -# -# Arguments: -# widget - entry widget to flash -# fg - Initial foreground colour -# bg - Initial background colour -# count - Counter to control the number of times flashed -def focusAndFlash(widget, fg, bg, count=5) - return if count <= 0 - TkTimer.new(200, count, - proc{widget.configure(:foreground=>bg, :background=>fg)}, - proc{widget.configure(:foreground=>fg, :background=>bg)} - ).start - widget.focus(true) -end - -l1 = TkLabelFrame.new($entry3_demo, :text=>"Integer Entry") -TkEntry.new(l1, :validate=>:focus, - :vcmd=>[ - proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P' - ]) {|e| - invalidcommand [proc{|w| focusAndFlash(w, e.fg, e.bg)}, '%W'] - pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') -} - -l2 = TkLabelFrame.new($entry3_demo, :text=>"Length-Constrained Entry") -TkEntry.new(l2, :validate=>:key, :invcmd=>proc{Tk.bell}, - :vcmd=>[proc{|s| s.length < 10}, '%P'] - ).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') - -### PHONE NUMBER ENTRY ### -# Note that the source to this is quite a bit longer as the behaviour -# demonstrated is a lot more ambitious than with the others. - -# Initial content for the third entry widget -entry3content = TkVariable.new("1-(000)-000-0000") - -# Mapping from alphabetic characters to numbers. -$phoneNumberMap = {} -Hash[*(%w(abc 2 def 3 ghi 4 jkl 5 mno 6 pqrs 7 tuv 8 wxyz 9))].each{|chars, n| - chars.split('').each{|c| - $phoneNumberMap[c] = n - $phoneNumberMap[c.upcase] = n - } -} - -# phoneSkipLeft -- -# Skip over fixed characters in a phone-number string when moving left. -# -# Arguments: -# widget - The entry widget containing the phone-number. -def phoneSkipLeft(widget) - idx = widget.index('insert') - if idx == 8 - # Skip back two extra characters - widget.cursor = idx - 2 - elsif idx == 7 || idx == 12 - # Skip back one extra character - widget.cursor = idx - 1 - elsif idx <= 3 - # Can't move any further - Tk.bell - Tk.callback_break - end -end - -# phoneSkipRight -- -# Skip over fixed characters in a phone-number string when moving right. -# -# Arguments: -# widget - The entry widget containing the phone-number. -# add - Offset to add to index before calculation (used by validation.) -def phoneSkipRight(widget, add = 0) - idx = widget.index('insert') - if (idx + add == 5) - # Skip forward two extra characters - widget.cursor = idx + 2 - elsif (idx + add == 6 || idx + add == 10) - # Skip forward one extra character - widget.cursor = idx + 1 - elsif (idx + add == 15 && add == 0) - # Can't move any further - Tk.bell - Tk.callback_break - end -end - -# validatePhoneChange -- -# Checks that the replacement (mapped to a digit) of the given -# character in an entry widget at the given position will leave a -# valid phone number in the widget. -# -# widget - entry widget to validate -# vmode - The widget's validation mode -# idx - The index where replacement is to occur -# char - The character (or string, though that will always be -# refused) to be overwritten at that point. - -def validatePhoneChange(widget, vmode, idx, char) - return true if idx == nil - Tk.after_idle(proc{widget.configure(:validate=>vmode, - :invcmd=>proc{Tk.bell})}) - if !(idx<3 || idx==6 || idx==7 || idx==11 || idx>15) && char =~ /[0-9A-Za-z]/ - widget.delete(idx) - widget.insert(idx, $phoneNumberMap[char] || char) - Tk.after_idle(proc{phoneSkipRight(widget, -1)}) - return true - end - return false -end - - -l3 = TkLabelFrame.new($entry3_demo, :text=>"US Phone-Number Entry") -TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell}, - :textvariable=>entry3content, - :vcmd=>[ - proc{|w,v,i,s| validatePhoneChange(w,v,i,s)}, - "%W %v %i %S" - ]){|e| - # Click to focus goes to the first editable character... - bind('FocusIn', proc{|d,w| - if d != "NotifyAncestor" - w.cursor = 3 - Tk.after_idle(proc{w.selection_clear}) - end - }, '%d %W') - bind('Left', proc{|w| phoneSkipLeft(w)}, '%W') - bind('Right', proc{|w| phoneSkipRight(w)}, '%W') - pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') -} - -l4 = TkLabelFrame.new($entry3_demo, :text=>"Password Entry") -TkEntry.new(l4, :validate=>:key, :show=>'*', - :vcmd=>[ - proc{|s| s.length <= 8}, - '%P' - ]).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') - -TkFrame.new($entry3_demo){|f| - lower - TkGrid.configure(l1, l2, :in=>f, :padx=>'3m', :pady=>'1m', :sticky=>:ew) - TkGrid.configure(l3, l4, :in=>f, :padx=>'3m', :pady=>'1m', :sticky=>:ew) - TkGrid.columnconfigure(f, [0,1], :uniform=>1) - pack(:fill=>:both, :expand=>true) -} diff --git a/ext/tk/sample/demos-en/filebox.rb b/ext/tk/sample/demos-en/filebox.rb deleted file mode 100644 index 7caaaf0ede..0000000000 --- a/ext/tk/sample/demos-en/filebox.rb +++ /dev/null @@ -1,97 +0,0 @@ -# filebox.rb -# -# This demonstration script prompts the user to select a file.# -# widget demo prompts the user to select a file (called by 'widget') -# - -# toplevel widget -if defined?($filebox_demo) && $filebox_demo - $filebox_demo.destroy - $filebox_demo = nil -end - -# demo toplevel widget -$filebox_demo = TkToplevel.new {|w| - title("File Selection Dialogs") - iconname("filebox") - positionWindow(w) -} - -# label -TkLabel.new($filebox_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left', - 'text'=>"Enter a file name in the entry box or click on the \"Browse\" buttons to select a file name using the file selection dialog.").pack('side'=>'top') - -# frame -TkFrame.new($filebox_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $filebox_demo - $filebox_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'filebox'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame -['open', 'save'].each{|type| - TkFrame.new($filebox_demo) {|f| - TkLabel.new(f, 'text'=>"Select a file to #{type}: ", 'anchor'=>'e')\ - .pack('side'=>'left') - - TkEntry.new(f, 'width'=>20) {|e| - pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x') - - TkButton.new(f, 'text'=>'Browse ...', - 'command'=>proc{fileDialog $filebox_demo,e,type})\ - .pack('side'=>'left') - } - - pack('fill'=>'x', 'padx'=>'1c', 'pady'=>3) - } -} - -$tk_strictMotif = TkVarAccess.new('tk_strictMotif') -if ($tk_platform['platform'] == 'unix') - TkCheckButton.new($filebox_demo, - 'text'=>'Use Motif Style Dialog', - 'variable'=>$tk_strictMotif, - 'onvalue'=>1, 'offvalue'=>0 ).pack('anchor'=>'c') -end - -def fileDialog(w,ent,operation) - # Type names Extension(s) Mac File Type(s) - # - #-------------------------------------------------------- - types = [ - ['Text files', ['.txt','.doc'] ], - ['Text files', [], 'TEXT' ], - ['Ruby Scripts', ['.rb'], 'TEXT' ], - ['Tcl Scripts', ['.tcl'], 'TEXT' ], - ['C Source Files', ['.c','.h'] ], - ['All Source Files', ['.rb','.tcl','.c','.h'] ], - ['Image Files', ['.gif'] ], - ['Image Files', ['.jpeg','.jpg'] ], - ['Image Files', [], ['GIFF','JPEG']], - ['All files', '*' ] - ] - - if operation == 'open' - file = Tk.getOpenFile('filetypes'=>types, 'parent'=>w) - else - file = Tk.getSaveFile('filetypes'=>types, 'parent'=>w, - 'initialfile'=>'Untitled', - 'defaultextension'=>'.txt') - end - if file != "" - ent.delete 0, 'end' - ent.insert 0, file - ent.xview 'end' - end -end - diff --git a/ext/tk/sample/demos-en/floor.rb b/ext/tk/sample/demos-en/floor.rb deleted file mode 100644 index db4d59fe73..0000000000 --- a/ext/tk/sample/demos-en/floor.rb +++ /dev/null @@ -1,1721 +0,0 @@ -# floor.rb -# -# This demonstration script creates a canvas widet that displays the -# floorplan for DEC's Western Research Laboratory. -# -# floorDisplay widget demo (called by 'widget') -# - -# floorDisplay -- -# Recreate the floorplan display in the canvas given by "w". The -# floor given by "active" is displayed on top with its office structure -# visible. -# -# Arguments: -# w - Name of the canvas window. -# active - Number of active floor (1, 2, or 3). - -def floorDisplay(w,active) - return if $activeFloor == active - - w.delete('all') - $activeFloor = active - - # First go through the three floors, displaying the backgrounds for - # each floor. - - floor_bg1(w,$floor_colors['bg1'],$floor_colors['outline1']) - floor_bg2(w,$floor_colors['bg2'],$floor_colors['outline2']) - floor_bg3(w,$floor_colors['bg3'],$floor_colors['outline3']) - - # Raise the background for the active floor so that it's on top. - - w.raise("floor#{active}") - - # Create a dummy item just to mark this point in the display list, - # so we can insert highlights here. - - TkcRectangle.new(w,0,100,1,101, 'fill'=>'', 'outline'=>'', 'tags'=>'marker') - - # Add the walls and labels for the active floor, along with - # transparent polygons that define the rooms on the floor. - # Make sure that the room polygons are on top. - - $floorLabels.clear - $floorItems.clear - send("floor_fg#{active}", w, $floor_colors['offices']) - w.raise('room') - - # Offset the floors diagonally from each other. - - w.move('floor1', '2c', '2c') - w.move('floor2', '1c', '1c') - - # Create items for the room entry and its label. - TkcWindow.new(w, 600, 100, 'anchor'=>'w', 'window'=>$floor_entry) - TkcText.new(w, 600, 100, 'anchor'=>'e', 'text'=>"Room: ") - w['scrollregion'] = w.bbox('all') -end - -# newRoom -- -# This method is invoked whenever the mouse enters a room -# in the floorplan. It changes tags so that the current room is -# highlighted. -# -# Arguments: -# w - The name of the canvas window. - -def newRoom(w) - id = w.find_withtag('current')[0] - $currentRoom.value = $floorLabels[id.id] if id != "" - Tk.update(true) -end - -# roomChanged -- -# This method is invoked whenever the currentRoom variable changes. -# It highlights the current room and unhighlights any previous room. -# -# Arguments: -# w - The canvas window displaying the floorplan. -# args - Not used. - -def roomChanged(w,*args) - w.delete('highlight') - item = $floorItems[$currentRoom.value] - return if item == nil - new = TkcPolygon.new(w, *(w.coords(item))) - new.configure('fill'=>$floor_colors['active'], 'tags'=>'highlight') - w.raise(new, 'marker') -end - -# floor_bg1 -- -# This method represents part of the floorplan database. When -# invoked, it instantiates the background information for the first -# floor. -# -# Arguments: -# w - The canvas window. -# fill - Fill color to use for the floor's background. -# outline - Color to use for the floor's outline. - -def floor_bg1(w,fill,outline) - TkcPolygon.new(w,347,80,349,82,351,84,353,85,363,92,375,99,386,104, - 386,129,398,129,398,162,484,162,484,129,559,129,559,133,725, - 133,725,129,802,129,802,389,644,389,644,391,559,391,559,327, - 508,327,508,311,484,311,484,278,395,278,395,288,400,288,404, - 288,409,290,413,292,418,297,421,302,422,309,421,318,417,325, - 411,330,405,332,397,333,344,333,340,334,336,336,335,338,332, - 342,331,347,332,351,334,354,336,357,341,359,340,360,335,363, - 331,365,326,366,304,366,304,355,258,355,258,387,60,387,60,391, - 0,391,0,337,3,337,3,114,8,114,8,25,30,25,30,5,93,5,98,5,104,7, - 110,10,116,16,119,20,122,28,123,32,123,68,220,68,220,34,221, - 22,223,17,227,13,231,8,236,4,242,2,246,0,260,0,283,1,300,5, - 321,14,335,22,348,25,365,29,363,39,358,48,352,56,337,70, - 344,76,347,80, 'tags'=>['floor1','bg'], 'fill'=>fill) - TkcLine.new(w,386,129,398,129, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,258,355,258,387, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,60,387,60,391, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,0,337,0,391, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,60,391,0,391, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,3,114,3,337, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,258,387,60,387, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,484,162,398,162, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,398,162,398,129, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,484,278,484,311, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,484,311,508,311, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,508,327,508,311, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,559,327,508,327, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,644,391,559,391, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,644,389,644,391, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,559,129,484,129, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,484,162,484,129, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,725,133,559,133, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,559,129,559,133, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,725,129,802,129, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,802,389,802,129, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,3,337,0,337, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,559,391,559,327, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,802,389,644,389, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,725,133,725,129, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,8,25,8,114, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,8,114,3,114, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,30,25,8,25, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,484,278,395,278, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,30,25,30,5, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,93,5,30,5, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,98,5,93,5, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,104,7,98,5, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,110,10,104,7, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,116,16,110,10, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,119,20,116,16, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,122,28,119,20, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,123,32,122,28, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,123,68,123,32, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,220,68,123,68, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,386,129,386,104, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,386,104,375,99, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,375,99,363,92, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,353,85,363,92, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,220,68,220,34, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,337,70,352,56, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,352,56,358,48, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,358,48,363,39, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,363,39,365,29, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,365,29,348,25, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,348,25,335,22, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,335,22,321,14, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,321,14,300,5, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,300,5,283,1, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,283,1,260,0, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,260,0,246,0, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,246,0,242,2, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,242,2,236,4, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,236,4,231,8, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,231,8,227,13, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,223,17,227,13, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,221,22,223,17, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,220,34,221,22, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,340,360,335,363, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,335,363,331,365, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,331,365,326,366, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,326,366,304,366, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,304,355,304,366, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,395,288,400,288, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,404,288,400,288, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,409,290,404,288, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,413,292,409,290, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,418,297,413,292, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,421,302,418,297, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,422,309,421,302, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,421,318,422,309, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,421,318,417,325, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,417,325,411,330, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,411,330,405,332, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,405,332,397,333, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,397,333,344,333, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,344,333,340,334, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,340,334,336,336, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,336,336,335,338, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,335,338,332,342, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,331,347,332,342, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,332,351,331,347, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,334,354,332,351, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,336,357,334,354, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,341,359,336,357, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,341,359,340,360, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,395,288,395,278, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,304,355,258,355, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,347,80,344,76, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,344,76,337,70, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,349,82,347,80, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,351,84,349,82, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,353,85,351,84, 'fill'=>outline, 'tags'=>['floor1','bg']) -end - -# floor_bg2 -- -# This method represents part of the floorplan database. When -# invoked, it instantiates the background information for the first -# floor. -# -# Arguments: -# w - The canvas window. -# fill - Fill color to use for the floor's background. -# outline - Color to use for the floor's outline. - -def floor_bg2(w,fill,outline) - TkcPolygon.new(w,559,129,484,129,484,162,398,162,398,129,315,129, - 315,133,176,133,176,129,96,129,96,133,3,133,3,339,0,339,0,391, - 60,391,60,387,258,387,258,329,350,329,350,311,395,311,395,280, - 484,280,484,311,508,311,508,327,558,327,558,391,644,391,644, - 367,802,367,802,129,725,129,725,133,559,133,559,129, - 'tags'=>['floor2','bg'], 'fill'=>fill) - TkcLine.new(w,350,311,350,329, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,398,129,398,162, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,802,367,802,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,802,129,725,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,725,133,725,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,559,129,559,133, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,559,133,725,133, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,484,162,484,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,559,129,484,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,802,367,644,367, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,644,367,644,391, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,644,391,558,391, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,558,327,558,391, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,558,327,508,327, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,508,327,508,311, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,484,311,508,311, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,484,280,484,311, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,398,162,484,162, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,484,280,395,280, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,395,280,395,311, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,258,387,60,387, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,3,133,3,339, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,3,339,0,339, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,60,391,0,391, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,0,339,0,391, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,60,387,60,391, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,258,329,258,387, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,350,329,258,329, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,395,311,350,311, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,398,129,315,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,176,133,315,133, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,176,129,96,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,3,133,96,133, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,315,133,315,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,176,133,176,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,96,133,96,129, 'fill'=>outline, 'tags'=>['floor2','bg']) -end - -# floor_bg3 -- -# This method represents part of the floorplan database. When -# invoked, it instantiates the background information for the first -# floor. -# -# Arguments: -# w - The canvas window. -# fill - Fill color to use for the floor's background. -# outline - Color to use for the floor's outline. - -def floor_bg3(w,fill,outline) - TkcPolygon.new(w,159,300,107,300,107,248,159,248,159,129,96,129,96, - 133,21,133,21,331,0,331,0,391,60,391,60,370,159,370,159,300, - 'tags'=>['floor3','bg'], 'fill'=>fill) - TkcPolygon.new(w,258,370,258,329,350,329,350,311,399,311,399,129, - 315,129,315,133,176,133,176,129,159,129,159,370,258,370, - 'tags'=>['floor3','bg'], 'fill'=>fill) - TkcLine.new(w,96,133,96,129, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,176,129,96,129, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,176,129,176,133, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,315,133,176,133, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,315,133,315,129, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,399,129,315,129, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,399,311,399,129, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,399,311,350,311, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,350,329,350,311, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,350,329,258,329, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,258,370,258,329, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,60,370,258,370, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,60,370,60,391, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,60,391,0,391, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,0,391,0,331, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,21,331,0,331, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,21,331,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,96,133,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,107,300,159,300,159,248,107,248,107,300, - 'fill'=>outline, 'tags'=>['floor3','bg']) -end - -# floor_fg1 -- -# This method represents part of the floorplan database. When -# invoked, it instantiates the foreground information for the first -# floor (office outlines and numbers). -# -# Arguments: -# w - The canvas window. -# color - Color to use for drawing foreground information. - -def floor_fg1(w,color) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '101' - $floorItems['101'] = i - TkcText.new(w,358,209, 'text'=>'101', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'Pub Lift1' - $floorItems['Pub Lift1'] = i - TkcText.new(w,323,223, 'text'=>'Pub Lift1', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'Priv Lift1' - $floorItems['Priv Lift1'] = i - TkcText.new(w,323,188, 'text'=>'Priv Lift1', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,42,389,42,337,1,337,1,389, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '110' - $floorItems['110'] = i - TkcText.new(w,21.5,363, 'text'=>'110', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '109' - $floorItems['109'] = i - TkcText.new(w,67,363, 'text'=>'109', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,300,51,253,6,253,6,300, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '111' - $floorItems['111'] = i - TkcText.new(w,28.5,276.5, 'text'=>'111', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,98,248,98,309,79,309,79,248, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '117B' - $floorItems['117B'] = i - TkcText.new(w,88.5,278.5, 'text'=>'117B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,251,51,204,6,204,6,251, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '112' - $floorItems['112'] = i - TkcText.new(w,28.5,227.5, 'text'=>'112', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,6,156,51,156,51,203,6,203, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '113' - $floorItems['113'] = i - TkcText.new(w,28.5,179.5, 'text'=>'113', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,85,169,79,169,79,192,85,192, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '117A' - $floorItems['117A'] = i - TkcText.new(w,82,180.5, 'text'=>'117A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,77,302,77,168,53,168,53,302, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '117' - $floorItems['117'] = i - TkcText.new(w,65,235, 'text'=>'117', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,155,51,115,6,115,6,155, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '114' - $floorItems['114'] = i - TkcText.new(w,28.5,135, 'text'=>'114', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,95,115,53,115,53,168,95,168, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '115' - $floorItems['115'] = i - TkcText.new(w,74,141.5, 'text'=>'115', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,87,113,87,27,10,27,10,113, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '116' - $floorItems['116'] = i - TkcText.new(w,48.5,70, 'text'=>'116', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,89,91,128,91,128,113,89,131, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '118' - $floorItems['118'] = i - TkcText.new(w,108.5,102, 'text'=>'118', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,178,128,178,132,216,132,216,91, - 163,91,163,112,149,112,149,128, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '120' - $floorItems['120'] = i - TkcText.new(w,189.5,111.5, 'text'=>'120', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,79,193,87,193,87,169,136,169,136,192, - 156,192,156,169,175,169,175,246,79,246, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '122' - $floorItems['122'] = i - TkcText.new(w,131,207.5, 'text'=>'122', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,138,169,154,169,154,191,138,191, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '121' - $floorItems['121'] = i - TkcText.new(w,146,180, 'text'=>'121', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,99,300,126,300,126,309,99,309, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '106A' - $floorItems['106A'] = i - TkcText.new(w,112.5,304.5, 'text'=>'106A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '105' - $floorItems['105'] = i - TkcText.new(w,124.5,278.5, 'text'=>'105', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,174,309,174,300,152,300,152,309, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '106B' - $floorItems['106B'] = i - TkcText.new(w,163,304.5, 'text'=>'106B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '104' - $floorItems['104'] = i - TkcText.new(w,184,278.5, 'text'=>'104', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,138,385,138,337,91,337,91,385, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '108' - $floorItems['108'] = i - TkcText.new(w,114.5,361, 'text'=>'108', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,256,337,140,337,140,385,256,385, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '107' - $floorItems['107'] = i - TkcText.new(w,198,361, 'text'=>'107', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,300,353,300,329,260,329,260,353, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'Smoking' - $floorItems['Smoking'] = i - TkcText.new(w,280,341, 'text'=>'Smoking', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '123' - $floorItems['123'] = i - TkcText.new(w,245.5,190.5, 'text'=>'123', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '103' - $floorItems['103'] = i - TkcText.new(w,259,287, 'text'=>'103', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '124' - $floorItems['124'] = i - TkcText.new(w,356,150, 'text'=>'124', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '125' - $floorItems['125'] = i - TkcText.new(w,392,217.5, 'text'=>'125', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '126' - $floorItems['126'] = i - TkcText.new(w,436.5,185.5, 'text'=>'126', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,409,209,409,229,399,229,399,253, - 486,253,486,239,474,239,474,209, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '127' - $floorItems['127'] = i - TkcText.new(w,436.5,'231', 'text'=>'127', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,501,164,501,174,495,174,495,188, - 490,188,490,204,476,204,476,164, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'MShower' - $floorItems['MShower'] = i - TkcText.new(w,488.5,'184', 'text'=>'MShower', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'Closet' - $floorItems['Closet'] = i - TkcText.new(w,502.5,190, 'text'=>'Closet', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'WShower' - $floorItems['WShower'] = i - TkcText.new(w,494.5,230, 'text'=>'WShower', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,486,131,558,131,558,135,724,135,724,166, - 697,166,697,275,553,275,531,254,515,254, - 515,174,503,174,503,161,486,161, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '130' - $floorItems['130'] = i - TkcText.new(w,638.5,205, 'text'=>'130', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,308,242,339,242,339,248,342,248, - 342,246,397,246,397,276,393,276, - 393,309,300,309,300,248,308,248, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '102' - $floorItems['102'] = i - TkcText.new(w,367.5,278.5, 'text'=>'102', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,397,255,486,255,486,276,397,276, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '128' - $floorItems['128'] = i - TkcText.new(w,441.5,265.5, 'text'=>'128', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,510,309,486,309,486,255,530,255, - 552,277,561,277,561,325,510,325, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '129' - $floorItems['129'] = i - TkcText.new(w,535.5,293, 'text'=>'129', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,696,281,740,281,740,387,642,387, - 642,389,561,389,561,277,696,277, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '133' - $floorItems['133'] = i - TkcText.new(w,628.5,335, 'text'=>'133', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,742,387,742,281,800,281,800,387, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '132' - $floorItems['132'] = i - TkcText.new(w,771,334, 'text'=>'132', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,800,168,800,280,699,280,699,168, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '134' - $floorItems['134'] = i - TkcText.new(w,749.5,224, 'text'=>'134', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,726,131,726,166,800,166,800,131, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '135' - $floorItems['135'] = i - TkcText.new(w,763,148.5, 'text'=>'135', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,340,360,335,363,331,365,326,366,304,366, - 304,312,396,312,396,288,400,288,404,288, - 409,290,413,292,418,297,421,302,422,309, - 421,318,417,325,411,330,405,332,397,333, - 344,333,340,334,336,336,335,338,332,342, - 331,347,332,351,334,354,336,357,341,359, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'Ramona Stair' - $floorItems['Ramona Stair'] = i - TkcText.new(w,368,323, 'text'=>'Ramona Stair', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,30,23,30,5,93,5,98,5,104,7,110,10,116,16,119,20, - 122,28,123,32,123,68,220,68,220,87,90,87,90,23, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'University Stair' - $floorItems['University Stair'] = i - TkcText.new(w,155,77.5, 'text'=>'University Stair', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,282,37,295,40,312,49,323,56,337,70,352,56, - 358,48,363,39,365,29,348,25,335,22,321,14, - 300,5,283,1,260,0,246,0,242,2,236,4,231,8, - 227,13,223,17,221,22,220,34,260,34, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'Plaza Stair' - $floorItems['Plaza Stair'] = i - TkcText.new(w,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,220,34,260,34,282,37,295,40,312,49, - 323,56,337,70,350,83,365,94,377,100, - 386,104,386,128,220,128, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'Plaza Deck' - $floorItems['Plaza Deck'] = i - TkcText.new(w,303,81, 'text'=>'Plaza Deck', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,257,336,77,336,6,336,6,301,77,301,77,310,257,310, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '106' - $floorItems['106'] = i - TkcText.new(w,131.5,318.5, 'text'=>'106', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,146,110,162,110,162,91,130,91,130,115,95,115, - 95,128,114,128,114,151,157,151,157,153,112,153, - 112,130,97,130,97,168,175,168,175,131,146,131, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '119' - $floorItems['119'] = i - TkcText.new(w,143.5,133, 'text'=>'119', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - TkcLine.new(w,155,191,155,189, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,155,177,155,169, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,96,129,96,169, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,78,169,176,169, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,176,247,176,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,340,206,307,206, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,340,187,340,170, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,340,210,340,201, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,340,247,340,224, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,340,241,307,241, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,376,246,376,170, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,307,247,307,170, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,376,170,307,170, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,315,129,315,170, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,147,129,176,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,202,133,176,133, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,398,129,315,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,258,352,258,387, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,60,387,60,391, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,0,337,0,391, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,60,391,0,391, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,3,114,3,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,258,387,60,387, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,237,52,273, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,189,52,225, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,140,52,177, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,395,306,395,311, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,531,254,398,254, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,475,178,475,238, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,502,162,398,162, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,398,129,398,188, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,383,188,376,188, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,408,188,408,194, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,398,227,398,254, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,408,227,398,227, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,408,222,408,227, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,408,206,408,210, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,408,208,475,208, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,484,278,484,311, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,484,311,508,311, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,508,327,508,311, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,559,327,508,327, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,644,391,559,391, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,644,389,644,391, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,514,205,475,205, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,496,189,496,187, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,559,129,484,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,484,162,484,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,725,133,559,133, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,559,129,559,133, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,725,149,725,167, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,725,129,802,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,802,389,802,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,739,167,802,167, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,396,188,408,188, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,0,337,9,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,58,337,21,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,43,391,43,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,105,337,75,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,91,387,91,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,154,337,117,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,139,387,139,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,227,337,166,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,258,337,251,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,258,328,302,328, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,302,355,302,311, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,395,311,302,311, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,484,278,395,278, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,395,294,395,278, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,473,278,473,275, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,473,256,473,254, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,533,257,531,254, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,553,276,551,274, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,698,276,553,276, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,559,391,559,327, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,802,389,644,389, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,741,314,741,389, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,698,280,698,167, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,707,280,698,280, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,802,280,731,280, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,741,280,741,302, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,698,167,727,167, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,725,137,725,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,514,254,514,175, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,496,175,514,175, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,502,175,502,162, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,475,166,475,162, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,496,176,496,175, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,491,189,496,189, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,491,205,491,189, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,487,238,475,238, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,487,240,487,238, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,487,252,487,254, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,315,133,304,133, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,256,133,280,133, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,78,247,270,247, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,307,247,294,247, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,214,133,232,133, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,217,247,217,266, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,217,309,217,291, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,217,309,172,309, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,154,309,148,309, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,175,300,175,309, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,151,300,175,300, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,151,247,151,309, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,78,237,78,265, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,78,286,78,309, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,106,309,78,309, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,130,309,125,309, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,99,309,99,247, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,127,299,99,299, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,127,309,127,299, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,155,191,137,191, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,137,169,137,191, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,78,171,78,169, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,78,190,78,218, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,86,192,86,169, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,86,192,78,192, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,301,3,301, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,286,52,301, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,252,3,252, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,203,3,203, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,3,156,52,156, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,8,25,8,114, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,63,114,3,114, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,75,114,97,114, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,108,114,129,114, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,129,114,129,89, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,114,52,128, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,132,89,88,89, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,88,25,88,89, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,88,114,88,89, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,218,89,144,89, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,147,111,147,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,162,111,147,111, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,162,109,162,111, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,162,96,162,89, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,218,89,218,94, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,218,89,218,119, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,8,25,88,25, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,258,337,258,328, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,113,129,96,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,302,355,258,355, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,386,104,386,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,377,100,386,104, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,365,94,377,100, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,350,83,365,94, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,337,70,350,83, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,337,70,323,56, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,312,49,323,56, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,295,40,312,49, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,282,37,295,40, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,260,34,282,37, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,253,34,260,34, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,386,128,386,104, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,113,152,156,152, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,113,152,156,152, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,113,152,113,129, 'fill'=>color, 'tags'=>['floor1','wall']) -end - -# floor_fg2 -- -# This method represents part of the floorplan database. When -# invoked, it instantiates the foreground information for the second -# floor (office outlines and numbers). -# -# Arguments: -# w - The canvas window. -# color - Color to use for drawing foreground information. - -def floor_fg2(w,color) - i = TkcPolygon.new(w,748,188,755,188,755,205,758,205,758,222, - 800,222,800,168,748,168, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '238' - $floorItems['238'] = i - TkcText.new(w,774,195, 'text'=>'238', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,726,188,746,188,746,166,800,166,800,131,726,131, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '237' - $floorItems['237'] = i - TkcText.new(w,763,148.5, 'text'=>'237', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,497,187,497,204,559,204,559,324,641,324, - 643,324,643,291,641,291,641,205,696,205, - 696,291,694,291,694,314,715,314,715,291, - 715,205,755,205,755,190,724,190,724,187, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '246' - $floorItems['246'] = i - TkcText.new(w,600,264, 'text'=>'246', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,694,279,643,279,643,314,694,314, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '247' - $floorItems['247'] = i - TkcText.new(w,668.5,296.5, 'text'=>'247', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,232,250,308,250,308,242,339,242,339,246, - 397,246,397,255,476,255,476,250,482,250,559,250, - 559,274,482,274,482,278,396,278,396,274,232,274, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '202' - $floorItems['202'] = i - TkcText.new(w,285.5,260, 'text'=>'202', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,53,228,53,338,176,338,233,338,233,196, - 306,196,306,180,175,180,175,169,156,169, - 156,196,176,196,176,228, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '206' - $floorItems['206'] = i - TkcText.new(w,143,267, 'text'=>'206', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,277,6,277,6,338,51,338, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '212' - $floorItems['212'] = i - TkcText.new(w,28.5,307.5, 'text'=>'212', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '245' - $floorItems['245'] = i - TkcText.new(w,521.5,300.5, 'text'=>'245', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,560,389,599,389,599,326,560,326, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '244' - $floorItems['244'] = i - TkcText.new(w,579.5,357.5, 'text'=>'244', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,601,389,601,326,643,326,643,389, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '243' - $floorItems['243'] = i - TkcText.new(w,622,357.5, 'text'=>'243', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,688,316,645,316,645,365,688,365, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '242' - $floorItems['242'] = i - TkcText.new(w,666.5,340.5, 'text'=>'242', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,802,367,759,367,759,226,802,226, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = 'Barbecue Deck' - $floorItems['Barbecue Deck'] = i - TkcText.new(w,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,262,755,314,717,314,717,262, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '240' - $floorItems['240'] = i - TkcText.new(w,736,288, 'text'=>'240', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,316,689,316,689,365,755,365, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '241' - $floorItems['241'] = i - TkcText.new(w,722,340.5, 'text'=>'241', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,206,717,206,717,261,755,261, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '239' - $floorItems['239'] = i - TkcText.new(w,736,233.5, 'text'=>'239', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,695,277,643,277,643,206,695,206, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '248' - $floorItems['248'] = i - TkcText.new(w,669,241.5, 'text'=>'248', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,676,135,676,185,724,185,724,135, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '236' - $floorItems['236'] = i - TkcText.new(w,700,160, 'text'=>'236', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '235' - $floorItems['235'] = i - TkcText.new(w,651.5,160, 'text'=>'235', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,626,143,633,143,633,135,572,135, - 572,143,579,143,579,185,626,185, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '234' - $floorItems['234'] = i - TkcText.new(w,606,160, 'text'=>'234', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,557,135,571,135,571,145,578,145, - 578,185,527,185,527,131,557,131, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '233' - $floorItems['233'] = i - TkcText.new(w,552.5,158, 'text'=>'233', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,476,249,557,249,557,205,476,205, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '230' - $floorItems['230'] = i - TkcText.new(w,516.5,227, 'text'=>'230', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '232' - $floorItems['232'] = i - TkcText.new(w,500.5,158, 'text'=>'232', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,476,186,495,186,495,204,476,204, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '229' - $floorItems['229'] = i - TkcText.new(w,485.5,195, 'text'=>'229', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '227' - $floorItems['227'] = i - TkcText.new(w,436.5,185.5, 'text'=>'227', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '228' - $floorItems['228'] = i - TkcText.new(w,436.5,231, 'text'=>'228', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '226' - $floorItems['226'] = i - TkcText.new(w,392,217.5, 'text'=>'226', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '225' - $floorItems['225'] = i - TkcText.new(w,356.5,150, 'text'=>'225', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,234,198,306,198,306,249,234,249, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '224' - $floorItems['224'] = i - TkcText.new(w,270,223.5, 'text'=>'224', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '223' - $floorItems['223'] = i - TkcText.new(w,292,157, 'text'=>'223', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,268,179,221,179,221,135,268,135, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '222' - $floorItems['222'] = i - TkcText.new(w,244.5,157, 'text'=>'222', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,177,179,219,179,219,135,177,135, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '221' - $floorItems['221'] = i - TkcText.new(w,198,157, 'text'=>'221', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '204' - $floorItems['204'] = i - TkcText.new(w,324,301.5, 'text'=>'204', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '205' - $floorItems['205'] = i - TkcText.new(w,265.5,307, 'text'=>'205', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,256,385,256,340,212,340,212,385, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '207' - $floorItems['207'] = i - TkcText.new(w,234,362.5, 'text'=>'207', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,210,340,164,340,164,385,210,385, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '208' - $floorItems['208'] = i - TkcText.new(w,187,362.5, 'text'=>'208', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,115,340,162,340,162,385,115,385, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '209' - $floorItems['209'] = i - TkcText.new(w,138.5,362.5, 'text'=>'209', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,228,89,156,53,156,53,228, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '217' - $floorItems['217'] = i - TkcText.new(w,71,192, 'text'=>'217', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,169,97,169,97,190,89,190, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '217A' - $floorItems['217A'] = i - TkcText.new(w,93,179.5, 'text'=>'217A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '216' - $floorItems['216'] = i - TkcText.new(w,71,145.5, 'text'=>'216', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,179,51,135,6,135,6,179, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '215' - $floorItems['215'] = i - TkcText.new(w,28.5,157, 'text'=>'215', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,227,6,227,6,180,51,180, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '214' - $floorItems['214'] = i - TkcText.new(w,28.5,203.5, 'text'=>'214', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,275,6,275,6,229,51,229, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '213' - $floorItems['213'] = i - TkcText.new(w,28.5,252, 'text'=>'213', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,114,340,67,340,67,385,114,385, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '210' - $floorItems['210'] = i - TkcText.new(w,90.5,362.5, 'text'=>'210', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '211' - $floorItems['211'] = i - TkcText.new(w,33,364.5, 'text'=>'211', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '203' - $floorItems['203'] = i - TkcText.new(w,367.5,292.5, 'text'=>'203', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,99,191,91,191,91,226,174,226,174,198, - 154,198,154,192,109,192,109,169,99,169, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '220' - $floorItems['220'] = i - TkcText.new(w,132.5,208.5, 'text'=>'220', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = 'Priv Lift2' - $floorItems['Priv Lift2'] = i - TkcText.new(w,323,188, 'text'=>'Priv Lift2', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = 'Pub Lift 2' - $floorItems['Pub Lift 2'] = i - TkcText.new(w,323,223, 'text'=>'Pub Lift 2', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '218' - $floorItems['218'] = i - TkcText.new(w,136,149.5, 'text'=>'218', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '219' - $floorItems['219'] = i - TkcText.new(w,132.5,180, 'text'=>'219', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '201' - $floorItems['201'] = i - TkcText.new(w,358,209, 'text'=>'201', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - TkcLine.new(w,641,186,678,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,350,757,367, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,634,133,634,144, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,634,144,627,144, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,572,133,572,144, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,572,144,579,144, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,398,129,398,162, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,174,197,175,197, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,175,197,175,227, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,206,757,221, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,396,188,408,188, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,727,189,725,189, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,747,167,802,167, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,747,167,747,189, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,755,189,739,189, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,769,224,757,224, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,802,224,802,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,802,129,725,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,725,189,725,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,725,186,690,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,676,133,676,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,627,144,627,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,629,186,593,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,579,144,579,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,559,129,559,133, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,725,133,559,133, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,484,162,484,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,559,129,484,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,526,129,526,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,540,186,581,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,528,186,523,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,511,186,475,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,496,190,496,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,496,205,496,202, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,475,205,527,205, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,558,205,539,205, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,558,205,558,249, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,558,249,475,249, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,662,206,642,206, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,695,206,675,206, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,695,278,642,278, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,642,291,642,206, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,695,291,695,206, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,716,208,716,206, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,206,716,206, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,221,757,224, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,793,224,802,224, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,262,716,262, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,716,220,716,264, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,716,315,716,276, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,315,703,315, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,325,757,224, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,367,644,367, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,689,367,689,315, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,647,315,644,315, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,659,315,691,315, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,600,325,600,391, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,627,325,644,325, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,644,391,644,315, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,615,325,575,325, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,644,391,558,391, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,563,325,558,325, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,558,391,558,314, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,558,327,508,327, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,558,275,484,275, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,558,302,558,275, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,508,327,508,311, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,484,311,508,311, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,484,275,484,311, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,475,208,408,208, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,408,206,408,210, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,408,222,408,227, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,408,227,398,227, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,398,227,398,254, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,408,188,408,194, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,383,188,376,188, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,398,188,398,162, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,398,162,484,162, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,475,162,475,254, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,398,254,475,254, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,484,280,395,280, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,395,311,395,275, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,307,197,293,197, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,278,197,233,197, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,233,197,233,249, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,307,179,284,179, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,233,249,278,249, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,269,179,269,133, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,220,179,220,133, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,155,191,110,191, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,90,190,98,190, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,98,169,98,190, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,52,133,52,165, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,52,214,52,177, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,52,226,52,262, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,52,274,52,276, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,234,275,234,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,226,339,258,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,211,387,211,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,214,339,177,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,258,387,60,387, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,3,133,3,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,165,339,129,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,117,339,80,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,68,339,59,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,0,339,46,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,60,391,0,391, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,0,339,0,391, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,60,387,60,391, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,258,329,258,387, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,350,329,258,329, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,395,311,350,311, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,398,129,315,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,176,133,315,133, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,176,129,96,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,3,133,96,133, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,66,387,66,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,115,387,115,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,163,387,163,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,234,275,276,275, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,288,275,309,275, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,298,275,298,329, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,341,283,350,283, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,321,275,341,275, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,375,275,395,275, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,315,129,315,170, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,376,170,307,170, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,307,250,307,170, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,376,245,376,170, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,340,241,307,241, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,340,245,340,224, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,340,210,340,201, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,340,187,340,170, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,340,206,307,206, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,293,250,307,250, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,271,179,238,179, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,226,179,195,179, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,176,129,176,179, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,182,179,176,179, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,174,169,176,169, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,162,169,90,169, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,96,169,96,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,175,227,90,227, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,90,190,90,227, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,52,179,3,179, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,52,228,3,228, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,52,276,3,276, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,155,177,155,169, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,110,191,110,169, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,155,189,155,197, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,350,283,350,329, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,162,197,155,197, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,341,275,341,283, 'fill'=>color, 'tags'=>['floor2','wall']) -end - -# floor_fg3 -- -# This method represents part of the floorplan database. When -# invoked, it instantiates the foreground information for the third -# floor (office outlines and numbers). -# -# Arguments: -# w - The canvas window. -# color - Color to use for drawing foreground information. - -def floor_fg3(w,color) - i = TkcPolygon.new(w,89,228,89,180,70,180,70,228, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '316' - $floorItems['316'] = i - TkcText.new(w,79.5,204, 'text'=>'316', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,115,368,162,368,162,323,115,323, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '309' - $floorItems['309'] = i - TkcText.new(w,138.5,345.5, 'text'=>'309', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,164,323,164,368,211,368,211,323, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '308' - $floorItems['308'] = i - TkcText.new(w,187.5,345.5, 'text'=>'308', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,256,368,212,368,212,323,256,323, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '307' - $floorItems['307'] = i - TkcText.new(w,234,345.5, 'text'=>'307', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '305' - $floorItems['305'] = i - TkcText.new(w,270.5,301.5, 'text'=>'305', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,251,219,251,203,244,203,244,219, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '324B' - $floorItems['324B'] = i - TkcText.new(w,247.5,211, 'text'=>'324B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,251,249,244,249,244,232,251,232, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '324A' - $floorItems['324A'] = i - TkcText.new(w,247.5,240.5, 'text'=>'324A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,223,135,223,179,177,179,177,135, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '320' - $floorItems['320'] = i - TkcText.new(w,200,157, 'text'=>'320', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,114,368,114,323,67,323,67,368, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '310' - $floorItems['310'] = i - TkcText.new(w,90.5,345.5, 'text'=>'310', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,23,277,23,321,68,321,68,277, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '312' - $floorItems['312'] = i - TkcText.new(w,45.5,299, 'text'=>'312', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,23,229,68,229,68,275,23,275, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '313' - $floorItems['313'] = i - TkcText.new(w,45.5,252, 'text'=>'313', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,68,227,23,227,23,180,68,180, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '314' - $floorItems['314'] = i - TkcText.new(w,40.5,203.5, 'text'=>'314', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,95,179,95,135,23,135,23,179, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '315' - $floorItems['315'] = i - TkcText.new(w,59,157, 'text'=>'315', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,99,226,99,204,91,204,91,226, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '316B' - $floorItems['316B'] = i - TkcText.new(w,95,215, 'text'=>'316B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,91,202,99,202,99,180,91,180, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '316A' - $floorItems['316A'] = i - TkcText.new(w,95,191, 'text'=>'316A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,97,169,109,169,109,192,154,192,154,198, - 174,198,174,226,101,226,101,179,97,179, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '319' - $floorItems['319'] = i - TkcText.new(w,141.5,209, 'text'=>'319', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '311' - $floorItems['311'] = i - TkcText.new(w,29.5,361, 'text'=>'311', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '318' - $floorItems['318'] = i - TkcText.new(w,132.5,180, 'text'=>'318', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '317' - $floorItems['317'] = i - TkcText.new(w,136,149.5, 'text'=>'317', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,274,194,274,221,306,221,306,194, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '323' - $floorItems['323'] = i - TkcText.new(w,290,207.5, 'text'=>'323', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,306,222,274,222,274,249,306,249, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '325' - $floorItems['325'] = i - TkcText.new(w,290,235.5, 'text'=>'325', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,263,179,224,179,224,135,263,135, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '321' - $floorItems['321'] = i - TkcText.new(w,243.5,157, 'text'=>'321', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,314,169,306,169,306,192,273,192, - 264,181,264,135,314,135, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '322' - $floorItems['322'] = i - TkcText.new(w,293.5,163.5, 'text'=>'322', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = 'Pub Lift3' - $floorItems['Pub Lift3'] = i - TkcText.new(w,323,223, 'text'=>'Pub Lift3', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = 'Priv Lift3' - $floorItems['Priv Lift3'] = i - TkcText.new(w,323,188, 'text'=>'Priv Lift3', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '303' - $floorItems['303'] = i - TkcText.new(w,373.5,292.5, 'text'=>'303', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,272,203,272,249,252,249,252,230, - 244,230,244,221,252,221,252,203, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '324' - $floorItems['324'] = i - TkcText.new(w,262,226, 'text'=>'324', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '304' - $floorItems['304'] = i - TkcText.new(w,324,301.5, 'text'=>'304', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '301' - $floorItems['301'] = i - TkcText.new(w,358,209, 'text'=>'301', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,397,246,377,246,377,185,397,185, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '327' - $floorItems['327'] = i - TkcText.new(w,387,215.5, 'text'=>'327', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '326' - $floorItems['326'] = i - TkcText.new(w,365.5,150, 'text'=>'326', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,308,251,242,251,242,274,342,274,342,282,375, 282, - 375,274,397,274,397,248,339,248,339,242,308,242, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '302' - $floorItems['302'] = i - TkcText.new(w,319.5,261, 'text'=>'302', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,70,321,242,321,242,200,259,200,259,203,272,203, - 272,193,263,180,242,180,175,180,175,169,156,169, - 156,196,177,196,177,228,107,228,70,228,70,275,107,275, - 107,248,160,248,160,301,107,301,107,275,70,275, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '306' - $floorItems['306'] = i - TkcText.new(w,200.5,284.5, 'text'=>'306', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - TkcLine.new(w,341,275,341,283, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,162,197,155,197, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,396,247,399,247, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,399,129,399,311, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,258,202,243,202, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,350,283,350,329, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,251,231,243,231, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,243,220,251,220, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,243,250,243,202, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,155,197,155,190, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,110,192,110,169, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,155,192,110,192, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,155,177,155,169, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,176,197,176,227, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,69,280,69,274, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,21,276,69,276, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,69,262,69,226, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,21,228,69,228, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,21,179,75,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,69,179,69,214, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,90,220,90,227, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,90,204,90,202, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,90,203,100,203, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,90,187,90,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,90,227,176,227, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,100,179,100,227, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,100,179,87,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,96,179,96,129, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,162,169,96,169, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,173,169,176,169, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,182,179,176,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,176,129,176,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,195,179,226,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,224,133,224,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,264,179,264,133, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,238,179,264,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,273,207,273,193, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,273,235,273,250, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,273,224,273,219, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,273,193,307,193, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,273,222,307,222, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,273,250,307,250, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,384,247,376,247, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,340,206,307,206, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,340,187,340,170, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,340,210,340,201, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,340,247,340,224, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,340,241,307,241, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,376,247,376,170, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,307,250,307,170, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,376,170,307,170, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,315,129,315,170, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,376,283,366,283, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,376,283,376,275, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,399,275,376,275, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,341,275,320,275, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,341,283,350,283, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,298,275,298,329, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,308,275,298,275, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,243,322,243,275, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,243,275,284,275, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,258,322,226,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,212,370,212,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,214,322,177,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,163,370,163,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,165,322,129,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,84,322,117,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,71,322,64,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,115,322,115,370, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,66,322,66,370, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,52,322,21,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,21,331,0,331, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,21,331,21,133, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,96,133,21,133, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,176,129,96,129, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,315,133,176,133, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,315,129,399,129, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,399,311,350,311, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,350,329,258,329, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,258,322,258,370, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,60,370,258,370, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,60,370,60,391, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,0,391,0,331, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,60,391,0,391, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,307,250,307,242, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,273,250,307,250, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,258,250,243,250, 'fill'=>color, 'tags'=>['floor3','wall']) -end - -# Below is the "main program" that creates the floorplan demonstration. - -# toplevel widget -if defined?($floor_demo) && $floor_demo - $floor_demo.destroy - $floor_demo = nil -end - -# demo toplevel widget -$floor_demo = TkToplevel.new {|w| - title("Floorplan Canvas Demonstration") - iconname("Floorplan") - positionWindow(w) - geometry('+20+20') - minsize(100,100) -} - -# label -TkLabel.new($floor_demo, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', - 'text'=>"This window contains a canvas widget showing the floorplan of Digital Equipment Corporation's Western Research Laboratory. It has three levels. At any given time one of the levels is active, meaning that you can see its room structure. To activate a level, click the left mouse button anywhere on it. As the mouse moves over the active level, the room under the mouse lights up and its room number appears in the \"Room:\" entry. You can also type a room number in the entry and the room will light up."){ - pack('side'=>'top') -} - -# frame -$floor_buttons = TkFrame.new($floor_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $floor_demo - $floor_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'floor'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$floor_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# -$floorLabels = {} -$floorItems = {} - -# canvas -if $tk_version =~ /^4\.[01]/ - $floor_canvas_frame = TkFrame.new($floor_demo,'bd'=>2,'relief'=>'sunken', - 'highlightthickness'=>2) - $floor_canvas = TkCanvas.new($floor_canvas_frame, - 'width'=>900, 'height'=>500, 'borderwidth'=>0, - 'highlightthickness'=>0) {|c| - TkScrollbar.new($floor_demo, 'orient'=>'horiz', - 'command'=>proc{|*args| c.xview(*args)}){|hs| - c.xscrollcommand(proc{|first,last| hs.set first,last}) - pack('side'=>'bottom', 'fill'=>'x') - } - TkScrollbar.new($floor_demo, 'command'=>proc{|*args| c.yview(*args)}){|vs| - c.yscrollcommand(proc{|first,last| vs.set first,last}) - pack('side'=>'right', 'fill'=>'y') - } - } - $floor_canvas_frame.pack('side'=>'top','fill'=>'both', 'expand'=>'yes') - $floor_canvas.pack('expand'=>'yes', 'fill'=>'both') - -else - TkFrame.new($floor_demo) {|f| - pack('side'=>'top', 'fill'=>'both', 'expand'=>'yes') - - h = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'horizontal') - v = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'vertical') - - TkFrame.new(f, 'bd'=>2, 'relief'=>'sunken') {|f1| - $floor_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500, - 'borderwidth'=>0, - 'highlightthickness'=>0) { - xscrollcommand(proc{|first,last| h.set first,last}) - yscrollcommand(proc{|first,last| v.set first,last}) - pack('expand'=>'yes', 'fill'=>'both') - } - grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - } - - v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - - TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0) - TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0) - - pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1) - - v.command(proc{|*args| c.yview(*args)}) - h.command(proc{|*args| c.xview(*args)}) - } -end - - -# Create an entry for displaying and typing in current room. - -$currentRoom = TkVariable.new -$floor_entry = TkEntry.new($floor_canvas, 'width'=>10, 'relief'=>'sunken', - 'bd'=>2, 'textvariable'=>$currentRoom) - -# Choose colors, then fill in the floorplan. - -$floor_colors = {} -if TkWinfo.depth($floor_canvas) > 1 - $floor_colors['bg1'] = '#a9c1da' - $floor_colors['outline1'] = '#77889a' - $floor_colors['bg2'] = '#9ab0c6' - $floor_colors['outline2'] = '#687786' - $floor_colors['bg3'] = '#8ba0b3' - $floor_colors['outline3'] = '#596673' - $floor_colors['offices'] = 'Black' - $floor_colors['active'] = '#c4d1df' -else - $floor_colors['bg1'] = 'white' - $floor_colors['outline1'] = 'black' - $floor_colors['bg2'] = 'white' - $floor_colors['outline2'] = 'black' - $floor_colors['bg3'] = 'white' - $floor_colors['outline3'] = 'black' - $floor_colors['offices'] = 'Black' - $floor_colors['active'] = 'black' -end - -$activeFloor = '' -floorDisplay $floor_canvas,3 - -# Set up event bindings for canvas: - -$floor_canvas.itembind('floor1', '1', proc{floorDisplay $floor_canvas,1}) -$floor_canvas.itembind('floor2', '1', proc{floorDisplay $floor_canvas,2}) -$floor_canvas.itembind('floor3', '1', proc{floorDisplay $floor_canvas,3}) -$floor_canvas.itembind('room', 'Enter', proc{newRoom $floor_canvas}) -$floor_canvas.itembind('room', 'Leave', proc{$currentRoom.value = ''}) -$floor_canvas.bind('2', proc{|x,y| $floor_canvas.scan_mark x,y}, '%x %y') -$floor_canvas.bind('B2-Motion', - proc{|x,y| $floor_canvas.scan_dragto x,y}, '%x %y') -$floor_canvas.bind('Destroy', proc{$currentRoom.unset}) -$currentRoom.value = '' -$currentRoom.trace('w',proc{roomChanged $floor_canvas}) - diff --git a/ext/tk/sample/demos-en/form.rb b/ext/tk/sample/demos-en/form.rb deleted file mode 100644 index dbb14302dc..0000000000 --- a/ext/tk/sample/demos-en/form.rb +++ /dev/null @@ -1,62 +0,0 @@ -# -# form widget demo (called by 'widget') -# - -# toplevel widget -if defined?($form_demo) && $form_demo - $form_demo.destroy - $form_demo = nil -end - -# demo toplevel widget -$form_demo = TkToplevel.new {|w| - title("Form Demonstration") - iconname("form") - positionWindow(w) -} - -# label -msg = TkLabel.new($form_demo) { - font $font - wraplength '4i' - justify 'left' - text "This window contains a simple form where you can type in the various entries and use tabs to move circularly between the entries." -} -msg.pack('side'=>'top', 'fill'=>'x') - -# frame -TkFrame.new($form_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $form_demo - $form_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'form'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# entry -form_data = [] -(1..5).each{|i| - f = TkFrame.new($form_demo, 'bd'=>2) - e = TkEntry.new(f, 'relief'=>'sunken', 'width'=>40) - l = TkLabel.new(f) - e.pack('side'=>'right') - l.pack('side'=>'left') - form_data[i] = {'frame'=>f, 'entry'=>e, 'label'=>l} -} - -# -form_data[1]['label'].text('Name:') -form_data[2]['label'].text('Address:') -form_data[5]['label'].text('Phone:') - -# pack -(1..5).each{|i| form_data[i]['frame'].pack('side'=>'top', 'fill'=>'x')} - diff --git a/ext/tk/sample/demos-en/hello b/ext/tk/sample/demos-en/hello deleted file mode 100644 index f06eabe518..0000000000 --- a/ext/tk/sample/demos-en/hello +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env ruby -require 'tk' - -unless /^8\.[1-9]/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK - require 'tkencoding' -end - -TkButton.new(nil, - 'text'=>"Hello Ruby world!", - 'font'=>TkFont.new('k14'), - 'command'=>proc{print "Hello Ruby world!\n"; exit} -).pack - -Tk.mainloop diff --git a/ext/tk/sample/demos-en/hscale.rb b/ext/tk/sample/demos-en/hscale.rb deleted file mode 100644 index 14e395b61a..0000000000 --- a/ext/tk/sample/demos-en/hscale.rb +++ /dev/null @@ -1,74 +0,0 @@ -require "tkcanvas" - -if defined?($hscale_demo) && $hscale_demo - $hscale_demo.destroy - $hscale_demo = nil -end - -$hscale_demo = TkToplevel.new {|w| - title("Horizontal Scale Demonstration") - iconname("hscale") -} -positionWindow($hscale_demo) - - -msg = TkLabel.new($hscale_demo) { - font $font - wraplength '3.5i' - justify 'left' - text "An arrow and a horizontal scale are displayed below. If you click or drag mouse button 1 in the scale, you can change the length of the arrow." -} -msg.pack('side'=>'top') - -TkFrame.new($hscale_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc { - tmppath = $hscale_demo - $hscale_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc { showCode 'hscale' } - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -TkFrame.new($hscale_demo) {|frame| - canvas = TkCanvas.new(frame) {|c| - width 50 - height 50 - bd 0 - highlightthickness 0 - TkcPolygon.new(c, '0', '0', '1', '1', '2', '2') { - fill 'DeepSkyBlue' - tags 'poly' - } - TkcLine.new(c, '0', '0', '1', '1', '2', '2', '0', '0') { - fill 'black' - tags 'line' - } - }.pack('side'=>'top', 'expand'=>'yes', 'anchor'=>'s', 'fill'=>'x', 'padx'=>'15') - scale = TkScale.new(frame) { - orient 'horizontal' - length 284 - from 0 - to 250 - command proc{|value| setWidth(canvas, value)} - tickinterval 50 - }.pack('side'=>'bottom', 'expand'=>'yes', 'anchor'=>'n') - scale.set 75 -}.pack('side'=>'top', 'fill'=>'x') - - -def setWidth(w, width) - width = width + 21 - x2 = width - 30 - if x2 < 21 - x2 = 21 - end - w.coords 'poly',20,15,20,35,x2,35,x2,45,width,25,x2,5,x2,15,20,15 - w.coords 'line',20,15,20,35,x2,35,x2,45,width,25,x2,5,x2,15,20,15 -end diff --git a/ext/tk/sample/demos-en/icon.rb b/ext/tk/sample/demos-en/icon.rb deleted file mode 100644 index 7557257ef4..0000000000 --- a/ext/tk/sample/demos-en/icon.rb +++ /dev/null @@ -1,95 +0,0 @@ -# icon.rb -# -# This demonstration script creates a toplevel window containing -# buttons that display bitmaps instead of text. -# -# iconic button widget demo (called by 'widget') -# - -# toplevel widget -if defined?($icon_demo) && $icon_demo - $icon_demo.destroy - $icon_demo = nil -end - -# demo toplevel widget -$icon_demo = TkToplevel.new {|w| - title("Iconic Button Demonstration") - iconname("icon") - positionWindow(w) -} - -# label -msg = TkLabel.new($icon_demo) { - font $font - wraplength '5i' - justify 'left' - text "This window shows three ways of using bitmaps or images in radiobuttons and checkbuttons. On the left are two radiobuttons, each of which displays a bitmap and an indicator. In the middle is a checkbutton that displays a different image depending on whether it is selected or not. On the right is a checkbutton that displays a single bitmap but changes its background color to indicate whether or not it is selected. (This change is visible when the mouse pointer is not directy over the button.)" -} -msg.pack('side'=>'top') - -# frame -TkFrame.new($icon_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $icon_demo - $icon_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'icon'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# image -flagup = \ -TkBitmapImage.new('file'=>[$demo_dir, - 'images','flagup.xbm'].join(File::Separator), - 'maskfile'=>\ - [$demo_dir,'images','flagup.xbm'].join(File::Separator)) -flagdown = \ -TkBitmapImage.new('file'=>[$demo_dir, - 'images','flagdown.xbm'].join(File::Separator), - 'maskfile'=>\ - [$demo_dir,'images','flagdown.xbm'].join(File::Separator)) - -# ÊÑ¿ôÀ¸À® -letters = TkVariable.new - -# frame -TkFrame.new($icon_demo, 'borderwidth'=>10){|w| - TkFrame.new(w) {|f| - TkRadioButton.new(f){ - bitmap '@' + [$demo_dir,'images','letters.xbm'].join(File::Separator) - variable letters - value 'full' - }.pack('side'=>'top', 'expand'=>'yes') - - TkRadioButton.new(f){ - bitmap '@' + [$demo_dir,'images','noletter.xbm'].join(File::Separator) - variable letters - value 'empty' - }.pack('side'=>'top', 'expand'=>'yes') - - }.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m') - - TkCheckButton.new(w) { - image flagdown - selectimage flagup - indicatoron 0 - selectcolor self['background'] - }.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m') - - TkCheckButton.new(w) { - bitmap '@' + [$demo_dir,'images','letters.xbm'].join(File::Separator) - indicatoron 0 - selectcolor 'SeaGreen1' - }.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m') - -}.pack('side'=>'top') - diff --git a/ext/tk/sample/demos-en/image1.rb b/ext/tk/sample/demos-en/image1.rb deleted file mode 100644 index 8d39b20049..0000000000 --- a/ext/tk/sample/demos-en/image1.rb +++ /dev/null @@ -1,60 +0,0 @@ -## image1.rb -# -# This demonstration script displays two image widgets. -# -# two image widgets demo (called by 'widget') -# - -# toplevel widget -if defined?($image1_demo) && $image1_demo - $image1_demo.destroy - $image1_demo = nil -end - -# demo toplevel widget -$image1_demo = TkToplevel.new {|w| - title('Image Demonstration #1') - iconname("Image1") - positionWindow(w) -} - -# label -msg = TkLabel.new($image1_demo) { - font $font - wraplength '4i' - justify 'left' - text "This demonstration displays two images, each in a separate label widget." -} -msg.pack('side'=>'top') - -# frame -TkFrame.new($image1_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $image1_demo - $image1_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'image1'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# image -image1a = \ -TkPhotoImage.new('file'=>[$demo_dir, - 'images','earth.gif'].join(File::Separator)) -image1b = \ -TkPhotoImage.new('file'=>[$demo_dir, - 'images','earthris.gif'].join(File::Separator)) - -# label -[ TkLabel.new($image1_demo, 'image'=>image1a, 'bd'=>1, 'relief'=>'sunken'), - TkLabel.new($image1_demo, 'image'=>image1b, 'bd'=>1, 'relief'=>'sunken') -].each{|w| w.pack('side'=>'top', 'padx'=>'.5m', 'pady'=>'.5m')} - diff --git a/ext/tk/sample/demos-en/image2.rb b/ext/tk/sample/demos-en/image2.rb deleted file mode 100644 index 9924195675..0000000000 --- a/ext/tk/sample/demos-en/image2.rb +++ /dev/null @@ -1,105 +0,0 @@ -# image2.rb -# -# This demonstration script creates a simple collection of widgets -# that allow you to select and view images in a Tk label. -# -# widget demo 'load image' (called by 'widget') -# - -# toplevel widget -if defined?($image2_demo) && $image2_demo - $image2_demo.destroy - $image2_demo = nil -end - -# demo toplevel widget -$image2_demo = TkToplevel.new {|w| - title('Image Demonstration #2') - iconname("Image2") - positionWindow(w) -} - -# label -msg = TkLabel.new($image2_demo) { - font $font - wraplength '4i' - justify 'left' - text "This demonstration allows you to view images using a Tk \"photo\" image. First type a directory name in the listbox, then press Enter to load the directory into the listbox. Then double-click on a file name in the listbox to see that image." -} -msg.pack('side'=>'top') - -# frame -TkFrame.new($image2_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $image2_demo - $image2_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'image2'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# ÊÑ¿ôÀ¸À® -$dirName = TkVariable.new([$demo_dir,'images'].join(File::Separator)) - -# image -$image2a = TkPhotoImage.new - -# -TkLabel.new($image2_demo, 'text'=>'Directory:')\ -.pack('side'=>'top', 'anchor'=>'w') - -image2_e = TkEntry.new($image2_demo) { - width 30 - textvariable $dirName -}.pack('side'=>'top', 'anchor'=>'w') - -TkFrame.new($image2_demo, 'height'=>'3m', 'width'=>20)\ -.pack('side'=>'top', 'anchor'=>'w') - -TkLabel.new($image2_demo, 'text'=>'File:')\ -.pack('side'=>'top', 'anchor'=>'w') - -TkFrame.new($image2_demo){|w| - s = TkScrollbar.new(w) - l = TkListbox.new(w) { - width 20 - height 10 - yscrollcommand proc{|first,last| s.set first,last} - } - s.command(proc{|*args| l.yview(*args)}) - l.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y') - s.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y') - #l.insert(0,'earth.gif', 'earthris.gif', 'mickey.gif', 'teapot.ppm') - l.insert(0,'earth.gif', 'earthris.gif', 'teapot.ppm') - l.bind('Double-1', proc{|x,y| loadImage $image2a,l,x,y}, '%x %y') - - image2_e.bind 'Return', proc{loadDir l} - -}.pack('side'=>'top', 'anchor'=>'w') - -# image -[ TkFrame.new($image2_demo, 'height'=>'3m', 'width'=>20), - TkLabel.new($image2_demo, 'text'=>'Image:'), - TkLabel.new($image2_demo, 'image'=>$image2a) -].each{|w| w.pack('side'=>'top', 'anchor'=>'w')} - -# -def loadDir(w) - w.delete(0,'end') - Dir.glob([$dirName,'*'].join(File::Separator)).sort.each{|f| - w.insert('end',File.basename(f)) - } -end - -def loadImage(img,w,x,y) - img.file([$dirName, w.get("@#{x},#{y}")].join(File::Separator)) -end - diff --git a/ext/tk/sample/demos-en/image3.rb b/ext/tk/sample/demos-en/image3.rb deleted file mode 100644 index d997ef7772..0000000000 --- a/ext/tk/sample/demos-en/image3.rb +++ /dev/null @@ -1,121 +0,0 @@ -# image3.rb -# -# This demonstration script creates a simple collection of widgets -# that allow you to select and view images in a Tk label. -# -# widget demo 'load image' (called by 'widget') -# - -# toplevel widget -if defined?($image3_demo) && $image3_demo - $image3_demo.destroy - $image3_demo = nil -end - -# demo toplevel widget -$image3_demo = TkToplevel.new {|w| - title('Image Demonstration #3') - iconname("Image3") - positionWindow(w) -} - -# -def loadDir(w) - w.delete(0,'end') - Dir.glob([$dirName,'*'].join(File::Separator)).sort.each{|f| - w.insert('end',File.basename(f)) - } -end - -# selectAndLoadDir -- -# This procedure pops up a dialog to ask for a directory to load into -# the listobx and (if the user presses OK) reloads the directory -# listbox from the directory named in the demo's entry. -# -# Arguments: -# w - Name of the toplevel window of the demo. -def selectAndLoadDir(w, lbox) - dir = Tk.chooseDirectory(:initialdir=>$dirName, :parent=>w, :mustexist=>true) - if dir.length > 0 - $dirName.value = dir - loadDir(lbox) - end -end - -def loadImage(w,x,y) - $image3a.file([$dirName, w.get("@#{x},#{y}")].join(File::Separator)) -end - - -# label -msg = TkLabel.new($image3_demo) { - font $font - wraplength '4i' - justify 'left' - text "This demonstration allows you to view images using a Tk \"photo\" image. First type a directory name in the listbox, then type Return to load the directory into the listbox. Then double-click on a file name in the listbox to see that image." -} -msg.pack('side'=>'top') - -# frame -TkFrame.new($image3_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $image3_demo - $image3_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'image3'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# variable -$dirName = TkVariable.new([$demo_dir,'images'].join(File::Separator)) - -# image -begin - $image3a.delete -rescue -end -$image3a = TkPhotoImage.new - -# -image3_f = TkFrame.new($image3_demo).pack(:fill=>:both, :expand=>true) - -image3_df = TkLabelFrame.new($image3_demo, :text=>'Directory:') - -image3_ff = TkLabelFrame.new($image3_demo, :text=>'File:', - :padx=>'2m', :pady=>'2m') -image3_lbx = TkListbox.new(image3_ff, :width=>20, :height=>10) { - pack(:side=>:left, :fill=>:y, :expand=>true) - yscrollbar(TkScrollbar.new(image3_ff).pack(:side=>:left, :fill=>:y, - :expand=>true)) - insert(0, *(%w(earth.gif earthris.gif teapot.ppm))) - bind('Double-1', proc{|x,y| loadImage(self, x, y)}, '%x %y') -} - -image3_ent = TkEntry.new(image3_df, :width=>30, :textvariable=>$dirName){ - pack(:side=>:left, :fill=>:both, :padx=>'2m', :pady=>'2m', :expand=>true) - bind('Return', proc{loadDir(image3_lbx)}) -} - -TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"Select Dir.", - :command=>proc{selectAndLoadDir(image3_ent, image3_lbx)}) { - pack(:side=>:left, :fill=>:y, :padx=>[0, '2m'], :pady=>'2m') -} - -image3_if = TkLabelFrame.new($image3_demo, :text=>'Image:') {|f| - TkLabel.new(f, :image=>$image3a).pack(:padx=>'2m', :pady=>'2m') -} - -Tk.grid(image3_df, '-', - :sticky=>:ew, :padx=>'1m', :pady=>'1m', :in=>image3_f) -Tk.grid(image3_ff, image3_if, - :sticky=>:nw, :padx=>'1m', :pady=>'1m', :in=>image3_f) -TkGrid.columnconfigure(image3_f, 1, :weight=>1) - diff --git a/ext/tk/sample/demos-en/images/earth.gif b/ext/tk/sample/demos-en/images/earth.gif Binary files differdeleted file mode 100644 index 3ae4a9ce01..0000000000 --- a/ext/tk/sample/demos-en/images/earth.gif +++ /dev/null diff --git a/ext/tk/sample/demos-en/images/earthris.gif b/ext/tk/sample/demos-en/images/earthris.gif Binary files differdeleted file mode 100644 index 48f08c4421..0000000000 --- a/ext/tk/sample/demos-en/images/earthris.gif +++ /dev/null diff --git a/ext/tk/sample/demos-en/images/face.xbm b/ext/tk/sample/demos-en/images/face.xbm deleted file mode 100644 index 03d829f4d1..0000000000 --- a/ext/tk/sample/demos-en/images/face.xbm +++ /dev/null @@ -1,173 +0,0 @@ -#define face_width 108 -#define face_height 144 -#define face_x_hot 48 -#define face_y_hot 80 -static char face_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x09, - 0x20, 0x80, 0x24, 0x05, 0x00, 0x80, 0x08, 0x00, 0x00, 0x00, 0x00, 0x88, - 0x24, 0x20, 0x80, 0x24, 0x00, 0x00, 0x00, 0x10, 0x80, 0x04, 0x00, 0x01, - 0x00, 0x01, 0x40, 0x0a, 0x09, 0x00, 0x92, 0x04, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x40, 0x12, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x84, - 0x24, 0x40, 0x22, 0xa8, 0x02, 0x14, 0x84, 0x92, 0x40, 0x42, 0x12, 0x04, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x52, 0x11, 0x00, 0x12, 0x00, - 0x40, 0x02, 0x00, 0x20, 0x00, 0x08, 0x00, 0xaa, 0x02, 0x54, 0x85, 0x24, - 0x00, 0x10, 0x12, 0x00, 0x00, 0x81, 0x44, 0x00, 0x90, 0x5a, 0x00, 0xea, - 0x1b, 0x00, 0x80, 0x40, 0x40, 0x02, 0x00, 0x08, 0x00, 0x20, 0xa2, 0x05, - 0x8a, 0xb4, 0x6e, 0x45, 0x12, 0x04, 0x08, 0x00, 0x00, 0x00, 0x10, 0x02, - 0xa8, 0x92, 0x00, 0xda, 0x5f, 0x10, 0x00, 0x10, 0xa1, 0x04, 0x20, 0x41, - 0x02, 0x00, 0x5a, 0x25, 0xa0, 0xff, 0xfb, 0x05, 0x41, 0x02, 0x04, 0x00, - 0x00, 0x08, 0x40, 0x80, 0xec, 0x9b, 0xec, 0xfe, 0x7f, 0x01, 0x04, 0x20, - 0x90, 0x02, 0x04, 0x00, 0x08, 0x20, 0xfb, 0x2e, 0xf5, 0xff, 0xff, 0x57, - 0x00, 0x04, 0x02, 0x00, 0x00, 0x20, 0x01, 0xc1, 0x6e, 0xab, 0xfa, 0xff, - 0xff, 0x05, 0x90, 0x20, 0x48, 0x02, 0x00, 0x04, 0x20, 0xa8, 0xdf, 0xb5, - 0xfe, 0xff, 0xff, 0x0b, 0x01, 0x00, 0x01, 0x00, 0x80, 0x80, 0x04, 0xe0, - 0xbb, 0xef, 0xff, 0xff, 0x7f, 0x01, 0x00, 0x04, 0x48, 0x02, 0x00, 0x20, - 0x80, 0xf4, 0x6f, 0xfb, 0xff, 0xff, 0xff, 0x20, 0x90, 0x40, 0x02, 0x00, - 0x00, 0x04, 0x08, 0xb8, 0xf6, 0xff, 0xff, 0xdf, 0xbe, 0x12, 0x45, 0x10, - 0x90, 0x04, 0x90, 0x00, 0x22, 0xfa, 0xff, 0xff, 0xff, 0xbb, 0xd7, 0xe9, - 0x3a, 0x02, 0x02, 0x00, 0x04, 0x90, 0x80, 0xfe, 0xdf, 0xf6, 0xb7, 0xef, - 0xbe, 0x56, 0x57, 0x40, 0x48, 0x09, 0x00, 0x04, 0x00, 0xfa, 0xf5, 0xdf, - 0xed, 0x5a, 0xd5, 0xea, 0xbd, 0x09, 0x00, 0x00, 0x40, 0x00, 0x92, 0xfe, - 0xbf, 0x7d, 0xb7, 0x6a, 0x55, 0xbf, 0xf7, 0x02, 0x11, 0x01, 0x00, 0x91, - 0x00, 0xff, 0xff, 0xaf, 0x55, 0x55, 0x5b, 0xeb, 0xef, 0x22, 0x04, 0x04, - 0x04, 0x00, 0xa4, 0xff, 0xf7, 0xad, 0xaa, 0xaa, 0xaa, 0xbe, 0xfe, 0x03, - 0x20, 0x00, 0x10, 0x44, 0x80, 0xff, 0x7f, 0x55, 0x12, 0x91, 0x2a, 0xeb, - 0xbf, 0x0b, 0x82, 0x02, 0x00, 0x00, 0xd1, 0x7f, 0xdf, 0xa2, 0xa4, 0x54, - 0x55, 0xfd, 0xfd, 0x47, 0x08, 0x08, 0x00, 0x21, 0xe4, 0xff, 0x37, 0x11, - 0x09, 0xa5, 0xaa, 0xb6, 0xff, 0x0d, 0x80, 0x00, 0x00, 0x04, 0xd0, 0xff, - 0x4f, 0x44, 0x20, 0x48, 0x55, 0xfb, 0xff, 0x27, 0x11, 0x02, 0x40, 0x40, - 0xe2, 0xfb, 0x15, 0x11, 0x4a, 0x55, 0x4a, 0x7d, 0xf7, 0x0f, 0x00, 0x00, - 0x04, 0x08, 0xf8, 0xdf, 0x52, 0x44, 0x01, 0x52, 0xb5, 0xfa, 0xff, 0x0f, - 0x49, 0x02, 0x00, 0x02, 0xe9, 0xf6, 0x0a, 0x11, 0xa4, 0x88, 0x4a, 0x6d, - 0xff, 0x5f, 0x00, 0x00, 0x10, 0x20, 0xf0, 0x2f, 0x21, 0x44, 0x10, 0x52, - 0xb5, 0xfa, 0xff, 0x0f, 0x44, 0x04, 0x80, 0x08, 0xf8, 0xab, 0x8a, 0x00, - 0x81, 0xa4, 0xd4, 0xd6, 0xfe, 0x2f, 0x00, 0x00, 0x04, 0x40, 0xb5, 0x2d, - 0x21, 0x08, 0x04, 0x90, 0xaa, 0xfa, 0xff, 0x1f, 0x11, 0x01, 0x00, 0x04, - 0xf0, 0x57, 0x0a, 0x22, 0x40, 0x4a, 0xda, 0x5e, 0xfb, 0x1f, 0x40, 0x00, - 0x40, 0x20, 0xba, 0x95, 0x90, 0x00, 0x01, 0xa0, 0xaa, 0xea, 0xff, 0x5f, - 0x02, 0x02, 0x00, 0x01, 0xe8, 0x57, 0x05, 0x00, 0x00, 0x12, 0xd5, 0xfe, - 0xfd, 0x1f, 0x48, 0x00, 0x04, 0x48, 0x7a, 0x95, 0x08, 0x02, 0x10, 0x40, - 0xaa, 0x55, 0xf7, 0x1f, 0x00, 0x09, 0x20, 0x00, 0xf8, 0x57, 0x22, 0x10, - 0x00, 0x28, 0xa9, 0xfa, 0xff, 0x5f, 0x02, 0x00, 0x00, 0x49, 0xdd, 0x29, - 0x01, 0x00, 0x80, 0x80, 0xaa, 0xd7, 0xff, 0x0f, 0x10, 0x00, 0x08, 0x00, - 0xf8, 0x96, 0x08, 0x00, 0x00, 0x20, 0x54, 0xfa, 0xee, 0x3f, 0x81, 0x04, - 0x40, 0x24, 0xfe, 0x55, 0x82, 0x00, 0x00, 0x82, 0xd2, 0xad, 0xff, 0x0f, - 0x08, 0x00, 0x04, 0x80, 0x6c, 0x97, 0x00, 0x00, 0x02, 0x20, 0xa9, 0xf6, - 0xdf, 0x5f, 0x00, 0x02, 0x20, 0x09, 0xfa, 0x49, 0x12, 0x00, 0x20, 0x84, - 0x54, 0xdb, 0xfe, 0x1f, 0x91, 0x00, 0x00, 0x00, 0xf8, 0x2b, 0x00, 0x20, - 0x00, 0x40, 0xa4, 0xf6, 0xbb, 0x1f, 0x04, 0x00, 0x44, 0x92, 0x7e, 0x95, - 0x02, 0x00, 0x00, 0x89, 0xaa, 0xdd, 0xff, 0x1f, 0x20, 0x09, 0x10, 0x00, - 0xf4, 0x57, 0x20, 0x01, 0x08, 0x20, 0xa9, 0x76, 0xff, 0x5f, 0x02, 0x00, - 0x00, 0x21, 0xfc, 0x4a, 0x05, 0x00, 0x01, 0x80, 0x54, 0xdb, 0xff, 0x1e, - 0x08, 0x02, 0x04, 0x08, 0xf9, 0x2b, 0x00, 0x00, 0x40, 0x28, 0xd2, 0xf6, - 0xff, 0xbf, 0x80, 0x00, 0x90, 0x00, 0xbc, 0x92, 0x08, 0x10, 0x00, 0x82, - 0x54, 0xdb, 0xff, 0x1f, 0x20, 0x00, 0x00, 0x44, 0xf9, 0x55, 0x02, 0x01, - 0x00, 0x20, 0xaa, 0xbd, 0xfd, 0x3f, 0x08, 0x04, 0x04, 0x10, 0xf4, 0x2a, - 0x01, 0x00, 0x22, 0x80, 0xd4, 0xf6, 0xff, 0x5f, 0x82, 0x00, 0x40, 0x02, - 0xf8, 0x55, 0x20, 0x00, 0x00, 0x50, 0x6a, 0xdf, 0xfe, 0x3f, 0x00, 0x00, - 0x00, 0x48, 0xe9, 0x4a, 0x05, 0x08, 0x00, 0xa5, 0xd5, 0xf5, 0xff, 0x3f, - 0x10, 0x01, 0x10, 0x01, 0xb0, 0xab, 0x92, 0x02, 0x40, 0xf8, 0xbf, 0xde, - 0xfe, 0x5f, 0x02, 0x04, 0x04, 0x48, 0xfa, 0xd4, 0x6f, 0x20, 0x84, 0xef, - 0xff, 0xfb, 0xff, 0x1f, 0x20, 0x00, 0x00, 0x00, 0xe0, 0xed, 0xbf, 0x0b, - 0xa1, 0x7e, 0xff, 0xbf, 0xfd, 0x5f, 0x04, 0x01, 0x20, 0x49, 0xd2, 0xfb, - 0xfe, 0x55, 0xd4, 0xff, 0xff, 0xf6, 0xff, 0x07, 0x00, 0x04, 0x00, 0x00, - 0xc0, 0xaa, 0xfb, 0x2b, 0xa2, 0xfe, 0xff, 0xdf, 0xee, 0x1f, 0x91, 0x00, - 0x82, 0xa4, 0xa4, 0xf5, 0xff, 0x57, 0xd5, 0xff, 0xbf, 0xfd, 0xff, 0x4d, - 0x00, 0x00, 0x20, 0x00, 0x88, 0x5b, 0xff, 0x2f, 0x69, 0xff, 0xff, 0xdb, - 0xfe, 0x1f, 0x24, 0x02, 0x00, 0x49, 0xa2, 0xd6, 0xff, 0x5f, 0xea, 0xff, - 0x7f, 0x7f, 0x7f, 0x0d, 0x00, 0x00, 0x10, 0x00, 0x40, 0xab, 0xf7, 0xbb, - 0xf0, 0xdf, 0xff, 0xd5, 0xff, 0xbf, 0x82, 0x04, 0x42, 0x24, 0x91, 0xd5, - 0xaa, 0xae, 0xd4, 0xaa, 0x52, 0x7b, 0xff, 0x15, 0x08, 0x00, 0x00, 0x01, - 0x04, 0x55, 0xd5, 0x55, 0x70, 0x5b, 0x75, 0xdd, 0xdf, 0x1f, 0x40, 0x00, - 0x08, 0x48, 0xa0, 0x4a, 0xa9, 0x56, 0xea, 0x56, 0xad, 0x6a, 0x7d, 0x9b, - 0x04, 0x01, 0x00, 0x02, 0x42, 0x2a, 0xd5, 0xaa, 0xa8, 0xaa, 0xaa, 0xfa, - 0xdf, 0x2f, 0x10, 0x04, 0x22, 0x48, 0x08, 0x45, 0x2a, 0x15, 0x68, 0x55, - 0x55, 0xd7, 0x76, 0x1b, 0x00, 0x00, 0x00, 0x01, 0x40, 0x2a, 0x80, 0xa0, - 0xb2, 0x09, 0x48, 0xb9, 0xdf, 0x17, 0x22, 0x01, 0x00, 0x24, 0x45, 0x8a, - 0x24, 0x4a, 0x54, 0x51, 0x91, 0xf6, 0x6e, 0x4b, 0x00, 0x04, 0x90, 0x00, - 0x80, 0x52, 0x00, 0x20, 0x69, 0x05, 0xa4, 0xaa, 0xff, 0x1e, 0x48, 0x00, - 0x02, 0x92, 0x08, 0x05, 0x81, 0x94, 0xd4, 0x92, 0x40, 0xfd, 0xb6, 0x8b, - 0x00, 0x01, 0x40, 0x00, 0x82, 0x54, 0x00, 0x48, 0x68, 0x05, 0x90, 0xa4, - 0xef, 0x06, 0x24, 0x00, 0x08, 0x12, 0x10, 0x05, 0x00, 0x10, 0xb5, 0x01, - 0x42, 0xfb, 0xbf, 0x43, 0x00, 0x09, 0x00, 0x40, 0x81, 0xa8, 0x08, 0x4a, - 0xaa, 0x96, 0x90, 0xac, 0x6d, 0x15, 0x22, 0x00, 0x20, 0x09, 0x04, 0x15, - 0x80, 0x28, 0xdc, 0x01, 0x24, 0xfb, 0xbf, 0x01, 0x80, 0x04, 0x09, 0x00, - 0x40, 0x48, 0x02, 0x45, 0xb2, 0x2e, 0x41, 0x6d, 0xef, 0x05, 0x11, 0x00, - 0x40, 0x52, 0x02, 0x15, 0x29, 0x2a, 0xac, 0x42, 0x54, 0xfb, 0x3b, 0x51, - 0x84, 0x00, 0x08, 0x00, 0x20, 0x54, 0x80, 0x05, 0xb5, 0x3d, 0xa2, 0xb6, - 0xdf, 0x00, 0x20, 0x04, 0x20, 0x49, 0x89, 0xa8, 0x6a, 0x29, 0xac, 0xd6, - 0x54, 0xff, 0x3f, 0x84, 0x00, 0x01, 0x04, 0x10, 0x00, 0x94, 0xa8, 0x56, - 0xda, 0x5f, 0xab, 0xd5, 0x1e, 0x10, 0x48, 0x00, 0x90, 0x82, 0x48, 0xa8, - 0xb2, 0xac, 0xfd, 0x55, 0xd5, 0xfe, 0x9f, 0x80, 0x00, 0x0a, 0x02, 0x08, - 0x02, 0x55, 0x5a, 0x75, 0xff, 0xaf, 0xb6, 0xf7, 0x2d, 0x12, 0x92, 0x00, - 0x10, 0x20, 0x10, 0xa8, 0x54, 0xd5, 0xbf, 0x5d, 0xad, 0xdd, 0x0f, 0x00, - 0x00, 0x04, 0x40, 0x09, 0x84, 0xa8, 0xaa, 0x5a, 0xed, 0xeb, 0x6a, 0xff, - 0x9f, 0xa4, 0x24, 0x01, 0x02, 0xa0, 0x20, 0x50, 0x55, 0xd5, 0xbe, 0xae, - 0xad, 0xfd, 0x16, 0x00, 0x10, 0x04, 0x20, 0x0a, 0x08, 0xb4, 0xaa, 0x95, - 0xaa, 0x7b, 0xb7, 0xdb, 0x5f, 0x92, 0x04, 0x01, 0x84, 0x20, 0x21, 0x51, - 0xd5, 0x2a, 0xa9, 0xee, 0xd5, 0xfe, 0x0d, 0x00, 0x20, 0x04, 0x10, 0x00, - 0x08, 0x50, 0xe9, 0xd7, 0xd4, 0xfb, 0xb5, 0xff, 0x9f, 0x24, 0x09, 0x01, - 0x42, 0x4a, 0xa2, 0x64, 0xd5, 0x55, 0x7b, 0x7f, 0xda, 0x7d, 0x4f, 0x00, - 0x20, 0x04, 0x00, 0x80, 0x00, 0xa0, 0x2a, 0x13, 0x84, 0x6a, 0x55, 0xff, - 0x1d, 0x48, 0x8a, 0x00, 0x94, 0x24, 0x8a, 0xc8, 0xaa, 0x42, 0x20, 0x5d, - 0xf5, 0xff, 0x5f, 0x01, 0x00, 0x02, 0x01, 0x00, 0x20, 0xa2, 0x4a, 0x1a, - 0x82, 0x56, 0xda, 0xbd, 0x3f, 0x92, 0x92, 0x00, 0x90, 0x92, 0x00, 0x40, - 0x95, 0x6a, 0xf4, 0x55, 0x6d, 0xff, 0xd6, 0x00, 0x00, 0x0a, 0x04, 0x20, - 0x14, 0x49, 0x4b, 0xaa, 0xaa, 0x56, 0xf5, 0xff, 0xbf, 0xab, 0xa4, 0x00, - 0x20, 0x89, 0x40, 0x80, 0xaa, 0xaa, 0xaa, 0xaa, 0xde, 0xbf, 0xeb, 0x03, - 0x00, 0x02, 0x04, 0x02, 0x0a, 0x10, 0x2b, 0x2a, 0x55, 0x5b, 0xf5, 0xff, - 0xd7, 0x2f, 0x92, 0x00, 0x10, 0x28, 0x21, 0x01, 0x56, 0x95, 0xa0, 0x56, - 0xdf, 0xef, 0xea, 0x87, 0x40, 0x0a, 0x42, 0x41, 0x00, 0x90, 0xaa, 0x52, - 0xb6, 0xad, 0xfa, 0xff, 0xd5, 0x2f, 0x14, 0x00, 0x00, 0x04, 0x95, 0x04, - 0xaa, 0xac, 0x55, 0x6b, 0xff, 0xb7, 0xea, 0x9f, 0x40, 0x02, 0x28, 0x51, - 0x00, 0x40, 0x58, 0xd5, 0xda, 0xd6, 0x6e, 0x7f, 0xf9, 0x3f, 0x12, 0x04, - 0x02, 0x04, 0x49, 0x25, 0x55, 0xaa, 0x77, 0xab, 0xff, 0x2b, 0xfd, 0x3f, - 0x48, 0x01, 0x20, 0x41, 0x00, 0x00, 0x58, 0xa9, 0xda, 0xea, 0xfd, 0xaf, - 0xfa, 0xff, 0x02, 0x04, 0x08, 0x14, 0x29, 0x49, 0x52, 0x55, 0x55, 0x55, - 0xff, 0x8d, 0xfe, 0x3f, 0xa8, 0x00, 0x02, 0x41, 0x00, 0x02, 0xa0, 0xa2, - 0xaa, 0xea, 0xff, 0x53, 0xfd, 0xff, 0x02, 0x04, 0x50, 0x04, 0x25, 0xa8, - 0x54, 0x49, 0x52, 0xb5, 0xbf, 0x8a, 0xfe, 0xff, 0xa9, 0x08, 0x04, 0x50, - 0x80, 0x02, 0xa1, 0x2a, 0x95, 0xea, 0xff, 0xa1, 0xff, 0xff, 0x03, 0x02, - 0x90, 0x02, 0x09, 0x08, 0x44, 0x49, 0x52, 0xbd, 0x7f, 0xca, 0xff, 0xff, - 0x2b, 0x09, 0x04, 0x48, 0x40, 0x82, 0x90, 0x56, 0xa9, 0xf6, 0xbf, 0xd0, - 0xff, 0xff, 0x47, 0x00, 0x50, 0x02, 0x15, 0x11, 0x40, 0x95, 0xaa, 0xfd, - 0x2f, 0xe9, 0xff, 0xff, 0x8f, 0x0a, 0x84, 0x50, 0x40, 0x84, 0x14, 0xaa, - 0x6a, 0xff, 0x5f, 0xf2, 0xff, 0xff, 0x7f, 0x00, 0x10, 0x02, 0x09, 0x10, - 0x40, 0x7d, 0xf7, 0xff, 0x0b, 0xfc, 0xff, 0xff, 0xaf, 0x02, 0x84, 0x50, - 0x42, 0x85, 0x12, 0xd0, 0xdd, 0xff, 0xa7, 0xf2, 0xff, 0xff, 0xff, 0x04, - 0x00, 0x0a, 0x08, 0x10, 0x48, 0xf8, 0xff, 0xff, 0x0a, 0xfe, 0xff, 0xff, - 0x7f, 0x03, 0xa4, 0x80, 0xa2, 0x8a, 0x02, 0x68, 0xff, 0xff, 0x52, 0xfd, - 0xff, 0xff, 0xff, 0x07, 0x00, 0x2a, 0x08, 0x20, 0x28, 0xdc, 0xff, 0x5f, - 0x05, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x92, 0x40, 0x22, 0x09, 0x02, 0xea, - 0xfb, 0xaf, 0x48, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x12, 0x81, 0xa0, - 0x48, 0x9c, 0x6e, 0x93, 0xa2, 0xff, 0xff, 0xff, 0xff, 0x07, 0xa8, 0x40, - 0x28, 0x0a, 0x02, 0x74, 0xb5, 0x45, 0x81, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0x02, 0x0a, 0x81, 0x20, 0x08, 0xae, 0xaa, 0x90, 0xe8, 0xff, 0xff, 0xff, - 0xff, 0x0f, 0x90, 0x40, 0x28, 0x88, 0x12, 0x58, 0x15, 0x50, 0xd0, 0xff, - 0xff, 0xff, 0xff, 0x0f, 0x44, 0x0a, 0x41, 0x21, 0x08, 0xae, 0x04, 0x14, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x40, 0x14, 0x88, 0x04, 0xba, - 0x02, 0x28, 0xe8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x42, 0x15, 0x41, 0x21, - 0x05, 0xad, 0x00, 0x05, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x40, - 0x24, 0x8a, 0x0e, 0x36, 0x00, 0x0a, 0xf4, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0x42, 0x25, 0x90, 0xd0, 0x8b, 0xc2, 0x41, 0x05, 0xfc, 0xff, 0xff, 0xff, - 0xff, 0x0f, 0x10, 0x08, 0x05, 0xe8, 0x8e, 0x58, 0x80, 0x02, 0xfa, 0xff, - 0xff, 0xff, 0xff, 0x0f, 0x4a, 0x20, 0xa8, 0xba, 0x0b, 0x2b, 0x51, 0x01, - 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x8a, 0x02, 0xe8, 0xaf, 0x84, - 0x90, 0x04, 0xfd, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x52, 0x21, 0x54, 0xbf, - 0x1f, 0x15, 0xa5, 0x02, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x08, - 0x01, 0xfa, 0xb6, 0xa4, 0x52, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0x4a, 0xa2, 0x54, 0xef, 0x5f, 0x4b, 0xa4, 0x80, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x0f, 0x80, 0x10, 0x82, 0xfe, 0xbf, 0x92, 0x52, 0x42, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x0f, 0x12, 0x42, 0xa8, 0xbf, 0x1f, 0x24, 0x80, 0xa0, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x84, 0x28, 0x8a, 0xf7, 0x37, 0x80, - 0x52, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x82, 0xe0, 0xff, - 0x1f, 0x00, 0x20, 0xe1, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x84, 0x28, - 0xca, 0xff, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0x10, 0x42, 0xf0, 0xfd, 0x1b, 0x00, 0x50, 0xf0, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x0f, 0xa4, 0x10, 0xc5, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x0f, 0x00, 0x22, 0xf8, 0xff, 0x0e, 0x00, 0x00, 0xf0, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xaa, 0x88, 0xe2, 0xff, 0x0f, 0x10, - 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x25, 0xfa, 0xff, - 0x0f, 0x01, 0x11, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xfb, - 0xfb, 0xff, 0x7f, 0x5d, 0xd5, 0xfa, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f}; diff --git a/ext/tk/sample/demos-en/images/flagdown.xbm b/ext/tk/sample/demos-en/images/flagdown.xbm deleted file mode 100644 index 55abc51825..0000000000 --- a/ext/tk/sample/demos-en/images/flagdown.xbm +++ /dev/null @@ -1,27 +0,0 @@ -#define flagdown_width 48 -#define flagdown_height 48 -static char flagdown_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xe1, 0x00, 0x00, - 0x00, 0x00, 0x70, 0x80, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x03, 0x00, - 0x00, 0x00, 0x0c, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x04, - 0x00, 0x00, 0x03, 0x00, 0x06, 0x06, 0x00, 0x80, 0x01, 0x00, 0x06, 0x07, - 0x00, 0xc0, 0x1f, 0x00, 0x87, 0x07, 0x00, 0xe0, 0x7f, 0x80, 0xc7, 0x07, - 0x00, 0x70, 0xe0, 0xc0, 0xe5, 0x07, 0x00, 0x38, 0x80, 0xe1, 0x74, 0x07, - 0x00, 0x18, 0x80, 0x71, 0x3c, 0x07, 0x00, 0x0c, 0x00, 0x3b, 0x1e, 0x03, - 0x00, 0x0c, 0x00, 0x1f, 0x0f, 0x00, 0x00, 0x86, 0x1f, 0x8e, 0x07, 0x00, - 0x00, 0x06, 0x06, 0xc6, 0x05, 0x00, 0x00, 0x06, 0x00, 0xc6, 0x05, 0x00, - 0x00, 0x06, 0x00, 0xc6, 0x04, 0x00, 0x00, 0x06, 0x00, 0x06, 0x04, 0x00, - 0x7f, 0x06, 0x00, 0x06, 0xe4, 0xff, 0x00, 0x06, 0x00, 0x06, 0x04, 0x00, - 0x00, 0x06, 0x00, 0x06, 0x04, 0x00, 0x00, 0x06, 0x00, 0x06, 0x06, 0x00, - 0x00, 0x06, 0x00, 0x06, 0x03, 0x00, 0x00, 0x06, 0x00, 0x86, 0x01, 0x00, - 0x00, 0x06, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x06, 0x00, 0x66, 0x00, 0x00, - 0x00, 0x06, 0x00, 0x36, 0x00, 0x00, 0x00, 0x06, 0x00, 0x3e, 0x00, 0x00, - 0x00, 0xfe, 0xff, 0x2f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x27, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, - 0xf7, 0xbf, 0x8e, 0xfc, 0xdf, 0xf8, 0x9d, 0xeb, 0x9b, 0x76, 0xd2, 0x7a, - 0x46, 0x30, 0xe2, 0x0f, 0xe1, 0x47, 0x55, 0x84, 0x48, 0x11, 0x84, 0x19}; diff --git a/ext/tk/sample/demos-en/images/flagup.xbm b/ext/tk/sample/demos-en/images/flagup.xbm deleted file mode 100644 index 6eb0d846a3..0000000000 --- a/ext/tk/sample/demos-en/images/flagup.xbm +++ /dev/null @@ -1,27 +0,0 @@ -#define flagup_width 48 -#define flagup_height 48 -static char flagup_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, - 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xef, 0x6a, 0x00, - 0x00, 0x00, 0xc0, 0x7b, 0x75, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0x6a, 0x00, - 0x00, 0x00, 0x30, 0x60, 0x75, 0x00, 0x00, 0x00, 0x18, 0xe0, 0x7f, 0x00, - 0x00, 0x00, 0x0c, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x06, 0xe0, 0x04, 0x00, - 0x00, 0x00, 0x03, 0xe0, 0x04, 0x00, 0x00, 0x80, 0x01, 0xe0, 0x06, 0x00, - 0x00, 0xc0, 0x1f, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x7f, 0xe0, 0x07, 0x00, - 0x00, 0x70, 0xe0, 0xe0, 0x05, 0x00, 0x00, 0x38, 0x80, 0xe1, 0x04, 0x00, - 0x00, 0x18, 0x80, 0xf1, 0x04, 0x00, 0x00, 0x0c, 0x00, 0xfb, 0x04, 0x00, - 0x00, 0x0c, 0x00, 0xff, 0x04, 0x00, 0x00, 0x86, 0x1f, 0xee, 0x04, 0x00, - 0x00, 0x06, 0x06, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0xe6, 0x04, 0x00, - 0x00, 0x06, 0x00, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0x66, 0x04, 0x00, - 0x7f, 0x56, 0x52, 0x06, 0xe4, 0xff, 0x00, 0x76, 0x55, 0x06, 0x04, 0x00, - 0x00, 0x56, 0x57, 0x06, 0x04, 0x00, 0x00, 0x56, 0x55, 0x06, 0x06, 0x00, - 0x00, 0x56, 0xd5, 0x06, 0x03, 0x00, 0x00, 0x06, 0x00, 0x86, 0x01, 0x00, - 0x54, 0x06, 0x00, 0xc6, 0x54, 0x55, 0xaa, 0x06, 0x00, 0x66, 0xaa, 0x2a, - 0x54, 0x06, 0x00, 0x36, 0x55, 0x55, 0xaa, 0x06, 0x00, 0xbe, 0xaa, 0x2a, - 0x54, 0xfe, 0xff, 0x6f, 0x55, 0x55, 0xaa, 0xfc, 0xff, 0xa7, 0xaa, 0x2a, - 0x54, 0x01, 0x88, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a, - 0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a, - 0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a, - 0x54, 0x55, 0x8d, 0x50, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa8, 0xaa, 0x2a, - 0x54, 0x55, 0x95, 0x54, 0x55, 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x2a, - 0x54, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/ext/tk/sample/demos-en/images/gray25.xbm b/ext/tk/sample/demos-en/images/gray25.xbm deleted file mode 100644 index b234b3cb0b..0000000000 --- a/ext/tk/sample/demos-en/images/gray25.xbm +++ /dev/null @@ -1,6 +0,0 @@ -#define grey_width 16 -#define grey_height 16 -static char grey_bits[] = { - 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, - 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, - 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44}; diff --git a/ext/tk/sample/demos-en/images/grey.25 b/ext/tk/sample/demos-en/images/grey.25 deleted file mode 100644 index b234b3cb0b..0000000000 --- a/ext/tk/sample/demos-en/images/grey.25 +++ /dev/null @@ -1,6 +0,0 @@ -#define grey_width 16 -#define grey_height 16 -static char grey_bits[] = { - 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, - 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, - 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44}; diff --git a/ext/tk/sample/demos-en/images/grey.5 b/ext/tk/sample/demos-en/images/grey.5 deleted file mode 100644 index 37688893f0..0000000000 --- a/ext/tk/sample/demos-en/images/grey.5 +++ /dev/null @@ -1,6 +0,0 @@ -#define grey_width 16 -#define grey_height 16 -static char grey_bits[] = { - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa}; diff --git a/ext/tk/sample/demos-en/images/letters.xbm b/ext/tk/sample/demos-en/images/letters.xbm deleted file mode 100644 index 0f12568d1a..0000000000 --- a/ext/tk/sample/demos-en/images/letters.xbm +++ /dev/null @@ -1,27 +0,0 @@ -#define letters_width 48 -#define letters_height 48 -static char letters_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, - 0x00, 0xfa, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, - 0x00, 0x3a, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2e, - 0xe0, 0xff, 0xff, 0xff, 0xff, 0x21, 0x20, 0x00, 0x00, 0x00, 0x00, 0x21, - 0xa0, 0x03, 0x00, 0x00, 0x70, 0x21, 0x20, 0x00, 0x00, 0x00, 0x50, 0x21, - 0xa0, 0x1f, 0x00, 0x00, 0x50, 0x21, 0x20, 0x00, 0x00, 0x00, 0x70, 0x21, - 0xfe, 0xff, 0xff, 0xff, 0x0f, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x21, - 0xfa, 0x01, 0x00, 0x80, 0x0b, 0x21, 0x02, 0x00, 0x00, 0x80, 0x0a, 0x21, - 0xba, 0x01, 0x00, 0x80, 0x0a, 0x21, 0x02, 0x00, 0x00, 0x80, 0x0b, 0x21, - 0x3a, 0x00, 0x00, 0x00, 0x08, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x21, - 0x02, 0xc0, 0xfb, 0x03, 0x08, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x3f, - 0x02, 0xc0, 0xbd, 0x0f, 0x08, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, - 0x02, 0xc0, 0x7f, 0x7b, 0x08, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, - 0x02, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, - 0xfe, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/ext/tk/sample/demos-en/images/noletter.xbm b/ext/tk/sample/demos-en/images/noletter.xbm deleted file mode 100644 index 5774124efe..0000000000 --- a/ext/tk/sample/demos-en/images/noletter.xbm +++ /dev/null @@ -1,27 +0,0 @@ -#define noletters_width 48 -#define noletters_height 48 -static char noletters_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00, - 0x00, 0xf0, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x7f, 0x00, - 0x00, 0x3e, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x1f, 0x00, 0x00, 0xf0, 0x01, - 0x80, 0x07, 0x00, 0x00, 0xc0, 0x03, 0xc0, 0x03, 0x00, 0x00, 0xe0, 0x07, - 0xe0, 0x01, 0x00, 0x00, 0xf0, 0x0f, 0xe0, 0x00, 0x00, 0x00, 0x78, 0x0e, - 0xf0, 0x00, 0x00, 0x00, 0x3c, 0x1e, 0x70, 0x00, 0x00, 0x00, 0x1e, 0x1c, - 0x38, 0x00, 0x00, 0x00, 0x0f, 0x38, 0x38, 0x00, 0x00, 0x80, 0x07, 0x38, - 0x3c, 0xfc, 0xff, 0xff, 0x7f, 0x78, 0x1c, 0x04, 0x00, 0xe0, 0x41, 0x70, - 0x1c, 0x04, 0x00, 0xf0, 0x40, 0x70, 0x1c, 0x74, 0x00, 0x78, 0x4e, 0x70, - 0x0e, 0x04, 0x00, 0x3c, 0x4a, 0xe0, 0x0e, 0x74, 0x03, 0x1e, 0x4a, 0xe0, - 0x0e, 0x04, 0x00, 0x0f, 0x4e, 0xe0, 0x0e, 0x04, 0x80, 0x07, 0x40, 0xe0, - 0x0e, 0x04, 0xf8, 0x0f, 0x40, 0xe0, 0x0e, 0x04, 0xe0, 0x01, 0x40, 0xe0, - 0x0e, 0x04, 0xf8, 0x00, 0x40, 0xe0, 0x0e, 0x04, 0x78, 0x00, 0x40, 0xe0, - 0x0e, 0x04, 0xfc, 0xf3, 0x40, 0xe0, 0x1c, 0x04, 0x1e, 0x00, 0x40, 0x70, - 0x1c, 0x04, 0x0f, 0x00, 0x40, 0x70, 0x1c, 0x84, 0x07, 0x00, 0x40, 0x70, - 0x3c, 0xfc, 0xff, 0xff, 0x7f, 0x78, 0x38, 0xe0, 0x01, 0x00, 0x00, 0x38, - 0x38, 0xf0, 0x00, 0x00, 0x00, 0x38, 0x70, 0x78, 0x00, 0x00, 0x00, 0x1c, - 0xf0, 0x3c, 0x00, 0x00, 0x00, 0x1e, 0xe0, 0x1e, 0x00, 0x00, 0x00, 0x0e, - 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x07, 0x00, 0x00, 0x80, 0x07, - 0x80, 0x07, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x1f, 0x00, 0x00, 0xf0, 0x01, - 0x00, 0x3e, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x7f, 0x00, - 0x00, 0xf0, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00}; diff --git a/ext/tk/sample/demos-en/images/pattern.xbm b/ext/tk/sample/demos-en/images/pattern.xbm deleted file mode 100644 index df31baf789..0000000000 --- a/ext/tk/sample/demos-en/images/pattern.xbm +++ /dev/null @@ -1,6 +0,0 @@ -#define foo_width 16 -#define foo_height 16 -static char foo_bits[] = { - 0x60, 0x06, 0x90, 0x09, 0x90, 0x09, 0xb0, 0x0d, 0x4e, 0x72, 0x49, 0x92, - 0x71, 0x8e, 0x8e, 0x71, 0x8e, 0x71, 0x71, 0x8e, 0x49, 0x92, 0x4e, 0x72, - 0xb0, 0x0d, 0x90, 0x09, 0x90, 0x09, 0x60, 0x06}; diff --git a/ext/tk/sample/demos-en/images/tcllogo.gif b/ext/tk/sample/demos-en/images/tcllogo.gif Binary files differdeleted file mode 100644 index 3fc7720b17..0000000000 --- a/ext/tk/sample/demos-en/images/tcllogo.gif +++ /dev/null diff --git a/ext/tk/sample/demos-en/images/teapot.ppm b/ext/tk/sample/demos-en/images/teapot.ppm deleted file mode 100644 index 78afefbf82..0000000000 --- a/ext/tk/sample/demos-en/images/teapot.ppm +++ /dev/null @@ -1,56 +0,0 @@ -P6 -256 256 -255 -\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À[7 eOLjQLmSMoTMnSMlRMhPL_9 \À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀnSMtVMzYN~[N~[N\N\O€\O€]O€]O€]O€]O€\O€\O}[NyYNtVM\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀG-wXN}[N€]O„^O†_O†`O‡`Oˆ`Oˆ`OˆaO‰aO‰aO‰aO‰aO‰aO‰aOˆaOˆ`O†_Oƒ^O\N\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀaMLyYN…_O‰aP‹bPcPŽcPŽdPŽdPdPdPdPdPdPdPdPeP‘eP’eP’eP‘ePdPcP…_OpUM\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀwXN…_OdP“fP•gQ–hQ˜hQ˜iQ™iQ™iQšiQšiQšjQ›jQ›jQœjQœjQœjQœjQœjQ›jQœjQ™iQ“fP‡`O\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀNCJiQL‹bP—hQkQ¡mR¤nR¥oR¥oR¥oR¥oR¥oR¥oR¦oR¦oR¦pR¨pS©qSªqS«rS¬rS«rS©qS¤oRœjQ€]O\KK\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀfOLrUMcPŸlR©qS¯tS²uTµwT·xT¸xT¹yTºyT»zT»zU¼zU¼zU¼zU»zUºyT¸xT¶wT¯tS¡mR‰aOhPL\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\Àa0 cNLqUM€\O”fQ¦pS²wVºzV¿|VÂ}VÄVÆVÇ€VÉ‚WÌ…[Õeæ w÷³‹êª…Ĉg§qT“fQ{ZNYIK9\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀO1{G#‘JkRMqUMtVN–iS¨v\·€d¹bµzZ±vU°uT®sSªqS¤nRœjQ’eP„^OrUMHh>!T4\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀG-V5wE"~I#†M%U+¥e7²l:°g2®b*a(`(©^(¥])¡^-›]1ŠS,qC$`9 R3G-\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À@)J/i>!pA"tD"wF$yH&xH&tE$wE#yG%}M+ƒT4S5mE*Z7!K/B*;'\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À‰aO¦oR½{UÇ€VÏ…X<(F-a: e<!h>!j@#k@$h>"d<!c=$hD-fF2[<)K0@);'5$Ë‚VÇ€V¿|U_LKYIK\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À…_O·xTÉ‚Wó«€ûµ‹Ö’k¼|X×>µf-¨^(¡Z'šW&–T&œN>)F-J/b; g>#nD(jB&c<!b=%jH2_A/I0!<(8&5$”J¥Y’S%8&;'?)E,<:HA=HE?IJAISFJYIKXIK\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À£nRÁ}UܘqÊŠe±vU²e,™V&¥V†C -€@|>y<u:r9o7l6 -j5 -h4 -g3 -5$D,K/b; h>"wM1tK.e="a<#cA,U8&E-<(9&.!a0 b1 c1 - -+3#@)46G<:HMCIXHK\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀU*´vT¿~X¸{YÃk+›W&‰N$|>u:p8k5 -f3 -a0 _/ ]. [- I¡\*ª_(‘LkRMmSMmSMnSMnSMD,R3W5mA"|O0|P1j?"c<!a=%Y7"N1F,;'NCJNCJNDJODJODJODJh>!a: X/K% -g3 -a0 Z- \/T*Q(ŠHµm8kRMmSMnTMoTMpTMpUM15G15G05G04G04GpUMpTM5^9 d<!yF#O+€N,rC#qB"pB#k?"a: Z7 6ODJPDJPEJQEJQEJREJREJREJRFJSFJSFJSFJSFJe<!X/ -^/ V+Q(L&I$r9 TlRMnSM46G47G47G46G46G46G46G46G36G36G25G25G15G04G/4F.3F -ˆ`O~[NqUM[- ‰HUGJUGJVGJVGJVHJWHJWHJWHKWHKXHKXHKXHKXHKXHKXIKXIKXIKXIKXIKh>!Y0 - -L&C!:4 -X&pUMuWMwXNxXN<:H<:H<:H<:H<;H<;H<;H<;H=;H=;H=;H=;H>;H>;H?<H@<HA=HC>HG@ILBIREJ[JKcNLjQL§pR±uTºzUÃ~VÈWË‚XÖŽcäsÒŽe¼{V²vT¨pSžkR•gQŒbP†_O‚^O]O€\O€\O€\O€\O€]O]O]O]O]O]O]O]O]O]O]O€\O€\O~\N}[N|ZNxXN•T%H$ -›W&rVMvWNyYNzYN|ZN}[N}[N><H?<H?<H?<H?<H?<H@<H@<H@<HA=HA=HB=HC>HE?IG@IIAIKBIODJSFJWHK—hQŸlR§pR°b(¾i*Én+Ù|7Û|6Ïr,Íq+Êp-Ãl+»g)±b(®sS§pS lRšiQ•gQePcPŠaPˆaO‡`O‡`O†_O†_O…_O…_O…_O…_O…_O…_O…_O„_O„^O„^Oƒ^Oƒ^O‚]O]O€\O~[N{ZN•T% - - - - -@%<-$G?@…pfdNLuWM\NdNL\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀTFJvWN‰aP./01„E}[N]O…_Oˆ`O‰aP‹bPŒbPcPcPŽcPdPdPdPeP‘eP’eP’eP“fP“fQ”fQ•gQ•gQ–gQ–hQ—hQ˜hQ™iQšiQ›jQœjQkQkRžlRŸlRžY&¤\'¨^'µ^½bÀcÃeÇi ÄgÀc½b¼a¹`µ^´]¯X¢[' Z'žY&¢mR¡mR¡mR lRŸlRŸlRžkRkQœkQœjQ›jQšjQšiQ™iQ™iQ˜iQ˜hQ—hQ—hQ—hQ–gQ–gQ•gQ•gQ•gQ”fQ”fQ“fQ“fP’eP‘ePdPcP‰aP—O - B\À\À\À\À\À\À\À\À\À\À%7!!C*F#P){dYœze»p€\OgPL\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀSFJ`LKvWNŠaPm6 - -\À\À\À\À\À\À\À\À\À B B -$5 ¬`(¶e)£nRœjQƒ^OJAI\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀXIK^KKdNLhPLuWM‚]OŒbP”fQeP -m6 -†`OŽcP“fQ—hQ˜hQ™iQšiQšjQ›jQ›jQ›jQœjQœjQœjQœkQkQkQkRžkRžkRžkRžlRŸlRŸlRŸlR lR lR lR¡mR¡mR¡mR¡mRºg)³c(²c(±b(V¿cÂeÅi!Åi!Àd¼bº`¹`·_·_¶^¢Q§]'ª_(`(¹f)£nR£nR£nR£nR£nR£nR£nR¢nR¢nR¢nR¢nR¢nR¢nR¢mR¢mR¢mR¢mR¢mR¢mR¢mR¢mR¢mR¢nR¢mR¢mR£nR¢mR¢mR¡mR mRkR—hQˆGa0 ŠbP mRœjQ“fQ‰aP}[NrUMmSM…L$\À\À\À\À\À\À\À\À B B -#C, 8&H.Z7 §pR›jQ{ZN\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀQEJ[JK`LKdNLhQLqUM{ZN…_OŽcP–gQ—hQ -‹bP‘eP–hQšiQ›jQœjQkQkQkRžkRžkRžlRžlRŸlRŸlRŸlRŸlRŸlR lR lR lR mR¡mR¡mR¡mR¡mR¡mR¢mR¢mR¢mR¢nR£nRÀj*ºg)·e)¶d)Âd°XÅgÅhÂe¿c½b½b¾bªU`(®a(¯a(³c(¾i*¤oR¤oR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤oR¤oR¥oR¥oR¥oR¥oR¥oR¥oR¦oR¦oR¥oR¥oR¤nR¡mR›jQŽQ%Z- œjQ£nRŸlR—hQŽdP…_OuWMpTMnSMkRLa: \À\À\À\À\À\À\À B B&D2 -@*S6#G@IPDJ˜hQmSM\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀVGJ]KKbMLeOLiQLlRMvWN\OˆaO‘eP—hQœjQ•gQ -\À\À\À\À\À B'D+E$(1J/jH1NCJUGJYIKUGJ\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀXHK]KKbNLfOLiQLkRMmSMoTMqUMxXN\N†_OŒbP’fP˜hQkQ¡mR¥oR§pS¦pR˜hQ¢mR¥oR¨pSªqS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rSªrSªrSªrS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS¬rS¬rS¬rS¬rS¬rS¬rS¬rS¬sS¬sSsSsSsSsSsSsS®sS®sS®sS®sS®tS¯tS°tS°uS±uS±uT±uT²uT²uT²uT´vTµwT´vT³vT²uT¯tS¢mR¯tS±uT±uS®tS«rS§pR¢mRkQ—hQ‘ePŠaPƒ^O\N{ZNvXNqUMpTMnSMlRMP%\À\À\À\À B#C*E$.E- .!G$Y:%d<"SFJYIKZIKNCJ\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀPDJZIK_LKdNLgPLjQLlRMnSMpTMqUMuWMyYN€\O†`OcP’fP—hQœjQ¡mR¥oR¨qS«rS«rSªrS mR -!C+E'0F.4F7%8%U/lG.SFJZIK]KKZIKB=H\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀREJZJK`LKdNLgPLjQLlRMnSMpTMqUMtWMxXN{ZN~[N]O„^O†`O‰aO‹bPdP•gQ™iQœkQ lR¤nR§pSªrSsS¯tT²uT´vT¶wT·xT¹yT¹yTºyTºyT¹yT¶xT´vT¬rS¢nR—hQ¿|U¿|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ}UÀ}UÁ}UÁ}UÁ}UÁ}UÂ}UÂ~UÃ~UÃ~VÃ~VÄVÅ€WÆX®a(ŸlRªrS´vT¸yT¼zU¾|UÁ~VÃXÆ‚[Ɇ_΋dÓ‘jÔ“mÔ“nБlÊŒhĆd½_¶{[°vWªsU¦pS¢nRžkRšiQ˜hQ•gQ“fQ‘ePdPŒbP‰aO†_Oƒ^O€\O|ZNxXNsVMpTMnTMmSMjQL€C B)D&/F-3F47G6%>"Y7 kA$YIK]KK^KKSFJ\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀVGJ\KKbMLeOLhPLkRLmSMnTMpTMrUMuWNyYN|ZN\N‚]O„_O‡`OŠaPŒbPŽcPeP“fP—hQ›jQžlR¢nR¥oS©qT¬sT¯uU²vU´wV¶xV¸yV¹yUºzU»zU¼{U½{U¾{U¾|U¿|U¿|U¿|U¿|U¾{U½{U¼{U¼zU»zTºyT¹yT¸xTµwT³vT´vT´vT´vT´wT´wTµwT·xT¹yTºzT¼zU½{U¾{U¿|UÀ|UÂ}UÄVÅ€WÇ‚YÉ„\͈_ÑŒdÙ”láuç£|쩂ſtî‡ëª…æ¦ÞŸ{Õ—sËŽl†d¹^³yZuW¨qU¤oSŸlRžkRœjQšiQ˜hQ–gQ”fQ‘ePdPcPŠaP‡`O„^O]O}[NyYNuWMpTMoTMmSMkRLgPL&D#.E,3F46G;'<(D"iB(VGJ]KK`LK[JKB>H\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀNCJYIK^LKcNLfOLiQLkRMmSMoTMqUMsVMvXNzYN}[N€\O‚^O…_Oˆ`OŠaPŒcPdP‘eP“fQ•gQ—hQ™iQkR mS¤oT¨rU¬tW°wY´zZ¸}\»]¾€^À^Á‚^‚^Â\Á€ZÁYÁXÁ~WÁ~WÂ~VÂ~VÂ~VÃ~VÃ~UÃ~UÄ~UÄ~UÄUÄUÅVÅVÅVÅVÆVÆ€VÆ€VÇ€WÇWÈ‚XɃZË…[͇^ЊaÓdØ’iÜ—nâtè£zî©ó¯‡ø´û¸‘üº“û¹“÷¶ñ±Œé©…à¡~Ö˜vËmÇf»€`´z[®vX©rU¥pT£oS¢nS lRžkRœkRšjQ˜iQ–hQ”fQ’ePdPcP‹bPˆ`O…_O‚]O~[NzYNvWNpTMoTMnSMkRMhQLo7,2F36G99HC+@ ]8 nA"\JK`ML_LKSFJ\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀSFJ[JK`LKdNLgPLjQLlRMnSMpTMqUMtVMwXNzZN}[N€]Oƒ^O†_OˆaO‹bPcPdP‘eP“fQ•gQ—hQ™iQ›jRžlR mS£oU§rW¬vZ²{]¹€a¿…fÅŠjËnГqÓ•sÕ–sÕ–rÕ–qÕ”oÓ’mÑjÏgÍŠcˈaɆ^È„\Ç‚[ÆYÅ€XÅ€WÅWÅWÅVÅVÅWÅ€WÆ€WÇXÈ‚YɃ[Ê…\͇_ÏŠaÒeÕ‘hÙ•mÝ™qávä¡zç¤}ê§€ë©ƒëª„é¨ƒå¥€ß |Ù›wÓ•rÌmƉh¿„c¸~^²yZ®vX¬tWªsV¨qU¦pT¤oS¢nS mRžlRœkR›jQ™iQ—hQ•gQ“fPePŽcP‹bPˆaO…_O‚^O\N{ZNwXNsVMoTMnSMlRMiQL~I#26G99G?<HA*E$ i@$ZIKaMLbML[JK;:H\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀWHJ]KKbMLeOLhPLjRLlSMnTMpTMrUMuWMxXN{ZN~\N]O„^O†`O‰aO‹bPŽcPdP’eP”fQ–gQ˜hQšiQœkRžlS mT£oU¦rWªuZ¯y]´~aºƒfŠlË’sÔšzÜ¡€ã§†è«‰ë®‹í¯Œí®‹ë¬ˆè¨„ã£~ßžyÚ™tÖ•oÒjÎŒfˈbÈ…_ƃ\ÅZÄ€YÃXÂWÂ~WÂ~WÂ~WÃXÀXÄ€YÅZƃ\Ç…^Ɇ`ˈbÌŠdÍ‹fÎgÎŽiÎŽjÎŽjÍŽjËŒiljgÆd¿ƒaº^¸}]¶|\´{[²yZ°xY®vX¬tWªsV¨qU¦pT¤oS¢nS mRžlRkR›jQ™iQ—hQ•gQ“fP‘ePŽdPŒbP‰aO†_Oƒ^O€\O|ZNxXNtVMpTMnSMmSMjQLgPL99G?<HG-E&b;!YIK`MLdOM`LKNCJ\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀŸlRºyTÄ~UÊ‚XʃYÄXº{WtUšW'¢[(—hQ lRcP€\OhQL\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀNCJYIK^LKcNLfOLiQLkRLmSMoTMqUMrVMvWNyYN|ZN\N‚]O„_O‡`O‰aPŒbPŽcPdP’fP”gQ–hQ˜iQšjRœkRžlS¡nT¤pU§sW«vZ°z]µb»„gŠlÉ‘sИyØžÞ¤…㩊èì±ï³‘ﳑëŠç©…⣀ݞzؘtÒ“nÎiɉdÆ…`Â]Á€[¿~Y¾}X½|W½|V¼{V¼{V¼{V¼{V¼{V¼|W¼|W½}X½}Y½~Z½~Z¼~Z»}[º}[º}[º~\º~\º~]º~]¹~]¸~]·}]¶|\´z[²yZ°wY®vX¬tWªsV¨rU¦pT¤oS¢nS mRŸlRkR›jQšiQ˜hQ–gQ“fQ‘ePdPŒcPŠaP‡`O„^O]O}[NyYNuWNpTMnTMmSMkRLhPL|H$D>IQ2P+XHK_LLfQOcNLXIK\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À©qSºyTÃ~VΈ`遲ޜv¾€]ªqS–LŽG|>g3 -S)?*%.—hQ—hQ‘eP‡`OuWM\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀSFJ[JK`LKdNLgPLjQLlRMnSMoTMqUMsVMwXNzYN}[N€\O‚^O…_O‡`OŠaPŒbPŽdP‘eP“fP•gQ—hQ˜iQšjRœkRŸlS¡nT¤pV§sX«vZ°z^¶b¼…gËmÊ’sјzØŸ€Þ¤…㩊èê¯ë°ê¯Žè¬‹å¨‡à¤‚Ûž|Ö™wÑ“qÌŽlljgÃ…bÀ‚_½\»}Zº{X¹zW¸yV·yU·xU·xU·xT·xT·xU·xU·xU·yV·yV·yW¸zW¸{X¹{Y¹|Zº}[º}[º}\º~\¹~]¹~]¸}]·|\µ{\´z[²yZ°wY®vX¬tWªsV¨rU¦pT¤oS¢nS¡mRŸlRkRœjQšiQ˜hQ–gQ”fQ’ePdPcPŠbP‡`O…_O‚]O~[NzZNvWNrUMoTMmSMlRMiQLeOLJAIJ(h>!]KKfQOgQN_LKD>I\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À™iQ°tS¸yT¼{UÂYÎŒeïˆô´Õ—u¶|\ Z'™LˆD -|> - -+,!.! "`E6†iYŒlZo\“q]•s^^J™va›wbycŸzd {e¤}foTMqUMsVMuWNwXNyYN{ZN|ZN~[N\O]O‚]Oƒ^O…_O†_O‡`Oˆ`O‰aOŠaP‹bPŒbPŒcPcPŽcPŽdPdPdPdPeP‘eP‘eP‘eP’eP’eP’eP’eP’fP’fP’fP“fP’fP’fP’fP’eP’eP’eP‘eP‘eP‘ePePdPdPdPŽdPŽcPcPŒcPŒbP‹bPŠaP‰aOˆ`O‡`O†_O…_Oƒ^O‚]O]O\O~[N|[N{ZNyYNwXN®ƒi¬ƒiª‚i¨i¦€hŒhR‰fQ†dQ‚bP•wfx]Oˆpdkbtd_m`]OEDG?A;:@.S….S….S….S….S…/S…/S…/S…/S…/S…/S…/S…/S…TxªTxªTxªTxªTxªTx«Tx«Tx«Ty«/S†GlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlž…ªÜ…ªÜ…ªÜHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlž…ªÜ…ªÜ£Ö£Ö£Ö£Ö¤Ö¤Ö¤Ö¤Ö¤ÖEi›€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤×€¤×€¤×€¤×€¥×€¥×€¥×Bg™Bg™Bg™Bg™Bg™&J|&J|&J|&J|&J|&J|&J|&J|&J|&J|&J|&J|&J|Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Af˜Af˜%J|%J|%J|%J|%J|%J|%J|%J|%J|%J|%I|%I|%I|%I|%I|%I| -+,YA5jPBpSD‹l[o]’q^–t`‚_Kšwbœycžze {f¡}g¤h¨i”lSrVMtWMvWNxXNyYN{ZN|[N~[N\O]O‚]Oƒ^O„_O…_O†`O‡`Oˆ`O‰aPŠaP‹bP‹bPŒbPcPcPŽcPŽcPdPdPdPdPdPdPdPdPePePePePePdPdPdPdPdPdPdPŽcPŽcPcPcPŒbP‹bP‹bPŠaP‰aOˆ`O‡`O†`O…_O„^Oƒ^O‚]O€]O\O~[N|[N{ZNyYNxXN°…j®„j¬„jªƒj¨‚j¦€jŒhSŠgS†eRƒcR|`QŒsf…oe}jcrd`k_]LCDC=@,,3(4F(4F.S….S…/S…/S…/S…/S…/S…/S…/S…TxªTxªTxªTxªTxªTxªTx«Tx«Tx«Ty«Ty«Ty«…ªÜHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlž†ªÜHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžChšChš¤Ö€¤Ö€¤Ö€¤Ö€¤ÖEi›Ei›Ei›€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤×€¤×€¤×€¤×Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Bg™Bg™&J|&J|&J|&J|&J|&J|&J|&J|&J|&J|Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜&J|%J|%J|%J|%J|%J|%J|%J|%J|%J|%J|%J|%I|%I|%I|%I|%I|#5H71O;3V?4iOBoSDsVFo]{[I^Kƒ`L…bN‡dOŸ{f }g¢~h¥€j’kT•mU˜oVšqWrWwXNxXNzYN{ZN}[N~[N\O€]O‚]Oƒ^O„^O…_O…_O†`O‡`Oˆ`O‰aO‰aPŠaP‹bP‹bPŒbPŒbPŒcPcPcPcPŽcPŽcPŽcPŽcPŽcPŽcPŽcPŽcPŽcPŽcPcPcPcPŒcPŒbP‹bP‹bP‹bPŠaP‰aP‰aOˆ`O‡`O†_O…_O„_O„^Oƒ^O]O€\O\N~[N|ZN{ZNyYN›oTšoT™oT—nT¬„lªƒl¨‚ljUŒiTŠhT†fT€cSvi‰rgnfyidqdah^^HBD?<@)+3OZkMYk(5F(5F(5F/S…/S…/S…/S…/S…TxªTxªTxªTxªTxªTxªTx«Tx«Ty«Ty«Ty«Ty«Uy«†ªÜ†ªÜ†ªÜ†ªÜHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlž†ªÜ†ªÜ†ªÜ†ªÜ†ªÜHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžDhšDhšDhšChš&K}&K}&K}&K}&K}&K}ChšChšCgšCgšCgšCgšCgšCgšCg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™&J|&J|&J|&J|&J|&J|Bg™Bg™Bg™Bf™Bf™Bf™Bf™Bf™Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜&J|&J|&J|&J|%J|%J|%J|%J|%J|%J|%J|%J|%J|%J|%J|%I|%I|A99N?;L:2T>4gNBlRD‡k\‹n^z[J~^LaN…cO‡dP‰fQŠgRŒhTjU’lV•nW˜pXšrXsY¶‹q¸qºŽr¼r½r¿s©z[©z[ªz[«{[¬{[¬{ZÅ“rÅ’qÅ’qÅ’pÅ’pÅ‘oyVxV¬xU¬wT¬wTŠaPŠbP‹bP‹bP‹bP‹bP‹bP‹bP‹bP‹bP‹bP‹bP‹bP‹bPŠaPŠaPŠaP‰aP‰aOˆaOˆ`O‡`O‡`O†_O…_O„^Oƒ^O‚^O‚]O]O€\O~\N}[N|ZNzYNpTœpU›pUšpU˜oV—oV•nV“mV‘lVkVŒjVˆhVƒfU~cUuj†qh~mfugdkaad\^E@D98?$(2minffm^blV^lMYk(5F(5F/S…TxªTxªTxªTxªTxªTxªTxªTx«Tx«Ty«Ty«Ty«Uy«Uy«†ªÜ†ªÜ†ªÜ†ªÜ†ªÜ†ªÜ†ªÜ†ªÜHlžHlžHlžHlžHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸ†ªÝ†ªÝ†ªÝ†ªÝ†ªÝ†ªÝ†ªÝ†ªÝ†ªÝ†ªÝHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸ'K}'K}'K}'K}'K}'K}'K}'K}'K}&K}&K}ChšChšChšChšChšChšChšCgšCgšCgšCgšCgšCgšCg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™&J|Cg™Cg™Cg™Cg™Cg™Bg™Bg™Bg™Bg™Bg™Bg™Bf™Bf™Bf™Bf™Bf™Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜&J|&J|&J|&J|&J|&J|&J|%J|%J|%J|%J|%J|%J|%J|Ae˜Ae˜;GY<68I=:I82Q=4XA6~fZ„j\‰m^p`|]L€`NƒcP†eQˆgS¡j£€l¦‚m©„n•oX˜qYšrZt[¶Œr¸sºs¼t½t¾‘t¨z]©{]ª{]«{\«{\¬{\¬{[Ä“sÄ“rÄ’rÄ’qÄ’pÄ‘p¬yWÄoÃnÃmÃlÂŽlÂŽkÁkˆaOˆaOˆaOˆaOˆaOˆaOˆaOˆ`Oˆ`O‡`O‡`O‡`O†`O†_O…_O…_O„_O„^Oƒ^O‚]O]O€]O\O~\N}[N|ZN¶‰l¶‰lµˆmœqV›qVšqV™pW˜pW–oW¬…nª…n§„n¤‚nŸ€n›~n€eW‘xlŠtk‚piykfodcf_`JDG@>C*,5$1MYktr~tstmolinadmX_lNZkMZkTxªTxªTxªTxªTx«Tx«Tx«Ty«Ty«Ty«Uy«Uy«Uy«†ªÝ†ªÝ†ªÝ†ªÝ†ªÝ†ªÝ†«Ý†«Ý†«Ý†«ÝHlŸHlŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸ†«Ý†«Ý†«Ý‡«Ý‡«Ý‡«Ý‡«Ý‡«Ý‡«Ý‡«Ý‡«Ý‡«Ý‡«ÝHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸ'K}'K}'K}'K}'K}'K}'K}'K}'K}'K}'K}'K}DhšDhšDhšDhšChšChšChšChšChšChšChšCgšCgšCgšCgšCgšCgšCg™Cg™Cg™Cg™Cg™&J}&J}&J}Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Bg™Bg™Bg™Bg™Bg™Bg™Bf™Bf™Bf™Bf™Bf˜Bf˜Bf˜Bf˜Bf˜&J|&J|&J|&J|&J|&J|&J|&J|&J|&J|Af˜Af˜Af˜Af˜;GY;GY;GY1'!D:9N?;N;3]I?zdY€h[†l^‹oasc“ue€bQ„dR‡fT l¢m¦ƒn©…o«‡p®ˆq±Šr³‹sžv] w]¹u»u¼‘u¾‘u¿’v¨{^©{^ª|^«|]«|]«{\¬{\¬{[¬{[¬zZ«zZ«yY«yX«xXÂoÂnÂnÁŽmÁŽm¨uT¨uS§tS§tS§tR¦sR¦sQ…_O…_O…_O„^O„^Oƒ^Oƒ^O‚^O‚]O]O€]O¢rS¡rS¡rS¸‰k·‰l·‰l¶‰m¶‰mµ‰m´‰n³‰n›qWšqX™qX®‡o‡o«†p¨…p¤ƒp pœp—}o{cXv`Vp]U}nishfhaba\_DAF::B$)4 -., 7(8'A1&F4(L8*oXIw]Jpdasfcvhexkg{mi~oj€qll\Xn^Yp`Zpa[qa\rb]rc^sc^sd_ue`wf`xgayhayhayhbxy‘y‘y‘y‘yy~ywgbvfateasd`qd`pc`nb_la_€ut|ssxqrunpZUXVRWROUMMSHIRIC@967-/3'+0(*-ACF?AD;=@#%( -.+>1(B3)B2&F4'E4)gTGlXJs^OzcTzaPqfethgvjhbVTcWUdXVeYWfZXg[Yh\Zi]Zi][j^\€us€ususts~tt~tt}tt|st{stut~tt|sszrsyqrwpquoqsmpqloXTXTQWPOULLSSJEA<:=99757335./2113)+.'),)+.8:="( -"6*#5*">2)>0&A2'C3(I8-^OFbRHfUJjXMq^RwcVzfYfRDfQCdN@zdTqijrjksklrklrklrklqjmpjmpjmojmojmnimmimkhliflscYm`Xg\VbYT^VRE>;A<:>98:77645:873220/0,-/)+.*,/#%( & - -&3#.$-% .% .& /&!,#,#@70A71XNHXNHWNHWNHZRLYQLYQLXQLWQLWPLUOLSNLQMKOLJMJJ0//.-.,,-&(+"(!' - -%' %$#" ! !$ - - - - - -* - ;?E7CU;HY=I[ diff --git a/ext/tk/sample/demos-en/items.rb b/ext/tk/sample/demos-en/items.rb deleted file mode 100644 index 8447430694..0000000000 --- a/ext/tk/sample/demos-en/items.rb +++ /dev/null @@ -1,374 +0,0 @@ -# items.rb -# -# This demonstration script creates a canvas that displays the -# canvas item types. -# -# canvas item types widget demo (called by 'widget') -# - -# toplevel widget -if defined?($items_demo) && $items_demo - $items_demo.destroy - $items_demo = nil -end - -# demo toplevel widget -$items_demo = TkToplevel.new {|w| - title("Canvas Item Demonstration") - iconname("Items") - positionWindow(w) -} - -# label -TkLabel.new($items_demo) { - font $font - wraplength '5i' - justify 'left' - text "This window contains a canvas widget with examples of the various kinds of items supported by canvases. The following operations are supported:\n Button-1 drag:\tmoves item under pointer.\n Button-2 drag:\trepositions view.\n Button-3 drag:\tstrokes out area.\n Ctrl+f:\t\tprints items under area." -}.pack('side'=>'top') - -# frame -TkFrame.new($items_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $items_demo - $items_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'items'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame -cvs = nil -TkFrame.new($items_demo) {|cf| - # canvas - cvs = TkCanvas.new(cf) {|c| - focus - scrollregion '0c 0c 30c 24c' - width '15c' - height '10c' - relief 'sunken' - borderwidth 2 - - hs = TkScrollbar.new(cf) {|s| - orient 'horizontal' - command proc{|*args| c.xview(*args)} - c.xscrollcommand proc{|first,last| s.set first,last} - } - - vs = TkScrollbar.new(cf) {|s| - command proc{|*args| c.yview(*args)} - c.yscrollcommand proc{|first,last| s.set first,last} - } - - if $tk_version =~ /^4\.[01]/ - hs.pack('side'=>'bottom', 'fill'=>'x') - vs.pack('side'=>'right', 'fill'=>'y') - c.pack('in'=>cf, 'expand'=>'yes', 'fill'=>'both') - - else - c.grid('in'=>cf, 'row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - vs.grid('row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - hs.grid('row'=>1, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - TkGrid.rowconfigure(cf, 0, 'weight'=>1, 'minsize'=>0) - TkGrid.columnconfigure(cf, 0, 'weight'=>1, 'minsize'=>0) - - end - - } -}.pack('side'=>'top', 'fill'=>'both', 'expand'=>'yes') - -# Display a 3x3 rectangular grid -TkcRectangle.new(cvs, '0c', '0c', '30c', '24c', 'width'=>2) -TkcLine.new(cvs, '0c', '8c', '30c', '8c', 'width'=>2) -TkcLine.new(cvs, '0c', '16c', '30c', '16c', 'width'=>2) -TkcLine.new(cvs, '10c', '0c', '10c', '24c', 'width'=>2) -TkcLine.new(cvs, '20c', '0c', '20c', '24c', 'width'=>2) - -font1 = '-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*' -font2 = '-Adobe-Helvetica-Bold-R-Normal--*-240-*-*-*-*-*-*' -if TkWinfo.depth($root).to_i > 1 - blue = 'DeepSkyBlue3' - red = 'red' - bisque = 'bisque3' - green = 'SeaGreen3' -else - blue = 'black' - red = 'black' - bisque = 'black' - green = 'black' -end - -# tag -$tag_item = TkcGroup.new(cvs) - -# Set up demos within each of the areas of the grid. -TkcText.new(cvs, '5c', '.2c', 'text'=>'Lines', 'anchor'=>'n') -TkcLine.new(cvs, '1c', '1c', '3c', '1c', '1c', '4c', '3c', '4c', - 'width'=>2, 'fill'=>blue, 'capstyle'=>'butt', - 'join'=>'miter', 'tags'=>$tag_item ) -TkcLine.new(cvs, '4.67c','1c','4.67c','4c', 'arrow'=>'last', 'tags'=>$tag_item) -TkcLine.new(cvs, '6.33c','1c','6.33c','4c', 'arrow'=>'both', 'tags'=>$tag_item) -TkcLine.new(cvs, '5c','6c','9c','6c','9c','1c','8c','1c','8c','4.8c','8.8c', - '4.8c','8.8c','1.2c','8.2c','1.2c','8.2c','4.6c','8.6c','4.6c', - '8.6c','1.4c','8.4c','1.4c','8.4c','4.4c', - 'width'=>3, 'fill'=>red, 'tags'=>$tag_item ) -TkcLine.new(cvs, '1c','5c','7c','5c','7c','7c','9c','7c', 'width'=>'.5c', - 'stipple'=>'@'+[$demo_dir, - 'images','gray25.xbm'].join(File::Separator), - 'arrow'=>'both', 'arrowshape'=>'15 15 7', 'tags'=>$tag_item ) -TkcLine.new(cvs, '1c','7c','1.75c','5.8c','2.5c','7c','3.25c','5.8c','4c','7c', - 'width'=>'.5c', 'capstyle'=>'round', 'join'=>'round', - 'tags'=>$tag_item ) - -TkcText.new(cvs, '15c', '.2c', - 'text'=>'Curves (smoothed lines)', 'anchor'=>'n') -TkcLine.new(cvs, '11c','4c','11.5c','1c','13.5c','1c','14c','4c', - 'smooth'=>'on', 'fill'=>blue, 'tags'=>$tag_item ) -TkcLine.new(cvs, '15.5c','1c','19.5c','1.5c','15.5c','4.5c','19.5c','4c', - 'smooth'=>'on', 'arrow'=>'both', 'width'=>3, 'tags'=>$tag_item ) -TkcLine.new(cvs, '12c','6c','13.5c','4.5c','16.5c','7.5c','18c','6c', - '16.5c','4.5c','13.5c','7.5c','12c','6c', - 'smooth'=>'on', 'width'=>'3m', 'capstyle'=>'round', - 'stipple'=>'@'+[$demo_dir, - 'images', 'gray25.xbm'].join(File::Separator), - 'fill'=>red, 'tags'=>$tag_item ) - -TkcText.new(cvs, '25c', '.2c', 'text'=>'Polygons', 'anchor'=>'n') -TkcPolygon.new(cvs, '21c','1.0c','22.5c','1.75c','24c','1.0c','23.25c','2.5c', - '24c','4.0c','22.5c','3.25c','21c','4.0c','21.75c','2.5c', - 'fill'=>'green', 'outline'=>'black', 'width'=>4, - 'tags'=>$tag_item ) -TkcPolygon.new(cvs, '25c','4c','25c','4c','25c','1c','26c','1c','27c','4c', - '28c','1c','29c','1c','29c','4c','29c','4c', - 'fill'=>red, 'smooth'=>'on', 'tags'=> $tag_item) -TkcPolygon.new(cvs, '22c','4.5c','25c','4.5c','25c','6.75c','28c','6.75c', - '28c','5.25c','24c','5.25c','24c','6.0c','26c','6c','26c', - '7.5c','22c','7.5c', - 'stipple'=>'@' + [$demo_dir, - 'images', 'gray25.xbm'].join(File::Separator), - 'outline'=>'black', 'tags'=>$tag_item ) - -TkcText.new(cvs, '5c', '8.2c', 'text'=>'Rectangles', 'anchor'=>'n') -TkcRectangle.new(cvs, '1c','9.5c','4c','12.5c', - 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item) -TkcRectangle.new(cvs, '0.5c','13.5c','4.5c','15.5c', - 'fill'=>green, 'tags'=>$tag_item ) -TkcRectangle.new(cvs, '6c','10c','9c','15c', 'outline'=>'', - 'stipple'=>'@'+[$demo_dir, - 'images','gray25.xbm'].join(File::Separator), - 'fill'=>blue, 'tags'=>$tag_item ) - -TkcText.new(cvs, '15c', '8.2c', 'text'=>'Ovals', 'anchor'=>'n') -TkcOval.new(cvs, '11c','9.5c','14c','12.5c', - 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item) -TkcOval.new(cvs, '10.5c','13.5c','14.5c','15.5c', - 'fill'=>green, 'tags'=>$tag_item ) -TkcOval.new(cvs, '16c','10c','19c','15c', 'outline'=>'', - 'stipple'=>'@'+[$demo_dir, - 'images','gray25.xbm'].join(File::Separator), - 'fill'=>blue, 'tags'=>$tag_item ) - -TkcText.new(cvs, '25c', '8.2c', 'text'=>'Text', 'anchor'=>'n') -TkcRectangle.new(cvs, '22.4c','8.9c','22.6c','9.1c') -TkcText.new(cvs, '22.5c', '9c', 'anchor'=>'n', 'font'=>font1, 'width'=>'4c', - 'text'=>'A short string of text, word-wrapped, justified left, and anchored north (at the top). The rectangles show the anchor points for each piece of text.', 'tags'=>$tag_item ) -TkcRectangle.new(cvs, '25.4c','10.9c','25.6c','11.1c') -TkcText.new(cvs, '25.5c', '11c', 'anchor'=>'w', 'font'=>font1, 'fill'=>blue, - 'text'=>'Several lines,\n each centered\nindividually,\nand all anchored\nat the left edge.', 'justify'=>'center', 'tags'=>$tag_item ) -TkcRectangle.new(cvs, '24.9c','13.9c','25.1c','14.1c') -if $tk_version =~ /^4\.[01]/ - TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red, - 'stipple'=>'@' + [$demo_dir, - 'images', 'grey.5'].join(File::Separator), - 'text'=>'Stippled characters', 'tags'=>$tag_item ) -else - TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red, - 'stipple'=>'gray50', 'text'=>'Stippled characters', - 'tags'=>$tag_item ) -end - -TkcText.new(cvs, '5c', '16.2c', 'text'=>'Arcs', 'anchor'=>'n') -TkcArc.new(cvs, '0.5c','17c','7c','20c', 'fill'=>green, 'outline'=>'black', - 'start'=>45, 'extent'=>270, 'style'=>'pieslice', 'tags'=>$tag_item) -#TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc', -# 'outline'=>blue, 'start'=>135, 'extent'=>270, -# 'outlinestipple'=>'@' + ['images', 'grey.25'].join(File::Separator), -# 'tags'=>$tag_item) -TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc', - 'outline'=>blue, 'start'=>135, 'extent'=>270, - 'outlinestipple'=>'@'+[$demo_dir, - 'images','gray25.xbm'].join(File::Separator), - 'tags'=>$tag_item) -TkcArc.new(cvs, '0.5c','20c','9.5c','24c', 'width'=>'4m', 'style'=>'pieslice', - 'fill'=>'', 'outline'=>red, 'start'=>225, 'extent'=>90, - 'tags'=>$tag_item) -TkcArc.new(cvs, '5.5c','20.5c','9.5c','23.5c', 'width'=>'4m', 'style'=>'chord', - 'fill'=>blue, 'outline'=>'', 'start'=>45, 'extent'=>270, - 'tags'=>$tag_item) - -TkcText.new(cvs, '15c', '16.2c', 'text'=>'Bitmaps', 'anchor'=>'n') -#TkcBitmap.new(cvs, '13c','20c', -# 'bitmap'=>'@' + ['images', 'face'].join(File::Separator), -# 'tags'=>$tag_item) -TkcBitmap.new(cvs, '13c','20c', - 'bitmap'=>'@' + [$demo_dir, - 'images', 'face.xbm'].join(File::Separator), - 'tags'=>$tag_item) -#TkcBitmap.new(cvs, '17c','18.5c', -# 'bitmap'=>'@' + ['images', 'noletters'].join(File::Separator), -# 'tags'=>$tag_item) -TkcBitmap.new(cvs, '17c','18.5c', - 'bitmap'=>'@' + [$demo_dir, - 'images', 'noletter.xbm'].join(File::Separator), - 'tags'=>$tag_item) -#TkcBitmap.new(cvs, '17c','21.5c', -# 'bitmap'=>'@' + ['images', 'letters'].join(File::Separator), -# 'tags'=>$tag_item) -# -TkcBitmap.new(cvs, '17c','21.5c') { - bitmap '@' + [$demo_dir, 'images', 'letters.xbm'].join(File::Separator) - tags $tag_item -} -#TkcBitmap.new(cvs, '17c','21.5c') { -# bitmap '@' + ['images', 'letters'].join(File::Separator) -# tags $tag_item -#} - -TkcText.new(cvs, '25c', '16.2c', 'text'=>'Windows', 'anchor'=>'n') -TkButton.new(cvs) {|b| - text 'Press Me' - command proc{butPress cvs, red} - TkcWindow.new(cvs, '21c','18c', - 'window'=>b, 'anchor'=>'nw', 'tags'=>$tag_item) -} -TkEntry.new(cvs, 'width'=>20, 'relief'=>'sunken') {|e| - insert 'end', 'Edit this text' - TkcWindow.new(cvs, '21c','21c', - 'window'=>e, 'anchor'=>'nw', 'tags'=>$tag_item) -} -TkScale.new(cvs, 'from'=>0, 'to'=>100, 'length'=>'6c', 'sliderlength'=>'.4c', - 'width'=>'.5c', 'tickinterval'=>0 ) {|scl| - TkcWindow.new(cvs, '28.5c','17.5c', - 'window'=>scl, 'anchor'=>'n', 'tags'=>$tag_item) -} -TkcText.new(cvs, '21c', '17.9c', 'text'=>'Button:', 'anchor'=>'sw') -TkcText.new(cvs, '21c', '20.9c', 'text'=>'Entry:', 'anchor'=>'sw') -TkcText.new(cvs, '28.5c', '17.4c', 'text'=>'Scale:', 'anchor'=>'s') - -# Set up event bindings for canvas: -cvs.itembind($tag_item, 'Any-Enter', proc{itemEnter cvs}) -cvs.itembind($tag_item, 'Any-Leave', proc{itemLeave cvs}) -cvs.bind('2', proc{|x,y| cvs.scan_mark x,y}, '%x %y') -cvs.bind('B2-Motion', proc{|x,y| cvs.scan_dragto x,y}, '%x %y') -cvs.bind('3', proc{|x,y| itemMark cvs,x,y}, '%x %y') -cvs.bind('B3-Motion', proc{|x,y| itemStroke cvs,x,y}, '%x %y') -cvs.bind('Control-f', proc{itemsUnderArea cvs}) -cvs.bind('1', proc{|x,y| itemStartDrag cvs,x,y}, '%x %y') -cvs.bind('B1-Motion', proc{|x,y| itemDrag cvs,x,y}, '%x %y') -# Utility methods for highlighting the item under the pointer - -$restoreCmd = nil -def itemEnter (c) - if TkWinfo.depth(c).to_i == 1 - $restoreCmd = nil - return - end - type = c.itemtype('current') - if type == TkcWindow - $restoreCmd = nil - return - end - if type == TkcBitmap - bg = (c.itemconfiginfo('current', 'background'))[4] - $restoreCmd = proc{c.itemconfigure 'current', 'background', bg} - c.itemconfigure 'current', 'background', 'SteelBlue2' - return - end - fill = (c.itemconfiginfo('current', 'fill'))[4] - if (type == TkcRectangle || type == TkcOval || type == TkcArc) && fill == [] - outline = (c.itemconfiginfo('current', 'outline'))[4] - $restoreCmd = proc{c.itemconfigure 'current', 'outline', outline} - c.itemconfigure 'current', 'outline', 'SteelBlue2' - else - $restoreCmd = proc{c.itemconfigure 'current', 'fill', fill} - c.itemconfigure 'current', 'fill', 'SteelBlue2' - end -end - -def itemLeave(c) - $restoreCmd.call if $restoreCmd -end - -# Utility methods for stroking out a rectangle and printing what's -# underneath the rectangle's area. - -def itemMark(c,x,y) - $areaX1 = c.canvasx(x) - $areaY1 = c.canvasy(y) - c.delete 'area' -end - -def itemStroke(c,x,y) - x = c.canvasx(x) - y = c.canvasy(y) - if $areaX1 != x && $areaY1 != y - c.delete 'area' - c.addtag_withtag 'area', TkcRectangle.new(c, $areaX1, $areaY1, x, y, - '-outline', 'black') - $areaX2 = x - $areaY2 = y - end -end - -def itemsUnderArea(c) - area = c.find_withtag('area') - items = [] - c.find_enclosed($areaX1,$areaY1,$areaX2,$areaY2).each{|i| - items.push(i) if i.gettags.include?($tag_item) - } - print "Items enclosed by area: #{items.inspect}\n"; STDOUT.flush - items.clear - c.find_overlapping($areaX1,$areaY1,$areaX2,$areaY2).each{|i| - items.push(i) if i.gettags.include?($tag_item) - } - print "Items overlapping area: #{items.inspect}\n"; STDOUT.flush -end - -$areaX1 = 0 -$areaY1 = 0 -$areaX2 = 0 -$areaY2 = 0 - -# Utility methods to support dragging of items. - -def itemStartDrag(c,x,y) - $lastX = c.canvasx(x) - $lastY = c.canvasy(y) -end - -def itemDrag(c,x,y) - x = c.canvasx(x) - y = c.canvasy(y) - c.move 'current', x - $lastX, y - $lastY - $lastX = x - $lastY = y -end - -# Method that's invoked when the button embedded in the canvas -# is invoked. - -def butPress(w,color) - i = TkcText.new(w, '25c', '18.1c', - 'text'=>'Ouch!!', 'fill'=>color, 'anchor'=>'n') - Tk.after(500, proc{w.delete i}) -end diff --git a/ext/tk/sample/demos-en/ixset b/ext/tk/sample/demos-en/ixset deleted file mode 100644 index 979894fcb8..0000000000 --- a/ext/tk/sample/demos-en/ixset +++ /dev/null @@ -1,333 +0,0 @@ -#!/usr/bin/env ruby - -# ixset -- -# A nice interface to "xset" to change X server settings -# - -require 'tk' - -class Xsettings - # - # Button actions - # - def quit - @root.destroy - end - - def ok - writesettings - quit - end - - def cancel - readsettings - dispsettings - end - - # apply is just "writesettings" - - - # - # Read current settings - # - def readsettings - xfd = open("|xset q", 'r') - xfd.readlines.each{|line| - fields = line.chomp.strip.split(/\s+/) - case fields[0] - when "auto" - if fields[1] == 'repeat:' - @kbdrep = fields[2] - @w_kbdrep.set(@kbdrep) - @kbdcli = fields[6] - end - - when "bell" - @bellvol = fields[2] - @bellpit = fields[5] - @belldur = fields[8] - - when "acceleration:" - @mouseacc = fields[1] - @mousethr = fields[3] - - when "prefer" - if fields[2] == 'yes' - @screenbla = 'blank' - else - @screenbla = 'noblank' - end - @w_screenbla.set(@screenbla) - - when "timeout:" - @screentim = fields[1] - @screencyc = fields[3] - - end - } - - xfd.close - end - - # - # Write settings into the X server - # - def writesettings - @bellvol = @w_bellvol.get - @bellpit = @w_bellpit.get - @belldur = @w_belldur.get - - @kbdrep = @w_kbdrep.get - if @kbdrep == 'on' - @kbdcli = @w_kbdcli.get - else - @kbdcli = 'off' - end - - @mouseacc = @w_mouseacc.get - @mousethr = @w_mousethr.get - - @screentim = @w_screentim.get - @screencyc = @w_screencyc.get - @screenbla = @w_screenbla.get - - system("xset \ - b #{@bellvol} #{@bellpit} #{@belldur} \ - c #{@kbdcli} \ - r #{@kbdrep} \ - m #{@mouseacc} #{@mousethr} \ - s #{@screentim} #{@screencyc} \ - s #{@screenbla}") - end - - # - # Sends all settings to the window - # - def dispsettings - @w_bellvol.set(@bellvol) - @w_bellpit.set(@bellpit) - @w_belldur.set(@belldur) - - @w_kbdonoff.set(@w_kbdrep.get) - @w_kbdcli.set(@kbdcli) - - @w_mouseacc.set(@mouseacc) - @w_mousethr.set(@mousethr) - - @w_screenblank.set(@w_screenbla.get) - @w_screenpat.set(@w_screenbla.get) - - @w_screentim.set(@screentim) - @w_screencyc.set(@screencyc) - end - - # - # Create all windows, and pack them - # - class LabelEntry - def initialize(parent, text, length) - @frame = TkFrame.new(parent) - TkLabel.new(@frame, 'text'=>text).pack('side'=>'left','expand'=>'y') - @entry = TkEntry.new(@frame, 'width'=>length, 'relief'=>'sunken') { - pack('side'=>'left','expand'=>'y') - } - end - def pack(keys) - @frame.pack(keys) - end - def get - @entry.value - end - def set(value) - @entry.delete(0,'end') - @entry.insert(0, value) - end - end - - def createwindows - win = self - - # - # Buttons - # - buttons = TkFrame.new(@root) {|f| - [ TkButton.new(f, 'command'=>proc{win.ok}, 'text'=>'Ok'), - TkButton.new(f, 'command'=>proc{win.writesettings}, 'text'=>'Apply'), - TkButton.new(f, 'command'=>proc{win.cancel}, 'text'=>'Cancel'), - TkButton.new(f, 'command'=>proc{win.quit}, 'text'=>'Quit') ].each{|b| - b.pack('side'=>'left', 'expand'=>'yes', 'pady'=>5) - } - } - - # - # Bell settings - # - bell = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2) - l = TkLabel.new(bell, 'text'=>'Bell Settings') - @w_bellvol = TkScale.new(bell, 'from'=>0, 'to'=>100, 'length'=>200, - 'tickinterval'=>20, 'orient'=>'horizontal', - 'label'=>"Volume (%)") - - f = TkFrame.new(bell) - @w_bellpit = LabelEntry.new(f, "Pitch (Hz)", 6) - @w_bellpit.pack('side'=>'left', 'padx'=>5) - @w_belldur = LabelEntry.new(f, "Duration (ms)", 6) - @w_belldur.pack('side'=>'right', 'padx'=>5) - - l.pack('side'=>'top', 'expand'=>'yes') - @w_bellvol.pack('side'=>'top', 'expand'=>'yes') - f.pack('side'=>'top', 'expand'=>'yes') - - # - # Keyboard settings - # - kbdonoff = nil - kbdcli = nil - kbd = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2) - l = TkLabel.new(kbd, 'text'=>'Keyboard Repeat Settings') - f = TkFrame.new(kbd) - @w_kbdonoff = TkCheckButton.new(f, 'text'=>'On', 'relief'=>'flat', - 'onvalue'=>'on', 'offvalue'=>'off', - 'variable'=>@w_kbdrep ) { - def self.set(value) - if value == 'on' - self.select - else - self.deselect - end - end - pack('side'=>'left', 'expand'=>'yes', 'fill'=>'both') - } - @w_kbdcli = TkScale.new(f, 'from'=>0, 'to'=>100, 'length'=>200, - 'tickinterval'=>20, 'orient'=>'horizontal', - 'label'=>'Click Volume (%)') - @w_kbdcli.pack('side'=>'left', 'expand'=>'yes') - l.pack('side'=>'top', 'expand'=>'yes') - f.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'fill'=>'x') - - # - # Mouse settings - # - mouse = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2) - l = TkLabel.new(mouse, 'text'=>'Mouse Settings') - f = TkFrame.new(mouse) - @w_mouseacc = LabelEntry.new(f, 'Acceleration', 3) - @w_mouseacc.pack('side'=>'left') - @w_mousethr = LabelEntry.new(f, 'Threshold (pixels)', 3) - @w_mousethr.pack('side'=>'right') - l.pack('side'=>'top') - f.pack('side'=>'top', 'expand'=>'yes') - - # - # Screen Saver settings - # - screen = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2) - l = TkLabel.new(screen, 'text'=>'Screen-saver Settings') - f = TkFrame.new(screen) - ff1 = TkFrame.new(f) - [ @w_screenblank = TkRadioButton.new(ff1, 'text'=>'Blank', - 'relief'=>'flat', - 'variable'=>@w_screenbla, - 'value'=>'blank') { - def self.set(value) - if value == 'blank' - self.select - else - self.deselect - end - end - }, - @w_screenpat = TkRadioButton.new(ff1, 'text'=>'Pattern', - 'relief'=>'flat', - 'variable'=>@w_screenbla, - 'value'=>'noblank') { - def self.set(value) - if value != 'blank' - self.select - else - self.deselect - end - end - } - ].each {|w| w.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w') } - - ff2 = TkFrame.new(f) - [ @w_screentim = LabelEntry.new(ff2, 'Timeout (s)', 5), - @w_screencyc = LabelEntry.new(ff2, 'Cycle (s)', 5) ].each{|w| - w.pack('side'=>'top', 'pady'=>2, 'anchor'=>'e') - } - - ff1.pack('side'=>'left') - ff2.pack('side'=>'left') - - l.pack('side'=>'top') - f.pack('side'=>'top', 'expand'=>'yes') - - # - # Main window - # - buttons.pack('side'=>'top', 'fill'=>'both') - bell.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes') - kbd.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes') - mouse.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes') - screen.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes') - - # - # Let the user resize our window - # - @root.minsize(10,10) - end - - def initialize - @root = TkRoot.new - - @kbdrep = 'on' - @w_kbdrep = TkVariable.new(@kbdrep) - def @w_kbdrep.get - self.value - end - def @w_kbdrep.set(val) - self.value=val - end - - @kbdcli = 0 - - @bellvol = 100 - @bellpit = 440 - @belldur = 100 - - @mouseacc = "3/1" - @mousethr = 4 - - @screenbla = "blank" - @w_screenbla = TkVariable.new(@screenbla) - def @w_screenbla.get - self.value - end - def @w_screenbla.set(val) - self.value=val - end - - @screentim = 600 - @screencyc = 600 - - # - # Listen what "xset" tells us... - # - readsettings - - # - # Create all windows - # - createwindows - - # - # Write xset parameters - # - dispsettings - end -end - -Xsettings.new - -Tk.mainloop diff --git a/ext/tk/sample/demos-en/ixset2 b/ext/tk/sample/demos-en/ixset2 deleted file mode 100644 index ce8472abe0..0000000000 --- a/ext/tk/sample/demos-en/ixset2 +++ /dev/null @@ -1,367 +0,0 @@ -#!/usr/bin/env ruby -# -# ixset -- -# A nice interface to "xset" to change X server settings -# - -require 'tk' - -class Xsettings - # - # Button actions - # - def quit - @root.destroy - end - - def ok - writesettings - quit - end - - def cancel - readsettings - dispsettings - @btn_APPLY.state(:disabled) - @btn_CANCEL.state(:disabled) - end - - # apply is just "writesettings" - def apply - writesettings - @btn_APPLY.state(:disabled) - @btn_CANCEL.state(:disabled) - end - - # - # Read current settings - # - def readsettings - xfd = open("|xset q", 'r') - xfd.readlines.each{|line| - fields = line.chomp.strip.split(/\s+/) - case fields[0] - when "auto" - if fields[1] == 'repeat:' - @kbdrep = fields[2] - @w_kbdrep.set(@kbdrep) - @kbdcli = fields[6] - end - - when "bell" - @bellvol = fields[2] - @bellpit = fields[5] - @belldur = fields[8] - - when "acceleration:" - @mouseacc = fields[1] - @mousethr = fields[3] - - when "prefer" - if fields[2] == 'yes' - @screenbla = 'blank' - else - @screenbla = 'noblank' - end - @w_screenbla.set(@screenbla) - - when "timeout:" - @screentim = fields[1] - @screencyc = fields[3] - - end - } - - xfd.close - end - - # - # Write settings into the X server - # - def writesettings - @bellvol = @w_bellvol.get - @bellpit = @w_bellpit.get - @belldur = @w_belldur.get - - @kbdrep = @w_kbdrep.get - if @kbdrep == 'on' - @kbdcli = @w_kbdcli.get - else - @kbdcli = 'off' - end - - @mouseacc = @w_mouseacc.get - @mousethr = @w_mousethr.get - - @screentim = @w_screentim.get - @screencyc = @w_screencyc.get - @screenbla = @w_screenbla.get - - system("xset \ - b #{@bellvol} #{@bellpit} #{@belldur} \ - c #{@kbdcli} \ - r #{@kbdrep} \ - m #{@mouseacc} #{@mousethr} \ - s #{@screentim} #{@screencyc} \ - s #{@screenbla}") - end - - # - # Sends all settings to the window - # - def dispsettings - @w_bellvol.set(@bellvol) - @w_bellpit.set(@bellpit) - @w_belldur.set(@belldur) - - @w_kbdonoff.set(@w_kbdrep.get) - @w_kbdcli.set(@kbdcli) - - @w_mouseacc.set(@mouseacc) - @w_mousethr.set(@mousethr) - - @w_screenblank.set(@w_screenbla.get) - @w_screenpat.set(@w_screenbla.get) - - @w_screentim.set(@screentim) - @w_screencyc.set(@screencyc) - end - - # - # Create all windows, and pack them - # - class LabelEntry - def initialize(parent, text, length, range=[]) - @frame = TkFrame.new(parent) - TkLabel.new(@frame, 'text'=>text).pack('side'=>'left') - if range.size > 0 - @entry = TkSpinbox.new(@frame, 'width'=>length, 'relief'=>'sunken', - 'from'=>range[0], 'to'=>range[1]) - else - @entry = TkEntry.new(@frame, 'width'=>length, 'relief'=>'sunken') - end - @entry.pack('side'=>'right','expand'=>'y', 'fill'=>'x') - end - def epath - @frame - end - def pack(keys) - @frame.pack(keys) - end - def get - @entry.value - end - def set(value) - @entry.delete(0,'end') - @entry.insert(0, value) - end - end - - def createwindows - win = self - - # - # Buttons - # - btn_frame = TkFrame.new(@root) - buttons = [ - @btn_OK = TkButton.new(btn_frame, 'command'=>proc{win.ok}, - 'default'=>'active', 'text'=>'Ok'), - @btn_APPLY = TkButton.new(btn_frame, 'command'=>proc{win.writesettings}, - 'default'=>'normal', 'text'=>'Apply', - 'state'=>'disabled'), - @btn_CANCEL = TkButton.new(btn_frame, 'command'=>proc{win.cancel}, - 'default'=>'normal', 'text'=>'Cancel', - 'state'=>'disabled'), - @btn_QUIT = TkButton.new(btn_frame, 'command'=>proc{win.quit}, - 'default'=>'normal', 'text'=>'Quit') - ] - buttons.each{|b| b.pack('side'=>'left', 'expand'=>'yes', 'pady'=>5) } - - @root.bind('Return', proc{@btn_OK.flash; @btn_OK.invoke}) - @root.bind('Escape', proc{@btn_QUIT.flash; @btn_QUIT.invoke}) - @root.bind('1', proc{|w| - unless buttons.index(w) - @btn_APPLY.state(:normal) - @btn_CANCEL.state(:normal) - end - }, '%W') - @root.bind('Key', proc{|w, k| - unless buttons.index(w) - case k - when 'Return', 'Escape', 'Tab', /.*Shift.*/ - # do nothing - else - @btn_APPLY.state(:normal) - @btn_CANCEL.state(:normal) - end - end - }, '%W %K') - - # - # Bell settings - # - bell = TkLabelframe.new(@root, 'text'=>'Bell Settings', - 'padx'=>'1.5m', 'pady'=>'1.5m') - @w_bellvol = TkScale.new(bell, 'from'=>0, 'to'=>100, 'length'=>200, - 'tickinterval'=>20, 'orient'=>'horizontal', - 'label'=>"Volume (%)") - - f = TkFrame.new(bell) - @w_bellpit = LabelEntry.new(f, "Pitch (Hz)", 6, [25, 20000]) - @w_bellpit.pack('side'=>'left', 'padx'=>5) - @w_belldur = LabelEntry.new(f, "Duration (ms)", 6, [1, 10000]) - @w_belldur.pack('side'=>'right', 'padx'=>5) - - @w_bellvol.pack('side'=>'top', 'expand'=>'yes') - f.pack('side'=>'top', 'expand'=>'yes') - - # - # Keyboard settings - # - kbdonoff = nil - kbdcli = nil - kbd = TkLabelframe.new(@root, 'text'=>'Keyboard Repeat Settings', - 'padx'=>'1.5m', 'pady'=>'1.5m') - f = TkFrame.new(kbd) - @w_kbdonoff = TkCheckButton.new(f, 'text'=>'On', 'relief'=>'flat', - 'onvalue'=>'on', 'offvalue'=>'off', - 'variable'=>@w_kbdrep ) { - def self.set(value) - if value == 'on' - self.select - else - self.deselect - end - end - pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x', 'padx'=>[0, '1m']) - } - @w_kbdcli = TkScale.new(f, 'from'=>0, 'to'=>100, 'length'=>200, - 'tickinterval'=>20, 'orient'=>'horizontal', - 'label'=>'Click Volume (%)') - @w_kbdcli.pack('side'=>'left', 'expand'=>'yes', - 'fill'=>'x', 'padx'=>['1m', 0]) - f.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'fill'=>'x') - - # - # Mouse settings - # - mouse = TkLabelframe.new(@root, 'text'=>'Mouse Settings', - 'padx'=>'1.5m', 'pady'=>'1.5m') - f = TkFrame.new(mouse) - @w_mouseacc = LabelEntry.new(f, 'Acceleration', 5) - @w_mouseacc.pack('side'=>'left', 'padx'=>[0, '1m']) - @w_mousethr = LabelEntry.new(f, 'Threshold (pixels)', 3, [1, 2000]) - @w_mousethr.pack('side'=>'right', 'padx'=>['1m', 0]) - f.pack('side'=>'top', 'expand'=>'yes') - - # - # Screen Saver settings - # - screen = TkLabelframe.new(@root, 'text'=>'Screen-saver Settings', - 'padx'=>'1.5m', 'pady'=>'1.5m') - @w_screenblank = TkRadioButton.new(screen, 'text'=>'Blank', - 'relief'=>'flat', 'anchor'=>'w', - 'variable'=>@w_screenbla, - 'value'=>'blank') { - def self.set(value) - if value == 'blank' - self.select - else - self.deselect - end - end - } - - @w_screenpat = TkRadioButton.new(screen, 'text'=>'Pattern', - 'relief'=>'flat', 'anchor'=>'w', - 'variable'=>@w_screenbla, - 'value'=>'noblank') { - def self.set(value) - if value != 'blank' - self.select - else - self.deselect - end - end - } - - @w_screentim = LabelEntry.new(screen, 'Timeout (s)', 5, [1, 100000]) - @w_screencyc = LabelEntry.new(screen, 'Cycle (s)', 5, [1, 100000]) - - Tk.grid(@w_screenblank, @w_screentim, 'sticky'=>'e') - Tk.grid(@w_screenpat, @w_screencyc, 'sticky'=>'e') - TkGrid.configure(@w_screenblank, @w_screenpat, 'sticky'=>'ew') - - # - # Main window - # - param = { - 'side'=>'top', 'fill'=>'both', 'expand'=>'yes', - 'padx'=>'1m', 'pady'=>'1m' - } - btn_frame.pack('side'=>'top', 'fill'=>'both') - bell.pack(param) - kbd.pack(param) - mouse.pack(param) - screen.pack(param) - - # - # Let the user resize our window - # - @root.minsize(10,10) - end - - def initialize(title) - @root = TkRoot.new('title'=>title) - - @kbdrep = 'on' - @w_kbdrep = TkVariable.new(@kbdrep) - def @w_kbdrep.get - self.value - end - def @w_kbdrep.set(val) - self.value=val - end - - @kbdcli = 0 - - @bellvol = 100 - @bellpit = 440 - @belldur = 100 - - @mouseacc = "3/1" - @mousethr = 4 - - @screenbla = "blank" - @w_screenbla = TkVariable.new(@screenbla) - def @w_screenbla.get - self.value - end - def @w_screenbla.set(val) - self.value=val - end - - @screentim = 600 - @screencyc = 600 - - # - # Listen what "xset" tells us... - # - readsettings - - # - # Create all windows - # - createwindows - - # - # Write xset parameters - # - dispsettings - end -end - -Xsettings.new(File.basename($0,'.rb')) - -Tk.mainloop diff --git a/ext/tk/sample/demos-en/label.rb b/ext/tk/sample/demos-en/label.rb deleted file mode 100644 index ef1bfa6f8a..0000000000 --- a/ext/tk/sample/demos-en/label.rb +++ /dev/null @@ -1,69 +0,0 @@ -# label.rb -# -# This demonstration script creates a toplevel window containing -# several label widgets. -# -# label widget demo (called by 'widget') -# - -# toplevel widget -if defined?($label_demo) && $label_demo - $label_demo.destroy - $label_demo = nil -end - -# demo toplevel widget -$label_demo = TkToplevel.new {|w| - title("Label Demonstration") - iconname("label") - positionWindow(w) -} - -# label -msg = TkLabel.new($label_demo) { - font $font - wraplength '4i' - justify 'left' - text "Five labels are displayed below: three textual ones on the left, and a bitmap label and a text label on the right. Labels are pretty boring because you can't do anything with them." -} -msg.pack('side'=>'top') - -# frame -TkFrame.new($label_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $label_demo - $label_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'See Code' - command proc{showCode 'label'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# label demo -f_left = TkFrame.new($label_demo) -f_right = TkFrame.new($label_demo) -[f_left, f_right].each{|w| w.pack('side'=>'left', 'expand'=>'yes', - 'padx'=>10, 'pady'=>10, 'fill'=>'both')} - -# label -[ TkLabel.new(f_left, 'text'=>'First label'), - TkLabel.new(f_left, 'text'=>'Second label, raised', - 'relief'=>'raised'), - TkLabel.new(f_left, 'text'=>'Third label, sunken', 'relief'=>'sunken') -].each{|w| w.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'anchor'=>'w')} - -TkLabel.new(f_right) { - bitmap('@' + [$demo_dir,'images','face.xbm'].join(File::Separator)) - borderwidth 2 - relief 'sunken' -}.pack('side'=>'top') - -TkLabel.new(f_right) { text 'Tcl/Tk Proprietor' }.pack('side'=>'top') - diff --git a/ext/tk/sample/demos-en/labelframe.rb b/ext/tk/sample/demos-en/labelframe.rb deleted file mode 100644 index 8636a4a9b9..0000000000 --- a/ext/tk/sample/demos-en/labelframe.rb +++ /dev/null @@ -1,93 +0,0 @@ -# labelframe.rb -# -# This demonstration script creates a toplevel window containing -# several labelframe widgets. -# -# based on "Id: labelframe.tcl,v 1.2 2001/10/30 11:21:50 dkf Exp" - - -if defined?($labelframe_demo) && $labelframe_demo - $labelframe_demo.destroy - $labelframe_demo = nil -end - -$labelframe_demo = TkToplevel.new {|w| - title("Labelframe Demonstration") - iconname("labelframe") - positionWindow(w) -} - -# Some information -TkLabel.new($labelframe_demo, - :font=>$font, :wraplength=>'4i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) -Labelframes are used to group related widgets together. \ -The label may be either plain text or another widget. \ -If your Tk library linked to Ruby doesn't include a 'labelframe' widget, \ -this demo doesn't work. Please use later version of Tk \ -which supports a 'labelframe' widget. -EOL - -# The bottom buttons -TkFrame.new($labelframe_demo){|f| - pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - - TkButton.new(f, :text=>'Dismiss', :width=>15, :command=>proc{ - $labelframe_demo.destroy - $labelframe_demo = nil - }).pack(:side=>:left, :expand=>true) - - TkButton.new(f, :text=>'See Code', :width=>15, :command=>proc{ - showCode 'labelframe' - }).pack(:side=>:left, :expand=>true) -} - -# Demo area -w = TkFrame.new($labelframe_demo).pack(:side=>:bottom, :fill=>:both, - :expand=>true) - -# A group of radiobuttons in a labelframe -TkLabelFrame.new(w, :text=>'Value', - :padx=>2, :pady=>2) {|f| - grid(:row=>0, :column=>0, :pady=>'2m', :padx=>'2m') - - v = TkVariable.new - (1..4).each{|i| - TkRadiobutton.new(f, :text=>"This is value #{i}", - :variable=>v, :value=>i) { - pack(:side=>:top, :fill=>:x, :pady=>2) - } - } -} - - -# Using a label window to control a group of options. -$lfdummy = TkVariable.new(0) - -def lfEnableButtons(w) - TkWinfo.children(w).each{|child| - next if child.path =~ /\.cb$/ - if $lfdummy == 1 - child.state(:normal) - else - child.state(:disabled) - end - } -end - -TkLabelFrame.new(w, :pady=>2, :padx=>2){|f| - TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy, - :text=>"Use this option.", :padx=>0) {|cb| - command proc{lfEnableButtons(f)} - f.labelwidget(cb) - } - grid(:row=>0, :column=>1, :pady=>'2m', :padx=>'2m') - - %w(Option1 Option2 Option3).each{|str| - TkCheckbutton.new(f, :text=>str).pack(:side=>:top, :fill=>:x, :pady=>2) - } - - lfEnableButtons(f) -} - -TkGrid.columnconfigure(w, [0,1], :weight=>1) diff --git a/ext/tk/sample/demos-en/menu.rb b/ext/tk/sample/demos-en/menu.rb deleted file mode 100644 index 7ea3fd2ebb..0000000000 --- a/ext/tk/sample/demos-en/menu.rb +++ /dev/null @@ -1,185 +0,0 @@ -# -# menus widget demo (called by 'widget') -# - -# toplevel widget -if defined?($menu_demo) && $menu_demo - $menu_demo.destroy - $menu_demo = nil -end - -# demo toplevel widget -$menu_demo = TkToplevel.new {|w| - title("File Selection Dialogs") - iconname("menu") - positionWindow(w) -} - -# menu frame À¸À® -$menu_frame = TkFrame.new($menu_demo, 'relief'=>'raised', 'bd'=>2) -$menu_frame.pack('side'=>'top', 'fill'=>'x') - -# label -TkLabel.new($menu_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { - if $tk_platform['platform'] == 'macintosh' - text("This window contains a menubar with cascaded menus. You can invoke entries with an accelerator by typing Command+x, where \"x\" is the character next to the command key symbol. The rightmost menu can be torn off into a palette by dragging outside of its bounds and releasing the mouse.") - else - text("This window contains a menubar with cascaded menus. You can post a menu from the keyboard by typing Alt+x, where \"x\" is the character underlined on the menu. You can then traverse among the menus using the arrow keys. When a menu is posted, you can invoke the current entry by typing space, or you can invoke any entry by typing its underlined character. If a menu entry has an accelerator, you can invoke the entry without posting the menu just by typing the accelerator. The rightmost menu can be torn off into a palette by selecting the first item in the menu.") - end -}.pack('side'=>'top') - -# frame -TkFrame.new($menu_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $menu_demo - $menu_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'menu'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# menu -TkMenubutton.new($menu_frame, 'text'=>'File', 'underline'=>0) {|m| - pack('side'=>'left') - TkMenu.new(m, 'tearoff'=>false) {|file_menu| - m.configure('menu'=>file_menu) - add('command', 'label'=>'Open...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Open..." entry'}) - add('command', 'label'=>'New', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "New" entry'}) - add('command', 'label'=>'Save', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Save" entry'}) - add('command', 'label'=>'Save As...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Save As..." entry'}) - add('separator') - add('command', 'label'=>'Print Setup...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Print Setup..." entry'}) - add('command', 'label'=>'Print...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Print..." entry'}) - add('separator') - add('command', 'label'=>'Dismiss Menus Demo', 'command'=>proc{$menu_demo.destroy}) - } -} - -if $tk_platform['platform'] == 'macintosh' - modifier = 'Command' -elsif $tk_platform['platform'] == 'windows' - modifier = 'Control' -else - modifier = 'Meta' -end - -TkMenubutton.new($menu_frame, 'text'=>'Basic', 'underline'=>0) {|m| - pack('side'=>'left') - TkMenu.new(m, 'tearoff'=>false) {|basic_menu| - m.configure('menu'=>basic_menu) - add('command', 'label'=>'Long entry that does nothing') - ['A','B','C','D','E','F','G'].each{|c| - add('command', 'label'=>"Print letter \"#{c}\"", - 'underline'=>14, 'accelerator'=>"Meta+#{c}", - 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") - $menu_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) - } - } -} - -TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m| - pack('side'=>'left') - TkMenu.new(m, 'tearoff'=>false) {|cascade_menu| - m.configure('menu'=>cascade_menu) - add('command', 'label'=>'Print hello', - 'command'=>proc{print "Hello\n"}, - 'accelerator'=>"#{modifier}+H", 'underline'=>6) - $menu_demo.bind("#{modifier}-h", proc{print "Hello\n"}) - add('command', 'label'=>'Print goodbye', - 'command'=>proc{print "Goodbye\n"}, - 'accelerator'=>"#{modifier}+G", 'underline'=>6) - $menu_demo.bind("#{modifier}-g", proc{print "Goodbye\n"}) - - TkMenu.new(m, 'tearoff'=>false) {|cascade_check| - cascade_menu.add('cascade', 'label'=>'Check buttons', - 'menu'=>cascade_check, 'underline'=>0) - oil = TkVariable.new(0) - add('check', 'label'=>'Oil checked', 'variable'=>oil) - trans = TkVariable.new(0) - add('check', 'label'=>'Transmission checked', 'variable'=>trans) - brakes = TkVariable.new(0) - add('check', 'label'=>'Brakes checked', 'variable'=>brakes) - lights = TkVariable.new(0) - add('check', 'label'=>'Lights checked', 'variable'=>lights) - add('separator') - add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu_demo, - ['oil', oil], - ['trans', trans], - ['brakes', brakes], - ['lights', lights])} ) - invoke 1 - invoke 3 - } - - TkMenu.new(m, 'tearoff'=>false) {|cascade_radio| - cascade_menu.add('cascade', 'label'=>'Radio buttons', - 'menu'=>cascade_radio, 'underline'=>0) - pointSize = TkVariable.new - add('radio', 'label'=>'10 point', 'variable'=>pointSize, 'value'=>10) - add('radio', 'label'=>'14 point', 'variable'=>pointSize, 'value'=>14) - add('radio', 'label'=>'18 point', 'variable'=>pointSize, 'value'=>18) - add('radio', 'label'=>'24 point', 'variable'=>pointSize, 'value'=>24) - add('radio', 'label'=>'32 point', 'variable'=>pointSize, 'value'=>32) - add('separator') - style = TkVariable.new - add('radio', 'label'=>'Roman', 'variable'=>style, 'value'=>'roman') - add('radio', 'label'=>'Bold', 'variable'=>style, 'value'=>'bold') - add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic') - add('separator') - add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu_demo, - ['pointSize', pointSize], - ['style', style])} ) - invoke 1 - invoke 7 - } - } -} - -TkMenubutton.new($menu_frame, 'text'=>'Icons', 'underline'=>0) {|m| - pack('side'=>'left') - TkMenu.new(m, 'tearoff'=>false) {|icon_menu| - m.configure('menu'=>icon_menu) - add('command', - 'bitmap'=>'@'+[$demo_dir,'images','pattern.xbm'].join(File::Separator), - 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', - 'text'=>'The menu entry you invoked displays a bitmap rather than a text string. Other than this, it is just like any other menu entry.', - 'bitmap'=>'', 'default'=>0, - 'buttons'=>'Dismiss')} ) - ['info', 'questhead', 'error'].each{|icon| - add('command', 'bitmap'=>icon, - 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) - } - } -} - -TkMenubutton.new($menu_frame, 'text'=>'More', 'underline'=>0) {|m| - pack('side'=>'left') - TkMenu.new(m, 'tearoff'=>false) {|more_menu| - m.configure('menu'=>more_menu) - [ 'An entry','Another entry','Does nothing','Does almost nothing', - 'Make life meaningful' ].each{|i| - add('command', 'label'=>i, - 'command'=>proc{print "You invoked \"#{i}\"\n"}) - } - } -} - -TkMenubutton.new($menu_frame, 'text'=>'Colors', 'underline'=>0) {|m| - pack('side'=>'left') - TkMenu.new(m) {|colors_menu| - m.configure('menu'=>colors_menu) - ['red', 'orange', 'yellow', 'green', 'blue'].each{|c| - add('command', 'label'=>c, 'background'=>c, - 'command'=>proc{print "You invoked \"#{c}\"\n"}) - } - } -} diff --git a/ext/tk/sample/demos-en/menu84.rb b/ext/tk/sample/demos-en/menu84.rb deleted file mode 100644 index 82e29f6475..0000000000 --- a/ext/tk/sample/demos-en/menu84.rb +++ /dev/null @@ -1,212 +0,0 @@ -# -# menus widget demo (called by 'widget') -# - -# toplevel widget -if defined?($menu84_demo) && $menu84_demo - $menu84_demo.destroy - $menu84_demo = nil -end - -# demo toplevel widget -$menu84_demo = TkToplevel.new {|w| - title("File Selection Dialogs") - iconname("menu84") - positionWindow(w) -} - -begin - windowingsystem = Tk.windowingsystem() -rescue - windowingsystem = "" -end - -# label -TkLabel.new($menu84_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { - if $tk_platform['platform'] == 'macintosh' || - windowingsystem == "classic" || windowingsystem == "aqua" - text("This window contains a menubar with cascaded menus. You can invoke entries with an accelerator by typing Command+x, where \"x\" is the character next to the command key symbol. The rightmost menu can be torn off into a palette by dragging outside of its bounds and releasing the mouse.") - else - text("This window contains a menubar with cascaded menus. You can post a menu from the keyboard by typing Alt+x, where \"x\" is the character underlined on the menu. You can then traverse among the menus using the arrow keys. When a menu is posted, you can invoke the current entry by typing space, or you can invoke any entry by typing its underlined character. If a menu entry has an accelerator, you can invoke the entry without posting the menu just by typing the accelerator. The rightmost menu can be torn off into a palette by selecting the first item in the menu.") - end -}.pack('side'=>'top') - - -menustatus = TkVariable.new(" ") -TkFrame.new($menu84_demo) {|frame| - TkLabel.new(frame, 'textvariable'=>menustatus, 'relief'=>'sunken', - 'bd'=>1, 'font'=>['Helvetica', '10'], - 'anchor'=>'w').pack('side'=>'left', 'padx'=>2, - 'expand'=>true, 'fill'=>'both') - pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2) -} - - -# frame -TkFrame.new($menu84_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $menu84_demo - $menu84_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'menu84'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - - -# create menu frame -$menu84_frame = TkMenu.new($menu84_demo, 'tearoff'=>false) - -# menu -TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| - $menu84_frame.add('cascade', 'label'=>'File', 'menu'=>m, 'underline'=>0) - add('command', 'label'=>'Open...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Open..." entry'}) - add('command', 'label'=>'New', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "New" entry'}) - add('command', 'label'=>'Save', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Save" entry'}) - add('command', 'label'=>'Save As...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Save As..." entry'}) - add('separator') - add('command', 'label'=>'Print Setup...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Print Setup..." entry'}) - add('command', 'label'=>'Print...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Print..." entry'}) - add('separator') - add('command', 'label'=>'Dismiss Menus Demo', 'command'=>proc{$menu84_demo.destroy}) -} - -if $tk_platform['platform'] == 'macintosh' || - windowingsystem = "classic" || windowingsystem = "aqua" - modifier = 'Command' -elsif $tk_platform['platform'] == 'windows' - modifier = 'Control' -else - modifier = 'Meta' -end - -TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| - $menu84_frame.add('cascade', 'label'=>'Basic', 'menu'=>m, 'underline'=>0) - add('command', 'label'=>'Long entry that does nothing') - ['A','B','C','D','E','F','G'].each{|c| - add('command', 'label'=>"Print letter \"#{c}\"", - 'underline'=>14, 'accelerator'=>"Meta+#{c}", - 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") - $menu84_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) - } -} - -TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| - $menu84_frame.add('cascade', 'label'=>'Cascades', 'menu'=>m, 'underline'=>0) - add('command', 'label'=>'Print hello', - 'command'=>proc{print "Hello\n"}, - 'accelerator'=>"#{modifier}+H", 'underline'=>6) - $menu84_demo.bind("#{modifier}-h", proc{print "Hello\n"}) - add('command', 'label'=>'Print goodbye', - 'command'=>proc{print "Goodbye\n"}, - 'accelerator'=>"#{modifier}+G", 'underline'=>6) - $menu84_demo.bind("#{modifier}-g", proc{print "Goodbye\n"}) - - TkMenu.new(m, 'tearoff'=>false) {|cascade_check| - m.add('cascade', 'label'=>'Check buttons', - 'menu'=>cascade_check, 'underline'=>0) - oil = TkVariable.new(0) - add('check', 'label'=>'Oil checked', 'variable'=>oil) - trans = TkVariable.new(0) - add('check', 'label'=>'Transmission checked', 'variable'=>trans) - brakes = TkVariable.new(0) - add('check', 'label'=>'Brakes checked', 'variable'=>brakes) - lights = TkVariable.new(0) - add('check', 'label'=>'Lights checked', 'variable'=>lights) - add('separator') - add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu84_demo, - ['oil', oil], - ['trans', trans], - ['brakes', brakes], - ['lights', lights])} ) - invoke 1 - invoke 3 - } - - TkMenu.new(m, 'tearoff'=>false) {|cascade_radio| - m.add('cascade', 'label'=>'Radio buttons', - 'menu'=>cascade_radio, 'underline'=>0) - pointSize = TkVariable.new - add('radio', 'label'=>'10 point', 'variable'=>pointSize, 'value'=>10) - add('radio', 'label'=>'14 point', 'variable'=>pointSize, 'value'=>14) - add('radio', 'label'=>'18 point', 'variable'=>pointSize, 'value'=>18) - add('radio', 'label'=>'24 point', 'variable'=>pointSize, 'value'=>24) - add('radio', 'label'=>'32 point', 'variable'=>pointSize, 'value'=>32) - add('separator') - style = TkVariable.new - add('radio', 'label'=>'Roman', 'variable'=>style, 'value'=>'roman') - add('radio', 'label'=>'Bold', 'variable'=>style, 'value'=>'bold') - add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic') - add('separator') - add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu84_demo, - ['pointSize', pointSize], - ['style', style])} ) - invoke 1 - invoke 7 - } -} - -TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| - $menu84_frame.add('cascade', 'label'=>'Icons', 'menu'=>m, 'underline'=>0) - add('command', 'hidemargin'=>1, - 'bitmap'=>'@'+[$demo_dir,'images','pattern.xbm'].join(File::Separator), - 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', - 'text'=>'The menu entry you invoked displays a bitmap rather than a text string. Other than this, it is just like any other menu entry.', - 'bitmap'=>'', 'default'=>0, - 'buttons'=>'Dismiss')} ) - ['info', 'questhead', 'error'].each{|icon| - add('command', 'bitmap'=>icon, 'hidemargin'=>1, - 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) - } - - entryconfigure(2, :columnbreak=>true) -} - -TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| - $menu84_frame.add('cascade', 'label'=>'More', 'menu'=>m, 'underline'=>0) - [ 'An entry','Another entry','Does nothing','Does almost nothing', - 'Make life meaningful' ].each{|i| - add('command', 'label'=>i, - 'command'=>proc{print "You invoked \"#{i}\"\n"}) - } - - m.entryconfigure('Does almost nothing', - 'bitmap'=>'questhead', 'compound'=>'left', - 'command'=>proc{ - TkDialog.new('title'=>'Compound Menu Entry', - 'message'=>'The menu entry you invoked'+ - 'displays both a bitmap and '+ - 'a text string. Other than '+ - 'this, it isjust like any '+ - 'other menu entry.', - 'buttons'=>['OK'], 'bitmap'=>'') - }) -} - -TkMenu.new($menu84_frame) {|m| - $menu84_frame.add('cascade', 'label'=>'Colors', 'menu'=>m, 'underline'=>0) - ['red', 'orange', 'yellow', 'green', 'blue'].each{|c| - add('command', 'label'=>c, 'background'=>c, - 'command'=>proc{print "You invoked \"#{c}\"\n"}) - } -} - -$menu84_demo.menu($menu84_frame) - -TkMenu.bind('<MenuSelect>', proc{|w| - begin - label = w.entrycget('active', 'label') - rescue - label = " " - end - menustatus.value = label - Tk.update(true) - }, '%W') diff --git a/ext/tk/sample/demos-en/menubu.rb b/ext/tk/sample/demos-en/menubu.rb deleted file mode 100644 index 42a5931dd1..0000000000 --- a/ext/tk/sample/demos-en/menubu.rb +++ /dev/null @@ -1,235 +0,0 @@ -# menubutton.rb -# -# This demonstration script creates a window with a bunch of menus -# and cascaded menus using menubuttons. - -require "tkcanvas" - -def optionMenu(menubutton, varName, firstValue, *rest) - varName.value = firstValue - configoptions = {'textvariable'=>varName,'indicatoron'=>'on', - 'relief'=>'raised','borderwidth'=>2,'highlightthickness'=>2, - 'anchor'=>'c','direction'=>'flush'} - configoptions.each {|key, value| - menubutton.configure(key, value) - } - menu = TkMenu.new(menubutton) { - tearoff 'off' - add 'radio', 'label'=>firstValue, 'variable'=>varName - } - menubutton.menu(menu) - for i in rest - menu.add 'radio', 'label'=>i, 'variable'=>varName - end - - return menu -end - -if defined?($menubu_demo) && $menubu_demo - $menubu_demo.destroy - $menubu_demo = nil -end - -$menubu_demo = TkToplevel.new {|w| - title("Menu Button Demonstration") - iconname("menubutton") -} - -positionWindow($menubu_demo) - -# version check -if $tk_version.to_f < 8.0 - -# label -TkLabel.new($menubu_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { - text("This is a demonstration of menubuttons. The \"Below\" menubutton pops its menu below the button; the \"Right\" button pops to the right, etc. There are two option menus directly below this text; one is just a standard menu and the other is a 16-color palette.") -}.pack('side'=>'top') - -# frame -TkFrame.new($menubu_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $menubu_demo - $menubu_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'menu'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -else ; # Tk8.x - -body = TkFrame.new($menubu_demo) -body.pack('expand'=>'yes', 'fill'=>'both') - -below = TkMenubutton.new(body) { - text "Below" - underline 0 - direction 'below' - relief 'raised' -} -belowMenu = TkMenu.new(below) { - tearoff 0 - add 'command', 'label'=>"Below menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Below menu.\""} - add 'command', 'label'=>"Below menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Below menu.\""} -} -below.menu(belowMenu) -below.grid('row'=>0, 'column'=>1, 'sticky'=>'n') - -below = TkMenubutton.new(body) { - text "Below" - underline 0 - direction 'below' - relief 'raised' -} -belowMenu = TkMenu.new(below) { - tearoff 0 - add 'command', 'label'=>"Below menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Below menu.\""} - add 'command', 'label'=>"Below menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Below menu.\""} -} -below.menu(belowMenu) -below.grid('row'=>0, 'column'=>1, 'sticky'=>'n') - -below = TkMenubutton.new(body) { - text "Below" - underline 0 - direction 'below' - relief 'raised' -} -belowMenu = TkMenu.new(below) { - tearoff 0 - add 'command', 'label'=>"Below menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Below menu.\""} - add 'command', 'label'=>"Below menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Below menu.\""} -} -below.menu(belowMenu) -below.grid('row'=>0, 'column'=>1, 'sticky'=>'n') - -right = TkMenubutton.new(body) { - text "Right" - underline 0 - direction 'right' - relief 'raised' -} -rightMenu = TkMenu.new(right) { - tearoff 0 - add 'command', 'label'=>"Right menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Left menu.\""} - add 'command', 'label'=>"Right menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Right menu.\""} -} -right.menu(rightMenu) -right.grid('row'=>1, 'column'=>0, 'sticky'=>'w') - -left = TkMenubutton.new(body) { - text "Left" - underline 0 - direction 'left' - relief 'raised' -} -leftMenu = TkMenu.new(left) { - tearoff 0 - add 'command', 'label'=>"Left menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Left menu.\""} - add 'command', 'label'=>"Left menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Left menu.\""} -} -left.menu(leftMenu) -left.grid('row'=>1, 'column'=>2, 'sticky'=>'e') - -center = TkFrame.new(body) { - grid('row'=>1, 'column'=>1, 'sticky'=>'news') -} - -above = TkMenubutton.new(body) { - text "Above" - underline 0 - direction 'above' - relief 'raised' -} -aboveMenu = TkMenu.new(above) { - tearoff 0 - add 'command', 'label'=>"Above menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Above menu.\""} - add 'command', 'label'=>"Above menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Above menu.\""} -} -above.menu(aboveMenu) -above.grid('row'=>2, 'column'=>1, 'sticky'=>'s') - -center = TkFrame.new(body) { - grid('row'=>1, 'column'=>1, 'sticky'=>'news') -} - -TkFrame.new($menubu_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc { - tmppath = $menubu_demo - $menubu_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc { showCode 'menubu' } - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'expand'=>'yes', 'fill'=>'x', 'pady'=>'2m') - -msg = TkLabel.new(center) { -# font $font - wraplength '4i' - justify 'left' - text "This is a demonstration of menubuttons. The \"Below\" menubutton pops its menu below the button; the \"Right\" button pops to the right, etc. There are two option menus directly below this text; one is just a standard menu and the other is a 16-color palette." -} -msg.pack('side'=>'top', 'padx'=>25, 'pady'=>25) - -TkFrame.new(center) {|f| - menubuttonoptions = TkVariable.new - mbutton = TkMenubutton.new(f) - options = optionMenu(mbutton, menubuttonoptions, - 'one', 'two', 'three') - mbutton.pack('side'=>'left', 'padx'=>25, 'pady'=>25) - paletteColor = TkVariable.new - colors = ['Black','red4','DarkGreen','NavyBlue', 'gray75', - 'Red','Green','Blue','gray50','Yellow','Cyan','Magenta', - 'White','Brown','DarkSeaGreen','DarkViolet'] - colorMenuButton = TkMenubutton.new(f) - m = optionMenu(colorMenuButton, paletteColor, *colors) - begin - windowingsystem = Tk.windowingsystem() - rescue - windowingsystem = "" - end - if windowingsystem == "classic" || windowingsystem == "aqua" - topBorderColor = 'Black' - bottomBorderColor = 'Black' - else - topBorderColor = 'gray50' - bottomBorderColor = 'gray75' - end - for i in 0..15 - image = TkPhotoImage.new('height'=>16, 'width'=>16) - image.put(topBorderColor, 0, 0, 16, 1) - image.put(topBorderColor, 0, 1, 1, 16) - image.put(bottomBorderColor, 0, 15, 16, 16) - image.put(bottomBorderColor, 15, 1, 16, 16) - image.put(colors[i], 1, 1, 15, 15) - - selectimage = TkPhotoImage.new('height'=>16, 'width'=>16) - selectimage.put('Black', 0, 0, 16, 2) - selectimage.put('Black', 0, 2, 2, 16) - selectimage.put('Black', 2, 14, 16, 16) - selectimage.put('Black', 14, 2, 16, 14) - selectimage.put(colors[i], 2, 2, 14, 14) - - m.entryconfigure(i, 'image'=>image, 'selectimage'=>selectimage, 'hidemargin'=>'on') - end - m.configure('tearoff', 'on') - for c in ['Black', 'gray75', 'gray50', 'White'] - m.entryconfigure(c, 'columnbreak'=>1) - end - colorMenuButton.pack('side'=>'left', 'padx'=>25, 'pady'=>25) - pack 'padx'=>25, 'pady'=>25 -} - -end ; # Tk8.x diff --git a/ext/tk/sample/demos-en/msgbox.rb b/ext/tk/sample/demos-en/msgbox.rb deleted file mode 100644 index 4152477e67..0000000000 --- a/ext/tk/sample/demos-en/msgbox.rb +++ /dev/null @@ -1,88 +0,0 @@ -# msgbox.rb -# -# This demonstration script creates message boxes of various type -# -# message boxes widget demo (called by 'widget') -# - -# toplevel widget -if defined?($msgbox_demo) && $msgbox_demo - $msgbox_demo.destroy - $msgbox_demo = nil -end - -# demo toplevel widget -$msgbox_demo = TkToplevel.new {|w| - title("Message Box Demonstration") - iconname("messagebox") - positionWindow(w) -} - -# label -TkLabel.new($msgbox_demo, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', - 'text'=>"Choose the icon and type option of the message box. Then press the \"Message Box\" button to see the message box.").pack('side'=>'top') - -# frame -TkFrame.new($msgbox_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $msgbox_demo - $msgbox_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'msgbox'} - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Message Box' - command proc{showMessageBox $msgbox_demo} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame -$msgbox_leftframe = TkFrame.new($msgbox_demo) -$msgbox_rightframe = TkFrame.new($msgbox_demo) -$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', - 'pady'=>'.5c', 'padx'=>'.5c') -$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', - 'pady'=>'.5c', 'padx'=>'.5c') - -TkLabel.new($msgbox_leftframe, 'text'=>'Icon').pack('side'=>'top') -TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\ -.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no') - -$msgboxIcon = TkVariable.new('info') -['error', 'info', 'question', 'warning'].each {|icon| - TkRadioButton.new($msgbox_leftframe, 'text'=>icon, 'variable'=>$msgboxIcon, - 'relief'=>'flat', 'value'=>icon, 'width'=>16, - 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, - 'anchor'=>'w', 'fill'=>'x') -} - -TkLabel.new($msgbox_rightframe, 'text'=>'Type').pack('side'=>'top') -TkFrame.new($msgbox_rightframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\ -.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no') - -$msgboxType = TkVariable.new('ok') -['abortretryignore', 'ok', 'okcancel', - 'retrycancel', 'yesno', 'yesnocancel'].each {|type| - TkRadioButton.new($msgbox_rightframe, 'text'=>type, 'variable'=>$msgboxType, - 'relief'=>'flat', 'value'=>type, 'width'=>16, - 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, - 'anchor'=>'w', 'fill'=>'x') -} - -def showMessageBox(w) - button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value, - 'title'=>'Message', 'parent'=>w, - 'message'=>"This is a \"#{$msgboxType.value}\" type messagebox with the \"#{$msgboxIcon.value}\" icon") - - Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w, - 'message'=>"You have selected \"#{button}\"") -end - diff --git a/ext/tk/sample/demos-en/paned1.rb b/ext/tk/sample/demos-en/paned1.rb deleted file mode 100644 index 8c25de0ef3..0000000000 --- a/ext/tk/sample/demos-en/paned1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# paned1.rb -# -# This demonstration script creates a toplevel window containing -# a paned window that separates two windows horizontally. -# -# based on "Id: paned1.tcl,v 1.1 2002/02/22 14:07:01 dkf Exp" - -if defined?($paned1_demo) && $paned1_demo - $paned1_demo.destroy - $paned1_demo = nil -end - -$paned1_demo = TkToplevel.new {|w| - title("Horizontal Paned Window Demonstration") - iconname("paned1") - positionWindow(w) -} - -TkLabel.new($paned1_demo, - :font=>$font, :wraplength=>'4i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) -The sash between the two coloured windows below can be used to divide the area between them. Use the left mouse button to resize without redrawing by just moving the sash, and use the middle mouse button to resize opaquely (always redrawing the windows in each position.) -If your Tk library linked to Ruby doesn't include a 'panedwindow', this demo doesn't work. Please use later version of Tk which supports a 'panedwindow'. -EOL - -# The bottom buttons -TkFrame.new($paned1_demo){|f| - pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - - TkButton.new(f, :text=>'Dismiss', :width=>15, :command=>proc{ - $paned1_demo.destroy - $paned1_demo = nil - }).pack(:side=>:left, :expand=>true) - - TkButton.new(f, :text=>'See Code', :width=>15, :command=>proc{ - showCode 'paned1' - }).pack(:side=>:left, :expand=>true) -} - -TkPanedwindow.new($paned1_demo){|f| - pack(:side=>:top, :expand=>true, :fill=>:both, :pady=>2, :padx=>'2m') - - add(TkLabel.new(f, :text=>"This is the\nleft side", :bg=>'yellow'), - TkLabel.new(f, :text=>"This is the\nright side", :bg=>'cyan')) -} diff --git a/ext/tk/sample/demos-en/paned2.rb b/ext/tk/sample/demos-en/paned2.rb deleted file mode 100644 index c8c5abb470..0000000000 --- a/ext/tk/sample/demos-en/paned2.rb +++ /dev/null @@ -1,92 +0,0 @@ -# paned2.rb -- -# -# This demonstration script creates a toplevel window containing -# a paned window that separates two windows vertically. -# -# based on "Id: paned2.tcl,v 1.1 2002/02/22 14:07:01 dkf Exp" - -if defined?($paned2_demo) && $paned2_demo - $paned2_demo.destroy - $paned2_demo = nil -end - -$paned2_demo = TkToplevel.new {|w| - title("Vertical Paned Window Demonstration") - iconname("paned2") - positionWindow(w) -} - -TkLabel.new($paned2_demo, - :font=>$font, :wraplength=>'4i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) -The sash between the two scrolled windows below can be used to divide the area between them. Use the left mouse button to resize without redrawing by just moving the sash, and use the middle mouse button to resize opaquely (always redrawing the windows in each position.) -If your Tk library linked to Ruby doesn't include a 'panedwindow', this demo doesn't work. Please use later version of Tk which supports a 'panedwindow'. -EOL - -# The bottom buttons -TkFrame.new($paned2_demo){|f| - pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - - TkButton.new(f, :text=>'Dismiss', :width=>15, :command=>proc{ - $paned2_demo.destroy - $paned2_demo = nil - }).pack(:side=>:left, :expand=>true) - - TkButton.new(f, :text=>'See Code', :width=>15, :command=>proc{ - showCode 'paned2' - }).pack(:side=>:left, :expand=>true) -} - -paneList = TkVariable.new # define as normal variable (not array) -paneList.value = [ # ruby's array --> tcl's list - 'List of Ruby/Tk Widgets', - 'TkButton', - 'TkCanvas', - 'TkCheckbutton', - 'TkEntry', - 'TkFrame', - 'TkLabel', - 'TkLabelframe', - 'TkListbox', - 'TkMenu', - 'TkMenubutton', - 'TkMessage', - 'TkPanedwindow', - 'TkRadiobutton', - 'TkScale', - 'TkScrollbar', - 'TkSpinbox', - 'TkText', - 'TkToplevel' -] - -# Create the pane itself -TkPanedwindow.new($paned2_demo, :orient=>:vertical){|f| - pack(:side=>:top, :expand=>true, :fill=>:both, :pady=>2, :padx=>'2m') - - add(TkFrame.new(f){|paned2_top| - TkListbox.new(paned2_top, :listvariable=>paneList) { - # Invert the first item to highlight it - itemconfigure(0, :background=>self.cget(:foreground), - :foreground=>self.cget(:background) ) - yscrollbar(TkScrollbar.new(paned2_top).pack(:side=>:right, - :fill=>:y)) - pack(:fill=>:both, :expand=>true) - } - }, - - TkFrame.new(f) {|paned2_bottom| - # The bottom window is a text widget with scrollbar - paned2_xscr = TkScrollbar.new(paned2_bottom) - paned2_yscr = TkScrollbar.new(paned2_bottom) - paned2_text = TkText.new(paned2_bottom, :width=>30, :wrap=>:non) { - insert('1.0', "This is just a normal text widget") - xscrollbar(paned2_xscr) - yscrollbar(paned2_yscr) - } - Tk.grid(paned2_text, paned2_yscr, :sticky=>'nsew') - Tk.grid(paned2_xscr, :sticky=>'nsew') - TkGrid.columnconfigure(paned2_bottom, 0, :weight=>1) - TkGrid.rowconfigure(paned2_bottom, 0, :weight=>1) - } ) -} diff --git a/ext/tk/sample/demos-en/patch_1.1c1 b/ext/tk/sample/demos-en/patch_1.1c1 deleted file mode 100644 index d3952e71eb..0000000000 --- a/ext/tk/sample/demos-en/patch_1.1c1 +++ /dev/null @@ -1,93 +0,0 @@ ---- /usr/src/ruby-1.1c1/lib/tkcanvas.rb Tue Jul 21 18:18:02 1998 -+++ tkcanvas.rb Fri Jul 24 20:38:24 1998 -@@ -310,7 +310,7 @@ - || key == 'latinfont' || key == 'asciifont' ) - tagfont_configure(tagid(tagOrId), {key=>value}) - else -- tk_call 'itemconfigure', tagid(tagOrId), "-#{key}", value -+ tk_send 'itemconfigure', tagid(tagOrId), "-#{key}", value - end - end - end ---- /usr/src/ruby-1.1c1/lib/tkfont.rb Fri Jul 17 23:43:28 1998 -+++ tkfont.rb Fri Jul 24 17:46:22 1998 -@@ -42,7 +42,7 @@ - r | [] - - when /^8\.*/ -- list(tk_call('font', 'names')) -+ tk_split_simplelist(tk_call('font', 'names')) - - end - end -@@ -89,10 +89,14 @@ - if fnt == [] - TkFont.new(nil, nil).call_font_configure(path, *(args + [{}])) - else -- compound = Hash[*list(tk_call('font', 'configure', -- fnt))].collect{|key,value| -- [key[1..-1], value] -- }.assoc('compound')[1] -+ begin -+ compound = Hash[*list(tk_call('font', 'configure', -+ fnt))].collect{|key,value| -+ [key[1..-1], value] -+ }.assoc('compound')[1] -+ rescue -+ compound = [] -+ end - if compound == [] - TkFont.new(fnt, DEFAULT_KANJI_FONT_NAME) \ - .call_font_configure(path, *(args + [{}])) -@@ -156,14 +160,19 @@ - elsif font.kind_of? Array - finfo = {} - finfo['family'] = font[0].to_s -- if font[1] && font[1] != '0' && font[1] =~ /^(|\+|-)([0-9]+)$/ -- if $1 == '-' -- finfo['pixels'] = font[1].to_s -+ if font[1] -+ fsize = font[1].to_s -+ if fsize != '0' && fsize =~ /^(|\+|-)([0-9]+)$/ -+ if $1 == '-' -+ finfo['pixels'] = $2 -+ else -+ finfo['points'] = $2 -+ end - else -- finfo['points'] = font[1].to_s -+ finfo['points'] = '13' - end - end -- finfo[2..-1].each{|style| -+ font[2..-1].each{|style| - case (style) - when 'normal' - finfo['weight'] = style -@@ -199,16 +208,19 @@ - elsif font.kind_of? Array - finfo = {} - finfo['family'] = font[0].to_s -- if font[1] && font[1] != '0' && font[1] =~ /^(|\+|-)([0-9]+)$/ -- if $1 == '-' -- finfo['pixels'] = $2 -+ if font[1] -+ fsize = font[1].to_s -+ if fsize != '0' && fsize =~ /^(|\+|-)([0-9]+)$/ -+ if $1 == '-' -+ finfo['pixels'] = $2 -+ else -+ finfo['points'] = $2 -+ end - else -- finfo['points'] = $2 -+ finfo['points'] = '13' - end -- else -- finfo['points'] = '13' - end -- finfo[2..-1].each{|style| -+ font[2..-1].each{|style| - case (style) - when 'normal' - finfo['weight'] = style diff --git a/ext/tk/sample/demos-en/plot.rb b/ext/tk/sample/demos-en/plot.rb deleted file mode 100644 index fb887011a7..0000000000 --- a/ext/tk/sample/demos-en/plot.rb +++ /dev/null @@ -1,122 +0,0 @@ -# plot.rb -# -# This demonstration script creates a canvas widget showing a 2-D -# plot with data points that can be dragged with the mouse. -# -# 2-D plot widget demo (called by 'widget') -# - -# toplevel widget -if defined?($plot_demo) && $plot_demo - $plot_demo.destroy - $plot_demo = nil -end - -# demo toplevel widget -$plot_demo = TkToplevel.new {|w| - title("Plot Demonstration") - iconname("Plot") - positionWindow(w) -} - -# label -TkLabel.new($plot_demo, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', - 'text'=>"This window displays a canvas widget containing a simple 2-dimensional plot. You can doctor the data by dragging any of the points with mouse button 1."){ - pack('side'=>'top') -} - -# frame -$plot_buttons = TkFrame.new($plot_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $plot_demo - $plot_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'plot'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$plot_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# font -plotFont = '-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*' - -# canvas -$plot_canvas = TkCanvas.new($plot_demo,'relief'=>'raised','width'=>450,'height'=>300) -$plot_canvas.pack('side'=>'top', 'fill'=>'x') - -# plot -TkcLine.new($plot_canvas, 100, 250, 400, 250, 'width'=>2) -TkcLine.new($plot_canvas, 100, 250, 100, 50, 'width'=>2) -TkcText.new($plot_canvas, 225, 20, - 'text'=>"A Simple Plot", 'font'=>plotFont, 'fill'=>'brown') - -(0..10).each {|i| - x = 100 + (i * 30) - TkcLine.new($plot_canvas, x, 250, x, 245, 'width'=>2) - TkcText.new($plot_canvas, x, 254, - 'text'=>10*i, 'font'=>plotFont, 'anchor'=>'n') -} -(0..5).each {|i| - y = 250 - (i * 40) - TkcLine.new($plot_canvas, 100, y, 105, y, 'width'=>2) - TkcText.new($plot_canvas, 96, y, - 'text'=>"#{i*50}.0", 'font'=>plotFont, 'anchor'=>'e') -} - -for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]] - x = 100 + (3*xx) - y = 250 - (4*yy)/5 - item = TkcOval.new($plot_canvas, x-6, y-6, x+6, y+6, - 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') - item.addtag 'point' -end - -$plot_canvas.itembind('point', 'Any-Enter', - proc{$plot_canvas.itemconfigure 'current','fill','red'}) -$plot_canvas.itembind('point', 'Any-Leave', - proc{$plot_canvas.itemconfigure 'current','fill','SkyBlue2'}) -$plot_canvas.itembind('point', '1', - proc{|x,y| plotDown $plot_canvas,x,y}, "%x %y") -$plot_canvas.itembind('point', 'ButtonRelease-1', - proc{$plot_canvas.dtag 'selected'}) -$plot_canvas.bind('B1-Motion', - proc{|x,y| plotMove $plot_canvas,x,y}, "%x %y") - -$plot = {'lastX'=>0, 'lastY'=>0} - -# plotDown -- -# This method is invoked when the mouse is pressed over one of the -# data points. It sets up state to allow the point to be dragged. -# -# Arguments: -# w - The canvas window. -# x, y - The coordinates of the mouse press. - -def plotDown (w, x, y) - w.dtag 'selected' - w.addtag_withtag 'selected', 'current' - w.raise 'current' - $plot['lastX'] = x - $plot['lastY'] = y -end - -# plotMove -- -# This method is invoked during mouse motion events. It drags the -# current item. -# -# Arguments: -# w - The canvas window. -# x, y - The coordinates of the mouse. - -def plotMove (w, x, y) - w.move 'selected', x - $plot['lastX'], y - $plot['lastY'] - $plot['lastX'] = x - $plot['lastY'] = y -end - diff --git a/ext/tk/sample/demos-en/puzzle.rb b/ext/tk/sample/demos-en/puzzle.rb deleted file mode 100644 index d206efe34b..0000000000 --- a/ext/tk/sample/demos-en/puzzle.rb +++ /dev/null @@ -1,120 +0,0 @@ -# puzzle.rb -# -# This demonstration script creates a 15-puzzle game using a collection -# of buttons. -# -# widet demo 'puzzle' (called by 'widget') -# - -# toplevel widget -if defined?($puzzle_demo) && $puzzle_demo - $puzzle_demo.destroy - $puzzle_demo = nil -end - -# demo toplevel widget -$puzzle_demo = TkToplevel.new {|w| - title("15-Puzzle Demonstration") - iconname("15-Puzzle") - positionWindow(w) -} - -# label -msg = TkLabel.new($puzzle_demo) { - font $font - wraplength '4i' - justify 'left' - text "A 15-puzzle appears below as a collection of buttons. Click on any of the pieces next to the space, and that piece will slide over the space. Continue this until the pieces are arranged in numerical order from upper-left to lower-right." -} -msg.pack('side'=>'top') - -# frame -TkFrame.new($puzzle_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $puzzle_demo - $puzzle_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'puzzle'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame - -# Special trick: select a darker color for the space by creating a -# scrollbar widget and using its trough color. -begin - if Tk.windowingsystem() == 'aqua' - frameSize = 160 - else - frameSize = 120 - end -rescue - frameSize = 120 -end - -s = TkScrollbar.new($puzzle_demo) -base = TkFrame.new($puzzle_demo) { - width frameSize - height frameSize - borderwidth 2 - relief 'sunken' - bg s['troughcolor'] -} -s.destroy -base.pack('side'=>'top', 'padx'=>'1c', 'pady'=>'1c') - -def def_puzzleswitch_proc(w, num) - proc{puzzleSwitch w, num} -end - -$xpos = {} -$ypos = {} -order = [3,1,6,2,5,7,15,13,4,11,8,9,14,10,12] -(0..14).each{|i| - num = order[i] - $xpos[num] = (i % 4) * 0.25 - $ypos[num] = (i / 4) * 0.25 - TkButton.new(base) {|w| - relief 'raised' - text num - highlightthickness 0 - command def_puzzleswitch_proc(w, num) - }.place('relx'=>$xpos[num], 'rely'=>$ypos[num], - 'relwidth'=>0.25, 'relheight'=>0.25) -} -$xpos['space'] = 0.75 -$ypos['space'] = 0.75 - - -# puzzleSwitch -- -# This procedure is invoked when the user clicks on a particular button; -# if the button is next to the empty space, it moves the button into the -# empty space. - -def puzzleSwitch(w, num) - if ( ($ypos[num] >= ($ypos['space'] - 0.01)) \ - && ($ypos[num] <= ($ypos['space'] + 0.01)) \ - && ($xpos[num] >= ($xpos['space'] - 0.26)) \ - && ($xpos[num] <= ($xpos['space'] + 0.26))) \ - || (($xpos[num] >= ($xpos['space'] - 0.01)) \ - && ($xpos[num] <= ($xpos['space'] + 0.01)) \ - && ($ypos[num] >= ($ypos['space'] - 0.26)) \ - && ($ypos[num] <= ($ypos['space'] + 0.26))) - tmp = $xpos['space'] - $xpos['space'] = $xpos[num] - $xpos[num] = tmp - tmp = $ypos['space'] - $ypos['space'] = $ypos[num] - $ypos[num] = tmp - w.place('relx'=>$xpos[num], 'rely'=>$ypos[num]) - end -end - diff --git a/ext/tk/sample/demos-en/radio.rb b/ext/tk/sample/demos-en/radio.rb deleted file mode 100644 index 96cdc4c54a..0000000000 --- a/ext/tk/sample/demos-en/radio.rb +++ /dev/null @@ -1,84 +0,0 @@ -# radio.rb -# -# This demonstration script creates a toplevel window containing -# several radiobutton widgets. -# -# radiobutton widget demo (called by 'widget') -# - -# toplevel widget -if defined?($radio_demo) && $radio_demo - $radio_demo.destroy - $radio_demo = nil -end - -# demo toplevel widget -$radio_demo = TkToplevel.new {|w| - title("Radiobutton Demonstration") - iconname("radio") - positionWindow(w) -} - -# label -msg = TkLabel.new($radio_demo) { - font $font - wraplength '4i' - justify 'left' - text "Two groups of radiobuttons are displayed below. If you click on a button then the button will become selected exclusively among all the buttons in its group. A Tcl variable is associated with each group to indicate which of the group's buttons is selected. Click the \"See Variables\" button to see the current values of the variables." -} -msg.pack('side'=>'top') - -# -size = TkVariable.new -color = TkVariable.new - -# frame -TkFrame.new($radio_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $radio_demo - $radio_demo = nil - $showVarsWin[tmppath.path] = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'radio'} - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'See Variables' - command proc{ - showVars($radio_demo, ['size', size], ['color', color]) - } - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame -f_left = TkFrame.new($radio_demo) -f_right = TkFrame.new($radio_demo) -f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') -f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') - -# radiobutton -[10, 12, 18, 24].each {|sz| - TkRadioButton.new(f_left) { - text "Point Size #{sz}" - variable size - relief 'flat' - value sz - }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w') -} - -['Red', 'Green', 'Blue', 'Yellow', 'Orange', 'Purple'].each {|col| - TkRadioButton.new(f_right) { - text col - variable color - relief 'flat' - value col.downcase - }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w') -} - diff --git a/ext/tk/sample/demos-en/radio2.rb b/ext/tk/sample/demos-en/radio2.rb deleted file mode 100644 index aefd81bdca..0000000000 --- a/ext/tk/sample/demos-en/radio2.rb +++ /dev/null @@ -1,106 +0,0 @@ -# radio.rb -# -# This demonstration script creates a toplevel window containing -# several radiobutton widgets. -# -# radiobutton widget demo (called by 'widget') -# - -# toplevel widget -if defined?($radio2_demo) && $radio2_demo - $radio2_demo.destroy - $radio2_demo = nil -end - -# demo toplevel widget -$radio2_demo = TkToplevel.new {|w| - title("Radiobutton Demonstration") - iconname("radio") - positionWindow(w) -} - -# label -msg = TkLabel.new($radio2_demo) { - font $font - wraplength '5i' - justify 'left' - text "Three groups of radiobuttons are displayed below. If you click on a button then the button will become selected exclusively among all the buttons in its group. A Tcl variable is associated with each group to indicate which of the group's buttons is selected. Click the \"See Variables\" button to see the current values of the variables." -} -msg.pack('side'=>'top') - -# -size = TkVariable.new -color = TkVariable.new -align = TkVariable.new - -# frame -TkFrame.new($radio2_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $radio2_demo - $radio2_demo = nil - $showVarsWin[tmppath.path] = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'radio'} - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'See Variables' - command proc{ - showVars($radio2_demo, - ['size', size], ['color', color], ['compound', align]) - } - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame -f_left = TkLabelFrame.new($radio2_demo, 'text'=>'Point Size', - 'pady'=>2, 'padx'=>2) -f_mid = TkLabelFrame.new($radio2_demo, 'text'=>'Color', - 'pady'=>2, 'padx'=>2) -f_right = TkLabelFrame.new($radio2_demo, 'text'=>'Alignment', - 'pady'=>2, 'padx'=>2) -f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') -f_mid.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') -f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') - -# radiobutton -[10, 12, 18, 24].each {|sz| - TkRadioButton.new(f_left) { - text "Point Size #{sz}" - variable size - relief 'flat' - value sz - }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x') -} - -['Red', 'Green', 'Blue', 'Yellow', 'Orange', 'Purple'].each {|col| - TkRadioButton.new(f_mid) { - text col - variable color - relief 'flat' - value col.downcase - anchor 'w' - }.pack('side'=>'top', 'pady'=>2, 'fill'=>'x') -} - -label = TkLabel.new(f_right, 'text'=>'Label', 'bitmap'=>'questhead', - 'compound'=>'left') -label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top') -label.height(TkWinfo.reqheight(label)) -abtn = ['Top', 'Left', 'Right', 'Bottom'].collect{|a| - lower = a.downcase - TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat', - 'value'=>lower, 'indicatoron'=>0, 'width'=>7, - 'command'=>proc{label.compound(align.value)}) -} - -Tk.grid('x', abtn[0]) -Tk.grid(abtn[1], label, abtn[2]) -Tk.grid('x', abtn[3]) diff --git a/ext/tk/sample/demos-en/rmt b/ext/tk/sample/demos-en/rmt deleted file mode 100644 index 73f631180a..0000000000 --- a/ext/tk/sample/demos-en/rmt +++ /dev/null @@ -1,268 +0,0 @@ -#!/usr/bin/env ruby - -# rmt -- -# This script implements a simple remote-control mechanism for -# Tk applications. It allows you to select an application and -# then type commands to that application. - -require 'tk' - -class Rmt - def initialize(parent=nil) - win = self - - unless parent - parent = TkRoot.new - end - root = TkWinfo.toplevel(parent) - root.minsize(1,1) - - # The instance variable below keeps track of the remote application - # that we're sending to. If it's an empty string then we execute - # the commands locally. - @app = 'local' - @mode = 'Ruby' - - # The instance variable below keeps track of whether we're in the - # middle of executing a command entered via the text. - @executing = 0 - - # The instance variable below keeps track of the last command executed, - # so it can be re-executed in response to !! commands. - @lastCommand = "" - - # Create menu bar. Arrange to recreate all the information in the - # applications sub-menu whenever it is cascaded to. - - TkFrame.new(root, 'relief'=>'raised', 'bd'=>2) {|f| - pack('side'=>'top', 'fill'=>'x') - TkMenubutton.new(f, 'text'=>'File', 'underline'=>0) {|mb| - TkMenu.new(mb) {|mf| - mb.menu(mf) - TkMenu.new(mf) {|ma| - postcommand proc{win.fillAppsMenu ma} - mf.add('cascade', 'label'=>'Select Application', - 'menu'=>ma, 'underline'=>0) - } - add('command', 'label'=>'Quit', - 'command'=>proc{root.destroy}, 'underline'=>0) - } - pack('side'=>'left') - } - } - - # Create text window and scrollbar. - - @txt = TkText.new(root, 'relief'=>'sunken', 'bd'=>2, 'setgrid'=>true) { - yscrollbar(TkScrollbar.new(root){pack('side'=>'right', 'fill'=>'y')}) - pack('side'=>'left') - } - - @promptEnd = TkTextMark.new(@txt, 'insert') - - # Create a binding to forward commands to the target application, - # plus modify many of the built-in bindings so that only information - # in the current command can be deleted (can still set the cursor - # earlier in the text and select and insert; just can't delete). - - @txt.bindtags([@txt, TkText, root, 'all']) - @txt.bind('Return', proc{ - @txt.set_insert('end - 1c') - @txt.insert('insert', "\n") - win.invoke - Tk.callback_break - }) - @txt.bind('Delete', proc{ - begin - @txt.tag_remove('sel', 'sel.first', @promptEnd) - rescue - end - if @txt.tag_nextrange('sel', '1.0', 'end') == [] - if @txt.compare('insert', '<', @promptEnd) - Tk.callback_break - end - end - }) - @txt.bind('BackSpace', proc{ - begin - @txt.tag_remove('sel', 'sel.first', @promptEnd) - rescue - end - if @txt.tag_nextrange('sel', '1.0', 'end') == [] - if @txt.compare('insert', '<', @promptEnd) - Tk.callback_break - end - end - }) - @txt.bind('Control-d', proc{ - if @txt.compare('insert', '<', @promptEnd) - Tk.callback_break - end - }) - @txt.bind('Control-k', proc{ - if @txt.compare('insert', '<', @promptEnd) - @txt.set_insert(@promptEnd) - end - }) - @txt.bind('Control-t', proc{ - if @txt.compare('insert', '<', @promptEnd) - Tk.callback_break - end - }) - @txt.bind('Meta-d', proc{ - if @txt.compare('insert', '<', @promptEnd) - Tk.callback_break - end - }) - @txt.bind('Meta-BackSpace', proc{ - if @txt.compare('insert', '<=', @promptEnd) - Tk.callback_break - end - }) - @txt.bind('Control-h', proc{ - if @txt.compare('insert', '<=', @promptEnd) - Tk.callback_break - end - }) - - @txt.tag_configure('bold', 'font'=>['Courier', 12, 'bold']) - - @app = Tk.appname('rmt') - if (@app =~ /^rmt(.*)$/) - root.title("Tk Remote Controller#{$1}") - root.iconname("Tk Remote#{$1}") - end - prompt - @txt.focus - #@app = TkWinfo.appname(TkRoot.new) - end - - def tkTextInsert(w,s) - return if s == "" - begin - if w.compare('sel.first','<=','insert') \ - && w.compare('sel.last','>=','insert') - w.tag_remove('sel', 'sel.first', @promptEnd) - w.delete('sel.first', 'sel.last') - end - rescue - end - w.insert('insert', s) - w.see('insert') - end - - # The method below is used to print out a prompt at the - # insertion point (which should be at the beginning of a line - # right now). - - def prompt - @txt.insert('insert', "#{@app}: ") - @promptEnd.set('insert') - @promptEnd.gravity = 'left' - @txt.tag_add('bold', "#{@promptEnd.path} linestart", @promptEnd) - end - - # The method below executes a command (it takes everything on the - # current line after the prompt and either sends it to the remote - # application or executes it locally, depending on "app". - - def invoke - cmd = @txt.get(@promptEnd, 'insert') - @executing += 1 - case (@mode) - when 'Tcl' - if Tk.info('complete', cmd) - if (cmd == "!!\n") - cmd = @lastCommand - else - @lastCommand = cmd - end - begin - msg = Tk.appsend(@app, false, cmd) - rescue - msg = "Error: #{$!}" - end - @txt.insert('insert', msg + "\n") if msg != "" - prompt - @promptEnd.set('insert') - end - - when 'Ruby' - if (cmd == "!!\n") - cmd = @lastCommand - end - complete = true - begin - eval("proc{#{cmd}}") - rescue - complete = false - end - if complete - @lastCommand = cmd - begin -# msg = Tk.appsend(@app, false, -# 'ruby', -# '"(' + cmd.gsub(/[][$"]/, '\\\\\&') + ').to_s"') - msg = Tk.rb_appsend(@app, false, cmd) - rescue - msg = "Error: #{$!}" - end - @txt.insert('insert', msg + "\n") if msg != "" - prompt - @promptEnd.set('insert') - end - end - - @executing -= 1 - @txt.yview_pickplace('insert') - end - - # The following method is invoked to change the application that - # we're talking to. It also updates the prompt for the current - # command, unless we're in the middle of executing a command from - # the text item (in which case a new prompt is about to be output - # so there's no need to change the old one). - - def newApp(appName, mode) - @app = appName - @mode = mode - if @executing == 0 - @promptEnd.gravity = 'right' - @txt.delete("#{@promptEnd.path} linestart", @promptEnd) - @txt.insert(@promptEnd, "#{appName}: ") - @txt.tag_add('bold', "#{@promptEnd.path} linestart", @promptEnd) - @promptEnd.gravity = 'left' - end - end - - # The method below will fill in the applications sub-menu with a list - # of all the applications that currently exist. - - def fillAppsMenu(menu) - win = self - begin - menu.delete(0,'last') - rescue - end - TkWinfo.interps.sort.each{|ip| - begin - if Tk.appsend(ip, false, 'info commands ruby') == "" - mode = 'Tcl' - else - mode = 'Ruby' - end - menu.add('command', 'label'=>format("%s (#{mode}/Tk)", ip), - 'command'=>proc{win.newApp ip, mode}) - rescue - menu.add('command', 'label'=>format("%s (unknown Tk)", ip), - 'command'=>proc{win.newApp ip, mode}, 'state'=>'disabled') - end - } - menu.add('command', 'label'=>format("local (Ruby/Tk)"), - 'command'=>proc{win.newApp 'local', 'Ruby'}) - end -end - -Rmt.new - -Tk.mainloop diff --git a/ext/tk/sample/demos-en/rolodex b/ext/tk/sample/demos-en/rolodex deleted file mode 100644 index 9a4030e902..0000000000 --- a/ext/tk/sample/demos-en/rolodex +++ /dev/null @@ -1,320 +0,0 @@ -#!/usr/bin/env ruby -# -# rolodex -- -# This script is a part of Tom LaStrange's rolodex -# -# Copyright (C) 1998 by Takaaki Tateishi <ttate@jaist.ac.jp> -# Time-stamp: "03/08/02 06:23:06 nagai" -# - -require "tk" - - -def show_help(topic,x=0,y=0) - if( topic.is_a?(TkWindow) ) - w = TkWinfo.containing(x,y) - if( TkWinfo.exist?(w) ) - topic = w - end - end - - if( $helpTopics.include?(topic) ) - msg = $helpTopics[topic] - else - msg = "Sorry, but no help is available for this topic" - end - TkDialog.new("title"=>"Rolodex Help", - "message"=>"Information on #{topic}:\n\n#{msg}", - "default_button"=>0, - "buttons"=>["OK"]) -end - -def fillCard - clearAction - $root.frame.entry[1].insert(0,"Takaaki Tateishi") - $root.frame.entry[2].insert(0,"Japan Advanced Institute of Science and Techonology") - $root.frame.entry[3].insert(0,"1-1 Asahidai, Tatsunokuchi") - $root.frame.entry[4].insert(0,"Ishikawa 923-1292, Japan") - $root.frame.entry[5].insert(0,"private") - $root.frame.entry[6].insert(0,"***-***-****") - $root.frame.entry[7].insert(0,"***-***-****") -end - -def addAction - for i in 1..7 - STDERR.print format("%-12s %s\n", - RolodexFrame::LABEL[i], - $root.frame.entry[i].value) - end -end - -def clearAction - for i in 1..7 - $root.frame.entry[i].delete(0,"end") - end -end - -def fileAction - TkDialog.new("title"=>"File Selection", - "message"=>"This is a dummy file selection dialog box.\n", - "default_button"=>0, - "buttons"=>["OK"]) - STDERR.print "dummy file name\n" -end - -def deleteAction - result = TkDialog.new("title"=>"Confirm Action", - "message"=>"Are you sure?", - "default_button"=>0, - "buttons"=>["Cancel"]) - if( result.value == 0 ) - clearAction - end -end - - -class RolodexFrame < TkFrame - attr_reader :entry, :label - - LABEL = ["","Name:","Address:","","","Home Phone:","Work Phone:","Fax:"] - - def initialize(parent=nil,keys=nil) - super(parent,keys) - self["relief"] = "flat" - - @i = [] - @label = [] - @entry = [] - for i in 1..7 - @i[i] = TkFrame.new(self) - @i[i].pack("side"=>"top", - "pady"=>2, - "anchor"=>"e") - @label[i] = TkLabel.new(@i[i], - "text"=>LABEL[i], - "anchor"=>"e") - @entry[i] = TkEntry.new(@i[i], - "width"=>30, - "relief"=>"sunken") - @entry[i].pack("side"=>"right") - @label[i].pack("side"=>"right") - end - end -end - -class RolodexButtons < TkFrame - attr_reader :clear, :add, :search, :delete - - def initialize(parent,keys=nil) - super(parent,keys) - @clear = TkButton.new(self, - "text" => "Clear") - @add = TkButton.new(self, - "text" => "Add") - @search = TkButton.new(self, - "text" => "Search") - @delete = TkButton.new(self, - "text" => "Delete") - for w in [@clear,@add,@search,@delete] - w.pack("side"=>"left", "padx"=>2) - end - end -end - -class RolodexMenuFrame < TkFrame - attr_reader :file_menu, :help_menu, :file, :help - - def initialize(parent,keys=nil) - super(parent,keys) - configure("relief"=>"raised", - "borderwidth"=>1) - - @file = TkMenubutton.new(self, - "text"=>"File", - "underline"=>0) - @file_menu = TkMenu.new(@file) - @file_menu.add("command", - "label" => "Load ...", - "command" => proc{fileAction}, - "underline" => 0) - @file_menu.add("command", - "label" => "Exit", - "command" => proc{$root.destroy}, - "underline" => 0) - @file.menu(@file_menu) - @file.pack("side"=>"left") - - @help = TkMenubutton.new(self, - "text"=>"Help", - "underline"=>0) - @help_menu = TkMenu.new(@help) - @help_menu.add("command", - "label"=>"On Context...", - "command"=>proc{show_help("context")}, - "underline"=>3) - @help_menu.add("command", - "label"=>"On Help...", - "command"=>proc{show_help("help")}, - "underline"=>3) - @help_menu.add("command", - "label"=>"On Window...", - "command"=>proc{show_help("window")}, - "underline"=>3) - @help_menu.add("command", - "label"=>"On Keys...", - "command"=>proc{show_help("keys")}, - "underline"=>3) - @help_menu.add("command", - "label"=>"On version...", - "command"=>proc{show_help("version")}, - "underline"=>3) - @help.menu(@help_menu) - @help.pack("side"=>"right") - end -end - -class Rolodex < TkRoot - attr_reader :frame, :buttons, :menu - - def initialize(*args) - super(*args) - @frame = RolodexFrame.new(self) - @frame.pack("side"=>"top", - "fill"=>"y", - "anchor"=>"center") - @buttons = RolodexButtons.new(self) - @buttons.pack("side"=>"bottom", - "pady"=>2, - "anchor"=>"center") - @menu = RolodexMenuFrame.new(self) - @menu.pack("before"=>@frame, - "side"=>"top", - "fill"=>"x") - end -end - -$root = Rolodex.new - -$root.buttons.delete.configure("command"=>proc{deleteAction}) -$root.buttons.add.configure("command"=>proc{addAction}) -$root.buttons.clear.configure("command"=>proc{clearAction}) -$root.buttons.search.configure("command"=>proc{addAction; fillCard}) - -$root.buttons.clear.configure("text"=>"Clear Ctrl+C") -$root.bind("Control-c",proc{clearAction}) - -$root.buttons.add.configure("text"=>"Add Ctrl+A") -$root.bind("Control-a",proc{addAction}) - -$root.buttons.search.configure("text"=>"Search Ctrl+S") -$root.bind("Control-s",proc{addAction; fillCard}) - -$root.buttons.delete.configure("text"=>"Delete... Ctrl+D") -$root.bind("Control-d",proc{deleteAction}) - -$root.menu.file_menu.entryconfigure(1, "accel"=>"Ctrl+F") -$root.bind("Control-f",proc{fileAction}) - -$root.menu.file_menu.entryconfigure(2, "accel"=>"Ctrl+Q") -$root.bind("Control-q",proc{$root.destroy}) - -$root.frame.entry[1].focus - -$root.bind("Any-F1", - proc{|event| show_help(event.widget, event.x_root, event.y_root)}) -$root.bind("Any-Help", - proc{|event| show_help(event.widget, event.x_root, event.y_root)}) - - -$helpTopics = {} - -$helpTopics[$root.menu.file] = <<EOF -This is the "file" menu. It can be used to invoke\ -some overall operations on the rolodex applications,\ -such as loading a file or exiting. -EOF - -$helpTopics[$root.menu.file_menu.index(0)] = <<EOF -The "Load" entry in the "File" menu posts a dialog box\ -that you can use to select a rolodex file -EOF - -$helpTopics[$root.menu.file_menu.index(1)] = <<EOF -The "Exit" entry in the "File" menu causes the rolodex\ -application to terminate -EOF - -$helpTopics[$root.frame.entry[1]] = <<EOF -In this field of the rolodex entry you should\ -type the person's name -EOF - -$helpTopics[$root.frame.entry[2]] = <<EOF -In this field of the rolodex entry you should\ -type the first line of the person's address -EOF - -$helpTopics[$root.frame.entry[3]] = <<EOF -In this field of the rolodex entry you should\ -type the second line of the person's address -EOF - -$helpTopics[$root.frame.entry[4]] = <<EOF -In this field of the rolodex entry you should\ -type the third line of the person's address -EOF - -$helpTopics[$root.frame.entry[5]] = <<EOF -In this field of the rolodex entry you should\ -type the person's home phone number, or "private"\ -if the person doesn't want his or he number publicized -EOF - -$helpTopics[$root.frame.entry[6]] = <<EOF -In this field of the rolodex entry you should\ -type the person's work phone number -EOF - -$helpTopics[$root.frame.entry[7]] = <<EOF -In this field of the rolodex entry you should\ -type the phone number for the person's FAX machine -EOF - -$helpTopics["context"] = <<EOF -Unfortunately, this application doesn't support context-sensitive\ -help in the usual way, because when this demo was written Ruby/Tk\ -didn't have a grab mechanism and this is needed for context-sensitive\ -help. Instead, you can achive much the same effect by simply moving\ -the mouse over the window you're curious about and pressing the\ -Help or F1 keys. You can do this anytime. -EOF - -$helpTopics["help"] = <<EOF -This application provides only very crude help. Besides the\ -entries in this menu, you can get help on individual windows\ -by moving the mouse cursor over the window and pressing the\ -Help or F1 keys. -EOF - -$helpTopics["window"] = <<EOF -This window is a dummy rolodex application created as part of\ -Tom LaStrange's toolkit benchmark. It doesn't really do anything\ -useful except to demonstrate a few features of the Ruby/Tk. -EOF - -$helpTopics["keys"] = <<EOF -The following accelerator keys are defined for this application\ -(in addition to those already available for the entry windows): -Ctrl+A: Add -Ctrl+C: Clear -Ctrl+D: Delete -Ctrl+F: Enter file name -Ctrl+Q: Exit application (quit) -Ctrl+S: Search (dummy operation) -EOF - -$helpTopics["version"] = <<EOF -This is version 1.0.1. -EOF - -Tk.mainloop diff --git a/ext/tk/sample/demos-en/rolodex-j b/ext/tk/sample/demos-en/rolodex-j deleted file mode 100644 index 27e2bc9da0..0000000000 --- a/ext/tk/sample/demos-en/rolodex-j +++ /dev/null @@ -1,323 +0,0 @@ -#!/usr/bin/env ruby -# -# rolodex -- -# ¤³¤Î¥¹¥¯¥ê¥×¥È¤Ï Tom LaStrange ¤Î rolodex ¤Î°ìÉô¤Ç¤¹¡£ -# -# Copyright (C) 1998 by Takaaki Tateishi <ttate@jaist.ac.jp> -# Time-stamp: "03/08/02 14:02:04 nagai" -# - -require "tk" - -Tk.encoding = "euc-jp" -$font = TkFont.new('k14') - -def show_help(topic,x=0,y=0) - if( topic.is_a?(TkWindow) ) - w = TkWinfo.containing(x,y) - if( w.is_a?(TkWindow) ) - if( TkWinfo.exist?(w) ) - topic = w - end - end - end - - if( $helpTopics.include?(topic) ) - msg = $helpTopics[topic] - else - msg = "¤³¤Î¥È¥Ô¥Ã¥¯¤Ë¤Ä¤¤¤Æ¤Î¥Ø¥ë¥×¤Ï¤Þ¤À»ÈÍѤǤ¤Þ¤»¤ó" - end - TkDialog.new("title"=>"Rolodex Help", - "message"=>"¡Ö#{topic}¡×\n\n#{msg}", - "font"=>$font, - "default_button"=>0, - "buttons"=>["OK"]) -end - -def fillCard - clearAction - $root.frame.entry[1].insert(0, "ΩÀÐ ¹§¾´") - $root.frame.entry[2].insert(0, "923-1292 ÀÐÀ") - $root.frame.entry[3].insert(0, "ä¸ýÄ® °°Âæ 1-1") - $root.frame.entry[4].insert(0, "ËÌΦÀèü²Ê³Øµ»½ÑÂç³Ø±¡Âç³Ø") - $root.frame.entry[5].insert(0,"private") - $root.frame.entry[6].insert(0,"***-***-****") - $root.frame.entry[7].insert(0,"***-***-****") -end - -def addAction - for i in 1..7 - STDERR.print format("%-12s %s\n", - RolodexFrame::LABEL[i], - $root.frame.entry[i].value) - end -end - -def clearAction - for i in 1..7 - $root.frame.entry[i].delete(0,"end") - end -end - -def fileAction - TkDialog.new("title"=>"File Selection", - "message"=>"¤³¤ì¤Ï¥Õ¥¡¥¤¥ëÁªÂò¥À¥¤¥¢¥í¥°¤Î¥À¥ß¡¼¤Ç¤¹¡£\n", - "font"=>$font, - "default_button"=>0, - "buttons"=>["OK"]) - STDERR.print "dummy file name\n" -end - -def deleteAction - result = TkDialog.new("title"=>"Confirm Action", - "message"=>"¤è¤í¤·¤¤¤Ç¤¹¤«¡©", - "font"=>$font, - "default_button"=>0, - "buttons"=>["¥¥ã¥ó¥»¥ë"]) - if( result.value == 0 ) - clearAction - end -end - - -class RolodexFrame < TkFrame - attr_reader :entry, :label - - LABEL = ["","̾Á°:","½»½ê","","","ÅÅÏÃ(¼«Âð):","ÅÅÏÃ(²ñ¼Ò):","Fax:"] - - def initialize(parent=nil,keys=nil) - super(parent,keys) - self["relief"] = "flat" - @i = [] - @label = [] - @entry = [] - for i in 1..7 - @i[i] = TkFrame.new(self) - @i[i].pack("side"=>"top", - "pady"=>2, - "anchor"=>"e") - @label[i] = TkLabel.new(@i[i], - "text"=>LABEL[i], - "anchor"=>"e", - "font" => $font) - @entry[i] = TkEntry.new(@i[i], - "width"=>30, - "relief"=>"sunken", - "font" => $font) - @entry[i].pack("side"=>"right") - @label[i].pack("side"=>"right") - end - end -end - -class RolodexButtons < TkFrame - attr_reader :clear, :add, :search, :delete - - def initialize(parent,keys=nil) - super(parent,keys) - @clear = TkButton.new(self, - "text" => "¥¯¥ê¥¢¡¼", - "font" => $font) - @add = TkButton.new(self, - "text" => "ÄɲÃ", - "font" => $font) - @search = TkButton.new(self, - "text" => "¸¡º÷", - "font" => $font) - @delete = TkButton.new(self, - "text" => "¾Ãµî", - "font" => $font) - for w in [@clear,@add,@search,@delete] - w.pack("side"=>"left", "padx"=>2) - end - end -end - -class RolodexMenuFrame < TkFrame - attr_reader :file_menu, :help_menu, :file, :help - - def initialize(parent,keys=nil) - super(parent,keys) - configure("relief"=>"raised", - "borderwidth"=>1) - - @file = TkMenubutton.new(self, - "text"=> "¥Õ¥¡¥¤¥ë", - "font"=> $font, - "underline"=>0) - @file_menu = TkMenu.new(@file) - @file_menu.add("command", - "label" => "ÆÉ¤ß¹þ¤ß ...", - "font" => $font, - "command" => proc{fileAction}, - "underline" => 0) - @file_menu.add("command", - "label" => "½ªÎ»", - "font" => $font, - "command" => proc{$root.destroy}, - "underline" => 0) - @file.menu(@file_menu) - @file.pack("side"=>"left") - - @help = TkMenubutton.new(self, - "text"=> "¥Ø¥ë¥×", - "font"=> $font, - "underline"=>0) - @help_menu = TkMenu.new(@help) - @help_menu.add("command", - "label"=> "¥³¥ó¥Æ¥¥¹¥È¤Ë¤Ä¤¤¤Æ", - "font" => $font, - "command"=>proc{show_help("¥³¥ó¥Æ¥¥¹¥È")}, - "underline"=>3) - @help_menu.add("command", - "label"=> "¥Ø¥ë¥×¤Ë¤Ä¤¤¤Æ", - "font" => $font, - "command"=>proc{show_help("¥Ø¥ë¥×")}, - "underline"=>3) - @help_menu.add("command", - "label"=> "¥¦¥£¥ó¥É¥¦¤Ë¤Ä¤¤¤Æ", - "font" => $font, - "command"=>proc{show_help("¥¦¥£¥ó¥É¥¦")}, - "underline"=>3) - @help_menu.add("command", - "label"=> "¥¡¼Áàºî¤Ë¤Ä¤¤¤Æ", - "font" => $font, - "command"=>proc{show_help("¥¡¼Áàºî")}, - "underline"=>3) - @help_menu.add("command", - "label"=> "¥Ð¡¼¥¸¥ç¥ó¾ðÊó", - "font" => $font, - "command"=>proc{show_help("¥Ð¡¼¥¸¥ç¥ó¾ðÊó")}, - "underline"=>3) - @help.menu(@help_menu) - @help.pack("side"=>"right") - end -end - -class Rolodex < TkRoot - attr_reader :frame, :buttons, :menu - - def initialize(*args) - super(*args) - @frame = RolodexFrame.new(self) - @frame.pack("side"=>"top", - "fill"=>"y", - "anchor"=>"center") - @buttons = RolodexButtons.new(self) - @buttons.pack("side"=>"bottom", - "pady"=>2, - "anchor"=>"center") - @menu = RolodexMenuFrame.new(self) - @menu.pack("before"=>@frame, - "side"=>"top", - "fill"=>"x") - end -end - -$root = Rolodex.new - -$root.buttons.delete.configure("command"=>proc{deleteAction}) -$root.buttons.add.configure("command"=>proc{addAction}) -$root.buttons.clear.configure("command"=>proc{clearAction}) -$root.buttons.search.configure("command"=>proc{addAction; fillCard}) - -$root.buttons.clear.configure("text"=> "¥¯¥ê¥¢¡¼ Ctrl+C", "font" => $font) -$root.bind("Control-c",proc{clearAction}) - -$root.buttons.add.configure("text"=> "Äɲà Ctrl+A", "font" => $font) -$root.bind("Control-a",proc{addAction}) - -$root.buttons.search.configure("text"=> "¸¡º÷ Ctrl+S", "font" => $font) -$root.bind("Control-s",proc{addAction; fillCard}) - -$root.buttons.delete.configure("text"=> "¾Ãµî Ctrl+D", "font" => $font) -$root.bind("Control-d",proc{deleteAction}) - -$root.menu.file_menu.entryconfigure(1, "accel"=>"Ctrl+F") -$root.bind("Control-f",proc{fileAction}) - -$root.menu.file_menu.entryconfigure(2, "accel"=>"Ctrl+Q") -$root.bind("Control-q",proc{$root.destroy}) - -$root.frame.entry[1].focus - -$root.bind("Any-F1", - proc{|event| show_help(event.widget, event.x_root, event.y_root)}) -$root.bind("Any-Help", - proc{|event| show_help(event.widget, event.x_root, event.y_root)}) - - -$helpTopics = {} - -$helpTopics[$root.menu.file] = <<EOF -¤³¤ì¤Ï¡Ö¥Õ¥¡¥¤¥ë¡×¥á¥Ë¥å¡¼¤Ç¤¹¡£¡ÖÆÉ¤ß¹þ¤ß¡×¤ä¡Ö½ªÎ»¡×¤Ê¤É¤ò -¹Ô¤Ê¤¦¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -EOF - -$helpTopics[$root.menu.file_menu.index(0)] = <<EOF -¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß¤ò¹Ô¤Ê¤¦¤È¤¤Ë»È¤¤¤Þ¤¹¡£ -EOF - -$helpTopics[$root.menu.file_menu.index(1)] = <<EOF -¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò½ªÎ»¤¹¤ë¤È¤¤Ë»È¤¤¤Þ¤¹¡£ -EOF - -$helpTopics[$root.frame.entry[1]] = <<EOF -̾Á°¤òµÆþ¤¹¤ë¥¨¥ó¥È¥ê¤Ç¤¹¡£ -EOF - -$helpTopics[$root.frame.entry[2]] = <<EOF -½»½ê¤òµÆþ¤¹¤ë¥¨¥ó¥È¥ê¤Ç¤¹¡£ -EOF - -$helpTopics[$root.frame.entry[3]] = <<EOF -½»½ê¤òµÆþ¤¹¤ë¥¨¥ó¥È¥ê¤Ç¤¹¡£ -EOF - -$helpTopics[$root.frame.entry[4]] = <<EOF -½»½ê¤òµÆþ¤¹¤ë¥¨¥ó¥È¥ê¤Ç¤¹¡£ -EOF - -$helpTopics[$root.frame.entry[5]] = <<EOF -¼«Âð¤ÎÅÅÏÃÈÖ¹æ¤òµÆþ¤¹¤ë¥¨¥ó¥È¥ê¤Ç¤¹¡£¸ø³«\ -¤·¤¿¤¯¤Ê¤¤¤È¤¤Ï private ¤ÈµÆþ¤·¤Þ¤¹¡£ -EOF - -$helpTopics[$root.frame.entry[6]] = <<EOF -²ñ¼Ò¤ÎÅÅÏÃÈÖ¹æ¤òµÆþ¤¹¤ë¥¨¥ó¥È¥ê¤Ç¤¹¡£ -EOF - -$helpTopics[$root.frame.entry[7]] = <<EOF -FAXÈÖ¹æ¤òµÆþ¤¹¤ë¥¨¥ó¥È¥ê¤Ç¤¹¡£ -EOF - -$helpTopics["¥³¥ó¥Æ¥¥¹¥È"] = <<EOF -Ruby/Tk¤Ç¤Ïgrab¤Îµ¡¹½¤¬¤Ê¤¤¤¿¤á¤³¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï\ -¥³¥ó¥Æ¥¥¹¥È¥Ø¥ë¥×¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ -¤·¤«¤·Æ±¤¸¤è¤¦¤Ê¸ú²Ì¤òbind¤È¥Þ¥¦¥¹¤Î°ÌÃÖ¤ÎWedget¤òÃΤë\ -¤³¤È¤ÇÆÀ¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -EOF - -$helpTopics["¥Ø¥ë¥×"] = <<EOF -¥Þ¥¦¥¹¤ò¥¦¥£¥ó¥É¥¦¤Ë¤¢¤ï¤»¤ÆF1¥¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ\ -¤½¤Î¥Ø¥ë¥×¤ò¸«¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -EOF - -$helpTopics["¥¦¥£¥ó¥É¥¦"] = <<EOF -¤³¤Î¥¦¥£¥ó¥É¥¦¤Ï¥À¥ß¡¼¤Ç¤¹¡£ -EOF - -$helpTopics["¥¡¼Áàºî"] = <<EOF -Ctrl+A: Äɲà -Ctrl+C: ¥¯¥ê¥¢¡¼ -Ctrl+D: ¾Ãµî -Ctrl+F: ¥Õ¥¡¥¤¥ëÁªÂò -Ctrl+Q: ½ªÎ» -Ctrl+S: ¸¡º÷ -EOF - -$helpTopics["¥Ð¡¼¥¸¥ç¥ó¾ðÊó"] = <<EOF -¥Ð¡¼¥¸¥ç¥ó¤Ï 1.0.1e ¤Ç¤¹¡£ -EOF - -Tk.mainloop diff --git a/ext/tk/sample/demos-en/ruler.rb b/ext/tk/sample/demos-en/ruler.rb deleted file mode 100644 index f5e7add516..0000000000 --- a/ext/tk/sample/demos-en/ruler.rb +++ /dev/null @@ -1,201 +0,0 @@ -# ruler.rb -# -# This demonstration script creates a canvas widget that displays a ruler -# with tab stops that can be set, moved, and deleted. -# -# ruler widget demo (called by 'widget') -# - -# rulerMkTab -- -# This method creates a new triangular polygon in a canvas to -# represent a tab stop. -# -# Arguments: -# c - The canvas window. -# x, y - Coordinates at which to create the tab stop. - -def rulerMkTab(c,x,y) - v = $demo_rulerInfo - TkcPolygon.new(c, x, y, x+v.size, y+v.size, x-v.size, y+v.size) -end - -# toplevel widget -if defined?($ruler_demo) && $ruler_demo - $ruler_demo.destroy - $ruler_demo = nil -end - -# demo toplevel widget -$ruler_demo = TkToplevel.new {|w| - title("Ruler Demonstration") - iconname("ruler") - positionWindow(w) -} - -# label -TkLabel.new($ruler_demo, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', - 'text'=>"This canvas widget shows a mock-up of a ruler. You can create tab stops by dragging them out of the well to the right of the ruler. You can also drag existing tab stops. If you drag a tab stop far enough up or down so that it turns dim, it will be deleted when you release the mouse button."){ - pack('side'=>'top') -} - -# frame -$ruler_buttons = TkFrame.new($ruler_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $ruler_demo - $ruler_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'ruler'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$ruler_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# canvas -$ruler_canvas = TkCanvas.new($ruler_demo, 'width'=>'14.8c', 'height'=>'2.5c') -$ruler_canvas.pack('side'=>'top', 'fill'=>'x') - -# -unless Struct.const_defined?("RulerInfo") - $demo_rulerInfo = Struct.new("RulerInfo", :grid, :left, :right, :x, :y, - :top, :bottom, :size, :normalStyle, - :activeStyle, :deleteStyle).new -end -$demo_rulerInfo.grid = '.25c' -$demo_rulerInfo.left = TkWinfo.fpixels($ruler_canvas, '1c') -$demo_rulerInfo.right = TkWinfo.fpixels($ruler_canvas, '13c') -$demo_rulerInfo.top = TkWinfo.fpixels($ruler_canvas, '1c') -$demo_rulerInfo.bottom = TkWinfo.fpixels($ruler_canvas, '1.5c') -$demo_rulerInfo.size = TkWinfo.fpixels($ruler_canvas, '.2c') -$demo_rulerInfo.normalStyle = {'fill'=>'black'} -if TkWinfo.depth($ruler_canvas) > 1 - $demo_rulerInfo.activeStyle = {'fill'=>'red', 'stipple'=>''} - $demo_rulerInfo.deleteStyle = {'fill'=>'red', - 'stipple'=>'@'+[$demo_dir, 'images', 'gray25.xbm'].join(File::Separator)} -else - $demo_rulerInfo.activeStyle = {'fill'=>'black', 'stipple'=>''} - $demo_rulerInfo.deleteStyle = {'fill'=>'black', - 'stipple'=>'@'+[$demo_dir, 'images', 'gray25.xbm'].join(File::Separator)} -end - -TkcLine.new($ruler_canvas, - '1c', '0.5c', '1c', '1c', '13c', '1c', '13c', '0.5c', 'width'=>1) -(0..11).each{|i| - x = i+1 - TkcLine.new($ruler_canvas, "#{x}c", '1c', "#{x}c", '0.6c', 'width'=>1) - TkcLine.new($ruler_canvas, "#{x}.25c", '1c', "#{x}.25c", '0.8c', 'width'=>1) - TkcLine.new($ruler_canvas, "#{x}.5c", '1c', "#{x}.5c", '0.7c', 'width'=>1) - TkcLine.new($ruler_canvas, "#{x}.75c", '1c', "#{x}.75c", '0.8c', 'width'=>1) - TkcText.new($ruler_canvas, "#{x}.15c", '0.75c', 'text'=>i, 'anchor'=>'sw') -} - -$rulerTag_well = TkcTag.new($ruler_canvas) -$ruler_canvas\ -.addtag_withtag($rulerTag_well, - TkcRectangle.new($ruler_canvas, - '13.2c', '1c', '13.8c', '0.5c', - 'outline'=>'black', - 'fill'=>($ruler_canvas\ - .configinfo('background'))[4]) ) -$ruler_canvas\ -.addtag_withtag($rulerTag_well, - rulerMkTab($ruler_canvas, - TkWinfo.pixels($ruler_canvas, '13.5c'), - TkWinfo.pixels($ruler_canvas, '.65c') ) ) - -$rulerTag_well.bind('1', proc{|x,y| rulerNewTab($ruler_canvas,x,y)}, '%x %y') -$ruler_canvas.itembind('tab', '1', - proc{|x,y| rulerSelectTab($ruler_canvas,x,y)}, '%x %y') -$ruler_canvas.bind('B1-Motion', - proc{|x,y| rulerMoveTab($ruler_canvas,x,y)}, '%x %y') -$ruler_canvas.bind('Any-ButtonRelease-1', proc{rulerReleaseTab($ruler_canvas)}) - -# rulerNewTab -- -# Does all the work of creating a tab stop, including creating the -# triangle object and adding tags to it to give it tab behavior. -# -# Arguments: -# c - The canvas window. -# x, y - The coordinates of the tab stop. - -def rulerNewTab(c,x,y) - v = $demo_rulerInfo - c.addtag_withtag('active', rulerMkTab(c,x,y)) - c.addtag_withtag('tab', 'active') - v.x = x - v.y = y - rulerMoveTab(c,x,y) -end - -# rulerSelectTab -- -# This method is invoked when mouse button 1 is pressed over -# a tab. It remembers information about the tab so that it can -# be dragged interactively. -# -# Arguments: -# c - The canvas widget. -# x, y - The coordinates of the mouse (identifies the point by -# which the tab was picked up for dragging). - -def rulerSelectTab(c,x,y) - v = $demo_rulerInfo - v.x = c.canvasx(x, v.grid) - v.y = v.top+2 - c.addtag_withtag('active', 'current') - c.itemconfigure('active', v.activeStyle) - c.raise('active') -end - -# rulerMoveTab -- -# This method is invoked during mouse motion events to drag a tab. -# It adjusts the position of the tab, and changes its appearance if -# it is about to be dragged out of the ruler. -# -# Arguments: -# c - The canvas widget. -# x, y - The coordinates of the mouse. - -def rulerMoveTab(c,x,y) - v = $demo_rulerInfo - return if c.find_withtag('active') == [] - cx = c.canvasx(x,v.grid) - cy = c.canvasy(y) - cx = v.left if cx < v.left - cx = v.right if cx > v.right - if (cy >= v.top && cy <= v.bottom) - cy = v.top+2 - c.itemconfigure('active', v.activeStyle) - else - cy = cy-v.size-2 - c.itemconfigure('active', v.deleteStyle) - end - c.move('active', cx-v.x, cy-v.y) - v.x = cx - v.y = cy -end - -# rulerReleaseTab -- -# This method is invoked during button release events that end -# a tab drag operation. It deselects the tab and deletes the tab if -# it was dragged out of the ruler. -# -# Arguments: -# c - The canvas widget. -# x, y - The coordinates of the mouse. - -def rulerReleaseTab(c) - v = $demo_rulerInfo - return if c.find_withtag('active') == [] - if v.y != v.top+2 - c.delete('active') - else - c.itemconfigure('active', v.normalStyle) - c.dtag('active') - end -end - diff --git a/ext/tk/sample/demos-en/sayings.rb b/ext/tk/sample/demos-en/sayings.rb deleted file mode 100644 index 4ba3097bed..0000000000 --- a/ext/tk/sample/demos-en/sayings.rb +++ /dev/null @@ -1,104 +0,0 @@ -# sayings.rb -# -# This demonstration script creates a listbox that can be scrolled -# both horizontally and vertically. It displays a collection of -# well-known sayings. -# -# listbox widget demo 'sayings' (called by 'widget') -# - -# toplevel widget -if defined?($sayings_demo) && $sayings_demo - $sayings_demo.destroy - $sayings_demo = nil -end - -# demo toplevel widget -$sayings_demo = TkToplevel.new {|w| - title("Listbox Demonstration (well-known sayings)") - iconname("sayings") - positionWindow(w) -} - -# label -msg = TkLabel.new($sayings_demo) { - font $font - wraplength '4i' - justify 'left' - text "The listbox below contains a collection of well-known sayings. You can scan the list using either of the scrollbars or by dragging in the listbox window with button 2 pressed." -} -msg.pack('side'=>'top') - -# frame -TkFrame.new($sayings_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $sayings_demo - $sayings_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'sayings'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame -sayings_lbox = nil -TkFrame.new($sayings_demo, 'borderwidth'=>10) {|w| - sv = TkScrollbar.new(w) - sh = TkScrollbar.new(w, 'orient'=>'horizontal') - sayings_lbox = TkListbox.new(w) { - setgrid 1 - width 20 - height 10 - yscrollcommand proc{|first,last| sv.set first,last} - xscrollcommand proc{|first,last| sh.set first,last} - } - sv.command(proc{|*args| sayings_lbox.yview(*args)}) - sh.command(proc{|*args| sayings_lbox.xview(*args)}) - - if $tk_version =~ /^4\.[01]/ - sv.pack('side'=>'right', 'fill'=>'y') - sh.pack('side'=>'bottom', 'fill'=>'x') - sayings_lbox.pack('expand'=>'yes', 'fill'=>'y') - - else - sayings_lbox.grid('row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - sv.grid('row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - sh.grid('row'=>1, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - TkGrid.rowconfigure(w, 0, 'weight'=>1, 'minsize'=>0) - TkGrid.columnconfigure(w, 0, 'weight'=>1, 'minsize'=>0) - end - -}.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y') - -sayings_lbox.insert(0, -"Waste not, want not", -"Early to bed and early to rise makes a man healthy, wealthy, and wise", -"Ask not what your country can do for you, ask what you can do for your country", -"I shall return", -"NOT", -"A picture is worth a thousand words", -"User interfaces are hard to build", -"Thou shalt not steal", -"A penny for your thoughts", -"Fool me once, shame on you; fool me twice, shame on me", -"Every cloud has a silver lining", -"Where there's smoke there's fire", -"It takes one to know one", -"Curiosity killed the cat; but satisfaction brought it back", -"Take this job and shove it", -"Up a creek without a paddle", -"I'm mad as hell and I'm not going to take it any more", -"An apple a day keeps the doctor away", -"Don't look a gift horse in the mouth" -) - diff --git a/ext/tk/sample/demos-en/search.rb b/ext/tk/sample/demos-en/search.rb deleted file mode 100644 index 2b27cdbb42..0000000000 --- a/ext/tk/sample/demos-en/search.rb +++ /dev/null @@ -1,192 +0,0 @@ -# search.rb -# -# This demonstration script creates a collection of widgets that -# allow you to load a file into a text widget, then perform searches -# on that file. -# -# Text Search widget demo (called by 'widget') -# - -# textLoadFile -- -# This method below loads a file into a text widget, discarding -# the previous contents of the widget. Tags for the old widget are -# not affected, however. -# -# Arguments: -# w - The window into which to load the file. Must be a -# text widget. -# file - The name of the file to load. Must be readable. - -def textLoadFile(w,file) - w.delete('1.0', 'end') - f = open(file, 'r') - while(!f.eof?) - w.insert('end', f.read(1000)) - end - f.close -end - -# textSearch -- -# Search for all instances of a given string in a text widget and -# apply a given tag to each instance found. -# -# Arguments: -# w - The window in which to search. Must be a text widget. -# string - The string to search for. The search is done using -# exact matching only; no special characters. -# tag - Tag to apply to each instance of a matching string. - -def textSearch(w, string, tag) - tag.remove('0.0', 'end') - return if string == "" - cur = '1.0' - loop { - cur, len = w.search_with_length(string, cur, 'end') - break if cur == "" - tag.add(cur, "#{cur} + #{len} char") - cur = w.index("#{cur} + #{len} char") - } -end - -# textToggle -- -# This method is invoked repeatedly to invoke two commands at -# periodic intervals. It normally reschedules itself after each -# execution but if an error occurs (e.g. because the window was -# deleted) then it doesn't reschedule itself. -# -# Arguments: -# cmd1 - Command to execute when method is called. -# sleep1 - Ms to sleep after executing cmd1 before executing cmd2. -# cmd2 - Command to execute in the *next* invocation of this method. -# sleep2 - Ms to sleep after executing cmd2 before executing cmd1 again. - -def textToggle(cmd1,sleep1,cmd2,sleep2) - sleep_list = [sleep2, sleep1] - TkAfter.new(proc{sleep = sleep_list.shift; sleep_list.push(sleep); sleep}, - -1, cmd1, cmd2).start(sleep1) -end - -# toplevel widget -if defined?($search_demo) && $search_demo - $search_demo.destroy - $search_demo = nil -end - -# demo toplevel widget -$search_demo = TkToplevel.new {|w| - title("Text Demonstration - Search and Highlight") - iconname("search") - positionWindow(w) -} - -# frame -$search_buttons = TkFrame.new($search_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $search_demo - $search_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'search'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$search_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame -TkFrame.new($search_demo) {|f| - TkLabel.new(f, 'text'=>'File name:', - 'width'=>13, 'anchor'=>'w').pack('side'=>'left') - $search_fileName = TkVariable.new - TkEntry.new(f, 'width'=>40, - 'textvariable'=>$search_fileName) { - pack('side'=>'left') - bind('Return', proc{textLoadFile($search_text, $search_fileName.value) - $search_string_entry.focus}) - focus - } - TkButton.new(f, 'text'=>'Load File', - 'command'=>proc{textLoadFile($search_text, - $search_fileName.value)})\ - .pack('side'=>'left', 'pady'=>5, 'padx'=>10) -}.pack('side'=>'top', 'fill'=>'x') - -TkFrame.new($search_demo) {|f| - TkLabel.new(f, 'text'=>'Search string:', - 'width'=>13, 'anchor'=>'w').pack('side'=>'left') - $search_searchString = TkVariable.new - $search_string_entry = TkEntry.new(f, 'width'=>40, - 'textvariable'=>$search_searchString) { - pack('side'=>'left') - bind('Return', proc{textSearch($search_text, $search_searchString.value, - $search_Tag)}) - } - TkButton.new(f, 'text'=>'Highlight', - 'command'=>proc{textSearch($search_text, - $search_searchString.value, - $search_Tag)}) { - pack('side'=>'left', 'pady'=>5, 'padx'=>10) - } -}.pack('side'=>'top', 'fill'=>'x') - -$search_text = TkText.new($search_demo, 'setgrid'=>true) {|t| - $search_Tag = TkTextTag.new(t) - TkScrollbar.new($search_demo, 'command'=>proc{|*args| t.yview(*args)}) {|sc| - t.yscrollcommand(proc{|first,last| sc.set first,last}) - pack('side'=>'right', 'fill'=>'y') - } - pack('expand'=>'yes', 'fill'=>'both') -} - -# Set up display styles for text highlighting. - -if TkWinfo.depth($search_demo) > 1 - textToggle(proc{ - begin - $search_Tag.configure('background'=>'#ce5555', - 'foreground'=>'white') - rescue - end - }, - 800, - proc{ - begin - $search_Tag.configure('background'=>'', 'foreground'=>'') - rescue - end - }, - 200 ) -else - textToggle(proc{ - begin - $search_Tag.configure('background'=>'black', - 'foreground'=>'white') - rescue - end - }, - 800, - proc{ - begin - $search_Tag.configure('background'=>'', 'foreground'=>'') - rescue - end - }, - 200 ) -end -$search_text.insert('1.0', '\ -This window demonstrates how to use the tagging facilities in text -widgets to implement a searching mechanism. First, type a file name -in the top entry, then type <Return> or click on "Load File". Then -type a string in the lower entry and type <Return> or click on -"Load File". This will cause all of the instances of the string to -be tagged with the tag "search", and it will arrange for the tag\'s -display attributes to change to make all of the strings blink.') -$search_text.set_insert '0.0' - -$search_fileName.value = '' -$search_searchString.value = '' - diff --git a/ext/tk/sample/demos-en/spin.rb b/ext/tk/sample/demos-en/spin.rb deleted file mode 100644 index 5d32454170..0000000000 --- a/ext/tk/sample/demos-en/spin.rb +++ /dev/null @@ -1,63 +0,0 @@ -# spin.rb -- -# -# This demonstration script creates several spinbox widgets. -# -# based on Tcl/Tk8.4.4 widget demos - -if defined?($spin_demo) && $spin_demo - $spin_demo.destroy - $spin_demo = nil -end - -$spin_demo = TkToplevel.new {|w| - title("Spinbox Demonstration") - iconname("spin") - positionWindow(w) -} - -TkLabel.new($spin_demo, - :font=>$font, :wraplength=>'5i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) -Three different spin-boxes are displayed below. \ -You can add characters by pointing, clicking and typing. \ -The normal Motif editing characters are supported, along with \ -many Emacs bindings. For example, Backspace and Control-h \ -delete the character to the left of the insertion cursor and \ -Delete and Control-d delete the chararacter to the right of the \ -insertion cursor. For values that are too large to fit in the \ -window all at once, you can scan through the value by dragging \ -with mouse button2 pressed. Note that the first spin-box will \ -only permit you to type in integers, and the third selects from \ -a list of Australian cities. -If your Tk library linked to Ruby doesn't include a 'spinbox' widget, \ -this demo doesn't work. Please use later version of Tk \ -which supports a 'spinbox' widget. -EOL - -TkFrame.new($spin_demo){|f| - pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - - TkButton.new(f, :text=>'Dismiss', :width=>15, :command=>proc{ - $spin_demo.destroy - $spin_demo = nil - }).pack(:side=>:left, :expand=>true) - - TkButton.new(f, :text=>'See Code', :width=>15, :command=>proc{ - showCode 'spin' - }).pack(:side=>:left, :expand=>true) -} - -australianCities = [ - 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide', - 'Brisbane', 'Hobart', 'Darwin', 'Alice Springs' -] - -[ - TkSpinbox.new($spin_demo, :from=>1, :to=>10, :width=>10, :validate=>:key, - :validatecommand=>[ - proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P' - ]), - TkSpinbox.new($spin_demo, :from=>0, :to=>3, :increment=>0.5, - :format=>'%05.2f', :width=>10), - TkSpinbox.new($spin_demo, :values=>australianCities, :width=>10) -].each{|sbox| sbox.pack(:side=>:top, :pady=>5, :padx=>10)} diff --git a/ext/tk/sample/demos-en/square b/ext/tk/sample/demos-en/square deleted file mode 100644 index 00bfde59ff..0000000000 --- a/ext/tk/sample/demos-en/square +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env ruby - -# square -- -# This script generates a demo application containing only -# a "square" widget. It's only usable if Tk has been compiled -# with tkSquare.c and with the -DSQUARE_DEMO compiler switch. -# This demo arranges the following bindings for the widget: -# -# Button-1 press/drag: moves square to mouse -# "a": toggle size animation on/off -# - -require 'tk' -require 'tkafter' - -class TkSquare<TkWindow - def create_self - begin - tk_call 'square', path - rescue - STDERR.print "\nSorry. Your Tk interpreter does not contain " + - 'a "square" demonstration widget.' + - "\n ( See documents included the Tcl/Tk source archive. )\n\n" - exit - end - end - def size(amount=nil) - if amount - tk_send 'size', amount - else - number(tk_send('size')) - end - end - def position(x,y) - tk_send 'position', x, y - end -end - -$s = TkSquare.new{ - pack('expand'=>'yes', 'fill'=>'both') - bind('1', proc{|x,y| center(x,y)}, '%s %y') - bind('B1-Motion', proc{|x,y| center(x,y)}, '%s %y') - bind('a', proc{animate}) - focus -} -TkRoot.new.minsize(1,1) - -# The procedure below centers the square on a given position. - -def center(x,y) - a = $s.size - $s.position(x-(a/2), y-(a/2)) -end - -# The procedures below provide a simple form of animation where -# the box changes size in a pulsing pattern: larger, smaller, larger, -# and so on. - -$inc = 0 - -def timer_proc - a = $s.size - return if $inc == 0 - $inc = -3 if a >= 40 - $inc = 3 if a <= 10 - $s.size(a+$inc) -end - -$timer = TkAfter.new(30, -1, proc{timer_proc}) - -def animate - if $inc == 0 - $inc = 3 - $timer.start - else - $inc = 0 - $timer.stop - end -end - -Tk.mainloop diff --git a/ext/tk/sample/demos-en/states.rb b/ext/tk/sample/demos-en/states.rb deleted file mode 100644 index d38c1245af..0000000000 --- a/ext/tk/sample/demos-en/states.rb +++ /dev/null @@ -1,78 +0,0 @@ -# states.rb -# -# This demonstration script creates a listbox widget that displays -# the names of the 50 states in the United States of America. -# -# listbox widget demo 'states' (called by 'widget') -# - -# toplevel widget -if defined?($states_demo) && $states_demo - $states_demo.destroy - $states_demo = nil -end - -# demo toplevel widget -$states_demo = TkToplevel.new {|w| - title("Listbox Demonstration (states)") - iconname("states") - positionWindow(w) -} - -# label -msg = TkLabel.new($states_demo) { - font $font - wraplength '4i' - justify 'left' - text "A listbox containing the 50 states is displayed below, along with a scrollbar. You can scan the list either using the scrollbar or by scanning. To scan, press button 2 in the widget and drag up or down." -} -msg.pack('side'=>'top') - -# frame -TkFrame.new($states_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $states_demo - $states_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'states'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame -states_lbox = nil -TkFrame.new($states_demo, 'borderwidth'=>'.5c') {|w| - s = TkScrollbar.new(w) - states_lbox = TkListbox.new(w) { - setgrid 1 - height 12 - yscrollcommand proc{|first,last| s.set first,last} - } - s.command(proc{|*args| states_lbox.yview(*args)}) - s.pack('side'=>'right', 'fill'=>'y') - states_lbox.pack('side'=>'left', 'expand'=>1, 'fill'=>'both') -}.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y') - -ins_data = [ - 'Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', - 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', - 'Hawaii', 'Idaho', 'Illinois', - 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', - 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', - 'Montana', 'Nebraska', 'Nevada', 'New_Hampshire', 'New_Jersey', 'New_Mexico', - 'New_York', 'North_Carolina', 'North_Dakota', - 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode_Island', - 'South_Carolina', 'South_Dakota', - 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', - 'West_Virginia', 'Wisconsin', 'Wyoming' -] - -states_lbox.insert(0, *ins_data) - diff --git a/ext/tk/sample/demos-en/style.rb b/ext/tk/sample/demos-en/style.rb deleted file mode 100644 index 8bf9c09662..0000000000 --- a/ext/tk/sample/demos-en/style.rb +++ /dev/null @@ -1,211 +0,0 @@ -# style.rb -# -# This demonstration script creates a text widget that illustrates the -# various display styles that may be set for tags. -# -# text (display styles) widget demo (called by 'widget') -# - -# toplevel widget -if defined?($style_demo) && $style_demo - $style_demo.destroy - $style_demo = nil -end - -# demo toplevel widget -$style_demo = TkToplevel.new {|w| - title("Text Demonstration - Display Styles") - iconname("style") - positionWindow(w) -} - -# frame -TkFrame.new($style_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $style_demo - $style_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'style'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# text -TkText.new($style_demo){|t| - # - setgrid 'true' - width 70 - height 32 - wrap 'word' - TkScrollbar.new($style_demo) {|s| - pack('side'=>'right', 'fill'=>'y') - command proc{|*args| t.yview(*args)} - t.yscrollcommand proc{|first,last| s.set first,last} - } - pack('expand'=>'yes', 'fill'=>'both') - - # - style_tag_bold = TkTextTag.new(t, 'font'=>'-*-Courier-Bold-O-Normal--*-120-*-*-*-*-*-*') - style_tag_big = TkTextTag.new(t, 'font'=>'-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*', 'kanjifont'=>$msg_kanji_font) - style_tag_verybig = TkTextTag.new(t, 'font'=>'-*-Helvetica-Bold-R-Normal--*-240-*-*-*-*-*-*') -# style_tag_small = TkTextTag.new(t, 'font'=>'-Adobe-Helvetica-Bold-R-Normal-*-100-*', 'kanjifont'=>$kanji_font) - style_tag_small = TkTextTag.new(t, 'font'=>'-Adobe-Helvetica-Bold-R-Normal-*-100-*') -### -# case($tk_version) -# when /^4.*/ -# style_tag_big = TkTextTag.new(t, 'font'=>'-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*', 'kanjifont'=>$msg_kanji_font) -# style_tag_small = TkTextTag.new(t, 'font'=>'-Adobe-Helvetica-Bold-R-Normal-*-100-*', 'kanjifont'=>$kanji_font) -# when /^8.*/ -# unless $style_demo_do_first -# $style_demo_do_first = true -# Tk.tk_call('font', 'create', '@bigascii', -# '-copy', '-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*') -# Tk.tk_call('font', 'create', '@smallascii', -# '-copy', '-Adobe-Helvetica-Bold-R-Normal-*-100-*') -# Tk.tk_call('font', 'create', '@cBigFont', -# '-compound', '@bigascii @msg_knj') -# Tk.tk_call('font', 'create', '@cSmallFont', -# '-compound', '@smallascii @kanji') -# end -# style_tag_big = TkTextTag.new(t, 'font'=>'@cBigFont') -# style_tag_small = TkTextTag.new(t, 'font'=>'@cSmallFont') -# end - - # - if TkWinfo.depth($root).to_i > 1 - style_tag_color1 = TkTextTag.new(t, 'background'=>'#a0b7ce') - style_tag_color2 = TkTextTag.new(t, 'foreground'=>'red') - style_tag_raised = TkTextTag.new(t, 'relief'=>'raised', 'borderwidth'=>1) - style_tag_sunken = TkTextTag.new(t, 'relief'=>'sunken', 'borderwidth'=>1) - else - style_tag_color1 = TkTextTag.new(t, 'background'=>'black', - 'foreground'=>'white') - style_tag_color2 = TkTextTag.new(t, 'background'=>'black', - 'foreground'=>'white') - style_tag_raised = TkTextTag.new(t, 'background'=>'white', - 'relief'=>'raised', 'borderwidth'=>1) - style_tag_sunken = TkTextTag.new(t, 'background'=>'white', - 'relief'=>'sunken', 'borderwidth'=>1) - end - - # ¥Æ¥¥¹¥È¥¿¥°ÀßÄê (¤½¤Î¾) - if $tk_version =~ /^4\.[01]/ - style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black', - 'borderwidth'=>0, - 'bgstipple'=>'gray25') - else - style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black', - 'borderwidth'=>0, - 'bgstipple'=>'gray12') - end - style_tag_fgstipple = TkTextTag.new(t, 'fgstipple'=>'gray50') - style_tag_underline = TkTextTag.new(t, 'underline'=>'on') - style_tag_overstrike = TkTextTag.new(t, 'overstrike'=>'on') - style_tag_right = TkTextTag.new(t, 'justify'=>'right') - style_tag_center = TkTextTag.new(t, 'justify'=>'center') - style_tag_super = TkTextTag.new(t, 'offset'=>'4p', 'font'=>'-Adobe-Courier-Medium-R-Normal--*-100-*-*-*-*-*-*') - style_tag_sub = TkTextTag.new(t, 'offset'=>'-2p', 'font'=>'-Adobe-Courier-Medium-R-Normal--*-100-*-*-*-*-*-*') - style_tag_margins = TkTextTag.new(t, 'lmargin1'=>'12m', 'lmargin2'=>'6m', - 'rmargin'=>'10m') - style_tag_spacing = TkTextTag.new(t, 'spacing1'=>'10p', 'spacing2'=>'2p', - 'lmargin1'=>'12m', 'lmargin2'=>'6m', - 'rmargin'=>'10m') - - # - insert('end', 'Text widgets like this one allow you to display information in a -variety of styles. Display styles are controlled using a mechanism -called ') - insert('end', 'tags', style_tag_big) - insert('end', '. Tags are just textual names that you can apply to one -or more ranges of characters within a text widget. You can configure -tags with various display styles. If you do this, then the tagged -characters will be displayed with the styles you chose. The -available display styles are: -') - insert('end', "\n1. Font.", style_tag_big) - insert('end', " You can choose any X font, ") - insert('end', "large", style_tag_verybig) - insert('end', " or ") - insert('end', "small.\n") - insert('end', "\n2. Color.", style_tag_big) - insert('end', " You can change either the ") - insert('end', "background", style_tag_color1) - insert('end', " or ") - insert('end', "foreground", style_tag_color2) - insert('end', "\ncolor, or ") - insert('end', "both", style_tag_color1, style_tag_color2) - insert('end', ".\n") - insert('end', "\n3. Stippling.", style_tag_big) - insert('end', " You can cause either the ") - insert('end', "background", style_tag_bgstipple) - insert('end', " or ") - insert('end', "foreground", style_tag_fgstipple) - insert('end', "\ninformation to be drawn with a stipple fill instead of a solid fill.\n") - insert('end', "\n4. Underlining.", style_tag_big) - insert('end', " You can ") - insert('end', "underline", style_tag_underline) - insert('end', " ranges of text.\n") - insert('end', "\n5. Overstrikes.", style_tag_big) - insert('end', " You can ") - insert('end', "draw lines through", style_tag_overstrike) - insert('end', " ranges of text.\n") - insert('end', "\n6. 3-D effects.", style_tag_big) - insert('end', " You can arrange for the background to be drawn\nwith a border that makes characters appear either\n") - insert('end', "raised", style_tag_raised) - insert('end', " or ") - insert('end', "sunken", style_tag_sunken) - insert('end', ".\n") - insert('end', "\n7. Justification.", style_tag_big) - insert('end', " You can arrange for lines to be displayed\n") - insert('end', "left-justified,\n") - insert('end', "right-justified, or\n", style_tag_right) - insert('end', "centered.\n", style_tag_center) - insert('end', "\n8. Superscripts and subscripts.", style_tag_big) - insert('end', " You can control the vertical\n") - insert('end', "position of text to generate superscript effects like 10") - insert('end', "n", style_tag_super) - insert('end', " or\nsubscript effects like X") - insert('end', "i", style_tag_sub) - insert('end', ".\n") - insert('end', "\n9. Margins.", style_tag_big) - insert('end', " You can control the amount of extra space left") - insert('end', " on\neach side of the text:\n") - insert('end', "This paragraph is an example of the use of ", style_tag_margins) - insert('end', "margins. It consists of a single line of text ", style_tag_margins) - insert('end', "that wraps around on the screen. There are two ", style_tag_margins) - insert('end', "separate left margin values, one for the first ", style_tag_margins) - insert('end', "display line associated with the text line, ", style_tag_margins) - insert('end', "and one for the subsequent display lines, which ", style_tag_margins) - insert('end', "occur because of wrapping. There is also a ", style_tag_margins) - insert('end', "separate specification for the right margin, ", style_tag_margins) - insert('end', "which is used to choose wrap points for lines.\n", style_tag_margins) - insert('end', "\n10. Spacing.", style_tag_big) - insert('end', " You can control the spacing of lines with three\n") - insert('end', "separate parameters. \"Spacing1\" tells how much ") - insert('end', "extra space to leave\nabove a line, \"spacing3\" ") - insert('end', "tells how much space to leave below a line,\nand ") - insert('end', "if a text line wraps, \"spacing2\" tells how much ") - insert('end', "space to leave\nbetween the display lines that ") - insert('end', "make up the text line.\n") - insert('end', "These indented paragraphs illustrate how spacing ", style_tag_spacing) - insert('end', "can be used. Each paragraph is actually a ", style_tag_spacing) - insert('end', "single line in the text widget, which is ", style_tag_spacing) - insert('end', "word-wrapped by the widget.\n", style_tag_spacing) - insert('end', "Spacing1 is set to 10 points for this text, ", style_tag_spacing) - insert('end', "which results in relatively large gaps between ", style_tag_spacing) - insert('end', "the paragraphs. Spacing2 is set to 2 points, ", style_tag_spacing) - insert('end', "which results in just a bit of extra space ", style_tag_spacing) - insert('end', "within a pararaph. Spacing3 isn't used ", style_tag_spacing) - insert('end', "in this example.\n", style_tag_spacing) - insert('end', "To see where the space is, select ranges of ", style_tag_spacing) - insert('end', "text within these paragraphs. The selection ", style_tag_spacing) - insert('end', "highlight will cover the extra space.", style_tag_spacing) - -} - diff --git a/ext/tk/sample/demos-en/tcolor b/ext/tk/sample/demos-en/tcolor deleted file mode 100644 index 6d023f0f8b..0000000000 --- a/ext/tk/sample/demos-en/tcolor +++ /dev/null @@ -1,519 +0,0 @@ -#!/usr/bin/env ruby -# -# tcolor -- -# ¤³¤Î¥¹¥¯¥ê¥×¥È¤ÏRGB,HSB,CYM·Á¼°¤ò¥µ¥Ý¡¼¥È¤¹¤ë -# ´Ê°×¥«¥é¡¼¥¨¥Ç¥£¥¿¤Ç¤¹¡£ -# -# Copyright (C) 1998 Takaaki Tateishi(ttate@jaist.ac.jp) -# last update: Thu Jun 18 06:32:35 JST 1998 -# - -# ¤Þ¤º¤Ïtk.rb¤òÆÉ¤ß¹þ¤à¡£ - -require "tk" - - -# Tk¤Ë¤è¤Ã¤ÆÊѹ¹¤µ¤ì¤ëÊÑ¿ô¤ÏTkVariable¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤ò»È¤¦¡£ - -$colorSpace = TkVariable.new(:rgb) -$red = 65535 -$green = 0 -$blue = 0 -$color = "#ffff00000000" -$updating = TkVariable.new(0) -$autoUpdate = TkVariable.new(1) -$name = TkVariable.new("") -# $command = TkVariable.new("print(%%,\"\n\")") -$command = TkVariable.new("") -$label1 = TkVariable.new("label1") -$label2 = TkVariable.new("label2") -$label3 = TkVariable.new("label3") - - -# setup the entry of the resourc database -if (TkVarAccess.new('tcl_platform')['platform'] == 'unix') - TkOptionDB.add('*Entry.background', 'white') -end - - -# ³Æ¥¤¥Ù¥ó¥ÈÍѤΥ᥽¥Ã¥É - -def rgbToHsv(red,green,blue) - - if ( red > green ) - max = red - min = green - else - max = green - min = red - end - - if ( blue > max ) - max = blue - else - if ( blue < min ) - min = blue - end - end - - range = max - min - - if ( max == 0 ) - sat = 0.0 - else - sat = (max-min)/max - end - - if ( sat == 0 ) - hue = 0.0 - else - rc = (max-red)/range - gc = (max-green)/range - bc = (max-blue)/range - if ( red == max ) - hue = 0.166667 * (bc - gc) - else - if ( green == max ) - hue = 0.166667 * (2.0 + rc - bc) - else - hue = 0.166667 * (4.0 + gc - rc) - end - end - if ( hue < 0.0 ) - hue = hue + 1.0 - end - end - - [hue,sat,max/65535] -end - - -def hsbToRgb(hue,sat,value) - v = 65535.0 * value - if( sat == 0 ) - ans = [v,v,v] - else - hue = hue*6.0 - if ( hue >= 6 ) - hue = 0.0 - end - i = hue.to_i - f = hue - i - p = 65535.0 * value * (1.0 - sat) - q = 65535.0 * value * (1.0 - (sat * f)) - t = 65535.0 * value * (1.0 - (sat * (1.0 - f))) - case i - when 0 - ans = [v,t,p] - when 1 - ans = [q,v,p] - when 2 - ans = [p,v,t] - when 3 - ans = [p,q,v] - when 4 - ans = [t,p,v] - when 5 - ans = [v,p,q] - else - raise(eException,"i value #{i} is out of range") - end - end - return ans -end - - -def doUpdate - newCmd = $command.to_s.gsub("%%","\"#{$color}\"") - eval(newCmd) -end - - -def tc_scaleChanged - if( $updating.to_i == 1 ) - return - end - - scale1 = $root.middle.middle.scale1 - scale2 = $root.middle.middle.scale2 - scale3 = $root.middle.middle.scale3 - - case $colorSpace.value.intern - when :rgb - $red = (scale1.get * 65.535).to_i - $green = (scale2.get * 65.535).to_i - $blue = (scale3.get * 65.535).to_i - when :cmy - $red = (65535 - scale1.get * 65.535).to_i - $green = (65535 - scale2.get * 65.535).to_i - $blue = (65535 - scale3.get * 65.535).to_i - when :hsb - list = hsbToRgb(scale1.get / 1000.0, - scale2.get / 1000.0, - scale3.get / 1000.0) - $red = list[0] - $green = list[1] - $blue = list[2] - else - raise(Exception,"unknown colorSpace") - end - $color = format("#%04x%04x%04x",$red.to_i,$green.to_i,$blue.to_i) - $root.middle.right.set_color($color) - if( $autoUpdate.to_i == 1 ) - doUpdate - end - Tk.update(TRUE) -end - - -def tc_setScales - $updating.value = 1 - - scale1 = $root.middle.middle.scale1 - scale2 = $root.middle.middle.scale2 - scale3 = $root.middle.middle.scale3 - - case $colorSpace.value.intern - when :rgb - scale1.set($red / 65.535) - scale2.set($green / 65.535) - scale3.set($blue / 65.535) - when :cmy - scale1.set((65535 - $red) / 65.535) - scale2.set((65535 - $green) / 65.535) - scale3.set((65535 - $blue) / 65.535) - when :hsb - list = rgbToHsv($red,$green,$blue) - scale1.set( list[0] * 1000.0 ) - scale2.set( list[1] * 1000.0 ) - scale3.set( list[2] * 1000.0 ) - else - raise(Exception,"unknown colorSpace") - end - - $updating.value = 0 -end - - -def tc_loadNamedColor(name) - if name[0,1] != "#" - list = TkWinfo.rgb($root.middle.right.swatch,name) - $red = list[0] - $green = list[1] - $blue = list[2] - else - case name.length - when 4 - format = /#(.{1})(.{1})(.{1})/ - shift = 12 - when 7 - format = /#(.{2})(.{2})(.{2})/ - shift = 8 - when 10 - format = /#(.{3})(.{3})(.{3})/ - shift = 4 - when 13 - format = /#(.{4})(.{4})(.{4})/ - shift = 0 - else - raise(eException,"syntax error in color name \"#{name}\"") - end - name.scan(format){|strlist| - if strlist.length != 3 - raise(eException,"syntax error in color name \"#{name}\"") - end - $red = strlist[0].to_i - $green = strlist[1].to_i - $blue = strlist[2].to_i - } - $red = $red << shift - $green = $green << shift - $blue = $blue << shift - end - - tc_setScales - $color = format("#%04x%04x%04x",$red,$green,$blue) - $root.middle.right.set_color($color) - if $autoUpdate.to_i == 1 - doUpdate - end -end - - -def changeColorSpace(space) - case space - when :rgb - $label1.value = "Red" - $label2.value = "Green" - $label3.value = "Blue" - when :cmy - $label1.value = "Cyan" - $label2.value = "Magenta" - $label3.value = "Yellow" - when :hsb - $label1.value = "Hue" - $label2.value = "Saturation" - $label3.value = "Brightness" - end - tc_setScales -end - - - - - -# tcolorÍѤΥá¥Ë¥å¡¼ - -class TkColorMenuFrame<TkFrame - def initialize(parent) - super(parent, - "relief"=>"raised", - "borderwidth"=>"2") - - # File¥á¥Ë¥å¡¼¥Ü¥¿¥ó¤ÎÀ¸À® - @file = TkMenubutton.new(self){|button| - - # File¥á¥Ë¥å¡¼¤ÎºîÀ® - @file_menu = TkMenu.new(button){ - add "radio", - "label" => "RGB color space", - "variable" => $colorSpace, - "value" => :rgb, - "underline" => "0", - "command" => proc{changeColorSpace(:rgb)} - add "radio", - "label" => "CMY color space", - "variable" => $colorSpace, - "value" => :cmy, - "underline" => "0", - "command" => proc{changeColorSpace(:cmy)} - add "radio", - "label" => "HSB color space", - "variable" => $colorSpace, - "value" => :hsb, - "underline" => "0", - "command" => proc{changeColorSpace(:hsb)} - add "separator" - add "radio", - "label" => "Automatic updates", - "variable" => $autoUpdate, - "value" => "1", - "underline" => "0" - add "radio", - "label" => "Manual updates", - "variable" => $autoUpdate, - "value" => "0", - "underline" => "0" - add "separator" - add "command", - "label" => "Exit program", - "underline" => "0", - "command" => proc{exit} - } - - # File¥á¥Ë¥å¡¼¤ÈFile¥Ü¥¿¥ó¤ò´ØÏ¢ÉÕ¤±¤ë - menu @file_menu - - text "File" - underline "0" - }.pack("side"=>"left") - - self - end -end - - -# ²¼Éô¤Î¥Õ¥ì¡¼¥à¤Î¤¿¤á¤Î¥¯¥é¥¹ -class TkColorBotFrame<TkFrame - def initialize(parent) - super(parent, - "relief"=> "raised", - "borderwidth"=> 2) - - @commandLabel = TkLabel.new(self, - "text"=> "Command:") - @command = TkEntry.new(self, - "relief"=> "sunken", - "borderwidth"=> "2", - "textvariable"=> $command, - "font"=> "-Adobe-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*") - @update = TkButton.new(self, - "text"=> "Update", - "command"=> proc{doUpdate}) - @commandLabel.pack("side"=>"left") - @update.pack("side"=>"right","pady"=>".1c","padx"=>".25c") - @command.pack("expand"=>"yes","fill"=>"x","ipadx"=>".25c") - - self - end -end - - -# ÃæÃʺ¸¤Î¥Õ¥ì¡¼¥à -class TkColorMiddleLeftFrame<TkFrame - def initialize(parent) - super(parent) - - for i in ["/usr/local/lib/X11rgb.txt","/usr/lib/X11/rgb.txt", - "/X11/R5/lib/X11/rgb.txt","/X11/R4/lib/rgb/rgb.txt", - "/usr/openwin/lib/X11/rgb.txt"] - if !File.readable?(i) - next - end - f = File.open(i) - @scroll = TkScrollbar.new(self, - "orient"=>"vertical", - "relief"=>"sunken", - "borderwidth"=>"2") - @scroll.pack("side"=>"right","fill"=>"y") - @names = TkListbox.new(self, - "width"=>"20", - "height"=>"12", - "yscrollcommand"=> proc{|first,last| @scroll.set first,last}, - "relief"=>"sunken", - "borderwidth"=>"2", - "exportselection"=>"false") - @scroll.command(proc{|*args| @names.yview(*args)}) - @names.bind("Double-1",proc{ - tc_loadNamedColor(@names.get(@names.curselection))}) - @names.pack("side"=>"left") - while (line = f.gets) - line.chop! - linelist = line.split(/[ \t]+/) - if linelist.length == 4 - @names.insert("end",linelist[3]) - end - end - f.close - break - end - - self - end -end - - -# ÃæÃÊÃæ±û¤Î¥Õ¥ì¡¼¥à -class TkColorMiddleMiddleFrame<TkFrame - # @scale1,@scale2,@scale3¤ò³°Éô¤«¤é»²¾È¤Î¤ßµö²Ä¤¹¤ë¡£(Êѹ¹ÉÔ²Ä) - attr_reader :scale1, :scale2, :scale3 - - def initialize(parent) - super(parent) - - @f1 = TkFrame.new(self) - @f2 = TkFrame.new(self) - @f3 = TkFrame.new(self) - @f4 = TkFrame.new(self) - - for f in [@f1,@f2,@f3] - f.pack("side"=>"top","expand"=>"yes") - end - @f4.pack("side"=>"top","expand"=>"yes","fill"=>"x") - - @label1 = TkLabel.new(self,"textvariable"=>$label1) - @scale1 = TkScale.new(self,"from"=>"0","to"=>"1000","length"=>"6c", - "orient"=>"horizontal", - "command"=>proc{tc_scaleChanged}) - @scale1.pack("side"=>"top","anchor"=>"w") - @label1.pack("side"=>"top","anchor"=>"w") - - @label2 = TkLabel.new(self,"textvariable"=>$label2) - @scale2 = TkScale.new(self,"from"=>"0","to"=>"1000","length"=>"6c", - "orient"=>"horizontal", - "command"=>proc{tc_scaleChanged}) - @scale2.pack("side"=>"top","anchor"=>"w") - @label2.pack("side"=>"top","anchor"=>"w") - - @label3 = TkLabel.new(self,"textvariable"=>$label3) - @scale3 = TkScale.new(self,"from"=>"0","to"=>"1000","length"=>"6c", - "orient"=>"horizontal", - "command"=>proc{tc_scaleChanged}) - @scale3.pack("side"=>"top","anchor"=>"w") - @label3.pack("side"=>"top","anchor"=>"w") - - @nameLabel = TkLabel.new(self,"text"=>"Name:") - @name = TkEntry.new(self,"relief"=>"sunken","borderwidth"=>"2", - "textvariable"=>$name,"width"=>"10", - "font"=>"-Adobe-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*") - @nameLabel.pack("side"=>"left") - @name.pack("side"=>"right", "expand"=>"1", "fill"=>"x") - @name.bind("Return",proc{tc_loadNamedColor $name.to_s}) - - self - end -end - - -class TkColorMiddleRightFrame<TkFrame - attr_reader :swatch - - def initialize(parent) - super(parent) - @swatch = TkFrame.new(self, "width"=>"2c", "height"=>"5c", - "background"=>$color) - @value = TkLabel.new(self, - "text"=>$color, - "width"=>"13", - "font"=>"-Adobe-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*") - @swatch.pack("side"=>"top","expand"=>"yes","fill"=>"both") - @value.pack("side"=>"bottom","pady"=>".25c") - - self - end - - def set_color(color) - @swatch["background"] = color - @value["text"] = color - end -end - - - -# ÃæÃʤΥե졼¥à -class TkColorMiddleFrame<TkFrame - attr_reader :left, :middle, :right - - def initialize(parent) - super(parent, - "relief"=> "raised", - "borderwidth"=> "2") - - @left = TkColorMiddleLeftFrame.new(self) - @left.pack("side"=>"left","padx"=>".25c","pady"=>".25c") - - @middle = TkColorMiddleMiddleFrame.new(self) - @middle.pack("side"=>"left","expand"=>"yes","fill"=>"y") - - @right = TkColorMiddleRightFrame.new(self) - @right.pack("side"=>"left","padx"=>".25c","pady"=>".25c","anchor"=>"s") - - self - end -end - - -class TkColor<TkRoot - attr_reader :menu, :bottom, :middle - - def initialize(*args) - super(*args) - @menu = TkColorMenuFrame.new(self) - @menu.pack("side"=>"top", "fill"=>"x") - - @bottom = TkColorBotFrame.new(self) - @bottom.pack("side"=>"bottom","fill"=>"x") - - @middle = TkColorMiddleFrame.new(self) - @middle.pack("side"=>"top","fill"=>"both") - - self - end -end - - -$root = TkColor.new - -# ¥¤¥Ù¥ó¥È¤òÂԤİ٤˥롼¥×¤ËÆþ¤ë¡£ -changeColorSpace :rgb -Tk.mainloop diff --git a/ext/tk/sample/demos-en/tcolor.bak b/ext/tk/sample/demos-en/tcolor.bak deleted file mode 100644 index 5464aebae2..0000000000 --- a/ext/tk/sample/demos-en/tcolor.bak +++ /dev/null @@ -1,513 +0,0 @@ -#!/usr/local/bin/ruby -# -# tcolor -- -# ¤³¤Î¥¹¥¯¥ê¥×¥È¤ÏRGB,HSB,CYM·Á¼°¤ò¥µ¥Ý¡¼¥È¤¹¤ë -# ´Ê°×¥«¥é¡¼¥¨¥Ç¥£¥¿¤Ç¤¹¡£ -# -# Copyright (C) 1998 Takaaki Tateishi(ttate@jaist.ac.jp) -# last update: Thu Jun 18 06:32:35 JST 1998 -# - -# ¤Þ¤º¤Ïtk.rb¤òÆÉ¤ß¹þ¤à¡£ - -require "tk" - - -# Tk¤Ë¤è¤Ã¤ÆÊѹ¹¤µ¤ì¤ëÊÑ¿ô¤ÏTkVariable¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤ò»È¤¦¡£ - -$colorSpace = TkVariable.new(:rgb) -$red = 65535 -$green = 0 -$blue = 0 -$color = "#ffff00000000" -$updating = TkVariable.new(0) -$autoUpdate = TkVariable.new(1) -$name = TkVariable.new("") -# $command = TkVariable.new("print(%%,\"\n\")") -$command = TkVariable.new("") -$label1 = TkVariable.new("label1") -$label2 = TkVariable.new("label2") -$label3 = TkVariable.new("label3") - - -# ³Æ¥¤¥Ù¥ó¥ÈÍѤΥ᥽¥Ã¥É - -def rgbToHsv(red,green,blue) - - if ( red > green ) - max = red - min = green - else - max = green - min = red - end - - if ( blue > max ) - max = blue - else - if ( blue < min ) - min = blue - end - end - - range = max - min - - if ( max == 0 ) - sat = 0.0 - else - sat = (max-min)/max - end - - if ( sat == 0 ) - hue = 0.0 - else - rc = (max-red)/range - gc = (max-green)/range - bc = (max-blue)/range - if ( red == max ) - hue = 0.166667 * (bc - gc) - else - if ( green == max ) - hue = 0.166667 * (2.0 + rc - bc) - else - hue = 0.166667 * (4.0 + gc - rc) - end - end - if ( hue < 0.0 ) - hue = hue + 1.0 - end - end - - [hue,sat,max/65535] -end - - -def hsbToRgb(hue,sat,value) - v = 65535.0 * value - if( sat == 0 ) - ans = [v,v,v] - else - hue = hue*6.0 - if ( hue >= 6 ) - hue = 0.0 - end - i = hue.to_i - f = hue - i - p = 65535.0 * value * (1.0 - sat) - q = 65535.0 * value * (1.0 - (sat * f)) - t = 65535.0 * value * (1.0 - (sat * (1.0 - f))) - case i - when 0 - ans = [v,t,p] - when 1 - ans = [q,v,p] - when 2 - ans = [p,v,t] - when 3 - ans = [p,q,v] - when 4 - ans = [t,p,v] - when 5 - ans = [v,p,q] - else - raise(eException,"i value #{i} is out of range") - end - end - return ans -end - - -def doUpdate - newCmd = $command.to_s.gsub("%%","\"#{$color}\"") - eval(newCmd) -end - - -def tc_scaleChanged - if( $updating.to_i == 1 ) - return - end - - scale1 = $root.middle.middle.scale1 - scale2 = $root.middle.middle.scale2 - scale3 = $root.middle.middle.scale3 - - case $colorSpace.to_i - when :rgb - $red = (scale1.get * 65.535).to_i - $green = (scale2.get * 65.535).to_i - $blue = (scale3.get * 65.535).to_i - when :cmy - $red = (65535 - scale1.get * 65.535).to_i - $green = (65535 - scale2.get * 65.535).to_i - $blue = (65535 - scale3.get * 65.535).to_i - when :hsb - list = hsbToRgb(scale1.get / 1000.0, - scale2.get / 1000.0, - scale3.get / 1000.0) - $red = list[0] - $green = list[1] - $blue = list[2] - else - raise(Exception,"unknown colorSpace") - end - $color = format("#%04x%04x%04x",$red.to_i,$green.to_i,$blue.to_i) - $root.middle.right.set_color($color) - if( $autoUpdate.to_i == 1 ) - doUpdate - end - Tk.update(TRUE) -end - - -def tc_setScales - $updating.value = 1 - - scale1 = $root.middle.middle.scale1 - scale2 = $root.middle.middle.scale2 - scale3 = $root.middle.middle.scale3 - - case $colorSpace.to_i - when :rgb - scale1.set($red / 65.535) - scale2.set($green / 65.535) - scale3.set($blue / 65.535) - when :cmy - scale1.set((65535 - $red) / 65.535) - scale2.set((65535 - $green) / 65.535) - scale3.set((65535 - $blue) / 65.535) - when :hsb - list = rgbToHsv($red,$green,$blue) - scale1.set( list[0] * 1000.0 ) - scale2.set( list[1] * 1000.0 ) - scale3.set( list[2] * 1000.0 ) - else - raise(Exception,"unknown colorSpace") - end - - $updating.value = 0 -end - - -def tc_loadNamedColor(name) - if name[0,1] != "#" - list = TkWinfo.rgb($root.middle.right.swatch,name) - $red = list[0] - $green = list[1] - $blue = list[2] - else - case name.length - when 4 - format = /#(.{1})(.{1})(.{1})/ - shift = 12 - when 7 - format = /#(.{2})(.{2})(.{2})/ - shift = 8 - when 10 - format = /#(.{3})(.{3})(.{3})/ - shift = 4 - when 13 - format = /#(.{4})(.{4})(.{4})/ - shift = 0 - else - raise(eException,"syntax error in color name \"#{name}\"") - end - name.scan(format){|strlist| - if strlist.length != 3 - raise(eException,"syntax error in color name \"#{name}\"") - end - $red = strlist[0].to_i - $green = strlist[1].to_i - $blue = strlist[2].to_i - } - $red = $red << shift - $green = $green << shift - $blue = $blue << shift - end - - tc_setScales - $color = format("#%04x%04x%04x",$red,$green,$blue) - $root.middle.right.set_color($color) - if $autoUpdate.to_i == 1 - doUpdate - end -end - - -def changeColorSpace(space) - case space - when :rgb - $label1.value = "Red" - $label2.value = "Green" - $label3.value = "Blue" - when :cmy - $label1.value = "Cyan" - $label2.value = "Magenta" - $label3.value = "Yellow" - when :hsb - $label1.value = "Hue" - $label2.value = "Saturation" - $label3.value = "Brightness" - end - tc_setScales -end - - - - - -# tcolorÍѤΥá¥Ë¥å¡¼ - -class TkColorMenuFrame<TkFrame - def initialize(parent) - super(parent, - "relief"=>"raised", - "borderwidth"=>"2") - - # File¥á¥Ë¥å¡¼¥Ü¥¿¥ó¤ÎÀ¸À® - @file = TkMenubutton.new(self){|button| - - # File¥á¥Ë¥å¡¼¤ÎºîÀ® - @file_menu = TkMenu.new(button){ - add "radio", - "label" => "RGB color space", - "variable" => $colorSpace, - "value" => :rgb, - "underline" => "0", - "command" => proc{changeColorSpace(:rgb)} - add "radio", - "label" => "CMY color space", - "variable" => $colorSpace, - "value" => :cmy, - "underline" => "0", - "command" => proc{changeColorSpace(:cmy)} - add "radio", - "label" => "HSB color space", - "variable" => $colorSpace, - "value" => :hsb, - "underline" => "0", - "command" => proc{changeColorSpace(:hsb)} - add "separator" - add "radio", - "label" => "Qutomatic updates", - "variable" => $autoUpdate, - "value" => "1", - "underline" => "0" - add "radio", - "label" => "Manual updates", - "variable" => $autoUpdate, - "value" => "0", - "underline" => "0" - add "separator" - add "command", - "label" => "Exit program", - "underline" => "0", - "command" => proc{exit} - } - - # File¥á¥Ë¥å¡¼¤ÈFile¥Ü¥¿¥ó¤ò´ØÏ¢ÉÕ¤±¤ë - menu @file_menu - - text "File" - underline "0" - }.pack("side"=>"left") - - self - end -end - - -# ²¼Éô¤Î¥Õ¥ì¡¼¥à¤Î¤¿¤á¤Î¥¯¥é¥¹ -class TkColorBotFrame<TkFrame - def initialize(parent) - super(parent, - "relief"=> "raised", - "borderwidth"=> 2) - - @commandLabel = TkLabel.new(self, - "text"=> "Command:") - @command = TkEntry.new(self, - "relief"=> "sunken", - "borderwidth"=> "2", - "textvariable"=> $command, - "font"=> "-Adobe-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*") - @update = TkButton.new(self, - "text"=> "Update", - "command"=> proc{doUpdate}) - @commandLabel.pack("side"=>"left") - @update.pack("side"=>"right","pady"=>".1c","padx"=>".25c") - @command.pack("expand"=>"yes","fill"=>"x","ipadx"=>".25c") - - self - end -end - - -# ÃæÃʺ¸¤Î¥Õ¥ì¡¼¥à -class TkColorMiddleLeftFrame<TkFrame - def initialize(parent) - super(parent) - - for i in ["/usr/local/lib/X11rgb.txt","/usr/lib/X11/rgb.txt", - "/X11/R5/lib/X11/rgb.txt","/X11/R4/lib/rgb/rgb.txt", - "/usr/openwin/lib/X11/rgb.txt"] - if !File.readable?(i) - next - end - f = File.open(i) - @scroll = TkScrollbar.new(self, - "orient"=>"vertical", - "relief"=>"sunken", - "borderwidth"=>"2") - @scroll.pack("side"=>"right","fill"=>"y") - @names = TkListbox.new(self, - "width"=>"20", - "height"=>"12", - "yscrollcommand"=> proc{|first,last| @scroll.set first,last}, - "relief"=>"sunken", - "borderwidth"=>"2", - "exportselection"=>"false") - @scroll.command(proc{|*args| @names.yview *args}) - @names.bind("Double-1",proc{ - tc_loadNamedColor(@names.get(@names.curselection))}) - @names.pack("side"=>"left") - while (line = f.gets) - line.chop! - linelist = line.split(/[ \t]+/) - if linelist.length == 4 - @names.insert("end",linelist[3]) - end - end - f.close - break - end - - self - end -end - - -# ÃæÃÊÃæ±û¤Î¥Õ¥ì¡¼¥à -class TkColorMiddleMiddleFrame<TkFrame - # @scale1,@scale2,@scale3¤ò³°Éô¤«¤é»²¾È¤Î¤ßµö²Ä¤¹¤ë¡£(Êѹ¹ÉÔ²Ä) - attr_reader :scale1, :scale2, :scale3 - - def initialize(parent) - super(parent) - - @f1 = TkFrame.new(self) - @f2 = TkFrame.new(self) - @f3 = TkFrame.new(self) - @f4 = TkFrame.new(self) - - for f in [@f1,@f2,@f3] - f.pack("side"=>"top","expand"=>"yes") - end - @f4.pack("side"=>"top","expand"=>"yes","fill"=>"x") - - @label1 = TkLabel.new(self,"textvariable"=>$label1) - @scale1 = TkScale.new(self,"from"=>"0","to"=>"1000","length"=>"6c", - "orient"=>"horizontal", - "command"=>proc{tc_scaleChanged}) - @scale1.pack("side"=>"top","anchor"=>"w") - @label1.pack("side"=>"top","anchor"=>"w") - - @label2 = TkLabel.new(self,"textvariable"=>$label2) - @scale2 = TkScale.new(self,"from"=>"0","to"=>"1000","length"=>"6c", - "orient"=>"horizontal", - "command"=>proc{tc_scaleChanged}) - @scale2.pack("side"=>"top","anchor"=>"w") - @label2.pack("side"=>"top","anchor"=>"w") - - @label3 = TkLabel.new(self,"textvariable"=>$label3) - @scale3 = TkScale.new(self,"from"=>"0","to"=>"1000","length"=>"6c", - "orient"=>"horizontal", - "command"=>proc{tc_scaleChanged}) - @scale3.pack("side"=>"top","anchor"=>"w") - @label3.pack("side"=>"top","anchor"=>"w") - - @nameLabel = TkLabel.new(self,"text"=>"Name:") - @name = TkEntry.new(self,"relief"=>"sunken","borderwidth"=>"2", - "textvariable"=>$name,"width"=>"10", - "font"=>"-Adobe-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*") - @nameLabel.pack("side"=>"left") - @name.pack("side"=>"right", "expand"=>"1", "fill"=>"x") - @name.bind("Return",proc{tc_loadNamedColor $name.to_s}) - - self - end -end - - -class TkColorMiddleRightFrame<TkFrame - attr_reader :swatch - - def initialize(parent) - super(parent) - @swatch = TkFrame.new(self, "width"=>"2c", "height"=>"5c", - "background"=>$color) - @value = TkLabel.new(self, - "text"=>$color, - "width"=>"13", - "font"=>"-Adobe-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*") - @swatch.pack("side"=>"top","expand"=>"yes","fill"=>"both") - @value.pack("side"=>"bottom","pady"=>".25c") - - self - end - - def set_color(color) - @swatch["background"] = color - @value["text"] = color - end -end - - - -# ÃæÃʤΥե졼¥à -class TkColorMiddleFrame<TkFrame - attr_reader :left, :middle, :right - - def initialize(parent) - super(parent, - "relief"=> "raised", - "borderwidth"=> "2") - - @left = TkColorMiddleLeftFrame.new(self) - @left.pack("side"=>"left","padx"=>".25c","pady"=>".25c") - - @middle = TkColorMiddleMiddleFrame.new(self) - @middle.pack("side"=>"left","expand"=>"yes","fill"=>"y") - - @right = TkColorMiddleRightFrame.new(self) - @right.pack("side"=>"left","padx"=>".25c","pady"=>".25c","anchor"=>"s") - - self - end -end - - -class TkColor<TkRoot - attr_reader :menu, :bottom, :middle - - def initialize - super - @menu = TkColorMenuFrame.new(self) - @menu.pack("side"=>"top", "fill"=>"x") - - @bottom = TkColorBotFrame.new(self) - @bottom.pack("side"=>"bottom","fill"=>"x") - - @middle = TkColorMiddleFrame.new(self) - @middle.pack("side"=>"top","fill"=>"both") - - self - end -end - - -$root = TkColor.new - -# ¥¤¥Ù¥ó¥È¤òÂԤİ٤˥롼¥×¤ËÆþ¤ë¡£ -changeColorSpace :rgb -Tk.mainloop diff --git a/ext/tk/sample/demos-en/text.rb b/ext/tk/sample/demos-en/text.rb deleted file mode 100644 index 2ed53e6938..0000000000 --- a/ext/tk/sample/demos-en/text.rb +++ /dev/null @@ -1,126 +0,0 @@ -# text.rb -# -# This demonstration script creates a text widget that describes -# the basic editing functions. -# -# text (basic facilities) widget demo (called by 'widget') -# - -# toplevel widget -if defined?($text_demo) && $text_demo - $text_demo.destroy - $text_demo = nil -end - -# demo toplevel widget -$text_demo = TkToplevel.new {|w| - title("Text Demonstration - Basic Facilities") - iconname("text") - positionWindow(w) -} - -# version check -if ((Tk::TK_VERSION.split('.').collect{|n| n.to_i} <=> [8,4]) < 0) - undo_support = false -else - undo_support = true -end - -# frame -TkFrame.new($text_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $text_demo - $text_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'text'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# text -TkText.new($text_demo){|t| - relief 'sunken' - bd 2 - setgrid 1 - height 30 - if undo_support - undo true - autoseparators true - end - TkScrollbar.new($text_demo) {|s| - pack('side'=>'right', 'fill'=>'y') - command proc{|*args| t.yview(*args)} - t.yscrollcommand proc{|first,last| s.set first,last} - } - pack('expand'=>'yes', 'fill'=>'both') - - # - insert('0.0', <<EOT) -This window is a text widget. It displays one or more lines of text -and allows you to edit the text. Here is a summary of the things you -can do to a text widget: - -1. Scrolling. Use the scrollbar to adjust the view in the text window. - -2. Scanning. Press mouse button 2 in the text window and drag up or down. -This will drag the text at high speed to allow you to scan its contents. - -3. Insert text. Press mouse button 1 to set the insertion cursor, then -type text. What you type will be added to the widget. - -4. Select. Press mouse button 1 and drag to select a range of characters. -Once you've released the button, you can adjust the selection by pressing -button 1 with the shift key down. This will reset the end of the -selection nearest the mouse cursor and you can drag that end of the -selection by dragging the mouse before releasing the mouse button. -You can double-click to select whole words or triple-click to select -whole lines. - -5. Delete and replace. To delete text, select the characters you'd like -to delete and type Backspace or Delete. Alternatively, you can type new -text, in which case it will replace the selected text. - -6. Copy the selection. To copy the selection into this window, select -what you want to copy (either here or in another application), then -click button 2 to copy the selection to the point of the mouse cursor. - -7. Edit. Text widgets support the standard Motif editing characters -plus many Emacs editing characters. Backspace and Control-h erase the -character to the left of the insertion cursor. Delete and Control-d -erase the character to the right of the insertion cursor. Meta-backspace -deletes the word to the left of the insertion cursor, and Meta-d deletes -the word to the right of the insertion cursor. Control-k deletes from -the insertion cursor to the end of the line, or it deletes the newline -character if that is the only thing left on the line. Control-o opens -a new line by inserting a newline character to the right of the insertion -cursor. Control-t transposes the two characters on either side of the -insertion cursor. #{ - if undo_support - undo_text = "Control-z undoes the last editing action performed,\nand " - case $tk_platform['platform'] - when "unix", "macintosh" - undo_text << "Control-Shift-z" - else # 'windows' - undo_text << "Control-y" - end - undo_text << "redoes undone edits." - else - "" - end -} - -7. Resize the window. This widget has been configured with the "setGrid" -option on, so that if you resize the window it will always resize to an -even number of characters high and wide. Also, if you make the window -narrow you can see that long lines automatically wrap around onto -additional lines so that all the information is always visible. -EOT - - set_insert('0.0') -} diff --git a/ext/tk/sample/demos-en/timer b/ext/tk/sample/demos-en/timer deleted file mode 100644 index 58a41d00c0..0000000000 --- a/ext/tk/sample/demos-en/timer +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env ruby -# -# timer -- -# This script generates a counter with start,stop and reset buttons. -# -# Copyright (C) 1998 Takaaki Tateishi (ttate@jaist.ac.jp) -# last update: Sat Jun 27 12:24:14 JST 1998 -# - -require "tk" -require "thread" -require "tkafter" - -$time = "0.00" -$m = Mutex.new -$loop = false - -def timer_stop - $loop = false - $m.lock -end - -def timer_start - $loop = true - $m.unlock -end - -def timer_reset - $time = "0.00" - $root.countframe.counter['text'] = $time -end - -def timer_loop - if $loop - $time = $time.succ - $root.countframe.counter['text'] = $time - end - Tk.after(10,proc{timer_loop}) -end - - -# -# thread version -# -def timer_loop2 - while true - $m.lock - $time = $time.succ - $root.countframe.counter['text'] = $time - sleep(0.01) - $m.unlock - end -end - -# -# TkAfter -# -def timer_loop3 - if $loop - $time = $time.succ - $root.countframe.counter['text'] = $time - end -end - - -class CountFrame < TkFrame - attr_reader :counter - - def initialize(parent=nil,keys=nil) - super(parent,keys) - @counter = TkLabel.new(self, - 'text'=>$time, - 'relief'=>'raised') - @counter.pack('fill'=>'both') - self - end -end - - -class ButtonFrame < TkFrame - def initialize(parent=nil,keys=nil) - super(parent,keys) -=begin - @stop = TkButton.new(self, - 'text'=>'Stop', - 'command'=>proc{timer_stop}) - @start = TkButton.new(self, - 'text'=>'Start', - 'command'=>proc{timer_start}) -=end - @stop = TkButton.new(self, :text=>'Stop', :state=>:disabled) - @start = TkButton.new(self, :text=>'Start', :state=>:normal) - - @stop.command proc{ - timer_stop - @start.state(:normal) - @stop.state(:disabled) - } - @start.command proc{ - timer_start - @stop.state(:normal) - @start.state(:disabled) - } - - @reset = TkButton.new(self, - 'text'=>'Reset', - 'command'=>proc{timer_reset}) - for b in [@stop,@start,@reset] - b.pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes') - end - end -end - - -class Timer < TkRoot - attr_reader :countframe - - def initialize(*args) - super(*args) - @countframe = CountFrame.new(self) - @buttonframe = ButtonFrame.new(self) - for f in [@buttonframe,@countframe] - f.pack('side'=>'top', 'fill'=>'both') - end - self - end -end - - -$root = Timer.new - -#$thread = Thread.start{timer_loop2} -#timer_loop -TkAfter.new(10,-1,proc{timer_loop3}).start - -Tk.mainloop diff --git a/ext/tk/sample/demos-en/tkencoding.rb b/ext/tk/sample/demos-en/tkencoding.rb deleted file mode 100644 index 727491a6ad..0000000000 --- a/ext/tk/sample/demos-en/tkencoding.rb +++ /dev/null @@ -1,42 +0,0 @@ -# -*- ruby -*- -# -# tkencoding.rb -# written by ttate@jaist.ac.jp - -class TclTkIp - alias __eval _eval - alias __invoke _invoke - private :__eval - private :__invoke - - attr_accessor :encoding - - def _eval(cmd) - if( @encoding ) - _fromUTF8(__eval(_toUTF8(cmd,@encoding)),@encoding) - else - __eval(cmd) - end - end - - def _invoke(*cmds) - if( @encoding ) - cmds = cmds.collect{|cmd| _toUTF8(cmd,@encoding)} - _fromUTF8(__invoke(*cmds),@encoding) - else - __invoke(*cmds) - end - end -end - -module Tk - INTERP = TkCore::INTERP - - def encoding=(name) - INTERP.encoding = name - end - - def encoding - INTERP.encoding - end -end diff --git a/ext/tk/sample/demos-en/twind.rb b/ext/tk/sample/demos-en/twind.rb deleted file mode 100644 index c841b7c317..0000000000 --- a/ext/tk/sample/demos-en/twind.rb +++ /dev/null @@ -1,285 +0,0 @@ -# twind.rb -# -# This demonstration script creates a text widget with a bunch of -# embedded windows. -# -# text (embedded windows) widget demo (called by 'widget') -# - -# toplevel widget -if defined?($twind_demo) && $twind_demo - $twind_demo.destroy - $twind_demo = nil -end - -# demo toplevel widget -$twind_demo = TkToplevel.new {|w| - title("Text Demonstration - Embedded Windows") - iconname("Embedded Windows") - positionWindow(w) -} - -# frame -$twind_buttons = TkFrame.new($twind_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc{ - tmppath = $twind_demo - $twind_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc{showCode 'twind'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$twind_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame -$twind_text = nil -TkFrame.new($twind_demo, 'highlightthickness'=>2, 'borderwidth'=>2, - 'relief'=>'sunken') {|f| - $twind_text = TkText.new(f, 'setgrid'=>'true', 'font'=>$font, - 'width'=>'70', 'height'=>35, 'wrap'=>'word', - 'highlightthickness'=>0, 'borderwidth'=>0 ){|t| - TkScrollbar.new(f) {|s| - command proc{|*args| t.yview(args)} - t.yscrollcommand proc{|first,last| s.set first,last} - }.pack('side'=>'right', 'fill'=>'y') - }.pack('expand'=>'yes', 'fill'=>'both') -}.pack('expand'=>'yes', 'fill'=>'both') - -# -$tag_center = TkTextTag.new($twind_text, - 'justify' =>'center', - 'spacing1'=>'5m', - 'spacing3'=>'5m' ) -$tag_buttons = TkTextTag.new($twind_text, - 'lmargin1'=>'1c', - 'lmargin2'=>'1c', - 'rmargin' =>'1c', - 'spacing1'=>'3m', - 'spacing2'=>0, - 'spacing3'=>0 ) - -$twind_text.insert('end', "A text widget can contain other widgets embedded ") -$twind_text.insert('end', "it. These are called \"embedded windows\", ") -$twind_text.insert('end', "and they can consist of arbitrary widgets. ") -$twind_text.insert('end', "For example, here are two embedded button ") -$twind_text.insert('end', "widgets. You can click on the first button to ") -TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - #text 'ON' - text 'Turn On' - command proc{textWindOn $twind_text,$twind_buttons} - cursor 'top_left_arrow' - }) -$twind_text.insert('end', " horizontal scrolling, which also turns off ") -$twind_text.insert('end', "word wrapping. Or, you can click on the second ") -$twind_text.insert('end', "button to\n") -TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - #text 'OFF' - text 'Turn Off' - command proc{textWindOff $twind_text} - cursor 'top_left_arrow' - }) - -$twind_text.insert('end', " horizontal scrolling and turn back on word wrapping.\n\n") -$twind_text.insert('end', "Or, here is another example. If you ") -TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - text 'Click Here' - command proc{textWindPlot $twind_text} - cursor 'top_left_arrow' - }) -$twind_text.insert('end', " a canvas displaying an x-y plot will appear right here.") -$mark_plot = TkTextMark.new($twind_text, 'insert') -$mark_plot.gravity='left' -$twind_text.insert('end', " You can drag the data points around with the mouse, ") -$twind_text.insert('end', "or you can click here to ") -TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - text 'Delete' - command proc{textWindDel $twind_text} - cursor 'top_left_arrow' - }) - -$twind_text.insert('end', " the plot again.\n\n") -$twind_text.insert('end', "You may also find it useful to put embedded windows in ") -$twind_text.insert('end', "a text without any actual text. In this case the ") -$twind_text.insert('end', "text widget acts like a geometry manager. For ") -$twind_text.insert('end', "example, here is a collection of buttons laid out ") -$twind_text.insert('end', "neatly into rows by the text widget. These buttons ") -$twind_text.insert('end', "can be used to change the background color of the ") -$twind_text.insert('end', "text widget (\"Default\" restores the color to ") -$twind_text.insert('end', "its default). If you click on the button labeled ") -$twind_text.insert('end', "\"Short\", it changes to a longer string so that ") -$twind_text.insert('end', "you can see how the text widget automatically ") -$twind_text.insert('end', "changes the layout. Click on the button again ") -$twind_text.insert('end', "to restore the short string.\n") - - -TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) {|b| - text 'Default' - command proc{embDefBg $twind_text} - cursor 'top_left_arrow' - $tag_buttons.add('end') - }, - 'padx'=>3 ) -embToggle = TkVariable.new('Short') -TkTextWindow.new($twind_text, 'end', - 'window'=>TkCheckButton.new($twind_text) { - textvariable embToggle - indicatoron 0 - variable embToggle - onvalue 'A much longer string' - offvalue 'Short' - cursor 'top_left_arrow' - pady 5 - padx 2 - }, - 'padx'=>3, - 'pady'=>2 ) - -[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4', - 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1', - 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1', - 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4' -].each{|twind_color| - TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - text twind_color - cursor 'top_left_arrow' - command proc{$twind_text.bg twind_color} - }, - 'padx'=>3, - 'pady'=>2 ) -} - -# -def textWindOn (w,f) - if defined? $twind_scroll - begin - $twind_scroll.destroy - rescue - end - $twind_scroll = nil - end - - base = TkWinfo.parent( TkWinfo.parent(w) ) - $twind_scroll = TkScrollbar.new(base) {|s| - orient 'horizontal' - command proc{|*args| w.xview(*args)} - w.xscrollcommand proc{|first,last| s.set first,last} - w.wrap 'none' - pack('after'=>f, 'side'=>'bottom', 'fill'=>'x') - } - - return nil -end - -def textWindOff (w) - if defined? $twind_scroll - begin - $twind_scroll.destroy - rescue - end - $twind_scroll = nil - end - w.xscrollcommand '' - w.wrap 'word' -end - -def textWindPlot (t) - if (defined? $twind_plot) && TkWinfo.exist?($twind_plot) - return - end - - $twind_plot = TkCanvas.new(t) { - relief 'sunken' - width 450 - height 300 - cursor 'top_left_arrow' - } - - font = '-Adobe-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*' - - TkcLine.new($twind_plot, 100, 250, 400, 250, 'width'=>2) - TkcLine.new($twind_plot, 100, 250, 100, 50, 'width'=>2) - TkcText.new($twind_plot, 225, 20, - 'text'=>"A Simple Plot", 'font'=>font, 'fill'=>'brown') - - (0..10).each {|i| - x = 100 + (i * 30) - TkcLine.new($twind_plot, x, 250, x, 245, 'width'=>2) - TkcText.new($twind_plot, x, 254, - 'text'=>10*i, 'font'=>font, 'anchor'=>'n') - } - (0..5).each {|i| - y = 250 - (i * 40) - TkcLine.new($twind_plot, 100, y, 105, y, 'width'=>2) - TkcText.new($twind_plot, 96, y, - 'text'=>"#{i*50}.0", 'font'=>font, 'anchor'=>'e') - } - - for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]] - x = 100 + (3*xx) - y = 250 - (4*yy)/5 - item = TkcOval.new($twind_plot, x-6, y-6, x+6, y+6, - 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') - item.addtag 'point' - end - - $twind_plot.itembind('point', 'Any-Enter', - proc{$twind_plot.itemconfigure 'current', 'fill', 'red'}) - $twind_plot.itembind('point', 'Any-Leave', - proc{$twind_plot.itemconfigure 'current', 'fill', 'SkyBlue2'}) - $twind_plot.itembind('point', '1', - proc{|x,y| embPlotDown $twind_plot,x,y}, "%x %y") - $twind_plot.itembind('point', 'ButtonRelease-1', - proc{$twind_plot.dtag 'selected'}) - $twind_plot.bind('B1-Motion', - proc{|x,y| embPlotMove $twind_plot,x,y}, "%x %y") - while ($twind_text.get($mark_plot) =~ /[ \t\n]/) - $twind_text.delete $mark_plot - end - $twind_text.insert $mark_plot,"\n" - TkTextWindow.new($twind_text, $mark_plot, 'window'=>$twind_plot) - $tag_center.add $mark_plot - $twind_text.insert $mark_plot,"\n" -end - -$embPlot = {'lastX'=>0, 'lastY'=>0} - -def embPlotDown (w, x, y) - w.dtag 'selected' - w.addtag_withtag 'selected', 'current' - w.raise 'current' - $embPlot['lastX'] = x - $embPlot['lastY'] = y -end - -def embPlotMove (w, x, y) - w.move 'selected', x - $embPlot['lastX'], y - $embPlot['lastY'] - $embPlot['lastX'] = x - $embPlot['lastY'] = y -end - -def textWindDel (w) - if (defined? $twind_text) && TkWinfo.exist?($twind_plot) - $twind_text.delete $twind_plot - $twind_plot = nil - while ($twind_text.get($mark_plot) =~ /[ \t\n]/) - $twind_text.delete $mark_plot - end - $twind_text.insert $mark_plot," " - end -end - -def embDefBg (w) - w['background'] = w.configinfo('background')[3] -end diff --git a/ext/tk/sample/demos-en/unicodeout.rb b/ext/tk/sample/demos-en/unicodeout.rb deleted file mode 100644 index 7bb951c93c..0000000000 --- a/ext/tk/sample/demos-en/unicodeout.rb +++ /dev/null @@ -1,112 +0,0 @@ -# unicodeout.rb -- -# -# This demonstration script shows how you can produce output (in label -# widgets) using many different alphabets. -# -# based on Tcl/Tk8.4.4 widget demos - -if defined?($unicodeout_demo) && $unicodeout_demo - $unicodeout_demo.destroy - $unicodeout_demo = nil -end - -$unicodeout_demo = TkToplevel.new {|w| - title("Unicode Label Demonstration") - iconname("unicodeout") - positionWindow(w) -} - -TkLabel.new($unicodeout_demo, - :font=>$font, :wraplength=>'5.4i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) -This is a sample of Tk's support for languages that use non-Western \ -character sets. However, what you will actually see below depends \ -largely on what character sets you have installed, and what you see \ -for characters that are not present varies greatly between platforms as well. \ -Please try to click the 'See Code' button, \ -and click the 'Rerun Demo' button after editing \ -(the source file is not changed) \ -the definition of @@font on the Unicodeout_SampleFrame class. -The strings are written in Tcl using UNICODE characters \ -using the \\uXXXX escape so as to do so in a portable fashion. - -ATTENTION: -The strings are converted to the encoded string objects \ -(completed to rewrite Tcl's escapes) by Tk::UTF8_String method. \ -And the Tk::UTF8_String objects are passed to the label widgets. -EOL - -TkFrame.new($unicodeout_demo){|f| - pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - - TkButton.new(f, :text=>'Dismiss', :width=>15, :command=>proc{ - $unicodeout_demo.destroy - $unicodeout_demo = nil - }).pack(:side=>:left, :expand=>true) - - TkButton.new(f, :text=>'See Code', :width=>15, :command=>proc{ - showCode 'unicodeout' - }).pack(:side=>:left, :expand=>true) -} - -wait_msg = TkLabel.new($unicodeout_demo, - :text=>"Please wait while loading fonts...", - :font=>"Helvetica 12 italic").pack - -class Unicodeout_SampleFrame < TkFrame - @@font = $font - # @@font = 'Helvetica 14' - # @@font = 'Courier 12' - # @@font = 'clearlyu 16' - # @@font = 'fixed 12' - # @@font = 'Times 12' - # @@font = 'Newspaper 12' - # @@font = '{New century schoolbook} 12' - - def initialize() - super($unicodeout_demo) - grid_columnconfig(1, :weight=>1) - end - - def add_sample(lang, *args) - sample_txt = Tk::UTF8_String(args.join('')) - l = TkLabel.new(self, :font=>@@font, :text=>lang+':', - :anchor=>:nw, :pady=>0) - #s = TkLabel.new(self, :font=>@@font, :text=>sample_txt, - s = TkLabel.new(self, :font=>TkFont.new(@@font), :text=>sample_txt, - :anchor=>:nw, :width=>30, :pady=>0) - Tk.grid(l, s, :sticky=>:ew, :pady=>0) - l.grid_config(:padx, '1m') - end -end -f = Unicodeout_SampleFrame.new -f.pack(:expand=>true, :fill=>:both, :padx=>'2m', :pady=>'1m') - -# Processing when some characters are missing might take a while, so make -# sure we're displaying something in the meantime... - -oldCursor = $unicodeout_demo.cursor -$unicodeout_demo.cursor('watch') -Tk.update - -f.add_sample('Arabic', - '\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D\uFE94', - '\uFEE4\uFEE0\uFEDC\uFEDF\uFE8D') -f.add_sample('Trad. Chinese', '\u4E2D\u570B\u7684\u6F22\u5B57') -f.add_sample('Simpl. Chinese', '\u6C49\u8BED') -f.add_sample('Greek', - '\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE ', - '\u03B3\u03BB\u03CE\u03C3\u03C3\u03B1') -f.add_sample('Hebrew', - '\u05DD\u05D9\u05DC\u05E9\u05D5\u05E8\u05D9 ', - '\u05DC\u05D9\u05D0\u05E8\u05E9\u05D9') -f.add_sample('Japanese', - '\u65E5\u672C\u8A9E\u306E\u3072\u3089\u304C\u306A, ', - '\u6F22\u5B57\u3068\u30AB\u30BF\u30AB\u30CA') -f.add_sample('Korean', '\uB300\uD55C\uBBFC\uAD6D\uC758 \uD55C\uAE00') -f.add_sample('Russian', - '\u0420\u0443\u0441\u0441\u043A\u0438\u0439 ', - '\u044F\u0437\u044B\u043A') - -wait_msg.destroy -$unicodeout_demo.cursor(oldCursor) diff --git a/ext/tk/sample/demos-en/vscale.rb b/ext/tk/sample/demos-en/vscale.rb deleted file mode 100644 index 636b85813b..0000000000 --- a/ext/tk/sample/demos-en/vscale.rb +++ /dev/null @@ -1,78 +0,0 @@ -# vscale.rb -# -# This demonstration script shows an example with a vertical scale. - -require "tkcanvas" - -if defined?($vscale_demo) && $vscale_demo - $vscale_demo.destroy - $vscale_demo = nil -end - -$vscale_demo = TkToplevel.new {|w| - title("Vertical Scale Demonstration") - iconname("vscale") -} -positionWindow($vscale_demo) - -msg = TkLabel.new($vscale_demo) { - font $font - wraplength '3.5i' - justify 'left' - text "An arrow and a vertical scale are displayed below. If you click or drag mouse button 1 in the scale, you can change the size of the arrow." -} -msg.pack('side'=>'top', 'padx'=>'.5c') - -TkFrame.new($vscale_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc { - tmppath = $vscale_demo - $vscale_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc { showCode 'vscale' } - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -TkFrame.new($vscale_demo) {|frame| - borderwidth 10 - canvas = TkCanvas.new(frame) {|c| - width 50 - height 50 - bd 0 - highlightthickness 0 - TkcPolygon.new(c, 0, 0, 1, 1, 2, 2) { - fill 'SeaGreen3' - tags 'poly' - } - TkcLine.new(c, 0, 0, 1, 1, 2, 2, 0, 0) { - fill 'black' - tags 'line' - } - }.pack('side'=>'left', 'anchor'=>'nw', 'fill'=>'y') - scale = TkScale.new(frame) { - orient 'vertical' - length 284 - from 0 - to 250 - command proc{|value| setHeight(canvas, value)} - tickinterval 50 - }.pack('side'=>'left', 'anchor'=>'ne') - scale.set 75 -}.pack - - -def setHeight(w, height) - height = height + 21 - y2 = height - 30 - if y2 < 21 - y2 = 21 - end - w.coords 'poly',15,20,35,20,35,y2,45,y2,25,height,5,y2,15,y2,15,20 - w.coords 'line',15,20,35,20,35,y2,45,y2,25,height,5,y2,15,y2,15,20 -end diff --git a/ext/tk/sample/demos-en/widget b/ext/tk/sample/demos-en/widget deleted file mode 100644 index aa702883de..0000000000 --- a/ext/tk/sample/demos-en/widget +++ /dev/null @@ -1,531 +0,0 @@ -#!/usr/bin/env ruby - -# widget -- -# This script demonstrates the various widgets provided by Tk, -# along with many of the features of the Tk toolkit. This file -# only contains code to generate the main window for the -# application, which invokes individual demonstrations. The -# code for the actual demonstrations is contained in separate -# ".rb" files is this directory, which are sourced by this script -# as needed. - -require 'tk' - -#unless /^8\.[1-9]/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK -# require 'tkencoding' -#end - -require 'tkafter' - -### $DEBUG=1 ########## - -#---------------------------------------------------------------- -# The code below create the main window, consisting of a menu bar -# and a text widget that explains how to use the program, plus lists -# all of the demos as hypertext items. -#---------------------------------------------------------------- - -# widget demo directory -$demo_dir = File.dirname($0) - -# root -$root = TkRoot.new{title "Ruby/Tk Widget Demonstration"} - -# tk -$tk_version = Tk::TK_VERSION - -# tcl_platform -$tk_platform = TkVarAccess.new('tcl_platform') - -# -$font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', nil) - -# -TkMenubar.new($root, - [[['File', 0], - ['About ... ', proc{aboutBox}, 0, '<F1>'], - '---', - ['Quit', proc{exit}, 0, 'Meta-Q'] - ]]).pack('side'=>'top', 'fill'=>'x') -$root.bind('F1', proc{aboutBox}) - -=begin -TkFrame.new($root){|frame| - TkMenubutton.new(frame){|button| - m = TkMenu.new(button) { - add 'command', 'label'=>'Quit', 'command'=>proc{exit}, 'underline'=>0 - } - menu m - text 'File' - underline 0 - }.pack('side'=>'left') -}.pack('side'=>'top', 'fill'=>'x') -=end - -# -if $tk_version =~ /^4\.[01]/ - scr = TkScrollbar.new($root, 'orient'=>'vertical') - txt = TkText.new($root) { - wrap 'word' - width 60 - height 30 - font $font - setgrid 'yes' - yscrollcommand proc{|first,last| scr.set first,last} - } - scr.command(proc{|*args| txt.yview(*args)}) - scr.pack('side'=>'right', 'fill'=>'y') - txt.pack('expand'=>'yes', 'fill'=>'both') -else - textFrame = TkFrame.new($root) - scr = TkScrollbar.new($root, 'orient'=>'vertical', - 'highlightthickness'=>0, 'takefocus'=>1) { - pack('in'=>textFrame, 'side'=>'right', 'fill'=>'y', 'padx'=>1) - } - txt = TkText.new($root) { - wrap 'word' - width 60 - height 30 - font $font - setgrid 'yes' - highlightthickness 0 - padx 4 - pady 2 - takefocus 0 - yscrollcommand proc{|first,last| scr.set first,last} - } - scr.command(proc{|*args| txt.yview(*args)}) -# txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both', 'padx'=>1) - txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both') -# textFrame.pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>2) - textFrame.pack('expand'=>'yes', 'fill'=>'both') - - statusBar = TkFrame.new($root) {|f| - $statusBarLabel = \ - TkLabel.new(f, 'text'=>" ", 'relief'=>'sunken', 'bd'=>1, 'anchor'=>'w', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*') \ - .pack('side'=>'left', 'padx'=>2, 'expand'=>'yes', 'fill'=>'both') - TkLabel.new(f, 'width'=>8, 'relief'=>'sunken', 'bd'=>1, 'anchor'=>'w', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*') \ - .pack('side'=>'left', 'padx'=>2) - }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2) -end - -# Create a bunch of tags to use in the text widget, such as those for -# section titles and demo descriptions. Also define the bindings for -# tags. - -tag_title = TkTextTag.new(txt, 'font'=>'-*-Helvetica-Bold-R-Normal--*-180-*-*-*-*-*-*') - -# We put some "space" characters to the left and right of each demo description -# so that the descriptions are highlighted only when the mouse cursor -# is right over them (but not when the cursor is to their left or right) - -tag_demospace = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c') - -if TkWinfo.depth($root) == '1' - tag_demo = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c', - 'underline'=>1) - $tag_visited = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c', - 'underline'=>1) - tag_hot = TkTextTag.new(txt, 'background'=>'black', 'foreground'=>'white') -else - tag_demo = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c', - 'foreground'=>'blue', 'underline'=>1) - $tag_visited = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c', - 'foreground'=>'#303080', 'underline'=>1) -# tag_hot = TkTextTag.new(txt, 'relief'=>'raised', 'borderwidth'=>1, -# 'background'=>'SeaGreen3') - tag_hot = TkTextTag.new(txt, 'borderwidth'=>1, 'foreground'=>'red') -end - -#tag_demo.bind('Button-1', proc{invoke txt, txt.index('current')}) -tag_demo.bind('ButtonRelease-1', - proc{|x,y|invoke txt, txt.index("@#{x},#{y}")}, '%x %y') - -lastLine = TkVariable.new("") -newLine = TkVariable.new("") -tag_demo.bind('Enter', proc{|x,y| - lastLine.value = txt.index("@#{x},#{y} linestart") - tag_hot.add(lastLine.value, "#{lastLine.value} lineend") - showStatus txt, txt.index("@#{x},#{y}") - }, - '%x %y') -tag_demo.bind('Leave', - proc{ - tag_hot.remove('1.0','end') - txt.configure('cursor','xterm') - $statusBarLabel.configure('text'=>"") - }) -tag_demo.bind('Motion', proc{|x, y| - newLine.value = txt.index("@#{x},#{y} linestart") - if newLine.value != lastLine.value - tag_hot.remove('1.0','end') - lastLine.value = newLine.value - if ( txt.tag_names("@#{x},#{y}").find{|t| - t.kind_of?(String) && t =~ /^demo-/ - } ) - tag_hot.add(lastLine.value, - "#{lastLine.value} lineend -1 chars") - end - end - showStatus txt, txt.index("@#{x},#{y}") - }, - '%x %y') - -# Create the text for the text widget. - -txt.insert('end', "Ruby/Tk Widget Demonstrations\n\n", tag_title) -txt.insert('end', <<EOT) -This application provides a front end for several short scripts that \ -demonstrate what you can do with Tk widgets. Each of the numbered \ -lines below describes a demonstration; you can click on it to invoke \ -the demonstration. Once the demonstration window appears, you can \ -click the "See Code" button to see the Ruby/Tk code that created the \ -demonstration. If you wish, you can edit the code and click the \ -"Rerun Demo" button in the code window to reinvoke the demonstration \ -with the modified code. - -Some demo scripts require the recent version of Tk library \ -(e.g. Tk8.4 or later) \ -If your Tk library linked to Ruby doesn't support the functions \ -required by the demo script, the demo doesn't work. \ -In such a case, please re-compile tcltklib with the later Tk library \ -which supports the required functions. - - -EOT - -txt.insert('end', "Labels, buttons, checkbuttons, and radiobuttons.\n", tag_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. Labels (text and bitmaps).\n", tag_demo, "demo-label") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. Labels and UNICODE text. (if supported)\n", tag_demo, "demo-unicodeout") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. Buttons.\n", tag_demo, "demo-button") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. Checkbuttons (select any of a group).\n", tag_demo, "demo-check") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "5. Radiobuttons (select one of a group).\n", tag_demo, "demo-radio") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "6. Radiobuttons (if supported 'compound' option).\n", tag_demo, "demo-radio2") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "7. A 15-puzzle game made out of buttons.\n", tag_demo, "demo-puzzle") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "8. Iconic buttons that use bitmaps.\n", tag_demo, "demo-icon") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "9. Two labels displaying images.\n", tag_demo, "demo-image1") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "10. A simple user interface for viewing images.\n", tag_demo, "demo-image2") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "11. A simple user interface for viewing images. (if supported)\n", tag_demo, "demo-image3") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "12. Labelled frames (if supported)\n", tag_demo, "demo-labelframe") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -txt.insert('end', "Listboxes\n", tag_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. 50 states.\n", tag_demo, "demo-states") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. Colors: change the color scheme for the application.\n", "#{tag_demo.id} demo-colors") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. A collection of famous sayings.\n", tag_demo, "demo-sayings") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -txt.insert('end', "Entries and Spin-boxes\n", tag_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. Without scrollbars.\n", tag_demo, "demo-entry1") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. With scrollbars.\n", tag_demo, "demo-entry2") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', - "3. Validated entries and password fields. (if supported)\n", - tag_demo, "demo-entry3") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. Spin-boxes. (if supported)\n", tag_demo, "demo-spin") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "5. Simple Rolodex-like form.\n", tag_demo, "demo-form") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -txt.insert('end', "Text\n", tag_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. Basic editable text.\n", tag_demo, "demo-text") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. Text display styles.\n", tag_demo, "demo-style") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. Hypertext (tag bindings).\n", tag_demo, "demo-bind") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. A text widget with embedded windows.\n", tag_demo, "demo-twind") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "5. A search tool built with a text widget.\n", tag_demo, "demo-search") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -txt.insert('end', "Canvases\n", tag_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. The canvas item types.\n", tag_demo, "demo-items") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. A simple 2-D plot.\n", tag_demo, "demo-plot") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. Text items in canvases.\n", tag_demo, "demo-ctext") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. An editor for arrowheads on canvas lines.\n", tag_demo, "demo-arrow") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "5. A ruler with adjustable tab stops.\n", tag_demo, "demo-ruler") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "6. A building floor plan.\n", tag_demo, "demo-floor") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "7. A simple scrollable canvas.\n", tag_demo, "demo-cscroll") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -txt.insert('end', "Scales\n", tag_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. Vertical scale.\n", tag_demo.id, "demo-vscale") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. Horizontal scale.\n", tag_demo.id, "demo-hscale") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -txt.insert('end', "Paned Windows\n", tag_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. Horizontal paned window. (if supported)\n", tag_demo.id, "demo-paned1") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. Vertical paned window. (if supported)\n", tag_demo.id, "demo-paned2") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -txt.insert('end', "Menus\n", tag_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. Menus and cascades.\n", tag_demo, "demo-menu") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. Menus and cascades. (if supported)\n", tag_demo, "demo-menu84") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. Menubuttons\n", tag_demo, "demo-menubu") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -txt.insert('end', "Common Dialogs\n", tag_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. Message boxes.\n", tag_demo, "demo-msgbox") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. File selection dialog.\n", tag_demo, "demo-filebox") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. Color picker.\n", tag_demo, "demo-clrpick") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -txt.insert('end', "Miscellaneous\n", tag_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. The built-in bitmaps.\n", tag_demo, "demo-bitmap") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. A dialog box with a local grab.\n", tag_demo, "demo-dialog1") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. A dialog box with a global grab.\n", tag_demo, "demo-dialog2") -txt.insert('end', " \n ", tag_demospace) - -txt.state('disabled') -scr.focus - -# positionWindow -- -# This procedure is invoked by most of the demos to position a -# new demo window. -# -# Arguments: -# w - The name of the window to position. - -def positionWindow(w) - w.geometry('+300+300') -end - -# showVars -- -# Displays the values of one or more variables in a window, and -# updates the display whenever any of the variables changes. -# -# Arguments: -# w - Name of new window to create for display. -# args - Any number of names of variables. - -$showVarsWin = {} -def showVars (parent, *args) - if $showVarsWin[parent.path] - begin - $showVarsWin[parent.path].destroy - rescue - end - end - w = TkToplevel.new(parent) {|w| - title "Variable values" - TkLabel.new(w) { - text "Variable values:" - width 20 - anchor 'center' - font '-Adobe-helvetica-medium-r-normal--*-180-*-*-*-*-*-*' - }.pack('side'=>'top', 'fill'=>'x') - len = 1 - args.each{|vnam,vbody| - len = vnam.to_s.length if vnam.to_s.length > len - } - args.each{|vnam,vbody| - TkFrame.new(w){|f| - #TkLabel.new(f, 'text'=>"#{vnam}: ").pack('side'=>'left') - TkLabel.new(f, 'text'=>"#{vnam}: ",'width'=>len+2).pack('side'=>'left') - TkLabel.new(f, 'textvariable'=>vbody, 'anchor'=>'w')\ - .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x') - }.pack('side'=>'top', 'anchor'=>'w', 'fill'=>'x') - } - TkButton.new(w) { - text "OK" - command proc{w.destroy} - }.pack('side'=>'bottom', 'pady'=>2) - } - $showVarsWin[parent.path] = w -end - -# invoke -- -# This procedure is called when the user clicks on a demo description. -# It is responsible for invoking the demonstration. -# -# Arguments: -# index - The index of the character that the user clicked on. - -def invoke (txt, index) - tag = txt.tag_names(index).find{|t| t.kind_of?(String) && t =~ /^demo-/} - return unless tag - cursor = txt.cget('cursor') - txt.cursor('watch') - Tk.update -# eval `cat #{tag[5..-1]}.rb` - eval `cat #{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb` - Tk.update -# txt.cursor('xterm') - txt.cursor(cursor) - - $tag_visited.add("#{index} linestart +1 chars", "#{index} lineend +1 chars") -end - -# showStatus -- -# -# Show the name of the demo program in the status bar. This procedure -# is called when the user moves the cursor over a demo description. -# - -def showStatus (txt, index) - tag = txt.tag_names(index).find{|t| t.kind_of?(String) && t =~ /^demo-/} - cursor = txt.cget('cursor') - unless tag - $statusBarLabel.configure('text', " ") - newcursor = 'xterm' - else - demoname = tag[5..-1] - $statusBarLabel.configure('text', - "Run the \"#{demoname}\" sample program") - newcursor = 'hand2' - end - txt.configure('cursor'=>newcursor) if cursor != newcursor -end - -# showCode -- -# This procedure creates a toplevel window that displays the code for -# a demonstration and allows it to be edited and reinvoked. -# -# Arguments: -# w - The name of the demonstration's window, which can be -# used to derive the name of the file containing its code. - -def showCode (demo) - file = "#{demo}.rb" - $code_window = nil unless defined? $code_window - if $code_window == nil || TkWinfo.exist?($code_window) == '0' - $code_window = TkToplevel.new(nil) - f = TkFrame.new($code_window) - TkButton.new(f) { - text "Dismiss" - command proc{ - $code_window.destroy - $code_window = nil - } - }.pack('side'=>'left', 'expand'=>'yes', 'pady'=>2) - TkButton.new(f) { - text "Rerun Demo" - command proc{eval($code_text.get('1.0','end'))} - }.pack('side'=>'left', 'expand'=>'yes', 'pady'=>2) -# f.pack('side'=>'bottom', 'expand'=>'yes', 'fill'=>'x') - f.pack('side'=>'bottom', 'fill'=>'x') - - if $tk_version =~ /^4\.[01]/ - s = TkScrollbar.new($code_window, 'orient'=>'vertical') - $code_text = TkText.new($code_window) { - height 40 - setgrid 'yes' - yscrollcommand proc{|first,last| s.set first,last} - } - s.command(proc{|*args| $code_text.yview(*args)}) - s.pack('side'=>'right', 'fill'=>'y') - $code_text.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'both') - else - TkFrame.new($code_window) {|f| - pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1) - - hs = TkScrollbar.new($code_window, 'highlightthickness'=>0, - 'orient'=>'horizontal') - vs = TkScrollbar.new($code_window, 'highlightthickness'=>0, - 'orient'=>'vertical') - $code_text = TkText.new($code_window) {|t| - height 40 - wrap 'word' - xscrollcommand proc{|first,last| hs.set first,last} - yscrollcommand proc{|first,last| vs.set first,last} - setgrid 'yes' - highlightthickness 0 - pady 2 - padx 3 - hs.command(proc{|*args| $code_text.xview(*args)}) - vs.command(proc{|*args| $code_text.yview(*args)}) - } - - $code_text.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - vs.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') -# xs.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, -# 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - -# JKC 2001-07-26: segfaults under 1.7.1 (2001-06-19) [i686-linux] - TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0) - TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0) - } - end - else - $code_window.deiconify - $code_window.raise - end - $code_window.title("Demo code: #{file}") - $code_window.iconname(file) -# fid = open(file, 'r') - fid = open([$demo_dir, file].join(File::Separator), 'r') - $code_text.delete('1.0', 'end') - #$code_text.insert('1.0', `cat #{file}`) - $code_text.insert('1.0', fid.read) - #$code_mark = TkTextMark.new($code_text, '1.0') - #$code_text.set_insert('1.0') - TkTextMarkInsert.new($code_text,'1.0') - fid.close -end - -# aboutBox -# -# Pops up a message box with an "about" message -# -def aboutBox - Tk.messageBox('icon'=>'info', 'type'=>'ok', 'title'=>'About Widget Demo', - 'message'=>"Ruby/Tk widget demonstration Ver.1.3.2-en\n\n( based on Tk 8.1 Copyright (c) 1996-1997 Sun Microsystems, Inc. )\n\nRunning Version :: Ruby#{VERSION}/Tk#{$tk_version}") -end - -################################ - -Tk.mainloop - diff --git a/ext/tk/sample/demos-jp/README b/ext/tk/sample/demos-jp/README deleted file mode 100644 index 42bec16c60..0000000000 --- a/ext/tk/sample/demos-jp/README +++ /dev/null @@ -1,54 +0,0 @@ - - Ruby/Tk widget-demo - version 1.2 ( 2000/04/08 ) - ±Ê°æ¡÷ÃÎǽ¡¥¶å¹©Âç (nagai@ai.kyutech.ac.jp) - -ɸ½àÇÛÉۤΠTcl/Tk ³ÈÄ¥¥Ñ¥Ã¥±¡¼¥¸¤ò¼è¤ê¹þ¤ó¤À Ruby (°Ê²¼ Ruby/Tk ¤È¸Æ¤Ó¤Þ¤¹) -¤Ç¤Ï¡¤Tk widget ¤òÍѤ¤¤¿ GUI ¤ÎºîÀ®¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤¤Þ¤¹¡¥¼ÂºÝ¤Ë GUI ¤òºîÀ® -¤·¤Æ¤¤¤¯¾ì¹ç¤Ë¤ÏÍÍ¡¹¤Ê¼ÂÎ㤬¥µ¥ó¥×¥ë¤È¤·¤ÆÂ¸ºß¤¹¤ë¤ÈÊØÍø¤Ê¤Î¤Ç¤¹¤¬¡¤Ruby/Tk -¤Ë¤Ï¤½¤Î¤è¤¦¤ÊŬÅö¤Ê¥µ¥ó¥×¥ë¥¹¥¯¥ê¥×¥È½¸¹ç¤Ï¸ºß¤·¤Þ¤»¤ó¤Ç¤·¤¿¡¥¤½¤ì¤ËÂФ·¡¤ -³ÈÄ¥¥Ñ¥Ã¥±¡¼¥¸¤Î¸µ¤Ç¤¢¤ë Tcl/Tk ¤Ë¤Ï¡¤Tk widget ¤òÍѤ¤¤Æ¤É¤Î¤è¤¦¤Ê¤³¤È¤¬¤Ç -¤¤ë¤«¤ò¼¨¤¹¤â¤Î¤È¤·¤Æ widget-demo ¤¬Â¸ºß¤·¤ª¤ê¡¤Tcl/Tk ¤òÍѤ¤¤¿ GUI ¤ÎºîÀ® -¤ò½¬ÆÀ¤¹¤ëºÝ¤ÎÂåɽŪ¥µ¥ó¥×¥ë¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡¥ËÜ¥¢¡¼¥«¥¤¥Ö¤Ï¡¤Ruby/Tk ¤Î½¬ÆÀ¤Î -¤¿¤á¤ÎÂåɽŪ¤Ê¥µ¥ó¥×¥ë¥¹¥¯¥ê¥×¥È¤È¤¹¤Ù¤¯¡¤Tcl/Tk ¤Î widget-demo ¤ò°Ü¿¢¤·¤¿¤â -¤Î¤Ç¤¹¡¥ - -º£²ó¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï ruby-1.4.x ¤ËÂбþ¤È¤·¤Æ¤ª¤¤Þ¤¹¤¬¡¤µì¥Ð¡¼¥¸¥ç¥ó¤ËÈæ¤Ù¤Æ¡¤ -¤Û¤È¤ó¤ÉÊѹ¹¤Ï¤¢¤ê¤Þ¤»¤ó¡¥ruby-1.1c2 °Ê¾å¤Ê¤éư¤¯¤È»×¤¤¤Þ¤¹¡¥ruby-1.5.x ¤Ë¤Ä -¤¤¤Æ¤Ï¥Æ¥¹¥È¤·¤Æ¤¤¤Þ¤»¤ó¡¥¤½¤Î¤¿¤á¡¤Èó¸ß´¹¤Î±Æ¶Á¤¬½Ð¤ë¤³¤È¤¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤» -¤ó¤¬¡¤¤½¤Î¾ì¹ç¤Ç¤â¾¯¤·¤Î½¤Àµ¤Çư¤«¤»¤ë¤È»×¤¤¤Þ¤¹¡¥ÁȤ߹þ¤à Tk ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï¡¤ -4.2 ¤Ç¤â 8.0 ¤Ç¤â½¤Àµ¤Ê¤¯Æ°¤«¤»¤ë¤Ï¤º¤Ç¤¹¡¥¤¿¤À¤·¡¤ÆüËܸìÈǤǤΰܿ¢¤È¤Ê¤Ã¤Æ -¤¤¤ë¤¿¤á¡¤ÆüËܸ첽¤µ¤ì¤¿ Tk ¤ò¤´ÍøÍѤ¯¤À¤µ¤¤¡¥¥¹¥¯¥ê¥×¥È¤Î¥Æ¥¹¥È¤Ï¡¤µì¥Ð¡¼¥¸¥ç -¥ó¤ÎºÝ¤Ë Tk4.2jp ¤È Tk8.0jp ¤Î¾å¤Ç¹Ô¤Ã¤Æ¤¤¤Þ¤¹ (´°àú¤Ë¤Ç¤Ï¤Ê¤¤¤Ç¤¹¤¬)¡¥º£²ó -¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï ruby-1.4.x + Tk8.0jp ¾å¤Ç¤Î´Êñ¤Ê¥Æ¥¹¥È¤·¤«¹Ô¤Ã¤Æ¤¤¤Þ¤»¤ó¤¬¡¤ -½¤Àµ¤È¤¤¤¦¤Û¤É¤Î½¤Àµ¤Ï¤·¤Æ¤¤¤Þ¤»¤ó¤Î¤ÇÌäÂê¤Ï¤Ê¤¤¤È¹Í¤¨¤Æ¤¤¤Þ¤¹¡¥ - -ËÜ¥¢¡¼¥«¥¤¥Ö¤Ë´Þ¤Þ¤ì¤ë¥¹¥¯¥ê¥×¥È¤Î¿¤¯¤Ï¡¤¸µ¤È¤Ê¤Ã¤Æ¤¤¤ë Tcl/Tk ÈǤËÈæ³ÓŪ¶á -¤¤¥¹¥¯¥ê¥×¥Èµ½Ò¤È¤Ê¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤Þ¤¹¡¥¤½¤Î¤¿¤á¡¤Ruby/Tk ¤Î¥µ¥ó¥×¥ë¤È¸À¤¦¤Ë -¤Ï¡¤¤¢¤Þ¤ê Ruby ¤é¤·¤¯¤Ê¤¤¤È¤â¸À¤¨¤ë¤Ç¤·¤ç¤¦¡¥¤Ë¤â¤«¤«¤ï¤é¤º¡¤¤½¤Î¤è¤¦¤Êµ½Ò -¤ò¼è¤Ã¤Æ¤¤¤ëÍýͳ¤Ï¡¤Ruby/Tk ¤Î¥É¥¥å¥á¥ó¥ÈÉÔ¤ˤ¢¤ê¤Þ¤¹¡¥ - -Tcl/Tk ¤Ë¤ÏŬÅö¤Ê»²¹Í½ñ¤¬²¿ºý¤«Â¸ºß¤·¤Æ¤¤¤Þ¤¹¤«¤é¡¤Ruby/Tk ¥¹¥¯¥ê¥×¥È¤òºîÀ® -¤¹¤ëºÝ¤Ï¡¤¤½¤Î¤è¤¦¤Ê Tcl/Tk ¤Î»²¹Í½ñ¤Ç¾ðÊó¤òÊ䤤¤Ê¤¬¤éºîÀ®¤¹¤ë¤³¤È¤Ë¤Ê¤ë¤È»× -¤¤¤Þ¤¹¡¥³Æ widget ¤Î»ÈÍÑÎã¤È¤·¤Æ¡¤Tcl/Tk ¤Î widget-demo ¤ò»²¾È¤¹¤ë¤³¤È¤â¤¢¤ë -¤Ç¤·¤ç¤¦¡¥Ruby/Tk ÈǤε½Ò¤ò widget-demo ¤ò Tcl/Tk ÈǤε½Ò¤Ë¶á¤¤¤â¤Î¤Ë¤·¤Æ -¤ª¤±¤Ð¡¤¤½¤ÎÂÐÈæ¤Ë¤è¤Ã¤Æ¡¤Ruby/Tk ¤ÎÍý²ò¤òÁá¤á¤ë¤³¤È¤¬¤Ç¤¤ë¤È¹Í¤¨¤é¤ì¤Þ¤¹¡¥ -°ìö Ruby/Tk ¤Ç¤Î ³Æ widget ¤Î»ÈÍÑÊýË¡¤ò½¬ÆÀ¤·¤Æ¤·¤Þ¤¨¤Ð¡¤Ruby ¤é¤·¤¤¥¹¥¯¥ê -¥×¥È¤òºîÀ®¤¹¤ë¤³¤È¤ÏÆñ¤·¤¯¤Ê¤¤¤Ç¤·¤ç¤¦¡¥ËÜ¥¢¡¼¥«¥¤¥Ö¤Î¥¹¥¯¥ê¥×¥È¤Ï¡¤Ruby/Tk -¤òºÇ½é¤Ë½¬ÆÀ¤¹¤ë¤Þ¤Ç¤ÎÆ§Âæ¤È¤·¤ÆÍøÍѤ·¤Æ¤¤¤¿¤À¤±¤ì¤Ð¹¬¤¤¤Ç¤¹¡¥ - -widget-demo ¤Î°Ü¿¢¤Ë¤¢¤¿¤Ã¤Æ¤Ï¡¤¼¡¤ÎÊý¤Ë¤â°Ü¿¢¤·¤¿¥¹¥¯¥ê¥×¥È¤òÄ󶡤·¤Æ¤¤¤¿¤À -¤¤Þ¤·¤¿¡¥¤³¤³¤Ë´¶¼Õ¤Î°Õ¤òɽ¤·¤Þ¤¹¡¥ - - ΩÀС÷JAIST (ttate@jaist.ac.jp) ¤µ¤ó - Ê¿¾¾¾Í»Ë (hiramatu@cdrom.co.jp) ¤µ¤ó - -Ê¿¾¾¤µ¤ó¤Ë¤è¤ë Ruby/Tk ÆþÌç¤Î Web page (http://www.cdrom.co.jp/~hiramatu/) -¤â Ruby/Tk ¤Î½¬ÆÀ¤ËÍÍѤȻפ¨¤Þ¤¹¤Î¤Ç¡¤¤¼¤Ò¤´»²¾È¤¯¤À¤µ¤¤¡¥ - -¤Þ¤¿¡¤Á°¶¶ (maebashi@iij.ad.jp) ¤µ¤ó¤ò¤Ï¤¸¤á¤È¤·¤Æ¡¤widget-demo ¤Î°Ü¿¢¤ËºÝ¤· -¤ÆÉ¬ÍפȤʤä¿ Ruby ¤Î Tk ´ØÏ¢¥é¥¤¥Ö¥é¥ê½¤Àµ¤Ë¤Ä¤¤¤Æ¡¤ÌäÂêÅÀ¡¤¥Ð¥°¤Î»ØÅ¦¤ò¤· -¤Æ¤¤¤¿¤À¤¤¤¿Êý¡¹¤Ë¤â´¶¼ÕÃפ·¤Þ¤¹¡¥ - -¤½¤·¤ÆºÇ¸å¤ËºÇÂç¤Î´¶¼Õ¤ò Ruby À߷׼ԤΠ¤Þ¤Ä¤â¤È ¤æ¤¤Ò¤í (matz@netlab.co.jp) -¤µ¤ó¤ËÊû¤²¤¿¤¤¤È»×¤¤¤Þ¤¹¡¥ diff --git a/ext/tk/sample/demos-jp/arrow.rb b/ext/tk/sample/demos-jp/arrow.rb deleted file mode 100644 index 3640798db1..0000000000 --- a/ext/tk/sample/demos-jp/arrow.rb +++ /dev/null @@ -1,235 +0,0 @@ -# -# arrowhead widget demo (called by 'widget') -# - -# arrowSetup -- -# This method regenerates all the text and graphics in the canvas -# window. It's called when the canvas is initially created, and also -# whenever any of the parameters of the arrow head are changed -# interactively. -# -# Arguments: -# c - Name of the canvas widget. - -def arrowSetup(c) - v = $demo_arrowInfo - - # Remember the current box, if there is one. - tags = c.gettags('current') - if tags != [] - cur = tags.find{|t| t.kind_of?(String) && t =~ /^box[1-3]$/ } - else - cur = nil - end - - # Create the arrow and outline. - c.delete('all') - TkcLine.new(c, v.x1, v.y, v.x2, v.y, - { 'width'=>10 * v.width, - 'arrowshape'=>[10*v.a, 10*v.b, 10*v.c], - 'arrow'=>'last' - }.update(v.bigLineStyle) ) - xtip = v.x2 - 10*v.b - deltaY = 10*v.c + 5*v.width - TkcLine.new(c, v.x2, v.y, xtip, v.y + deltaY, - v.x2 - 10*v.a, v.y, xtip, v.y - deltaY, v.x2, v.y, - 'width'=>2, 'capstyle'=>'round', 'joinstyle'=>'round') - - # Create the boxes for reshaping the line and arrowhead. - TkcRectangle.new(c, v.x2-10*v.a-5, v.y-5, v.x2-10*v.a+5, v.y+5, - {'tags'=>['box1', $arrowTag_box]}.update(v.boxStyle) ) - TkcRectangle.new(c, xtip-5, v.y-deltaY-5, xtip+5, v.y-deltaY+5, - {'tags'=>['box2', $arrowTag_box]}.update(v.boxStyle) ) - TkcRectangle.new(c, v.x1-5, v.y-5*v.width-5, v.x1+5, v.y-5*v.width+5, - {'tags'=>['box3', $arrowTag_box]}.update(v.boxStyle) ) - c.itemconfigure cur, v.activeStyle if cur - - # Create three arrows in actual size with the same parameters - TkcLine.new(c, v.x2+50, 0, v.x2+50, 1000, 'width'=>2) - tmp = v.x2+100 - TkcLine.new(c, tmp, v.y-125, tmp, v.y-75, 'width'=>v.width, - 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) - TkcLine.new(c, tmp-25, v.y, tmp+25, v.y, 'width'=>v.width, - 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) - TkcLine.new(c, tmp-25, v.y+75, tmp+25, v.y+125, 'width'=>v.width, - 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) - - # Create a bunch of other arrows and text items showing the - # current dimensions. - tmp = v.x2+10 - TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y-deltaY, - 'arrow'=>'both', 'arrowshape'=>v.smallTips) - TkcText.new(c, v.x2+15, v.y-deltaY+5*v.c, 'text'=>v.c, 'anchor'=>'w') - tmp = v.x1-10 - TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y+5*v.width, - 'arrow'=>'both', 'arrowshape'=>v.smallTips) - TkcText.new(c, v.x1-15, v.y, 'text'=>v.width, 'anchor'=>'e') - tmp = v.y+5*v.width+10*v.c+10 - TkcLine.new(c, v.x2-10*v.a, tmp, v.x2, tmp, - 'arrow'=>'both', 'arrowshape'=>v.smallTips) - TkcText.new(c, v.x2-5*v.a, tmp+5, 'text'=>v.a, 'anchor'=>'n') - tmp = tmp+25 - TkcLine.new(c, v.x2-10*v.b, tmp, v.x2, tmp, - 'arrow'=>'both', 'arrowshape'=>v.smallTips) - TkcText.new(c, v.x2-5*v.b, tmp+5, 'text'=>v.b, 'anchor'=>'n') - - TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*') - TkcText.new(c, v.x1, 330, - 'text'=>"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]", 'anchor'=>'w', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*') - - v.count += 1 -end - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($arrow_demo) && $arrow_demo - $arrow_demo.destroy - $arrow_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$arrow_demo = TkToplevel.new {|w| - title("Arrowhead Editor Demonstration") - iconname("arrow") - positionWindow(w) -} - -# label À¸À® -TkLabel.new($arrow_demo, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', - 'text'=>"¤³¤Î widget ¤Ç¡¢¥¥ã¥ó¥Ð¥¹¤Ç»È¤ï¤ì¤ë¥é¥¤¥ó¤Ë¤Ä¤¤¤ÆÍÍ¡¹¤ÊÉý¤äÌð°õ¤ÎƬ¤Î·Á¤ò»î¤·¤Æ¤ß¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£Àþ¤ÎÉý¤äÌð°õ¤Î·Á¤òÊѤ¨¤ë¤Ë¤Ï¡¢³ÈÂ礵¤ì¤¿Ìð°õ¤Ë¤Ä¤¤¤Æ¤¤¤ë 3¤Ä¤Î»Í³Ñ¤ò¥É¥é¥Ã¥°¤·¤Æ¤¯¤À¤µ¤¤¡£±¦Â¦¤ÎÌð°õ¤ÏÉáÄ̤ÎÂ礤µ¤Ç¤Î¥µ¥ó¥×¥ë¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡£²¼¤Î¥Æ¥¥¹¥È¤Ï¥é¥¤¥ó¥¢¥¤¥Æ¥à¤ËÂФ¹¤ëÀßÄꥪ¥×¥·¥ç¥ó¤Ç¤¹¡£"){ - pack('side'=>'top') -} - -# frame À¸À® -$arrow_buttons = TkFrame.new($arrow_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $arrow_demo - $arrow_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'arrow'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$arrow_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# canvas ÀßÄê -$arrow_canvas = TkCanvas.new($arrow_demo, 'width'=>500, 'height'=>350, - 'relief'=>'sunken', 'borderwidth'=>2) -$arrow_canvas.pack('expand'=>'yes', 'fill'=>'both') - -# ÃÍÀßÄê -unless Struct.const_defined?("ArrowInfo") - $demo_arrowInfo = Struct.new("ArrowInfo", :a, :b, :c, :width, :motionProc, - :x1, :x2, :y, :smallTips, :count, - :bigLineStyle, :boxStyle, :activeStyle).new -end -$demo_arrowInfo.a = 8 -$demo_arrowInfo.b = 10 -$demo_arrowInfo.c = 3 -$demo_arrowInfo.width = 2 -$demo_arrowInfo.motionProc = proc{} -$demo_arrowInfo.x1 = 40 -$demo_arrowInfo.x2 = 350 -$demo_arrowInfo.y = 150 -$demo_arrowInfo.smallTips = [5, 5, 2] -$demo_arrowInfo.count = 0 -if TkWinfo.depth($arrow_canvas) > 1 - $demo_arrowInfo.bigLineStyle = {'fill'=>'SkyBlue1'} - $demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1} - $demo_arrowInfo.activeStyle = {'fill'=>'red', 'outline'=>'black', 'width'=>1} -else - $demo_arrowInfo.bigLineStyle = {'fill'=>'black', - 'stipple'=>'@'+[$demo_dir, 'images', 'grey.25'].join(File::Separator)} - $demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1} - $demo_arrowInfo.activeStyle = {'fill'=>'black','outline'=>'black','width'=>1} -end -$arrowTag_box = TkcTag.new($arrow_canvas) -arrowSetup $arrow_canvas -$arrowTag_box.bind('Enter', proc{$arrow_canvas.itemconfigure('current', $demo_arrowInfo.activeStyle)}) -$arrowTag_box.bind('Leave', proc{$arrow_canvas.itemconfigure('current', $demo_arrowInfo.boxStyle)}) -$arrowTag_box.bind('B1-Enter', proc{}) -$arrowTag_box.bind('B1-Leave', proc{}) -$arrow_canvas.itembind('box1', '1', - proc{$demo_arrowInfo.motionProc \ - = proc{|x,y| arrowMove1 $arrow_canvas, x, y}}) -$arrow_canvas.itembind('box2', '1', - proc{$demo_arrowInfo.motionProc \ - = proc{|x,y| arrowMove2 $arrow_canvas, x, y}}) -$arrow_canvas.itembind('box3', '1', - proc{$demo_arrowInfo.motionProc \ - = proc{|x,y| arrowMove3 $arrow_canvas, x, y}}) -$arrowTag_box.bind('B1-Motion', - proc{|x,y| $demo_arrowInfo.motionProc.call(x,y)}, "%x %y") -$arrow_canvas.bind('Any-ButtonRelease-1', proc{arrowSetup $arrow_canvas}) - -# arrowMove1 -- -# This method is called for each mouse motion event on box1 (the -# one at the vertex of the arrow). It updates the controlling parameters -# for the line and arrowhead. -# -# Arguments: -# c - The name of the canvas window. -# x, y - The coordinates of the mouse. - -def arrowMove1(c,x,y) - v = $demo_arrowInfo - newA = (v.x2+5-c.canvasx(x).round)/10 - newA = 0 if newA < 0 - newA = 25 if newA > 25 - if newA != v.a - c.move('box1', 10*(v.a-newA), 0) - v.a = newA - end -end - -# arrowMove2 -- -# This method is called for each mouse motion event on box2 (the -# one at the trailing tip of the arrowhead). It updates the controlling -# parameters for the line and arrowhead. -# -# Arguments: -# c - The name of the canvas window. -# x, y - The coordinates of the mouse. - -def arrowMove2(c,x,y) - v = $demo_arrowInfo - newB = (v.x2+5-c.canvasx(x).round)/10 - newB = 0 if newB < 0 - newB = 25 if newB > 25 - newC = (v.y+5-c.canvasy(y).round-5*v.width)/10 - newC = 0 if newC < 0 - newC = 20 if newC > 20 - if newB != v.b || newC != v.c - c.move('box2', 10*(v.b-newB), 10*(v.c-newC)) - v.b = newB - v.c = newC - end -end - -# arrowMove3 -- -# This method is called for each mouse motion event on box3 (the -# one that controls the thickness of the line). It updates the -# controlling parameters for the line and arrowhead. -# -# Arguments: -# c - The name of the canvas window. -# x, y - The coordinates of the mouse. - -def arrowMove3(c,x,y) - v = $demo_arrowInfo - newWidth = (v.y+2-c.canvasy(y).round)/5 - newWidth = 0 if newWidth < 0 - newWidth = 20 if newWidth > 20 - if newWidth != v.width - c.move('box3', 0, 5*(v.width-newWidth)) - v.width = newWidth - end -end - diff --git a/ext/tk/sample/demos-jp/bind.rb b/ext/tk/sample/demos-jp/bind.rb deleted file mode 100644 index 1f221a6293..0000000000 --- a/ext/tk/sample/demos-jp/bind.rb +++ /dev/null @@ -1,106 +0,0 @@ -# -# text (tag bindings) widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($bind_demo) && $bind_demo - $bind_demo.destroy - $bind_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$bind_demo = TkToplevel.new {|w| - title("Text Demonstration - Tag Bindings") - iconname("bind") - positionWindow(w) -} - -# frame À¸À® -TkFrame.new($bind_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $bind_demo - $bind_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'bind'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# bind Íѥ᥽¥Ã¥É -def tag_binding_for_bind_demo(tag, enter_style, leave_style) - tag.bind('Any-Enter', proc{tag.configure enter_style}) - tag.bind('Any-Leave', proc{tag.configure leave_style}) -end - -# text À¸À® -TkText.new($bind_demo){|t| - # À¸À® - setgrid 'true' - width 60 - height 24 - font $font - wrap 'word' - TkScrollbar.new($bind_demo) {|s| - pack('side'=>'right', 'fill'=>'y') - command proc{|*args| t.yview(*args)} - t.yscrollcommand proc{|first,last| s.set first,last} - } - pack('expand'=>'yes', 'fill'=>'both') - - # ¥¹¥¿¥¤¥ëÀßÄê - if TkWinfo.depth($root).to_i > 1 - tagstyle_bold = {'background'=>'#43ce80', 'relief'=>'raised', - 'borderwidth'=>1} - tagstyle_normal = {'background'=>'', 'relief'=>'flat'} - else - tagstyle_bold = {'foreground'=>'white', 'background'=>'black'} - tagstyle_normal = {'foreground'=>'', 'background'=>''} - end - - # ¥Æ¥¥¹¥ÈÁÞÆþ - insert 'insert', "¥Æ¥¥¹¥Èwidget¤Îɽ¼¨¥¹¥¿¥¤¥ë¤òÀ©¸æ¤¹¤ë¤Î¤ÈƱ¤¸¥¿¥°¤Î¥á¥«¥Ë¥º¥à¤ò»È¤Ã¤Æ¡¢¥Æ¥¥¹¥È¤ËTcl¤Î¥³¥Þ¥ó¥É¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£¤³¤ì¤Ë¤è¤ê¡¢¥Þ¥¦¥¹¤ä¥¡¼¥Ü¡¼¥É¤Î¥¢¥¯¥·¥ç¥ó¤ÇÆÃÄê¤ÎTcl¤Î¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£Î㤨¤Ð¡¢²¼¤Î¥¥ã¥ó¥Ð¥¹¤Î¥Ç¥â¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ¤ÎÀâÌÀʸ¤Ë¤Ï¤½¤Î¤è¤¦¤Ê¥¿¥°¤¬¤Ä¤¤¤Æ¤¤¤Þ¤¹¡£¥Þ¥¦¥¹¤òÀâÌÀʸ¤Î¾å¤Ë»ý¤Ã¤Æ¤¤¤¯¤ÈÀâÌÀʸ¤¬¸÷¤ê¡¢¥Ü¥¿¥ó1¤ò²¡¤¹¤È¤½¤ÎÀâÌÀ¤Î¥Ç¥â¤¬»Ï¤Þ¤ê¤Þ¤¹¡£ - -" - insert('end', '1. ¥¥ã¥ó¥Ð¥¹ widget ¤Ëºî¤ë¤³¤È¤Î¤Ç¤¤ë¥¢¥¤¥Æ¥à¤Î¼ïÎàÁ´¤Æ¤Ë´Ø¤¹¤ë¥µ¥ó¥×¥ë¡£', (d1 = TkTextTag.new(t)) ) - insert('end', "\n\n") - insert('end', '2. ´Êñ¤Ê 2¼¡¸µ¤Î¥×¥í¥Ã¥È¡£¥Ç¡¼¥¿¤òɽ¤¹ÅÀ¤òư¤«¤¹¤³¤È¤¬¤Ç¤¤ë¡£', (d2 = TkTextTag.new(t)) ) - insert('end', "\n\n") - insert('end', '3. ¥Æ¥¥¹¥È¥¢¥¤¥Æ¥à¤Î¥¢¥ó¥«¡¼¤È¹Ô·¤¨¡£', - (d3 = TkTextTag.new(t)) ) - insert('end', "\n\n") - insert('end', '4. ¥é¥¤¥ó¥¢¥¤¥Æ¥à¤Î¤¿¤á¤ÎÌð°õ¤ÎƬ¤Î·Á¤Î¥¨¥Ç¥£¥¿¡£', - (d4 = TkTextTag.new(t)) ) - insert('end', "\n\n") - insert('end', '5. ¥¿¥Ö¥¹¥È¥Ã¥×¤òÊѹ¹¤¹¤ë¤¿¤á¤Îµ¡Ç½¤Ä¤¤Î¥ë¡¼¥é¡¼¡£', - (d5 = TkTextTag.new(t)) ) - insert('end', "\n\n") - insert('end', - '6. ¥¥ã¥ó¥Ð¥¹¤¬¤É¤¦¤ä¤Ã¤Æ¥¹¥¯¥í¡¼¥ë¤¹¤ë¤Î¤«¤ò¼¨¤¹¥°¥ê¥Ã¥É¡£', - (d6 = TkTextTag.new(t)) ) - - # binding - [d1, d2, d3, d4, d5, d6].each{|tag| - tag_binding_for_bind_demo(tag, tagstyle_bold, tagstyle_normal) - } - d1.bind('1', - proc{eval `cat #{[$demo_dir,'items.rb'].join(File::Separator)}`}) - d2.bind('1', - proc{eval `cat #{[$demo_dir,'plot.rb'].join(File::Separator)}`}) - d3.bind('1', - proc{eval `cat #{[$demo_dir,'ctext.rb'].join(File::Separator)}`}) - d4.bind('1', - proc{eval `cat #{[$demo_dir,'arrow.rb'].join(File::Separator)}`}) - d5.bind('1', - proc{eval `cat #{[$demo_dir,'ruler.rb'].join(File::Separator)}`}) - d6.bind('1', - proc{eval `cat #{[$demo_dir,'cscroll.rb'].join(File::Separator)}`}) - - TkTextMarkInsert.new(t, '0.0') - configure('state','disabled') -} diff --git a/ext/tk/sample/demos-jp/bitmap.rb b/ext/tk/sample/demos-jp/bitmap.rb deleted file mode 100644 index a400862881..0000000000 --- a/ext/tk/sample/demos-jp/bitmap.rb +++ /dev/null @@ -1,70 +0,0 @@ -# -# bitmap widget demo (called by 'widget') -# - -# bitmapRow -- -# Create a row of bitmap items in a window. -# -# Arguments: -# w - The parent window that is to contain the row. -# args - The names of one or more bitmaps, which will be displayed -# in a new row across the bottom of w along with their -# names. - -def bitmapRow(w,*args) - TkFrame.new(w){|row| - pack('side'=>'top', 'fill'=>'both') - for bitmap in args - TkFrame.new(row){|base| - pack('side'=>'left', 'fill'=>'both', 'pady'=>'.25c', 'padx'=>'.25c') - TkLabel.new(base, 'text'=>bitmap, 'width'=>9).pack('side'=>'bottom') - TkLabel.new(base, 'bitmap'=>bitmap).pack('side'=>'bottom') - } - end - } -end - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($bitmap_demo) && $bitmap_demo - $bitmap_demo.destroy - $bitmap_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$bitmap_demo = TkToplevel.new {|w| - title("Bitmap Demonstration") - iconname("bitmap") - positionWindow(w) -} - -# label À¸À® -TkLabel.new($bitmap_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left', - 'text'=>"¤³¤Î¥¦¥£¥ó¥É¥¦¤Ë¤Ï¡¢Tk ¤ËÁȤ߹þ¤Þ¤ì¤¿¤¹¤Ù¤Æ¤Î¥Ó¥Ã¥È¥Þ¥Ã¥×¤¬¡¢¤½¤ì¤é¤Î̾Á°¤È¶¦¤Ëɽ¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Tcl ¤Î¥¹¥¯¥ê¥×¥ÈÃæ¤Ç¤Ï¡¢¤½¤ì¤¾¤ì¤Î̾Á°¤òÍѤ¤¤Æ»²¾È¤·¤Þ¤¹¡£"){ - pack('side'=>'top') -} - -# frame À¸À® -$bitmap_buttons = TkFrame.new($bitmap_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $bitmap_demo - $bitmap_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'bitmap'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$bitmap_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame ÀßÄê -TkFrame.new($bitmap_demo){|f| - bitmapRow(f,'error','gray25','gray50','hourglass') - bitmapRow(f,'info','question','questhead','warning') - pack('side'=>'top', 'expand'=>'yes', 'fill'=>'both') -} - diff --git a/ext/tk/sample/demos-jp/browse1 b/ext/tk/sample/demos-jp/browse1 deleted file mode 100644 index 03e251035a..0000000000 --- a/ext/tk/sample/demos-jp/browse1 +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env ruby - -# browse -- -# This script generates a directory browser, which lists the working -# directory and allow you to open files or subdirectories by -# double-clicking. - -require 'tk' - -# Create a scrollbar on the right side of the main window and a listbox -# on the left side. - -listbox = TkListbox.new(nil, 'relief'=>'sunken', - 'width'=>20, 'height'=>20, 'setgrid'=>'yes') {|l| - TkScrollbar.new(nil, 'command'=>proc{|*args| l.yview *args}) {|s| - pack('side'=>'right', 'fill'=>'y') - l.yscrollcommand(proc{|first,last| s.set(first,last)}) - } - - pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes') -} - -root = TkRoot.new -root.minsize(1,1) - -# The procedure below is invoked to open a browser on a given file; if the -# file is a directory then another instance of this program is invoked; if -# the file is a regular file then the Mx editor is invoked to display -# the file. - -def browse (dir, file) - file = dir + File::Separator + file if dir != '.' - type = File.ftype(file) - if type == 'directory' - system($0 + ' ' + file + ' &') - else - if type == 'file' - if ENV['EDITOR'] - system(ENV['EDITOR'] + ' ' + file + ' &') - else - system('xedit ' + file + ' &') - end - else - STDOUT.print "\"#{file}\" isn't a directory or regular file" - end - end -end - -# Fill the listbox with a list of all the files in the directory (run -# the "ls" command to get that information). - -dir = ARGV[0] ? ARGV[0] : '.' -open("|ls -a #{dir}", 'r'){|fid| fid.readlines}.each{|fname| - listbox.insert('end', fname.chomp) -} - -# Set up bindings for the browser. - -Tk.bind_all('Control-c', proc{root.destroy}) -listbox.bind('Double-Button-1', - proc{TkSelection.get.each{|f| browse dir, f}}) - -Tk.mainloop diff --git a/ext/tk/sample/demos-jp/browse2 b/ext/tk/sample/demos-jp/browse2 deleted file mode 100644 index 304a5f547e..0000000000 --- a/ext/tk/sample/demos-jp/browse2 +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env ruby - -# browse -- -# This script generates a directory browser, which lists the working -# directory and allow you to open files or subdirectories by -# double-clicking. - -require 'tk' - -class Browse - BROWSE_WIN_COUNTER = TkVariable.new(0) - - def initialize(dir) - BROWSE_WIN_COUNTER.value = BROWSE_WIN_COUNTER.to_i + 1 - - # create base frame - base = TkToplevel.new { - minsize(1,1) - title('Browse : ' + dir) - } - - # Create a scrollbar on the right side of the main window and a listbox - # on the left side. - list = TkListbox.new(base, 'relief'=>'sunken', - 'width'=>20, 'height'=>20, 'setgrid'=>'yes') {|l| - TkScrollbar.new(base, 'command'=>proc{|*args| l.yview *args}) {|s| - pack('side'=>'right', 'fill'=>'y') - l.yscrollcommand(proc{|first,last| s.set(first,last)}) - } - - pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes') - - # Fill the listbox with a list of all the files in the directory (run - # the "ls" command to get that information). - open("|ls -a #{dir}", 'r'){|fid| fid.readlines}.each{|fname| - l.insert('end', fname.chomp) - } - - } - - # Set up bindings for the browser. - base.bind('Control-c', - proc{ - base.destroy - Browse::BROWSE_WIN_COUNTER.value = \ - Browse::BROWSE_WIN_COUNTER.to_i - 1}) - list.bind('Double-Button-1', - proc{TkSelection.get.each{|f| self.browse dir, f}}) - end - - # The method below is invoked to open a browser on a given file; if the - # file is a directory then another instance of this program is invoked; if - # the file is a regular file then the Mx editor is invoked to display - # the file. - def browse (dir, file) - file = dir + File::Separator + file if dir != '.' - type = File.ftype(file) - if type == 'directory' - Browse.new(file) - else - if type == 'file' - if ENV['EDITOR'] - system(ENV['EDITOR'] + ' ' + file + ' &') - else - system('xedit ' + file + ' &') - end - else - STDOUT.print "\"#{file}\" isn't a directory or regular file" - end - end - end - -end - -Browse.new(ARGV[0] ? ARGV[0] : '.') - -TkRoot.new { - withdraw - Browse::BROWSE_WIN_COUNTER.trace('w', proc{exit if Browse::BROWSE_WIN_COUNTER.to_i == 0}) -} - -Tk.mainloop diff --git a/ext/tk/sample/demos-jp/button.rb b/ext/tk/sample/demos-jp/button.rb deleted file mode 100644 index 33247261f2..0000000000 --- a/ext/tk/sample/demos-jp/button.rb +++ /dev/null @@ -1,80 +0,0 @@ -# -# button widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($button_demo) && $button_demo - $button_demo.destroy - $button_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$button_demo = TkToplevel.new {|w| - title("Button Demonstration") - iconname("button") - positionWindow(w) -} - -# label À¸À® -msg = TkLabel.new($button_demo) { - font $kanji_font - wraplength '4i' - justify 'left' - text "¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¥Ü¥¿¥ó¤ÎÇØ·Ê¿§¤¬¤½¤Î¥Ü¥¿¥ó¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¿§¤Ë¤Ê¤ê¤Þ¤¹¡£¥Ü¥¿¥ó¤«¤é¥Ü¥¿¥ó¤Ø¤Î°Üư¤Ï¥¿¥Ö¤ò²¡¤¹¤³¤È¤Ç¤â²Äǽ¤Ç¤¹¡£¤Þ¤¿¥¹¥Ú¡¼¥¹¤Ç¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£" -} -msg.pack('side'=>'top') - -# frame À¸À® -$button_buttons = TkFrame.new($button_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $button_demo - $button_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'button'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# button À¸À® -TkButton.new($button_demo){ - text "Peach Puff" - width 10 - command proc{ - $button_demo.configure('bg','PeachPuff1') - $button_buttons.configure('bg','PeachPuff1') - } -}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2) - -TkButton.new($button_demo){ - text "Light Blue" - width 10 - command proc{ - $button_demo.configure('bg','LightBlue1') - $button_buttons.configure('bg','LightBlue1') - } -}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2) - -TkButton.new($button_demo){ - text "Sea Green" - width 10 - command proc{ - $button_demo.configure('bg','SeaGreen2') - $button_buttons.configure('bg','SeaGreen2') - } -}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2) - -TkButton.new($button_demo){ - text "Yellow" - width 10 - command proc{ - $button_demo.configure('bg','Yellow1') - $button_buttons.configure('bg','Yellow1') - } -}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2) diff --git a/ext/tk/sample/demos-jp/check.rb b/ext/tk/sample/demos-jp/check.rb deleted file mode 100644 index 50c21fac0e..0000000000 --- a/ext/tk/sample/demos-jp/check.rb +++ /dev/null @@ -1,66 +0,0 @@ -# -# checkbutton widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($check_demo) && $check_demo - $check_demo.destroy - $check_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$check_demo = TkToplevel.new {|w| - title("Checkbutton Demonstration") - iconname("check") - positionWindow(w) -} - -# label À¸À® -msg = TkLabel.new($check_demo) { - font $font - wraplength '4i' - justify 'left' - text "²¼¤Ë¤Ï 3 ¤Ä¤Î¥Á¥§¥Ã¥¯¥Ü¥¿¥ó¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¥¯¥ê¥Ã¥¯¤¹¤ë¤È¥Ü¥¿¥ó¤ÎÁªÂò¾õÂÖ¤¬ÊѤï¤ê¡¢Tcl ÊÑ¿ô¤Ë¤½¤Î¥Ü¥¿¥ó¤Î¾õÂÖ¤ò¼¨¤¹ÃͤòÀßÄꤷ¤Þ¤¹¡£¸½ºß¤ÎÊÑ¿ô¤ÎÃͤò¸«¤ë¤Ë¤Ï¡ÖÊÑ¿ô»²¾È¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£" -} -msg.pack('side'=>'top') - -# ÊÑ¿ôÀ¸À® -wipers = TkVariable.new(0) -brakes = TkVariable.new(0) -sober = TkVariable.new(0) - -# frame À¸À® -TkFrame.new($check_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $check_demo - $check_demo = nil - $showVarsWin[tmppath.path] = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'check'} - }.pack('side'=>'left', 'expand'=>'yes') - - - TkButton.new(frame) { - text 'ÊÑ¿ô»²¾È' - command proc{ - showVars($check_demo, - ['wipers', wipers], ['brakes', brakes], ['sober', sober]) - } - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - - -# checkbutton À¸À® -[ TkCheckButton.new($check_demo, 'text'=>'¥ï¥¤¥Ñ¡¼ OK', 'variable'=>wipers), - TkCheckButton.new($check_demo, 'text'=>'¥Ö¥ì¡¼¥ OK', 'variable'=>brakes), - TkCheckButton.new($check_demo, 'text'=>'¥É¥é¥¤¥Ð¡¼ÁÇÌÌ', 'variable'=>sober) -].each{|w| w.relief('flat'); w.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')} - diff --git a/ext/tk/sample/demos-jp/clrpick.rb b/ext/tk/sample/demos-jp/clrpick.rb deleted file mode 100644 index 55cfd9c7c6..0000000000 --- a/ext/tk/sample/demos-jp/clrpick.rb +++ /dev/null @@ -1,74 +0,0 @@ -# -# widget demo prompts the user to select a color (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($clrpick_demo) && $clrpick_demo - $clrpick_demo.destroy - $clrpick_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$clrpick_demo = TkToplevel.new {|w| - title("Color Selection Dialogs") - iconname("colors") - positionWindow(w) -} - -# label À¸À® -TkLabel.new($clrpick_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left', - 'text'=>"°Ê²¼¤Î¥Ü¥¿¥ó¤ò²¡¤·¤Æ¡¢¤³¤Î¥¦¥£¥ó¥É¥¦¾å¤Ë¤¢¤ë¥¦¥£¥¸¥§¥Ã¥È¤ÎÁ°·Ê¿§¤ÈÇØ·Ê¿§¤òÁªÂò¤·¤Æ²¼¤µ¤¤¡£").pack('side'=>'top') - -# frame À¸À® -TkFrame.new($clrpick_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $clrpick_demo - $clrpick_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'clrpick'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# button À¸À® -TkButton.new($clrpick_demo, 'text'=>'ÇØ·Ê¿§¤òÀßÄê ...') {|b| - command(proc{setColor $clrpick_demo, b, 'background', - ['background', 'highlightbackground']}) - pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m') -} - -TkButton.new($clrpick_demo, 'text'=>'Á°·Ê¿§¤òÀßÄê ...') {|b| - command(proc{setColor $clrpick_demo, b, 'foreground', ['foreground']}) - pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m') -} - -def setColor(w,button,name,options) - w.grab - initialColor = button[name] - color = Tk.chooseColor('title'=>"Choose a #{name} color", 'parent'=>w, - 'initialcolor'=>initialColor) - if color != "" - setColor_helper(w,options,color) - end - - w.grab('release') -end - -def setColor_helper(w, options, color) - options.each{|opt| - begin - w[opt] = color - rescue - end - } - TkWinfo.children(w).each{|child| - setColor_helper child, options, color - } -end - diff --git a/ext/tk/sample/demos-jp/colors.rb b/ext/tk/sample/demos-jp/colors.rb deleted file mode 100644 index f9a5983e75..0000000000 --- a/ext/tk/sample/demos-jp/colors.rb +++ /dev/null @@ -1,143 +0,0 @@ -# -# listbox widget demo 'colors' (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($colors_demo) && $colors_demo - $colors_demo.destroy - $colors_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$colors_demo = TkToplevel.new {|w| - title("Listbox Demonstration (colors)") - iconname("colors") - positionWindow(w) -} - -# label À¸À® -msg = TkLabel.new($colors_demo) { - font $font - wraplength '4i' - justify 'left' - text "²¼¤Ë¤Ï¿§¤Î̾Á°¤¬Æþ¤Ã¤¿¥¹¥¯¥í¡¼¥ë¥Ð¡¼ÉդΥꥹ¥È¥Ü¥Ã¥¯¥¹¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¥ê¥¹¥È¤ò¥¹¥¯¥í¡¼¥ë¤µ¤»¤ë¤Î¤Ï¥¹¥¯¥í¡¼¥ë¥Ð¡¼¤Ç¤â¤Ç¤¤Þ¤¹¤·¡¢¥ê¥¹¥È¥Ü¥Ã¥¯¥¹¤ÎÃæ¤Ç¥Þ¥¦¥¹¤Î¥Ü¥¿¥ó2(Ãæ¥Ü¥¿¥ó)¤ò²¡¤·¤¿¤Þ¤Þ¥É¥é¥Ã¥°¤·¤Æ¤â¤Ç¤¤Þ¤¹¡£¤¢¤ë¿§¤ò¥Ü¥¿¥ó1(º¸¥Ü¥¿¥ó)¤Ç¥À¥Ö¥ë¥¯¥ê¥Ã¥¯¤¹¤ë¤È¥¢¥×¥ê¥±¡¼¥·¥ç¥óÁ´ÂΤ¬¤½¤Î¿§¤Ë¤Ê¤ê¤Þ¤¹¡£" -} -msg.pack('side'=>'top') - -# frame À¸À® -TkFrame.new($colors_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $colors_demo - $colors_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'colors'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame À¸À® -colors_lbox = nil -TkFrame.new($colors_demo, 'borderwidth'=>10) {|w| - s = TkScrollbar.new(w) - colors_lbox = TkListbox.new(w) { - setgrid 1 - width 10 - height 12 - yscrollcommand proc{|first,last| s.set first,last} - } - s.command(proc{|*args| colors_lbox.yview(*args)}) - s.pack('side'=>'right', 'fill'=>'y') - colors_lbox.pack('side'=>'left', 'expand'=>1, 'fill'=>'both') -}.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y') - -colors_lbox.bind('Double-1', proc{TkPalette.setPalette TkSelection.get}) - -ins_data = [ - 'gray60','gray70','gray80','gray85','gray90','gray95', - 'snow1','snow2','snow3','snow4','seashell1','seashell2', - 'seashell3','seashell4','AntiqueWhite1','AntiqueWhite2', - 'AntiqueWhite3','AntiqueWhite4','bisque1','bisque2', - 'bisque3','bisque4','PeachPuff1','PeachPuff2', - 'PeachPuff3','PeachPuff4','NavajoWhite1','NavajoWhite2', - 'NavajoWhite3','NavajoWhite4','LemonChiffon1', - 'LemonChiffon2','LemonChiffon3','LemonChiffon4', - 'cornsilk1','cornsilk2','cornsilk3','cornsilk4', - 'ivory1','ivory2','ivory3','ivory4','honeydew1', - 'honeydew2','honeydew3','honeydew4','LavenderBlush1', - 'LavenderBlush2','LavenderBlush3','LavenderBlush4', - 'MistyRose1','MistyRose2','MistyRose3','MistyRose4', - 'azure1','azure2','azure3','azure4','SlateBlue1', - 'SlateBlue2','SlateBlue3','SlateBlue4','RoyalBlue1', - 'RoyalBlue2','RoyalBlue3','RoyalBlue4','blue1','blue2', - 'blue3','blue4','DodgerBlue1','DodgerBlue2', - 'DodgerBlue3','DodgerBlue4','SteelBlue1','SteelBlue2', - 'SteelBlue3','SteelBlue4','DeepSkyBlue1','DeepSkyBlue2', - 'DeepSkyBlue3','DeepSkyBlue4','SkyBlue1','SkyBlue2', - 'SkyBlue3','SkyBlue4','LightSkyBlue1','LightSkyBlue2', - 'LightSkyBlue3','LightSkyBlue4','SlateGray1', - 'SlateGray2','SlateGray3','SlateGray4', - 'LightSteelBlue1','LightSteelBlue2','LightSteelBlue3', - 'LightSteelBlue4','LightBlue1','LightBlue2', - 'LightBlue3','LightBlue4','LightCyan1','LightCyan2', - 'LightCyan3','LightCyan4','PaleTurquoise1', - 'PaleTurquoise2','PaleTurquoise3','PaleTurquoise4', - 'CadetBlue1','CadetBlue2','CadetBlue3','CadetBlue4', - 'turquoise1','turquoise2','turquoise3','turquoise4', - 'cyan1','cyan2','cyan3','cyan4','DarkSlateGray1', - 'DarkSlateGray2','DarkSlateGray3','DarkSlateGray4', - 'aquamarine1','aquamarine2','aquamarine3','aquamarine4', - 'DarkSeaGreen1','DarkSeaGreen2','DarkSeaGreen3', - 'DarkSeaGreen4','SeaGreen1','SeaGreen2','SeaGreen3', - 'SeaGreen4','PaleGreen1','PaleGreen2','PaleGreen3', - 'PaleGreen4','SpringGreen1','SpringGreen2', - 'SpringGreen3','SpringGreen4','green1','green2', - 'green3','green4','chartreuse1','chartreuse2', - 'chartreuse3','chartreuse4','OliveDrab1','OliveDrab2', - 'OliveDrab3','OliveDrab4','DarkOliveGreen1', - 'DarkOliveGreen2','DarkOliveGreen3','DarkOliveGreen4', - 'khaki1','khaki2','khaki3','khaki4','LightGoldenrod1', - 'LightGoldenrod2','LightGoldenrod3','LightGoldenrod4', - 'LightYellow1','LightYellow2','LightYellow3', - 'LightYellow4','yellow1','yellow2','yellow3','yellow4', - 'gold1','gold2','gold3','gold4','goldenrod1', - 'goldenrod2','goldenrod3','goldenrod4','DarkGoldenrod1', - 'DarkGoldenrod2','DarkGoldenrod3','DarkGoldenrod4', - 'RosyBrown1','RosyBrown2','RosyBrown3','RosyBrown4', - 'IndianRed1','IndianRed2','IndianRed3','IndianRed4', - 'sienna1','sienna2','sienna3','sienna4','burlywood1', - 'burlywood2','burlywood3','burlywood4','wheat1', - 'wheat2','wheat3','wheat4','tan1','tan2','tan3','tan4', - 'chocolate1','chocolate2','chocolate3','chocolate4', - 'firebrick1','firebrick2','firebrick3','firebrick4', - 'brown1','brown2','brown3','brown4','salmon1','salmon2', - 'salmon3','salmon4','LightSalmon1','LightSalmon2', - 'LightSalmon3','LightSalmon4','orange1','orange2', - 'orange3','orange4','DarkOrange1','DarkOrange2', - 'DarkOrange3','DarkOrange4','coral1','coral2','coral3', - 'coral4','tomato1','tomato2','tomato3','tomato4', - 'OrangeRed1','OrangeRed2','OrangeRed3','OrangeRed4', - 'red1','red2','red3','red4','DeepPink1','DeepPink2', - 'DeepPink3','DeepPink4','HotPink1','HotPink2', - 'HotPink3','HotPink4','pink1','pink2','pink3','pink4', - 'LightPink1','LightPink2','LightPink3','LightPink4', - 'PaleVioletRed1','PaleVioletRed2','PaleVioletRed3', - 'PaleVioletRed4','maroon1','maroon2','maroon3', - 'maroon4','VioletRed1','VioletRed2','VioletRed3', - 'VioletRed4','magenta1','magenta2','magenta3', - 'magenta4','orchid1','orchid2','orchid3','orchid4', - 'plum1','plum2','plum3','plum4','MediumOrchid1', - 'MediumOrchid2','MediumOrchid3','MediumOrchid4', - 'DarkOrchid1','DarkOrchid2','DarkOrchid3', - 'DarkOrchid4','purple1','purple2','purple3','purple4', - 'MediumPurple1','MediumPurple2','MediumPurple3', - 'MediumPurple4','thistle1','thistle2','thistle3', 'thistle4' -] - -colors_lbox.insert(0, *ins_data) diff --git a/ext/tk/sample/demos-jp/cscroll.rb b/ext/tk/sample/demos-jp/cscroll.rb deleted file mode 100644 index 7f5ffa2f02..0000000000 --- a/ext/tk/sample/demos-jp/cscroll.rb +++ /dev/null @@ -1,130 +0,0 @@ -# -# simple scrollable canvas widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($cscroll_demo) && $cscroll_demo - $cscroll_demo.destroy - $cscroll_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$cscroll_demo = TkToplevel.new {|w| - title("Scrollable Canvas Demonstration") - iconname("cscroll") - positionWindow(w) -} - -# label À¸À® -TkLabel.new($cscroll_demo, 'font'=>$font, 'wraplength'=>'4i', - 'justify'=>'left', 'text'=>"¤³¤Î¥¦¥£¥ó¥É¥¦¤Ë¤Ï¥¹¥¯¥í¡¼¥ë¥Ð¡¼¤ä¥Þ¥¦¥¹¤Î¥Ü¥¿¥ó2 ¤Ç¥¹¥¯¥í¡¼¥ë¤Ç¤¤ë¥¥ã¥ó¥Ð¥¹ widget ¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£»Í³Ñ¤Î¾å¤Ç¥Ü¥¿¥ó1 ¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¤½¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬É¸½à½ÐÎϤ˽ÐÎϤµ¤ì¤Þ¤¹¡£"){ - pack('side'=>'top') -} - -# frame À¸À® -$cscroll_buttons = TkFrame.new($cscroll_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $cscroll_demo - $cscroll_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'cscroll'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$cscroll_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame ÀßÄê -unless $tk_version =~ /^4\.[01]/ - $cscroll_grid = TkFrame.new($cscroll_demo) { - pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1) - } - TkGrid.rowconfigure($cscroll_grid, 0, 'weight'=>1, 'minsize'=>0) - TkGrid.columnconfigure($cscroll_grid, 0, 'weight'=>1, 'minsize'=>0) -end - -# canvas ÀßÄê -$cscroll_canvas = TkCanvas.new($cscroll_demo, - 'relief'=>'sunken', 'borderwidth'=>2, - 'scrollregion'=>['-11c', '-11c', '50c', '20c'] - ) {|c| - if $tk_version =~ /^4\.[01]/ - pack('expand'=>'yes', 'fill'=>'both') - else - grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - end - - TkScrollbar.new($cscroll_demo, 'command'=>proc{|*args| c.yview(*args)}) {|vs| - c.yscrollcommand(proc{|first,last| vs.set first,last}) - if $tk_version =~ /^4\.[01]/ - pack('side'=>'right', 'fill'=>'y') - else - grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - end - } - - TkScrollbar.new($cscroll_demo, 'orient'=>'horiz', - 'command'=>proc{|*args| c.xview(*args)}) {|hs| - c.xscrollcommand(proc{|first,last| hs.set first,last}) - if $tk_version =~ /^4\.[01]/ - pack('side'=>'bottom', 'fill'=>'x') - else - grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - end - } -} - -bg = $cscroll_canvas.configinfo('bg')[4] -(0..19).each{|i| - x = -10+3*i - y = -10 - (0..9).each{|j| - TkcRectangle.new($cscroll_canvas, "#{x}c", "#{y}c", "#{x+2}c", "#{y+2}c", - 'outline'=>'black', 'fill'=>bg, 'tags'=>'rect') - TkcText.new($cscroll_canvas, "#{x+1}c", "#{y+1}c", - 'text'=>"#{i},#{j}", 'anchor'=>'center', 'tags'=>'text') - y += 3 - } -} - -$cscroll_canvas.itembind('all', 'Any-Enter', proc{scrollEnter $cscroll_canvas}) -$cscroll_canvas.itembind('all', 'Any-Leave', proc{scrollLeave $cscroll_canvas}) -$cscroll_canvas.itembind('all', '1', proc{scrollButton $cscroll_canvas}) -$cscroll_canvas.itembind('all', 'Any-Enter', proc{scrollEnter $cscroll_canvas}) -$cscroll_canvas.bind('2', proc{|x,y| $cscroll_canvas.scan_mark(x,y)}, '%x %y') -$cscroll_canvas.bind('B2-Motion', - proc{|x,y| $cscroll_canvas.scan_dragto(x,y)}, '%x %y') - -def scrollEnter(c) - id = c.find_withtag('current')[0].id - id -= 1 if c.gettags('current').include?('text') - $oldFill = c.itemconfiginfo(id, 'fill')[4] - if TkWinfo.depth(c) > 1 - c.itemconfigure(id, 'fill'=>'SeaGreen1') - else - c.itemconfigure(id, 'fill'=>'black') - c.itemconfigure(id+1, 'fill'=>'white') - end -end - -def scrollLeave(c) - id = c.find_withtag('current')[0].id - id -= 1 if c.gettags('current').include?('text') - c.itemconfigure(id, 'fill'=>$oldFill) - c.itemconfigure(id+1, 'fill'=>'black') -end - -def scrollButton(c) - id = c.find_withtag('current')[0].id - id += 1 unless c.gettags('current').include?('text') - print "You buttoned at #{c.itemconfiginfo(id,'text')[4]}\n" -end - diff --git a/ext/tk/sample/demos-jp/ctext.rb b/ext/tk/sample/demos-jp/ctext.rb deleted file mode 100644 index 6d9355e2f8..0000000000 --- a/ext/tk/sample/demos-jp/ctext.rb +++ /dev/null @@ -1,181 +0,0 @@ -# -# Canvas Text widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($ctext_demo) && $ctext_demo - $ctext_demo.destroy - $ctext_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$ctext_demo = TkToplevel.new {|w| - title("Canvas Text Demonstration") - iconname("Text") - positionWindow(w) -} - -# label À¸À® -TkLabel.new($ctext_demo, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', - 'text'=>"¤³¤Î¥¦¥£¥ó¥É¥¦¤Ë¤Ï¥¥ã¥ó¥Ð¥¹widget¤Î¥Æ¥¥¹¥Èµ¡Ç½¤ò¥Ç¥â¤¹¤ë¤¿¤á¤Î¥Æ¥¥¹¥Èʸ»úÎó¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¥Þ¥¦¥¹¤ò»Í³Ñ¤ÎÃæ¤Ë»ý¤Ã¤Æ¤¤¤¡¢¥¯¥ê¥Ã¥¯¤¹¤ë¤È°ÌÃÖ¤®¤áÍѤÎÅÀ¤«¤é¤ÎÁêÂаÌÃÖ¤òÊѤ¨¤¿¤ê¡¢¹Ô·¤¨¤òÊѤ¨¤¿¤ê¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£¤Þ¤¿°Ê²¼¤Î¤è¤¦¤ÊÊÔ½¸¤Î¤¿¤á¤Î´Êñ¤Ê¥Ð¥¤¥ó¥Ç¥£¥ó¥°¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤¹¡£ - - 1. ¥Þ¥¦¥¹¤ò»ý¤Ã¤Æ¤¤¤¡¢¥¯¥ê¥Ã¥¯¤·¡¢ÆþÎϤǤ¤Þ¤¹¡£ - 2. ¥Ü¥¿¥ó1¤ÇÁªÂò¤Ç¤¤Þ¤¹¡£ - 3. ¥Þ¥¦¥¹¤Î°ÌÃ֤˥ܥ¿¥ó2¤ÇÁªÂò¤·¤¿¥Æ¥¥¹¥È¤ò¥³¥Ô¡¼¤Ç¤¤Þ¤¹¡£ - 4.¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤ò¥³¥ó¥È¥í¡¼¥ë-H¤ÇÁÞÆþ¥«¡¼¥½¥ë¤ÎľÁ°¤Îʸ»ú¤òºï½ü¤·¤Þ¤¹¡£ - 5. Delete¥¡¼¤ÏÁÞÆþ¥«¡¼¥½¥ë¤Îľ¸å¤Îʸ»ú¤òºï½ü¤·¤Þ¤¹¡£"){ - pack('side'=>'top') -} - -# frame À¸À® -$ctext_buttons = TkFrame.new($ctext_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $ctext_demo - $ctext_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'ctext'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$ctext_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# canvas À¸À® -$ctext_canvas = TkCanvas.new($ctext_demo, 'relief'=>'flat', - 'borderwidth'=>0, 'width'=>500, 'height'=>350) -$ctext_canvas.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'both') - -# font ÀßÄê -textFont = '-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*' - -# canvas ÀßÄê -TkcRectangle.new($ctext_canvas, 245, 195, 255, 205, - 'outline'=>'black', 'fill'=>'red') - -$ctag_text = TkcTag.new($ctext_canvas) -$ctag_text.withtag(TkcText.new($ctext_canvas, 250, 200, - 'text'=>"¤³¤ì¤Ï¥¥ã¥ó¥Ð¥¹widget¤Î¥Æ¥¥¹¥Èµ¡Ç½¤ò¥Ç¥â¤¹¤ë¤¿¤á¤Îʸ»úÎó¤Ç¤¹¡£¥Þ¥¦¥¹¤ò»ý¤Ã¤Æ¤¤¤¡¢¥¯¥ê¥Ã¥¯¤·¤ÆÆþÎϤǤ¤Þ¤¹¡£ÁªÂò¤·¤Æ¥³¥ó¥È¥í¡¼¥ë-D¤Ç¾Ãµî¤¹¤ë¤³¤È¤â¤Ç¤¤Þ¤¹¡£", - 'width'=>440, 'anchor'=>'n', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*', - 'kanjifont'=>'-*-r-*--24-*-jisx0208.1983-0', - 'justify'=>'left') ) - -$ctag_text.bind('1', proc{|x,y| textB1Press $ctext_canvas,x,y}, "%x %y") -$ctag_text.bind('B1-Motion', proc{|x,y| textB1Move $ctext_canvas,x,y}, "%x %y") -$ctag_text.bind('Shift-1', - proc{|x,y| $ctext_canvas.seleect_adjust 'current', "@#{x},#{y}"}, - "%x %y") -$ctag_text.bind('Shift-B1-Motion', - proc{|x,y| textB1Move $ctext_canvas,x,y}, "%x %y") -$ctag_text.bind('KeyPress', proc{|a| textInsert $ctext_canvas,a}, "%A") -$ctag_text.bind('Return', proc{textInsert $ctext_canvas,"\n"}) -$ctag_text.bind('Control-h', proc{textBs $ctext_canvas}) -$ctag_text.bind('BackSpace', proc{textBs $ctext_canvas}) -$ctag_text.bind('Delete', proc{textDel $ctext_canvas}) -$ctag_text.bind('2', proc{|x,y| textPaste $ctext_canvas, "@#{x},#{y}"}, - "%x %y") - -# Next, create some items that allow the text's anchor position -# to be edited. - -def mkTextConfig(w,x,y,option,value,color) - item = TkcRectangle.new(w, x, y, x+30, y+30, - 'outline'=>'black', 'fill'=>color, 'width'=>1) - item.bind('1', proc{$ctag_text.configure option, value}) - w.addtag_withtag('config', item) -end - -x = 50 -y = 50 -color = 'LightSkyBlue1' -mkTextConfig $ctext_canvas, x, y, 'anchor', 'se', color -mkTextConfig $ctext_canvas, x+30, y, 'anchor', 's', color -mkTextConfig $ctext_canvas, x+60, y, 'anchor', 'sw', color -mkTextConfig $ctext_canvas, x, y+30, 'anchor', 'e', color -mkTextConfig $ctext_canvas, x+30, y+30, 'anchor', 'center', color -mkTextConfig $ctext_canvas, x+60, y+30, 'anchor', 'w', color -mkTextConfig $ctext_canvas, x, y+60, 'anchor', 'ne', color -mkTextConfig $ctext_canvas, x+30, y+60, 'anchor', 'n', color -mkTextConfig $ctext_canvas, x+60, y+60, 'anchor', 'nw', color -item = TkcRectangle.new($ctext_canvas, x+40, y+40, x+50, y+50, - 'outline'=>'black', 'fill'=>'red') -item.bind('1', proc{$ctag_text.configure 'anchor', 'center'}) -TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position', 'anchor'=>'s', - 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', - 'fill'=>'brown') - -# Lastly, create some items that allow the text's justification to be -# changed. - -x = 350 -y = 50 -color = 'SeaGreen2' -mkTextConfig $ctext_canvas, x, y, 'justify', 'left', color -mkTextConfig $ctext_canvas, x+30, y, 'justify', 'center', color -mkTextConfig $ctext_canvas, x+60, y, 'justify', 'right', color -TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Justification', 'anchor'=>'s', - 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', - 'fill'=>'brown') - -$ctext_canvas.itembind('config', 'Enter', proc{textEnter $ctext_canvas}) -$ctext_canvas.itembind('config', 'Leave', - proc{$ctext_canvas\ - .itemconfigure('current', - 'fill'=>$textConfigFill)}) - -$textConfigFill = '' - -def textEnter(w) - $textConfigFill = (w.itemconfiginfo 'current', 'fill')[4] - w.itemconfigure 'current', 'fill', 'black' -end - -def textInsert(w, string) - return if string == "" - begin - $ctag_text.dchars 'sel.first', 'sel.last' - rescue - end - $ctag_text.insert 'insert', string -end - -def textPaste(w, pos) - begin - $ctag_text.insert pos, TkSelection.get - rescue - end -end - -def textB1Press(w,x,y) - w.icursor 'current', "@#{x},#{y}" - w.itemfocus 'current' - w.focus - w.select_from 'current', "@#{x},#{y}" -end - -def textB1Move(w,x,y) - w.select_to 'current', "@#{x},#{y}" -end - -def textBs(w) - begin - $ctag_text.dchars 'sel.first', 'sel.last' - rescue - char = $ctag_text.index('insert').to_i - 1 - $ctag_text.dchars(char) if char >= 0 - end -end - -def textDel(w) - begin - $ctag_text.dchars 'sel.first', 'sel.last' - rescue - $ctag_text.dchars 'insert' - end -end - diff --git a/ext/tk/sample/demos-jp/dialog1.rb b/ext/tk/sample/demos-jp/dialog1.rb deleted file mode 100644 index 5b578a981d..0000000000 --- a/ext/tk/sample/demos-jp/dialog1.rb +++ /dev/null @@ -1,38 +0,0 @@ -# -# a dialog box with a local grab (called by 'widget') -# -class TkDialog_Demo1 < TkDialog - ############### - private - ############### - def title - "Dialog with local grab" - end - - def message - '¥â¡¼¥À¥ë¥À¥¤¥¢¥í¥°¥Ü¥Ã¥¯¥¹¤Ç¤¹¡£Tk ¤Î "grab" ¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤Æ¥À¥¤¥¢¥í¥°¥Ü¥Ã¥¯¥¹¤Ç¡Ö¥í¡¼¥«¥ë¥°¥é¥Ö¡×¤·¤Æ¤¤¤Þ¤¹¡£²¼¤Î¤¤¤º¤ì¤«¤Î¥Ü¥¿¥ó¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¤³¤Î¥À¥¤¥¢¥í¥°¤ËÅú¤¨¤ë¤Þ¤Ç¡¢¤³¤Î¥°¥é¥Ö¤Ë¤è¤Ã¤Æ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¾¤Î¥¦¥£¥ó¥É¥¦¤Ç¤Ï¡¢¥Ý¥¤¥ó¥¿´Ø·¸¤Î¥¤¥Ù¥ó¥È¤ò¼õ¤±¼è¤ë¤³¤È¤¬¤Ç¤¤Ê¤¯¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£' - end - - def bitmap - 'info' - end - - def default_button - 0 - end - - def buttons -# "λ²ò ¥¥ã¥ó¥»¥ë ¥³¡¼¥É»²¾È" - ["λ²ò", "¥¥ã¥ó¥»¥ë", "¥³¡¼¥É»²¾È"] - end -end - -ret = TkDialog_Demo1.new('message_config'=>{'wraplength'=>'4i'}).value -case ret -when 0 - print "¤¢¤Ê¤¿¤Ï¡Öλ²ò¡×¤ò²¡¤·¤Þ¤·¤¿¤Í¡£\n" -when 1 - print "¤¢¤Ê¤¿¤Ï¡Ö¥¥ã¥ó¥»¥ë¡×¤ò²¡¤·¤Þ¤·¤¿¤Í¡£\n" -when 2 - showCode dialog1 -end diff --git a/ext/tk/sample/demos-jp/dialog2.rb b/ext/tk/sample/demos-jp/dialog2.rb deleted file mode 100644 index 4819f18a03..0000000000 --- a/ext/tk/sample/demos-jp/dialog2.rb +++ /dev/null @@ -1,42 +0,0 @@ -# -# a dialog box with a global grab (called by 'widget') -# -class TkDialog_Demo2 < TkDialog - ############### - private - ############### - def title - "Dialog with global grab" - end - - def message - '¤³¤Î¥À¥¤¥¢¥í¥°¥Ü¥Ã¥¯¥¹¤Ï¥°¥í¡¼¥Ð¥ë¥°¥é¥Ö¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤¹¡£²¼¤Î¥Ü¥¿¥ó¤ò¼Â¹Ô¤¹¤ë¤Þ¤Ç¡¢¥Ç¥£¥¹¥×¥ì¥¤¾å¤Î¤¤¤«¤Ê¤ë¤â¤Î¤È¤âÂÐÏäǤ¤Þ¤»¤ó¡£¥°¥í¡¼¥Ð¥ë¥°¥é¥Ö¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¡¢¤Þ¤ºÎɤ¤¹Í¤¨¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£¤É¤¦¤·¤Æ¤âɬÍפˤʤë¤Þ¤Ç»È¤ª¤¦¤È»×¤ï¤Ê¤¤¤Ç²¼¤µ¤¤¡£' - end - - def bitmap - 'info' - end - - def default_button - 0 - end - - def buttons -# "λ²ò ¥¥ã¥ó¥»¥ë ¥³¡¼¥É»²¾È" - ["λ²ò", "¥¥ã¥ó¥»¥ë", "¥³¡¼¥É»²¾È"] - end -end - -ret = TkDialog_Demo2.new('message_config'=>{'wraplength'=>'4i'}, - 'prev_command'=>proc{|dialog| - Tk.after 100, proc{dialog.grab('global')} - }).value -case ret -when 0 - print "¤¢¤Ê¤¿¤Ï¡Öλ²ò¡×¤ò²¡¤·¤Þ¤·¤¿¤Í¡£\n" -when 1 - print "¤¢¤Ê¤¿¤Ï¡Ö¥¥ã¥ó¥»¥ë¡×¤ò²¡¤·¤Þ¤·¤¿¤Í¡£\n" -when 2 - showCode dialog2 -end - diff --git a/ext/tk/sample/demos-jp/doc.org/README b/ext/tk/sample/demos-jp/doc.org/README deleted file mode 100644 index 90677d3316..0000000000 --- a/ext/tk/sample/demos-jp/doc.org/README +++ /dev/null @@ -1,7 +0,0 @@ -This directory contains a collection of demonstration programs that -are translated into Japanese. You need to use a Japanized "wish" to -see these Japanese-translated demonstration programs. You also need -to put this directory ("demos.jp") at the next to "demos" since some -of the programs refer to the image files at "demos". - -Please refer to the README file at "demos" for more detail. diff --git a/ext/tk/sample/demos-jp/doc.org/README.JP b/ext/tk/sample/demos-jp/doc.org/README.JP deleted file mode 100644 index 42b4929378..0000000000 --- a/ext/tk/sample/demos-jp/doc.org/README.JP +++ /dev/null @@ -1,14 +0,0 @@ -This directory contains "widget" demo for the Japanized Tcl7.6/Tk4.2. -Most of the messages in the original are translated to Japanese. -But other tools in this directory are not translated. - -Following 2 kanji fonts are defined at the beginning of the file "widget." - - -*--24-*-jisx0208.1983-0 - -*--16-*-jisx0208.1983-0 - -These fonts are all part of the core distribution of X11R5, so -if you are running X11R5, you don't have to modify the file. - -But if you don't have these fonts, replace them with appropriate ones. -"-*--14-*-jisx0208.1983-0" will be a good choice. diff --git a/ext/tk/sample/demos-jp/doc.org/README.tk80 b/ext/tk/sample/demos-jp/doc.org/README.tk80 deleted file mode 100644 index c71f977d74..0000000000 --- a/ext/tk/sample/demos-jp/doc.org/README.tk80 +++ /dev/null @@ -1,46 +0,0 @@ -This directory contains a collection of programs to demonstrate -the features of the Tk toolkit. The programs are all scripts for -"wish", a windowing shell. If wish has been installed in /usr/local -then you can invoke any of the programs in this directory just -by typing its file name to your command shell. Otherwise invoke -wish with the file as its first argument, e.g., "wish hello". -The rest of this file contains a brief description of each program. -Files with names ending in ".tcl" are procedure packages used by one -or more of the demo programs; they can't be used as programs by -themselves so they aren't described below. - -hello - Creates a single button; if you click on it, a message - is typed and the application terminates. - -widget - Contains a collection of demonstrations of the widgets - currently available in the Tk library. Most of the .tcl - files are scripts for individual demos available through - the "widget" program. - -ixset - A simple Tk-based wrapper for the "xset" program, which - allows you to interactively query and set various X options - such as mouse acceleration and bell volume. Thanks to - Pierre David for contributing this example. - -rolodex - A mock-up of a simple rolodex application. It has much of - the user interface for such an application but no back-end - database. This program was written in response to Tom - LaStrange's toolkit benchmark challenge. - -tcolor - A color editor. Allows you to edit colors in several - different ways, and will also perform automatic updates - using "send". - -rmt - Allows you to "hook-up" remotely to any Tk application - on the display. Select an application with the menu, - then just type commands: they'll go to that application. - -timer - Displays a seconds timer with start and stop buttons. - Control-c and control-q cause it to exit. - -browse - A simple directory browser. Invoke it with and argument - giving the name of the directory you'd like to browse. - Double-click on files or subdirectories to browse them. - Control-c and control-q cause the program to exit. - -sccs id = SCCS: @(#) README 1.3 96/02/16 10:49:14 diff --git a/ext/tk/sample/demos-jp/doc.org/license.terms b/ext/tk/sample/demos-jp/doc.org/license.terms deleted file mode 100644 index 03ca6fcb31..0000000000 --- a/ext/tk/sample/demos-jp/doc.org/license.terms +++ /dev/null @@ -1,39 +0,0 @@ -This software is copyrighted by the Regents of the University of -California, Sun Microsystems, Inc., and other parties. The following -terms apply to all files associated with the software unless explicitly -disclaimed in individual files. - -The authors hereby grant permission to use, copy, modify, distribute, -and license this software and its documentation for any purpose, provided -that existing copyright notices are retained in all copies and that this -notice is included verbatim in any distributions. No written agreement, -license, or royalty fee is required for any of the authorized uses. -Modifications to this software may be copyrighted by their authors -and need not follow the licensing terms described here, provided that -the new terms are clearly indicated on the first page of each file where -they apply. - -IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -MODIFICATIONS. - -GOVERNMENT USE: If you are acquiring this software on behalf of the -U.S. government, the Government shall have only "Restricted Rights" -in the software and related documentation as defined in the Federal -Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you -are acquiring the software on behalf of the Department of Defense, the -software shall be classified as "Commercial Computer Software" and the -Government shall have only "Restricted Rights" as defined in Clause -252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the -authors grant the U.S. Government and others acting in its behalf -permission to use and distribute the software in accordance with the -terms specified in this license. diff --git a/ext/tk/sample/demos-jp/doc.org/license.terms.tk80 b/ext/tk/sample/demos-jp/doc.org/license.terms.tk80 deleted file mode 100644 index 03ca6fcb31..0000000000 --- a/ext/tk/sample/demos-jp/doc.org/license.terms.tk80 +++ /dev/null @@ -1,39 +0,0 @@ -This software is copyrighted by the Regents of the University of -California, Sun Microsystems, Inc., and other parties. The following -terms apply to all files associated with the software unless explicitly -disclaimed in individual files. - -The authors hereby grant permission to use, copy, modify, distribute, -and license this software and its documentation for any purpose, provided -that existing copyright notices are retained in all copies and that this -notice is included verbatim in any distributions. No written agreement, -license, or royalty fee is required for any of the authorized uses. -Modifications to this software may be copyrighted by their authors -and need not follow the licensing terms described here, provided that -the new terms are clearly indicated on the first page of each file where -they apply. - -IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -MODIFICATIONS. - -GOVERNMENT USE: If you are acquiring this software on behalf of the -U.S. government, the Government shall have only "Restricted Rights" -in the software and related documentation as defined in the Federal -Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you -are acquiring the software on behalf of the Department of Defense, the -software shall be classified as "Commercial Computer Software" and the -Government shall have only "Restricted Rights" as defined in Clause -252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the -authors grant the U.S. Government and others acting in its behalf -permission to use and distribute the software in accordance with the -terms specified in this license. diff --git a/ext/tk/sample/demos-jp/entry1.rb b/ext/tk/sample/demos-jp/entry1.rb deleted file mode 100644 index 273b6728df..0000000000 --- a/ext/tk/sample/demos-jp/entry1.rb +++ /dev/null @@ -1,56 +0,0 @@ -# -# entry (no scrollbars) widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($entry1_demo) && $entry1_demo - $entry1_demo.destroy - $entry1_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$entry1_demo = TkToplevel.new {|w| - title("Entry Demonstration (no scrollbars)") - iconname("entry1") - positionWindow(w) -} - -# label À¸À® -msg = TkLabel.new($entry1_demo) { - font $font - wraplength '5i' - justify 'left' - text "3¼ïÎà¤Î°Û¤Ê¤ë¥¨¥ó¥È¥ê¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Ê¸»ú¤òÆþÎϤ¹¤ë¤Ë¤Ï¥Ý¥¤¥ó¥¿¤ò»ý¤Ã¤Æ¹Ô¤¡¢¥¯¥ê¥Ã¥¯¤·¤Æ¤«¤é¥¿¥¤¥×¤·¤Æ¤¯¤À¤µ¤¤¡£É¸½àŪ¤ÊMotif¤ÎÊÔ½¸µ¡Ç½¤¬¡¢Emacs¤Î¥¡¼¥Ð¥¤¥ó¥É¤È¤È¤â¤Ë¡¢¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Î㤨¤Ð¡¢¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤È¥³¥ó¥È¥í¡¼¥ë-H¤Ï¥«¡¼¥½¥ë¤Îº¸¤Îʸ»ú¤òºï½ü¤·¡¢¥Ç¥ê¡¼¥È¥¡¼¤È¥³¥ó¥È¥í¡¼¥ë-D¤Ï¥«¡¼¥½¥ë¤Î±¦Â¦¤Îʸ»ú¤òºï½ü¤·¤Þ¤¹¡£Ä¹²á¤®¤Æ¥¦¥£¥ó¥É¥¦¤ËÆþ¤êÀÚ¤é¤Ê¤¤¤â¤Î¤Ï¡¢¥Þ¥¦¥¹¤Î¥Ü¥¿¥ó2¤ò²¡¤·¤¿¤Þ¤Þ¥É¥é¥Ã¥°¤¹¤ë¤³¤È¤Ç¥¹¥¯¥í¡¼¥ë¤µ¤»¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ÆüËܸì¤òÆþÎϤ¹¤ë¤Î¤Ï¥³¥ó¥È¥í¡¼¥ë-¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤Ç¤¹¡£kinput2¤¬Æ°¤¤¤Æ¤¤¤ì¤ÐÆþÎϤ¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£" -} -msg.pack('side'=>'top') - -# frame À¸À® -TkFrame.new($entry1_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $entry1_demo - $entry1_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'entry1'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# entry À¸À® -e1 = TkEntry.new($entry1_demo, 'relief'=>'sunken') -e2 = TkEntry.new($entry1_demo, 'relief'=>'sunken') -e3 = TkEntry.new($entry1_demo, 'relief'=>'sunken') -[e1,e2,e3].each{|w| w.pack('side'=>'top', 'padx'=>10, 'pady'=>5, 'fill'=>'x')} - -# ½é´üÃÍÁÞÆþ -e1.insert(0, '½é´üÃÍ') -e2.insert('end', "¤³¤Î¥¨¥ó¥È¥ê¤Ë¤ÏŤ¤Ê¸»úÎ󤬯þ¤Ã¤Æ¤¤¤Æ¡¢") -e2.insert('end', "Ť¹¤®¤Æ¥¦¥£¥ó¥É¥¦¤Ë¤ÏÆþ¤êÀÚ¤é¤Ê¤¤¤Î¤Ç¡¢") -e2.insert('end', "¼ÂºÝ¤Î½ê½ª¤ê¤Þ¤Ç¸«¤ë¤Ë¤Ï¥¹¥¯¥í¡¼¥ë¤µ¤»¤Ê¤±¤ì¤Ð") -e2.insert('end', "¤Ê¤é¤Ê¤¤¤Ç¤·¤ç¤¦¡£") - diff --git a/ext/tk/sample/demos-jp/entry2.rb b/ext/tk/sample/demos-jp/entry2.rb deleted file mode 100644 index 7efac005f0..0000000000 --- a/ext/tk/sample/demos-jp/entry2.rb +++ /dev/null @@ -1,87 +0,0 @@ -# -# entry (with scrollbars) widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($entry2_demo) && $entry2_demo - $entry2_demo.destroy - $entry2_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$entry2_demo = TkToplevel.new {|w| - title("Entry Demonstration (with scrollbars)") - iconname("entry2") - positionWindow(w) -} - -# label À¸À® -msg = TkLabel.new($entry2_demo) { - font $font - wraplength '5i' - justify 'left' - text "3¼ïÎà¤Î°Û¤Ê¤ë¥¨¥ó¥È¥ê¤¬³Æ¡¹¥¹¥¯¥í¡¼¥ë¥Ð¡¼ÉÕ¤Çɽ¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Ê¸»ú¤òÆþÎϤ¹¤ë¤Ë¤Ï¥Ý¥¤¥ó¥¿¤ò»ý¤Ã¤Æ¹Ô¤¡¢¥¯¥ê¥Ã¥¯¤·¤Æ¤«¤é¥¿¥¤¥×¤·¤Æ¤¯¤À¤µ¤¤¡£É¸½àŪ¤ÊMotif¤ÎÊÔ½¸µ¡Ç½¤¬¡¢Emacs¤Î¥¡¼¥Ð¥¤¥ó¥É¤È¤È¤â¤Ë¡¢¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Î㤨¤Ð¡¢¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤È¥³¥ó¥È¥í¡¼¥ë-H¤Ï¥«¡¼¥½¥ë¤Îº¸¤Îʸ»ú¤òºï½ü¤·¡¢¥Ç¥ê¡¼¥È¥¡¼¤È¥³¥ó¥È¥í¡¼¥ë-D¤Ï¥«¡¼¥½¥ë¤Î±¦Â¦¤Îʸ»ú¤òºï½ü¤·¤Þ¤¹¡£Ä¹²á¤®¤Æ¥¦¥£¥ó¥É¥¦¤ËÆþ¤êÀÚ¤é¤Ê¤¤¤â¤Î¤Ï¡¢¥Þ¥¦¥¹¤Î¥Ü¥¿¥ó2¤ò²¡¤·¤¿¤Þ¤Þ¥É¥é¥Ã¥°¤¹¤ë¤³¤È¤Ç¥¹¥¯¥í¡¼¥ë¤µ¤»¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ÆüËܸì¤òÆþÎϤ¹¤ë¤Î¤Ï¥³¥ó¥È¥í¡¼¥ë-¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤Ç¤¹¡£kinput2¤¬Æ°¤¤¤Æ¤¤¤ì¤ÐÆþÎϤ¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£" -} -msg.pack('side'=>'top') - -# frame À¸À® -TkFrame.new($entry2_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $entry2_demo - $entry2_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'entry2'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame À¸À® -TkFrame.new($entry2_demo, 'borderwidth'=>10) {|w| - # entry 1 - s1 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz') - e1 = TkEntry.new(w, 'relief'=>'sunken') { - xscrollcommand proc{|first,last| s1.set first,last} - } - s1.command(proc{|*args| e1.xview(*args)}) - e1.pack('side'=>'top', 'fill'=>'x') - s1.pack('side'=>'top', 'fill'=>'x') - - # spacer - TkFrame.new(w, 'width'=>20, 'height'=>10).pack('side'=>'top', 'fill'=>'x') - - # entry 2 - s2 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz') - e2 = TkEntry.new(w, 'relief'=>'sunken') { - xscrollcommand proc{|first,last| s2.set first,last} - } - s2.command(proc{|*args| e2.xview(*args)}) - e2.pack('side'=>'top', 'fill'=>'x') - s2.pack('side'=>'top', 'fill'=>'x') - - # spacer - TkFrame.new(w, 'width'=>20, 'height'=>10).pack('side'=>'top', 'fill'=>'x') - - # entry 3 - s3 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz') - e3 = TkEntry.new(w, 'relief'=>'sunken') { - xscrollcommand proc{|first,last| s3.set first,last} - } - s3.command(proc{|*args| e3.xview(*args)}) - e3.pack('side'=>'top', 'fill'=>'x') - s3.pack('side'=>'top', 'fill'=>'x') - - # ½é´üÃÍÁÞÆþ - e1.insert(0, '½é´üÃÍ') - e2.insert('end', "¤³¤Î¥¨¥ó¥È¥ê¤Ë¤ÏŤ¤Ê¸»úÎ󤬯þ¤Ã¤Æ¤¤¤Æ¡¢") - e2.insert('end', "Ť¹¤®¤Æ¥¦¥£¥ó¥É¥¦¤Ë¤ÏÆþ¤êÀÚ¤é¤Ê¤¤¤Î¤Ç¡¢") - e2.insert('end', "¼ÂºÝ¤Î½ê½ª¤ê¤Þ¤Ç¸«¤ë¤Ë¤Ï¥¹¥¯¥í¡¼¥ë¤µ¤»¤Ê¤±¤ì¤Ð") - e2.insert('end', "¤Ê¤é¤Ê¤¤¤Ç¤·¤ç¤¦¡£") - -}.pack('side'=>'top', 'fill'=>'x', 'expand'=>'yes') - diff --git a/ext/tk/sample/demos-jp/entry3.rb b/ext/tk/sample/demos-jp/entry3.rb deleted file mode 100644 index 9bf3f62097..0000000000 --- a/ext/tk/sample/demos-jp/entry3.rb +++ /dev/null @@ -1,202 +0,0 @@ -# entry3.rb -- -# -# This demonstration script creates several entry widgets whose -# permitted input is constrained in some way. It also shows off a -# password entry. -# -# based on Tcl/Tk8.4.4 widget demos - -if defined?($entry3_demo) && $entry3_demo - $entry3_demo.destroy - $entry3_demo = nil -end - -$entry3_demo = TkToplevel.new {|w| - title("Constrained Entry Demonstration") - iconname("entry3") - positionWindow(w) -} - -TkLabel.new($entry3_demo, - :font=>$font, :wraplength=>'5i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) -°Ê²¼¤Ë¤Ï£´¼ïÎà¤Î¥¨¥ó¥È¥ê¥Ü¥Ã¥¯¥¹¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡¥³Æ¥¨¥ó¥È¥ê¥Ü¥Ã¥¯¥¹¤Ï¡¤\ -¥Þ¥¦¥¹¥¯¥ê¥Ã¥¯¤ÇÁªÂò¤·Ê¸»ú¤òÂǤÁ¹þ¤à¤³¤È¤¬²Äǽ¤Ç¤¹¤¬¡¤¤½¤ì¤¾¤ì¤¬¤É¤Î¤è¤¦¤Ê\ -ÆþÎϤò¼õ¤±ÉÕ¤±¤ë¤³¤È¤¬¤Ç¤¤ë¤«¤Ë¤ÏÀ©Ìó¤¬Àߤ±¤é¤ì¤Æ¤¤¤Þ¤¹¡¥\ -°ì¤Ä¤á¤Î¥¨¥ó¥È¥ê¥Ü¥Ã¥¯¥¹¤ÏÀ°¿ô¤È¸«¤Ê¤µ¤ì¤ëʸ»úÎ󤫯þÎÏʸ»ú¤¬¤Ê¤¤¶õ¤Î¾õÂÖ¤«\ -¤Î¾ì¹ç¤À¤±¤ò¼õ¤±ÉÕ¤±¡¤ÌäÂ꤬¤¢¤ë¾ì¹ç¤Ï¥¨¥ó¥È¥ê¥Ü¥Ã¥¯¥¹¤¬ÅÀÌǤ·¤Þ¤¹\ -¡Ê¥Õ¥©¡¼¥«¥¹¤¬µî¤ë»þ¤Ë¥Á¥§¥Ã¥¯¤µ¤ì¤Þ¤¹¡Ë¡¥\ -Æó¤Ä¤á¤Î¥¨¥ó¥È¥ê¥Ü¥Ã¥¯¥¹¤Ï¡¤ÆþÎϤµ¤ì¤¿Ê¸»úÎó¤ÎŤµ¤¬\ -£±£°Ê¸»ṳ́Ëþ¤Î¾ì¹ç¤À¤±¤ò¼õ¤±ÉÕ¤±¡¤À©¸Â¤ò±Û¤¨¤Æ½ñ¤¹þ¤â¤¦¤È¤·¤¿¤È¤¤Ë¤Ï\ -¥Ù¥ë¤òÌĤ餷¤ÆÃΤ餻¤Þ¤¹¡¥\ -»°¤Ä¤á¤ÏÊÆ¹ñ¤ÎÅÅÏÃÈÖ¹æ¤ò¼õ¤±ÉÕ¤±¤ë¥¨¥ó¥È¥ê¥Ü¥Ã¥¯¥¹¤Ç¤¹¡¥\ -¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤Ï¡¤ÅÅÏõ¡¤Î¥À¥¤¥ä¥ë¾å¤ÇÂбþ¤Å¤±¤é¤ì¤Æ¤¤¤ë¿ô»ú¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡¥\ -ÉÔŬÀÚ¤Êʸ»ú¤¬ÆþÎϤµ¤ì¤¿¤ê¿ô»ú°Ê³°¤Îʸ»ú¤Î°ÌÃ֤˿ô»ú¤òÆþÎϤ·¤è¤¦¤È¤·¤¿¤ê\ -¤·¤¿¾ì¹ç¤Ë¤Ï·Ù¹ð¤Î¥Ù¥ë¤¬ÌĤê¤Þ¤¹¡¥\ -»Í¤Ä¤á¤Î¥¨¥ó¥È¥ê¥Ü¥Ã¥¯¥¹¤Ï¡¤£¸Ê¸»ú¤Þ¤Ç¤ÎÆþÎϤò¼õ¤±ÉÕ¤±¤ë\ -¥Ñ¥¹¥ï¡¼¥É¥Õ¥£¡¼¥ë¥É¤Ç¤¹¡Ê£¸Ê¸»ú°Ê¾å¤ÏÆÃ¤Ë·Ù¹ð¤ò½Ð¤¹¤³¤È¤Ê¤¯Ìµ»ë¤µ¤ì¤Þ¤¹¡Ë¡¥\ -ÆþÎϤµ¤ì¤¿Ê¸»ú¤Ï¥¢¥¹¥¿¥ê¥¹¥¯µ¹æ¤ËÃÖ¤´¹¤¨¤ÆÉ½¼¨¤µ¤ì¤Þ¤¹¡¥ -EOL - -TkFrame.new($entry3_demo){|f| - pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - - TkButton.new(f, :text=>'λ²ò', :width=>15, :command=>proc{ - $entry3_demo.destroy - $entry3_demo = nil - }).pack(:side=>:left, :expand=>true) - - TkButton.new(f, :text=>'¥³¡¼¥É»²¾È', :width=>15, :command=>proc{ - showCode 'entry3' - }).pack(:side=>:left, :expand=>true) -} - -# focusAndFlash -- -# Error handler for entry widgets that forces the focus onto the -# widget and makes the widget flash by exchanging the foreground and -# background colours at intervals of 200ms (i.e. at approximately -# 2.5Hz). -# -# Arguments: -# widget - entry widget to flash -# fg - Initial foreground colour -# bg - Initial background colour -# count - Counter to control the number of times flashed -def focusAndFlash(widget, fg, bg, count=5) - return if count <= 0 - TkTimer.new(200, count, - proc{widget.configure(:foreground=>bg, :background=>fg)}, - proc{widget.configure(:foreground=>fg, :background=>bg)} - ).start - widget.focus(true) -end - -l1 = TkLabelFrame.new($entry3_demo, :text=>"À°¿ô¥¨¥ó¥È¥ê") -TkEntry.new(l1, :validate=>:focus, - :vcmd=>[ - proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P' - ]) {|e| - invalidcommand [proc{|w| focusAndFlash(w, e.fg, e.bg)}, '%W'] - pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') -} - -l2 = TkLabelFrame.new($entry3_demo, :text=>"ŤµÀ©ÌóÉÕ¤¥¨¥ó¥È¥ê") -TkEntry.new(l2, :validate=>:key, :invcmd=>proc{Tk.bell}, - :vcmd=>[proc{|s| s.length < 10}, '%P'] - ).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') - -### PHONE NUMBER ENTRY ### -# Note that the source to this is quite a bit longer as the behaviour -# demonstrated is a lot more ambitious than with the others. - -# Initial content for the third entry widget -entry3content = TkVariable.new("1-(000)-000-0000") - -# Mapping from alphabetic characters to numbers. -$phoneNumberMap = {} -Hash[*(%w(abc 2 def 3 ghi 4 jkl 5 mno 6 pqrs 7 tuv 8 wxyz 9))].each{|chars, n| - chars.split('').each{|c| - $phoneNumberMap[c] = n - $phoneNumberMap[c.upcase] = n - } -} - -# phoneSkipLeft -- -# Skip over fixed characters in a phone-number string when moving left. -# -# Arguments: -# widget - The entry widget containing the phone-number. -def phoneSkipLeft(widget) - idx = widget.index('insert') - if idx == 8 - # Skip back two extra characters - widget.cursor = idx - 2 - elsif idx == 7 || idx == 12 - # Skip back one extra character - widget.cursor = idx - 1 - elsif idx <= 3 - # Can't move any further - Tk.bell - Tk.callback_break - end -end - -# phoneSkipRight -- -# Skip over fixed characters in a phone-number string when moving right. -# -# Arguments: -# widget - The entry widget containing the phone-number. -# add - Offset to add to index before calculation (used by validation.) -def phoneSkipRight(widget, add = 0) - idx = widget.index('insert') - if (idx + add == 5) - # Skip forward two extra characters - widget.cursor = idx + 2 - elsif (idx + add == 6 || idx + add == 10) - # Skip forward one extra character - widget.cursor = idx + 1 - elsif (idx + add == 15 && add == 0) - # Can't move any further - Tk.bell - Tk.callback_break - end -end - -# validatePhoneChange -- -# Checks that the replacement (mapped to a digit) of the given -# character in an entry widget at the given position will leave a -# valid phone number in the widget. -# -# widget - entry widget to validate -# vmode - The widget's validation mode -# idx - The index where replacement is to occur -# char - The character (or string, though that will always be -# refused) to be overwritten at that point. - -def validatePhoneChange(widget, vmode, idx, char) - return true if idx == nil - Tk.after_idle(proc{widget.configure(:validate=>vmode, - :invcmd=>proc{Tk.bell})}) - if !(idx<3 || idx==6 || idx==7 || idx==11 || idx>15) && char =~ /[0-9A-Za-z]/ - widget.delete(idx) - widget.insert(idx, $phoneNumberMap[char] || char) - Tk.after_idle(proc{phoneSkipRight(widget, -1)}) - return true - end - return false -end - - -l3 = TkLabelFrame.new($entry3_demo, :text=>"ÊÆ¹ñÅÅÏÃÈֹ楨¥ó¥È¥ê") -TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell}, - :textvariable=>entry3content, - :vcmd=>[ - proc{|w,v,i,s| validatePhoneChange(w,v,i,s)}, - "%W %v %i %S" - ]){|e| - # Click to focus goes to the first editable character... - bind('FocusIn', proc{|d,w| - if d != "NotifyAncestor" - w.cursor = 3 - Tk.after_idle(proc{w.selection_clear}) - end - }, '%d %W') - bind('Left', proc{|w| phoneSkipLeft(w)}, '%W') - bind('Right', proc{|w| phoneSkipRight(w)}, '%W') - pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') -} - -l4 = TkLabelFrame.new($entry3_demo, :text=>"¥Ñ¥¹¥ï¡¼¥É¥¨¥ó¥È¥ê") -TkEntry.new(l4, :validate=>:key, :show=>'*', - :vcmd=>[ - proc{|s| s.length <= 8}, - '%P' - ]).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') - -TkFrame.new($entry3_demo){|f| - lower - TkGrid.configure(l1, l2, :in=>f, :padx=>'3m', :pady=>'1m', :sticky=>:ew) - TkGrid.configure(l3, l4, :in=>f, :padx=>'3m', :pady=>'1m', :sticky=>:ew) - TkGrid.columnconfigure(f, [0,1], :uniform=>1) - pack(:fill=>:both, :expand=>true) -} diff --git a/ext/tk/sample/demos-jp/filebox.rb b/ext/tk/sample/demos-jp/filebox.rb deleted file mode 100644 index 1754596706..0000000000 --- a/ext/tk/sample/demos-jp/filebox.rb +++ /dev/null @@ -1,95 +0,0 @@ -# -# widget demo prompts the user to select a file (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($filebox_demo) && $entry2_demo - $filebox_demo.destroy - $filebox_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$filebox_demo = TkToplevel.new {|w| - title("File Selection Dialogs") - iconname("filebox") - positionWindow(w) -} - -# label À¸À® -TkLabel.new($filebox_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left', - 'text'=>"¥¨¥ó¥È¥ê¤Ë¥Õ¥¡¥¤¥ë̾¤òľÀÜÆþÎϤ¹¤ë¤«¡¢\"Browse\" ¥Ü¥¿¥ó¤ò²¡¤·¤Æ¥Õ¥¡¥¤¥ëÁªÂò¥À¥¤¥¢¥í¥°¤«¤é¥Õ¥¡¥¤¥ë̾¤òÁª¤ó¤Ç²¼¤µ¤¤¡£").pack('side'=>'top') - -# frame À¸À® -TkFrame.new($filebox_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $filebox_demo - $filebox_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'filebox'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame À¸À® -['³«¤¯', 'Êݸ'].each{|type| - TkFrame.new($filebox_demo) {|f| - TkLabel.new(f, 'text'=>"¥Õ¥¡¥¤¥ë¤ò#{type}: ", 'anchor'=>'e')\ - .pack('side'=>'left') - - TkEntry.new(f, 'width'=>20) {|e| - pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x') - - TkButton.new(f, 'text'=>'Browse ...', - 'command'=>proc{fileDialog $filebox_demo,e,type})\ - .pack('side'=>'left') - } - - pack('fill'=>'x', 'padx'=>'1c', 'pady'=>3) - } -} - -$tk_strictMotif = TkVarAccess.new('tk_strictMotif') -if ($tk_platform['platform'] == 'unix') - TkCheckButton.new($filebox_demo, - 'text'=>'Motif¥¹¥¿¥¤¥ë¤Î¥À¥¤¥¢¥í¥°¤òÍѤ¤¤ë', - 'variable'=>$tk_strictMotif, - 'onvalue'=>1, 'offvalue'=>0 ).pack('anchor'=>'c') -end - -def fileDialog(w,ent,operation) - # Type names Extension(s) Mac File Type(s) - # - #-------------------------------------------------------- - types = [ - ['Text files', ['.txt','.doc'] ], - ['Text files', [], 'TEXT' ], - ['Ruby Scripts', ['.rb'], 'TEXT' ], - ['Tcl Scripts', ['.tcl'], 'TEXT' ], - ['C Source Files', ['.c','.h'] ], - ['All Source Files', ['.rb','.tcl','.c','.h'] ], - ['Image Files', ['.gif'] ], - ['Image Files', ['.jpeg','.jpg'] ], - ['Image Files', [], ['GIFF','JPEG']], - ['All files', '*' ] - ] - - if operation == '³«¤¯' - file = Tk.getOpenFile('filetypes'=>types, 'parent'=>w) - else - file = Tk.getSaveFile('filetypes'=>types, 'parent'=>w, - 'initialfile'=>'Untitled', - 'defaultextension'=>'.txt') - end - if file != "" - ent.delete 0, 'end' - ent.insert 0, file - ent.xview 'end' - end -end - diff --git a/ext/tk/sample/demos-jp/floor.rb b/ext/tk/sample/demos-jp/floor.rb deleted file mode 100644 index bb655d5b55..0000000000 --- a/ext/tk/sample/demos-jp/floor.rb +++ /dev/null @@ -1,1717 +0,0 @@ -# -# floorDisplay widget demo (called by 'widget') -# - -# floorDisplay -- -# Recreate the floorplan display in the canvas given by "w". The -# floor given by "active" is displayed on top with its office structure -# visible. -# -# Arguments: -# w - Name of the canvas window. -# active - Number of active floor (1, 2, or 3). - -def floorDisplay(w,active) - return if $activeFloor == active - - w.delete('all') - $activeFloor = active - - # First go through the three floors, displaying the backgrounds for - # each floor. - - floor_bg1(w,$floor_colors['bg1'],$floor_colors['outline1']) - floor_bg2(w,$floor_colors['bg2'],$floor_colors['outline2']) - floor_bg3(w,$floor_colors['bg3'],$floor_colors['outline3']) - - # Raise the background for the active floor so that it's on top. - - w.raise("floor#{active}") - - # Create a dummy item just to mark this point in the display list, - # so we can insert highlights here. - - TkcRectangle.new(w,0,100,1,101, 'fill'=>'', 'outline'=>'', 'tags'=>'marker') - - # Add the walls and labels for the active floor, along with - # transparent polygons that define the rooms on the floor. - # Make sure that the room polygons are on top. - - $floorLabels.clear - $floorItems.clear - send("floor_fg#{active}", w, $floor_colors['offices']) - w.raise('room') - - # Offset the floors diagonally from each other. - - w.move('floor1', '2c', '2c') - w.move('floor2', '1c', '1c') - - # Create items for the room entry and its label. - TkcWindow.new(w, 600, 100, 'anchor'=>'w', 'window'=>$floor_entry) - TkcText.new(w, 600, 100, 'anchor'=>'e', 'text'=>"Éô²°ÈÖ¹æ: ") - w['scrollregion'] = w.bbox('all') -end - -# newRoom -- -# This method is invoked whenever the mouse enters a room -# in the floorplan. It changes tags so that the current room is -# highlighted. -# -# Arguments: -# w - The name of the canvas window. - -def newRoom(w) - id = w.find_withtag('current')[0] - $currentRoom.value = $floorLabels[id.id] if id != "" - Tk.update(true) -end - -# roomChanged -- -# This method is invoked whenever the currentRoom variable changes. -# It highlights the current room and unhighlights any previous room. -# -# Arguments: -# w - The canvas window displaying the floorplan. -# args - Not used. - -def roomChanged(w,*args) - w.delete('highlight') - item = $floorItems[$currentRoom.value] - return if item == nil - new = TkcPolygon.new(w, *(w.coords(item))) - new.configure('fill'=>$floor_colors['active'], 'tags'=>'highlight') - w.raise(new, 'marker') -end - -# floor_bg1 -- -# This method represents part of the floorplan database. When -# invoked, it instantiates the background information for the first -# floor. -# -# Arguments: -# w - The canvas window. -# fill - Fill color to use for the floor's background. -# outline - Color to use for the floor's outline. - -def floor_bg1(w,fill,outline) - TkcPolygon.new(w,347,80,349,82,351,84,353,85,363,92,375,99,386,104, - 386,129,398,129,398,162,484,162,484,129,559,129,559,133,725, - 133,725,129,802,129,802,389,644,389,644,391,559,391,559,327, - 508,327,508,311,484,311,484,278,395,278,395,288,400,288,404, - 288,409,290,413,292,418,297,421,302,422,309,421,318,417,325, - 411,330,405,332,397,333,344,333,340,334,336,336,335,338,332, - 342,331,347,332,351,334,354,336,357,341,359,340,360,335,363, - 331,365,326,366,304,366,304,355,258,355,258,387,60,387,60,391, - 0,391,0,337,3,337,3,114,8,114,8,25,30,25,30,5,93,5,98,5,104,7, - 110,10,116,16,119,20,122,28,123,32,123,68,220,68,220,34,221, - 22,223,17,227,13,231,8,236,4,242,2,246,0,260,0,283,1,300,5, - 321,14,335,22,348,25,365,29,363,39,358,48,352,56,337,70, - 344,76,347,80, 'tags'=>['floor1','bg'], 'fill'=>fill) - TkcLine.new(w,386,129,398,129, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,258,355,258,387, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,60,387,60,391, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,0,337,0,391, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,60,391,0,391, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,3,114,3,337, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,258,387,60,387, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,484,162,398,162, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,398,162,398,129, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,484,278,484,311, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,484,311,508,311, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,508,327,508,311, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,559,327,508,327, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,644,391,559,391, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,644,389,644,391, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,559,129,484,129, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,484,162,484,129, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,725,133,559,133, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,559,129,559,133, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,725,129,802,129, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,802,389,802,129, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,3,337,0,337, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,559,391,559,327, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,802,389,644,389, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,725,133,725,129, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,8,25,8,114, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,8,114,3,114, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,30,25,8,25, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,484,278,395,278, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,30,25,30,5, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,93,5,30,5, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,98,5,93,5, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,104,7,98,5, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,110,10,104,7, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,116,16,110,10, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,119,20,116,16, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,122,28,119,20, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,123,32,122,28, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,123,68,123,32, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,220,68,123,68, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,386,129,386,104, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,386,104,375,99, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,375,99,363,92, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,353,85,363,92, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,220,68,220,34, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,337,70,352,56, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,352,56,358,48, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,358,48,363,39, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,363,39,365,29, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,365,29,348,25, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,348,25,335,22, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,335,22,321,14, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,321,14,300,5, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,300,5,283,1, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,283,1,260,0, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,260,0,246,0, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,246,0,242,2, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,242,2,236,4, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,236,4,231,8, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,231,8,227,13, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,223,17,227,13, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,221,22,223,17, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,220,34,221,22, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,340,360,335,363, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,335,363,331,365, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,331,365,326,366, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,326,366,304,366, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,304,355,304,366, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,395,288,400,288, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,404,288,400,288, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,409,290,404,288, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,413,292,409,290, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,418,297,413,292, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,421,302,418,297, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,422,309,421,302, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,421,318,422,309, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,421,318,417,325, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,417,325,411,330, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,411,330,405,332, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,405,332,397,333, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,397,333,344,333, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,344,333,340,334, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,340,334,336,336, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,336,336,335,338, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,335,338,332,342, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,331,347,332,342, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,332,351,331,347, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,334,354,332,351, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,336,357,334,354, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,341,359,336,357, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,341,359,340,360, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,395,288,395,278, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,304,355,258,355, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,347,80,344,76, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,344,76,337,70, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,349,82,347,80, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,351,84,349,82, 'fill'=>outline, 'tags'=>['floor1','bg']) - TkcLine.new(w,353,85,351,84, 'fill'=>outline, 'tags'=>['floor1','bg']) -end - -# floor_bg2 -- -# This method represents part of the floorplan database. When -# invoked, it instantiates the background information for the first -# floor. -# -# Arguments: -# w - The canvas window. -# fill - Fill color to use for the floor's background. -# outline - Color to use for the floor's outline. - -def floor_bg2(w,fill,outline) - TkcPolygon.new(w,559,129,484,129,484,162,398,162,398,129,315,129, - 315,133,176,133,176,129,96,129,96,133,3,133,3,339,0,339,0,391, - 60,391,60,387,258,387,258,329,350,329,350,311,395,311,395,280, - 484,280,484,311,508,311,508,327,558,327,558,391,644,391,644, - 367,802,367,802,129,725,129,725,133,559,133,559,129, - 'tags'=>['floor2','bg'], 'fill'=>fill) - TkcLine.new(w,350,311,350,329, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,398,129,398,162, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,802,367,802,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,802,129,725,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,725,133,725,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,559,129,559,133, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,559,133,725,133, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,484,162,484,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,559,129,484,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,802,367,644,367, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,644,367,644,391, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,644,391,558,391, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,558,327,558,391, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,558,327,508,327, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,508,327,508,311, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,484,311,508,311, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,484,280,484,311, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,398,162,484,162, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,484,280,395,280, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,395,280,395,311, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,258,387,60,387, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,3,133,3,339, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,3,339,0,339, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,60,391,0,391, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,0,339,0,391, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,60,387,60,391, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,258,329,258,387, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,350,329,258,329, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,395,311,350,311, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,398,129,315,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,176,133,315,133, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,176,129,96,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,3,133,96,133, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,315,133,315,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,176,133,176,129, 'fill'=>outline, 'tags'=>['floor2','bg']) - TkcLine.new(w,96,133,96,129, 'fill'=>outline, 'tags'=>['floor2','bg']) -end - -# floor_bg3 -- -# This method represents part of the floorplan database. When -# invoked, it instantiates the background information for the first -# floor. -# -# Arguments: -# w - The canvas window. -# fill - Fill color to use for the floor's background. -# outline - Color to use for the floor's outline. - -def floor_bg3(w,fill,outline) - TkcPolygon.new(w,159,300,107,300,107,248,159,248,159,129,96,129,96, - 133,21,133,21,331,0,331,0,391,60,391,60,370,159,370,159,300, - 'tags'=>['floor3','bg'], 'fill'=>fill) - TkcPolygon.new(w,258,370,258,329,350,329,350,311,399,311,399,129, - 315,129,315,133,176,133,176,129,159,129,159,370,258,370, - 'tags'=>['floor3','bg'], 'fill'=>fill) - TkcLine.new(w,96,133,96,129, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,176,129,96,129, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,176,129,176,133, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,315,133,176,133, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,315,133,315,129, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,399,129,315,129, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,399,311,399,129, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,399,311,350,311, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,350,329,350,311, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,350,329,258,329, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,258,370,258,329, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,60,370,258,370, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,60,370,60,391, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,60,391,0,391, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,0,391,0,331, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,21,331,0,331, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,21,331,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,96,133,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,107,300,159,300,159,248,107,248,107,300, - 'fill'=>outline, 'tags'=>['floor3','bg']) -end - -# floor_fg1 -- -# This method represents part of the floorplan database. When -# invoked, it instantiates the foreground information for the first -# floor (office outlines and numbers). -# -# Arguments: -# w - The canvas window. -# color - Color to use for drawing foreground information. - -def floor_fg1(w,color) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '101' - $floorItems['101'] = i - TkcText.new(w,358,209, 'text'=>'101', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'Pub Lift1' - $floorItems['Pub Lift1'] = i - TkcText.new(w,323,223, 'text'=>'Pub Lift1', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'Priv Lift1' - $floorItems['Priv Lift1'] = i - TkcText.new(w,323,188, 'text'=>'Priv Lift1', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,42,389,42,337,1,337,1,389, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '110' - $floorItems['110'] = i - TkcText.new(w,21.5,363, 'text'=>'110', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '109' - $floorItems['109'] = i - TkcText.new(w,67,363, 'text'=>'109', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,300,51,253,6,253,6,300, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '111' - $floorItems['111'] = i - TkcText.new(w,28.5,276.5, 'text'=>'111', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,98,248,98,309,79,309,79,248, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '117B' - $floorItems['117B'] = i - TkcText.new(w,88.5,278.5, 'text'=>'117B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,251,51,204,6,204,6,251, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '112' - $floorItems['112'] = i - TkcText.new(w,28.5,227.5, 'text'=>'112', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,6,156,51,156,51,203,6,203, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '113' - $floorItems['113'] = i - TkcText.new(w,28.5,179.5, 'text'=>'113', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,85,169,79,169,79,192,85,192, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '117A' - $floorItems['117A'] = i - TkcText.new(w,82,180.5, 'text'=>'117A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,77,302,77,168,53,168,53,302, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '117' - $floorItems['117'] = i - TkcText.new(w,65,235, 'text'=>'117', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,155,51,115,6,115,6,155, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '114' - $floorItems['114'] = i - TkcText.new(w,28.5,135, 'text'=>'114', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,95,115,53,115,53,168,95,168, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '115' - $floorItems['115'] = i - TkcText.new(w,74,141.5, 'text'=>'115', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,87,113,87,27,10,27,10,113, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '116' - $floorItems['116'] = i - TkcText.new(w,48.5,70, 'text'=>'116', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,89,91,128,91,128,113,89,131, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '118' - $floorItems['118'] = i - TkcText.new(w,108.5,102, 'text'=>'118', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,178,128,178,132,216,132,216,91, - 163,91,163,112,149,112,149,128, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '120' - $floorItems['120'] = i - TkcText.new(w,189.5,111.5, 'text'=>'120', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,79,193,87,193,87,169,136,169,136,192, - 156,192,156,169,175,169,175,246,79,246, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '122' - $floorItems['122'] = i - TkcText.new(w,131,207.5, 'text'=>'122', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,138,169,154,169,154,191,138,191, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '121' - $floorItems['121'] = i - TkcText.new(w,146,180, 'text'=>'121', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,99,300,126,300,126,309,99,309, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '106A' - $floorItems['106A'] = i - TkcText.new(w,112.5,304.5, 'text'=>'106A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '105' - $floorItems['105'] = i - TkcText.new(w,124.5,278.5, 'text'=>'105', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,174,309,174,300,152,300,152,309, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '106B' - $floorItems['106B'] = i - TkcText.new(w,163,304.5, 'text'=>'106B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '104' - $floorItems['104'] = i - TkcText.new(w,184,278.5, 'text'=>'104', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,138,385,138,337,91,337,91,385, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '108' - $floorItems['108'] = i - TkcText.new(w,114.5,361, 'text'=>'108', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,256,337,140,337,140,385,256,385, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '107' - $floorItems['107'] = i - TkcText.new(w,198,361, 'text'=>'107', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,300,353,300,329,260,329,260,353, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'Smoking' - $floorItems['Smoking'] = i - TkcText.new(w,280,341, 'text'=>'Smoking', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '123' - $floorItems['123'] = i - TkcText.new(w,245.5,190.5, 'text'=>'123', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '103' - $floorItems['103'] = i - TkcText.new(w,259,287, 'text'=>'103', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '124' - $floorItems['124'] = i - TkcText.new(w,356,150, 'text'=>'124', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '125' - $floorItems['125'] = i - TkcText.new(w,392,217.5, 'text'=>'125', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '126' - $floorItems['126'] = i - TkcText.new(w,436.5,185.5, 'text'=>'126', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,409,209,409,229,399,229,399,253, - 486,253,486,239,474,239,474,209, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '127' - $floorItems['127'] = i - TkcText.new(w,436.5,'231', 'text'=>'127', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,501,164,501,174,495,174,495,188, - 490,188,490,204,476,204,476,164, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'MShower' - $floorItems['MShower'] = i - TkcText.new(w,488.5,'184', 'text'=>'MShower', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'Closet' - $floorItems['Closet'] = i - TkcText.new(w,502.5,190, 'text'=>'Closet', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'WShower' - $floorItems['WShower'] = i - TkcText.new(w,494.5,230, 'text'=>'WShower', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,486,131,558,131,558,135,724,135,724,166, - 697,166,697,275,553,275,531,254,515,254, - 515,174,503,174,503,161,486,161, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '130' - $floorItems['130'] = i - TkcText.new(w,638.5,205, 'text'=>'130', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,308,242,339,242,339,248,342,248, - 342,246,397,246,397,276,393,276, - 393,309,300,309,300,248,308,248, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '102' - $floorItems['102'] = i - TkcText.new(w,367.5,278.5, 'text'=>'102', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,397,255,486,255,486,276,397,276, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '128' - $floorItems['128'] = i - TkcText.new(w,441.5,265.5, 'text'=>'128', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,510,309,486,309,486,255,530,255, - 552,277,561,277,561,325,510,325, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '129' - $floorItems['129'] = i - TkcText.new(w,535.5,293, 'text'=>'129', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,696,281,740,281,740,387,642,387, - 642,389,561,389,561,277,696,277, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '133' - $floorItems['133'] = i - TkcText.new(w,628.5,335, 'text'=>'133', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,742,387,742,281,800,281,800,387, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '132' - $floorItems['132'] = i - TkcText.new(w,771,334, 'text'=>'132', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,800,168,800,280,699,280,699,168, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '134' - $floorItems['134'] = i - TkcText.new(w,749.5,224, 'text'=>'134', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,726,131,726,166,800,166,800,131, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '135' - $floorItems['135'] = i - TkcText.new(w,763,148.5, 'text'=>'135', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,340,360,335,363,331,365,326,366,304,366, - 304,312,396,312,396,288,400,288,404,288, - 409,290,413,292,418,297,421,302,422,309, - 421,318,417,325,411,330,405,332,397,333, - 344,333,340,334,336,336,335,338,332,342, - 331,347,332,351,334,354,336,357,341,359, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'Ramona Stair' - $floorItems['Ramona Stair'] = i - TkcText.new(w,368,323, 'text'=>'Ramona Stair', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,30,23,30,5,93,5,98,5,104,7,110,10,116,16,119,20, - 122,28,123,32,123,68,220,68,220,87,90,87,90,23, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'University Stair' - $floorItems['University Stair'] = i - TkcText.new(w,155,77.5, 'text'=>'University Stair', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,282,37,295,40,312,49,323,56,337,70,352,56, - 358,48,363,39,365,29,348,25,335,22,321,14, - 300,5,283,1,260,0,246,0,242,2,236,4,231,8, - 227,13,223,17,221,22,220,34,260,34, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'Plaza Stair' - $floorItems['Plaza Stair'] = i - TkcText.new(w,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,220,34,260,34,282,37,295,40,312,49, - 323,56,337,70,350,83,365,94,377,100, - 386,104,386,128,220,128, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = 'Plaza Deck' - $floorItems['Plaza Deck'] = i - TkcText.new(w,303,81, 'text'=>'Plaza Deck', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,257,336,77,336,6,336,6,301,77,301,77,310,257,310, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '106' - $floorItems['106'] = i - TkcText.new(w,131.5,318.5, 'text'=>'106', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,146,110,162,110,162,91,130,91,130,115,95,115, - 95,128,114,128,114,151,157,151,157,153,112,153, - 112,130,97,130,97,168,175,168,175,131,146,131, - 'fill'=>'', 'tags'=>['floor1','room']) - $floorLabels[i.id] = '119' - $floorItems['119'] = i - TkcText.new(w,143.5,133, 'text'=>'119', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor1','label']) - TkcLine.new(w,155,191,155,189, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,155,177,155,169, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,96,129,96,169, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,78,169,176,169, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,176,247,176,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,340,206,307,206, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,340,187,340,170, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,340,210,340,201, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,340,247,340,224, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,340,241,307,241, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,376,246,376,170, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,307,247,307,170, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,376,170,307,170, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,315,129,315,170, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,147,129,176,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,202,133,176,133, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,398,129,315,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,258,352,258,387, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,60,387,60,391, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,0,337,0,391, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,60,391,0,391, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,3,114,3,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,258,387,60,387, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,237,52,273, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,189,52,225, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,140,52,177, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,395,306,395,311, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,531,254,398,254, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,475,178,475,238, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,502,162,398,162, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,398,129,398,188, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,383,188,376,188, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,408,188,408,194, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,398,227,398,254, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,408,227,398,227, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,408,222,408,227, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,408,206,408,210, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,408,208,475,208, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,484,278,484,311, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,484,311,508,311, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,508,327,508,311, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,559,327,508,327, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,644,391,559,391, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,644,389,644,391, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,514,205,475,205, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,496,189,496,187, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,559,129,484,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,484,162,484,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,725,133,559,133, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,559,129,559,133, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,725,149,725,167, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,725,129,802,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,802,389,802,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,739,167,802,167, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,396,188,408,188, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,0,337,9,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,58,337,21,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,43,391,43,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,105,337,75,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,91,387,91,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,154,337,117,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,139,387,139,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,227,337,166,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,258,337,251,337, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,258,328,302,328, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,302,355,302,311, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,395,311,302,311, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,484,278,395,278, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,395,294,395,278, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,473,278,473,275, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,473,256,473,254, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,533,257,531,254, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,553,276,551,274, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,698,276,553,276, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,559,391,559,327, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,802,389,644,389, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,741,314,741,389, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,698,280,698,167, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,707,280,698,280, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,802,280,731,280, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,741,280,741,302, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,698,167,727,167, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,725,137,725,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,514,254,514,175, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,496,175,514,175, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,502,175,502,162, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,475,166,475,162, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,496,176,496,175, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,491,189,496,189, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,491,205,491,189, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,487,238,475,238, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,487,240,487,238, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,487,252,487,254, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,315,133,304,133, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,256,133,280,133, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,78,247,270,247, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,307,247,294,247, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,214,133,232,133, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,217,247,217,266, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,217,309,217,291, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,217,309,172,309, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,154,309,148,309, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,175,300,175,309, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,151,300,175,300, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,151,247,151,309, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,78,237,78,265, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,78,286,78,309, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,106,309,78,309, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,130,309,125,309, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,99,309,99,247, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,127,299,99,299, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,127,309,127,299, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,155,191,137,191, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,137,169,137,191, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,78,171,78,169, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,78,190,78,218, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,86,192,86,169, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,86,192,78,192, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,301,3,301, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,286,52,301, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,252,3,252, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,203,3,203, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,3,156,52,156, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,8,25,8,114, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,63,114,3,114, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,75,114,97,114, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,108,114,129,114, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,129,114,129,89, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,52,114,52,128, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,132,89,88,89, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,88,25,88,89, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,88,114,88,89, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,218,89,144,89, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,147,111,147,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,162,111,147,111, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,162,109,162,111, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,162,96,162,89, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,218,89,218,94, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,218,89,218,119, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,8,25,88,25, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,258,337,258,328, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,113,129,96,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,302,355,258,355, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,386,104,386,129, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,377,100,386,104, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,365,94,377,100, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,350,83,365,94, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,337,70,350,83, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,337,70,323,56, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,312,49,323,56, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,295,40,312,49, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,282,37,295,40, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,260,34,282,37, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,253,34,260,34, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,386,128,386,104, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,113,152,156,152, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,113,152,156,152, 'fill'=>color, 'tags'=>['floor1','wall']) - TkcLine.new(w,113,152,113,129, 'fill'=>color, 'tags'=>['floor1','wall']) -end - -# floor_fg2 -- -# This method represents part of the floorplan database. When -# invoked, it instantiates the foreground information for the second -# floor (office outlines and numbers). -# -# Arguments: -# w - The canvas window. -# color - Color to use for drawing foreground information. - -def floor_fg2(w,color) - i = TkcPolygon.new(w,748,188,755,188,755,205,758,205,758,222, - 800,222,800,168,748,168, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '238' - $floorItems['238'] = i - TkcText.new(w,774,195, 'text'=>'238', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,726,188,746,188,746,166,800,166,800,131,726,131, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '237' - $floorItems['237'] = i - TkcText.new(w,763,148.5, 'text'=>'237', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,497,187,497,204,559,204,559,324,641,324, - 643,324,643,291,641,291,641,205,696,205, - 696,291,694,291,694,314,715,314,715,291, - 715,205,755,205,755,190,724,190,724,187, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '246' - $floorItems['246'] = i - TkcText.new(w,600,264, 'text'=>'246', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,694,279,643,279,643,314,694,314, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '247' - $floorItems['247'] = i - TkcText.new(w,668.5,296.5, 'text'=>'247', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,232,250,308,250,308,242,339,242,339,246, - 397,246,397,255,476,255,476,250,482,250,559,250, - 559,274,482,274,482,278,396,278,396,274,232,274, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '202' - $floorItems['202'] = i - TkcText.new(w,285.5,260, 'text'=>'202', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,53,228,53,338,176,338,233,338,233,196, - 306,196,306,180,175,180,175,169,156,169, - 156,196,176,196,176,228, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '206' - $floorItems['206'] = i - TkcText.new(w,143,267, 'text'=>'206', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,277,6,277,6,338,51,338, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '212' - $floorItems['212'] = i - TkcText.new(w,28.5,307.5, 'text'=>'212', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '245' - $floorItems['245'] = i - TkcText.new(w,521.5,300.5, 'text'=>'245', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,560,389,599,389,599,326,560,326, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '244' - $floorItems['244'] = i - TkcText.new(w,579.5,357.5, 'text'=>'244', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,601,389,601,326,643,326,643,389, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '243' - $floorItems['243'] = i - TkcText.new(w,622,357.5, 'text'=>'243', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,688,316,645,316,645,365,688,365, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '242' - $floorItems['242'] = i - TkcText.new(w,666.5,340.5, 'text'=>'242', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,802,367,759,367,759,226,802,226, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = 'Barbecue Deck' - $floorItems['Barbecue Deck'] = i - TkcText.new(w,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,262,755,314,717,314,717,262, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '240' - $floorItems['240'] = i - TkcText.new(w,736,288, 'text'=>'240', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,316,689,316,689,365,755,365, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '241' - $floorItems['241'] = i - TkcText.new(w,722,340.5, 'text'=>'241', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,206,717,206,717,261,755,261, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '239' - $floorItems['239'] = i - TkcText.new(w,736,233.5, 'text'=>'239', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,695,277,643,277,643,206,695,206, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '248' - $floorItems['248'] = i - TkcText.new(w,669,241.5, 'text'=>'248', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,676,135,676,185,724,185,724,135, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '236' - $floorItems['236'] = i - TkcText.new(w,700,160, 'text'=>'236', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '235' - $floorItems['235'] = i - TkcText.new(w,651.5,160, 'text'=>'235', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,626,143,633,143,633,135,572,135, - 572,143,579,143,579,185,626,185, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '234' - $floorItems['234'] = i - TkcText.new(w,606,160, 'text'=>'234', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,557,135,571,135,571,145,578,145, - 578,185,527,185,527,131,557,131, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '233' - $floorItems['233'] = i - TkcText.new(w,552.5,158, 'text'=>'233', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,476,249,557,249,557,205,476,205, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '230' - $floorItems['230'] = i - TkcText.new(w,516.5,227, 'text'=>'230', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '232' - $floorItems['232'] = i - TkcText.new(w,500.5,158, 'text'=>'232', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,476,186,495,186,495,204,476,204, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '229' - $floorItems['229'] = i - TkcText.new(w,485.5,195, 'text'=>'229', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '227' - $floorItems['227'] = i - TkcText.new(w,436.5,185.5, 'text'=>'227', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '228' - $floorItems['228'] = i - TkcText.new(w,436.5,231, 'text'=>'228', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '226' - $floorItems['226'] = i - TkcText.new(w,392,217.5, 'text'=>'226', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '225' - $floorItems['225'] = i - TkcText.new(w,356.5,150, 'text'=>'225', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,234,198,306,198,306,249,234,249, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '224' - $floorItems['224'] = i - TkcText.new(w,270,223.5, 'text'=>'224', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '223' - $floorItems['223'] = i - TkcText.new(w,292,157, 'text'=>'223', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,268,179,221,179,221,135,268,135, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '222' - $floorItems['222'] = i - TkcText.new(w,244.5,157, 'text'=>'222', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,177,179,219,179,219,135,177,135, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '221' - $floorItems['221'] = i - TkcText.new(w,198,157, 'text'=>'221', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '204' - $floorItems['204'] = i - TkcText.new(w,324,301.5, 'text'=>'204', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '205' - $floorItems['205'] = i - TkcText.new(w,265.5,307, 'text'=>'205', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,256,385,256,340,212,340,212,385, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '207' - $floorItems['207'] = i - TkcText.new(w,234,362.5, 'text'=>'207', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,210,340,164,340,164,385,210,385, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '208' - $floorItems['208'] = i - TkcText.new(w,187,362.5, 'text'=>'208', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,115,340,162,340,162,385,115,385, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '209' - $floorItems['209'] = i - TkcText.new(w,138.5,362.5, 'text'=>'209', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,228,89,156,53,156,53,228, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '217' - $floorItems['217'] = i - TkcText.new(w,71,192, 'text'=>'217', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,169,97,169,97,190,89,190, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '217A' - $floorItems['217A'] = i - TkcText.new(w,93,179.5, 'text'=>'217A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '216' - $floorItems['216'] = i - TkcText.new(w,71,145.5, 'text'=>'216', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,179,51,135,6,135,6,179, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '215' - $floorItems['215'] = i - TkcText.new(w,28.5,157, 'text'=>'215', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,227,6,227,6,180,51,180, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '214' - $floorItems['214'] = i - TkcText.new(w,28.5,203.5, 'text'=>'214', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,275,6,275,6,229,51,229, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '213' - $floorItems['213'] = i - TkcText.new(w,28.5,252, 'text'=>'213', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,114,340,67,340,67,385,114,385, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '210' - $floorItems['210'] = i - TkcText.new(w,90.5,362.5, 'text'=>'210', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '211' - $floorItems['211'] = i - TkcText.new(w,33,364.5, 'text'=>'211', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '203' - $floorItems['203'] = i - TkcText.new(w,367.5,292.5, 'text'=>'203', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,99,191,91,191,91,226,174,226,174,198, - 154,198,154,192,109,192,109,169,99,169, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '220' - $floorItems['220'] = i - TkcText.new(w,132.5,208.5, 'text'=>'220', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = 'Priv Lift2' - $floorItems['Priv Lift2'] = i - TkcText.new(w,323,188, 'text'=>'Priv Lift2', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = 'Pub Lift 2' - $floorItems['Pub Lift 2'] = i - TkcText.new(w,323,223, 'text'=>'Pub Lift 2', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '218' - $floorItems['218'] = i - TkcText.new(w,136,149.5, 'text'=>'218', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '219' - $floorItems['219'] = i - TkcText.new(w,132.5,180, 'text'=>'219', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, - 'fill'=>'', 'tags'=>['floor2','room']) - $floorLabels[i.id] = '201' - $floorItems['201'] = i - TkcText.new(w,358,209, 'text'=>'201', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor2','label']) - TkcLine.new(w,641,186,678,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,350,757,367, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,634,133,634,144, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,634,144,627,144, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,572,133,572,144, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,572,144,579,144, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,398,129,398,162, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,174,197,175,197, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,175,197,175,227, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,206,757,221, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,396,188,408,188, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,727,189,725,189, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,747,167,802,167, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,747,167,747,189, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,755,189,739,189, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,769,224,757,224, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,802,224,802,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,802,129,725,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,725,189,725,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,725,186,690,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,676,133,676,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,627,144,627,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,629,186,593,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,579,144,579,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,559,129,559,133, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,725,133,559,133, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,484,162,484,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,559,129,484,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,526,129,526,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,540,186,581,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,528,186,523,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,511,186,475,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,496,190,496,186, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,496,205,496,202, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,475,205,527,205, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,558,205,539,205, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,558,205,558,249, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,558,249,475,249, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,662,206,642,206, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,695,206,675,206, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,695,278,642,278, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,642,291,642,206, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,695,291,695,206, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,716,208,716,206, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,206,716,206, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,221,757,224, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,793,224,802,224, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,262,716,262, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,716,220,716,264, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,716,315,716,276, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,315,703,315, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,325,757,224, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,757,367,644,367, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,689,367,689,315, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,647,315,644,315, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,659,315,691,315, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,600,325,600,391, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,627,325,644,325, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,644,391,644,315, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,615,325,575,325, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,644,391,558,391, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,563,325,558,325, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,558,391,558,314, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,558,327,508,327, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,558,275,484,275, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,558,302,558,275, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,508,327,508,311, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,484,311,508,311, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,484,275,484,311, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,475,208,408,208, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,408,206,408,210, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,408,222,408,227, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,408,227,398,227, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,398,227,398,254, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,408,188,408,194, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,383,188,376,188, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,398,188,398,162, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,398,162,484,162, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,475,162,475,254, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,398,254,475,254, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,484,280,395,280, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,395,311,395,275, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,307,197,293,197, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,278,197,233,197, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,233,197,233,249, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,307,179,284,179, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,233,249,278,249, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,269,179,269,133, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,220,179,220,133, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,155,191,110,191, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,90,190,98,190, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,98,169,98,190, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,52,133,52,165, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,52,214,52,177, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,52,226,52,262, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,52,274,52,276, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,234,275,234,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,226,339,258,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,211,387,211,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,214,339,177,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,258,387,60,387, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,3,133,3,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,165,339,129,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,117,339,80,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,68,339,59,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,0,339,46,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,60,391,0,391, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,0,339,0,391, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,60,387,60,391, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,258,329,258,387, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,350,329,258,329, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,395,311,350,311, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,398,129,315,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,176,133,315,133, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,176,129,96,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,3,133,96,133, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,66,387,66,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,115,387,115,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,163,387,163,339, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,234,275,276,275, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,288,275,309,275, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,298,275,298,329, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,341,283,350,283, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,321,275,341,275, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,375,275,395,275, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,315,129,315,170, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,376,170,307,170, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,307,250,307,170, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,376,245,376,170, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,340,241,307,241, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,340,245,340,224, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,340,210,340,201, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,340,187,340,170, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,340,206,307,206, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,293,250,307,250, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,271,179,238,179, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,226,179,195,179, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,176,129,176,179, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,182,179,176,179, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,174,169,176,169, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,162,169,90,169, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,96,169,96,129, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,175,227,90,227, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,90,190,90,227, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,52,179,3,179, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,52,228,3,228, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,52,276,3,276, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,155,177,155,169, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,110,191,110,169, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,155,189,155,197, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,350,283,350,329, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,162,197,155,197, 'fill'=>color, 'tags'=>['floor2','wall']) - TkcLine.new(w,341,275,341,283, 'fill'=>color, 'tags'=>['floor2','wall']) -end - -# floor_fg3 -- -# This method represents part of the floorplan database. When -# invoked, it instantiates the foreground information for the third -# floor (office outlines and numbers). -# -# Arguments: -# w - The canvas window. -# color - Color to use for drawing foreground information. - -def floor_fg3(w,color) - i = TkcPolygon.new(w,89,228,89,180,70,180,70,228, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '316' - $floorItems['316'] = i - TkcText.new(w,79.5,204, 'text'=>'316', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,115,368,162,368,162,323,115,323, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '309' - $floorItems['309'] = i - TkcText.new(w,138.5,345.5, 'text'=>'309', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,164,323,164,368,211,368,211,323, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '308' - $floorItems['308'] = i - TkcText.new(w,187.5,345.5, 'text'=>'308', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,256,368,212,368,212,323,256,323, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '307' - $floorItems['307'] = i - TkcText.new(w,234,345.5, 'text'=>'307', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '305' - $floorItems['305'] = i - TkcText.new(w,270.5,301.5, 'text'=>'305', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,251,219,251,203,244,203,244,219, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '324B' - $floorItems['324B'] = i - TkcText.new(w,247.5,211, 'text'=>'324B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,251,249,244,249,244,232,251,232, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '324A' - $floorItems['324A'] = i - TkcText.new(w,247.5,240.5, 'text'=>'324A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,223,135,223,179,177,179,177,135, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '320' - $floorItems['320'] = i - TkcText.new(w,200,157, 'text'=>'320', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,114,368,114,323,67,323,67,368, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '310' - $floorItems['310'] = i - TkcText.new(w,90.5,345.5, 'text'=>'310', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,23,277,23,321,68,321,68,277, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '312' - $floorItems['312'] = i - TkcText.new(w,45.5,299, 'text'=>'312', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,23,229,68,229,68,275,23,275, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '313' - $floorItems['313'] = i - TkcText.new(w,45.5,252, 'text'=>'313', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,68,227,23,227,23,180,68,180, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '314' - $floorItems['314'] = i - TkcText.new(w,40.5,203.5, 'text'=>'314', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,95,179,95,135,23,135,23,179, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '315' - $floorItems['315'] = i - TkcText.new(w,59,157, 'text'=>'315', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,99,226,99,204,91,204,91,226, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '316B' - $floorItems['316B'] = i - TkcText.new(w,95,215, 'text'=>'316B', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,91,202,99,202,99,180,91,180, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '316A' - $floorItems['316A'] = i - TkcText.new(w,95,191, 'text'=>'316A', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,97,169,109,169,109,192,154,192,154,198, - 174,198,174,226,101,226,101,179,97,179, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '319' - $floorItems['319'] = i - TkcText.new(w,141.5,209, 'text'=>'319', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '311' - $floorItems['311'] = i - TkcText.new(w,29.5,361, 'text'=>'311', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '318' - $floorItems['318'] = i - TkcText.new(w,132.5,180, 'text'=>'318', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '317' - $floorItems['317'] = i - TkcText.new(w,136,149.5, 'text'=>'317', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,274,194,274,221,306,221,306,194, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '323' - $floorItems['323'] = i - TkcText.new(w,290,207.5, 'text'=>'323', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,306,222,274,222,274,249,306,249, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '325' - $floorItems['325'] = i - TkcText.new(w,290,235.5, 'text'=>'325', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,263,179,224,179,224,135,263,135, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '321' - $floorItems['321'] = i - TkcText.new(w,243.5,157, 'text'=>'321', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,314,169,306,169,306,192,273,192, - 264,181,264,135,314,135, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '322' - $floorItems['322'] = i - TkcText.new(w,293.5,163.5, 'text'=>'322', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = 'Pub Lift3' - $floorItems['Pub Lift3'] = i - TkcText.new(w,323,223, 'text'=>'Pub Lift3', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = 'Priv Lift3' - $floorItems['Priv Lift3'] = i - TkcText.new(w,323,188, 'text'=>'Priv Lift3', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '303' - $floorItems['303'] = i - TkcText.new(w,373.5,292.5, 'text'=>'303', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,272,203,272,249,252,249,252,230, - 244,230,244,221,252,221,252,203, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '324' - $floorItems['324'] = i - TkcText.new(w,262,226, 'text'=>'324', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '304' - $floorItems['304'] = i - TkcText.new(w,324,301.5, 'text'=>'304', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '301' - $floorItems['301'] = i - TkcText.new(w,358,209, 'text'=>'301', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,397,246,377,246,377,185,397,185, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '327' - $floorItems['327'] = i - TkcText.new(w,387,215.5, 'text'=>'327', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '326' - $floorItems['326'] = i - TkcText.new(w,365.5,150, 'text'=>'326', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,308,251,242,251,242,274,342,274,342,282,375, 282, - 375,274,397,274,397,248,339,248,339,242,308,242, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '302' - $floorItems['302'] = i - TkcText.new(w,319.5,261, 'text'=>'302', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,70,321,242,321,242,200,259,200,259,203,272,203, - 272,193,263,180,242,180,175,180,175,169,156,169, - 156,196,177,196,177,228,107,228,70,228,70,275,107,275, - 107,248,160,248,160,301,107,301,107,275,70,275, - 'fill'=>'', 'tags'=>['floor3','room']) - $floorLabels[i.id] = '306' - $floorItems['306'] = i - TkcText.new(w,200.5,284.5, 'text'=>'306', 'fill'=>color, - 'anchor'=>'c', 'tags'=>['floor3','label']) - TkcLine.new(w,341,275,341,283, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,162,197,155,197, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,396,247,399,247, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,399,129,399,311, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,258,202,243,202, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,350,283,350,329, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,251,231,243,231, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,243,220,251,220, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,243,250,243,202, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,155,197,155,190, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,110,192,110,169, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,155,192,110,192, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,155,177,155,169, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,176,197,176,227, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,69,280,69,274, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,21,276,69,276, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,69,262,69,226, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,21,228,69,228, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,21,179,75,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,69,179,69,214, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,90,220,90,227, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,90,204,90,202, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,90,203,100,203, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,90,187,90,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,90,227,176,227, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,100,179,100,227, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,100,179,87,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,96,179,96,129, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,162,169,96,169, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,173,169,176,169, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,182,179,176,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,176,129,176,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,195,179,226,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,224,133,224,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,264,179,264,133, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,238,179,264,179, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,273,207,273,193, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,273,235,273,250, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,273,224,273,219, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,273,193,307,193, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,273,222,307,222, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,273,250,307,250, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,384,247,376,247, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,340,206,307,206, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,340,187,340,170, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,340,210,340,201, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,340,247,340,224, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,340,241,307,241, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,376,247,376,170, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,307,250,307,170, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,376,170,307,170, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,315,129,315,170, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,376,283,366,283, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,376,283,376,275, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,399,275,376,275, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,341,275,320,275, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,341,283,350,283, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,298,275,298,329, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,308,275,298,275, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,243,322,243,275, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,243,275,284,275, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,258,322,226,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,212,370,212,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,214,322,177,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,163,370,163,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,165,322,129,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,84,322,117,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,71,322,64,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,115,322,115,370, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,66,322,66,370, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,52,322,21,322, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,21,331,0,331, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,21,331,21,133, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,96,133,21,133, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,176,129,96,129, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,315,133,176,133, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,315,129,399,129, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,399,311,350,311, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,350,329,258,329, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,258,322,258,370, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,60,370,258,370, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,60,370,60,391, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,0,391,0,331, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,60,391,0,391, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,307,250,307,242, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,273,250,307,250, 'fill'=>color, 'tags'=>['floor3','wall']) - TkcLine.new(w,258,250,243,250, 'fill'=>color, 'tags'=>['floor3','wall']) -end - -# Below is the "main program" that creates the floorplan demonstration. - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($floor_demo) && $floor_demo - $floor_demo.destroy - $floor_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$floor_demo = TkToplevel.new {|w| - title("Floorplan Canvas Demonstration") - iconname("Floorplan") - positionWindow(w) - geometry('+20+20') - minsize(100,100) -} - -# label À¸À® -TkLabel.new($floor_demo, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', - 'text'=>"¤³¤Î¥¦¥£¥ó¥É¥¦¤Ë¤Ï¥Ç¥£¥¸¥¿¥ë¥¨¥¯¥¤¥Ã¥×¥á¥ó¥È¼Ò¤Î¥¦¥§¥¹¥¿¥ó¥ê¥µ¡¼¥Á¥é¥Ü¥é¥È¥ê (DECWRL) ¤Î´Ö¼è¤ê¤¬½ñ¤«¤ì¤¿¥¥ã¥ó¥Ð¥¹ widget ¤¬Æþ¤Ã¤Æ¤¤¤Þ¤¹¡£¤³¤ì¤Ï 3³¬·ú¤Æ¤Ç¡¢¾ï¤Ë¤½¤Î¤¦¤Á¤Î1³¬Ê¬¤¬ÁªÂò¡¢¤Ä¤Þ¤ê¤½¤Î´Ö¼è¤ê¤¬É½¼¨¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£¤¢¤ë³¬¤òÁªÂò¤¹¤ë¤Ë¤Ï¡¢¤½¤Î¾å¤Ç¥Þ¥¦¥¹¤Îº¸¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£¥Þ¥¦¥¹¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤ë³¬¤Î¾å¤òư¤¯¤È¡¢¤½¤Î²¼¤Ë¤¢¤ëÉô²°¤Î¿§¤¬ÊѤï¤ê¡¢Éô²°Èֹ椬¡ÖÉô²°ÈÖ¹æ:¡×¥¨¥ó¥È¥ê¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£¤Þ¤¿¡¢¥¨¥ó¥È¥ê¤ËÉô²°ÈÖ¹æ¤ò½ñ¤¯¤È¤½¤ÎÉô²°¤Î¿§¤¬ÊѤï¤ê¤Þ¤¹¡£"){ - pack('side'=>'top') -} - -# frame À¸À® -$floor_buttons = TkFrame.new($floor_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $floor_demo - $floor_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'floor'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$floor_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# ÊÑ¿ôÀßÄê -$floorLabels = {} -$floorItems = {} - -# canvas ÀßÄê -if $tk_version =~ /^4\.[01]/ - $floor_canvas_frame = TkFrame.new($floor_demo,'bd'=>2,'relief'=>'sunken', - 'highlightthickness'=>2) - $floor_canvas = TkCanvas.new($floor_canvas_frame, - 'width'=>900, 'height'=>500, 'borderwidth'=>0, - 'highlightthickness'=>0) {|c| - TkScrollbar.new($floor_demo, 'orient'=>'horiz', - 'command'=>proc{|*args| c.xview(*args)}){|hs| - c.xscrollcommand(proc{|first,last| hs.set first,last}) - pack('side'=>'bottom', 'fill'=>'x') - } - TkScrollbar.new($floor_demo, 'command'=>proc{|*args| c.yview(*args)}){|vs| - c.yscrollcommand(proc{|first,last| vs.set first,last}) - pack('side'=>'right', 'fill'=>'y') - } - } - $floor_canvas_frame.pack('side'=>'top','fill'=>'both', 'expand'=>'yes') - $floor_canvas.pack('expand'=>'yes', 'fill'=>'both') - -else - TkFrame.new($floor_demo) {|f| - pack('side'=>'top', 'fill'=>'both', 'expand'=>'yes') - - h = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'horizontal') - v = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'vertical') - - TkFrame.new(f, 'bd'=>2, 'relief'=>'sunken') {|f1| - $floor_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500, - 'borderwidth'=>0, - 'highlightthickness'=>0) { - xscrollcommand(proc{|first,last| h.set first,last}) - yscrollcommand(proc{|first,last| v.set first,last}) - pack('expand'=>'yes', 'fill'=>'both') - } - grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - } - - v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - - TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0) - TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0) - - pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1) - - v.command(proc{|*args| c.yview(*args)}) - h.command(proc{|*args| c.xview(*args)}) - } -end - - -# Create an entry for displaying and typing in current room. - -$currentRoom = TkVariable.new -$floor_entry = TkEntry.new($floor_canvas, 'width'=>10, 'relief'=>'sunken', - 'bd'=>2, 'textvariable'=>$currentRoom) - -# Choose colors, then fill in the floorplan. - -$floor_colors = {} -if TkWinfo.depth($floor_canvas) > 1 - $floor_colors['bg1'] = '#a9c1da' - $floor_colors['outline1'] = '#77889a' - $floor_colors['bg2'] = '#9ab0c6' - $floor_colors['outline2'] = '#687786' - $floor_colors['bg3'] = '#8ba0b3' - $floor_colors['outline3'] = '#596673' - $floor_colors['offices'] = 'Black' - $floor_colors['active'] = '#c4d1df' -else - $floor_colors['bg1'] = 'white' - $floor_colors['outline1'] = 'black' - $floor_colors['bg2'] = 'white' - $floor_colors['outline2'] = 'black' - $floor_colors['bg3'] = 'white' - $floor_colors['outline3'] = 'black' - $floor_colors['offices'] = 'Black' - $floor_colors['active'] = 'black' -end - -$activeFloor = '' -floorDisplay $floor_canvas,3 - -# Set up event bindings for canvas: - -$floor_canvas.itembind('floor1', '1', proc{floorDisplay $floor_canvas,1}) -$floor_canvas.itembind('floor2', '1', proc{floorDisplay $floor_canvas,2}) -$floor_canvas.itembind('floor3', '1', proc{floorDisplay $floor_canvas,3}) -$floor_canvas.itembind('room', 'Enter', proc{newRoom $floor_canvas}) -$floor_canvas.itembind('room', 'Leave', proc{$currentRoom.value = ''}) -$floor_canvas.bind('2', proc{|x,y| $floor_canvas.scan_mark x,y}, '%x %y') -$floor_canvas.bind('B2-Motion', - proc{|x,y| $floor_canvas.scan_dragto x,y}, '%x %y') -$floor_canvas.bind('Destroy', proc{$currentRoom.unset}) -$currentRoom.value = '' -$currentRoom.trace('w',proc{roomChanged $floor_canvas}) - diff --git a/ext/tk/sample/demos-jp/form.rb b/ext/tk/sample/demos-jp/form.rb deleted file mode 100644 index 35baeed46b..0000000000 --- a/ext/tk/sample/demos-jp/form.rb +++ /dev/null @@ -1,62 +0,0 @@ -# -# form widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($form_demo) && $form_demo - $form_demo.destroy - $form_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$form_demo = TkToplevel.new {|w| - title("Form Demonstration") - iconname("form") - positionWindow(w) -} - -# label À¸À® -msg = TkLabel.new($form_demo) { - font $font - wraplength '4i' - justify 'left' - text "¤³¤Î¥¦¥£¥ó¥É¥¦¤Ï´Êñ¤Ê¥Õ¥©¡¼¥àÆþÎÏÍѤˤʤäƤ¤¤Æ¡¢¤µ¤Þ¤¶¤Þ¤Ê¥¨¥ó¥È¥ê¤ËÆþÎϤ¬¤Ç¤¤Þ¤¹¡£¥¿¥Ö¤Ç¥¨¥ó¥È¥ê¤ÎÀÚÂØ¤¨¤¬¤Ç¤¤Þ¤¹¡£" -} -msg.pack('side'=>'top', 'fill'=>'x') - -# frame À¸À® -TkFrame.new($form_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $form_demo - $form_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'form'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# entry À¸À® -form_data = [] -(1..5).each{|i| - f = TkFrame.new($form_demo, 'bd'=>2) - e = TkEntry.new(f, 'relief'=>'sunken', 'width'=>40) - l = TkLabel.new(f) - e.pack('side'=>'right') - l.pack('side'=>'left') - form_data[i] = {'frame'=>f, 'entry'=>e, 'label'=>l} -} - -# ʸ»úÎóÀßÄê -form_data[1]['label'].text('̾Á°:') -form_data[2]['label'].text('½»½ê:') -form_data[5]['label'].text('ÅÅÏÃ:') - -# pack -(1..5).each{|i| form_data[i]['frame'].pack('side'=>'top', 'fill'=>'x')} - diff --git a/ext/tk/sample/demos-jp/hello b/ext/tk/sample/demos-jp/hello deleted file mode 100644 index 859ebd950e..0000000000 --- a/ext/tk/sample/demos-jp/hello +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env ruby -require 'tk' - -TkButton.new(nil, - 'text'=>"¤³¤ó¤Ë¤Á¤Ï¡¢À¤³¦", - 'command'=>proc{print "¤³¤ó¤Ë¤Á¤Ï¡¢À¤³¦\n"; exit} -).pack - -Tk.mainloop diff --git a/ext/tk/sample/demos-jp/hscale.rb b/ext/tk/sample/demos-jp/hscale.rb deleted file mode 100644 index 4333239c73..0000000000 --- a/ext/tk/sample/demos-jp/hscale.rb +++ /dev/null @@ -1,76 +0,0 @@ -require "tkcanvas" - -if defined?($hscale_demo) && $hscale_deom - $hscale_demo.destroy - $hscale_demo = nil -end - -$hscale_demo = TkToplevel.new {|w| - title("Horizontal Scale Demonstration") - iconname("hscale") -} -positionWindow($hscale_demo) - - -msg = TkLabel.new($hscale_demo) { - font $font - wraplength '3.5i' - justify 'left' - text "²¼¤Ë¤ÏÌð°õ¤¬1¤Ä¤È¿åÊ¿¤Ê¥¹¥±¡¼¥ë¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\ -¥¹¥±¡¼¥ë¾å¤Ç¥Þ¥¦¥¹¥Ü¥¿¥ó1¤ò¥¯¥ê¥Ã¥¯¡¢¤Þ¤¿¤Ï¥É¥é¥Ã¥°¤¹¤ë¤È\ -Ìð°õ¤ÎŤµ¤òÊѤ¨¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£" -} -msg.pack('side'=>'top') - -TkFrame.new($hscale_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc { - tmppath = $hscale_demo - $hscale_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc { showCode 'hscale' } - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -TkFrame.new($hscale_demo) {|frame| - canvas = TkCanvas.new(frame) {|c| - width 50 - height 50 - bd 0 - highlightthickness 0 - TkcPolygon.new(c, '0', '0', '1', '1', '2', '2') { - fill 'DeepSkyBlue' - tags 'poly' - } - TkcLine.new(c, '0', '0', '1', '1', '2', '2', '0', '0') { - fill 'black' - tags 'line' - } - }.pack('side'=>'top', 'expand'=>'yes', 'anchor'=>'s', 'fill'=>'x', 'padx'=>'15') - scale = TkScale.new(frame) { - orient 'horizontal' - length 284 - from 0 - to 250 - command proc{|value| setWidth(canvas, value)} - tickinterval 50 - }.pack('side'=>'bottom', 'expand'=>'yes', 'anchor'=>'n') - scale.set 75 -}.pack('side'=>'top', 'fill'=>'x') - - -def setWidth(w, width) - width = width + 21 - x2 = width - 30 - if x2 < 21 - x2 = 21 - end - w.coords 'poly',20,15,20,35,x2,35,x2,45,width,25,x2,5,x2,15,20,15 - w.coords 'line',20,15,20,35,x2,35,x2,45,width,25,x2,5,x2,15,20,15 -end diff --git a/ext/tk/sample/demos-jp/icon.rb b/ext/tk/sample/demos-jp/icon.rb deleted file mode 100644 index 9b39d33847..0000000000 --- a/ext/tk/sample/demos-jp/icon.rb +++ /dev/null @@ -1,91 +0,0 @@ -# -# iconic button widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($icon_demo) && $icon_demo - $icon_demo.destroy - $icon_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$icon_demo = TkToplevel.new {|w| - title("Iconic Button Demonstration") - iconname("icon") - positionWindow(w) -} - -# label À¸À® -msg = TkLabel.new($icon_demo) { - font $font - wraplength '5i' - justify 'left' - text "¤³¤Î¥¦¥£¥ó¥É¥¦¤Ë¤Ï¥é¥¸¥ª¥Ü¥¿¥ó¤È¥Á¥§¥Ã¥¯¥Ü¥¿¥ó¾å¤Ë¥Ó¥Ã¥È¥Þ¥Ã¥×¤ä²èÁü¤òɽ¼¨¤¹¤ë 3 ¤Ä¤ÎÊýË¡¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡£º¸¤Ë¤¢¤ë¤Î¤Ï2¤Ä¤Î¥é¥¸¥ª¥Ü¥¿¥ó¤Ç¡¢¤½¤ì¤¾¤ì¤¬¡¢¥Ó¥Ã¥È¥Þ¥Ã¥×¤ÈÁªÂò¤ò¼¨¤¹¥¤¥ó¥¸¥±¡¼¥¿¤Ç¤Ç¤¤Æ¤¤¤Þ¤¹¡£Ãæ±û¤Ë¤¢¤ë¤Î¤Ï¡¢ÁªÂòºÑ¤ß¤«¤É¤¦¤«¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë²èÁü¤òɽ¼¨¤¹¤ë¥Á¥§¥Ã¥¯¥Ü¥¿¥ó¤Ç¤¹¡£±¦Â¦¤Ë¤¢¤ë¤Î¤ÏÁªÂòºÑ¤ß¤«¤É¤¦¤«¤Ë¤è¤Ã¤ÆÇØ·Ê¿§¤¬ÊѤï¤ë¥Ó¥Ã¥È¥Þ¥Ã¥×¤òɽ¼¨¤¹¤ë¥Á¥§¥Ã¥¯¥Ü¥¿¥ó¤Ç¤¹¡£" -} -msg.pack('side'=>'top') - -# frame À¸À® -TkFrame.new($icon_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $icon_demo - $icon_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'icon'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# image À¸À® -flagup = \ -TkBitmapImage.new('file'=>[$demo_dir, - 'images','flagup.bmp'].join(File::Separator), - 'maskfile'=>\ - [$demo_dir,'images','flagup.bmp'].join(File::Separator)) -flagdown = \ -TkBitmapImage.new('file'=>[$demo_dir, - 'images','flagdown.bmp'].join(File::Separator), - 'maskfile'=>\ - [$demo_dir,'images','flagdown.bmp'].join(File::Separator)) - -# ÊÑ¿ôÀ¸À® -letters = TkVariable.new - -# frame À¸À® -TkFrame.new($icon_demo, 'borderwidth'=>10){|w| - TkFrame.new(w) {|f| - TkRadioButton.new(f){ - bitmap '@' + [$demo_dir,'images','letters.bmp'].join(File::Separator) - variable letters - value 'full' - }.pack('side'=>'top', 'expand'=>'yes') - - TkRadioButton.new(f){ - bitmap '@' + [$demo_dir,'images','noletter.bmp'].join(File::Separator) - variable letters - value 'empty' - }.pack('side'=>'top', 'expand'=>'yes') - - }.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m') - - TkCheckButton.new(w) { - image flagdown - selectimage flagup - indicatoron 0 - selectcolor self['background'] - }.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m') - - TkCheckButton.new(w) { - bitmap '@' + [$demo_dir,'images','letters.bmp'].join(File::Separator) - indicatoron 0 - selectcolor 'SeaGreen1' - }.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m') - -}.pack('side'=>'top') - diff --git a/ext/tk/sample/demos-jp/image1.rb b/ext/tk/sample/demos-jp/image1.rb deleted file mode 100644 index bfe47c47af..0000000000 --- a/ext/tk/sample/demos-jp/image1.rb +++ /dev/null @@ -1,57 +0,0 @@ -# -# two image widgets demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($image1_demo) && $image1_demo - $image1_demo.destroy - $image1_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$image1_demo = TkToplevel.new {|w| - title('Image Demonstration #1') - iconname("Image1") - positionWindow(w) -} - -# label À¸À® -msg = TkLabel.new($image1_demo) { - font $font - wraplength '4i' - justify 'left' - text "¤³¤Î¥Ç¥â¤Ç¤Ï2¤Ä¤Î¥é¥Ù¥ë¾å¤Ë²èÁü¤ò¤½¤ì¤¾¤ìɽ¼¨¤·¤Æ¤¤¤Þ¤¹¡£" -} -msg.pack('side'=>'top') - -# frame À¸À® -TkFrame.new($image1_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $image1_demo - $image1_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'image1'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# image À¸À® -image1a = \ -TkPhotoImage.new('file'=>[$demo_dir, - 'images','earth.gif'].join(File::Separator)) -image1b = \ -TkPhotoImage.new('file'=>[$demo_dir, - 'images','earthris.gif'].join(File::Separator)) - -# label À¸À® -[ TkLabel.new($image1_demo, 'image'=>image1a, 'bd'=>1, 'relief'=>'sunken'), - TkLabel.new($image1_demo, 'image'=>image1b, 'bd'=>1, 'relief'=>'sunken') -].each{|w| w.pack('side'=>'top', 'padx'=>'.5m', 'pady'=>'.5m')} - diff --git a/ext/tk/sample/demos-jp/image2.rb b/ext/tk/sample/demos-jp/image2.rb deleted file mode 100644 index 07f9b17ebe..0000000000 --- a/ext/tk/sample/demos-jp/image2.rb +++ /dev/null @@ -1,101 +0,0 @@ -# -# widget demo 'load image' (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($image2_demo) && $image2_demo - $image2_demo.destroy - $image2_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$image2_demo = TkToplevel.new {|w| - title('Image Demonstration #2') - iconname("Image2") - positionWindow(w) -} - -# label À¸À® -msg = TkLabel.new($image2_demo) { - font $font - wraplength '4i' - justify 'left' - text "¤³¤Î¥Ç¥â¤Ç¤ÏTk¤Î photo image ¤ò»ÈÍѤ·¤Æ²èÁü¤ò¸«¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ºÇ½é¤Ë¥¨¥ó¥È¥êÆâ¤Ë¤Ë¥Ç¥£¥ì¥¯¥È¥ê̾¤òÆþ¤ì¤Æ²¼¤µ¤¤¡£¼¡¤Ë²¼¤Î¥ê¥¹¥È¥Ü¥Ã¥¯¥¹¤Ë¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¥í¡¼¥É¤¹¤ë¤¿¤á¡¢¥ê¥¿¡¼¥ó¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£¤½¤Î¸å¡¢²èÁü¤òÁªÂò¤¹¤ë¤¿¤á¤Ë¥ê¥¹¥È¥Ü¥Ã¥¯¥¹¤ÎÃæ¤Î¥Õ¥¡¥¤¥ë̾¤ò¥À¥Ö¥ë¥¯¥ê¥Ã¥¯¤·¤Æ²¼¤µ¤¤¡£" -} -msg.pack('side'=>'top') - -# frame À¸À® -TkFrame.new($image2_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $image2_demo - $image2_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'image2'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# ÊÑ¿ôÀ¸À® -$dirName = TkVariable.new([$demo_dir,'images'].join(File::Separator)) - -# image À¸À® -$image2a = TkPhotoImage.new - -# ¥Õ¥¡¥¤¥ë̾ÆþÎÏÉô -TkLabel.new($image2_demo, 'text'=>'¥Ç¥£¥ì¥¯¥È¥ê:')\ -.pack('side'=>'top', 'anchor'=>'w') - -image2_e = TkEntry.new($image2_demo) { - width 30 - textvariable $dirName -}.pack('side'=>'top', 'anchor'=>'w') - -TkFrame.new($image2_demo, 'height'=>'3m', 'width'=>20)\ -.pack('side'=>'top', 'anchor'=>'w') - -TkLabel.new($image2_demo, 'text'=>'¥Õ¥¡¥¤¥ë:')\ -.pack('side'=>'top', 'anchor'=>'w') - -TkFrame.new($image2_demo){|w| - s = TkScrollbar.new(w) - l = TkListbox.new(w) { - width 20 - height 10 - yscrollcommand proc{|first,last| s.set first,last} - } - s.command(proc{|*args| l.yview(*args)}) - l.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y') - s.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y') - #l.insert(0,'earth.gif', 'earthris.gif', 'mickey.gif', 'teapot.ppm') - l.insert(0,'earth.gif', 'earthris.gif', 'teapot.ppm') - l.bind('Double-1', proc{|x,y| loadImage $image2a,l,x,y}, '%x %y') - - image2_e.bind 'Return', proc{loadDir l} - -}.pack('side'=>'top', 'anchor'=>'w') - -# image ÇÛÃÖ -[ TkFrame.new($image2_demo, 'height'=>'3m', 'width'=>20), - TkLabel.new($image2_demo, 'text'=>'²èÁü:'), - TkLabel.new($image2_demo, 'image'=>$image2a) -].each{|w| w.pack('side'=>'top', 'anchor'=>'w')} - -# ¥á¥½¥Ã¥ÉÄêµÁ -def loadDir(w) - w.delete(0,'end') - Dir.glob([$dirName,'*'].join(File::Separator)).sort.each{|f| - w.insert('end',File.basename(f)) - } -end - -def loadImage(img,w,x,y) - img.file([$dirName, w.get("@#{x},#{y}")].join(File::Separator)) -end - diff --git a/ext/tk/sample/demos-jp/image3.rb b/ext/tk/sample/demos-jp/image3.rb deleted file mode 100644 index 84257a2b32..0000000000 --- a/ext/tk/sample/demos-jp/image3.rb +++ /dev/null @@ -1,121 +0,0 @@ -# image3.rb -# -# This demonstration script creates a simple collection of widgets -# that allow you to select and view images in a Tk label. -# -# widget demo 'load image' (called by 'widget') -# - -# toplevel widget -if defined?($image3_demo) && $image3_demo - $image3_demo.destroy - $image3_demo = nil -end - -# demo toplevel widget -$image3_demo = TkToplevel.new {|w| - title('Image Demonstration #3') - iconname("Image3") - positionWindow(w) -} - -# -def loadDir(w) - w.delete(0,'end') - Dir.glob([$dirName,'*'].join(File::Separator)).sort.each{|f| - w.insert('end',File.basename(f)) - } -end - -# selectAndLoadDir -- -# This procedure pops up a dialog to ask for a directory to load into -# the listobx and (if the user presses OK) reloads the directory -# listbox from the directory named in the demo's entry. -# -# Arguments: -# w - Name of the toplevel window of the demo. -def selectAndLoadDir(w, lbox) - dir = Tk.chooseDirectory(:initialdir=>$dirName, :parent=>w, :mustexist=>true) - if dir.length > 0 - $dirName.value = dir - loadDir(lbox) - end -end - -def loadImage(w,x,y) - $image3a.file([$dirName, w.get("@#{x},#{y}")].join(File::Separator)) -end - - -# label -msg = TkLabel.new($image3_demo) { - font $font - wraplength '4i' - justify 'left' - text "¤³¤Î¥Ç¥â¤Ç¤ÏTk¤Î photo image ¤ò»ÈÍѤ·¤Æ²èÁü¤ò ¸«¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ºÇ½é¤Ë¥¨¥ó¥È¥êÆâ¤Ë¤Ë¥Ç¥£¥ì¥¯¥È¥ê̾¤òÆþ¤ì¤Æ²¼¤µ¤¤¡£¼¡¤Ë²¼¤Î¥ê¥¹¥È¥Ü¥Ã¥¯¥¹¤Ë¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¥í¡¼¥É¤¹¤ë¤¿¤á¡¢¥ê¥¿¡¼¥ó¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£¤½¤Î¸å¡¢²èÁü¤òÁªÂò¤¹¤ë¤¿¤á¤Ë¥ê¥¹¥È¥Ü¥Ã¥¯¥¹¤ÎÃæ¤Î¥Õ¥¡¥¤¥ë̾¤ò¥À¥Ö¥ë¥¯¥ê¥Ã¥¯¤·¤Æ²¼¤µ¤¤¡£" -} -msg.pack('side'=>'top') - -# frame -TkFrame.new($image3_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $image3_demo - $image3_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'image3'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# variable -$dirName = TkVariable.new([$demo_dir,'images'].join(File::Separator)) - -# image -begin - $image3a.delete -rescue -end -$image3a = TkPhotoImage.new - -# -image3_f = TkFrame.new($image3_demo).pack(:fill=>:both, :expand=>true) - -image3_df = TkLabelFrame.new($image3_demo, :text=>'¥Ç¥£¥ì¥¯¥È¥ê:') - -image3_ff = TkLabelFrame.new($image3_demo, :text=>'¥Õ¥¡¥¤¥ë:', - :padx=>'2m', :pady=>'2m') -image3_lbx = TkListbox.new(image3_ff, :width=>20, :height=>10) { - pack(:side=>:left, :fill=>:y, :expand=>true) - yscrollbar(TkScrollbar.new(image3_ff).pack(:side=>:left, :fill=>:y, - :expand=>true)) - insert(0, *(%w(earth.gif earthris.gif teapot.ppm))) - bind('Double-1', proc{|x,y| loadImage(self, x, y)}, '%x %y') -} - -image3_ent = TkEntry.new(image3_df, :width=>30, :textvariable=>$dirName){ - pack(:side=>:left, :fill=>:both, :padx=>'2m', :pady=>'2m', :expand=>true) - bind('Return', proc{loadDir(image3_lbx)}) -} - -TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"¥Ç¥£¥ì¥¯¥È¥êÁªÂò", - :command=>proc{selectAndLoadDir(image3_ent, image3_lbx)}) { - pack(:side=>:left, :fill=>:y, :padx=>[0, '2m'], :pady=>'2m') -} - -image3_if = TkLabelFrame.new($image3_demo, :text=>'¥¤¥á¡¼¥¸:') {|f| - TkLabel.new(f, :image=>$image3a).pack(:padx=>'2m', :pady=>'2m') -} - -Tk.grid(image3_df, '-', - :sticky=>:ew, :padx=>'1m', :pady=>'1m', :in=>image3_f) -Tk.grid(image3_ff, image3_if, - :sticky=>:nw, :padx=>'1m', :pady=>'1m', :in=>image3_f) -TkGrid.columnconfigure(image3_f, 1, :weight=>1) - diff --git a/ext/tk/sample/demos-jp/images/earth.gif b/ext/tk/sample/demos-jp/images/earth.gif Binary files differdeleted file mode 100644 index 3ae4a9ce01..0000000000 --- a/ext/tk/sample/demos-jp/images/earth.gif +++ /dev/null diff --git a/ext/tk/sample/demos-jp/images/earthris.gif b/ext/tk/sample/demos-jp/images/earthris.gif Binary files differdeleted file mode 100644 index 48f08c4421..0000000000 --- a/ext/tk/sample/demos-jp/images/earthris.gif +++ /dev/null diff --git a/ext/tk/sample/demos-jp/images/face.bmp b/ext/tk/sample/demos-jp/images/face.bmp deleted file mode 100644 index 03d829f4d1..0000000000 --- a/ext/tk/sample/demos-jp/images/face.bmp +++ /dev/null @@ -1,173 +0,0 @@ -#define face_width 108 -#define face_height 144 -#define face_x_hot 48 -#define face_y_hot 80 -static char face_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x09, - 0x20, 0x80, 0x24, 0x05, 0x00, 0x80, 0x08, 0x00, 0x00, 0x00, 0x00, 0x88, - 0x24, 0x20, 0x80, 0x24, 0x00, 0x00, 0x00, 0x10, 0x80, 0x04, 0x00, 0x01, - 0x00, 0x01, 0x40, 0x0a, 0x09, 0x00, 0x92, 0x04, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x40, 0x12, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x84, - 0x24, 0x40, 0x22, 0xa8, 0x02, 0x14, 0x84, 0x92, 0x40, 0x42, 0x12, 0x04, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x52, 0x11, 0x00, 0x12, 0x00, - 0x40, 0x02, 0x00, 0x20, 0x00, 0x08, 0x00, 0xaa, 0x02, 0x54, 0x85, 0x24, - 0x00, 0x10, 0x12, 0x00, 0x00, 0x81, 0x44, 0x00, 0x90, 0x5a, 0x00, 0xea, - 0x1b, 0x00, 0x80, 0x40, 0x40, 0x02, 0x00, 0x08, 0x00, 0x20, 0xa2, 0x05, - 0x8a, 0xb4, 0x6e, 0x45, 0x12, 0x04, 0x08, 0x00, 0x00, 0x00, 0x10, 0x02, - 0xa8, 0x92, 0x00, 0xda, 0x5f, 0x10, 0x00, 0x10, 0xa1, 0x04, 0x20, 0x41, - 0x02, 0x00, 0x5a, 0x25, 0xa0, 0xff, 0xfb, 0x05, 0x41, 0x02, 0x04, 0x00, - 0x00, 0x08, 0x40, 0x80, 0xec, 0x9b, 0xec, 0xfe, 0x7f, 0x01, 0x04, 0x20, - 0x90, 0x02, 0x04, 0x00, 0x08, 0x20, 0xfb, 0x2e, 0xf5, 0xff, 0xff, 0x57, - 0x00, 0x04, 0x02, 0x00, 0x00, 0x20, 0x01, 0xc1, 0x6e, 0xab, 0xfa, 0xff, - 0xff, 0x05, 0x90, 0x20, 0x48, 0x02, 0x00, 0x04, 0x20, 0xa8, 0xdf, 0xb5, - 0xfe, 0xff, 0xff, 0x0b, 0x01, 0x00, 0x01, 0x00, 0x80, 0x80, 0x04, 0xe0, - 0xbb, 0xef, 0xff, 0xff, 0x7f, 0x01, 0x00, 0x04, 0x48, 0x02, 0x00, 0x20, - 0x80, 0xf4, 0x6f, 0xfb, 0xff, 0xff, 0xff, 0x20, 0x90, 0x40, 0x02, 0x00, - 0x00, 0x04, 0x08, 0xb8, 0xf6, 0xff, 0xff, 0xdf, 0xbe, 0x12, 0x45, 0x10, - 0x90, 0x04, 0x90, 0x00, 0x22, 0xfa, 0xff, 0xff, 0xff, 0xbb, 0xd7, 0xe9, - 0x3a, 0x02, 0x02, 0x00, 0x04, 0x90, 0x80, 0xfe, 0xdf, 0xf6, 0xb7, 0xef, - 0xbe, 0x56, 0x57, 0x40, 0x48, 0x09, 0x00, 0x04, 0x00, 0xfa, 0xf5, 0xdf, - 0xed, 0x5a, 0xd5, 0xea, 0xbd, 0x09, 0x00, 0x00, 0x40, 0x00, 0x92, 0xfe, - 0xbf, 0x7d, 0xb7, 0x6a, 0x55, 0xbf, 0xf7, 0x02, 0x11, 0x01, 0x00, 0x91, - 0x00, 0xff, 0xff, 0xaf, 0x55, 0x55, 0x5b, 0xeb, 0xef, 0x22, 0x04, 0x04, - 0x04, 0x00, 0xa4, 0xff, 0xf7, 0xad, 0xaa, 0xaa, 0xaa, 0xbe, 0xfe, 0x03, - 0x20, 0x00, 0x10, 0x44, 0x80, 0xff, 0x7f, 0x55, 0x12, 0x91, 0x2a, 0xeb, - 0xbf, 0x0b, 0x82, 0x02, 0x00, 0x00, 0xd1, 0x7f, 0xdf, 0xa2, 0xa4, 0x54, - 0x55, 0xfd, 0xfd, 0x47, 0x08, 0x08, 0x00, 0x21, 0xe4, 0xff, 0x37, 0x11, - 0x09, 0xa5, 0xaa, 0xb6, 0xff, 0x0d, 0x80, 0x00, 0x00, 0x04, 0xd0, 0xff, - 0x4f, 0x44, 0x20, 0x48, 0x55, 0xfb, 0xff, 0x27, 0x11, 0x02, 0x40, 0x40, - 0xe2, 0xfb, 0x15, 0x11, 0x4a, 0x55, 0x4a, 0x7d, 0xf7, 0x0f, 0x00, 0x00, - 0x04, 0x08, 0xf8, 0xdf, 0x52, 0x44, 0x01, 0x52, 0xb5, 0xfa, 0xff, 0x0f, - 0x49, 0x02, 0x00, 0x02, 0xe9, 0xf6, 0x0a, 0x11, 0xa4, 0x88, 0x4a, 0x6d, - 0xff, 0x5f, 0x00, 0x00, 0x10, 0x20, 0xf0, 0x2f, 0x21, 0x44, 0x10, 0x52, - 0xb5, 0xfa, 0xff, 0x0f, 0x44, 0x04, 0x80, 0x08, 0xf8, 0xab, 0x8a, 0x00, - 0x81, 0xa4, 0xd4, 0xd6, 0xfe, 0x2f, 0x00, 0x00, 0x04, 0x40, 0xb5, 0x2d, - 0x21, 0x08, 0x04, 0x90, 0xaa, 0xfa, 0xff, 0x1f, 0x11, 0x01, 0x00, 0x04, - 0xf0, 0x57, 0x0a, 0x22, 0x40, 0x4a, 0xda, 0x5e, 0xfb, 0x1f, 0x40, 0x00, - 0x40, 0x20, 0xba, 0x95, 0x90, 0x00, 0x01, 0xa0, 0xaa, 0xea, 0xff, 0x5f, - 0x02, 0x02, 0x00, 0x01, 0xe8, 0x57, 0x05, 0x00, 0x00, 0x12, 0xd5, 0xfe, - 0xfd, 0x1f, 0x48, 0x00, 0x04, 0x48, 0x7a, 0x95, 0x08, 0x02, 0x10, 0x40, - 0xaa, 0x55, 0xf7, 0x1f, 0x00, 0x09, 0x20, 0x00, 0xf8, 0x57, 0x22, 0x10, - 0x00, 0x28, 0xa9, 0xfa, 0xff, 0x5f, 0x02, 0x00, 0x00, 0x49, 0xdd, 0x29, - 0x01, 0x00, 0x80, 0x80, 0xaa, 0xd7, 0xff, 0x0f, 0x10, 0x00, 0x08, 0x00, - 0xf8, 0x96, 0x08, 0x00, 0x00, 0x20, 0x54, 0xfa, 0xee, 0x3f, 0x81, 0x04, - 0x40, 0x24, 0xfe, 0x55, 0x82, 0x00, 0x00, 0x82, 0xd2, 0xad, 0xff, 0x0f, - 0x08, 0x00, 0x04, 0x80, 0x6c, 0x97, 0x00, 0x00, 0x02, 0x20, 0xa9, 0xf6, - 0xdf, 0x5f, 0x00, 0x02, 0x20, 0x09, 0xfa, 0x49, 0x12, 0x00, 0x20, 0x84, - 0x54, 0xdb, 0xfe, 0x1f, 0x91, 0x00, 0x00, 0x00, 0xf8, 0x2b, 0x00, 0x20, - 0x00, 0x40, 0xa4, 0xf6, 0xbb, 0x1f, 0x04, 0x00, 0x44, 0x92, 0x7e, 0x95, - 0x02, 0x00, 0x00, 0x89, 0xaa, 0xdd, 0xff, 0x1f, 0x20, 0x09, 0x10, 0x00, - 0xf4, 0x57, 0x20, 0x01, 0x08, 0x20, 0xa9, 0x76, 0xff, 0x5f, 0x02, 0x00, - 0x00, 0x21, 0xfc, 0x4a, 0x05, 0x00, 0x01, 0x80, 0x54, 0xdb, 0xff, 0x1e, - 0x08, 0x02, 0x04, 0x08, 0xf9, 0x2b, 0x00, 0x00, 0x40, 0x28, 0xd2, 0xf6, - 0xff, 0xbf, 0x80, 0x00, 0x90, 0x00, 0xbc, 0x92, 0x08, 0x10, 0x00, 0x82, - 0x54, 0xdb, 0xff, 0x1f, 0x20, 0x00, 0x00, 0x44, 0xf9, 0x55, 0x02, 0x01, - 0x00, 0x20, 0xaa, 0xbd, 0xfd, 0x3f, 0x08, 0x04, 0x04, 0x10, 0xf4, 0x2a, - 0x01, 0x00, 0x22, 0x80, 0xd4, 0xf6, 0xff, 0x5f, 0x82, 0x00, 0x40, 0x02, - 0xf8, 0x55, 0x20, 0x00, 0x00, 0x50, 0x6a, 0xdf, 0xfe, 0x3f, 0x00, 0x00, - 0x00, 0x48, 0xe9, 0x4a, 0x05, 0x08, 0x00, 0xa5, 0xd5, 0xf5, 0xff, 0x3f, - 0x10, 0x01, 0x10, 0x01, 0xb0, 0xab, 0x92, 0x02, 0x40, 0xf8, 0xbf, 0xde, - 0xfe, 0x5f, 0x02, 0x04, 0x04, 0x48, 0xfa, 0xd4, 0x6f, 0x20, 0x84, 0xef, - 0xff, 0xfb, 0xff, 0x1f, 0x20, 0x00, 0x00, 0x00, 0xe0, 0xed, 0xbf, 0x0b, - 0xa1, 0x7e, 0xff, 0xbf, 0xfd, 0x5f, 0x04, 0x01, 0x20, 0x49, 0xd2, 0xfb, - 0xfe, 0x55, 0xd4, 0xff, 0xff, 0xf6, 0xff, 0x07, 0x00, 0x04, 0x00, 0x00, - 0xc0, 0xaa, 0xfb, 0x2b, 0xa2, 0xfe, 0xff, 0xdf, 0xee, 0x1f, 0x91, 0x00, - 0x82, 0xa4, 0xa4, 0xf5, 0xff, 0x57, 0xd5, 0xff, 0xbf, 0xfd, 0xff, 0x4d, - 0x00, 0x00, 0x20, 0x00, 0x88, 0x5b, 0xff, 0x2f, 0x69, 0xff, 0xff, 0xdb, - 0xfe, 0x1f, 0x24, 0x02, 0x00, 0x49, 0xa2, 0xd6, 0xff, 0x5f, 0xea, 0xff, - 0x7f, 0x7f, 0x7f, 0x0d, 0x00, 0x00, 0x10, 0x00, 0x40, 0xab, 0xf7, 0xbb, - 0xf0, 0xdf, 0xff, 0xd5, 0xff, 0xbf, 0x82, 0x04, 0x42, 0x24, 0x91, 0xd5, - 0xaa, 0xae, 0xd4, 0xaa, 0x52, 0x7b, 0xff, 0x15, 0x08, 0x00, 0x00, 0x01, - 0x04, 0x55, 0xd5, 0x55, 0x70, 0x5b, 0x75, 0xdd, 0xdf, 0x1f, 0x40, 0x00, - 0x08, 0x48, 0xa0, 0x4a, 0xa9, 0x56, 0xea, 0x56, 0xad, 0x6a, 0x7d, 0x9b, - 0x04, 0x01, 0x00, 0x02, 0x42, 0x2a, 0xd5, 0xaa, 0xa8, 0xaa, 0xaa, 0xfa, - 0xdf, 0x2f, 0x10, 0x04, 0x22, 0x48, 0x08, 0x45, 0x2a, 0x15, 0x68, 0x55, - 0x55, 0xd7, 0x76, 0x1b, 0x00, 0x00, 0x00, 0x01, 0x40, 0x2a, 0x80, 0xa0, - 0xb2, 0x09, 0x48, 0xb9, 0xdf, 0x17, 0x22, 0x01, 0x00, 0x24, 0x45, 0x8a, - 0x24, 0x4a, 0x54, 0x51, 0x91, 0xf6, 0x6e, 0x4b, 0x00, 0x04, 0x90, 0x00, - 0x80, 0x52, 0x00, 0x20, 0x69, 0x05, 0xa4, 0xaa, 0xff, 0x1e, 0x48, 0x00, - 0x02, 0x92, 0x08, 0x05, 0x81, 0x94, 0xd4, 0x92, 0x40, 0xfd, 0xb6, 0x8b, - 0x00, 0x01, 0x40, 0x00, 0x82, 0x54, 0x00, 0x48, 0x68, 0x05, 0x90, 0xa4, - 0xef, 0x06, 0x24, 0x00, 0x08, 0x12, 0x10, 0x05, 0x00, 0x10, 0xb5, 0x01, - 0x42, 0xfb, 0xbf, 0x43, 0x00, 0x09, 0x00, 0x40, 0x81, 0xa8, 0x08, 0x4a, - 0xaa, 0x96, 0x90, 0xac, 0x6d, 0x15, 0x22, 0x00, 0x20, 0x09, 0x04, 0x15, - 0x80, 0x28, 0xdc, 0x01, 0x24, 0xfb, 0xbf, 0x01, 0x80, 0x04, 0x09, 0x00, - 0x40, 0x48, 0x02, 0x45, 0xb2, 0x2e, 0x41, 0x6d, 0xef, 0x05, 0x11, 0x00, - 0x40, 0x52, 0x02, 0x15, 0x29, 0x2a, 0xac, 0x42, 0x54, 0xfb, 0x3b, 0x51, - 0x84, 0x00, 0x08, 0x00, 0x20, 0x54, 0x80, 0x05, 0xb5, 0x3d, 0xa2, 0xb6, - 0xdf, 0x00, 0x20, 0x04, 0x20, 0x49, 0x89, 0xa8, 0x6a, 0x29, 0xac, 0xd6, - 0x54, 0xff, 0x3f, 0x84, 0x00, 0x01, 0x04, 0x10, 0x00, 0x94, 0xa8, 0x56, - 0xda, 0x5f, 0xab, 0xd5, 0x1e, 0x10, 0x48, 0x00, 0x90, 0x82, 0x48, 0xa8, - 0xb2, 0xac, 0xfd, 0x55, 0xd5, 0xfe, 0x9f, 0x80, 0x00, 0x0a, 0x02, 0x08, - 0x02, 0x55, 0x5a, 0x75, 0xff, 0xaf, 0xb6, 0xf7, 0x2d, 0x12, 0x92, 0x00, - 0x10, 0x20, 0x10, 0xa8, 0x54, 0xd5, 0xbf, 0x5d, 0xad, 0xdd, 0x0f, 0x00, - 0x00, 0x04, 0x40, 0x09, 0x84, 0xa8, 0xaa, 0x5a, 0xed, 0xeb, 0x6a, 0xff, - 0x9f, 0xa4, 0x24, 0x01, 0x02, 0xa0, 0x20, 0x50, 0x55, 0xd5, 0xbe, 0xae, - 0xad, 0xfd, 0x16, 0x00, 0x10, 0x04, 0x20, 0x0a, 0x08, 0xb4, 0xaa, 0x95, - 0xaa, 0x7b, 0xb7, 0xdb, 0x5f, 0x92, 0x04, 0x01, 0x84, 0x20, 0x21, 0x51, - 0xd5, 0x2a, 0xa9, 0xee, 0xd5, 0xfe, 0x0d, 0x00, 0x20, 0x04, 0x10, 0x00, - 0x08, 0x50, 0xe9, 0xd7, 0xd4, 0xfb, 0xb5, 0xff, 0x9f, 0x24, 0x09, 0x01, - 0x42, 0x4a, 0xa2, 0x64, 0xd5, 0x55, 0x7b, 0x7f, 0xda, 0x7d, 0x4f, 0x00, - 0x20, 0x04, 0x00, 0x80, 0x00, 0xa0, 0x2a, 0x13, 0x84, 0x6a, 0x55, 0xff, - 0x1d, 0x48, 0x8a, 0x00, 0x94, 0x24, 0x8a, 0xc8, 0xaa, 0x42, 0x20, 0x5d, - 0xf5, 0xff, 0x5f, 0x01, 0x00, 0x02, 0x01, 0x00, 0x20, 0xa2, 0x4a, 0x1a, - 0x82, 0x56, 0xda, 0xbd, 0x3f, 0x92, 0x92, 0x00, 0x90, 0x92, 0x00, 0x40, - 0x95, 0x6a, 0xf4, 0x55, 0x6d, 0xff, 0xd6, 0x00, 0x00, 0x0a, 0x04, 0x20, - 0x14, 0x49, 0x4b, 0xaa, 0xaa, 0x56, 0xf5, 0xff, 0xbf, 0xab, 0xa4, 0x00, - 0x20, 0x89, 0x40, 0x80, 0xaa, 0xaa, 0xaa, 0xaa, 0xde, 0xbf, 0xeb, 0x03, - 0x00, 0x02, 0x04, 0x02, 0x0a, 0x10, 0x2b, 0x2a, 0x55, 0x5b, 0xf5, 0xff, - 0xd7, 0x2f, 0x92, 0x00, 0x10, 0x28, 0x21, 0x01, 0x56, 0x95, 0xa0, 0x56, - 0xdf, 0xef, 0xea, 0x87, 0x40, 0x0a, 0x42, 0x41, 0x00, 0x90, 0xaa, 0x52, - 0xb6, 0xad, 0xfa, 0xff, 0xd5, 0x2f, 0x14, 0x00, 0x00, 0x04, 0x95, 0x04, - 0xaa, 0xac, 0x55, 0x6b, 0xff, 0xb7, 0xea, 0x9f, 0x40, 0x02, 0x28, 0x51, - 0x00, 0x40, 0x58, 0xd5, 0xda, 0xd6, 0x6e, 0x7f, 0xf9, 0x3f, 0x12, 0x04, - 0x02, 0x04, 0x49, 0x25, 0x55, 0xaa, 0x77, 0xab, 0xff, 0x2b, 0xfd, 0x3f, - 0x48, 0x01, 0x20, 0x41, 0x00, 0x00, 0x58, 0xa9, 0xda, 0xea, 0xfd, 0xaf, - 0xfa, 0xff, 0x02, 0x04, 0x08, 0x14, 0x29, 0x49, 0x52, 0x55, 0x55, 0x55, - 0xff, 0x8d, 0xfe, 0x3f, 0xa8, 0x00, 0x02, 0x41, 0x00, 0x02, 0xa0, 0xa2, - 0xaa, 0xea, 0xff, 0x53, 0xfd, 0xff, 0x02, 0x04, 0x50, 0x04, 0x25, 0xa8, - 0x54, 0x49, 0x52, 0xb5, 0xbf, 0x8a, 0xfe, 0xff, 0xa9, 0x08, 0x04, 0x50, - 0x80, 0x02, 0xa1, 0x2a, 0x95, 0xea, 0xff, 0xa1, 0xff, 0xff, 0x03, 0x02, - 0x90, 0x02, 0x09, 0x08, 0x44, 0x49, 0x52, 0xbd, 0x7f, 0xca, 0xff, 0xff, - 0x2b, 0x09, 0x04, 0x48, 0x40, 0x82, 0x90, 0x56, 0xa9, 0xf6, 0xbf, 0xd0, - 0xff, 0xff, 0x47, 0x00, 0x50, 0x02, 0x15, 0x11, 0x40, 0x95, 0xaa, 0xfd, - 0x2f, 0xe9, 0xff, 0xff, 0x8f, 0x0a, 0x84, 0x50, 0x40, 0x84, 0x14, 0xaa, - 0x6a, 0xff, 0x5f, 0xf2, 0xff, 0xff, 0x7f, 0x00, 0x10, 0x02, 0x09, 0x10, - 0x40, 0x7d, 0xf7, 0xff, 0x0b, 0xfc, 0xff, 0xff, 0xaf, 0x02, 0x84, 0x50, - 0x42, 0x85, 0x12, 0xd0, 0xdd, 0xff, 0xa7, 0xf2, 0xff, 0xff, 0xff, 0x04, - 0x00, 0x0a, 0x08, 0x10, 0x48, 0xf8, 0xff, 0xff, 0x0a, 0xfe, 0xff, 0xff, - 0x7f, 0x03, 0xa4, 0x80, 0xa2, 0x8a, 0x02, 0x68, 0xff, 0xff, 0x52, 0xfd, - 0xff, 0xff, 0xff, 0x07, 0x00, 0x2a, 0x08, 0x20, 0x28, 0xdc, 0xff, 0x5f, - 0x05, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x92, 0x40, 0x22, 0x09, 0x02, 0xea, - 0xfb, 0xaf, 0x48, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x12, 0x81, 0xa0, - 0x48, 0x9c, 0x6e, 0x93, 0xa2, 0xff, 0xff, 0xff, 0xff, 0x07, 0xa8, 0x40, - 0x28, 0x0a, 0x02, 0x74, 0xb5, 0x45, 0x81, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0x02, 0x0a, 0x81, 0x20, 0x08, 0xae, 0xaa, 0x90, 0xe8, 0xff, 0xff, 0xff, - 0xff, 0x0f, 0x90, 0x40, 0x28, 0x88, 0x12, 0x58, 0x15, 0x50, 0xd0, 0xff, - 0xff, 0xff, 0xff, 0x0f, 0x44, 0x0a, 0x41, 0x21, 0x08, 0xae, 0x04, 0x14, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x40, 0x14, 0x88, 0x04, 0xba, - 0x02, 0x28, 0xe8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x42, 0x15, 0x41, 0x21, - 0x05, 0xad, 0x00, 0x05, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x40, - 0x24, 0x8a, 0x0e, 0x36, 0x00, 0x0a, 0xf4, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0x42, 0x25, 0x90, 0xd0, 0x8b, 0xc2, 0x41, 0x05, 0xfc, 0xff, 0xff, 0xff, - 0xff, 0x0f, 0x10, 0x08, 0x05, 0xe8, 0x8e, 0x58, 0x80, 0x02, 0xfa, 0xff, - 0xff, 0xff, 0xff, 0x0f, 0x4a, 0x20, 0xa8, 0xba, 0x0b, 0x2b, 0x51, 0x01, - 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x8a, 0x02, 0xe8, 0xaf, 0x84, - 0x90, 0x04, 0xfd, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x52, 0x21, 0x54, 0xbf, - 0x1f, 0x15, 0xa5, 0x02, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x08, - 0x01, 0xfa, 0xb6, 0xa4, 0x52, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0x4a, 0xa2, 0x54, 0xef, 0x5f, 0x4b, 0xa4, 0x80, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x0f, 0x80, 0x10, 0x82, 0xfe, 0xbf, 0x92, 0x52, 0x42, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x0f, 0x12, 0x42, 0xa8, 0xbf, 0x1f, 0x24, 0x80, 0xa0, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x84, 0x28, 0x8a, 0xf7, 0x37, 0x80, - 0x52, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x82, 0xe0, 0xff, - 0x1f, 0x00, 0x20, 0xe1, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x84, 0x28, - 0xca, 0xff, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0x10, 0x42, 0xf0, 0xfd, 0x1b, 0x00, 0x50, 0xf0, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x0f, 0xa4, 0x10, 0xc5, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x0f, 0x00, 0x22, 0xf8, 0xff, 0x0e, 0x00, 0x00, 0xf0, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xaa, 0x88, 0xe2, 0xff, 0x0f, 0x10, - 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x25, 0xfa, 0xff, - 0x0f, 0x01, 0x11, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xfb, - 0xfb, 0xff, 0x7f, 0x5d, 0xd5, 0xfa, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f}; diff --git a/ext/tk/sample/demos-jp/images/flagdown.bmp b/ext/tk/sample/demos-jp/images/flagdown.bmp deleted file mode 100644 index 55abc51825..0000000000 --- a/ext/tk/sample/demos-jp/images/flagdown.bmp +++ /dev/null @@ -1,27 +0,0 @@ -#define flagdown_width 48 -#define flagdown_height 48 -static char flagdown_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xe1, 0x00, 0x00, - 0x00, 0x00, 0x70, 0x80, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x03, 0x00, - 0x00, 0x00, 0x0c, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x04, - 0x00, 0x00, 0x03, 0x00, 0x06, 0x06, 0x00, 0x80, 0x01, 0x00, 0x06, 0x07, - 0x00, 0xc0, 0x1f, 0x00, 0x87, 0x07, 0x00, 0xe0, 0x7f, 0x80, 0xc7, 0x07, - 0x00, 0x70, 0xe0, 0xc0, 0xe5, 0x07, 0x00, 0x38, 0x80, 0xe1, 0x74, 0x07, - 0x00, 0x18, 0x80, 0x71, 0x3c, 0x07, 0x00, 0x0c, 0x00, 0x3b, 0x1e, 0x03, - 0x00, 0x0c, 0x00, 0x1f, 0x0f, 0x00, 0x00, 0x86, 0x1f, 0x8e, 0x07, 0x00, - 0x00, 0x06, 0x06, 0xc6, 0x05, 0x00, 0x00, 0x06, 0x00, 0xc6, 0x05, 0x00, - 0x00, 0x06, 0x00, 0xc6, 0x04, 0x00, 0x00, 0x06, 0x00, 0x06, 0x04, 0x00, - 0x7f, 0x06, 0x00, 0x06, 0xe4, 0xff, 0x00, 0x06, 0x00, 0x06, 0x04, 0x00, - 0x00, 0x06, 0x00, 0x06, 0x04, 0x00, 0x00, 0x06, 0x00, 0x06, 0x06, 0x00, - 0x00, 0x06, 0x00, 0x06, 0x03, 0x00, 0x00, 0x06, 0x00, 0x86, 0x01, 0x00, - 0x00, 0x06, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x06, 0x00, 0x66, 0x00, 0x00, - 0x00, 0x06, 0x00, 0x36, 0x00, 0x00, 0x00, 0x06, 0x00, 0x3e, 0x00, 0x00, - 0x00, 0xfe, 0xff, 0x2f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x27, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, - 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, - 0xf7, 0xbf, 0x8e, 0xfc, 0xdf, 0xf8, 0x9d, 0xeb, 0x9b, 0x76, 0xd2, 0x7a, - 0x46, 0x30, 0xe2, 0x0f, 0xe1, 0x47, 0x55, 0x84, 0x48, 0x11, 0x84, 0x19}; diff --git a/ext/tk/sample/demos-jp/images/flagup.bmp b/ext/tk/sample/demos-jp/images/flagup.bmp deleted file mode 100644 index 6eb0d846a3..0000000000 --- a/ext/tk/sample/demos-jp/images/flagup.bmp +++ /dev/null @@ -1,27 +0,0 @@ -#define flagup_width 48 -#define flagup_height 48 -static char flagup_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, - 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xef, 0x6a, 0x00, - 0x00, 0x00, 0xc0, 0x7b, 0x75, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0x6a, 0x00, - 0x00, 0x00, 0x30, 0x60, 0x75, 0x00, 0x00, 0x00, 0x18, 0xe0, 0x7f, 0x00, - 0x00, 0x00, 0x0c, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x06, 0xe0, 0x04, 0x00, - 0x00, 0x00, 0x03, 0xe0, 0x04, 0x00, 0x00, 0x80, 0x01, 0xe0, 0x06, 0x00, - 0x00, 0xc0, 0x1f, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x7f, 0xe0, 0x07, 0x00, - 0x00, 0x70, 0xe0, 0xe0, 0x05, 0x00, 0x00, 0x38, 0x80, 0xe1, 0x04, 0x00, - 0x00, 0x18, 0x80, 0xf1, 0x04, 0x00, 0x00, 0x0c, 0x00, 0xfb, 0x04, 0x00, - 0x00, 0x0c, 0x00, 0xff, 0x04, 0x00, 0x00, 0x86, 0x1f, 0xee, 0x04, 0x00, - 0x00, 0x06, 0x06, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0xe6, 0x04, 0x00, - 0x00, 0x06, 0x00, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0x66, 0x04, 0x00, - 0x7f, 0x56, 0x52, 0x06, 0xe4, 0xff, 0x00, 0x76, 0x55, 0x06, 0x04, 0x00, - 0x00, 0x56, 0x57, 0x06, 0x04, 0x00, 0x00, 0x56, 0x55, 0x06, 0x06, 0x00, - 0x00, 0x56, 0xd5, 0x06, 0x03, 0x00, 0x00, 0x06, 0x00, 0x86, 0x01, 0x00, - 0x54, 0x06, 0x00, 0xc6, 0x54, 0x55, 0xaa, 0x06, 0x00, 0x66, 0xaa, 0x2a, - 0x54, 0x06, 0x00, 0x36, 0x55, 0x55, 0xaa, 0x06, 0x00, 0xbe, 0xaa, 0x2a, - 0x54, 0xfe, 0xff, 0x6f, 0x55, 0x55, 0xaa, 0xfc, 0xff, 0xa7, 0xaa, 0x2a, - 0x54, 0x01, 0x88, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a, - 0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a, - 0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a, - 0x54, 0x55, 0x8d, 0x50, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa8, 0xaa, 0x2a, - 0x54, 0x55, 0x95, 0x54, 0x55, 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x2a, - 0x54, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/ext/tk/sample/demos-jp/images/gray25.bmp b/ext/tk/sample/demos-jp/images/gray25.bmp deleted file mode 100644 index b234b3cb0b..0000000000 --- a/ext/tk/sample/demos-jp/images/gray25.bmp +++ /dev/null @@ -1,6 +0,0 @@ -#define grey_width 16 -#define grey_height 16 -static char grey_bits[] = { - 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, - 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, - 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44}; diff --git a/ext/tk/sample/demos-jp/images/grey.25 b/ext/tk/sample/demos-jp/images/grey.25 deleted file mode 100644 index b234b3cb0b..0000000000 --- a/ext/tk/sample/demos-jp/images/grey.25 +++ /dev/null @@ -1,6 +0,0 @@ -#define grey_width 16 -#define grey_height 16 -static char grey_bits[] = { - 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, - 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, - 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44}; diff --git a/ext/tk/sample/demos-jp/images/grey.5 b/ext/tk/sample/demos-jp/images/grey.5 deleted file mode 100644 index 37688893f0..0000000000 --- a/ext/tk/sample/demos-jp/images/grey.5 +++ /dev/null @@ -1,6 +0,0 @@ -#define grey_width 16 -#define grey_height 16 -static char grey_bits[] = { - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, - 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa}; diff --git a/ext/tk/sample/demos-jp/images/letters.bmp b/ext/tk/sample/demos-jp/images/letters.bmp deleted file mode 100644 index 0f12568d1a..0000000000 --- a/ext/tk/sample/demos-jp/images/letters.bmp +++ /dev/null @@ -1,27 +0,0 @@ -#define letters_width 48 -#define letters_height 48 -static char letters_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, - 0x00, 0xfa, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, - 0x00, 0x3a, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2e, - 0xe0, 0xff, 0xff, 0xff, 0xff, 0x21, 0x20, 0x00, 0x00, 0x00, 0x00, 0x21, - 0xa0, 0x03, 0x00, 0x00, 0x70, 0x21, 0x20, 0x00, 0x00, 0x00, 0x50, 0x21, - 0xa0, 0x1f, 0x00, 0x00, 0x50, 0x21, 0x20, 0x00, 0x00, 0x00, 0x70, 0x21, - 0xfe, 0xff, 0xff, 0xff, 0x0f, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x21, - 0xfa, 0x01, 0x00, 0x80, 0x0b, 0x21, 0x02, 0x00, 0x00, 0x80, 0x0a, 0x21, - 0xba, 0x01, 0x00, 0x80, 0x0a, 0x21, 0x02, 0x00, 0x00, 0x80, 0x0b, 0x21, - 0x3a, 0x00, 0x00, 0x00, 0x08, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x21, - 0x02, 0xc0, 0xfb, 0x03, 0x08, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x3f, - 0x02, 0xc0, 0xbd, 0x0f, 0x08, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, - 0x02, 0xc0, 0x7f, 0x7b, 0x08, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, - 0x02, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, - 0xfe, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/ext/tk/sample/demos-jp/images/noletter.bmp b/ext/tk/sample/demos-jp/images/noletter.bmp deleted file mode 100644 index 5774124efe..0000000000 --- a/ext/tk/sample/demos-jp/images/noletter.bmp +++ /dev/null @@ -1,27 +0,0 @@ -#define noletters_width 48 -#define noletters_height 48 -static char noletters_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00, - 0x00, 0xf0, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x7f, 0x00, - 0x00, 0x3e, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x1f, 0x00, 0x00, 0xf0, 0x01, - 0x80, 0x07, 0x00, 0x00, 0xc0, 0x03, 0xc0, 0x03, 0x00, 0x00, 0xe0, 0x07, - 0xe0, 0x01, 0x00, 0x00, 0xf0, 0x0f, 0xe0, 0x00, 0x00, 0x00, 0x78, 0x0e, - 0xf0, 0x00, 0x00, 0x00, 0x3c, 0x1e, 0x70, 0x00, 0x00, 0x00, 0x1e, 0x1c, - 0x38, 0x00, 0x00, 0x00, 0x0f, 0x38, 0x38, 0x00, 0x00, 0x80, 0x07, 0x38, - 0x3c, 0xfc, 0xff, 0xff, 0x7f, 0x78, 0x1c, 0x04, 0x00, 0xe0, 0x41, 0x70, - 0x1c, 0x04, 0x00, 0xf0, 0x40, 0x70, 0x1c, 0x74, 0x00, 0x78, 0x4e, 0x70, - 0x0e, 0x04, 0x00, 0x3c, 0x4a, 0xe0, 0x0e, 0x74, 0x03, 0x1e, 0x4a, 0xe0, - 0x0e, 0x04, 0x00, 0x0f, 0x4e, 0xe0, 0x0e, 0x04, 0x80, 0x07, 0x40, 0xe0, - 0x0e, 0x04, 0xf8, 0x0f, 0x40, 0xe0, 0x0e, 0x04, 0xe0, 0x01, 0x40, 0xe0, - 0x0e, 0x04, 0xf8, 0x00, 0x40, 0xe0, 0x0e, 0x04, 0x78, 0x00, 0x40, 0xe0, - 0x0e, 0x04, 0xfc, 0xf3, 0x40, 0xe0, 0x1c, 0x04, 0x1e, 0x00, 0x40, 0x70, - 0x1c, 0x04, 0x0f, 0x00, 0x40, 0x70, 0x1c, 0x84, 0x07, 0x00, 0x40, 0x70, - 0x3c, 0xfc, 0xff, 0xff, 0x7f, 0x78, 0x38, 0xe0, 0x01, 0x00, 0x00, 0x38, - 0x38, 0xf0, 0x00, 0x00, 0x00, 0x38, 0x70, 0x78, 0x00, 0x00, 0x00, 0x1c, - 0xf0, 0x3c, 0x00, 0x00, 0x00, 0x1e, 0xe0, 0x1e, 0x00, 0x00, 0x00, 0x0e, - 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x07, 0x00, 0x00, 0x80, 0x07, - 0x80, 0x07, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x1f, 0x00, 0x00, 0xf0, 0x01, - 0x00, 0x3e, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x7f, 0x00, - 0x00, 0xf0, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00}; diff --git a/ext/tk/sample/demos-jp/images/pattern.bmp b/ext/tk/sample/demos-jp/images/pattern.bmp deleted file mode 100644 index df31baf789..0000000000 --- a/ext/tk/sample/demos-jp/images/pattern.bmp +++ /dev/null @@ -1,6 +0,0 @@ -#define foo_width 16 -#define foo_height 16 -static char foo_bits[] = { - 0x60, 0x06, 0x90, 0x09, 0x90, 0x09, 0xb0, 0x0d, 0x4e, 0x72, 0x49, 0x92, - 0x71, 0x8e, 0x8e, 0x71, 0x8e, 0x71, 0x71, 0x8e, 0x49, 0x92, 0x4e, 0x72, - 0xb0, 0x0d, 0x90, 0x09, 0x90, 0x09, 0x60, 0x06}; diff --git a/ext/tk/sample/demos-jp/images/tcllogo.gif b/ext/tk/sample/demos-jp/images/tcllogo.gif Binary files differdeleted file mode 100644 index 3fc7720b17..0000000000 --- a/ext/tk/sample/demos-jp/images/tcllogo.gif +++ /dev/null diff --git a/ext/tk/sample/demos-jp/images/teapot.ppm b/ext/tk/sample/demos-jp/images/teapot.ppm deleted file mode 100644 index 78afefbf82..0000000000 --- a/ext/tk/sample/demos-jp/images/teapot.ppm +++ /dev/null @@ -1,56 +0,0 @@ -P6 -256 256 -255 -\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À[7 eOLjQLmSMoTMnSMlRMhPL_9 \À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀnSMtVMzYN~[N~[N\N\O€\O€]O€]O€]O€]O€\O€\O}[NyYNtVM\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀG-wXN}[N€]O„^O†_O†`O‡`Oˆ`Oˆ`OˆaO‰aO‰aO‰aO‰aO‰aO‰aOˆaOˆ`O†_Oƒ^O\N\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀaMLyYN…_O‰aP‹bPcPŽcPŽdPŽdPdPdPdPdPdPdPdPeP‘eP’eP’eP‘ePdPcP…_OpUM\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀwXN…_OdP“fP•gQ–hQ˜hQ˜iQ™iQ™iQšiQšiQšjQ›jQ›jQœjQœjQœjQœjQœjQ›jQœjQ™iQ“fP‡`O\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀNCJiQL‹bP—hQkQ¡mR¤nR¥oR¥oR¥oR¥oR¥oR¥oR¦oR¦oR¦pR¨pS©qSªqS«rS¬rS«rS©qS¤oRœjQ€]O\KK\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀfOLrUMcPŸlR©qS¯tS²uTµwT·xT¸xT¹yTºyT»zT»zU¼zU¼zU¼zU»zUºyT¸xT¶wT¯tS¡mR‰aOhPL\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\Àa0 cNLqUM€\O”fQ¦pS²wVºzV¿|VÂ}VÄVÆVÇ€VÉ‚WÌ…[Õeæ w÷³‹êª…Ĉg§qT“fQ{ZNYIK9\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀO1{G#‘JkRMqUMtVN–iS¨v\·€d¹bµzZ±vU°uT®sSªqS¤nRœjQ’eP„^OrUMHh>!T4\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀG-V5wE"~I#†M%U+¥e7²l:°g2®b*a(`(©^(¥])¡^-›]1ŠS,qC$`9 R3G-\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À@)J/i>!pA"tD"wF$yH&xH&tE$wE#yG%}M+ƒT4S5mE*Z7!K/B*;'\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À‰aO¦oR½{UÇ€VÏ…X<(F-a: e<!h>!j@#k@$h>"d<!c=$hD-fF2[<)K0@);'5$Ë‚VÇ€V¿|U_LKYIK\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À…_O·xTÉ‚Wó«€ûµ‹Ö’k¼|X×>µf-¨^(¡Z'šW&–T&œN>)F-J/b; g>#nD(jB&c<!b=%jH2_A/I0!<(8&5$”J¥Y’S%8&;'?)E,<:HA=HE?IJAISFJYIKXIK\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À£nRÁ}UܘqÊŠe±vU²e,™V&¥V†C -€@|>y<u:r9o7l6 -j5 -h4 -g3 -5$D,K/b; h>"wM1tK.e="a<#cA,U8&E-<(9&.!a0 b1 c1 - -+3#@)46G<:HMCIXHK\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀU*´vT¿~X¸{YÃk+›W&‰N$|>u:p8k5 -f3 -a0 _/ ]. [- I¡\*ª_(‘LkRMmSMmSMnSMnSMD,R3W5mA"|O0|P1j?"c<!a=%Y7"N1F,;'NCJNCJNDJODJODJODJh>!a: X/K% -g3 -a0 Z- \/T*Q(ŠHµm8kRMmSMnTMoTMpTMpUM15G15G05G04G04GpUMpTM5^9 d<!yF#O+€N,rC#qB"pB#k?"a: Z7 6ODJPDJPEJQEJQEJREJREJREJRFJSFJSFJSFJSFJe<!X/ -^/ V+Q(L&I$r9 TlRMnSM46G47G47G46G46G46G46G46G36G36G25G25G15G04G/4F.3F -ˆ`O~[NqUM[- ‰HUGJUGJVGJVGJVHJWHJWHJWHKWHKXHKXHKXHKXHKXHKXIKXIKXIKXIKXIKh>!Y0 - -L&C!:4 -X&pUMuWMwXNxXN<:H<:H<:H<:H<;H<;H<;H<;H=;H=;H=;H=;H>;H>;H?<H@<HA=HC>HG@ILBIREJ[JKcNLjQL§pR±uTºzUÃ~VÈWË‚XÖŽcäsÒŽe¼{V²vT¨pSžkR•gQŒbP†_O‚^O]O€\O€\O€\O€\O€]O]O]O]O]O]O]O]O]O]O]O€\O€\O~\N}[N|ZNxXN•T%H$ -›W&rVMvWNyYNzYN|ZN}[N}[N><H?<H?<H?<H?<H?<H@<H@<H@<HA=HA=HB=HC>HE?IG@IIAIKBIODJSFJWHK—hQŸlR§pR°b(¾i*Én+Ù|7Û|6Ïr,Íq+Êp-Ãl+»g)±b(®sS§pS lRšiQ•gQePcPŠaPˆaO‡`O‡`O†_O†_O…_O…_O…_O…_O…_O…_O…_O„_O„^O„^Oƒ^Oƒ^O‚]O]O€\O~[N{ZN•T% - - - - -@%<-$G?@…pfdNLuWM\NdNL\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀTFJvWN‰aP./01„E}[N]O…_Oˆ`O‰aP‹bPŒbPcPcPŽcPdPdPdPeP‘eP’eP’eP“fP“fQ”fQ•gQ•gQ–gQ–hQ—hQ˜hQ™iQšiQ›jQœjQkQkRžlRŸlRžY&¤\'¨^'µ^½bÀcÃeÇi ÄgÀc½b¼a¹`µ^´]¯X¢[' Z'žY&¢mR¡mR¡mR lRŸlRŸlRžkRkQœkQœjQ›jQšjQšiQ™iQ™iQ˜iQ˜hQ—hQ—hQ—hQ–gQ–gQ•gQ•gQ•gQ”fQ”fQ“fQ“fP’eP‘ePdPcP‰aP—O - B\À\À\À\À\À\À\À\À\À\À%7!!C*F#P){dYœze»p€\OgPL\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀSFJ`LKvWNŠaPm6 - -\À\À\À\À\À\À\À\À\À B B -$5 ¬`(¶e)£nRœjQƒ^OJAI\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀXIK^KKdNLhPLuWM‚]OŒbP”fQeP -m6 -†`OŽcP“fQ—hQ˜hQ™iQšiQšjQ›jQ›jQ›jQœjQœjQœjQœkQkQkQkRžkRžkRžkRžlRŸlRŸlRŸlR lR lR lR¡mR¡mR¡mR¡mRºg)³c(²c(±b(V¿cÂeÅi!Åi!Àd¼bº`¹`·_·_¶^¢Q§]'ª_(`(¹f)£nR£nR£nR£nR£nR£nR£nR¢nR¢nR¢nR¢nR¢nR¢nR¢mR¢mR¢mR¢mR¢mR¢mR¢mR¢mR¢mR¢nR¢mR¢mR£nR¢mR¢mR¡mR mRkR—hQˆGa0 ŠbP mRœjQ“fQ‰aP}[NrUMmSM…L$\À\À\À\À\À\À\À\À B B -#C, 8&H.Z7 §pR›jQ{ZN\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀQEJ[JK`LKdNLhQLqUM{ZN…_OŽcP–gQ—hQ -‹bP‘eP–hQšiQ›jQœjQkQkQkRžkRžkRžlRžlRŸlRŸlRŸlRŸlRŸlR lR lR lR mR¡mR¡mR¡mR¡mR¡mR¢mR¢mR¢mR¢nR£nRÀj*ºg)·e)¶d)Âd°XÅgÅhÂe¿c½b½b¾bªU`(®a(¯a(³c(¾i*¤oR¤oR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤oR¤oR¥oR¥oR¥oR¥oR¥oR¥oR¦oR¦oR¥oR¥oR¤nR¡mR›jQŽQ%Z- œjQ£nRŸlR—hQŽdP…_OuWMpTMnSMkRLa: \À\À\À\À\À\À\À B B&D2 -@*S6#G@IPDJ˜hQmSM\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀVGJ]KKbMLeOLiQLlRMvWN\OˆaO‘eP—hQœjQ•gQ -\À\À\À\À\À B'D+E$(1J/jH1NCJUGJYIKUGJ\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀXHK]KKbNLfOLiQLkRMmSMoTMqUMxXN\N†_OŒbP’fP˜hQkQ¡mR¥oR§pS¦pR˜hQ¢mR¥oR¨pSªqS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rSªrSªrSªrS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS«rS¬rS¬rS¬rS¬rS¬rS¬rS¬rS¬sS¬sSsSsSsSsSsSsS®sS®sS®sS®sS®tS¯tS°tS°uS±uS±uT±uT²uT²uT²uT´vTµwT´vT³vT²uT¯tS¢mR¯tS±uT±uS®tS«rS§pR¢mRkQ—hQ‘ePŠaPƒ^O\N{ZNvXNqUMpTMnSMlRMP%\À\À\À\À B#C*E$.E- .!G$Y:%d<"SFJYIKZIKNCJ\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀPDJZIK_LKdNLgPLjQLlRMnSMpTMqUMuWMyYN€\O†`OcP’fP—hQœjQ¡mR¥oR¨qS«rS«rSªrS mR -!C+E'0F.4F7%8%U/lG.SFJZIK]KKZIKB=H\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀREJZJK`LKdNLgPLjQLlRMnSMpTMqUMtWMxXN{ZN~[N]O„^O†`O‰aO‹bPdP•gQ™iQœkQ lR¤nR§pSªrSsS¯tT²uT´vT¶wT·xT¹yT¹yTºyTºyT¹yT¶xT´vT¬rS¢nR—hQ¿|U¿|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ}UÀ}UÁ}UÁ}UÁ}UÁ}UÂ}UÂ~UÃ~UÃ~VÃ~VÄVÅ€WÆX®a(ŸlRªrS´vT¸yT¼zU¾|UÁ~VÃXÆ‚[Ɇ_΋dÓ‘jÔ“mÔ“nБlÊŒhĆd½_¶{[°vWªsU¦pS¢nRžkRšiQ˜hQ•gQ“fQ‘ePdPŒbP‰aO†_Oƒ^O€\O|ZNxXNsVMpTMnTMmSMjQL€C B)D&/F-3F47G6%>"Y7 kA$YIK]KK^KKSFJ\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀVGJ\KKbMLeOLhPLkRLmSMnTMpTMrUMuWNyYN|ZN\N‚]O„_O‡`OŠaPŒbPŽcPeP“fP—hQ›jQžlR¢nR¥oS©qT¬sT¯uU²vU´wV¶xV¸yV¹yUºzU»zU¼{U½{U¾{U¾|U¿|U¿|U¿|U¿|U¾{U½{U¼{U¼zU»zTºyT¹yT¸xTµwT³vT´vT´vT´vT´wT´wTµwT·xT¹yTºzT¼zU½{U¾{U¿|UÀ|UÂ}UÄVÅ€WÇ‚YÉ„\͈_ÑŒdÙ”láuç£|쩂ſtî‡ëª…æ¦ÞŸ{Õ—sËŽl†d¹^³yZuW¨qU¤oSŸlRžkRœjQšiQ˜hQ–gQ”fQ‘ePdPcPŠaP‡`O„^O]O}[NyYNuWMpTMoTMmSMkRLgPL&D#.E,3F46G;'<(D"iB(VGJ]KK`LK[JKB>H\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀNCJYIK^LKcNLfOLiQLkRMmSMoTMqUMsVMvXNzYN}[N€\O‚^O…_Oˆ`OŠaPŒcPdP‘eP“fQ•gQ—hQ™iQkR mS¤oT¨rU¬tW°wY´zZ¸}\»]¾€^À^Á‚^‚^Â\Á€ZÁYÁXÁ~WÁ~WÂ~VÂ~VÂ~VÃ~VÃ~UÃ~UÄ~UÄ~UÄUÄUÅVÅVÅVÅVÆVÆ€VÆ€VÇ€WÇWÈ‚XɃZË…[͇^ЊaÓdØ’iÜ—nâtè£zî©ó¯‡ø´û¸‘üº“û¹“÷¶ñ±Œé©…à¡~Ö˜vËmÇf»€`´z[®vX©rU¥pT£oS¢nS lRžkRœkRšjQ˜iQ–hQ”fQ’ePdPcP‹bPˆ`O…_O‚]O~[NzYNvWNpTMoTMnSMkRMhQLo7,2F36G99HC+@ ]8 nA"\JK`ML_LKSFJ\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀSFJ[JK`LKdNLgPLjQLlRMnSMpTMqUMtVMwXNzZN}[N€]Oƒ^O†_OˆaO‹bPcPdP‘eP“fQ•gQ—hQ™iQ›jRžlR mS£oU§rW¬vZ²{]¹€a¿…fÅŠjËnГqÓ•sÕ–sÕ–rÕ–qÕ”oÓ’mÑjÏgÍŠcˈaɆ^È„\Ç‚[ÆYÅ€XÅ€WÅWÅWÅVÅVÅWÅ€WÆ€WÇXÈ‚YɃ[Ê…\͇_ÏŠaÒeÕ‘hÙ•mÝ™qávä¡zç¤}ê§€ë©ƒëª„é¨ƒå¥€ß |Ù›wÓ•rÌmƉh¿„c¸~^²yZ®vX¬tWªsV¨qU¦pT¤oS¢nS mRžlRœkR›jQ™iQ—hQ•gQ“fPePŽcP‹bPˆaO…_O‚^O\N{ZNwXNsVMoTMnSMlRMiQL~I#26G99G?<HA*E$ i@$ZIKaMLbML[JK;:H\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀWHJ]KKbMLeOLhPLjRLlSMnTMpTMrUMuWMxXN{ZN~\N]O„^O†`O‰aO‹bPŽcPdP’eP”fQ–gQ˜hQšiQœkRžlS mT£oU¦rWªuZ¯y]´~aºƒfŠlË’sÔšzÜ¡€ã§†è«‰ë®‹í¯Œí®‹ë¬ˆè¨„ã£~ßžyÚ™tÖ•oÒjÎŒfˈbÈ…_ƃ\ÅZÄ€YÃXÂWÂ~WÂ~WÂ~WÃXÀXÄ€YÅZƃ\Ç…^Ɇ`ˈbÌŠdÍ‹fÎgÎŽiÎŽjÎŽjÍŽjËŒiljgÆd¿ƒaº^¸}]¶|\´{[²yZ°xY®vX¬tWªsV¨qU¦pT¤oS¢nS mRžlRkR›jQ™iQ—hQ•gQ“fP‘ePŽdPŒbP‰aO†_Oƒ^O€\O|ZNxXNtVMpTMnSMmSMjQLgPL99G?<HG-E&b;!YIK`MLdOM`LKNCJ\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀŸlRºyTÄ~UÊ‚XʃYÄXº{WtUšW'¢[(—hQ lRcP€\OhQL\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀNCJYIK^LKcNLfOLiQLkRLmSMoTMqUMrVMvWNyYN|ZN\N‚]O„_O‡`O‰aPŒbPŽcPdP’fP”gQ–hQ˜iQšjRœkRžlS¡nT¤pU§sW«vZ°z]µb»„gŠlÉ‘sИyØžÞ¤…㩊èì±ï³‘ﳑëŠç©…⣀ݞzؘtÒ“nÎiɉdÆ…`Â]Á€[¿~Y¾}X½|W½|V¼{V¼{V¼{V¼{V¼{V¼|W¼|W½}X½}Y½~Z½~Z¼~Z»}[º}[º}[º~\º~\º~]º~]¹~]¸~]·}]¶|\´z[²yZ°wY®vX¬tWªsV¨rU¦pT¤oS¢nS mRŸlRkR›jQšiQ˜hQ–gQ“fQ‘ePdPŒcPŠaP‡`O„^O]O}[NyYNuWNpTMnTMmSMkRLhPL|H$D>IQ2P+XHK_LLfQOcNLXIK\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À©qSºyTÃ~VΈ`遲ޜv¾€]ªqS–LŽG|>g3 -S)?*%.—hQ—hQ‘eP‡`OuWM\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀSFJ[JK`LKdNLgPLjQLlRMnSMoTMqUMsVMwXNzYN}[N€\O‚^O…_O‡`OŠaPŒbPŽdP‘eP“fP•gQ—hQ˜iQšjRœkRŸlS¡nT¤pV§sX«vZ°z^¶b¼…gËmÊ’sјzØŸ€Þ¤…㩊èê¯ë°ê¯Žè¬‹å¨‡à¤‚Ûž|Ö™wÑ“qÌŽlljgÃ…bÀ‚_½\»}Zº{X¹zW¸yV·yU·xU·xU·xT·xT·xU·xU·xU·yV·yV·yW¸zW¸{X¹{Y¹|Zº}[º}[º}\º~\¹~]¹~]¸}]·|\µ{\´z[²yZ°wY®vX¬tWªsV¨rU¦pT¤oS¢nS¡mRŸlRkRœjQšiQ˜hQ–gQ”fQ’ePdPcPŠbP‡`O…_O‚]O~[NzZNvWNrUMoTMmSMlRMiQLeOLJAIJ(h>!]KKfQOgQN_LKD>I\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À™iQ°tS¸yT¼{UÂYÎŒeïˆô´Õ—u¶|\ Z'™LˆD -|> - -+,!.! "`E6†iYŒlZo\“q]•s^^J™va›wbycŸzd {e¤}foTMqUMsVMuWNwXNyYN{ZN|ZN~[N\O]O‚]Oƒ^O…_O†_O‡`Oˆ`O‰aOŠaP‹bPŒbPŒcPcPŽcPŽdPdPdPdPeP‘eP‘eP‘eP’eP’eP’eP’eP’fP’fP’fP“fP’fP’fP’fP’eP’eP’eP‘eP‘eP‘ePePdPdPdPŽdPŽcPcPŒcPŒbP‹bPŠaP‰aOˆ`O‡`O†_O…_Oƒ^O‚]O]O\O~[N|[N{ZNyYNwXN®ƒi¬ƒiª‚i¨i¦€hŒhR‰fQ†dQ‚bP•wfx]Oˆpdkbtd_m`]OEDG?A;:@.S….S….S….S….S…/S…/S…/S…/S…/S…/S…/S…/S…TxªTxªTxªTxªTxªTx«Tx«Tx«Ty«/S†GlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlž…ªÜ…ªÜ…ªÜHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlž…ªÜ…ªÜ£Ö£Ö£Ö£Ö¤Ö¤Ö¤Ö¤Ö¤ÖEi›€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤×€¤×€¤×€¤×€¥×€¥×€¥×Bg™Bg™Bg™Bg™Bg™&J|&J|&J|&J|&J|&J|&J|&J|&J|&J|&J|&J|&J|Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Af˜Af˜%J|%J|%J|%J|%J|%J|%J|%J|%J|%J|%I|%I|%I|%I|%I|%I| -+,YA5jPBpSD‹l[o]’q^–t`‚_Kšwbœycžze {f¡}g¤h¨i”lSrVMtWMvWNxXNyYN{ZN|[N~[N\O]O‚]Oƒ^O„_O…_O†`O‡`Oˆ`O‰aPŠaP‹bP‹bPŒbPcPcPŽcPŽcPdPdPdPdPdPdPdPdPePePePePePdPdPdPdPdPdPdPŽcPŽcPcPcPŒbP‹bP‹bPŠaP‰aOˆ`O‡`O†`O…_O„^Oƒ^O‚]O€]O\O~[N|[N{ZNyYNxXN°…j®„j¬„jªƒj¨‚j¦€jŒhSŠgS†eRƒcR|`QŒsf…oe}jcrd`k_]LCDC=@,,3(4F(4F.S….S…/S…/S…/S…/S…/S…/S…/S…TxªTxªTxªTxªTxªTxªTx«Tx«Tx«Ty«Ty«Ty«…ªÜHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlž†ªÜHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžChšChš¤Ö€¤Ö€¤Ö€¤Ö€¤ÖEi›Ei›Ei›€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤Ö€¤×€¤×€¤×€¤×Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Bg™Bg™&J|&J|&J|&J|&J|&J|&J|&J|&J|&J|Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜&J|%J|%J|%J|%J|%J|%J|%J|%J|%J|%J|%J|%I|%I|%I|%I|%I|#5H71O;3V?4iOBoSDsVFo]{[I^Kƒ`L…bN‡dOŸ{f }g¢~h¥€j’kT•mU˜oVšqWrWwXNxXNzYN{ZN}[N~[N\O€]O‚]Oƒ^O„^O…_O…_O†`O‡`Oˆ`O‰aO‰aPŠaP‹bP‹bPŒbPŒbPŒcPcPcPcPŽcPŽcPŽcPŽcPŽcPŽcPŽcPŽcPŽcPŽcPcPcPcPŒcPŒbP‹bP‹bP‹bPŠaP‰aP‰aOˆ`O‡`O†_O…_O„_O„^Oƒ^O]O€\O\N~[N|ZN{ZNyYN›oTšoT™oT—nT¬„lªƒl¨‚ljUŒiTŠhT†fT€cSvi‰rgnfyidqdah^^HBD?<@)+3OZkMYk(5F(5F(5F/S…/S…/S…/S…/S…TxªTxªTxªTxªTxªTxªTx«Tx«Ty«Ty«Ty«Ty«Uy«†ªÜ†ªÜ†ªÜ†ªÜHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlž†ªÜ†ªÜ†ªÜ†ªÜ†ªÜHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžHlžDhšDhšDhšChš&K}&K}&K}&K}&K}&K}ChšChšCgšCgšCgšCgšCgšCgšCg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™&J|&J|&J|&J|&J|&J|Bg™Bg™Bg™Bf™Bf™Bf™Bf™Bf™Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜&J|&J|&J|&J|%J|%J|%J|%J|%J|%J|%J|%J|%J|%J|%J|%I|%I|A99N?;L:2T>4gNBlRD‡k\‹n^z[J~^LaN…cO‡dP‰fQŠgRŒhTjU’lV•nW˜pXšrXsY¶‹q¸qºŽr¼r½r¿s©z[©z[ªz[«{[¬{[¬{ZÅ“rÅ’qÅ’qÅ’pÅ’pÅ‘oyVxV¬xU¬wT¬wTŠaPŠbP‹bP‹bP‹bP‹bP‹bP‹bP‹bP‹bP‹bP‹bP‹bP‹bPŠaPŠaPŠaP‰aP‰aOˆaOˆ`O‡`O‡`O†_O…_O„^Oƒ^O‚^O‚]O]O€\O~\N}[N|ZNzYNpTœpU›pUšpU˜oV—oV•nV“mV‘lVkVŒjVˆhVƒfU~cUuj†qh~mfugdkaad\^E@D98?$(2minffm^blV^lMYk(5F(5F/S…TxªTxªTxªTxªTxªTxªTxªTx«Tx«Ty«Ty«Ty«Uy«Uy«†ªÜ†ªÜ†ªÜ†ªÜ†ªÜ†ªÜ†ªÜ†ªÜHlžHlžHlžHlžHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸ†ªÝ†ªÝ†ªÝ†ªÝ†ªÝ†ªÝ†ªÝ†ªÝ†ªÝ†ªÝHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸHlŸ'K}'K}'K}'K}'K}'K}'K}'K}'K}&K}&K}ChšChšChšChšChšChšChšCgšCgšCgšCgšCgšCgšCg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™&J|Cg™Cg™Cg™Cg™Cg™Bg™Bg™Bg™Bg™Bg™Bg™Bf™Bf™Bf™Bf™Bf™Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜Bf˜&J|&J|&J|&J|&J|&J|&J|%J|%J|%J|%J|%J|%J|%J|Ae˜Ae˜;GY<68I=:I82Q=4XA6~fZ„j\‰m^p`|]L€`NƒcP†eQˆgS¡j£€l¦‚m©„n•oX˜qYšrZt[¶Œr¸sºs¼t½t¾‘t¨z]©{]ª{]«{\«{\¬{\¬{[Ä“sÄ“rÄ’rÄ’qÄ’pÄ‘p¬yWÄoÃnÃmÃlÂŽlÂŽkÁkˆaOˆaOˆaOˆaOˆaOˆaOˆaOˆ`Oˆ`O‡`O‡`O‡`O†`O†_O…_O…_O„_O„^Oƒ^O‚]O]O€]O\O~\N}[N|ZN¶‰l¶‰lµˆmœqV›qVšqV™pW˜pW–oW¬…nª…n§„n¤‚nŸ€n›~n€eW‘xlŠtk‚piykfodcf_`JDG@>C*,5$1MYktr~tstmolinadmX_lNZkMZkTxªTxªTxªTxªTx«Tx«Tx«Ty«Ty«Ty«Uy«Uy«Uy«†ªÝ†ªÝ†ªÝ†ªÝ†ªÝ†ªÝ†«Ý†«Ý†«Ý†«ÝHlŸHlŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸ†«Ý†«Ý†«Ý‡«Ý‡«Ý‡«Ý‡«Ý‡«Ý‡«Ý‡«Ý‡«Ý‡«Ý‡«ÝHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸHmŸ'K}'K}'K}'K}'K}'K}'K}'K}'K}'K}'K}'K}DhšDhšDhšDhšChšChšChšChšChšChšChšCgšCgšCgšCgšCgšCgšCg™Cg™Cg™Cg™Cg™&J}&J}&J}Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Cg™Bg™Bg™Bg™Bg™Bg™Bg™Bf™Bf™Bf™Bf™Bf˜Bf˜Bf˜Bf˜Bf˜&J|&J|&J|&J|&J|&J|&J|&J|&J|&J|Af˜Af˜Af˜Af˜;GY;GY;GY1'!D:9N?;N;3]I?zdY€h[†l^‹oasc“ue€bQ„dR‡fT l¢m¦ƒn©…o«‡p®ˆq±Šr³‹sžv] w]¹u»u¼‘u¾‘u¿’v¨{^©{^ª|^«|]«|]«{\¬{\¬{[¬{[¬zZ«zZ«yY«yX«xXÂoÂnÂnÁŽmÁŽm¨uT¨uS§tS§tS§tR¦sR¦sQ…_O…_O…_O„^O„^Oƒ^Oƒ^O‚^O‚]O]O€]O¢rS¡rS¡rS¸‰k·‰l·‰l¶‰m¶‰mµ‰m´‰n³‰n›qWšqX™qX®‡o‡o«†p¨…p¤ƒp pœp—}o{cXv`Vp]U}nishfhaba\_DAF::B$)4 -., 7(8'A1&F4(L8*oXIw]Jpdasfcvhexkg{mi~oj€qll\Xn^Yp`Zpa[qa\rb]rc^sc^sd_ue`wf`xgayhayhayhbxy‘y‘y‘y‘yy~ywgbvfateasd`qd`pc`nb_la_€ut|ssxqrunpZUXVRWROUMMSHIRIC@967-/3'+0(*-ACF?AD;=@#%( -.+>1(B3)B2&F4'E4)gTGlXJs^OzcTzaPqfethgvjhbVTcWUdXVeYWfZXg[Yh\Zi]Zi][j^\€us€ususts~tt~tt}tt|st{stut~tt|sszrsyqrwpquoqsmpqloXTXTQWPOULLSSJEA<:=99757335./2113)+.'),)+.8:="( -"6*#5*">2)>0&A2'C3(I8-^OFbRHfUJjXMq^RwcVzfYfRDfQCdN@zdTqijrjksklrklrklrklqjmpjmpjmojmojmnimmimkhliflscYm`Xg\VbYT^VRE>;A<:>98:77645:873220/0,-/)+.*,/#%( & - -&3#.$-% .% .& /&!,#,#@70A71XNHXNHWNHWNHZRLYQLYQLXQLWQLWPLUOLSNLQMKOLJMJJ0//.-.,,-&(+"(!' - -%' %$#" ! !$ - - - - - -* - ;?E7CU;HY=I[ diff --git a/ext/tk/sample/demos-jp/items.rb b/ext/tk/sample/demos-jp/items.rb deleted file mode 100644 index e1007c5a8d..0000000000 --- a/ext/tk/sample/demos-jp/items.rb +++ /dev/null @@ -1,372 +0,0 @@ -# -# canvas item types widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($items_demo) && $items_demo - $items_demo.destroy - $items_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$items_demo = TkToplevel.new {|w| - title("Canvas Item Demonstration") - iconname("Items") - positionWindow(w) -} - -# label À¸À® -TkLabel.new($items_demo) { - font $font - wraplength '5i' - justify 'left' - text "¤³¤Î¥¦¥£¥ó¥É¥¦¤Ë¤Ï¥¥ã¥ó¥Ð¥¹ widget ¤¬Æþ¤Ã¤Æ¤ª¤ê¡¢¤½¤ÎÃæ¤Ë¤Ï¥¥ã¥ó¥Ð¥¹ widget ¤¬¥µ¥Ý¡¼¥È¤¹¤ëÍÍ¡¹¤Ê¥¿¥¤¥×¤Î¥¢¥¤¥Æ¥à¤ÎÎ㤬Æþ¤Ã¤Æ¤¤¤Þ¤¹¡£¼¡¤Î¤è¤¦¤ÊÁàºî¤¬¤Ç¤¤Þ¤¹¡£\n ¥Ü¥¿¥ó-1 ¥É¥é¥Ã¥°:\t¥¢¥¤¥Æ¥à¤òư¤«¤¹¡£\n ¥Ü¥¿¥ó-2 ¥É¥é¥Ã¥°:\t¸«¤¨¤Æ¤¤¤ëÉôʬ¤ò¤º¤é¤¹¡£\n ¥Ü¥¿¥ó-3 ¥É¥é¥Ã¥°:\tÎΰè¤ò°Ï¤¦¡£\n ¥³¥ó¥È¥í¡¼¥ë-F:\tÎΰè¤Î²¼¤Î¥¢¥¤¥Æ¥à¤òɽ¼¨¤¹¤ë¡£" -}.pack('side'=>'top') - -# frame À¸À® -TkFrame.new($items_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $items_demo - $items_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'items'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame À¸À® -cvs = nil -TkFrame.new($items_demo) {|cf| - # canvas À¸À® - cvs = TkCanvas.new(cf) {|c| - focus - scrollregion '0c 0c 30c 24c' - width '15c' - height '10c' - relief 'sunken' - borderwidth 2 - - hs = TkScrollbar.new(cf) {|s| - orient 'horizontal' - command proc{|*args| c.xview(*args)} - c.xscrollcommand proc{|first,last| s.set first,last} - } - - vs = TkScrollbar.new(cf) {|s| - command proc{|*args| c.yview(*args)} - c.yscrollcommand proc{|first,last| s.set first,last} - } - - if $tk_version =~ /^4\.[01]/ - hs.pack('side'=>'bottom', 'fill'=>'x') - vs.pack('side'=>'right', 'fill'=>'y') - c.pack('in'=>cf, 'expand'=>'yes', 'fill'=>'both') - - else - c.grid('in'=>cf, 'row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - vs.grid('row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - hs.grid('row'=>1, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - TkGrid.rowconfigure(cf, 0, 'weight'=>1, 'minsize'=>0) - TkGrid.columnconfigure(cf, 0, 'weight'=>1, 'minsize'=>0) - - end - - } -}.pack('side'=>'top', 'fill'=>'both', 'expand'=>'yes') - -# Display a 3x3 rectangular grid -TkcRectangle.new(cvs, '0c', '0c', '30c', '24c', 'width'=>2) -TkcLine.new(cvs, '0c', '8c', '30c', '8c', 'width'=>2) -TkcLine.new(cvs, '0c', '16c', '30c', '16c', 'width'=>2) -TkcLine.new(cvs, '10c', '0c', '10c', '24c', 'width'=>2) -TkcLine.new(cvs, '20c', '0c', '20c', '24c', 'width'=>2) - -font1 = '-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*' -font2 = '-Adobe-Helvetica-Bold-R-Normal--*-240-*-*-*-*-*-*' -if TkWinfo.depth($root).to_i > 1 - blue = 'DeepSkyBlue3' - red = 'red' - bisque = 'bisque3' - green = 'SeaGreen3' -else - blue = 'black' - red = 'black' - bisque = 'black' - green = 'black' -end - -# tag ¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À® -$tag_item = TkcGroup.new(cvs) - -# Set up demos within each of the areas of the grid. -TkcText.new(cvs, '5c', '.2c', 'text'=>'¥é¥¤¥ó', 'anchor'=>'n') -TkcLine.new(cvs, '1c', '1c', '3c', '1c', '1c', '4c', '3c', '4c', - 'width'=>2, 'fill'=>blue, 'capstyle'=>'butt', - 'join'=>'miter', 'tags'=>$tag_item ) -TkcLine.new(cvs, '4.67c','1c','4.67c','4c', 'arrow'=>'last', 'tags'=>$tag_item) -TkcLine.new(cvs, '6.33c','1c','6.33c','4c', 'arrow'=>'both', 'tags'=>$tag_item) -TkcLine.new(cvs, '5c','6c','9c','6c','9c','1c','8c','1c','8c','4.8c','8.8c', - '4.8c','8.8c','1.2c','8.2c','1.2c','8.2c','4.6c','8.6c','4.6c', - '8.6c','1.4c','8.4c','1.4c','8.4c','4.4c', - 'width'=>3, 'fill'=>red, 'tags'=>$tag_item ) -TkcLine.new(cvs, '1c','5c','7c','5c','7c','7c','9c','7c', 'width'=>'.5c', - 'stipple'=>'@'+[$demo_dir, - 'images','gray25.bmp'].join(File::Separator), - 'arrow'=>'both', 'arrowshape'=>'15 15 7', 'tags'=>$tag_item ) -TkcLine.new(cvs, '1c','7c','1.75c','5.8c','2.5c','7c','3.25c','5.8c','4c','7c', - 'width'=>'.5c', 'capstyle'=>'round', 'join'=>'round', - 'tags'=>$tag_item ) - -TkcText.new(cvs, '15c', '.2c', - 'text'=>'¶ÊÀþ (³ê¤é¤«¤Ë¤Ä¤Ê¤¤¤ÀľÀþ)', 'anchor'=>'n') -TkcLine.new(cvs, '11c','4c','11.5c','1c','13.5c','1c','14c','4c', - 'smooth'=>'on', 'fill'=>blue, 'tags'=>$tag_item ) -TkcLine.new(cvs, '15.5c','1c','19.5c','1.5c','15.5c','4.5c','19.5c','4c', - 'smooth'=>'on', 'arrow'=>'both', 'width'=>3, 'tags'=>$tag_item ) -TkcLine.new(cvs, '12c','6c','13.5c','4.5c','16.5c','7.5c','18c','6c', - '16.5c','4.5c','13.5c','7.5c','12c','6c', - 'smooth'=>'on', 'width'=>'3m', 'capstyle'=>'round', - 'stipple'=>'@'+[$demo_dir, - 'images', 'gray25.bmp'].join(File::Separator), - 'fill'=>red, 'tags'=>$tag_item ) - -TkcText.new(cvs, '25c', '.2c', 'text'=>'¿³Ñ·Á', 'anchor'=>'n') -TkcPolygon.new(cvs, '21c','1.0c','22.5c','1.75c','24c','1.0c','23.25c','2.5c', - '24c','4.0c','22.5c','3.25c','21c','4.0c','21.75c','2.5c', - 'fill'=>'green', 'outline'=>'black', 'width'=>4, - 'tags'=>$tag_item ) -TkcPolygon.new(cvs, '25c','4c','25c','4c','25c','1c','26c','1c','27c','4c', - '28c','1c','29c','1c','29c','4c','29c','4c', - 'fill'=>red, 'smooth'=>'on', 'tags'=> $tag_item) -TkcPolygon.new(cvs, '22c','4.5c','25c','4.5c','25c','6.75c','28c','6.75c', - '28c','5.25c','24c','5.25c','24c','6.0c','26c','6c','26c', - '7.5c','22c','7.5c', - 'stipple'=>'@' + [$demo_dir, - 'images', 'gray25.bmp'].join(File::Separator), - 'outline'=>'black', 'tags'=>$tag_item ) - -TkcText.new(cvs, '5c', '8.2c', 'text'=>'¶ë·Á', 'anchor'=>'n') -TkcRectangle.new(cvs, '1c','9.5c','4c','12.5c', - 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item) -TkcRectangle.new(cvs, '0.5c','13.5c','4.5c','15.5c', - 'fill'=>green, 'tags'=>$tag_item ) -TkcRectangle.new(cvs, '6c','10c','9c','15c', 'outline'=>'', - 'stipple'=>'@'+[$demo_dir, - 'images','gray25.bmp'].join(File::Separator), - 'fill'=>blue, 'tags'=>$tag_item ) - -TkcText.new(cvs, '15c', '8.2c', 'text'=>'Âʱß', 'anchor'=>'n') -TkcOval.new(cvs, '11c','9.5c','14c','12.5c', - 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item) -TkcOval.new(cvs, '10.5c','13.5c','14.5c','15.5c', - 'fill'=>green, 'tags'=>$tag_item ) -TkcOval.new(cvs, '16c','10c','19c','15c', 'outline'=>'', - 'stipple'=>'@'+[$demo_dir, - 'images','gray25.bmp'].join(File::Separator), - 'fill'=>blue, 'tags'=>$tag_item ) - -TkcText.new(cvs, '25c', '8.2c', 'text'=>'¥Æ¥¥¹¥È', 'anchor'=>'n') -TkcRectangle.new(cvs, '22.4c','8.9c','22.6c','9.1c') -TkcText.new(cvs, '22.5c', '9c', 'anchor'=>'n', 'font'=>font1, 'width'=>'4c', - 'text'=>'û¤¤¥Æ¥¥¹¥È¡£¥ï¡¼¥É¥é¥Ã¥×¡¢º¸Â·¤¨¡¢¥¢¥ó¥«¡¼¤ÏËÌ (¾å)¡£\ -¢¢¤Ï³Æ¥Æ¥¥¹¥È¤Î¥¢¥ó¥«¡¼¥Ý¥¤¥ó¥È¤ò¼¨¤¹¡£', 'tags'=>$tag_item ) -TkcRectangle.new(cvs, '25.4c','10.9c','25.6c','11.1c') -TkcText.new(cvs, '25.5c', '11c', 'anchor'=>'w', 'font'=>font1, 'fill'=>blue, - 'text'=>'¤¤¤¯¤Ä¤«¤Î¹Ô¡£\n¤½¤ì¤¾¤ìÆÈΩ¤Ë\n¹Ô·¤¨¡£\n\ -Á´¤Æº¸Ã¼¤¬¥¢¥ó¥«¡¼¤µ¤ì¤Æ¤¤¤ë¡£', 'justify'=>'center', 'tags'=>$tag_item ) -TkcRectangle.new(cvs, '24.9c','13.9c','25.1c','14.1c') -if $tk_version =~ /^4\.[01]/ - TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red, - 'stipple'=>'@' + [$demo_dir, - 'images', 'grey.5'].join(File::Separator), - 'text'=>'Stippled characters', 'tags'=>$tag_item ) -else - TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red, - 'stipple'=>'gray50', 'text'=>'Stippled characters', - 'tags'=>$tag_item ) -end - -TkcText.new(cvs, '5c', '16.2c', 'text'=>'¸Ì', 'anchor'=>'n') -TkcArc.new(cvs, '0.5c','17c','7c','20c', 'fill'=>green, 'outline'=>'black', - 'start'=>45, 'extent'=>270, 'style'=>'pieslice', 'tags'=>$tag_item) -#TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc', -# 'outline'=>blue, 'start'=>135, 'extent'=>270, -# 'outlinestipple'=>'@' + ['images', 'grey.25'].join(File::Separator), -# 'tags'=>$tag_item) -TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc', - 'outline'=>blue, 'start'=>135, 'extent'=>270, - 'outlinestipple'=>'@'+[$demo_dir, - 'images','gray25.bmp'].join(File::Separator), - 'tags'=>$tag_item) -TkcArc.new(cvs, '0.5c','20c','9.5c','24c', 'width'=>'4m', 'style'=>'pieslice', - 'fill'=>'', 'outline'=>red, 'start'=>225, 'extent'=>90, - 'tags'=>$tag_item) -TkcArc.new(cvs, '5.5c','20.5c','9.5c','23.5c', 'width'=>'4m', 'style'=>'chord', - 'fill'=>blue, 'outline'=>'', 'start'=>45, 'extent'=>270, - 'tags'=>$tag_item) - -TkcText.new(cvs, '15c', '16.2c', 'text'=>'¥Ó¥Ã¥È¥Þ¥Ã¥×', 'anchor'=>'n') -#TkcBitmap.new(cvs, '13c','20c', -# 'bitmap'=>'@' + ['images', 'face'].join(File::Separator), -# 'tags'=>$tag_item) -TkcBitmap.new(cvs, '13c','20c', - 'bitmap'=>'@' + [$demo_dir, - 'images', 'face.bmp'].join(File::Separator), - 'tags'=>$tag_item) -#TkcBitmap.new(cvs, '17c','18.5c', -# 'bitmap'=>'@' + ['images', 'noletters'].join(File::Separator), -# 'tags'=>$tag_item) -TkcBitmap.new(cvs, '17c','18.5c', - 'bitmap'=>'@' + [$demo_dir, - 'images', 'noletter.bmp'].join(File::Separator), - 'tags'=>$tag_item) -#TkcBitmap.new(cvs, '17c','21.5c', -# 'bitmap'=>'@' + ['images', 'letters'].join(File::Separator), -# 'tags'=>$tag_item) -# ¢¤Î·Á¼°¤Ç¤â²Äǽ -TkcBitmap.new(cvs, '17c','21.5c') { - bitmap '@' + [$demo_dir, 'images', 'letters.bmp'].join(File::Separator) - tags $tag_item -} -#TkcBitmap.new(cvs, '17c','21.5c') { -# bitmap '@' + ['images', 'letters'].join(File::Separator) -# tags $tag_item -#} - -TkcText.new(cvs, '25c', '16.2c', 'text'=>'¥¦¥£¥ó¥É¥¦', 'anchor'=>'n') -TkButton.new(cvs) {|b| - text '²¡¤·¤Æ¤Í' - command proc{butPress cvs, red} - TkcWindow.new(cvs, '21c','18c', - 'window'=>b, 'anchor'=>'nw', 'tags'=>$tag_item) -} -TkEntry.new(cvs, 'width'=>20, 'relief'=>'sunken') {|e| - insert 'end', 'ÊÔ½¸¤·¤Æ¤Í' - TkcWindow.new(cvs, '21c','21c', - 'window'=>e, 'anchor'=>'nw', 'tags'=>$tag_item) -} -TkScale.new(cvs, 'from'=>0, 'to'=>100, 'length'=>'6c', 'sliderlength'=>'.4c', - 'width'=>'.5c', 'tickinterval'=>0 ) {|scl| - TkcWindow.new(cvs, '28.5c','17.5c', - 'window'=>scl, 'anchor'=>'n', 'tags'=>$tag_item) -} -TkcText.new(cvs, '21c', '17.9c', 'text'=>'¥Ü¥¿¥ó:', 'anchor'=>'sw') -TkcText.new(cvs, '21c', '20.9c', 'text'=>'¥¨¥ó¥È¥ê:', 'anchor'=>'sw') -TkcText.new(cvs, '28.5c', '17.4c', 'text'=>'¥¹¥±¡¼¥ë:', 'anchor'=>'s') - -# Set up event bindings for canvas: -cvs.itembind($tag_item, 'Any-Enter', proc{itemEnter cvs}) -cvs.itembind($tag_item, 'Any-Leave', proc{itemLeave cvs}) -cvs.bind('2', proc{|x,y| cvs.scan_mark x,y}, '%x %y') -cvs.bind('B2-Motion', proc{|x,y| cvs.scan_dragto x,y}, '%x %y') -cvs.bind('3', proc{|x,y| itemMark cvs,x,y}, '%x %y') -cvs.bind('B3-Motion', proc{|x,y| itemStroke cvs,x,y}, '%x %y') -cvs.bind('Control-f', proc{itemsUnderArea cvs}) -cvs.bind('1', proc{|x,y| itemStartDrag cvs,x,y}, '%x %y') -cvs.bind('B1-Motion', proc{|x,y| itemDrag cvs,x,y}, '%x %y') -# Utility methods for highlighting the item under the pointer - -$restoreCmd = nil -def itemEnter (c) - if TkWinfo.depth(c).to_i == 1 - $restoreCmd = nil - return - end - type = c.itemtype('current') - if type == TkcWindow - $restoreCmd = nil - return - end - if type == TkcBitmap - bg = (c.itemconfiginfo('current', 'background'))[4] - $restoreCmd = proc{c.itemconfigure 'current', 'background', bg} - c.itemconfigure 'current', 'background', 'SteelBlue2' - return - end - fill = (c.itemconfiginfo('current', 'fill'))[4] - if (type == TkcRectangle || type == TkcOval || type == TkcArc) && fill == [] - outline = (c.itemconfiginfo('current', 'outline'))[4] - $restoreCmd = proc{c.itemconfigure 'current', 'outline', outline} - c.itemconfigure 'current', 'outline', 'SteelBlue2' - else - $restoreCmd = proc{c.itemconfigure 'current', 'fill', fill} - c.itemconfigure 'current', 'fill', 'SteelBlue2' - end -end - -def itemLeave(c) - $restoreCmd.call if $restoreCmd -end - -# Utility methods for stroking out a rectangle and printing what's -# underneath the rectangle's area. - -def itemMark(c,x,y) - $areaX1 = c.canvasx(x) - $areaY1 = c.canvasy(y) - c.delete 'area' -end - -def itemStroke(c,x,y) - x = c.canvasx(x) - y = c.canvasy(y) - if $areaX1 != x && $areaY1 != y - c.delete 'area' - c.addtag_withtag 'area', TkcRectangle.new(c, $areaX1, $areaY1, x, y, - '-outline', 'black') - $areaX2 = x - $areaY2 = y - end -end - -def itemsUnderArea(c) - area = c.find_withtag('area') - items = [] - c.find_enclosed($areaX1,$areaY1,$areaX2,$areaY2).each{|i| - items.push(i) if i.gettags.include?($tag_item) - } - print "Items enclosed by area: #{items.inspect}\n"; STDOUT.flush - items.clear - c.find_overlapping($areaX1,$areaY1,$areaX2,$areaY2).each{|i| - items.push(i) if i.gettags.include?($tag_item) - } - print "Items overlapping area: #{items.inspect}\n"; STDOUT.flush -end - -$areaX1 = 0 -$areaY1 = 0 -$areaX2 = 0 -$areaY2 = 0 - -# Utility methods to support dragging of items. - -def itemStartDrag(c,x,y) - $lastX = c.canvasx(x) - $lastY = c.canvasy(y) -end - -def itemDrag(c,x,y) - x = c.canvasx(x) - y = c.canvasy(y) - c.move 'current', x - $lastX, y - $lastY - $lastX = x - $lastY = y -end - -# Method that's invoked when the button embedded in the canvas -# is invoked. - -def butPress(w,color) - i = TkcText.new(w, '25c', '18.1c', - 'text'=>'¤¤¤Æ¤Æ!!', 'fill'=>color, 'anchor'=>'n') - Tk.after(500, proc{w.delete i}) -end diff --git a/ext/tk/sample/demos-jp/ixset b/ext/tk/sample/demos-jp/ixset deleted file mode 100644 index 46c2378073..0000000000 --- a/ext/tk/sample/demos-jp/ixset +++ /dev/null @@ -1,333 +0,0 @@ -#!/usr/bin/env ruby - -# ixset -- -# A nice interface to "xset" to change X server settings -# - -require 'tk' - -class Xsettings - # - # Button actions - # - def quit - @root.destroy - end - - def ok - writesettings - quit - end - - def cancel - readsettings - dispsettings - end - - # apply is just "writesettings" - - - # - # Read current settings - # - def readsettings - xfd = open("|xset q", 'r') - xfd.readlines.each{|line| - fields = line.chomp.strip.split(/\s+/) - case fields[0] - when "auto" - if fields[1] == 'repeat:' - @kbdrep = fields[2] - @w_kbdrep.set(@kbdrep) - @kbdcli = fields[6] - end - - when "bell" - @bellvol = fields[2] - @bellpit = fields[5] - @belldur = fields[8] - - when "acceleration:" - @mouseacc = fields[1] - @mousethr = fields[3] - - when "prefer" - if fields[2] == 'yes' - @screenbla = 'blank' - else - @screenbla = 'noblank' - end - @w_screenbla.set(@screenbla) - - when "timeout:" - @screentim = fields[1] - @screencyc = fields[3] - - end - } - - xfd.close - end - - # - # Write settings into the X server - # - def writesettings - @bellvol = @w_bellvol.get - @bellpit = @w_bellpit.get - @belldur = @w_belldur.get - - @kbdrep = @w_kbdrep.get - if @kbdrep == 'on' - @kbdcli = @w_kbdcli.get - else - @kbdcli = 'off' - end - - @mouseacc = @w_mouseacc.get - @mousethr = @w_mousethr.get - - @screentim = @w_screentim.get - @screencyc = @w_screencyc.get - @screenbla = @w_screenbla.get - - system("xset \ - b #{@bellvol} #{@bellpit} #{@belldur} \ - c #{@kbdcli} \ - r #{@kbdrep} \ - m #{@mouseacc} #{@mousethr} \ - s #{@screentim} #{@screencyc} \ - s #{@screenbla}") - end - - # - # Sends all settings to the window - # - def dispsettings - @w_bellvol.set(@bellvol) - @w_bellpit.set(@bellpit) - @w_belldur.set(@belldur) - - @w_kbdonoff.set(@w_kbdrep.get) - @w_kbdcli.set(@kbdcli) - - @w_mouseacc.set(@mouseacc) - @w_mousethr.set(@mousethr) - - @w_screenblank.set(@w_screenbla.get) - @w_screenpat.set(@w_screenbla.get) - - @w_screentim.set(@screentim) - @w_screencyc.set(@screencyc) - end - - # - # Create all windows, and pack them - # - class LabelEntry - def initialize(parent, text, length) - @frame = TkFrame.new(parent) - TkLabel.new(@frame, 'text'=>text).pack('side'=>'left','expand'=>'y') - @entry = TkEntry.new(@frame, 'width'=>length, 'relief'=>'sunken') { - pack('side'=>'left','expand'=>'y') - } - end - def pack(keys) - @frame.pack(keys) - end - def get - @entry.value - end - def set(value) - @entry.delete(0,'end') - @entry.insert(0, value) - end - end - - def createwindows - win = self - - # - # Buttons - # - buttons = TkFrame.new(@root) {|f| - [ TkButton.new(f, 'command'=>proc{win.ok}, 'text'=>'Ok'), - TkButton.new(f, 'command'=>proc{win.writesettings}, 'text'=>'Apply'), - TkButton.new(f, 'command'=>proc{win.cancel}, 'text'=>'Cancel'), - TkButton.new(f, 'command'=>proc{win.quit}, 'text'=>'Quit') ].each{|b| - b.pack('side'=>'left', 'expand'=>'yes', 'pady'=>5) - } - } - - # - # Bell settings - # - bell = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2) - l = TkLabel.new(bell, 'text'=>'Bell Settings') - @w_bellvol = TkScale.new(bell, 'from'=>0, 'to'=>100, 'length'=>200, - 'tickinterval'=>20, 'orient'=>'horizontal', - 'label'=>"Volume (%)") - - f = TkFrame.new(bell) - @w_bellpit = LabelEntry.new(f, "Pitch (Hz)", 6) - @w_bellpit.pack('side'=>'left', 'padx'=>5) - @w_belldur = LabelEntry.new(f, "Duration (ms)", 6) - @w_belldur.pack('side'=>'right', 'padx'=>5) - - l.pack('side'=>'top', 'expand'=>'yes') - @w_bellvol.pack('side'=>'top', 'expand'=>'yes') - f.pack('side'=>'top', 'expand'=>'yes') - - # - # Keyboard settings - # - kbdonoff = nil - kbdcli = nil - kbd = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2) - l = TkLabel.new(kbd, 'text'=>'Keyboard Repeat Settings') - f = TkFrame.new(kbd) - @w_kbdonoff = TkCheckButton.new(f, 'text'=>'On', 'relief'=>'flat', - 'onvalue'=>'on', 'offvalue'=>'off', - 'variable'=>@w_kbdrep ) { - def self.set(value) - if value == 'on' - self.select - else - self.deselect - end - end - pack('side'=>'left', 'expand'=>'yes', 'fill'=>'both') - } - @w_kbdcli = TkScale.new(f, 'from'=>0, 'to'=>100, 'length'=>200, - 'tickinterval'=>20, 'orient'=>'horizontal', - 'label'=>'Click Volume (%)') - @w_kbdcli.pack('side'=>'left', 'expand'=>'yes') - l.pack('side'=>'top', 'expand'=>'yes') - f.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'fill'=>'x') - - # - # Mouse settings - # - mouse = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2) - l = TkLabel.new(mouse, 'text'=>'Mouse Settings') - f = TkFrame.new(mouse) - @w_mouseacc = LabelEntry.new(f, 'Acceleration', 3) - @w_mouseacc.pack('side'=>'left') - @w_mousethr = LabelEntry.new(f, 'Threshold (pixels)', 3) - @w_mousethr.pack('side'=>'right') - l.pack('side'=>'top') - f.pack('side'=>'top', 'expand'=>'yes') - - # - # Screen Saver settings - # - screen = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2) - l = TkLabel.new(screen, 'text'=>'Screen-saver Settings') - f = TkFrame.new(screen) - ff1 = TkFrame.new(f) - [ @w_screenblank = TkRadioButton.new(ff1, 'text'=>'Blank', - 'relief'=>'flat', - 'variable'=>@w_screenbla, - 'value'=>'blank') { - def self.set(value) - if value == 'blank' - self.select - else - self.deselect - end - end - }, - @w_screenpat = TkRadioButton.new(ff1, 'text'=>'Pattern', - 'relief'=>'flat', - 'variable'=>@w_screenbla, - 'value'=>'noblank') { - def self.set(value) - if value != 'blank' - self.select - else - self.deselect - end - end - } - ].each {|w| w.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w') } - - ff2 = TkFrame.new(f) - [ @w_screentim = LabelEntry.new(ff2, 'Timeout (s)', 5), - @w_screencyc = LabelEntry.new(ff2, 'Cycle (s)', 5) ].each{|w| - w.pack('side'=>'top', 'pady'=>2, 'anchor'=>'e') - } - - ff1.pack('side'=>'left') - ff2.pack('side'=>'left') - - l.pack('side'=>'top') - f.pack('side'=>'top', 'expand'=>'yes') - - # - # Main window - # - buttons.pack('side'=>'top', 'fill'=>'both') - bell.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes') - kbd.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes') - mouse.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes') - screen.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes') - - # - # Let the user resize our window - # - @root.minsize(10,10) - end - - def initialize - @root = TkRoot.new - - @kbdrep = 'on' - @w_kbdrep = TkVariable.new(@kbdrep) - def @w_kbdrep.get - self.value - end - def @w_kbdrep.set(val) - self.value=val - end - - @kbdcli = 0 - - @bellvol = 100 - @bellpit = 440 - @belldur = 100 - - @mouseacc = "3/1" - @mousethr = 4 - - @screenbla = "blank" - @w_screenbla = TkVariable.new(@screenbla) - def @w_screenbla.get - self.value - end - def @w_screenbla.set(val) - self.value=val - end - - @screentim = 600 - @screencyc = 600 - - # - # Listen what "xset" tells us... - # - readsettings - - # - # Create all windows - # - createwindows - - # - # Write xset parameters - # - dispsettings - end -end - -Xsettings.new - -Tk.mainloop diff --git a/ext/tk/sample/demos-jp/ixset2 b/ext/tk/sample/demos-jp/ixset2 deleted file mode 100644 index 8947daa4b4..0000000000 --- a/ext/tk/sample/demos-jp/ixset2 +++ /dev/null @@ -1,368 +0,0 @@ -#!/usr/bin/env ruby -# -# ixset -- -# A nice interface to "xset" to change X server settings -# - -require 'tk' - -class Xsettings - # - # Button actions - # - def quit - @root.destroy - end - - def ok - writesettings - quit - end - - def cancel - readsettings - dispsettings - @btn_APPLY.state(:disabled) - @btn_CANCEL.state(:disabled) - end - - # apply is just "writesettings" - def apply - writesettings - @btn_APPLY.state(:disabled) - @btn_CANCEL.state(:disabled) - end - - # - # Read current settings - # - def readsettings - xfd = open("|xset q", 'r') - xfd.readlines.each{|line| - fields = line.chomp.strip.split(/\s+/) - case fields[0] - when "auto" - if fields[1] == 'repeat:' - @kbdrep = fields[2] - @w_kbdrep.set(@kbdrep) - @kbdcli = fields[6] - end - - when "bell" - @bellvol = fields[2] - @bellpit = fields[5] - @belldur = fields[8] - - when "acceleration:" - @mouseacc = fields[1] - @mousethr = fields[3] - - when "prefer" - if fields[2] == 'yes' - @screenbla = 'blank' - else - @screenbla = 'noblank' - end - @w_screenbla.set(@screenbla) - - when "timeout:" - @screentim = fields[1] - @screencyc = fields[3] - - end - } - - xfd.close - end - - # - # Write settings into the X server - # - def writesettings - @bellvol = @w_bellvol.get - @bellpit = @w_bellpit.get - @belldur = @w_belldur.get - - @kbdrep = @w_kbdrep.get - if @kbdrep == 'on' - @kbdcli = @w_kbdcli.get - else - @kbdcli = 'off' - end - - @mouseacc = @w_mouseacc.get - @mousethr = @w_mousethr.get - - @screentim = @w_screentim.get - @screencyc = @w_screencyc.get - @screenbla = @w_screenbla.get - - system("xset \ - b #{@bellvol} #{@bellpit} #{@belldur} \ - c #{@kbdcli} \ - r #{@kbdrep} \ - m #{@mouseacc} #{@mousethr} \ - s #{@screentim} #{@screencyc} \ - s #{@screenbla}") - end - - # - # Sends all settings to the window - # - def dispsettings - @w_bellvol.set(@bellvol) - @w_bellpit.set(@bellpit) - @w_belldur.set(@belldur) - - @w_kbdonoff.set(@w_kbdrep.get) - @w_kbdcli.set(@kbdcli) - - @w_mouseacc.set(@mouseacc) - @w_mousethr.set(@mousethr) - - @w_screenblank.set(@w_screenbla.get) - @w_screenpat.set(@w_screenbla.get) - - @w_screentim.set(@screentim) - @w_screencyc.set(@screencyc) - end - - # - # Create all windows, and pack them - # - class LabelEntry - def initialize(parent, text, length, range=[]) - @frame = TkFrame.new(parent) - TkLabel.new(@frame, 'text'=>text).pack('side'=>'left') - if range.size > 0 - @entry = TkSpinbox.new(@frame, 'width'=>length, 'relief'=>'sunken', - 'from'=>range[0], 'to'=>range[1]) - else - @entry = TkEntry.new(@frame, 'width'=>length, 'relief'=>'sunken') - end - @entry.pack('side'=>'right','expand'=>'y', 'fill'=>'x') - end - def epath - @frame - end - def pack(keys) - @frame.pack(keys) - end - def get - @entry.value - end - def set(value) - @entry.delete(0,'end') - @entry.insert(0, value) - end - end - - def createwindows - win = self - - # - # Buttons - # - btn_frame = TkFrame.new(@root) - buttons = [ - @btn_OK = TkButton.new(btn_frame, 'command'=>proc{win.ok}, - 'default'=>'active', 'text'=>'λ²ò'), - @btn_APPLY = TkButton.new(btn_frame, 'command'=>proc{win.writesettings}, - 'default'=>'normal', 'text'=>'ŬÍÑ', - 'state'=>'disabled'), - @btn_CANCEL = TkButton.new(btn_frame, 'command'=>proc{win.cancel}, - 'default'=>'normal', 'text'=>'¼è¾Ã', - 'state'=>'disabled'), - @btn_QUIT = TkButton.new(btn_frame, 'command'=>proc{win.quit}, - 'default'=>'normal', 'text'=>'Ãæ»ß') - ] - buttons.each{|b| b.pack('side'=>'left', 'expand'=>'yes', 'pady'=>5) } - - @root.bind('Return', proc{@btn_OK.flash; @btn_OK.invoke}) - @root.bind('Escape', proc{@btn_QUIT.flash; @btn_QUIT.invoke}) - @root.bind('1', proc{|w| - unless buttons.index(w) - @btn_APPLY.state(:normal) - @btn_CANCEL.state(:normal) - end - }, '%W') - @root.bind('Key', proc{|w, k| - unless buttons.index(w) - case k - when 'Return', 'Escape', 'Tab', /.*Shift.*/ - # do nothing - else - @btn_APPLY.state(:normal) - @btn_CANCEL.state(:normal) - end - end - }, '%W %K') - - # - # Bell settings - # - bell = TkLabelframe.new(@root, 'text'=>'¥Ù¥ëÀßÄê', - 'padx'=>'1.5m', 'pady'=>'1.5m') - @w_bellvol = TkScale.new(bell, 'from'=>0, 'to'=>100, 'length'=>200, - 'tickinterval'=>20, 'orient'=>'horizontal', - 'label'=>"²»ÎÌ (%)") - - f = TkFrame.new(bell) - @w_bellpit = LabelEntry.new(f, "²»Äø (Hz)", 6, [25, 20000]) - @w_bellpit.pack('side'=>'left', 'padx'=>5) - @w_belldur = LabelEntry.new(f, "»ý³»þ´Ö (ms)", 6, [1, 10000]) - @w_belldur.pack('side'=>'right', 'padx'=>5) - - @w_bellvol.pack('side'=>'top', 'expand'=>'yes') - f.pack('side'=>'top', 'expand'=>'yes') - - # - # Keyboard settings - # - kbdonoff = nil - kbdcli = nil - kbd = TkLabelframe.new(@root, 'text'=>'¥¡¼¥Ü¡¼¥É¥ê¥Ô¡¼¥ÈÀßÄê', - 'padx'=>'1.5m', 'pady'=>'1.5m') - f = TkFrame.new(kbd) - @w_kbdonoff = TkCheckButton.new(f, 'text'=>'¥¯¥ê¥Ã¥¯²»¤¢¤ê', - 'relief'=>'flat', - 'onvalue'=>'on', 'offvalue'=>'off', - 'variable'=>@w_kbdrep ) { - def self.set(value) - if value == 'on' - self.select - else - self.deselect - end - end - pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x', 'padx'=>[0, '1m']) - } - @w_kbdcli = TkScale.new(f, 'from'=>0, 'to'=>100, 'length'=>200, - 'tickinterval'=>20, 'orient'=>'horizontal', - 'label'=>'¥¯¥ê¥Ã¥¯²»ÎÌ (%)') - @w_kbdcli.pack('side'=>'left', 'expand'=>'yes', - 'fill'=>'x', 'padx'=>['1m', 0]) - f.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'fill'=>'x') - - # - # Mouse settings - # - mouse = TkLabelframe.new(@root, 'text'=>'¥Þ¥¦¥¹ÀßÄê', - 'padx'=>'1.5m', 'pady'=>'1.5m') - f = TkFrame.new(mouse) - @w_mouseacc = LabelEntry.new(f, '²Ã®ÎÌ', 5) - @w_mouseacc.pack('side'=>'left', 'padx'=>[0, '1m']) - @w_mousethr = LabelEntry.new(f, 'ïçÃÍ (pixels)', 3, [1, 2000]) - @w_mousethr.pack('side'=>'right', 'padx'=>['1m', 0]) - f.pack('side'=>'top', 'expand'=>'yes') - - # - # Screen Saver settings - # - screen = TkLabelframe.new(@root, 'text'=>'¥¹¥¯¥ê¡¼¥ó¥»¡¼¥ÐÀßÄê', - 'padx'=>'1.5m', 'pady'=>'1.5m') - @w_screenblank = TkRadioButton.new(screen, 'text'=>'¥Ö¥é¥ó¥¯É½¼¨', - 'relief'=>'flat', 'anchor'=>'w', - 'variable'=>@w_screenbla, - 'value'=>'blank') { - def self.set(value) - if value == 'blank' - self.select - else - self.deselect - end - end - } - - @w_screenpat = TkRadioButton.new(screen, 'text'=>'¥Ñ¥¿¡¼¥óɽ¼¨', - 'relief'=>'flat', 'anchor'=>'w', - 'variable'=>@w_screenbla, - 'value'=>'noblank') { - def self.set(value) - if value != 'blank' - self.select - else - self.deselect - end - end - } - - @w_screentim = LabelEntry.new(screen, '¥¿¥¤¥à¥¢¥¦¥È (s)', 5, [1, 100000]) - @w_screencyc = LabelEntry.new(screen, '¼þ´ü (s)', 5, [1, 100000]) - - Tk.grid(@w_screenblank, @w_screentim, 'sticky'=>'e') - Tk.grid(@w_screenpat, @w_screencyc, 'sticky'=>'e') - TkGrid.configure(@w_screenblank, @w_screenpat, 'sticky'=>'ew') - - # - # Main window - # - param = { - 'side'=>'top', 'fill'=>'both', 'expand'=>'yes', - 'padx'=>'1m', 'pady'=>'1m' - } - btn_frame.pack('side'=>'top', 'fill'=>'both') - bell.pack(param) - kbd.pack(param) - mouse.pack(param) - screen.pack(param) - - # - # Let the user resize our window - # - @root.minsize(10,10) - end - - def initialize(title) - @root = TkRoot.new('title'=>title) - - @kbdrep = 'on' - @w_kbdrep = TkVariable.new(@kbdrep) - def @w_kbdrep.get - self.value - end - def @w_kbdrep.set(val) - self.value=val - end - - @kbdcli = 0 - - @bellvol = 100 - @bellpit = 440 - @belldur = 100 - - @mouseacc = "3/1" - @mousethr = 4 - - @screenbla = "blank" - @w_screenbla = TkVariable.new(@screenbla) - def @w_screenbla.get - self.value - end - def @w_screenbla.set(val) - self.value=val - end - - @screentim = 600 - @screencyc = 600 - - # - # Listen what "xset" tells us... - # - readsettings - - # - # Create all windows - # - createwindows - - # - # Write xset parameters - # - dispsettings - end -end - -Xsettings.new(File.basename($0,'.rb')) - -Tk.mainloop diff --git a/ext/tk/sample/demos-jp/label.rb b/ext/tk/sample/demos-jp/label.rb deleted file mode 100644 index 80ab5f3d8f..0000000000 --- a/ext/tk/sample/demos-jp/label.rb +++ /dev/null @@ -1,64 +0,0 @@ -# -# label widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($label_demo) && $label_demo - $label_demo.destroy - $label_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$label_demo = TkToplevel.new {|w| - title("Label Demonstration") - iconname("label") - positionWindow(w) -} - -# label À¸À® -msg = TkLabel.new($label_demo) { - font $font - wraplength '4i' - justify 'left' - text "²¼¤Ë¤Ï5¤Ä¤Î¥é¥Ù¥ë¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£º¸Â¦¤Ë¤Ï¥Æ¥¥¹¥È¥é¥Ù¥ë¤¬3¤Ä¤¢¤ê¡¢±¦Â¦¤Ë¤Ï¥Ó¥Ã¥È¥Þ¥Ã¥×¥é¥Ù¥ë¤È¥Æ¥¥¹¥È¥é¥Ù¥ë¤¬¤¢¤ê¤Þ¤¹¡£¥é¥Ù¥ë¤È¤¤¤¦¤Î¤Ï¤¢¤Þ¤êÌÌÇò¤¤¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£¤Ê¤¼¤Ê¤éį¤á¤ë°Ê³°²¿¤â¤Ç¤¤Ê¤¤¤«¤é¤Ç¤¹¡£" -} -msg.pack('side'=>'top') - -# frame À¸À® -TkFrame.new($label_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $label_demo - $label_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'label'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# label demo Íѥե졼¥àÀ¸À® -f_left = TkFrame.new($label_demo) -f_right = TkFrame.new($label_demo) -[f_left, f_right].each{|w| w.pack('side'=>'left', 'expand'=>'yes', - 'padx'=>10, 'pady'=>10, 'fill'=>'both')} - -# label À¸À® -[ TkLabel.new(f_left, 'text'=>'ºÇ½é¤Î¥é¥Ù¥ë'), - TkLabel.new(f_left, 'text'=>'2 ÈÖÌÜ¡£¤Á¤ç¤Ã¤ÈÉ⤾夬¤é¤»¤Æ¤ß¤Þ¤·¤¿', - 'relief'=>'raised'), - TkLabel.new(f_left, 'text'=>'3 ÈÖÌÜ¡£ÄÀ¤ó¤Ç¤¤¤Þ¤¹ ', 'relief'=>'sunken') -].each{|w| w.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'anchor'=>'w')} - -TkLabel.new(f_right) { - bitmap('@' + [$demo_dir,'images','face.bmp'].join(File::Separator)) - borderwidth 2 - relief 'sunken' -}.pack('side'=>'top') - -TkLabel.new(f_right) { text 'Tcl/Tk ½êͼÔ' }.pack('side'=>'top') diff --git a/ext/tk/sample/demos-jp/labelframe.rb b/ext/tk/sample/demos-jp/labelframe.rb deleted file mode 100644 index 044fcd23ae..0000000000 --- a/ext/tk/sample/demos-jp/labelframe.rb +++ /dev/null @@ -1,98 +0,0 @@ -# labelframe.rb -# -# This demonstration script creates a toplevel window containing -# several labelframe widgets. -# -# based on "Id: labelframe.tcl,v 1.2 2001/10/30 11:21:50 dkf Exp" - - -if defined?($labelframe_demo) && $labelframe_demo - $labelframe_demo.destroy - $labelframe_demo = nil -end - -$labelframe_demo = TkToplevel.new {|w| - title("Labelframe Demonstration") - iconname("labelframe") - positionWindow(w) -} - -# Some information -TkLabel.new($labelframe_demo, - :font=>$font, :wraplength=>'4i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) -TkLabelFrame ¥¦¥£¥¸¥§¥Ã¥È¤Ï´ØÏ¢¤¹¤ë widget -·²¤ò¤Þ¤È¤á¤Æ¼è¤ê°·¤¦¤¿¤á¤ËÍѤ¤¤é¤ì¤Þ¤¹¡£¥é -¥Ù¥ë¤ÏÄ̾ï¤Îʸ»úÎó¤Ç¤â²¿¤é¤«¤Î¥¦¥£¥¸¥§¥Ã¥È -¤Ç¤â¤«¤Þ¤¤¤Þ¤»¤ó¡£¤â¤·¤¢¤Ê¤¿¤¬»È¤Ã¤Æ¤¤¤ë -Ruby ¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë Tk ¥é¥¤¥Ö¥é¥ê¤¬ -labelframe ¥¦¥£¥¸¥§¥Ã¥È¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤ -¾ì¹ç¡¢¤³¤Î¥Ç¥â¤Ï¤¦¤Þ¤¯Æ°¤«¤Ê¤¤¤Ï¤º¤Ç¤¹¡£ -¤½¤Î¾ì¹ç¤Ë¤Ï labelframe ¥¦¥£¥¸¥§¥Ã¥È¤¬¼ÂÁõ -¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ê¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î Tk -¤òÁȤ߹ç¤ï¤»¤Æ»î¤¹¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£ -EOL - -# The bottom buttons -TkFrame.new($labelframe_demo){|f| - pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - - TkButton.new(f, :text=>'λ²ò', :width=>15, :command=>proc{ - $labelframe_demo.destroy - $labelframe_demo = nil - }).pack(:side=>:left, :expand=>true) - - TkButton.new(f, :text=>'¥³¡¼¥É»²¾È', :width=>15, :command=>proc{ - showCode 'labelframe' - }).pack(:side=>:left, :expand=>true) -} - -# Demo area -w = TkFrame.new($labelframe_demo).pack(:side=>:bottom, :fill=>:both, - :expand=>true) - -# A group of radiobuttons in a labelframe -TkLabelFrame.new(w, :text=>'ÁªÂòÃÍ', - :padx=>2, :pady=>2) {|f| - grid(:row=>0, :column=>0, :pady=>'2m', :padx=>'2m') - - v = TkVariable.new - (1..4).each{|i| - TkRadiobutton.new(f, :text=>"This is value #{i}", - :variable=>v, :value=>i) { - pack(:side=>:top, :fill=>:x, :pady=>2) - } - } -} - - -# Using a label window to control a group of options. -$lfdummy = TkVariable.new(0) - -def lfEnableButtons(w) - TkWinfo.children(w).each{|child| - next if child.path =~ /\.cb$/ - if $lfdummy == 1 - child.state(:normal) - else - child.state(:disabled) - end - } -end - -TkLabelFrame.new(w, :pady=>2, :padx=>2){|f| - TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy, - :text=>"¥ª¥×¥·¥ç¥ó¤ò»ÈÍÑ", :padx=>0) {|cb| - command proc{lfEnableButtons(f)} - f.labelwidget(cb) - } - grid(:row=>0, :column=>1, :pady=>'2m', :padx=>'2m') - - %w(¥ª¥×¥·¥ç¥ó1 ¥ª¥×¥·¥ç¥ó2 ¥ª¥×¥·¥ç¥ó3).each{|str| - TkCheckbutton.new(f, :text=>str).pack(:side=>:top, :fill=>:x, :pady=>2) - } - - lfEnableButtons(f) -} - -TkGrid.columnconfigure(w, [0,1], :weight=>1) diff --git a/ext/tk/sample/demos-jp/menu.rb b/ext/tk/sample/demos-jp/menu.rb deleted file mode 100644 index fb32623cc8..0000000000 --- a/ext/tk/sample/demos-jp/menu.rb +++ /dev/null @@ -1,186 +0,0 @@ -# -# menus widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($menu_demo) && $menu_demo - $menu_demo.destroy - $menu_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$menu_demo = TkToplevel.new {|w| - title("File Selection Dialogs") - iconname("menu") - positionWindow(w) -} - -# menu frame À¸À® -$menu_frame = TkFrame.new($menu_demo, 'relief'=>'raised', 'bd'=>2) -$menu_frame.pack('side'=>'top', 'fill'=>'x') - -# label À¸À® -TkLabel.new($menu_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { - if $tk_platform['platform'] == 'macintosh' - text("¤³¤Î¥¦¥£¥ó¥É¥¦¤ÏÍÍ¡¹¤Ê¥á¥Ë¥å¡¼¤È¥«¥¹¥±¡¼¥É¥á¥Ë¥å¡¼¤«¤é¹½À®¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Command-X ¤òÆþÎϤ¹¤ë¤È¡¢X¤¬¥³¥Þ¥ó¥É¥¡¼µ¹æ¤Ë³¤¤¤ÆÉ½¼¨¤µ¤ì¤Æ¤¤¤ëʸ»ú¤Ê¤é¤Ð¡¢¥¢¥¯¥»¥é¥ì¡¼¥¿¤ò»È¤Ã¤¿¹àÌܵ¯Æ°¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤¤Þ¤¹¡£¥á¥Ë¥å¡¼Í×ÁÇÃæ¡¢ºÇ¸å¤Î¤â¤Î¤Ï¡¢¤½¤Î¥á¥Ë¥å¡¼¤ÎºÇ½é¤Î¹àÌܤòÁªÂò¤¹¤ë¤³¤È¤ÇÆÈΩ¤µ¤»¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£") - else - text("¤³¤Î¥¦¥£¥ó¥É¥¦¤ÏÍÍ¡¹¤Ê¥á¥Ë¥å¡¼¤È¥«¥¹¥±¡¼¥É¥á¥Ë¥å¡¼¤«¤é¹½À®¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Alt-X ¤òÆþÎϤ¹¤ë¤È¡¢X¤¬¥á¥Ë¥å¡¼¤Ë¥¢¥ó¥À¡¼¥é¥¤¥óÉÕ¤¤Çɽ¼¨¤µ¤ì¤Æ¤¤¤ëʸ»ú¤Ê¤é¤Ð¡¢¥¡¼¥Ü¡¼¥É¤«¤é¤Î»ØÄ꤬¤Ç¤¤Þ¤¹¡£Ìð°õ¥¡¼¤Ç¥á¥Ë¥å¡¼¤Î¥È¥é¥Ð¡¼¥¹¤â²Äǽ¤Ç¤¹¡£¥á¥Ë¥å¡¼¤¬»ØÄꤵ¤ì¤¿ºÝ¤Ë¤Ï¡¢¥¹¥Ú¡¼¥¹¥¡¼¤Ç¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£¤¢¤ë¤¤¤Ï¡¢¥¢¥ó¥À¡¼¥é¥¤¥óÉÕ¤¤Îʸ»ú¤òÆþÎϤ¹¤ë¤³¤È¤Ç¤â¼Â¹Ô¤Ç¤¤Þ¤¹¡£¥á¥Ë¥å¡¼¤Î¥¨¥ó¥È¥ê¤¬¥¢¥¯¥»¥é¥ì¡¼¥¿¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤½¤Î¥¢¥¯¥»¥é¥ì¡¼¥¿¤òÆþÎϤ¹¤ë¤³¤È¤Ç¥á¥Ë¥å¡¼¤ò»ØÄꤹ¤ë¤³¤È¤Ê¤·¤Ë¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£¥á¥Ë¥å¡¼Í×ÁÇÃæ¡¢ºÇ¸å¤Î¤â¤Î¤Ï¡¢¤½¤Î¥á¥Ë¥å¡¼¤ÎºÇ½é¤Î¹àÌܤòÁªÂò¤¹¤ë¤³¤È¤ÇÆÈΩ¤µ¤»¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£") - end -}.pack('side'=>'top') - -# frame À¸À® -TkFrame.new($menu_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $menu_demo - $menu_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'menu'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# menu À¸À® -TkMenubutton.new($menu_frame, 'text'=>'File', 'underline'=>0) {|m| - pack('side'=>'left') - TkMenu.new(m, 'tearoff'=>false) {|file_menu| - m.configure('menu'=>file_menu) - add('command', 'label'=>'³«¤¯ ...', 'command'=>proc{fail '¤³¤ì¤Ï¡¢¥Ç¥â¤Ç¤¹¤Î¤Ç"³«¤¯ ..."¤ËÂФ¹¤ë¥¢¥¯¥·¥ç¥ó¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£'}) - add('command', 'label'=>'¿·µ¬', 'command'=>proc{fail '¤³¤ì¤Ï¡¢¥Ç¥â¤Ç¤¹¤Î¤Ç"¿·µ¬"¤ËÂФ¹¤ë¥¢¥¯¥·¥ç¥ó¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£'}) - add('command', 'label'=>'Êݸ', 'command'=>proc{fail '¤³¤ì¤Ï¡¢¥Ç¥â¤Ç¤¹¤Î¤Ç"Êݸ"¤ËÂФ¹¤ë¥¢¥¯¥·¥ç¥ó¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£'}) - add('command', 'label'=>'Êݸ(»ØÄê) ...', 'command'=>proc{fail '¤³¤ì¤Ï¡¢¥Ç¥â¤Ç¤¹¤Î¤Ç"Êݸ(»ØÄê) ..."¤ËÂФ¹¤ë¥¢¥¯¥·¥ç¥ó¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£'}) - add('separator') - add('command', 'label'=>'¥×¥ê¥ó¥ÈÀßÄê ...', 'command'=>proc{fail '¤³¤ì¤Ï¡¢¥Ç¥â¤Ç¤¹¤Î¤Ç"¥×¥ê¥ó¥ÈÀßÄê ..."¤ËÂФ¹¤ë¥¢¥¯¥·¥ç¥ó¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£'}) - add('command', 'label'=>'¥×¥ê¥ó¥È ...', 'command'=>proc{fail '¤³¤ì¤Ï¡¢¥Ç¥â¤Ç¤¹¤Î¤Ç"¥×¥ê¥ó¥È ..."¤ËÂФ¹¤ë¥¢¥¯¥·¥ç¥ó¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£'}) - add('separator') - add('command', 'label'=>'½ªÎ»', 'command'=>proc{$menu_demo.destroy}) - } -} - -if $tk_platform['platform'] == 'macintosh' - modifier = 'Command' -elsif $tk_platform['platform'] == 'windows' - modifier = 'Control' -else - modifier = 'Meta' -end - -TkMenubutton.new($menu_frame, 'text'=>'Basic', 'underline'=>0) {|m| - pack('side'=>'left') - TkMenu.new(m, 'tearoff'=>false) {|basic_menu| - m.configure('menu'=>basic_menu) - add('command', 'label'=>'²¿¤â¤·¤Ê¤¤Ä¹¤¤¥¨¥ó¥È¥ê') - ['A','B','C','D','E','F','G'].each{|c| - # add('command', 'label'=>"ʸ»ú \"#{c}\" ¤ò°õ»ú", 'underline'=>4, - add('command', 'label'=>"Print letter \"#{c}\" (ʸ»ú \"#{c}\" ¤ò°õ»ú)", - 'underline'=>14, 'accelerator'=>"Meta+#{c}", - 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") - $menu_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) - } - } -} - -TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m| - pack('side'=>'left') - TkMenu.new(m, 'tearoff'=>false) {|cascade_menu| - m.configure('menu'=>cascade_menu) - add('command', 'label'=>'Print hello(¤³¤ó¤Ë¤Á¤Ï)', - 'command'=>proc{print "Hello(¤³¤ó¤Ë¤Á¤Ï)\n"}, - 'accelerator'=>"#{modifier}+H", 'underline'=>6) - $menu_demo.bind("#{modifier}-h", proc{print "Hello(¤³¤ó¤Ë¤Á¤Ï)\n"}) - add('command', 'label'=>'Print goodbye(¤µ¤è¤¦¤Ê¤é)', - 'command'=>proc{print "Goodbye(¤µ¤è¤¦¤Ê¤é)\n"}, - 'accelerator'=>"#{modifier}+G", 'underline'=>6) - $menu_demo.bind("#{modifier}-g", proc{print "Goodbye(¤µ¤è¤¦¤Ê¤é)\n"}) - - TkMenu.new(m, 'tearoff'=>false) {|cascade_check| - cascade_menu.add('cascade', 'label'=>'Check buttons(¥Á¥§¥Ã¥¯¥Ü¥¿¥ó)', - 'menu'=>cascade_check, 'underline'=>0) - oil = TkVariable.new(0) - add('check', 'label'=>'¥ª¥¤¥ëÅÀ¸¡', 'variable'=>oil) - trans = TkVariable.new(0) - add('check', 'label'=>'¥È¥é¥ó¥¹¥ß¥Ã¥·¥ç¥óÅÀ¸¡', 'variable'=>trans) - brakes = TkVariable.new(0) - add('check', 'label'=>'¥Ö¥ì¡¼¥ÅÀ¸¡', 'variable'=>brakes) - lights = TkVariable.new(0) - add('check', 'label'=>'¥é¥¤¥ÈÅÀ¸¡', 'variable'=>lights) - add('separator') - add('command', 'label'=>'¸½ºß¤ÎÃͤòɽ¼¨', - 'command'=>proc{showVars($menu_demo, - ['¥ª¥¤¥ëÅÀ¸¡', oil], - ['¥È¥é¥ó¥¹¥ß¥Ã¥·¥ç¥óÅÀ¸¡', trans], - ['¥Ö¥ì¡¼¥ÅÀ¸¡', brakes], - ['¥é¥¤¥ÈÅÀ¸¡', lights])} ) - invoke 1 - invoke 3 - } - - TkMenu.new(m, 'tearoff'=>false) {|cascade_radio| - cascade_menu.add('cascade', 'label'=>'Radio buttons(¥é¥¸¥ª¥Ü¥¿¥ó)', - 'menu'=>cascade_radio, 'underline'=>0) - pointSize = TkVariable.new - add('radio', 'label'=>'10 ¥Ý¥¤¥ó¥È', 'variable'=>pointSize, 'value'=>10) - add('radio', 'label'=>'14 ¥Ý¥¤¥ó¥È', 'variable'=>pointSize, 'value'=>14) - add('radio', 'label'=>'18 ¥Ý¥¤¥ó¥È', 'variable'=>pointSize, 'value'=>18) - add('radio', 'label'=>'24 ¥Ý¥¤¥ó¥È', 'variable'=>pointSize, 'value'=>24) - add('radio', 'label'=>'32 ¥Ý¥¤¥ó¥È', 'variable'=>pointSize, 'value'=>32) - add('separator') - style = TkVariable.new - add('radio', 'label'=>'¥í¡¼¥Þ¥ó', 'variable'=>style, 'value'=>'roman') - add('radio', 'label'=>'¥Ü¡¼¥ë¥É', 'variable'=>style, 'value'=>'bold') - add('radio', 'label'=>'¥¤¥¿¥ê¥Ã¥¯', 'variable'=>style, 'value'=>'italic') - add('separator') - add('command', 'label'=>'¸½ºß¤ÎÃͤòɽ¼¨', - 'command'=>proc{showVars($menu_demo, - ['¥Ý¥¤¥ó¥È¥µ¥¤¥º', pointSize], - ['¥¹¥¿¥¤¥ë', style])} ) - invoke 1 - invoke 7 - } - } -} - -TkMenubutton.new($menu_frame, 'text'=>'Icons', 'underline'=>0) {|m| - pack('side'=>'left') - TkMenu.new(m, 'tearoff'=>false) {|icon_menu| - m.configure('menu'=>icon_menu) - add('command', - 'bitmap'=>'@'+[$demo_dir,'images','pattern.bmp'].join(File::Separator), - 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', - 'text'=>'º£¤¢¤Ê¤¿¤¬ÁªÂò¤·¤¿¥á¥Ë¥å¡¼¤Î¹àÌܤϥƥ¥¹¥È¤Ç¤Ï¤Ê¤¯¥Ó¥Ã¥È¥Þ¥Ã¥×¤òɽ¼¨¤·¤Æ¤¤¤Þ¤·¤¿¡£¤½¤ì°Ê³°¤ÎÅÀ¤Ç¤Ï¾¤Î¥á¥Ë¥å¡¼¹àÌܤÈÊѤï¤ê¤Þ¤»¤ó¡£', - 'bitmap'=>'', 'default'=>0, - 'buttons'=>'λ²ò')} ) - ['info', 'questhead', 'error'].each{|icon| - add('command', 'bitmap'=>icon, - 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) - } - } -} - -TkMenubutton.new($menu_frame, 'text'=>'More', 'underline'=>0) {|m| - pack('side'=>'left') - TkMenu.new(m, 'tearoff'=>false) {|more_menu| - m.configure('menu'=>more_menu) - [ '¥¨¥ó¥È¥ê','Ê̤Υ¨¥ó¥È¥ê','²¿¤â¤·¤Ê¤¤','¤Û¤È¤ó¤É²¿¤â¤·¤Ê¤¤', - '¿ÍÀ¸¤ò°ÕµÁ¤¢¤ë¤â¤Î¤Ë' ].each{|i| - add('command', 'label'=>i, - 'command'=>proc{print "You invoked \"#{i}\"\n"}) - } - } -} - -TkMenubutton.new($menu_frame, 'text'=>'Colors', 'underline'=>0) {|m| - pack('side'=>'left') - TkMenu.new(m) {|colors_menu| - m.configure('menu'=>colors_menu) - ['red', 'orange', 'yellow', 'green', 'blue'].each{|c| - add('command', 'label'=>c, 'background'=>c, - 'command'=>proc{print "You invoked \"#{c}\"\n"}) - } - } -} diff --git a/ext/tk/sample/demos-jp/menu84.rb b/ext/tk/sample/demos-jp/menu84.rb deleted file mode 100644 index ea5fdf6487..0000000000 --- a/ext/tk/sample/demos-jp/menu84.rb +++ /dev/null @@ -1,208 +0,0 @@ -# -# menus widget demo (called by 'widget') -# - -# toplevel widget -if defined?($menu84_demo) && $menu84_demo - $menu84_demo.destroy - $menu84_demo = nil -end - -# demo toplevel widget -$menu84_demo = TkToplevel.new {|w| - title("File Selection Dialogs") - iconname("menu84") - positionWindow(w) -} - -begin - windowingsystem = Tk.windowingsystem() -rescue - windowingsystem = "" -end - -# label -TkLabel.new($menu84_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { - if $tk_platform['platform'] == 'macintosh' || - windowingsystem == "classic" || windowingsystem == "aqua" - text("¤³¤Î¥¦¥£¥ó¥É¥¦¤Ë¤Ï¥«¥¹¥±¡¼¥É¥á¥Ë¥å¡¼¤ò»ý¤Ä¥á¥Ë¥å¡¼¥Ð¡¼¤¬ÉÕ¤±¤é¤ì¤Æ¤¤¤Þ¤¹¡£Command+x ('x'¤Ï¥³¥Þ¥ó¥É¥¡¼¥·¥ó¥Ü¥ë¤Ë³¤±¤ÆÉ½¼¨¤µ¤ì¤Æ¤¤¤ëʸ»ú¤Ç¤¹) ¤È¥¿¥¤¥×¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤â¹àÌܤε¡Ç½¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ºÇ¸å¤Î¥á¥Ë¥å¡¼¤Ï¡¢¥Þ¥¦¥¹¤Ç¥¦¥£¥ó¥É¥¦¤Î³°¤Ë¥É¥é¥Ã¥°¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢ÆÈΩ¤·¤¿¥Ñ¥ì¥Ã¥È¤È¤Ê¤ë¤è¤¦¤ËÀÚ¤êÊü¤¹¤³¤È¤¬²Äǽ¤Ç¤¹¡£") - else - text("¤³¤Î¥¦¥£¥ó¥É¥¦¤Ë¤Ï¥«¥¹¥±¡¼¥É¥á¥Ë¥å¡¼¤ò»ý¤Ä¥á¥Ë¥å¡¼¥Ð¡¼¤¬ÉÕ¤±¤é¤ì¤Æ¤¤¤Þ¤¹¡£Alt+x ('x'¤Ï¥á¥Ë¥å¡¼¾å¤Ç²¼Àþ¤¬°ú¤«¤ì¤¿Ê¸»ú¤Ç¤¹) ¤È¥¿¥¤¥×¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤â¥á¥Ë¥å¡¼¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤¤Þ¤¹¡£Ìð°õ¥¡¼¤ò»È¤Ã¤Æ¡¢¥á¥Ë¥å¡¼´Ö¤ò°Üư¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡£¥á¥Ë¥å¡¼¤¬É½¼¨¤µ¤ì¤Æ¤¤¤ë»þ¤Ë¤Ï¡¢¸½ºß°ÌÃ֤ιàÌܤò¥¹¥Ú¡¼¥¹¥¡¼¤ÇÁªÂò¤·¤¿¤ê¡¢²¼Àþ¤¬°ú¤«¤ì¤¿Ê¸»ú¤òÆþÎϤ¹¤ë¤³¤È¤Ç¤½¤Î¹àÌܤòÁªÂò¤·¤¿¤ê¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£¤â¤·¹àÌܤ˥¢¥¯¥»¥é¥ì¡¼¥¿¤Î»ØÄ꤬¤Ê¤µ¤ì¤Æ¤¤¤¿¤Ê¤é¤Ð¡¢¤½¤Î»ØÄꤵ¤ì¤¿¥¡¼ÆþÎϤò¹Ô¤¦¤³¤È¤Ç¡¢¥á¥Ë¥å¡¼¤òɽ¼¨¤µ¤»¤ë¤³¤È¤Ê¤¯Ä¾Àܤ½¤Î¹àÌܤε¡Ç½¤ò¸Æ¤Ó½Ð¤»¤Þ¤¹¡£ºÇ¸å¤Î¥á¥Ë¥å¡¼¤Ï¡¢¥á¥Ë¥å¡¼¤ÎºÇ½é¤Î¹àÌܤòÁªÂò¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢ÆÈΩ¤·¤¿¥Ñ¥ì¥Ã¥È¤È¤Ê¤ë¤è¤¦¤ËÀÚ¤êÊü¤¹¤³¤È¤¬²Äǽ¤Ç¤¹¡£") - end -}.pack('side'=>'top') - - -menustatus = TkVariable.new(" ") -TkFrame.new($menu84_demo) {|frame| - TkLabel.new(frame, 'textvariable'=>menustatus, 'relief'=>'sunken', - 'bd'=>1, 'font'=>['Helvetica', '10'], - 'anchor'=>'w').pack('side'=>'left', 'padx'=>2, - 'expand'=>true, 'fill'=>'both') - pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2) -} - - -# frame -TkFrame.new($menu84_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $menu84_demo - $menu84_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'menu84'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - - -# create menu frame -$menu84_frame = TkMenu.new($menu84_demo, 'tearoff'=>false) - -# menu -TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| - $menu84_frame.add('cascade', 'label'=>'File', 'menu'=>m, 'underline'=>0) - add('command', 'label'=>'Open...', 'command'=>proc{fail '¤³¤ì¤Ïñ¤Ê¤ë¥Ç¥â¤Ç¤¹¤«¤é¡¢"Open..." ¹àÌܤε¡Ç½¤ÏÆÃ¤ËÄêµÁ¤µ¤ì¤Æ¤Ï¤¤¤Þ¤»¤ó¡£'}) - add('command', 'label'=>'New', 'command'=>proc{fail '¤³¤ì¤Ïñ¤Ê¤ë¥Ç¥â¤Ç¤¹¤«¤é¡¢"New" ¹àÌܤε¡Ç½¤ÏÆÃ¤ËÄêµÁ¤µ¤ì¤Æ¤Ï¤¤¤Þ¤»¤ó¡£'}) - add('command', 'label'=>'Save', 'command'=>proc{fail '¤³¤ì¤Ïñ¤Ê¤ë¤Ç¤â¤Ç¤¹¤«¤é¡¢"Save" ¹àÌܤε¡Ç½¤ÏÆÃ¤ËÄêµÁ¤µ¤ì¤Æ¤Ï¤¤¤Þ¤»¤ó¡£'}) - add('command', 'label'=>'Save As...', 'command'=>proc{fail '¤³¤ì¤Ïñ¤Ê¤ë¤Ç¤â¤Ç¤¹¤«¤é¡¢"Save As..." ¹àÌܤε¡Ç½¤ÏÆÃ¤ËÄêµÁ¤µ¤ì¤Æ¤Ï¤¤¤Þ¤»¤ó¡£'}) - add('separator') - add('command', 'label'=>'Print Setup...', 'command'=>proc{fail '¤³¤ì¤Ïñ¤Ê¤ë¥Ç¥â¤Ç¤¹¤«¤é¡¢"Print Setup..." ¹àÌܤε¡Ç½¤ÏÆÃ¤ËÄêµÁ¤µ¤ì¤Æ¤Ï¤¤¤Þ¤»¤ó¡£'}) - add('command', 'label'=>'Print...', 'command'=>proc{fail '¤³¤ì¤Ïñ¤Ê¤ë¥Ç¥â¤Ç¤¹¤«¤é¡¢"Print..." ¹àÌܤε¡Ç½¤ÏÆÃ¤ËÄêµÁ¤µ¤ì¤Æ¤Ï¤¤¤Þ¤»¤ó¡£'}) - add('separator') - add('command', 'label'=>'Dismiss Menus Demo', 'command'=>proc{$menu84_demo.destroy}) -} - -if $tk_platform['platform'] == 'macintosh' || - windowingsystem = "classic" || windowingsystem = "aqua" - modifier = 'Command' -elsif $tk_platform['platform'] == 'windows' - modifier = 'Control' -else - modifier = 'Meta' -end - -TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| - $menu84_frame.add('cascade', 'label'=>'Basic', 'menu'=>m, 'underline'=>0) - add('command', 'label'=>'Long entry that does nothing') - ['A','B','C','D','E','F','G'].each{|c| - add('command', 'label'=>"Print letter \"#{c}\"", - 'underline'=>14, 'accelerator'=>"Meta+#{c}", - 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") - $menu84_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) - } -} - -TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| - $menu84_frame.add('cascade', 'label'=>'Cascades', 'menu'=>m, 'underline'=>0) - add('command', 'label'=>'Print hello', - 'command'=>proc{print "Hello\n"}, - 'accelerator'=>"#{modifier}+H", 'underline'=>6) - $menu84_demo.bind("#{modifier}-h", proc{print "Hello\n"}) - add('command', 'label'=>'Print goodbye', - 'command'=>proc{print "Goodbye\n"}, - 'accelerator'=>"#{modifier}+G", 'underline'=>6) - $menu84_demo.bind("#{modifier}-g", proc{print "Goodbye\n"}) - - TkMenu.new(m, 'tearoff'=>false) {|cascade_check| - m.add('cascade', 'label'=>'Check button', - 'menu'=>cascade_check, 'underline'=>0) - oil = TkVariable.new(0) - add('check', 'label'=>'¥ª¥¤¥ë¸¡ºº', 'variable'=>oil) - trans = TkVariable.new(0) - add('check', 'label'=>'¥È¥é¥ó¥¹¥ß¥Ã¥·¥ç¥ó¸¡ºº', 'variable'=>trans) - brakes = TkVariable.new(0) - add('check', 'label'=>'¥Ö¥ì¡¼¥¸¡ºº', 'variable'=>brakes) - lights = TkVariable.new(0) - add('check', 'label'=>'¥é¥¤¥È¸¡ºº', 'variable'=>lights) - add('separator') - add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu84_demo, - ['¥ª¥¤¥ë', oil], - ['¥È¥é¥ó¥¹¥ß¥Ã¥·¥ç¥ó', trans], - ['¥Ö¥ì¡¼¥', brakes], - ['¥é¥¤¥È', lights])} ) - invoke 1 - invoke 3 - } - - TkMenu.new(m, 'tearoff'=>false) {|cascade_radio| - m.add('cascade', 'label'=>'Radio buttons', - 'menu'=>cascade_radio, 'underline'=>0) - pointSize = TkVariable.new - add('radio', 'label'=>'10 point', 'variable'=>pointSize, 'value'=>10) - add('radio', 'label'=>'14 point', 'variable'=>pointSize, 'value'=>14) - add('radio', 'label'=>'18 point', 'variable'=>pointSize, 'value'=>18) - add('radio', 'label'=>'24 point', 'variable'=>pointSize, 'value'=>24) - add('radio', 'label'=>'32 point', 'variable'=>pointSize, 'value'=>32) - add('separator') - style = TkVariable.new - add('radio', 'label'=>'Roman', 'variable'=>style, 'value'=>'roman') - add('radio', 'label'=>'Bold', 'variable'=>style, 'value'=>'bold') - add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic') - add('separator') - add('command', 'label'=>'¸½ºßÃͤÎɽ¼¨', - 'command'=>proc{showVars($menu84_demo, - ['pointSize', pointSize], - ['style', style])} ) - invoke 1 - invoke 7 - } -} - -TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| - $menu84_frame.add('cascade', 'label'=>'Icons', 'menu'=>m, 'underline'=>0) - add('command', 'hidemargin'=>1, - 'bitmap'=>'@'+[$demo_dir,'images','pattern.bmp'].join(File::Separator), - 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', - 'text'=>'¤¢¤Ê¤¿¤¬ÁªÂò¤·¤¿¥á¥Ë¥å¡¼¹àÌܤϡ¢Ê¸»úÎó¤ÎÂå¤ï¤ê¤Ë¥Ó¥Ã¥È¥Þ¥Ã¥×¥¤¥á¡¼¥¸¤Ç¹àÌܤòɽ¼¨¤·¤¿¤â¤Î¤Ç¤¹¡£¤½¤ì°Ê³°¤ÎÅÀ¤Ç¤Ï¡¢¤Û¤«¤Î¥á¥Ë¥å¡¼¹àÌÜ¤È¤Î´Ö¤ÇÆÃ¤Ë°ã¤¤¤¬¤¢¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£', - 'bitmap'=>'', 'default'=>0, - 'buttons'=>'ÊĤ¸¤ë')} ) - ['info', 'questhead', 'error'].each{|icon| - add('command', 'bitmap'=>icon, 'hidemargin'=>1, - 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) - } - - entryconfigure(2, :columnbreak=>true) -} - -TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| - $menu84_frame.add('cascade', 'label'=>'More', 'menu'=>m, 'underline'=>0) - [ 'An entry','Another entry','Does nothing','Does almost nothing', - 'Make life meaningful' ].each{|i| - add('command', 'label'=>i, - 'command'=>proc{print "You invoked \"#{i}\"\n"}) - } - - m.entryconfigure('Does almost nothing', - 'bitmap'=>'questhead', 'compound'=>'left', - 'command'=>proc{ - TkDialog.new('title'=>'Compound Menu Entry', - 'message'=>'¤¢¤Ê¤¿¤¬ÁªÂò¤·¤¿¥á¥Ë¥å¡¼¹àÌܤϡ¢¥Ó¥Ã¥È¥Þ¥Ã¥×¥¤¥á¡¼¥¸¤Èʸ»úÎó¤È¤òƱ»þ¤Ë°ì¤Ä¤Î¹àÌܤËɽ¼¨¤¹¤ë¤è¤¦¤Ë¤·¤¿¤â¤Î¤Ç¤¹¡£¤½¤ì°Ê³°¤ÎÅÀ¤Ç¤Ï¡¢¤Û¤«¤Î¥á¥Ë¥å¡¼¹àÌÜ¤È¤Î´Ö¤ÇÆÃ¤Ë°ã¤¤¤¬¤¢¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£', - 'buttons'=>['λ²ò'], 'bitmap'=>'') - }) -} - -TkMenu.new($menu84_frame) {|m| - $menu84_frame.add('cascade', 'label'=>'Colors', 'menu'=>m, 'underline'=>0) - ['red', 'orange', 'yellow', 'green', 'blue'].each{|c| - add('command', 'label'=>c, 'background'=>c, - 'command'=>proc{print "You invoked \"#{c}\"\n"}) - } -} - -$menu84_demo.menu($menu84_frame) - -TkMenu.bind('<MenuSelect>', proc{|w| - begin - label = w.entrycget('active', 'label') - rescue - label = " " - end - menustatus.value = label - Tk.update(true) - }, '%W') diff --git a/ext/tk/sample/demos-jp/menu8x.rb b/ext/tk/sample/demos-jp/menu8x.rb deleted file mode 100644 index a6d3c5e09e..0000000000 --- a/ext/tk/sample/demos-jp/menu8x.rb +++ /dev/null @@ -1,219 +0,0 @@ -# -# menus widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($menu8x_demo) && $menu8x_demo - $menu8x_demo.destroy - $menu8x_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$menu8x_demo = TkToplevel.new {|w| - title("Menu Demonstration (Tk8.x)") - iconname("menu") - positionWindow(w) -} - -# version check -if $tk_version.to_f < 8.0 - -# label À¸À® -TkLabel.new($menu8x_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { - text("¼Â¹Ô¤·¤è¤¦¤È¤·¤¿¥¹¥¯¥ê¥×¥È¤Ï Tk8.0 °Ê¾å¤ÇÍøÍѤǤ¤ëµ¡Ç½¤òÍøÍѤ·¤Æ¤¤¤ë¤¿¤á¡¢¤¢¤Ê¤¿¤Î Ruby#{VERSION}/Tk#{$tk_version}#{(Tk::JAPANIZED_TK)? 'jp': ''} ¤Ç¤ÏÀµ¾ï¤Ë¼Â¹Ô¤Ç¤¤Þ¤»¤ó¡£¤è¤Ã¤Æ¥Ç¥â¤Î¼Â¹Ô¤òÃæ»ß¤·¤Þ¤·¤¿¡£¤¿¤À¤·¡¢²¼¤Î¥³¡¼¥É»²¾È¥Ü¥¿¥ó¤ò²¡¤¹¤³¤È¤Ç¡¢¼Â¹Ô¤¬Ãæ»ß¤µ¤ì¤¿¥¹¥¯¥ê¥×¥È¤Î¥½¡¼¥¹¤ò»²¾È¤¹¤ë¤³¤È¤Ï²Äǽ¤Ç¤¹¡£") -}.pack('side'=>'top') - -# frame À¸À® -TkFrame.new($menu8x_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $menu8x_demo - $menu8x_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'menu'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -else ; # Tk8.x - -# label À¸À® -TkLabel.new($menu8x_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { - if $tk_platform['platform'] == 'macintosh' - text("¤³¤Î¥¦¥£¥ó¥É¥¦¤ÏÍÍ¡¹¤Ê¥á¥Ë¥å¡¼¤È¥«¥¹¥±¡¼¥É¥á¥Ë¥å¡¼¤«¤é¹½À®¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Command-X ¤òÆþÎϤ¹¤ë¤È¡¢X¤¬¥³¥Þ¥ó¥É¥¡¼µ¹æ¤Ë³¤¤¤ÆÉ½¼¨¤µ¤ì¤Æ¤¤¤ëʸ»ú¤Ê¤é¤Ð¡¢¥¢¥¯¥»¥é¥ì¡¼¥¿¤ò»È¤Ã¤¿¹àÌܵ¯Æ°¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤¤Þ¤¹¡£¥á¥Ë¥å¡¼Í×ÁÇÃæ¡¢ºÇ¸å¤Î¤â¤Î¤Ï¡¢¤½¤Î¥á¥Ë¥å¡¼¤ÎºÇ½é¤Î¹àÌܤòÁªÂò¤¹¤ë¤³¤È¤ÇÆÈΩ¤µ¤»¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£") - else - text("¤³¤Î¥¦¥£¥ó¥É¥¦¤ÏÍÍ¡¹¤Ê¥á¥Ë¥å¡¼¤È¥«¥¹¥±¡¼¥É¥á¥Ë¥å¡¼¤«¤é¹½À®¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Alt-X ¤òÆþÎϤ¹¤ë¤È¡¢X¤¬¥á¥Ë¥å¡¼¤Ë¥¢¥ó¥À¡¼¥é¥¤¥óÉÕ¤¤Çɽ¼¨¤µ¤ì¤Æ¤¤¤ëʸ»ú¤Ê¤é¤Ð¡¢¥¡¼¥Ü¡¼¥É¤«¤é¤Î»ØÄ꤬¤Ç¤¤Þ¤¹¡£Ìð°õ¥¡¼¤Ç¥á¥Ë¥å¡¼¤Î¥È¥é¥Ð¡¼¥¹¤â²Äǽ¤Ç¤¹¡£¥á¥Ë¥å¡¼¤¬»ØÄꤵ¤ì¤¿ºÝ¤Ë¤Ï¡¢¥¹¥Ú¡¼¥¹¥¡¼¤Ç¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£¤¢¤ë¤¤¤Ï¡¢¥¢¥ó¥À¡¼¥é¥¤¥óÉÕ¤¤Îʸ»ú¤òÆþÎϤ¹¤ë¤³¤È¤Ç¤â¼Â¹Ô¤Ç¤¤Þ¤¹¡£¥á¥Ë¥å¡¼¤Î¥¨¥ó¥È¥ê¤¬¥¢¥¯¥»¥é¥ì¡¼¥¿¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤½¤Î¥¢¥¯¥»¥é¥ì¡¼¥¿¤òÆþÎϤ¹¤ë¤³¤È¤Ç¥á¥Ë¥å¡¼¤ò»ØÄꤹ¤ë¤³¤È¤Ê¤·¤Ë¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£¥á¥Ë¥å¡¼Í×ÁÇÃæ¡¢ºÇ¸å¤Î¤â¤Î¤Ï¡¢¤½¤Î¥á¥Ë¥å¡¼¤ÎºÇ½é¤Î¹àÌܤòÁªÂò¤¹¤ë¤³¤È¤ÇÆÈΩ¤µ¤»¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£") - end -}.pack('side'=>'top') - -# ¾õÂÖɽ¼¨¤ÎÀ¸À® -$menu8xstatus = TkVariable.new(" ") -TkFrame.new($menu8x_demo) {|frame| - TkLabel.new(frame, 'textvariable'=>$menu8xstatus, 'relief'=>'sunken', - 'bd'=>1, 'font'=>['Helvetica', '10'], 'anchor'=>'w')\ - .pack('side'=>'left', 'padx'=>2, 'expand'=>'yes', 'fill'=>'both') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2) - -# frame À¸À® -TkFrame.new($menu8x_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $menu8x_demo - $menu8x_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'menu'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# menu À¸À® -TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m| - TkMenu.new(m, 'tearoff'=>false) {|file_menu| - m.add('cascade', 'label'=>'File', 'menu'=>file_menu, 'underline'=>0) - add('command', 'label'=>'³«¤¯ ...', 'command'=>proc{fail '¤³¤ì¤Ï¡¢¥Ç¥â¤Ç¤¹¤Î¤Ç"³«¤¯ ..."¤ËÂФ¹¤ë¥¢¥¯¥·¥ç¥ó¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£'}) - add('command', 'label'=>'¿·µ¬', 'command'=>proc{fail '¤³¤ì¤Ï¡¢¥Ç¥â¤Ç¤¹¤Î¤Ç"¿·µ¬"¤ËÂФ¹¤ë¥¢¥¯¥·¥ç¥ó¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£'}) - add('command', 'label'=>'Êݸ', 'command'=>proc{fail '¤³¤ì¤Ï¡¢¥Ç¥â¤Ç¤¹¤Î¤Ç"Êݸ"¤ËÂФ¹¤ë¥¢¥¯¥·¥ç¥ó¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£'}) - add('command', 'label'=>'Êݸ(»ØÄê) ...', 'command'=>proc{fail '¤³¤ì¤Ï¡¢¥Ç¥â¤Ç¤¹¤Î¤Ç"Êݸ(»ØÄê) ..."¤ËÂФ¹¤ë¥¢¥¯¥·¥ç¥ó¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£'}) - add('separator') - add('command', 'label'=>'¥×¥ê¥ó¥ÈÀßÄê ...', 'command'=>proc{fail '¤³¤ì¤Ï¡¢¥Ç¥â¤Ç¤¹¤Î¤Ç"¥×¥ê¥ó¥ÈÀßÄê ..."¤ËÂФ¹¤ë¥¢¥¯¥·¥ç¥ó¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£'}) - add('command', 'label'=>'¥×¥ê¥ó¥È ...', 'command'=>proc{fail '¤³¤ì¤Ï¡¢¥Ç¥â¤Ç¤¹¤Î¤Ç"¥×¥ê¥ó¥È ..."¤ËÂФ¹¤ë¥¢¥¯¥·¥ç¥ó¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£'}) - add('separator') - add('command', 'label'=>'½ªÎ»', 'command'=>proc{$menu8x_demo.destroy}) - } - - if $tk_platform['platform'] == 'macintosh' - modifier = 'Command' - elsif $tk_platform['platform'] == 'windows' - modifier = 'Control' - else - modifier = 'Meta' - end - - TkMenu.new(m, 'tearoff'=>false) {|basic_menu| - m.add('cascade', 'label'=>'Basic', 'menu'=>basic_menu, 'underline'=>0) - add('command', 'label'=>'²¿¤â¤·¤Ê¤¤Ä¹¤¤¥¨¥ó¥È¥ê') - ['A','B','C','D','E','F','G'].each{|c| - # add('command', 'label'=>"ʸ»ú \"#{c}\" ¤ò°õ»ú", 'underline'=>4, - add('command', 'label'=>"Print letter \"#{c}\" (ʸ»ú \"#{c}\" ¤ò°õ»ú)", - 'underline'=>14, 'accelerator'=>"Meta+#{c}", - 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") - $menu8x_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) - } - } - - TkMenu.new(m, 'tearoff'=>false) {|cascade_menu| - m.add('cascade', 'label'=>'Cascades', 'menu'=>cascade_menu, 'underline'=>0) - add('command', 'label'=>'Print hello(¤³¤ó¤Ë¤Á¤Ï)', - 'command'=>proc{print "Hello(¤³¤ó¤Ë¤Á¤Ï)\n"}, - 'accelerator'=>"#{modifier}+H", 'underline'=>6) - $menu8x_demo.bind("#{modifier}-h", proc{print "Hello(¤³¤ó¤Ë¤Á¤Ï)\n"}) - add('command', 'label'=>'Print goodbye(¤µ¤è¤¦¤Ê¤é)', - 'command'=>proc{print "Goodbye(¤µ¤è¤¦¤Ê¤é)\n"}, - 'accelerator'=>"#{modifier}+G", 'underline'=>6) - $menu8x_demo.bind("#{modifier}-g", proc{print "Goodbye(¤µ¤è¤¦¤Ê¤é)\n"}) - - TkMenu.new(m, 'tearoff'=>false) {|cascade_check| - cascade_menu.add('cascade', 'label'=>'Check buttons(¥Á¥§¥Ã¥¯¥Ü¥¿¥ó)', - 'menu'=>cascade_check, 'underline'=>0) - oil = TkVariable.new(0) - add('check', 'label'=>'¥ª¥¤¥ëÅÀ¸¡', 'variable'=>oil) - trans = TkVariable.new(0) - add('check', 'label'=>'¥È¥é¥ó¥¹¥ß¥Ã¥·¥ç¥óÅÀ¸¡', 'variable'=>trans) - brakes = TkVariable.new(0) - add('check', 'label'=>'¥Ö¥ì¡¼¥ÅÀ¸¡', 'variable'=>brakes) - lights = TkVariable.new(0) - add('check', 'label'=>'¥é¥¤¥ÈÅÀ¸¡', 'variable'=>lights) - add('separator') - add('command', 'label'=>'¸½ºß¤ÎÃͤòɽ¼¨', - 'command'=>proc{showVars($menu8x_demo, - ['¥ª¥¤¥ëÅÀ¸¡', oil], - ['¥È¥é¥ó¥¹¥ß¥Ã¥·¥ç¥óÅÀ¸¡', trans], - ['¥Ö¥ì¡¼¥ÅÀ¸¡', brakes], - ['¥é¥¤¥ÈÅÀ¸¡', lights])} ) - invoke 1 - invoke 3 - } - - TkMenu.new(m, 'tearoff'=>false) {|cascade_radio| - cascade_menu.add('cascade', 'label'=>'Radio buttons(¥é¥¸¥ª¥Ü¥¿¥ó)', - 'menu'=>cascade_radio, 'underline'=>0) - pointSize = TkVariable.new - add('radio', 'label'=>'10 ¥Ý¥¤¥ó¥È', 'variable'=>pointSize, 'value'=>10) - add('radio', 'label'=>'14 ¥Ý¥¤¥ó¥È', 'variable'=>pointSize, 'value'=>14) - add('radio', 'label'=>'18 ¥Ý¥¤¥ó¥È', 'variable'=>pointSize, 'value'=>18) - add('radio', 'label'=>'24 ¥Ý¥¤¥ó¥È', 'variable'=>pointSize, 'value'=>24) - add('radio', 'label'=>'32 ¥Ý¥¤¥ó¥È', 'variable'=>pointSize, 'value'=>32) - add('separator') - style = TkVariable.new - add('radio', 'label'=>'¥í¡¼¥Þ¥ó', 'variable'=>style, 'value'=>'roman') - add('radio', 'label'=>'¥Ü¡¼¥ë¥É', 'variable'=>style, 'value'=>'bold') - add('radio', 'label'=>'¥¤¥¿¥ê¥Ã¥¯', 'variable'=>style, 'value'=>'italic') - add('separator') - add('command', 'label'=>'¸½ºß¤ÎÃͤòɽ¼¨', - 'command'=>proc{showVars($menu8x_demo, - ['¥Ý¥¤¥ó¥È¥µ¥¤¥º', pointSize], - ['¥¹¥¿¥¤¥ë', style])} ) - invoke 1 - invoke 7 - } - } - - TkMenu.new(m, 'tearoff'=>false) {|icon_menu| - m.add('cascade', 'label'=>'Icons', 'menu'=>icon_menu, 'underline'=>0) - add('command', - 'bitmap'=>'@'+[$demo_dir,'images','pattern.bmp'].join(File::Separator), - 'hidemargin'=>1, - 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', - 'text'=>'º£¤¢¤Ê¤¿¤¬ÁªÂò¤·¤¿¥á¥Ë¥å¡¼¤Î¹àÌܤϥƥ¥¹¥È¤Ç¤Ï¤Ê¤¯¥Ó¥Ã¥È¥Þ¥Ã¥×¤òɽ¼¨¤·¤Æ¤¤¤Þ¤·¤¿¡£¤½¤ì°Ê³°¤ÎÅÀ¤Ç¤Ï¾¤Î¥á¥Ë¥å¡¼¹àÌܤÈÊѤï¤ê¤Þ¤»¤ó¡£', - 'bitmap'=>'', 'default'=>0, - 'buttons'=>'λ²ò')} ) - ['info', 'questhead', 'error'].each{|icon| - add('command', 'bitmap'=>icon, 'hidemargin'=>1, - 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) - } - - entryconfigure(2, 'columnbreak'=>1) - } - - TkMenu.new(m, 'tearoff'=>false) {|more_menu| - m.add('cascade', 'label'=>'More', 'menu'=>more_menu, 'underline'=>0) - [ '¥¨¥ó¥È¥ê','Ê̤Υ¨¥ó¥È¥ê','²¿¤â¤·¤Ê¤¤','¤Û¤È¤ó¤É²¿¤â¤·¤Ê¤¤', - '¿ÍÀ¸¤ò°ÕµÁ¤¢¤ë¤â¤Î¤Ë' ].each{|i| - add('command', 'label'=>i, - 'command'=>proc{print "You invoked \"#{i}\"\n"}) - } - } - - TkMenu.new(m) {|colors_menu| - m.add('cascade', 'label'=>'Colors', 'menu'=>colors_menu, 'underline'=>1) - ['red', 'orange', 'yellow', 'green', 'blue'].each{|c| - add('command', 'label'=>c, 'background'=>c, - 'command'=>proc{print "You invoked \"#{c}\"\n"}) - } - } - - $menu8x_demo.configure('menu'=>m) -} - -TkMenu.bind('<MenuSelect>', - proc{|w| - begin - label = w.entrycget('active', 'label') - rescue - label = ' ' - end - $menu8xstatus.value = label - Tk.update('idletasks') - }, '%W') - -end ; # Tk 8.x diff --git a/ext/tk/sample/demos-jp/menubu.rb b/ext/tk/sample/demos-jp/menubu.rb deleted file mode 100644 index 8b4d7980d2..0000000000 --- a/ext/tk/sample/demos-jp/menubu.rb +++ /dev/null @@ -1,233 +0,0 @@ -require "tkcanvas" - -def optionMenu(menubutton, varName, firstValue, *rest) - varName.value = firstValue - configoptions = {'textvariable'=>varName,'indicatoron'=>'on', - 'relief'=>'raised','borderwidth'=>2,'highlightthickness'=>2, - 'anchor'=>'c','direction'=>'flush'} - configoptions.each {|key, value| - menubutton.configure(key, value) - } - menu = TkMenu.new(menubutton) { - tearoff 'off' - add 'radio', 'label'=>firstValue, 'variable'=>varName - } - menubutton.menu(menu) - for i in rest - menu.add 'radio', 'label'=>i, 'variable'=>varName - end - - return menu -end - -if defined?($menubu_demo) && $menubu_demo - $menubu_demo.destroy - $menubu_demo = nil -end - -$menubu_demo = TkToplevel.new {|w| - title("Menu Button Demonstration") - iconname("menubutton") -} - -positionWindow($menubu_demo) - -# version check -if $tk_version.to_f < 8.0 - -# label À¸À® -TkLabel.new($menubu_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { - text("¼Â¹Ô¤·¤è¤¦¤È¤·¤¿¥¹¥¯¥ê¥×¥È¤Ï Tk8.0 °Ê¾å¤ÇÍøÍѤǤ¤ëµ¡Ç½¤òÍøÍѤ·¤Æ¤¤¤ë¤¿¤á¡¢¤¢¤Ê¤¿¤Î Ruby#{VERSION}/Tk#{$tk_version}#{(Tk::JAPANIZED_TK)? 'jp': ''} ¤Ç¤ÏÀµ¾ï¤Ë¼Â¹Ô¤Ç¤¤Þ¤»¤ó¡£¤è¤Ã¤Æ¥Ç¥â¤Î¼Â¹Ô¤òÃæ»ß¤·¤Þ¤·¤¿¡£¤¿¤À¤·¡¢²¼¤Î¥³¡¼¥É»²¾È¥Ü¥¿¥ó¤ò²¡¤¹¤³¤È¤Ç¡¢¼Â¹Ô¤¬Ãæ»ß¤µ¤ì¤¿¥¹¥¯¥ê¥×¥È¤Î¥½¡¼¥¹¤ò»²¾È¤¹¤ë¤³¤È¤Ï²Äǽ¤Ç¤¹¡£") -}.pack('side'=>'top') - -# frame À¸À® -TkFrame.new($menubu_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $menubu_demo - $menubu_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'menu'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -else ; # Tk8.x - -body = TkFrame.new($menubu_demo) -body.pack('expand'=>'yes', 'fill'=>'both') - -below = TkMenubutton.new(body) { - text "Below" - underline 0 - direction 'below' - relief 'raised' -} -belowMenu = TkMenu.new(below) { - tearoff 0 - add 'command', 'label'=>"Below menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Below menu.\""} - add 'command', 'label'=>"Below menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Below menu.\""} -} -below.menu(belowMenu) -below.grid('row'=>0, 'column'=>1, 'sticky'=>'n') - -below = TkMenubutton.new(body) { - text "Below" - underline 0 - direction 'below' - relief 'raised' -} -belowMenu = TkMenu.new(below) { - tearoff 0 - add 'command', 'label'=>"Below menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Below menu.\""} - add 'command', 'label'=>"Below menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Below menu.\""} -} -below.menu(belowMenu) -below.grid('row'=>0, 'column'=>1, 'sticky'=>'n') - -below = TkMenubutton.new(body) { - text "Below" - underline 0 - direction 'below' - relief 'raised' -} -belowMenu = TkMenu.new(below) { - tearoff 0 - add 'command', 'label'=>"Below menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Below menu.\""} - add 'command', 'label'=>"Below menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Below menu.\""} -} -below.menu(belowMenu) -below.grid('row'=>0, 'column'=>1, 'sticky'=>'n') - -right = TkMenubutton.new(body) { - text "Right" - underline 0 - direction 'right' - relief 'raised' -} -rightMenu = TkMenu.new(right) { - tearoff 0 - add 'command', 'label'=>"Right menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Left menu.\""} - add 'command', 'label'=>"Right menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Right menu.\""} -} -right.menu(rightMenu) -right.grid('row'=>1, 'column'=>0, 'sticky'=>'w') - -left = TkMenubutton.new(body) { - text "Left" - underline 0 - direction 'left' - relief 'raised' -} -leftMenu = TkMenu.new(left) { - tearoff 0 - add 'command', 'label'=>"Left menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Left menu.\""} - add 'command', 'label'=>"Left menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Left menu.\""} -} -left.menu(leftMenu) -left.grid('row'=>1, 'column'=>2, 'sticky'=>'e') - -center = TkFrame.new(body) { - grid('row'=>1, 'column'=>1, 'sticky'=>'news') -} - -above = TkMenubutton.new(body) { - text "Above" - underline 0 - direction 'above' - relief 'raised' -} -aboveMenu = TkMenu.new(above) { - tearoff 0 - add 'command', 'label'=>"Above menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Above menu.\""} - add 'command', 'label'=>"Above menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Above menu.\""} -} -above.menu(aboveMenu) -above.grid('row'=>2, 'column'=>1, 'sticky'=>'s') - -center = TkFrame.new(body) { - grid('row'=>1, 'column'=>1, 'sticky'=>'news') -} - -TkFrame.new($menubu_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc { - tmppath = $menubu_demo - $menubu_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc { showCode 'menubu' } - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'expand'=>'yes', 'fill'=>'x', 'pady'=>'2m') - -msg = TkLabel.new(center) { -# font $font - wraplength '4i' - justify 'left' - text "¤³¤ì¤Ï¥á¥Ë¥å¡¼¥Ü¥¿¥ó¤Î¥Ç¥â¤Ç¤¹¡£\"Below\"¤Î¥Ü¥¿¥ó¤Ï\ -²¼¤Ë¥á¥Ë¥å¡¼¤ò½Ð¤·¡¢\"Right\"¤Î¥Ü¥¿¥ó¤Ï±¦¤Ë¥á¥Ë¥å¡¼¤ò½Ð¤·¤Æ¡¢\ -¡Ä¡Ä¤È¤Ê¤ê¤Þ¤¹¡£¤³¤Îʸ¾Ï¤Î²¼¤Ë¤Ï2¤Ä¤Î¥ª¥×¥·¥ç¥ó¥á¥Ë¥å¡¼¤¬¤¢¤ê¤Þ¤¹¡£\ -1¤Ä¤ÏÉáÄ̤Υá¥Ë¥å¡¼¤Ç¡¢¤â¤¦1¤Ä¤Ï16¿§¤Î¥Ñ¥ì¥Ã¥È¤Ç¤¹¡£" -} -msg.pack('side'=>'top', 'padx'=>25, 'pady'=>25) - -TkFrame.new(center) {|f| - menubuttonoptions = TkVariable.new - mbutton = TkMenubutton.new(f) - options = optionMenu(mbutton, menubuttonoptions, - 'one', 'two', 'three') - mbutton.pack('side'=>'left', 'padx'=>25, 'pady'=>25) - paletteColor = TkVariable.new - colors = ['Black','red4','DarkGreen','NavyBlue', 'gray75', - 'Red','Green','Blue','gray50','Yellow','Cyan','Magenta', - 'White','Brown','DarkSeaGreen','DarkViolet'] - colorMenuButton = TkMenubutton.new(f) - m = optionMenu(colorMenuButton, paletteColor, *colors) - begin - windowingsystem = Tk.windowingsystem() - rescue - windowingsystem = "" - end - if windowingsystem == "classic" || windowingsystem == "aqua" - topBorderColor = 'Black' - bottomBorderColor = 'Black' - else - topBorderColor = 'gray50' - bottomBorderColor = 'gray75' - end - for i in 0..15 - image = TkPhotoImage.new('height'=>16, 'width'=>16) - image.put(topBorderColor, 0, 0, 16, 1) - image.put(topBorderColor, 0, 1, 1, 16) - image.put(bottomBorderColor, 0, 15, 16, 16) - image.put(bottomBorderColor, 15, 1, 16, 16) - image.put(colors[i], 1, 1, 15, 15) - - selectimage = TkPhotoImage.new('height'=>16, 'width'=>16) - selectimage.put('Black', 0, 0, 16, 2) - selectimage.put('Black', 0, 2, 2, 16) - selectimage.put('Black', 2, 14, 16, 16) - selectimage.put('Black', 14, 2, 16, 14) - selectimage.put(colors[i], 2, 2, 14, 14) - - m.entryconfigure(i, 'image'=>image, 'selectimage'=>selectimage, 'hidemargin'=>'on') - end - m.configure('tearoff', 'on') - for c in ['Black', 'gray75', 'gray50', 'White'] - m.entryconfigure(c, 'columnbreak'=>1) - end - colorMenuButton.pack('side'=>'left', 'padx'=>25, 'pady'=>25) - pack 'padx'=>25, 'pady'=>25 -} - -end ; # Tk8.x diff --git a/ext/tk/sample/demos-jp/msgbox.rb b/ext/tk/sample/demos-jp/msgbox.rb deleted file mode 100644 index cf53d70487..0000000000 --- a/ext/tk/sample/demos-jp/msgbox.rb +++ /dev/null @@ -1,85 +0,0 @@ -# -# message boxes widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($msgbox_demo) && $msgbox_demo - $msgbox_demo.destroy - $msgbox_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$msgbox_demo = TkToplevel.new {|w| - title("Message Box Demonstration") - iconname("messagebox") - positionWindow(w) -} - -# label À¸À® -TkLabel.new($msgbox_demo, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', - 'text'=>"ɽ¼¨¤¹¤ë¥¢¥¤¥³¥ó¤È¥á¥Ã¥»¡¼¥¸¥Ü¥Ã¥¯¥¹¤Î¼ïÎà¤òÁª¤ó¤Ç²¼¤µ¤¤¡£¤½¤·¤Æ \"¥á¥Ã¥»¡¼¥¸¥Ü¥Ã¥¯¥¹\" ¥Ü¥¿¥ó¤ò²¡¤¹¤È¡¢»ØÄꤷ¤¿¥á¥Ã¥»¡¼¥¸¥Ü¥Ã¥¯¥¹¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£").pack('side'=>'top') - -# frame À¸À® -TkFrame.new($msgbox_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $msgbox_demo - $msgbox_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'msgbox'} - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥á¥Ã¥»¡¼¥¸¥Ü¥Ã¥¯¥¹' - command proc{showMessageBox $msgbox_demo} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame À¸À® -$msgbox_leftframe = TkFrame.new($msgbox_demo) -$msgbox_rightframe = TkFrame.new($msgbox_demo) -$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', - 'pady'=>'.5c', 'padx'=>'.5c') -$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', - 'pady'=>'.5c', 'padx'=>'.5c') - -TkLabel.new($msgbox_leftframe, 'text'=>'¥¢¥¤¥³¥ó').pack('side'=>'top') -TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\ -.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no') - -$msgboxIcon = TkVariable.new('info') -['error', 'info', 'question', 'warning'].each {|icon| - TkRadioButton.new($msgbox_leftframe, 'text'=>icon, 'variable'=>$msgboxIcon, - 'relief'=>'flat', 'value'=>icon, 'width'=>16, - 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, - 'anchor'=>'w', 'fill'=>'x') -} - -TkLabel.new($msgbox_rightframe, 'text'=>'¼ïÎà').pack('side'=>'top') -TkFrame.new($msgbox_rightframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\ -.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no') - -$msgboxType = TkVariable.new('ok') -['abortretryignore', 'ok', 'okcancel', - 'retrycancel', 'yesno', 'yesnocancel'].each {|type| - TkRadioButton.new($msgbox_rightframe, 'text'=>type, 'variable'=>$msgboxType, - 'relief'=>'flat', 'value'=>type, 'width'=>16, - 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, - 'anchor'=>'w', 'fill'=>'x') -} - -def showMessageBox(w) - button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value, - 'title'=>'Message', 'parent'=>w, - 'message'=>"¤³¤ì¤Ï \"#{$msgboxType.value}\" ¤È¤¤¤¦¼ïÎà¤Î¥á¥Ã¥»¡¼¥¸¥Ü¥Ã¥¯¥¹¤Ç¡¢\"#{$msgboxIcon.value}\" ¤Î¥¢¥¤¥³¥ó¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£") - - Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w, - 'message'=>"¤¢¤Ê¤¿¤Ï \"#{button}\" ¤ò²¡¤·¤Þ¤·¤¿¤Í¡£") -end - diff --git a/ext/tk/sample/demos-jp/paned1.rb b/ext/tk/sample/demos-jp/paned1.rb deleted file mode 100644 index 99e6b6cddb..0000000000 --- a/ext/tk/sample/demos-jp/paned1.rb +++ /dev/null @@ -1,48 +0,0 @@ -# paned1.rb -# -# This demonstration script creates a toplevel window containing -# a paned window that separates two windows horizontally. -# -# based on "Id: paned1.tcl,v 1.1 2002/02/22 14:07:01 dkf Exp" - -if defined?($paned1_demo) && $paned1_demo - $paned1_demo.destroy - $paned1_demo = nil -end - -$paned1_demo = TkToplevel.new {|w| - title("Horizontal Paned Window Demonstration") - iconname("paned1") - positionWindow(w) -} - -TkLabel.new($paned1_demo, - :font=>$font, :wraplength=>'4i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) -²¼¤Î¿§ÉÕ¤±¤µ¤ì¤¿Æó¤Ä¤Î¥¦¥£¥ó¥É¥¦¤Î´Ö¤Î»ÅÀÚ¤êÏȤϡ¢°ì¤Ä¤ÎÎΰè¤ò¤½¤ì¤¾¤ì¤Î¥¦¥£¥ó¥É¥¦¤Î¤¿¤á¤Ëʬ³ä¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¹¡£º¸¥Ü¥¿¥ó¤Ç»ÅÀÚ¤ê¤òÁàºî¤¹¤ë¤È¡¢Ê¬³ä¥µ¥¤¥ºÊѹ¹¤ÎÁàºîÅÓÃæ¤Ç¤ÏºÆÉ½¼¨¤Ï¤Ê¤µ¤ì¤º¡¢³ÎÄꤵ¤»¤¿¤È¤¤Ëɽ¼¨¤¬¹¹¿·¤µ¤ì¤Þ¤¹¡£¥Þ¥¦¥¹¤Ë¤è¤ë»ÅÀÚ¤ê¤ÎÁàºî¤ËÄɿ路¤Æ¥µ¥¤¥º¤òÊѹ¹¤·¤¿É½¼¨¤¬¤Ê¤ï¤ì¤ë¤è¤¦¤Ë¤·¤¿¤¤¾ì¹ç¤Ï¡¢¥Þ¥¦¥¹¤ÎÃæ±û¥Ü¥¿¥ó¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£ -¤â¤·¤¢¤Ê¤¿¤¬»È¤Ã¤Æ¤¤¤ë Ruby ¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë Tk ¥é¥¤¥Ö¥é¥ê¤¬ panedwindow ¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤ -¾ì¹ç¡¢¤³¤Î¥Ç¥â¤Ï¤¦¤Þ¤¯Æ°¤«¤Ê¤¤¤Ï¤º¤Ç¤¹¡£¤½¤Î¾ì¹ç¤Ë¤Ï panedwindow ¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ê -¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î Tk ¤òÁȤ߹ç¤ï¤»¤Æ»î¤¹ -¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£ -EOL - -# The bottom buttons -TkFrame.new($paned1_demo){|f| - pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - - TkButton.new(f, :text=>'λ²ò', :width=>15, :command=>proc{ - $paned1_demo.destroy - $paned1_demo = nil - }).pack(:side=>:left, :expand=>true) - - TkButton.new(f, :text=>'¥³¡¼¥É»²¾È', :width=>15, :command=>proc{ - showCode 'paned1' - }).pack(:side=>:left, :expand=>true) -} - -TkPanedwindow.new($paned1_demo){|f| - pack(:side=>:top, :expand=>true, :fill=>:both, :pady=>2, :padx=>'2m') - - add(TkLabel.new(f, :text=>"This is the\nleft side", :bg=>'yellow'), - TkLabel.new(f, :text=>"This is the\nright side", :bg=>'cyan')) -} diff --git a/ext/tk/sample/demos-jp/paned2.rb b/ext/tk/sample/demos-jp/paned2.rb deleted file mode 100644 index 9df88c4b97..0000000000 --- a/ext/tk/sample/demos-jp/paned2.rb +++ /dev/null @@ -1,96 +0,0 @@ -# paned2.rb -- -# -# This demonstration script creates a toplevel window containing -# a paned window that separates two windows vertically. -# -# based on "Id: paned2.tcl,v 1.1 2002/02/22 14:07:01 dkf Exp" - -if defined?($paned2_demo) && $paned2_demo - $paned2_demo.destroy - $paned2_demo = nil -end - -$paned2_demo = TkToplevel.new {|w| - title("Vertical Paned Window Demonstration") - iconname("paned2") - positionWindow(w) -} - -TkLabel.new($paned2_demo, - :font=>$font, :wraplength=>'4i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) -²¼¤Î¥¹¥¯¥í¡¼¥ë¥Ð¡¼ÉÕ¤¤Î¥¦¥£¥¸¥§¥Ã¥È¤¬ÃÖ¤«¤ì¤¿Æó¤Ä¤Î¥¦¥£¥ó¥É¥¦¤Î´Ö¤Î»ÅÀÚ¤êÏȤϡ¢°ì¤Ä¤ÎÎΰè¤ò¤½¤ì¤¾¤ì¤Î¥¦¥£¥ó¥É¥¦¤Î¤¿¤á¤Ëʬ³ä¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¹¡£º¸¥Ü¥¿¥ó¤Ç»ÅÀÚ¤ê¤òÁàºî¤¹¤ë¤È¡¢Ê¬³ä¥µ¥¤¥ºÊѹ¹¤ÎÁàºîÅÓÃæ¤Ç¤ÏºÆÉ½¼¨¤Ï¤Ê¤µ¤ì¤º¡¢³ÎÄꤵ¤»¤¿¤È¤¤Ëɽ¼¨¤¬¹¹¿·¤µ¤ì¤Þ¤¹¡£¥Þ¥¦¥¹¤Ë¤è¤ë»ÅÀÚ¤ê¤ÎÁàºî¤ËÄɿ路¤Æ¥µ¥¤¥º¤òÊѹ¹¤·¤¿É½¼¨¤¬¤Ê¤ï¤ì¤ë¤è¤¦¤Ë¤·¤¿¤¤¾ì¹ç¤Ï¡¢¥Þ¥¦¥¹¤ÎÃæ±û¥Ü¥¿¥ó¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£ -¤â¤·¤¢¤Ê¤¿¤¬»È¤Ã¤Æ¤¤¤ë Ruby ¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë Tk ¥é¥¤¥Ö¥é¥ê¤¬ panedwindow ¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤ -¾ì¹ç¡¢¤³¤Î¥Ç¥â¤Ï¤¦¤Þ¤¯Æ°¤«¤Ê¤¤¤Ï¤º¤Ç¤¹¡£¤½¤Î¾ì¹ç¤Ë¤Ï panedwindow ¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ê -¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î Tk ¤òÁȤ߹ç¤ï¤»¤Æ»î¤¹ -¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£ -EOL - -# The bottom buttons -TkFrame.new($paned2_demo){|f| - pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - - TkButton.new(f, :text=>'λ²ò', :width=>15, :command=>proc{ - $paned2_demo.destroy - $paned2_demo = nil - }).pack(:side=>:left, :expand=>true) - - TkButton.new(f, :text=>'¥³¡¼¥É»²¾È', :width=>15, :command=>proc{ - showCode 'paned2' - }).pack(:side=>:left, :expand=>true) -} - -paneList = TkVariable.new # define as normal variable (not array) -paneList.value = [ # ruby's array --> tcl's list - 'Ruby/Tk ¤Î¥¦¥£¥¸¥§¥Ã¥È°ìÍ÷', - 'TkButton', - 'TkCanvas', - 'TkCheckbutton', - 'TkEntry', - 'TkFrame', - 'TkLabel', - 'TkLabelframe', - 'TkListbox', - 'TkMenu', - 'TkMenubutton', - 'TkMessage', - 'TkPanedwindow', - 'TkRadiobutton', - 'TkScale', - 'TkScrollbar', - 'TkSpinbox', - 'TkText', - 'TkToplevel' -] - -# Create the pane itself -TkPanedwindow.new($paned2_demo, :orient=>:vertical){|f| - pack(:side=>:top, :expand=>true, :fill=>:both, :pady=>2, :padx=>'2m') - - add(TkFrame.new(f){|paned2_top| - TkListbox.new(paned2_top, :listvariable=>paneList) { - # Invert the first item to highlight it - itemconfigure(0, :background=>self.cget(:foreground), - :foreground=>self.cget(:background) ) - yscrollbar(TkScrollbar.new(paned2_top).pack(:side=>:right, - :fill=>:y)) - pack(:fill=>:both, :expand=>true) - } - }, - - TkFrame.new(f) {|paned2_bottom| - # The bottom window is a text widget with scrollbar - paned2_xscr = TkScrollbar.new(paned2_bottom) - paned2_yscr = TkScrollbar.new(paned2_bottom) - paned2_text = TkText.new(paned2_bottom, :width=>30, :wrap=>:non) { - insert('1.0', '¤³¤³¤ËÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢' + - '¤´¤¯ÉáÄ̤Υƥ¥¹¥È¥¦¥£¥¸¥§¥Ã¥È¤Ç¤¹¡£') - xscrollbar(paned2_xscr) - yscrollbar(paned2_yscr) - } - Tk.grid(paned2_text, paned2_yscr, :sticky=>'nsew') - Tk.grid(paned2_xscr, :sticky=>'nsew') - TkGrid.columnconfigure(paned2_bottom, 0, :weight=>1) - TkGrid.rowconfigure(paned2_bottom, 0, :weight=>1) - } ) -} diff --git a/ext/tk/sample/demos-jp/plot.rb b/ext/tk/sample/demos-jp/plot.rb deleted file mode 100644 index 464dd4441d..0000000000 --- a/ext/tk/sample/demos-jp/plot.rb +++ /dev/null @@ -1,118 +0,0 @@ -# -# 2-D plot widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($plot_demo) && $plot_demo - $plot_demo.destroy - $plot_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$plot_demo = TkToplevel.new {|w| - title("Plot Demonstration") - iconname("Plot") - positionWindow(w) -} - -# label À¸À® -TkLabel.new($plot_demo, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', - 'text'=>"¤³¤Î¥¦¥£¥ó¥É¥¦¤Ï´Êñ¤Ê2¼¡¸µ¤Î¥×¥í¥Ã¥È¤ò´Þ¤ó¤À¥¥ã¥ó¥Ð¥¹ widget¤Ç¤¹¡£É½¼¨¤µ¤ì¤¿ÅÀ¤ò¥Þ¥¦¥¹¥Ü¥¿¥ó1¤Ç¥É¥é¥Ã¥°¤·¤Æ¥Ç¡¼¥¿¤ò¤¤¤¸¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£"){ - pack('side'=>'top') -} - -# frame À¸À® -$plot_buttons = TkFrame.new($plot_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $plot_demo - $plot_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'plot'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$plot_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# font ÀßÄê -plotFont = '-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*' - -# canvas ÀßÄê -$plot_canvas = TkCanvas.new($plot_demo,'relief'=>'raised','width'=>450,'height'=>300) -$plot_canvas.pack('side'=>'top', 'fill'=>'x') - -# plot À¸À® -TkcLine.new($plot_canvas, 100, 250, 400, 250, 'width'=>2) -TkcLine.new($plot_canvas, 100, 250, 100, 50, 'width'=>2) -TkcText.new($plot_canvas, 225, 20, - 'text'=>"´Êñ¤Ê¥×¥í¥Ã¥È", 'font'=>plotFont, 'fill'=>'brown') - -(0..10).each {|i| - x = 100 + (i * 30) - TkcLine.new($plot_canvas, x, 250, x, 245, 'width'=>2) - TkcText.new($plot_canvas, x, 254, - 'text'=>10*i, 'font'=>plotFont, 'anchor'=>'n') -} -(0..5).each {|i| - y = 250 - (i * 40) - TkcLine.new($plot_canvas, 100, y, 105, y, 'width'=>2) - TkcText.new($plot_canvas, 96, y, - 'text'=>"#{i*50}.0", 'font'=>plotFont, 'anchor'=>'e') -} - -for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]] - x = 100 + (3*xx) - y = 250 - (4*yy)/5 - item = TkcOval.new($plot_canvas, x-6, y-6, x+6, y+6, - 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') - item.addtag 'point' -end - -$plot_canvas.itembind('point', 'Any-Enter', - proc{$plot_canvas.itemconfigure 'current','fill','red'}) -$plot_canvas.itembind('point', 'Any-Leave', - proc{$plot_canvas.itemconfigure 'current','fill','SkyBlue2'}) -$plot_canvas.itembind('point', '1', - proc{|x,y| plotDown $plot_canvas,x,y}, "%x %y") -$plot_canvas.itembind('point', 'ButtonRelease-1', - proc{$plot_canvas.dtag 'selected'}) -$plot_canvas.bind('B1-Motion', - proc{|x,y| plotMove $plot_canvas,x,y}, "%x %y") - -$plot = {'lastX'=>0, 'lastY'=>0} - -# plotDown -- -# This method is invoked when the mouse is pressed over one of the -# data points. It sets up state to allow the point to be dragged. -# -# Arguments: -# w - The canvas window. -# x, y - The coordinates of the mouse press. - -def plotDown (w, x, y) - w.dtag 'selected' - w.addtag_withtag 'selected', 'current' - w.raise 'current' - $plot['lastX'] = x - $plot['lastY'] = y -end - -# plotMove -- -# This method is invoked during mouse motion events. It drags the -# current item. -# -# Arguments: -# w - The canvas window. -# x, y - The coordinates of the mouse. - -def plotMove (w, x, y) - w.move 'selected', x - $plot['lastX'], y - $plot['lastY'] - $plot['lastX'] = x - $plot['lastY'] = y -end - diff --git a/ext/tk/sample/demos-jp/puzzle.rb b/ext/tk/sample/demos-jp/puzzle.rb deleted file mode 100644 index 24c48693a9..0000000000 --- a/ext/tk/sample/demos-jp/puzzle.rb +++ /dev/null @@ -1,115 +0,0 @@ -# -# widet demo 'puzzle' (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($puzzle_demo) && $puzzle_demo - $puzzle_demo.destroy - $puzzle_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$puzzle_demo = TkToplevel.new {|w| - title("15-Puzzle Demonstration") - iconname("15-Puzzle") - positionWindow(w) -} - -# label À¸À® -msg = TkLabel.new($puzzle_demo) { - font $font - wraplength '4i' - justify 'left' - text "²¼¤Î15-¥Ñ¥º¥ë¤Ï¥Ü¥¿¥ó¤ò½¸¤á¤Æ¤Ç¤¤Æ¤¤¤Þ¤¹¡£¶õ¤¤¤Æ¤¤¤ë½ê¤ÎÎ٤Υԡ¼¥¹¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¤½¤Î¥Ô¡¼¥¹¤¬¤½¤Î¶õ¤¤¤Æ¤¤¤ë¾ì½ê¤Ë¥¹¥é¥¤¥É¤·¤Þ¤¹¡£¤³¤ÎÁàºî¤ò³¤±¡¢¥Ô¡¼¥¹¤¬¤½¤Î¿ô¤Î½ç¤Ë¾å¤«¤é²¼¡¢º¸¤«¤é±¦¤Ëʤ֤褦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£" -} -msg.pack('side'=>'top') - -# frame À¸À® -TkFrame.new($puzzle_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $puzzle_demo - $puzzle_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'puzzle'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame À¸À® -# -# Special trick: scrollbar widget ¤òÀ¸À®¤·¤Æ¤½¤Î trough color ¤òÍѤ¤¤ë¤³¤È¤Ç -# ¶õÇòÉôʬ¤Î¤¿¤á¤Î°Å¿§¤òÁªÂò¤·¡¤ÀßÄꤹ¤ë -# -begin - if Tk.windowingsystem() == 'aqua' - frameSize = 160 - else - frameSize = 120 - end -rescue - frameSize = 120 -end - -s = TkScrollbar.new($puzzle_demo) -base = TkFrame.new($puzzle_demo) { - width frameSize - height frameSize - borderwidth 2 - relief 'sunken' - bg s['troughcolor'] -} -s.destroy -base.pack('side'=>'top', 'padx'=>'1c', 'pady'=>'1c') - -# proc ¤Î¥¹¥³¡¼¥×¤òÊĤ¸¤ë¤¿¤á¡¤proc À¸À®¥á¥½¥Ã¥É¤òÍÑ°Õ -# ¤³¤¦¤·¤Æ¤ª¤«¤Í¤Ð¡¤¥ë¡¼¥×Ãæ¤ÇÃͤ¬ÊѲ½¤¹¤ë num ¤Î±Æ¶Á¤ò¼õ¤±¤Æ -# puzzleSwitch ¤ÎÂè 2 °ú¿ô¤¬ÊѲ½¤·¤Æ¤·¤Þ¤¤¡¤´üÂÔÄ̤ê¤Ë¤Ï¤Ê¤é¤Ê¤¤¡¥ -def def_puzzleswitch_proc(w, num) - proc{puzzleSwitch w, num} -end - -$xpos = {} -$ypos = {} -order = [3,1,6,2,5,7,15,13,4,11,8,9,14,10,12] -(0..14).each{|i| - num = order[i] - $xpos[num] = (i % 4) * 0.25 - $ypos[num] = (i / 4) * 0.25 - TkButton.new(base) {|w| - relief 'raised' - text num - highlightthickness 0 - command def_puzzleswitch_proc(w, num) - }.place('relx'=>$xpos[num], 'rely'=>$ypos[num], - 'relwidth'=>0.25, 'relheight'=>0.25) -} -$xpos['space'] = 0.75 -$ypos['space'] = 0.75 - -############ -def puzzleSwitch(w, num) - if ( ($ypos[num] >= ($ypos['space'] - 0.01)) \ - && ($ypos[num] <= ($ypos['space'] + 0.01)) \ - && ($xpos[num] >= ($xpos['space'] - 0.26)) \ - && ($xpos[num] <= ($xpos['space'] + 0.26))) \ - || (($xpos[num] >= ($xpos['space'] - 0.01)) \ - && ($xpos[num] <= ($xpos['space'] + 0.01)) \ - && ($ypos[num] >= ($ypos['space'] - 0.26)) \ - && ($ypos[num] <= ($ypos['space'] + 0.26))) - tmp = $xpos['space'] - $xpos['space'] = $xpos[num] - $xpos[num] = tmp - tmp = $ypos['space'] - $ypos['space'] = $ypos[num] - $ypos[num] = tmp - w.place('relx'=>$xpos[num], 'rely'=>$ypos[num]) - end -end - diff --git a/ext/tk/sample/demos-jp/radio.rb b/ext/tk/sample/demos-jp/radio.rb deleted file mode 100644 index 871503029e..0000000000 --- a/ext/tk/sample/demos-jp/radio.rb +++ /dev/null @@ -1,80 +0,0 @@ -# -# radiobutton widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($radio_demo) && $radio_demo - $radio_demo.destroy - $radio_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$radio_demo = TkToplevel.new {|w| - title("Radiobutton Demonstration") - iconname("radio") - positionWindow(w) -} - -# label À¸À® -msg = TkLabel.new($radio_demo) { - font $font - wraplength '4i' - justify 'left' - text "²¼¤Ë¤Ï2¤Ä¤Î¥é¥¸¥ª¥Ü¥¿¥ó¥°¥ë¡¼¥×¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¤½¤Î¥Ü¥¿¥ó¤À¤±¤¬¤½¤Î¥°¥ë¡¼¥×¤ÎÃæ¤ÇÁªÂò¤µ¤ì¤Þ¤¹¡£³Æ¥°¥ë¡¼¥×¤ËÂФ·¤Æ¤½¤Î¥°¥ë¡¼¥×¤ÎÃæ¤Î¤É¤Î¥Ü¥¿¥ó¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤ë¤«¤ò¼¨¤¹ÊÑ¿ô¤¬³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤Þ¤¹¡£¸½ºß¤ÎÊÑ¿ô¤ÎÃͤò¸«¤ë¤Ë¤Ï¡ÖÊÑ¿ô»²¾È¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£" -} -msg.pack('side'=>'top') - -# ÊÑ¿ôÀ¸À® -size = TkVariable.new -color = TkVariable.new - -# frame À¸À® -TkFrame.new($radio_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $radio_demo - $radio_demo = nil - $showVarsWin[tmppath.path] = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'radio'} - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'ÊÑ¿ô»²¾È' - command proc{ - showVars($radio_demo, ['size', size], ['color', color]) - } - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame À¸À® -f_left = TkFrame.new($radio_demo) -f_right = TkFrame.new($radio_demo) -f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') -f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') - -# radiobutton À¸À® -[10, 12, 18, 24].each {|sz| - TkRadioButton.new(f_left) { - text "¥Ý¥¤¥ó¥È¥µ¥¤¥º #{sz}" - variable size - relief 'flat' - value sz - }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w') -} - -['ÀÖ', 'ÎÐ', 'ÀÄ', '²«', 'Üô', '»ç'].each {|col| - TkRadioButton.new(f_right) { - text col - variable color - relief 'flat' - value col.downcase - }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w') -} - diff --git a/ext/tk/sample/demos-jp/radio2.rb b/ext/tk/sample/demos-jp/radio2.rb deleted file mode 100644 index 62425af90d..0000000000 --- a/ext/tk/sample/demos-jp/radio2.rb +++ /dev/null @@ -1,106 +0,0 @@ -# radio.rb -# -# This demonstration script creates a toplevel window containing -# several radiobutton widgets. -# -# radiobutton widget demo (called by 'widget') -# - -# toplevel widget -if defined?($radio2_demo) && $radio2_demo - $radio2_demo.destroy - $radio2_demo = nil -end - -# demo toplevel widget -$radio2_demo = TkToplevel.new {|w| - title("Radiobutton Demonstration") - iconname("radio") - positionWindow(w) -} - -# label -msg = TkLabel.new($radio2_demo) { - font $font - wraplength '5i' - justify 'left' - text "²¼¤Ë¤Ï2¤Ä¤Î¥é¥¸¥ª¥Ü¥¿¥ó¥°¥ë¡¼¥×¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¤½¤Î¥Ü¥¿¥ó¤À¤±¤¬¤½¤Î¥°¥ë¡¼¥×¤ÎÃæ¤ÇÁªÂò¤µ¤ì¤Þ¤¹¡£³Æ¥°¥ë¡¼¥×¤ËÂФ·¤Æ¤½¤Î¥°¥ë¡¼¥×¤ÎÃæ¤Î¤É¤Î¥Ü¥¿¥ó¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤ë¤«¤ò¼¨¤¹ÊÑ¿ô¤¬³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤Þ¤¹¡£¸½ºß¤ÎÊÑ¿ô¤ÎÃͤò¸«¤ë¤Ë¤Ï¡ÖÊÑ¿ô»²¾È¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£" -} -msg.pack('side'=>'top') - -# -size = TkVariable.new -color = TkVariable.new -align = TkVariable.new - -# frame -TkFrame.new($radio2_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $radio2_demo - $radio2_demo = nil - $showVarsWin[tmppath.path] = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'radio'} - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'ÊÑ¿ô»²¾È' - command proc{ - showVars($radio2_demo, - ['size', size], ['color', color], ['compound', align]) - } - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame -f_left = TkLabelFrame.new($radio2_demo, 'text'=>'ʸ»ú¥µ¥¤¥º', - 'pady'=>2, 'padx'=>2) -f_mid = TkLabelFrame.new($radio2_demo, 'text'=>'¿§', - 'pady'=>2, 'padx'=>2) -f_right = TkLabelFrame.new($radio2_demo, 'text'=>'¥Ó¥Ã¥È¥Þ¥Ã¥×ÇÛÃÖ', - 'pady'=>2, 'padx'=>2) -f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') -f_mid.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') -f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') - -# radiobutton -[10, 12, 18, 24].each {|sz| - TkRadioButton.new(f_left) { - text "¥Ý¥¤¥ó¥È¥µ¥¤¥º #{sz}" - variable size - relief 'flat' - value sz - }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x') -} - -['ÀÖ', 'ÎÐ', 'ÀÄ', '²«', 'Üô', '»ç'].each {|col| - TkRadioButton.new(f_mid) { - text col - variable color - relief 'flat' - value col.downcase - anchor 'w' - }.pack('side'=>'top', 'pady'=>2, 'fill'=>'x') -} - -label = TkLabel.new(f_right, 'text'=>'¥é¥Ù¥ë', 'bitmap'=>'questhead', - 'compound'=>'left') -label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top') -label.height(TkWinfo.reqheight(label)) -abtn = ['Top', 'Left', 'Right', 'Bottom'].collect{|a| - lower = a.downcase - TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat', - 'value'=>lower, 'indicatoron'=>0, 'width'=>7, - 'command'=>proc{label.compound(align.value)}) -} - -Tk.grid('x', abtn[0]) -Tk.grid(abtn[1], label, abtn[2]) -Tk.grid('x', abtn[3]) diff --git a/ext/tk/sample/demos-jp/rmt b/ext/tk/sample/demos-jp/rmt deleted file mode 100644 index 73f631180a..0000000000 --- a/ext/tk/sample/demos-jp/rmt +++ /dev/null @@ -1,268 +0,0 @@ -#!/usr/bin/env ruby - -# rmt -- -# This script implements a simple remote-control mechanism for -# Tk applications. It allows you to select an application and -# then type commands to that application. - -require 'tk' - -class Rmt - def initialize(parent=nil) - win = self - - unless parent - parent = TkRoot.new - end - root = TkWinfo.toplevel(parent) - root.minsize(1,1) - - # The instance variable below keeps track of the remote application - # that we're sending to. If it's an empty string then we execute - # the commands locally. - @app = 'local' - @mode = 'Ruby' - - # The instance variable below keeps track of whether we're in the - # middle of executing a command entered via the text. - @executing = 0 - - # The instance variable below keeps track of the last command executed, - # so it can be re-executed in response to !! commands. - @lastCommand = "" - - # Create menu bar. Arrange to recreate all the information in the - # applications sub-menu whenever it is cascaded to. - - TkFrame.new(root, 'relief'=>'raised', 'bd'=>2) {|f| - pack('side'=>'top', 'fill'=>'x') - TkMenubutton.new(f, 'text'=>'File', 'underline'=>0) {|mb| - TkMenu.new(mb) {|mf| - mb.menu(mf) - TkMenu.new(mf) {|ma| - postcommand proc{win.fillAppsMenu ma} - mf.add('cascade', 'label'=>'Select Application', - 'menu'=>ma, 'underline'=>0) - } - add('command', 'label'=>'Quit', - 'command'=>proc{root.destroy}, 'underline'=>0) - } - pack('side'=>'left') - } - } - - # Create text window and scrollbar. - - @txt = TkText.new(root, 'relief'=>'sunken', 'bd'=>2, 'setgrid'=>true) { - yscrollbar(TkScrollbar.new(root){pack('side'=>'right', 'fill'=>'y')}) - pack('side'=>'left') - } - - @promptEnd = TkTextMark.new(@txt, 'insert') - - # Create a binding to forward commands to the target application, - # plus modify many of the built-in bindings so that only information - # in the current command can be deleted (can still set the cursor - # earlier in the text and select and insert; just can't delete). - - @txt.bindtags([@txt, TkText, root, 'all']) - @txt.bind('Return', proc{ - @txt.set_insert('end - 1c') - @txt.insert('insert', "\n") - win.invoke - Tk.callback_break - }) - @txt.bind('Delete', proc{ - begin - @txt.tag_remove('sel', 'sel.first', @promptEnd) - rescue - end - if @txt.tag_nextrange('sel', '1.0', 'end') == [] - if @txt.compare('insert', '<', @promptEnd) - Tk.callback_break - end - end - }) - @txt.bind('BackSpace', proc{ - begin - @txt.tag_remove('sel', 'sel.first', @promptEnd) - rescue - end - if @txt.tag_nextrange('sel', '1.0', 'end') == [] - if @txt.compare('insert', '<', @promptEnd) - Tk.callback_break - end - end - }) - @txt.bind('Control-d', proc{ - if @txt.compare('insert', '<', @promptEnd) - Tk.callback_break - end - }) - @txt.bind('Control-k', proc{ - if @txt.compare('insert', '<', @promptEnd) - @txt.set_insert(@promptEnd) - end - }) - @txt.bind('Control-t', proc{ - if @txt.compare('insert', '<', @promptEnd) - Tk.callback_break - end - }) - @txt.bind('Meta-d', proc{ - if @txt.compare('insert', '<', @promptEnd) - Tk.callback_break - end - }) - @txt.bind('Meta-BackSpace', proc{ - if @txt.compare('insert', '<=', @promptEnd) - Tk.callback_break - end - }) - @txt.bind('Control-h', proc{ - if @txt.compare('insert', '<=', @promptEnd) - Tk.callback_break - end - }) - - @txt.tag_configure('bold', 'font'=>['Courier', 12, 'bold']) - - @app = Tk.appname('rmt') - if (@app =~ /^rmt(.*)$/) - root.title("Tk Remote Controller#{$1}") - root.iconname("Tk Remote#{$1}") - end - prompt - @txt.focus - #@app = TkWinfo.appname(TkRoot.new) - end - - def tkTextInsert(w,s) - return if s == "" - begin - if w.compare('sel.first','<=','insert') \ - && w.compare('sel.last','>=','insert') - w.tag_remove('sel', 'sel.first', @promptEnd) - w.delete('sel.first', 'sel.last') - end - rescue - end - w.insert('insert', s) - w.see('insert') - end - - # The method below is used to print out a prompt at the - # insertion point (which should be at the beginning of a line - # right now). - - def prompt - @txt.insert('insert', "#{@app}: ") - @promptEnd.set('insert') - @promptEnd.gravity = 'left' - @txt.tag_add('bold', "#{@promptEnd.path} linestart", @promptEnd) - end - - # The method below executes a command (it takes everything on the - # current line after the prompt and either sends it to the remote - # application or executes it locally, depending on "app". - - def invoke - cmd = @txt.get(@promptEnd, 'insert') - @executing += 1 - case (@mode) - when 'Tcl' - if Tk.info('complete', cmd) - if (cmd == "!!\n") - cmd = @lastCommand - else - @lastCommand = cmd - end - begin - msg = Tk.appsend(@app, false, cmd) - rescue - msg = "Error: #{$!}" - end - @txt.insert('insert', msg + "\n") if msg != "" - prompt - @promptEnd.set('insert') - end - - when 'Ruby' - if (cmd == "!!\n") - cmd = @lastCommand - end - complete = true - begin - eval("proc{#{cmd}}") - rescue - complete = false - end - if complete - @lastCommand = cmd - begin -# msg = Tk.appsend(@app, false, -# 'ruby', -# '"(' + cmd.gsub(/[][$"]/, '\\\\\&') + ').to_s"') - msg = Tk.rb_appsend(@app, false, cmd) - rescue - msg = "Error: #{$!}" - end - @txt.insert('insert', msg + "\n") if msg != "" - prompt - @promptEnd.set('insert') - end - end - - @executing -= 1 - @txt.yview_pickplace('insert') - end - - # The following method is invoked to change the application that - # we're talking to. It also updates the prompt for the current - # command, unless we're in the middle of executing a command from - # the text item (in which case a new prompt is about to be output - # so there's no need to change the old one). - - def newApp(appName, mode) - @app = appName - @mode = mode - if @executing == 0 - @promptEnd.gravity = 'right' - @txt.delete("#{@promptEnd.path} linestart", @promptEnd) - @txt.insert(@promptEnd, "#{appName}: ") - @txt.tag_add('bold', "#{@promptEnd.path} linestart", @promptEnd) - @promptEnd.gravity = 'left' - end - end - - # The method below will fill in the applications sub-menu with a list - # of all the applications that currently exist. - - def fillAppsMenu(menu) - win = self - begin - menu.delete(0,'last') - rescue - end - TkWinfo.interps.sort.each{|ip| - begin - if Tk.appsend(ip, false, 'info commands ruby') == "" - mode = 'Tcl' - else - mode = 'Ruby' - end - menu.add('command', 'label'=>format("%s (#{mode}/Tk)", ip), - 'command'=>proc{win.newApp ip, mode}) - rescue - menu.add('command', 'label'=>format("%s (unknown Tk)", ip), - 'command'=>proc{win.newApp ip, mode}, 'state'=>'disabled') - end - } - menu.add('command', 'label'=>format("local (Ruby/Tk)"), - 'command'=>proc{win.newApp 'local', 'Ruby'}) - end -end - -Rmt.new - -Tk.mainloop diff --git a/ext/tk/sample/demos-jp/rolodex b/ext/tk/sample/demos-jp/rolodex deleted file mode 100644 index 9f87ae2829..0000000000 --- a/ext/tk/sample/demos-jp/rolodex +++ /dev/null @@ -1,320 +0,0 @@ -#!/usr/bin/env ruby -# -# rolodex -- -# This script is a part of Tom LaStrange's rolodex -# -# Copyright (C) 1998 by Takaaki Tateishi <ttate@jaist.ac.jp> -# Time-stamp: "03/08/02 12:45:21 nagai" -# - -require "tk" - - -def show_help(topic,x=0,y=0) - if( topic.is_a?(TkWindow) ) - w = TkWinfo.containing(x,y) - if( TkWinfo.exist?(w) ) - topic = w - end - end - - if( $helpTopics.include?(topic) ) - msg = $helpTopics[topic] - else - msg = "Sorry, but no help is available for this topic" - end - TkDialog.new("title"=>"Rolodex Help", - "message"=>"Information on #{topic}:\n\n#{msg}", - "default_button"=>0, - "buttons"=>["OK"]) -end - -def fillCard - clearAction - $root.frame.entry[1].insert(0,"Takaaki Tateishi") - $root.frame.entry[2].insert(0,"Japan Advanced Institute of Science and Techonology") - $root.frame.entry[3].insert(0,"1-1 Asahidai, Tatsunokuchi") - $root.frame.entry[4].insert(0,"Ishikawa 923-1292, Japan") - $root.frame.entry[5].insert(0,"private") - $root.frame.entry[6].insert(0,"***-***-****") - $root.frame.entry[7].insert(0,"***-***-****") -end - -def addAction - for i in 1..7 - STDERR.print format("%-12s %s\n", - RolodexFrame::LABEL[i], - $root.frame.entry[i].value) - end -end - -def clearAction - for i in 1..7 - $root.frame.entry[i].delete(0,"end") - end -end - -def fileAction - TkDialog.new("title"=>"File Selection", - "message"=>"This is a dummy file selection dialog box.\n", - "default_button"=>0, - "buttons"=>["OK"]) - STDERR.print "dummy file name\n" -end - -def deleteAction - result = TkDialog.new("title"=>"Confirm Action", - "message"=>"Are you sure?", - "default_button"=>0, - "buttons"=>["Cancel"]) - if( result.value == 0 ) - clearAction - end -end - - -class RolodexFrame < TkFrame - attr_reader :entry, :label - - LABEL = ["","Name:","Address:","","","Home Phone:","Work Phone:","Fax:"] - - def initialize(parent=nil,keys=nil) - super(parent,keys) - self["relief"] = "flat" - - @i = [] - @label = [] - @entry = [] - for i in 1..7 - @i[i] = TkFrame.new(self) - @i[i].pack("side"=>"top", - "pady"=>2, - "anchor"=>"e") - @label[i] = TkLabel.new(@i[i], - "text"=>LABEL[i], - "anchor"=>"e") - @entry[i] = TkEntry.new(@i[i], - "width"=>30, - "relief"=>"sunken") - @entry[i].pack("side"=>"right") - @label[i].pack("side"=>"right") - end - end -end - -class RolodexButtons < TkFrame - attr_reader :clear, :add, :search, :delete - - def initialize(parent,keys=nil) - super(parent,keys) - @clear = TkButton.new(self, - "text" => "Clear") - @add = TkButton.new(self, - "text" => "Add") - @search = TkButton.new(self, - "text" => "Search") - @delete = TkButton.new(self, - "text" => "Delete") - for w in [@clear,@add,@search,@delete] - w.pack("side"=>"left", "padx"=>2) - end - end -end - -class RolodexMenuFrame < TkFrame - attr_reader :file_menu, :help_menu, :file, :help - - def initialize(parent,keys=nil) - super(parent,keys) - configure("relief"=>"raised", - "borderwidth"=>1) - - @file = TkMenubutton.new(self, - "text"=>"File", - "underline"=>0) - @file_menu = TkMenu.new(@file) - @file_menu.add("command", - "label" => "Load ...", - "command" => proc{fileAction}, - "underline" => 0) - @file_menu.add("command", - "label" => "Exit", - "command" => proc{$root.destroy}, - "underline" => 0) - @file.menu(@file_menu) - @file.pack("side"=>"left") - - @help = TkMenubutton.new(self, - "text"=>"Help", - "underline"=>0) - @help_menu = TkMenu.new(@help) - @help_menu.add("command", - "label"=>"On Context...", - "command"=>proc{show_help("context")}, - "underline"=>3) - @help_menu.add("command", - "label"=>"On Help...", - "command"=>proc{show_help("help")}, - "underline"=>3) - @help_menu.add("command", - "label"=>"On Window...", - "command"=>proc{show_help("window")}, - "underline"=>3) - @help_menu.add("command", - "label"=>"On Keys...", - "command"=>proc{show_help("keys")}, - "underline"=>3) - @help_menu.add("command", - "label"=>"On version...", - "command"=>proc{show_help("version")}, - "underline"=>3) - @help.menu(@help_menu) - @help.pack("side"=>"right") - end -end - -class Rolodex < TkRoot - attr_reader :frame, :buttons, :menu - - def initialize(*args) - super(*args) - @frame = RolodexFrame.new(self) - @frame.pack("side"=>"top", - "fill"=>"y", - "anchor"=>"center") - @buttons = RolodexButtons.new(self) - @buttons.pack("side"=>"bottom", - "pady"=>2, - "anchor"=>"center") - @menu = RolodexMenuFrame.new(self) - @menu.pack("before"=>@frame, - "side"=>"top", - "fill"=>"x") - end -end - -$root = Rolodex.new - -$root.buttons.delete.configure("command"=>proc{deleteAction}) -$root.buttons.add.configure("command"=>proc{addAction}) -$root.buttons.clear.configure("command"=>proc{clearAction}) -$root.buttons.search.configure("command"=>proc{addAction; fillCard}) - -$root.buttons.clear.configure("text"=>"Clear Ctrl+C") -$root.bind("Control-c",proc{clearAction}) - -$root.buttons.add.configure("text"=>"Add Ctrl+A") -$root.bind("Control-a",proc{addAction}) - -$root.buttons.search.configure("text"=>"Search Ctrl+S") -$root.bind("Control-s",proc{addAction; fillCard}) - -$root.buttons.delete.configure("text"=>"Delete... Ctrl+D") -$root.bind("Control-d",proc{deleteAction}) - -$root.menu.file_menu.entryconfigure(1, "accel"=>"Ctrl+F") -$root.bind("Control-f",proc{fileAction}) - -$root.menu.file_menu.entryconfigure(2, "accel"=>"Ctrl+Q") -$root.bind("Control-q",proc{$root.destroy}) - -$root.frame.entry[1].focus - -$root.bind("Any-F1", - proc{|event| show_help(event.widget, event.x_root, event.y_root)}) -$root.bind("Any-Help", - proc{|event| show_help(event.widget, event.x_root, event.y_root)}) - - -$helpTopics = {} - -$helpTopics[$root.menu.file] = <<EOF -This is the "file" menu. It can be used to invoke\ -some overall operations on the rolodex applications,\ -such as loading a file or exiting. -EOF - -$helpTopics[$root.menu.file_menu.index(0)] = <<EOF -The "Load" entry in the "File" menu posts a dialog box\ -that you can use to select a rolodex file -EOF - -$helpTopics[$root.menu.file_menu.index(1)] = <<EOF -The "Exit" entry in the "File" menu causes the rolodex\ -application to terminate -EOF - -$helpTopics[$root.frame.entry[1]] = <<EOF -In this field of the rolodex entry you should\ -type the person's name -EOF - -$helpTopics[$root.frame.entry[2]] = <<EOF -In this field of the rolodex entry you should\ -type the first line of the person's address -EOF - -$helpTopics[$root.frame.entry[3]] = <<EOF -In this field of the rolodex entry you should\ -type the second line of the person's address -EOF - -$helpTopics[$root.frame.entry[4]] = <<EOF -In this field of the rolodex entry you should\ -type the third line of the person's address -EOF - -$helpTopics[$root.frame.entry[5]] = <<EOF -In this field of the rolodex entry you should\ -type the person's home phone number, or "private"\ -if the person doesn't want his or he number publicized -EOF - -$helpTopics[$root.frame.entry[6]] = <<EOF -In this field of the rolodex entry you should\ -type the person's work phone number -EOF - -$helpTopics[$root.frame.entry[7]] = <<EOF -In this field of the rolodex entry you should\ -type the phone number for the person's FAX machine -EOF - -$helpTopics["context"] = <<EOF -Unfortunately, this application doesn't support context-sensitive\ -help in the usual way, because when this demo was written Ruby/Tk\ -didn't have a grab mechanism and this is needed for context-sensitive\ -help. Instead, you can achive much the same effect by simply moving\ -the mouse over the window you're curious about and pressing the\ -Help or F1 keys. You can do this anytime. -EOF - -$helpTopics["help"] = <<EOF -This application provides only very crude help. Besides the\ -entries in this menu, you can get help on individual windows\ -by moving the mouse cursor over the window and pressing the\ -Help or F1 keys. -EOF - -$helpTopics["window"] = <<EOF -This window is a dummy rolodex application created as part of\ -Tom LaStrange's toolkit benchmark. It doesn't really do anything\ -useful except to demonstrate a few features of the Ruby/Tk. -EOF - -$helpTopics["keys"] = <<EOF -The following accelerator keys are defined for this application\ -(in addition to those already available for the entry windows): -Ctrl+A: Add -Ctrl+C: Clear -Ctrl+D: Delete -Ctrl+F: Enter file name -Ctrl+Q: Exit application (quit) -Ctrl+S: Search (dummy operation) -EOF - -$helpTopics["version"] = <<EOF -This is version 1.0.1. -EOF - -Tk.mainloop diff --git a/ext/tk/sample/demos-jp/rolodex-j b/ext/tk/sample/demos-jp/rolodex-j deleted file mode 100644 index 1c482aafb2..0000000000 --- a/ext/tk/sample/demos-jp/rolodex-j +++ /dev/null @@ -1,299 +0,0 @@ -#!/usr/bin/env ruby -# -# rolodex -- -# ¤³¤Î¥¹¥¯¥ê¥×¥È¤Ï Tom LaStrange ¤Î rolodex ¤Î°ìÉô¤Ç¤¹¡£ -# -# Copyright (C) 1998 by Takaaki Tateishi <ttate@jaist.ac.jp> -# Time-stamp: "03/08/02 14:01:54 nagai" -# - -require "tk" -Tk.encoding = "euc-jp" - -def show_help(topic,x=0,y=0) - if( topic.is_a?(TkWindow) ) - w = TkWinfo.containing(x,y) - if( w.is_a?(TkWindow) ) - if( TkWinfo.exist?(w) ) - topic = w - end - end - end - - if( $helpTopics.include?(topic) ) - msg = $helpTopics[topic] - else - msg = "¤³¤Î¥È¥Ô¥Ã¥¯¤Ë¤Ä¤¤¤Æ¤Î¥Ø¥ë¥×¤Ï¤Þ¤À»ÈÍѤǤ¤Þ¤»¤ó" - end - TkDialog.new("title"=>"Rolodex Help", - "message"=>"¡Ö#{topic}¡×\n\n#{msg}", - "default_button"=>0, - "buttons"=>["OK"]) -end - -def fillCard - clearAction - $root.frame.entry[1].insert(0, "ΩÀÐ ¹§¾´") - $root.frame.entry[2].insert(0, "923-1292 ÀÐÀ") - $root.frame.entry[3].insert(0, "ä¸ýÄ® °°Âæ 1-1") - $root.frame.entry[4].insert(0, "ËÌΦÀèü²Ê³Øµ»½ÑÂç³Ø±¡Âç³Ø") - $root.frame.entry[5].insert(0,"private") - $root.frame.entry[6].insert(0,"***-***-****") - $root.frame.entry[7].insert(0,"***-***-****") -end - -def addAction - for i in 1..7 - STDERR.print format("%-12s %s\n", - RolodexFrame::LABEL[i], - $root.frame.entry[i].value) - end -end - -def clearAction - for i in 1..7 - $root.frame.entry[i].delete(0,"end") - end -end - -def fileAction - TkDialog.new("title"=>"File Selection", - "message"=>"¤³¤ì¤Ï¥Õ¥¡¥¤¥ëÁªÂò¥À¥¤¥¢¥í¥°¤Î¥À¥ß¡¼¤Ç¤¹¡£\n", - "default_button"=>0, - "buttons"=>["OK"]) - STDERR.print "dummy file name\n" -end - -def deleteAction - result = TkDialog.new("title"=>"Confirm Action", - "message"=>"¤è¤í¤·¤¤¤Ç¤¹¤«¡©", - "default_button"=>0, - "buttons"=>["¥¥ã¥ó¥»¥ë"]) - if( result.value == 0 ) - clearAction - end -end - - -class RolodexFrame < TkFrame - attr_reader :entry, :label - - LABEL = ["","̾Á°:","½»½ê","","","ÅÅÏÃ(¼«Âð):","ÅÅÏÃ(²ñ¼Ò):","Fax:"] - - def initialize(parent=nil,keys=nil) - super(parent,keys) - self["relief"] = "flat" - @i = [] - @label = [] - @entry = [] - for i in 1..7 - @i[i] = TkFrame.new(self) - @i[i].pack("side"=>"top", - "pady"=>2, - "anchor"=>"e") - @label[i] = TkLabel.new(@i[i], - "text"=>LABEL[i], - "anchor"=>"e") - @entry[i] = TkEntry.new(@i[i], - "width"=>30, - "relief"=>"sunken") - @entry[i].pack("side"=>"right") - @label[i].pack("side"=>"right") - end - end -end - -class RolodexButtons < TkFrame - attr_reader :clear, :add, :search, :delete - - def initialize(parent,keys=nil) - super(parent,keys) - @clear = TkButton.new(self,"text" => "¥¯¥ê¥¢¡¼") - @add = TkButton.new(self, "text" => "ÄɲÃ") - @search = TkButton.new(self, "text" => "¸¡º÷") - @delete = TkButton.new(self, "text" => "¾Ãµî") - for w in [@clear,@add,@search,@delete] - w.pack("side"=>"left", "padx"=>2) - end - end -end - -class RolodexMenuFrame < TkFrame - attr_reader :file_menu, :help_menu, :file, :help - - def initialize(parent,keys=nil) - super(parent,keys) - configure("relief"=>"raised", - "borderwidth"=>1) - - @file = TkMenubutton.new(self, - "text"=> "¥Õ¥¡¥¤¥ë", - "underline"=>0) - @file_menu = TkMenu.new(@file) - @file_menu.add("command", - "label" => "ÆÉ¤ß¹þ¤ß ...", - "command" => proc{fileAction}, - "underline" => 0) - @file_menu.add("command", - "label" => "½ªÎ»", - "command" => proc{$root.destroy}, - "underline" => 0) - @file.menu(@file_menu) - @file.pack("side"=>"left") - - @help = TkMenubutton.new(self, - "text"=> "¥Ø¥ë¥×", - "underline"=>0) - @help_menu = TkMenu.new(@help) - @help_menu.add("command", - "label"=> "¥³¥ó¥Æ¥¥¹¥È¤Ë¤Ä¤¤¤Æ", - "command"=>proc{show_help("¥³¥ó¥Æ¥¥¹¥È")}, - "underline"=>3) - @help_menu.add("command", - "label"=> "¥Ø¥ë¥×¤Ë¤Ä¤¤¤Æ", - "command"=>proc{show_help("¥Ø¥ë¥×")}, - "underline"=>3) - @help_menu.add("command", - "label"=> "¥¦¥£¥ó¥É¥¦¤Ë¤Ä¤¤¤Æ", - "command"=>proc{show_help("¥¦¥£¥ó¥É¥¦")}, - "underline"=>3) - @help_menu.add("command", - "label"=> "¥¡¼Áàºî¤Ë¤Ä¤¤¤Æ", - "command"=>proc{show_help("¥¡¼Áàºî")}, - "underline"=>3) - @help_menu.add("command", - "label"=> "¥Ð¡¼¥¸¥ç¥ó¾ðÊó", - "command"=>proc{show_help("¥Ð¡¼¥¸¥ç¥ó¾ðÊó")}, - "underline"=>3) - @help.menu(@help_menu) - @help.pack("side"=>"right") - end -end - -class Rolodex < TkRoot - attr_reader :frame, :buttons, :menu - - def initialize(*args) - super(*args) - @frame = RolodexFrame.new(self) - @frame.pack("side"=>"top", - "fill"=>"y", - "anchor"=>"center") - @buttons = RolodexButtons.new(self) - @buttons.pack("side"=>"bottom", - "pady"=>2, - "anchor"=>"center") - @menu = RolodexMenuFrame.new(self) - @menu.pack("before"=>@frame, - "side"=>"top", - "fill"=>"x") - end -end - -$root = Rolodex.new - -$root.buttons.delete.configure("command"=>proc{deleteAction}) -$root.buttons.add.configure("command"=>proc{addAction}) -$root.buttons.clear.configure("command"=>proc{clearAction}) -$root.buttons.search.configure("command"=>proc{addAction; fillCard}) - -$root.buttons.clear.configure("text"=> "¥¯¥ê¥¢¡¼ Ctrl+C") -$root.bind("Control-c",proc{clearAction}) - -$root.buttons.add.configure("text"=> "Äɲà Ctrl+A") -$root.bind("Control-a",proc{addAction}) - -$root.buttons.search.configure("text"=> "¸¡º÷ Ctrl+S") -$root.bind("Control-s",proc{addAction; fillCard}) - -$root.buttons.delete.configure("text"=> "¾Ãµî Ctrl+D") -$root.bind("Control-d",proc{deleteAction}) - -$root.menu.file_menu.entryconfigure(1, "accel"=>"Ctrl+F") -$root.bind("Control-f",proc{fileAction}) - -$root.menu.file_menu.entryconfigure(2, "accel"=>"Ctrl+Q") -$root.bind("Control-q",proc{$root.destroy}) - -$root.frame.entry[1].focus - -$root.bind("Any-F1", - proc{|event| show_help(event.widget, event.x_root, event.y_root)}) -$root.bind("Any-Help", - proc{|event| show_help(event.widget, event.x_root, event.y_root)}) - - -$helpTopics = {} - -$helpTopics[$root.menu.file] = <<EOF -¤³¤ì¤Ï¡Ö¥Õ¥¡¥¤¥ë¡×¥á¥Ë¥å¡¼¤Ç¤¹¡£¡ÖÆÉ¤ß¹þ¤ß¡×¤ä¡Ö½ªÎ»¡×¤Ê¤É¤ò -¹Ô¤Ê¤¦¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -EOF - -$helpTopics[$root.menu.file_menu.index(0)] = <<EOF -¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß¤ò¹Ô¤Ê¤¦¤È¤¤Ë»È¤¤¤Þ¤¹¡£ -EOF - -$helpTopics[$root.menu.file_menu.index(1)] = <<EOF -¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò½ªÎ»¤¹¤ë¤È¤¤Ë»È¤¤¤Þ¤¹¡£ -EOF - -$helpTopics[$root.frame.entry[1]] = <<EOF -̾Á°¤òµÆþ¤¹¤ë¥¨¥ó¥È¥ê¤Ç¤¹¡£ -EOF - -$helpTopics[$root.frame.entry[2]] = <<EOF -½»½ê¤òµÆþ¤¹¤ë¥¨¥ó¥È¥ê¤Ç¤¹¡£ -EOF - -$helpTopics[$root.frame.entry[3]] = <<EOF -½»½ê¤òµÆþ¤¹¤ë¥¨¥ó¥È¥ê¤Ç¤¹¡£ -EOF - -$helpTopics[$root.frame.entry[4]] = <<EOF -½»½ê¤òµÆþ¤¹¤ë¥¨¥ó¥È¥ê¤Ç¤¹¡£ -EOF - -$helpTopics[$root.frame.entry[5]] = <<EOF -¼«Âð¤ÎÅÅÏÃÈÖ¹æ¤òµÆþ¤¹¤ë¥¨¥ó¥È¥ê¤Ç¤¹¡£¸ø³«\ -¤·¤¿¤¯¤Ê¤¤¤È¤¤Ï private ¤ÈµÆþ¤·¤Þ¤¹¡£ -EOF - -$helpTopics[$root.frame.entry[6]] = <<EOF -²ñ¼Ò¤ÎÅÅÏÃÈÖ¹æ¤òµÆþ¤¹¤ë¥¨¥ó¥È¥ê¤Ç¤¹¡£ -EOF - -$helpTopics[$root.frame.entry[7]] = <<EOF -FAXÈÖ¹æ¤òµÆþ¤¹¤ë¥¨¥ó¥È¥ê¤Ç¤¹¡£ -EOF - -$helpTopics["¥³¥ó¥Æ¥¥¹¥È"] = <<EOF -Ruby/Tk¤Ç¤Ïgrab¤Îµ¡¹½¤¬¤Ê¤¤¤¿¤á¤³¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï\ -¥³¥ó¥Æ¥¥¹¥È¥Ø¥ë¥×¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ -¤·¤«¤·Æ±¤¸¤è¤¦¤Ê¸ú²Ì¤òbind¤È¥Þ¥¦¥¹¤Î°ÌÃÖ¤ÎWedget¤òÃΤë\ -¤³¤È¤ÇÆÀ¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -EOF - -$helpTopics["¥Ø¥ë¥×"] = <<EOF -¥Þ¥¦¥¹¤ò¥¦¥£¥ó¥É¥¦¤Ë¤¢¤ï¤»¤ÆF1¥¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ\ -¤½¤Î¥Ø¥ë¥×¤ò¸«¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -EOF - -$helpTopics["¥¦¥£¥ó¥É¥¦"] = <<EOF -¤³¤Î¥¦¥£¥ó¥É¥¦¤Ï¥À¥ß¡¼¤Ç¤¹¡£ -EOF - -$helpTopics["¥¡¼Áàºî"] = <<EOF -Ctrl+A: Äɲà -Ctrl+C: ¥¯¥ê¥¢¡¼ -Ctrl+D: ¾Ãµî -Ctrl+F: ¥Õ¥¡¥¤¥ëÁªÂò -Ctrl+Q: ½ªÎ» -Ctrl+S: ¸¡º÷ -EOF - -$helpTopics["¥Ð¡¼¥¸¥ç¥ó¾ðÊó"] = <<EOF -¥Ð¡¼¥¸¥ç¥ó¤Ï 1.0.1j ¤Ç¤¹¡£ -EOF - -Tk.mainloop diff --git a/ext/tk/sample/demos-jp/ruler.rb b/ext/tk/sample/demos-jp/ruler.rb deleted file mode 100644 index d1a7818be4..0000000000 --- a/ext/tk/sample/demos-jp/ruler.rb +++ /dev/null @@ -1,197 +0,0 @@ -# -# ruler widget demo (called by 'widget') -# - -# rulerMkTab -- -# This method creates a new triangular polygon in a canvas to -# represent a tab stop. -# -# Arguments: -# c - The canvas window. -# x, y - Coordinates at which to create the tab stop. - -def rulerMkTab(c,x,y) - v = $demo_rulerInfo - TkcPolygon.new(c, x, y, x+v.size, y+v.size, x-v.size, y+v.size) -end - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($ruler_demo) && $ruler_demo - $ruler_demo.destroy - $ruler_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$ruler_demo = TkToplevel.new {|w| - title("Ruler Demonstration") - iconname("ruler") - positionWindow(w) -} - -# label À¸À® -TkLabel.new($ruler_demo, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', - 'text'=>"¤³¤Î¥¥ã¥ó¥Ð¥¹widget¤Ï¥ë¡¼¥é¡¼¤ÎÌÏ·¿¤Ç¤¹¡£¥ë¡¼¥é¡¼¤Î±¦¤Ë¤¢¤ë¤Î¤Ï¥¿¥Ö¥¹¥È¥Ã¥×¤Î°æ¸Í¤Ç¡¢¤³¤³¤«¤é°ú¤ÃÄ¥¤Ã¤Æ¤¯¤ë¤³¤È¤Ë¤è¤Ã¤Æ¥¿¥Ö¥¹¥È¥Ã¥×¤òºî¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£¤Þ¤¿¡¢¤¹¤Ç¤Ë¤¢¤ë¥¿¥Ö¥¹¥È¥Ã¥×¤òư¤«¤¹¤³¤È¤â¤Ç¤¤Þ¤¹¡£¥¿¥Ö¥¹¥È¥Ã¥×¤ò¾åÊý¤Þ¤¿¤Ï²¼Êý¤Ë¤«¤¹¤ì¤ÆÉ½¼¨¤µ¤ì¤ë¤Þ¤Ç¥É¥é¥Ã¥°¤¹¤ë¤È¡¢¥Þ¥¦¥¹¥Ü¥¿¥ó¤òÎ¥¤·¤¿»þ¤Ë¤½¤Î¥¿¥Ö¥¹¥È¥Ã¥×¤Ï¾Ã¤¨¤Þ¤¹¡£"){ - pack('side'=>'top') -} - -# frame À¸À® -$ruler_buttons = TkFrame.new($ruler_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $ruler_demo - $ruler_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'ruler'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$ruler_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# canvas ÀßÄê -$ruler_canvas = TkCanvas.new($ruler_demo, 'width'=>'14.8c', 'height'=>'2.5c') -$ruler_canvas.pack('side'=>'top', 'fill'=>'x') - -# ÃÍÀßÄê -unless Struct.const_defined?("RulerInfo") - $demo_rulerInfo = Struct.new("RulerInfo", :grid, :left, :right, :x, :y, - :top, :bottom, :size, :normalStyle, - :activeStyle, :deleteStyle).new -end -$demo_rulerInfo.grid = '.25c' -$demo_rulerInfo.left = TkWinfo.fpixels($ruler_canvas, '1c') -$demo_rulerInfo.right = TkWinfo.fpixels($ruler_canvas, '13c') -$demo_rulerInfo.top = TkWinfo.fpixels($ruler_canvas, '1c') -$demo_rulerInfo.bottom = TkWinfo.fpixels($ruler_canvas, '1.5c') -$demo_rulerInfo.size = TkWinfo.fpixels($ruler_canvas, '.2c') -$demo_rulerInfo.normalStyle = {'fill'=>'black'} -if TkWinfo.depth($ruler_canvas) > 1 - $demo_rulerInfo.activeStyle = {'fill'=>'red', 'stipple'=>''} - $demo_rulerInfo.deleteStyle = {'fill'=>'red', - 'stipple'=>'@'+[$demo_dir, 'images', 'gray25.bmp'].join(File::Separator)} -else - $demo_rulerInfo.activeStyle = {'fill'=>'black', 'stipple'=>''} - $demo_rulerInfo.deleteStyle = {'fill'=>'black', - 'stipple'=>'@'+[$demo_dir, 'images', 'gray25.bmp'].join(File::Separator)} -end - -TkcLine.new($ruler_canvas, - '1c', '0.5c', '1c', '1c', '13c', '1c', '13c', '0.5c', 'width'=>1) -(0..11).each{|i| - x = i+1 - TkcLine.new($ruler_canvas, "#{x}c", '1c', "#{x}c", '0.6c', 'width'=>1) - TkcLine.new($ruler_canvas, "#{x}.25c", '1c', "#{x}.25c", '0.8c', 'width'=>1) - TkcLine.new($ruler_canvas, "#{x}.5c", '1c', "#{x}.5c", '0.7c', 'width'=>1) - TkcLine.new($ruler_canvas, "#{x}.75c", '1c', "#{x}.75c", '0.8c', 'width'=>1) - TkcText.new($ruler_canvas, "#{x}.15c", '0.75c', 'text'=>i, 'anchor'=>'sw') -} - -$rulerTag_well = TkcTag.new($ruler_canvas) -$ruler_canvas\ -.addtag_withtag($rulerTag_well, - TkcRectangle.new($ruler_canvas, - '13.2c', '1c', '13.8c', '0.5c', - 'outline'=>'black', - 'fill'=>($ruler_canvas\ - .configinfo('background'))[4]) ) -$ruler_canvas\ -.addtag_withtag($rulerTag_well, - rulerMkTab($ruler_canvas, - TkWinfo.pixels($ruler_canvas, '13.5c'), - TkWinfo.pixels($ruler_canvas, '.65c') ) ) - -$rulerTag_well.bind('1', proc{|x,y| rulerNewTab($ruler_canvas,x,y)}, '%x %y') -$ruler_canvas.itembind('tab', '1', - proc{|x,y| rulerSelectTab($ruler_canvas,x,y)}, '%x %y') -$ruler_canvas.bind('B1-Motion', - proc{|x,y| rulerMoveTab($ruler_canvas,x,y)}, '%x %y') -$ruler_canvas.bind('Any-ButtonRelease-1', proc{rulerReleaseTab($ruler_canvas)}) - -# rulerNewTab -- -# Does all the work of creating a tab stop, including creating the -# triangle object and adding tags to it to give it tab behavior. -# -# Arguments: -# c - The canvas window. -# x, y - The coordinates of the tab stop. - -def rulerNewTab(c,x,y) - v = $demo_rulerInfo - c.addtag_withtag('active', rulerMkTab(c,x,y)) - c.addtag_withtag('tab', 'active') - v.x = x - v.y = y - rulerMoveTab(c,x,y) -end - -# rulerSelectTab -- -# This method is invoked when mouse button 1 is pressed over -# a tab. It remembers information about the tab so that it can -# be dragged interactively. -# -# Arguments: -# c - The canvas widget. -# x, y - The coordinates of the mouse (identifies the point by -# which the tab was picked up for dragging). - -def rulerSelectTab(c,x,y) - v = $demo_rulerInfo - v.x = c.canvasx(x, v.grid) - v.y = v.top+2 - c.addtag_withtag('active', 'current') - c.itemconfigure('active', v.activeStyle) - c.raise('active') -end - -# rulerMoveTab -- -# This method is invoked during mouse motion events to drag a tab. -# It adjusts the position of the tab, and changes its appearance if -# it is about to be dragged out of the ruler. -# -# Arguments: -# c - The canvas widget. -# x, y - The coordinates of the mouse. - -def rulerMoveTab(c,x,y) - v = $demo_rulerInfo - return if c.find_withtag('active') == [] - cx = c.canvasx(x,v.grid) - cy = c.canvasy(y) - cx = v.left if cx < v.left - cx = v.right if cx > v.right - if (cy >= v.top && cy <= v.bottom) - cy = v.top+2 - c.itemconfigure('active', v.activeStyle) - else - cy = cy-v.size-2 - c.itemconfigure('active', v.deleteStyle) - end - c.move('active', cx-v.x, cy-v.y) - v.x = cx - v.y = cy -end - -# rulerReleaseTab -- -# This method is invoked during button release events that end -# a tab drag operation. It deselects the tab and deletes the tab if -# it was dragged out of the ruler. -# -# Arguments: -# c - The canvas widget. -# x, y - The coordinates of the mouse. - -def rulerReleaseTab(c) - v = $demo_rulerInfo - return if c.find_withtag('active') == [] - if v.y != v.top+2 - c.delete('active') - else - c.itemconfigure('active', v.normalStyle) - c.dtag('active') - end -end - diff --git a/ext/tk/sample/demos-jp/sayings.rb b/ext/tk/sample/demos-jp/sayings.rb deleted file mode 100644 index f627396e0f..0000000000 --- a/ext/tk/sample/demos-jp/sayings.rb +++ /dev/null @@ -1,99 +0,0 @@ -# -# listbox widget demo 'sayings' (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($sayings_demo) && $sayings_demo - $sayings_demo.destroy - $sayings_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$sayings_demo = TkToplevel.new {|w| - title("Listbox Demonstration (well-known sayings)") - iconname("sayings") - positionWindow(w) -} - -# label À¸À® -msg = TkLabel.new($sayings_demo) { - font $font - wraplength '4i' - justify 'left' - text "²¼¤Î¥ê¥¹¥È¥Ü¥Ã¥¯¥¹¤Ë¤Ï¤¤¤í¤¤¤í¤Ê³Ê¸À¤¬Æþ¤Ã¤Æ¤¤¤Þ¤¹¡£¥ê¥¹¥È¤ò¥¹¥¯¥í¡¼¥ë¤µ¤»¤ë¤Î¤Ï¥¹¥¯¥í¡¼¥ë¥Ð¡¼¤Ç¤â¤Ç¤¤Þ¤¹¤·¡¢¥ê¥¹¥È¥Ü¥Ã¥¯¥¹¤ÎÃæ¤Ç¥Þ¥¦¥¹¤Î¥Ü¥¿¥ó2(Ãæ¥Ü¥¿¥ó)¤ò²¡¤·¤¿¤Þ¤Þ¥É¥é¥Ã¥°¤·¤Æ¤â¤Ç¤¤Þ¤¹¡£" -} -msg.pack('side'=>'top') - -# frame À¸À® -TkFrame.new($sayings_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $sayings_demo - $sayings_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'sayings'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame À¸À® -sayings_lbox = nil -TkFrame.new($sayings_demo, 'borderwidth'=>10) {|w| - sv = TkScrollbar.new(w) - sh = TkScrollbar.new(w, 'orient'=>'horizontal') - sayings_lbox = TkListbox.new(w) { - setgrid 1 - width 20 - height 10 - yscrollcommand proc{|first,last| sv.set first,last} - xscrollcommand proc{|first,last| sh.set first,last} - } - sv.command(proc{|*args| sayings_lbox.yview(*args)}) - sh.command(proc{|*args| sayings_lbox.xview(*args)}) - - if $tk_version =~ /^4\.[01]/ - sv.pack('side'=>'right', 'fill'=>'y') - sh.pack('side'=>'bottom', 'fill'=>'x') - sayings_lbox.pack('expand'=>'yes', 'fill'=>'y') - - else - sayings_lbox.grid('row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - sv.grid('row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - sh.grid('row'=>1, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - TkGrid.rowconfigure(w, 0, 'weight'=>1, 'minsize'=>0) - TkGrid.columnconfigure(w, 0, 'weight'=>1, 'minsize'=>0) - end - -}.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y') - -sayings_lbox.insert(0, -"Waste not, want not", -"Early to bed and early to rise makes a man healthy, wealthy, and wise", -"Ask not what your country can do for you, ask what you can do for your country", -"I shall return", -"NOT", -"A picture is worth a thousand words", -"User interfaces are hard to build", -"Thou shalt not steal", -"A penny for your thoughts", -"Fool me once, shame on you; fool me twice, shame on me", -"Every cloud has a silver lining", -"Where there's smoke there's fire", -"It takes one to know one", -"Curiosity killed the cat", -"Take this job and shove it", -"Up a creek without a paddle", -"I'm mad as hell and I'm not going to take it any more", -"An apple a day keeps the doctor away", -"Don't look a gift horse in the mouth" -) - diff --git a/ext/tk/sample/demos-jp/search.rb b/ext/tk/sample/demos-jp/search.rb deleted file mode 100644 index 538c607c01..0000000000 --- a/ext/tk/sample/demos-jp/search.rb +++ /dev/null @@ -1,187 +0,0 @@ -# -# Text Search widget demo (called by 'widget') -# - -# textLoadFile -- -# This method below loads a file into a text widget, discarding -# the previous contents of the widget. Tags for the old widget are -# not affected, however. -# -# Arguments: -# w - The window into which to load the file. Must be a -# text widget. -# file - The name of the file to load. Must be readable. - -def textLoadFile(w,file) - w.delete('1.0', 'end') - f = open(file, 'r') - while(!f.eof?) - w.insert('end', f.read(1000)) - end - f.close -end - -# textSearch -- -# Search for all instances of a given string in a text widget and -# apply a given tag to each instance found. -# -# Arguments: -# w - The window in which to search. Must be a text widget. -# string - The string to search for. The search is done using -# exact matching only; no special characters. -# tag - Tag to apply to each instance of a matching string. - -def textSearch(w, string, tag) - tag.remove('0.0', 'end') - return if string == "" - cur = '1.0' - loop { - cur, len = w.search_with_length(string, cur, 'end') - break if cur == "" - tag.add(cur, "#{cur} + #{len} char") - cur = w.index("#{cur} + #{len} char") - } -end - -# textToggle -- -# This method is invoked repeatedly to invoke two commands at -# periodic intervals. It normally reschedules itself after each -# execution but if an error occurs (e.g. because the window was -# deleted) then it doesn't reschedule itself. -# -# Arguments: -# cmd1 - Command to execute when method is called. -# sleep1 - Ms to sleep after executing cmd1 before executing cmd2. -# cmd2 - Command to execute in the *next* invocation of this method. -# sleep2 - Ms to sleep after executing cmd2 before executing cmd1 again. - -def textToggle(cmd1,sleep1,cmd2,sleep2) - sleep_list = [sleep2, sleep1] - TkAfter.new(proc{sleep = sleep_list.shift; sleep_list.push(sleep); sleep}, - -1, cmd1, cmd2).start(sleep1) -end - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($search_demo) && $search_demo - $search_demo.destroy - $search_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$search_demo = TkToplevel.new {|w| - title("Text Demonstration - Search and Highlight") - iconname("search") - positionWindow(w) -} - -# frame À¸À® -$search_buttons = TkFrame.new($search_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $search_demo - $search_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'search'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$search_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame À¸À® -TkFrame.new($search_demo) {|f| - TkLabel.new(f, 'text'=>'¥Õ¥¡¥¤¥ë̾:', - 'width'=>13, 'anchor'=>'w').pack('side'=>'left') - $search_fileName = TkVariable.new - TkEntry.new(f, 'width'=>40, - 'textvariable'=>$search_fileName) { - pack('side'=>'left') - bind('Return', proc{textLoadFile($search_text, $search_fileName.value) - $search_string_entry.focus}) - focus - } - TkButton.new(f, 'text'=>'ÆÉ¤ß¹þ¤ß', - 'command'=>proc{textLoadFile($search_text, - $search_fileName.value)})\ - .pack('side'=>'left', 'pady'=>5, 'padx'=>10) -}.pack('side'=>'top', 'fill'=>'x') - -TkFrame.new($search_demo) {|f| - TkLabel.new(f, 'text'=>'¸¡º÷ʸ»úÎó:', - 'width'=>13, 'anchor'=>'w').pack('side'=>'left') - $search_searchString = TkVariable.new - $search_string_entry = TkEntry.new(f, 'width'=>40, - 'textvariable'=>$search_searchString) { - pack('side'=>'left') - bind('Return', proc{textSearch($search_text, $search_searchString.value, - $search_Tag)}) - } - TkButton.new(f, 'text'=>'ȿž', - 'command'=>proc{textSearch($search_text, - $search_searchString.value, - $search_Tag)}) { - pack('side'=>'left', 'pady'=>5, 'padx'=>10) - } -}.pack('side'=>'top', 'fill'=>'x') - -$search_text = TkText.new($search_demo, 'setgrid'=>true) {|t| - $search_Tag = TkTextTag.new(t) - TkScrollbar.new($search_demo, 'command'=>proc{|*args| t.yview(*args)}) {|sc| - t.yscrollcommand(proc{|first,last| sc.set first,last}) - pack('side'=>'right', 'fill'=>'y') - } - pack('expand'=>'yes', 'fill'=>'both') -} - -# Set up display styles for text highlighting. - -if TkWinfo.depth($search_demo) > 1 - textToggle(proc{ - begin - $search_Tag.configure('background'=>'#ce5555', - 'foreground'=>'white') - rescue - end - }, - 800, - proc{ - begin - $search_Tag.configure('background'=>'', 'foreground'=>'') - rescue - end - }, - 200 ) -else - textToggle(proc{ - begin - $search_Tag.configure('background'=>'black', - 'foreground'=>'white') - rescue - end - }, - 800, - proc{ - begin - $search_Tag.configure('background'=>'', 'foreground'=>'') - rescue - end - }, - 200 ) -end -$search_text.insert('1.0', '\ -¤³¤Î¥¦¥£¥ó¥É¥¦¤Ï¸¡º÷µ¡¹½¤ò¼Â¸½¤¹¤ë¤Î¤Ë¥Æ¥¥¹¥È widget ¤Î¥¿¥°µ¡Ç½¤¬¤É¤Î -¤è¤¦¤Ë»È¤ï¤ì¤ë¤Î¤«¤ò¥Ç¥â¤¹¤ë¤â¤Î¤Ç¤¹¡£¤Þ¤º¾å¤Î¥¨¥ó¥È¥ê¤Ë¥Õ¥¡¥¤¥ë̾¤òÆþ -¤ì¡¢<¥ê¥¿¡¼¥ó> ¤ò²¡¤¹¤«¡Ö¥í¡¼¥É¡×¥Ü¥¿¥ó¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£¼¡¤Ë¤½¤Î²¼¤Î -¥¨¥ó¥È¥ê¤Ëʸ»úÎó¤òÆþÎϤ·¡¢<¥ê¥¿¡¼¥ó> ¤ò²¡¤¹¤«¡Öȿž¡×¥Ü¥¿¥ó¤ò²¡¤·¤Æ¤¯ -¤À¤µ¤¤¡£¤¹¤ë¤È¥Õ¥¡¥¤¥ëÃæ¤Î¡¢¸¡º÷ʸ»úÎó¤È°ìÃפ¹¤ëÉôʬ¤ËÁ´¤Æ "search_Tag" -¤È¤¤¤¦¥¿¥°¤¬¤Ä¤±¤é¤ì¡¢¥¿¥°¤Îɽ¼¨Â°À¤È¤·¤Æ¤½¤Îʸ»úÎó¤¬ÅÀÌǤ¹¤ë¤è¤¦¤Ë -ÀßÄꤵ¤ì¤Þ¤¹¡£') -$search_text.set_insert '0.0' - -$search_fileName.value = '' -$search_searchString.value = '' - diff --git a/ext/tk/sample/demos-jp/spin.rb b/ext/tk/sample/demos-jp/spin.rb deleted file mode 100644 index 4f6edc13c0..0000000000 --- a/ext/tk/sample/demos-jp/spin.rb +++ /dev/null @@ -1,67 +0,0 @@ -# spin.rb -- -# -# This demonstration script creates several spinbox widgets. -# -# based on Tcl/Tk8.4.4 widget demos - -if defined?($spin_demo) && $spin_demo - $spin_demo.destroy - $spin_demo = nil -end - -$spin_demo = TkToplevel.new {|w| - title("Spinbox Demonstration") - iconname("spin") - positionWindow(w) -} - -TkLabel.new($spin_demo, - :font=>$font, :wraplength=>'5i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) -²¼¤Ë¤Ï£³¼ïÎà¤Î¥¹¥Ô¥ó¥Ü¥Ã¥¯¥¹¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\ -¤½¤ì¤¾¤ì¡¢¥Þ¥¦¥¹¤ÇÁªÂò¤·¤ÆÊ¸»ú¤òÆþÎϤ¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -ÊÔ½¸Áàºî¤È¤·¤Æ¤Ï¡¢Emacs ·Á¼°¤Î¿¤¯¤Ë²Ã¤¨¤Æ¡¢°ìÈÌŪ¤Ê -Motif ·Á¼°¤Î¥¡¼Áàºî¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤¿¤È¤¨¤Ð¡¢ -Backspace ¤È Control-h ¤È¤ÏÆþÎÏ¥«¡¼¥½¥ë¤Îº¸Â¦¤Îʸ»ú¤ò -ºï½ü¤·¡¢Delete ¤È Control-d ¤È¤Ï±¦Â¦¤Îʸ»ú¤òºï½ü¤·¤Þ¤¹¡£ -ÆþÎÏÏȤÎŤµ¤ò±Û¤¨¤ë¤è¤¦¤ÊŤ¤Ê¸»úÎó¤òÆþÎϤ·¤¿¾ì¹ç¤Ë¤Ï¡¢ -¥Þ¥¦¥¹¤Î¥Ü¥¿¥ó£²¤ò²¡¤·¤Æ¥É¥é¥Ã¥°¤¹¤ë¤³¤È¤Ç¡¢ÆþÎÏʸ»úÎó -¤ò¥¹¥¥ã¥ó¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£ -¤Ê¤ª¡¢ºÇ½é¤Î¥¹¥Ô¥ó¥Ü¥Ã¥¯¥¹¤Ï¡¢À°¿ôÃͤȤߤʤµ¤ì¤ë¤è¤¦¤Ê -ʸ»úÎó¤·¤«ÆþÎϤ¬µö¤µ¤ì¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£¤Þ¤¿¡¢ -£³ÈÖÌܤΥ¹¥Ô¥ó¥Ü¥Ã¥¯¥¹¤ÇÁªÂò¸õÊä¤Ë¸½¤ì¤ë¤Î¤Ï¥ª¡¼¥¹¥È¥é -¥ê¥¢¤ÎÅÔ»Ô̾¤Î¥ê¥¹¥È¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ -¤â¤·¤¢¤Ê¤¿¤¬»È¤Ã¤Æ¤¤¤ë Ruby ¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë Tk ¥é¥¤ -¥Ö¥é¥ê¤¬ spinbox ¥¦¥£¥¸¥§¥Ã¥È¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¤³¤Î -¥Ç¥â¤Ï¤¦¤Þ¤¯Æ°¤«¤Ê¤¤¤Ï¤º¤Ç¤¹¡£¤½¤Î¾ì¹ç¤Ë¤Ï spinbox ¥¦¥£ -¥¸¥§¥Ã¥È¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ê¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î Tk -¤òÁȤ߹ç¤ï¤»¤Æ»î¤¹¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£ -EOL - -TkFrame.new($spin_demo){|f| - pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - - TkButton.new(f, :text=>'λ²ò', :width=>15, :command=>proc{ - $spin_demo.destroy - $spin_demo = nil - }).pack(:side=>:left, :expand=>true) - - TkButton.new(f, :text=>'¥³¡¼¥É»²¾È', :width=>15, :command=>proc{ - showCode 'spin' - }).pack(:side=>:left, :expand=>true) -} - -australianCities = [ - 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide', - 'Brisbane', 'Hobart', 'Darwin', 'Alice Springs' -] - -[ - TkSpinbox.new($spin_demo, :from=>1, :to=>10, :width=>10, :validate=>:key, - :validatecommand=>[ - proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P' - ]), - TkSpinbox.new($spin_demo, :from=>0, :to=>3, :increment=>0.5, - :format=>'%05.2f', :width=>10), - TkSpinbox.new($spin_demo, :values=>australianCities, :width=>10) -].each{|sbox| sbox.pack(:side=>:top, :pady=>5, :padx=>10)} diff --git a/ext/tk/sample/demos-jp/square b/ext/tk/sample/demos-jp/square deleted file mode 100644 index 00bfde59ff..0000000000 --- a/ext/tk/sample/demos-jp/square +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env ruby - -# square -- -# This script generates a demo application containing only -# a "square" widget. It's only usable if Tk has been compiled -# with tkSquare.c and with the -DSQUARE_DEMO compiler switch. -# This demo arranges the following bindings for the widget: -# -# Button-1 press/drag: moves square to mouse -# "a": toggle size animation on/off -# - -require 'tk' -require 'tkafter' - -class TkSquare<TkWindow - def create_self - begin - tk_call 'square', path - rescue - STDERR.print "\nSorry. Your Tk interpreter does not contain " + - 'a "square" demonstration widget.' + - "\n ( See documents included the Tcl/Tk source archive. )\n\n" - exit - end - end - def size(amount=nil) - if amount - tk_send 'size', amount - else - number(tk_send('size')) - end - end - def position(x,y) - tk_send 'position', x, y - end -end - -$s = TkSquare.new{ - pack('expand'=>'yes', 'fill'=>'both') - bind('1', proc{|x,y| center(x,y)}, '%s %y') - bind('B1-Motion', proc{|x,y| center(x,y)}, '%s %y') - bind('a', proc{animate}) - focus -} -TkRoot.new.minsize(1,1) - -# The procedure below centers the square on a given position. - -def center(x,y) - a = $s.size - $s.position(x-(a/2), y-(a/2)) -end - -# The procedures below provide a simple form of animation where -# the box changes size in a pulsing pattern: larger, smaller, larger, -# and so on. - -$inc = 0 - -def timer_proc - a = $s.size - return if $inc == 0 - $inc = -3 if a >= 40 - $inc = 3 if a <= 10 - $s.size(a+$inc) -end - -$timer = TkAfter.new(30, -1, proc{timer_proc}) - -def animate - if $inc == 0 - $inc = 3 - $timer.start - else - $inc = 0 - $timer.stop - end -end - -Tk.mainloop diff --git a/ext/tk/sample/demos-jp/states.rb b/ext/tk/sample/demos-jp/states.rb deleted file mode 100644 index cf8a6768b6..0000000000 --- a/ext/tk/sample/demos-jp/states.rb +++ /dev/null @@ -1,70 +0,0 @@ -# -# listbox widget demo 'states' (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($states_demo) && $states_demo - $states_demo.destroy - $states_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$states_demo = TkToplevel.new {|w| - title("Listbox Demonstration (states)") - iconname("states") - positionWindow(w) -} - -# label À¸À® -msg = TkLabel.new($states_demo) { - font $font - wraplength '4i' - justify 'left' - text "²¼¤Ë¤¢¤ë¤Î¤ÏÅÔÆ»Éܸ©Ì¾¤¬Æþ¤Ã¤¿¥¹¥¯¥í¡¼¥ë¥Ð¡¼ÉդΥꥹ¥È¥Ü¥Ã¥¯¥¹¤Ç¤¹¡£¥ê¥¹¥È¤ò¥¹¥¯¥í¡¼¥ë¤µ¤»¤ë¤Î¤Ï¥¹¥¯¥í¡¼¥ë¥Ð¡¼¤Ç¤â¤Ç¤¤Þ¤¹¤·¡¢¥ê¥¹¥È¥Ü¥Ã¥¯¥¹¤ÎÃæ¤Ç¥Þ¥¦¥¹¤Î¥Ü¥¿¥ó2(Ãæ¥Ü¥¿¥ó)¤ò²¡¤·¤¿¤Þ¤Þ¥É¥é¥Ã¥°¤·¤Æ¤â¤Ç¤¤Þ¤¹¡£" -} -msg.pack('side'=>'top') - -# frame À¸À® -TkFrame.new($states_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $states_demo - $states_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'states'} - }.pack('side'=>'left', 'expand'=>'yes') - -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame À¸À® -states_lbox = nil -TkFrame.new($states_demo, 'borderwidth'=>'.5c') {|w| - s = TkScrollbar.new(w) - states_lbox = TkListbox.new(w) { - setgrid 1 - height 12 - yscrollcommand proc{|first,last| s.set first,last} - } - s.command(proc{|*args| states_lbox.yview(*args)}) - s.pack('side'=>'right', 'fill'=>'y') - states_lbox.pack('side'=>'left', 'expand'=>1, 'fill'=>'both') -}.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y') - -ins_data = [ - '°¦ÃÎ','ÀÄ¿¹','½©ÅÄ','ÀÐÀî','°ñ¾ë','´ä¼ê','°¦É²', - 'Âçʬ','Âçºå','²¬»³','²Æì','¹áÀî','¼¯»ùÅç','¿ÀÆàÀî', - '´ôÉì','µþÅÔ','·§ËÜ','·²ÇÏ','¹âÃÎ','ºë¶Ì','º´²ì', - '¼¢²ì','ÀŲ¬','Å纬','ÀéÍÕ','Åìµþ','ÆÁÅç','ÆÊÌÚ', - 'Ä»¼è','ÉÙ»³','Ĺºê','ĹÌî','ÆàÎÉ','¿·³ã','ʼ¸Ë', - '¹Åç','Ê¡°æ','Ê¡²¬','Ê¡Åç','Ë̳¤Æ»','»°½Å','µÜ¾ë', - 'µÜºê','»³·Á','»³¸ý','»³Íü','ϲλ³' -] - -states_lbox.insert(0, *ins_data) - diff --git a/ext/tk/sample/demos-jp/style.rb b/ext/tk/sample/demos-jp/style.rb deleted file mode 100644 index d58c6115ae..0000000000 --- a/ext/tk/sample/demos-jp/style.rb +++ /dev/null @@ -1,247 +0,0 @@ -# -# text (display styles) widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($style_demo) && $style_demo - $style_demo.destroy - $style_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$style_demo = TkToplevel.new {|w| - title("Text Demonstration - Display Styles") - iconname("style") - positionWindow(w) -} - -# frame À¸À® -TkFrame.new($style_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $style_demo - $style_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'style'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# text À¸À® -TkText.new($style_demo){|t| - # À¸À® - setgrid 'true' - width 70 - height 32 - wrap 'word' - TkScrollbar.new($style_demo) {|s| - pack('side'=>'right', 'fill'=>'y') - command proc{|*args| t.yview(*args)} - t.yscrollcommand proc{|first,last| s.set first,last} - } - pack('expand'=>'yes', 'fill'=>'both') - - # ¥Æ¥¥¹¥È¥¿¥°ÀßÄê (¥Õ¥©¥ó¥È´ØÏ¢) - style_tag_bold = TkTextTag.new(t, 'font'=>'-*-Courier-Bold-O-Normal--*-120-*-*-*-*-*-*') - style_tag_big = TkTextTag.new(t, 'font'=>'-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*', 'kanjifont'=>$msg_kanji_font) - style_tag_verybig = TkTextTag.new(t, 'font'=>'-*-Helvetica-Bold-R-Normal--*-240-*-*-*-*-*-*') -# style_tag_small = TkTextTag.new(t, 'font'=>'-Adobe-Helvetica-Bold-R-Normal-*-100-*', 'kanjifont'=>$kanji_font) - style_tag_small = TkTextTag.new(t, 'font'=>'-Adobe-Helvetica-Bold-R-Normal-*-100-*') -### -# case($tk_version) -# when /^4.*/ -# style_tag_big = TkTextTag.new(t, 'font'=>'-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*', 'kanjifont'=>$msg_kanji_font) -# style_tag_small = TkTextTag.new(t, 'font'=>'-Adobe-Helvetica-Bold-R-Normal-*-100-*', 'kanjifont'=>$kanji_font) -# when /^8.*/ -# unless $style_demo_do_first -# $style_demo_do_first = true -# Tk.tk_call('font', 'create', '@bigascii', -# '-copy', '-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*') -# Tk.tk_call('font', 'create', '@smallascii', -# '-copy', '-Adobe-Helvetica-Bold-R-Normal-*-100-*') -# Tk.tk_call('font', 'create', '@cBigFont', -# '-compound', '@bigascii @msg_knj') -# Tk.tk_call('font', 'create', '@cSmallFont', -# '-compound', '@smallascii @kanji') -# end -# style_tag_big = TkTextTag.new(t, 'font'=>'@cBigFont') -# style_tag_small = TkTextTag.new(t, 'font'=>'@cSmallFont') -# end - - # ¥Æ¥¥¹¥È¥¿¥°ÀßÄê (¿§¡¤¥ì¥ê¡¼¥Õ´ØÏ¢) - if TkWinfo.depth($root).to_i > 1 - style_tag_color1 = TkTextTag.new(t, 'background'=>'#a0b7ce') - style_tag_color2 = TkTextTag.new(t, 'foreground'=>'red') - style_tag_raised = TkTextTag.new(t, 'relief'=>'raised', 'borderwidth'=>1) - style_tag_sunken = TkTextTag.new(t, 'relief'=>'sunken', 'borderwidth'=>1) - else - style_tag_color1 = TkTextTag.new(t, 'background'=>'black', - 'foreground'=>'white') - style_tag_color2 = TkTextTag.new(t, 'background'=>'black', - 'foreground'=>'white') - style_tag_raised = TkTextTag.new(t, 'background'=>'white', - 'relief'=>'raised', 'borderwidth'=>1) - style_tag_sunken = TkTextTag.new(t, 'background'=>'white', - 'relief'=>'sunken', 'borderwidth'=>1) - end - - # ¥Æ¥¥¹¥È¥¿¥°ÀßÄê (¤½¤Î¾) - if $tk_version =~ /^4\.[01]/ - style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black', - 'borderwidth'=>0, - 'bgstipple'=>'gray25') - else - style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black', - 'borderwidth'=>0, - 'bgstipple'=>'gray12') - end - style_tag_fgstipple = TkTextTag.new(t, 'fgstipple'=>'gray50') - style_tag_underline = TkTextTag.new(t, 'underline'=>'on') - style_tag_overstrike = TkTextTag.new(t, 'overstrike'=>'on') - style_tag_right = TkTextTag.new(t, 'justify'=>'right') - style_tag_center = TkTextTag.new(t, 'justify'=>'center') - style_tag_super = TkTextTag.new(t, 'offset'=>'4p', 'font'=>'-Adobe-Courier-Medium-R-Normal--*-100-*-*-*-*-*-*') - style_tag_sub = TkTextTag.new(t, 'offset'=>'-2p', 'font'=>'-Adobe-Courier-Medium-R-Normal--*-100-*-*-*-*-*-*') - style_tag_margins = TkTextTag.new(t, 'lmargin1'=>'12m', 'lmargin2'=>'6m', - 'rmargin'=>'10m') - style_tag_spacing = TkTextTag.new(t, 'spacing1'=>'10p', 'spacing2'=>'2p', - 'lmargin1'=>'12m', 'lmargin2'=>'6m', - 'rmargin'=>'10m') - - # ¥Æ¥¥¹¥ÈÁÞÆþ - insert('end', '¤³¤Î¤è¤¦¤Ë¥Æ¥¥¹¥È widget ¤Ï¾ðÊó¤òÍÍ¡¹¤Ê¥¹¥¿¥¤¥ë¤Çɽ¼¨¤¹¤ë¤³¤È -¤¬¤Ç¤¤Þ¤¹¡£') - insert('end', '¥¿¥°', style_tag_big) - insert('end', '¤È¤¤¤¦¥á¥«¥Ë¥º¥à¤Ç¥³¥ó¥È¥í¡¼¥ë¤µ¤ì¤Þ¤¹¡£ -¥¿¥°¤È¤Ï¥Æ¥¥¹¥È widget Æâ¤Î¤¢¤ëʸ»ú (¤ÎÈϰÏ)¤ËÂФ·¤ÆÅ¬ÍѤǤ¤ë -ñ¤Ê¤ë̾Á°¤Î¤³¤È¤Ç¤¹¡£¥¿¥°¤ÏÍÍ¡¹¤Êɽ¼¨¥¹¥¿¥¤¥ë¤ËÀßÄê¤Ç¤¤Þ¤¹¡£ -ÀßÄꤹ¤ë¤È¡¢¤½¤Î¥¿¥°¤Î¤Ä¤¤¤¿Ê¸»ú¤Ï»ØÄꤷ¤¿¥¹¥¿¥¤¥ë¤Çɽ¼¨¤µ¤ì¤ë -¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£»ÈÍѤǤ¤ëɽ¼¨¥¹¥¿¥¤¥ë¤Ï¼¡¤ÎÄ̤ê¤Ç¤¹¡£ -') - insert('end', ' -1. ¥Õ¥©¥ó¥È', style_tag_big) - insert('end', ' ¤É¤ó¤Ê X ¤Î¥Õ¥©¥ó¥È¤Ç¤â»È¤¨¤Þ¤¹¡£') - insert('end', 'large', style_tag_verybig) - insert('end', ' -¤È¤«') -# insert('end', '¾®¤µ¤¤', style_tag_small) - insert('end', 'small', style_tag_small) - insert('end', '¤È¤«¡£ -') - insert('end', ' -2. ¿§', style_tag_big) - insert('end', ' ') - insert('end', 'ÇØ·Ê¿§', style_tag_color1) - insert('end', '¤â') - insert('end', 'Á°·Ê¿§', style_tag_color2) - insert('end', '¤â') - insert('end', 'ξÊý', style_tag_color1, style_tag_color2) - insert('end', '¤È¤âÊѤ¨¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -') - insert('end', ' -3. ÌÖ¤«¤±', style_tag_big) - insert('end', ' ¤³¤Î¤è¤¦¤ËÉÁ²è¤ÎºÝ¤Ë') - insert('end', 'ÇØ·Ê¤â', style_tag_bgstipple) - insert('end', 'ʸ»ú¤â', style_tag_fgstipple) - insert('end', 'ñ¤Ê¤ëÅɤê¤Ä¤Ö¤· -¤Ç¤Ê¤¯¡¢ÌÖ¤«¤±¤ò»È¤¦¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -') - insert('end', ' -4. ²¼Àþ', style_tag_big) - insert('end', ' ¤³¤Î¤è¤¦¤Ë') - insert('end', 'ʸ»ú¤Ë²¼Àþ¤ò°ú¤¯', style_tag_underline) - insert('end', '¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -') - insert('end', ' -5. ÂǤÁ¾Ã¤·Àþ', style_tag_big) - insert('end', ' ¤³¤Î¤è¤¦¤Ë') - insert('end', 'ʸ»ú¤Ë½Å¤Í¤ÆÀþ¤ò°ú¤¯', style_tag_overstrike) - insert('end', '¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -') - insert('end', ' -6. 3D ¸ú²Ì', style_tag_big) - insert('end', ' ÇØ·Ê¤ËÏȤò¤Ä¤±¤Æ¡¢Ê¸»ú¤ò') - insert('end', 'Èô¤Ó½Ð¤¹', style_tag_raised) - insert('end', '¤è¤¦¤Ë¤·¤¿¤ê') - insert('end', 'ÄÀ¤à', style_tag_sunken) - insert('end', ' -¤è¤¦¤Ë¤Ç¤¤Þ¤¹¡£ -') - insert('end', ' -7. ¹Ô·¤¨', style_tag_big) - insert('end', ' ¤³¤Î¤è¤¦¤Ë¹Ô¤ò -') - insert('end', 'º¸¤Ë·¤¨¤¿¤ê -') - insert('end', '±¦¤Ë·¤¨¤¿¤ê -', style_tag_right) - insert('end', '¿¿Ãæ¤Ë·¤¨¤¿¤ê¤Ç¤¤Þ¤¹¡£ -', style_tag_center) - insert('end', ' -8. ¸ªÉդʸ»ú¤Èź»ú', style_tag_big) - insert('end', ' 10') - insert('end', 'n', style_tag_super) - insert('end', ' ¤Î¤è¤¦¤Ë¸ªÉդʸ»ú¤Î¸ú²Ì¤ä¡¢') - insert('end', ' -X') - insert('end', 'i', style_tag_sub) - insert('end', '¤Î¤è¤¦¤Ëź»ú¤Î¸ú²Ì¤ò½Ð¤¹¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -') - insert('end', ' -9. ¥Þ¡¼¥¸¥ó', style_tag_big) - insert('end', '¥Æ¥¥¹¥È¤Îº¸Â¦¤Ë;ʬ¤Ê¶õÇò¤òÃÖ¤¯¤³¤È¤¬¤Ç¤¤Þ¤¹: -') - insert('end', '¤³¤ÎÃÊÍî¤Ï¥Þ¡¼¥¸¥ó¤Î»ÈÍÑÎã¤Ç¤¹¡£¥¹¥¯¥ê¡¼¥ó', - style_tag_margins) - insert('end', '¾å¤ÇÀÞ¤êÊÖ¤µ¤ì¤ÆÉ½¼¨¤µ¤ì¤Æ¤¤¤ë1¹Ô¤Î¥Æ¥¥¹¥È¤Ç¤¹¡£', - style_tag_margins) - insert('end', 'º¸Â¦¤Ë¤Ï2¼ïÎà¤Î¥Þ¡¼¥¸¥ó¤ò»ý¤Á¤Þ¤¹¡£', style_tag_margins) - insert('end', '1¹ÔÌܤËÂФ¹¤ë¤â¤Î¤È¡¢', style_tag_margins) - insert('end', '2¹ÔÌܰʹߤÎϢ³¤·¤¿¥Þ¡¼¥¸¥ó', style_tag_margins) - insert('end', '¤Ç¤¹¡£¤Þ¤¿±¦Â¦¤Ë¤â¥Þ¡¼¥¸¥ó¤¬¤¢¤ê¤Þ¤¹¡£', style_tag_margins) - insert('end', '¹Ô¤ÎÀÞ¤êÊÖ¤·°ÌÃÖ¤ò·è¤á¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -', style_tag_margins) - insert('end', ' -10. ¥¹¥Ú¡¼¥·¥ó¥°', style_tag_big) - insert('end', '3¤Ä¤Î¥Ñ¥é¥á¡¼¥¿¤Ç¹Ô¤Î¥¹¥Ú¡¼¥·¥ó¥°¤ò') - insert('end', 'À©¸æ¤¹ -¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£Spacing1¤Ç¡¢¹Ô¤Î') - insert('end', '¾å¤Ë¤É¤Î¤¯¤é¤¤¤Î¶õ´Ö¤òÃÖ¤¯¤«¡¢ -spacing3') - insert('end', '¤Ç¹Ô¤Î²¼¤Ë¤É¤Î¤¯¤é¤¤¤Î¶õ´Ö¤òÃÖ¤¯¤«¡¢') - insert('end', '¹Ô¤¬ÀÞ¤êÊÖ¤µ¤ì¤Æ¤¤¤ë¤Ê¤é -¤Ð¡¢spacing2¤Ç¡¢') - insert('end', '¥Æ¥¥¹¥È¹Ô¤òÀ¸À®¤·¤Æ¤¤¤ë¹Ô¤Î´Ö¤Ë¤É¤Î¤¯¤é¤¤') - insert('end', '¤Î¶õ´Ö¤òÃÖ -¤¯¤«¤ò¼¨¤·¤Þ¤¹¡£ -') - insert('end', '¤³¤ì¤é¤Î¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤¿ÃÊÍî¤Ï¤É¤Î¤è¤¦¤Ë', - style_tag_spacing) - insert('end', '¥¹¥Ú¡¼¥·¥ó¥°¤¬¤¬¹Ô¤ï¤ì¤ë¤Î¤«¤ò¼¨¤·¤Þ¤¹¡£', - style_tag_spacing) - insert('end', '³ÆÃÊÍî¤Ï¼ÂºÝ¤Ï¥Æ¥¥¹¥Èwidget', style_tag_spacing) - insert('end', '¤Î1¹Ô¤Ç¡¢widget¤Ë¤è¤Ã¤ÆÀÞ¤ê¾ö¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£ -', style_tag_spacing) - insert('end', 'Spacing1¤Ï¤³¤Î¥Æ¥¥¹¥È¤Ç¤Ï10point¤Ë', style_tag_spacing) - insert('end', 'ÀßÄꤵ¤ì¤Æ¤¤¤Þ¤¹¡£', style_tag_spacing) - insert('end', '¤³¤ì¤Ë¤è¤ê¡¢ÃÊÍî¤Î´Ö¤ËÂ礤ʴֳ֤¬', style_tag_spacing) - insert('end', '¸ºß¤·¤Æ¤¤¤Þ¤¹¡£', style_tag_spacing) - insert('end', 'Spacing2¤Ï2point¤ËÀßÄꤵ¤ì¤Æ¤¤¤Þ¤¹¡£', style_tag_spacing) - insert('end', '¤³¤ì¤ÇÃÊÍî¤ÎÃæ¤Ë¤Û¤ó¤Î¾¯¤·´Ö³Ö¤¬Â¸ºß¤·¤Æ¤¤¤Þ¤¹¡£', - style_tag_spacing) - insert('end', 'Spacing3¤Ï¤³¤ÎÎã¤Ç¤Ï»ÈÍѤµ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ -', style_tag_spacing) - insert('end', '´Ö³Ö¤¬¤É¤³¤Ë¤¢¤ë¤«¤ò¸«¤¿¤±¤ì¤Ð¡¢¤³¤ì¤é¤ÎÃÊÍî¤Î', - style_tag_spacing) - insert('end', '¤Ê¤«¤Ç¥Æ¥¥¹¥È¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£ÁªÂò¤Î', style_tag_spacing) - insert('end', 'ȿž¤·¤¿Éôʬ¤Ë¤Ï;ʬ¤Ë¤È¤é¤ì¤¿´Ö³Ö¤¬', style_tag_spacing) - insert('end', '´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£ -', style_tag_spacing) - -} - diff --git a/ext/tk/sample/demos-jp/tcolor b/ext/tk/sample/demos-jp/tcolor deleted file mode 100644 index 391ce4c446..0000000000 --- a/ext/tk/sample/demos-jp/tcolor +++ /dev/null @@ -1,519 +0,0 @@ -#!/usr/bin/env ruby -# -# tcolor -- -# ¤³¤Î¥¹¥¯¥ê¥×¥È¤ÏRGB,HSB,CYM·Á¼°¤ò¥µ¥Ý¡¼¥È¤¹¤ë -# ´Ê°×¥«¥é¡¼¥¨¥Ç¥£¥¿¤Ç¤¹¡£ -# -# Copyright (C) 1998 Takaaki Tateishi(ttate@jaist.ac.jp) -# last update: Thu Jun 18 06:32:35 JST 1998 -# - -# ¤Þ¤º¤Ïtk.rb¤òÆÉ¤ß¹þ¤à¡£ - -require "tk" - - -# Tk¤Ë¤è¤Ã¤ÆÊѹ¹¤µ¤ì¤ëÊÑ¿ô¤ÏTkVariable¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤ò»È¤¦¡£ - -$colorSpace = TkVariable.new(:rgb) -$red = 65535 -$green = 0 -$blue = 0 -$color = "#ffff00000000" -$updating = TkVariable.new(0) -$autoUpdate = TkVariable.new(1) -$name = TkVariable.new("") -# $command = TkVariable.new("print(%%,\"\n\")") -$command = TkVariable.new("") -$label1 = TkVariable.new("label1") -$label2 = TkVariable.new("label2") -$label3 = TkVariable.new("label3") - - -# ¥ê¥½¡¼¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀßÄê -if (TkVarAccess.new('tcl_platform')['platform'] == 'unix') - TkOptionDB.add('*Entry.background', 'white') -end - - -# ³Æ¥¤¥Ù¥ó¥ÈÍѤΥ᥽¥Ã¥É - -def rgbToHsv(red,green,blue) - - if ( red > green ) - max = red - min = green - else - max = green - min = red - end - - if ( blue > max ) - max = blue - else - if ( blue < min ) - min = blue - end - end - - range = max - min - - if ( max == 0 ) - sat = 0.0 - else - sat = (max-min)/max - end - - if ( sat == 0 ) - hue = 0.0 - else - rc = (max-red)/range - gc = (max-green)/range - bc = (max-blue)/range - if ( red == max ) - hue = 0.166667 * (bc - gc) - else - if ( green == max ) - hue = 0.166667 * (2.0 + rc - bc) - else - hue = 0.166667 * (4.0 + gc - rc) - end - end - if ( hue < 0.0 ) - hue = hue + 1.0 - end - end - - [hue,sat,max/65535] -end - - -def hsbToRgb(hue,sat,value) - v = 65535.0 * value - if( sat == 0 ) - ans = [v,v,v] - else - hue = hue*6.0 - if ( hue >= 6 ) - hue = 0.0 - end - i = hue.to_i - f = hue - i - p = 65535.0 * value * (1.0 - sat) - q = 65535.0 * value * (1.0 - (sat * f)) - t = 65535.0 * value * (1.0 - (sat * (1.0 - f))) - case i - when 0 - ans = [v,t,p] - when 1 - ans = [q,v,p] - when 2 - ans = [p,v,t] - when 3 - ans = [p,q,v] - when 4 - ans = [t,p,v] - when 5 - ans = [v,p,q] - else - raise(eException,"i value #{i} is out of range") - end - end - return ans -end - - -def doUpdate - newCmd = $command.to_s.gsub("%%","\"#{$color}\"") - eval(newCmd) -end - - -def tc_scaleChanged - if( $updating.to_i == 1 ) - return - end - - scale1 = $root.middle.middle.scale1 - scale2 = $root.middle.middle.scale2 - scale3 = $root.middle.middle.scale3 - - case $colorSpace.value.intern - when :rgb - $red = (scale1.get * 65.535).to_i - $green = (scale2.get * 65.535).to_i - $blue = (scale3.get * 65.535).to_i - when :cmy - $red = (65535 - scale1.get * 65.535).to_i - $green = (65535 - scale2.get * 65.535).to_i - $blue = (65535 - scale3.get * 65.535).to_i - when :hsb - list = hsbToRgb(scale1.get / 1000.0, - scale2.get / 1000.0, - scale3.get / 1000.0) - $red = list[0] - $green = list[1] - $blue = list[2] - else - raise(Exception,"unknown colorSpace") - end - $color = format("#%04x%04x%04x",$red.to_i,$green.to_i,$blue.to_i) - $root.middle.right.set_color($color) - if( $autoUpdate.to_i == 1 ) - doUpdate - end - Tk.update(TRUE) -end - - -def tc_setScales - $updating.value = 1 - - scale1 = $root.middle.middle.scale1 - scale2 = $root.middle.middle.scale2 - scale3 = $root.middle.middle.scale3 - - case $colorSpace.value.intern - when :rgb - scale1.set($red / 65.535) - scale2.set($green / 65.535) - scale3.set($blue / 65.535) - when :cmy - scale1.set((65535 - $red) / 65.535) - scale2.set((65535 - $green) / 65.535) - scale3.set((65535 - $blue) / 65.535) - when :hsb - list = rgbToHsv($red,$green,$blue) - scale1.set( list[0] * 1000.0 ) - scale2.set( list[1] * 1000.0 ) - scale3.set( list[2] * 1000.0 ) - else - raise(Exception,"unknown colorSpace") - end - - $updating.value = 0 -end - - -def tc_loadNamedColor(name) - if name[0,1] != "#" - list = TkWinfo.rgb($root.middle.right.swatch,name) - $red = list[0] - $green = list[1] - $blue = list[2] - else - case name.length - when 4 - format = /#(.{1})(.{1})(.{1})/ - shift = 12 - when 7 - format = /#(.{2})(.{2})(.{2})/ - shift = 8 - when 10 - format = /#(.{3})(.{3})(.{3})/ - shift = 4 - when 13 - format = /#(.{4})(.{4})(.{4})/ - shift = 0 - else - raise(eException,"syntax error in color name \"#{name}\"") - end - name.scan(format){|strlist| - if strlist.length != 3 - raise(eException,"syntax error in color name \"#{name}\"") - end - $red = strlist[0].to_i - $green = strlist[1].to_i - $blue = strlist[2].to_i - } - $red = $red << shift - $green = $green << shift - $blue = $blue << shift - end - - tc_setScales - $color = format("#%04x%04x%04x",$red,$green,$blue) - $root.middle.right.set_color($color) - if $autoUpdate.to_i == 1 - doUpdate - end -end - - -def changeColorSpace(space) - case space - when :rgb - $label1.value = "Red" - $label2.value = "Green" - $label3.value = "Blue" - when :cmy - $label1.value = "Cyan" - $label2.value = "Magenta" - $label3.value = "Yellow" - when :hsb - $label1.value = "Hue" - $label2.value = "Saturation" - $label3.value = "Brightness" - end - tc_setScales -end - - - - - -# tcolorÍѤΥá¥Ë¥å¡¼ - -class TkColorMenuFrame<TkFrame - def initialize(parent) - super(parent, - "relief"=>"raised", - "borderwidth"=>"2") - - # File¥á¥Ë¥å¡¼¥Ü¥¿¥ó¤ÎÀ¸À® - @file = TkMenubutton.new(self){|button| - - # File¥á¥Ë¥å¡¼¤ÎºîÀ® - @file_menu = TkMenu.new(button){ - add "radio", - "label" => "RGB color space", - "variable" => $colorSpace, - "value" => :rgb, - "underline" => "0", - "command" => proc{changeColorSpace(:rgb)} - add "radio", - "label" => "CMY color space", - "variable" => $colorSpace, - "value" => :cmy, - "underline" => "0", - "command" => proc{changeColorSpace(:cmy)} - add "radio", - "label" => "HSB color space", - "variable" => $colorSpace, - "value" => :hsb, - "underline" => "0", - "command" => proc{changeColorSpace(:hsb)} - add "separator" - add "radio", - "label" => "Automatic updates", - "variable" => $autoUpdate, - "value" => "1", - "underline" => "0" - add "radio", - "label" => "Manual updates", - "variable" => $autoUpdate, - "value" => "0", - "underline" => "0" - add "separator" - add "command", - "label" => "Exit program", - "underline" => "0", - "command" => proc{exit} - } - - # File¥á¥Ë¥å¡¼¤ÈFile¥Ü¥¿¥ó¤ò´ØÏ¢ÉÕ¤±¤ë - menu @file_menu - - text "File" - underline "0" - }.pack("side"=>"left") - - self - end -end - - -# ²¼Éô¤Î¥Õ¥ì¡¼¥à¤Î¤¿¤á¤Î¥¯¥é¥¹ -class TkColorBotFrame<TkFrame - def initialize(parent) - super(parent, - "relief"=> "raised", - "borderwidth"=> 2) - - @commandLabel = TkLabel.new(self, - "text"=> "Command:") - @command = TkEntry.new(self, - "relief"=> "sunken", - "borderwidth"=> "2", - "textvariable"=> $command, - "font"=> "-Adobe-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*") - @update = TkButton.new(self, - "text"=> "Update", - "command"=> proc{doUpdate}) - @commandLabel.pack("side"=>"left") - @update.pack("side"=>"right","pady"=>".1c","padx"=>".25c") - @command.pack("expand"=>"yes","fill"=>"x","ipadx"=>".25c") - - self - end -end - - -# ÃæÃʺ¸¤Î¥Õ¥ì¡¼¥à -class TkColorMiddleLeftFrame<TkFrame - def initialize(parent) - super(parent) - - for i in ["/usr/local/lib/X11rgb.txt","/usr/lib/X11/rgb.txt", - "/X11/R5/lib/X11/rgb.txt","/X11/R4/lib/rgb/rgb.txt", - "/usr/openwin/lib/X11/rgb.txt"] - if !File.readable?(i) - next - end - f = File.open(i) - @scroll = TkScrollbar.new(self, - "orient"=>"vertical", - "relief"=>"sunken", - "borderwidth"=>"2") - @scroll.pack("side"=>"right","fill"=>"y") - @names = TkListbox.new(self, - "width"=>"20", - "height"=>"12", - "yscrollcommand"=> proc{|first,last| @scroll.set first,last}, - "relief"=>"sunken", - "borderwidth"=>"2", - "exportselection"=>"false") - @scroll.command(proc{|*args| @names.yview(*args)}) - @names.bind("Double-1",proc{ - tc_loadNamedColor(@names.get(@names.curselection))}) - @names.pack("side"=>"left") - while (line = f.gets) - line.chop! - linelist = line.split(/[ \t]+/) - if linelist.length == 4 - @names.insert("end",linelist[3]) - end - end - f.close - break - end - - self - end -end - - -# ÃæÃÊÃæ±û¤Î¥Õ¥ì¡¼¥à -class TkColorMiddleMiddleFrame<TkFrame - # @scale1,@scale2,@scale3¤ò³°Éô¤«¤é»²¾È¤Î¤ßµö²Ä¤¹¤ë¡£(Êѹ¹ÉÔ²Ä) - attr_reader :scale1, :scale2, :scale3 - - def initialize(parent) - super(parent) - - @f1 = TkFrame.new(self) - @f2 = TkFrame.new(self) - @f3 = TkFrame.new(self) - @f4 = TkFrame.new(self) - - for f in [@f1,@f2,@f3] - f.pack("side"=>"top","expand"=>"yes") - end - @f4.pack("side"=>"top","expand"=>"yes","fill"=>"x") - - @label1 = TkLabel.new(self,"textvariable"=>$label1) - @scale1 = TkScale.new(self,"from"=>"0","to"=>"1000","length"=>"6c", - "orient"=>"horizontal", - "command"=>proc{tc_scaleChanged}) - @scale1.pack("side"=>"top","anchor"=>"w") - @label1.pack("side"=>"top","anchor"=>"w") - - @label2 = TkLabel.new(self,"textvariable"=>$label2) - @scale2 = TkScale.new(self,"from"=>"0","to"=>"1000","length"=>"6c", - "orient"=>"horizontal", - "command"=>proc{tc_scaleChanged}) - @scale2.pack("side"=>"top","anchor"=>"w") - @label2.pack("side"=>"top","anchor"=>"w") - - @label3 = TkLabel.new(self,"textvariable"=>$label3) - @scale3 = TkScale.new(self,"from"=>"0","to"=>"1000","length"=>"6c", - "orient"=>"horizontal", - "command"=>proc{tc_scaleChanged}) - @scale3.pack("side"=>"top","anchor"=>"w") - @label3.pack("side"=>"top","anchor"=>"w") - - @nameLabel = TkLabel.new(self,"text"=>"Name:") - @name = TkEntry.new(self,"relief"=>"sunken","borderwidth"=>"2", - "textvariable"=>$name,"width"=>"10", - "font"=>"-Adobe-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*") - @nameLabel.pack("side"=>"left") - @name.pack("side"=>"right", "expand"=>"1", "fill"=>"x") - @name.bind("Return",proc{tc_loadNamedColor $name.to_s}) - - self - end -end - - -class TkColorMiddleRightFrame<TkFrame - attr_reader :swatch - - def initialize(parent) - super(parent) - @swatch = TkFrame.new(self, "width"=>"2c", "height"=>"5c", - "background"=>$color) - @value = TkLabel.new(self, - "text"=>$color, - "width"=>"13", - "font"=>"-Adobe-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*") - @swatch.pack("side"=>"top","expand"=>"yes","fill"=>"both") - @value.pack("side"=>"bottom","pady"=>".25c") - - self - end - - def set_color(color) - @swatch["background"] = color - @value["text"] = color - end -end - - - -# ÃæÃʤΥե졼¥à -class TkColorMiddleFrame<TkFrame - attr_reader :left, :middle, :right - - def initialize(parent) - super(parent, - "relief"=> "raised", - "borderwidth"=> "2") - - @left = TkColorMiddleLeftFrame.new(self) - @left.pack("side"=>"left","padx"=>".25c","pady"=>".25c") - - @middle = TkColorMiddleMiddleFrame.new(self) - @middle.pack("side"=>"left","expand"=>"yes","fill"=>"y") - - @right = TkColorMiddleRightFrame.new(self) - @right.pack("side"=>"left","padx"=>".25c","pady"=>".25c","anchor"=>"s") - - self - end -end - - -class TkColor<TkRoot - attr_reader :menu, :bottom, :middle - - def initialize(*args) - super(*args) - @menu = TkColorMenuFrame.new(self) - @menu.pack("side"=>"top", "fill"=>"x") - - @bottom = TkColorBotFrame.new(self) - @bottom.pack("side"=>"bottom","fill"=>"x") - - @middle = TkColorMiddleFrame.new(self) - @middle.pack("side"=>"top","fill"=>"both") - - self - end -end - - -$root = TkColor.new - -# ¥¤¥Ù¥ó¥È¤òÂԤİ٤˥롼¥×¤ËÆþ¤ë¡£ -changeColorSpace :rgb -Tk.mainloop diff --git a/ext/tk/sample/demos-jp/text.rb b/ext/tk/sample/demos-jp/text.rb deleted file mode 100644 index 179589d820..0000000000 --- a/ext/tk/sample/demos-jp/text.rb +++ /dev/null @@ -1,116 +0,0 @@ -# -# text (basic facilities) widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($text_demo) && $text_demo - $text_demo.destroy - $text_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$text_demo = TkToplevel.new {|w| - title("Text Demonstration - Basic Facilities") - iconname("text") - positionWindow(w) -} - -# version check -if ((Tk::TK_VERSION.split('.').collect{|n| n.to_i} <=> [8,4]) < 0) - undo_support = false -else - undo_support = true -end - -# frame À¸À® -TkFrame.new($text_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $text_demo - $text_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'text'} - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# text À¸À® -TkText.new($text_demo){|t| - # À¸À® - relief 'sunken' - bd 2 - setgrid 1 - height 30 - TkScrollbar.new($text_demo) {|s| - pack('side'=>'right', 'fill'=>'y') - command proc{|*args| t.yview(*args)} - t.yscrollcommand proc{|first,last| s.set first,last} - } - pack('expand'=>'yes', 'fill'=>'both') - - # ¥Æ¥¥¹¥ÈÁÞÆþ - insert('0.0', <<EOT) -¤³¤Î¥¦¥£¥ó¥É¥¦¤Ï¥Æ¥¥¹¥È widget ¤Ç¤¹¡£1¹Ô¤Þ¤¿¤Ï¤½¤ì°Ê¾å¤Î¥Æ¥¥¹¥È¤òɽ -¼¨¡¦ÊÔ½¸¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£°Ê²¼¤Ï¥Æ¥¥¹¥È widget ¤Ç¤Ç¤¤ëÁàºî¤Ë¤Ä¤¤¤Æ -¤Þ¤È¤á¤¿¤â¤Î¤Ç¤¹¡£ - -1. ¥¹¥¯¥í¡¼¥ë¡£¥¹¥¯¥í¡¼¥ë¥Ð¡¼¤Ç¥Æ¥¥¹¥È¤Îɽ¼¨Éôʬ¤òư¤«¤¹¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ - -2. ¥¹¥¥ã¥Ë¥ó¥°¡£¥Æ¥¥¹¥È¤Î¥¦¥£¥ó¥É¥¦¤Ç¥Þ¥¦¥¹¥Ü¥¿¥ó2 (Ãæ¥Ü¥¿¥ó¤ò) ¤ò²¡ -¤·¤Æ¾å²¼¤Ë¥É¥é¥Ã¥°¤·¤Æ¤¯¤À¤µ¤¤¡£¤½¤¦¤¹¤ë¤È¥Æ¥¥¹¥È¤¬¹â®¤Ç¥É¥é¥Ã¥°¤µ¤ì¡¢ -ÆâÍÆ¤ò¤¶¤Ã¤Èį¤á¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ - -3. ¥Æ¥¥¹¥È¤ÎÁÞÆþ¡£¥Þ¥¦¥¹¥Ü¥¿¥ó1 (º¸¥Ü¥¿¥ó) ¤ò²¡¤·¡¢ÁÞÆþ¥«¡¼¥½¥ë¤ò¥»¥Ã -¥È¤·¤Æ¤«¤é¥Æ¥¥¹¥È¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£ÆþÎϤ·¤¿¤â¤Î¤¬ widget ¤ËÆþ¤ê¤Þ¤¹¡£ - -4. ÁªÂò¡£¤¢¤ëÈϰϤÎʸ»ú¤òÁªÂò¤¹¤ë¤Ë¤Ï¥Þ¥¦¥¹¥Ü¥¿¥ó1 ¤ò²¡¤·¡¢¥É¥é¥Ã¥°¤· -¤Æ¤¯¤À¤µ¤¤¡£°ìÅ٥ܥ¿¥ó¤òÎ¥¤·¤¿¤é¡¢¥·¥Õ¥È¥¡¼¤ò²¡¤·¤Ê¤¬¤é¥Ü¥¿¥ó1 ¤ò²¡¤¹ -¤³¤È¤ÇÁªÂòÈϰϤÎÄ´À°¤¬¤Ç¤¤Þ¤¹¡£¤³¤ì¤ÏÁªÂòÈϰϤκǸå¤ò¥Þ¥¦¥¹¥«¡¼¥½¥ë¤Ë -ºÇ¤â¶á¤¤°ÌÃ֤˥ꥻ¥Ã¥È¤·¡¢¥Ü¥¿¥ó¤òÎ¥¤¹Á°¤Ë¥Þ¥¦¥¹¤ò¥É¥é¥Ã¥°¤¹¤ë¤³¤È¤Ç¤µ -¤é¤ËÁªÂòÈϰϤòÄ´À°¤Ç¤¤Þ¤¹¡£¥À¥Ö¥ë¥¯¥ê¥Ã¥¯¤Ç¥ï¡¼¥É¤ò¡¢¤Þ¤¿¥È¥ê¥×¥ë¥¯¥ê¥Ã -¥¯¤Ç¹ÔÁ´ÂΤòÁªÂò¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ - -5. ¾Ãµî¤ÈÃÖ´¹¡£¥Æ¥¥¹¥È¤ò¾Ãµî¤¹¤ë¤Ë¤Ï¡¢¾Ãµî¤·¤¿¤¤Ê¸»ú¤òÁªÂò¤·¤Æ¥Ð¥Ã¥¯ -¥¹¥Ú¡¼¥¹¤«¥Ç¥ê¡¼¥È¥¡¼¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£¤¢¤ë¤¤¤Ï¡¢¿·¤·¤¤¥Æ¥¥¹¥È¤ò -ÆþÎϤ¹¤ë¤ÈÁªÂò¤µ¤ì¤¿¥Æ¥¥¹¥È¤ÈÃÖ´¹¤µ¤ì¤Þ¤¹¡£ - -6. ÁªÂòÉôʬ¤Î¥³¥Ô¡¼¡£ÁªÂòÉôʬ¤ò¤³¤Î¥¦¥£¥ó¥É¥¦¤ÎÃæ¤Î¤É¤³¤«¤Ë¥³¥Ô¡¼¤¹¤ë -¤Ë¤Ï¡¢¤Þ¤º¥³¥Ô¡¼¤·¤¿¤¤½ê¤òÁªÂò(¤³¤³¤Ç¡¢¤¢¤ë¤¤¤ÏÊ̤Υ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç) -¤·¡¢¥Ü¥¿¥ó 2 ¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¡¢ÁÞÆþ¥«¡¼¥½¥ë¤Î°ÌÃ֤˥³¥Ô¡¼¤·¤Æ¤¯¤À¤µ¤¤¡£ - -7. ÊÔ½¸¡£¥Æ¥¥¹¥È widget ¤Ï Emacs ¤Î¥¡¼¥Ð¥¤¥ó¥É¤Ë²Ã¤¨¤ÆÉ¸½àŪ¤Ê¤Î Motif -¤ÎÊÔ½¸µ¡Ç½¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤¹¡£¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤È¥³¥ó¥È¥í¡¼¥ë-H ¤ÏÁÞÆþ -¥«¡¼¥½¥ë¤Îº¸Â¦¤Îʸ»ú¤òºï½ü¤·¤Þ¤¹¡£¥Ç¥ê¡¼¥È¥¡¼¤È¥³¥ó¥È¥í¡¼¥ë-D ¤ÏÁÞÆþ -¥«¡¼¥½¥ë¤Î±¦Â¦¤Îʸ»ú¤òºï½ü¤·¤Þ¤¹¡£Meta-¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤ÏÁÞÆþ¥«¡¼¥½¥ë¤Î -±¦Â¦¤Îñ¸ì¤òºï½ü¤·¡¢Meta-D ¤ÏÁÞÆþ¥«¡¼¥½¥ë¤Îº¸Â¦¤Îñ¸ì¤òºï½ü¤·¤Þ¤¹¡£ -¥³¥ó¥È¥í¡¼¥ë-K ¤ÏÁÞÆþ¥«¡¼¥½¥ë¤«¤é¹ÔËö¤Þ¤Ç¤òºï½ü¤·¡¢¤½¤Î°ÌÃ֤˲þ¹Ô -¤·¤«¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢²þ¹Ô¤òºï½ü¤·¤Þ¤¹¡£#{ - if undo_support - undo_text = "Control-z ¤ÏºÇ¸å¤Ë¹Ô¤Ã¤¿Êѹ¹¤Î¼è¤ê¾Ã¤·(undo)¤ò¹Ô¤¤¡¢" - case $tk_platform['platform'] - when "unix", "macintosh" - undo_text << "Control-Shift-z" - else # 'windows' - undo_text << "Control-y" - end - undo_text << "¤Ïundo¤·¤¿Êѹ¹¤ÎºÆÅ¬ÍÑ(redo)¤ò¹Ô¤¤¤Þ¤¹¡£" - else - "" - end -} - - -8. ¥¦¥£¥ó¥É¥¦¤Î¥ê¥µ¥¤¥º¡£¤³¤Î widget ¤Ï "setGrid" ¥ª¥×¥·¥ç¥ó¤ò¥ª¥ó¤Ë¤· -¤Æ¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¥¦¥£¥ó¥É¥¦¤ò¥ê¥µ¥¤¥º¤¹¤ë»þ¤Ë¤Ï¹â¤µ¤ÈÉý¤Ï¾ï¤Ëʸ»ú¹â¤Èʸ -»úÉý¤ÎÀ°¿ôÇܤˤʤê¤Þ¤¹¡£¤Þ¤¿¡¢¥¦¥£¥ó¥É¥¦¤ò¶¹¤¯¤·¤¿¾ì¹ç¤Ë¤ÏŤ¤¹Ô¤¬¼«Æ° -Ū¤ËÀÞ¤êÊÖ¤µ¤ì¡¢¾ï¤ËÁ´¤Æ¤ÎÆâÍÆ¤¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ -EOT - - set_insert('0.0') -} - diff --git a/ext/tk/sample/demos-jp/timer b/ext/tk/sample/demos-jp/timer deleted file mode 100644 index 58a41d00c0..0000000000 --- a/ext/tk/sample/demos-jp/timer +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env ruby -# -# timer -- -# This script generates a counter with start,stop and reset buttons. -# -# Copyright (C) 1998 Takaaki Tateishi (ttate@jaist.ac.jp) -# last update: Sat Jun 27 12:24:14 JST 1998 -# - -require "tk" -require "thread" -require "tkafter" - -$time = "0.00" -$m = Mutex.new -$loop = false - -def timer_stop - $loop = false - $m.lock -end - -def timer_start - $loop = true - $m.unlock -end - -def timer_reset - $time = "0.00" - $root.countframe.counter['text'] = $time -end - -def timer_loop - if $loop - $time = $time.succ - $root.countframe.counter['text'] = $time - end - Tk.after(10,proc{timer_loop}) -end - - -# -# thread version -# -def timer_loop2 - while true - $m.lock - $time = $time.succ - $root.countframe.counter['text'] = $time - sleep(0.01) - $m.unlock - end -end - -# -# TkAfter -# -def timer_loop3 - if $loop - $time = $time.succ - $root.countframe.counter['text'] = $time - end -end - - -class CountFrame < TkFrame - attr_reader :counter - - def initialize(parent=nil,keys=nil) - super(parent,keys) - @counter = TkLabel.new(self, - 'text'=>$time, - 'relief'=>'raised') - @counter.pack('fill'=>'both') - self - end -end - - -class ButtonFrame < TkFrame - def initialize(parent=nil,keys=nil) - super(parent,keys) -=begin - @stop = TkButton.new(self, - 'text'=>'Stop', - 'command'=>proc{timer_stop}) - @start = TkButton.new(self, - 'text'=>'Start', - 'command'=>proc{timer_start}) -=end - @stop = TkButton.new(self, :text=>'Stop', :state=>:disabled) - @start = TkButton.new(self, :text=>'Start', :state=>:normal) - - @stop.command proc{ - timer_stop - @start.state(:normal) - @stop.state(:disabled) - } - @start.command proc{ - timer_start - @stop.state(:normal) - @start.state(:disabled) - } - - @reset = TkButton.new(self, - 'text'=>'Reset', - 'command'=>proc{timer_reset}) - for b in [@stop,@start,@reset] - b.pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes') - end - end -end - - -class Timer < TkRoot - attr_reader :countframe - - def initialize(*args) - super(*args) - @countframe = CountFrame.new(self) - @buttonframe = ButtonFrame.new(self) - for f in [@buttonframe,@countframe] - f.pack('side'=>'top', 'fill'=>'both') - end - self - end -end - - -$root = Timer.new - -#$thread = Thread.start{timer_loop2} -#timer_loop -TkAfter.new(10,-1,proc{timer_loop3}).start - -Tk.mainloop diff --git a/ext/tk/sample/demos-jp/twind.rb b/ext/tk/sample/demos-jp/twind.rb deleted file mode 100644 index d35acd24d0..0000000000 --- a/ext/tk/sample/demos-jp/twind.rb +++ /dev/null @@ -1,284 +0,0 @@ -# -# text (embedded windows) widget demo (called by 'widget') -# - -# toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë -if defined?($twind_demo) && $twind_demo - $twind_demo.destroy - $twind_demo = nil -end - -# demo ÍѤΠtoplevel widget ¤òÀ¸À® -$twind_demo = TkToplevel.new {|w| - title("Text Demonstration - Embedded Windows") - iconname("Embedded Windows") - positionWindow(w) -} - -# frame À¸À® -$twind_buttons = TkFrame.new($twind_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc{ - tmppath = $twind_demo - $twind_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc{showCode 'twind'} - }.pack('side'=>'left', 'expand'=>'yes') -} -$twind_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -# frame À¸À® -$twind_text = nil -TkFrame.new($twind_demo, 'highlightthickness'=>2, 'borderwidth'=>2, - 'relief'=>'sunken') {|f| - $twind_text = TkText.new(f, 'setgrid'=>'true', 'font'=>$font, - 'width'=>'70', 'height'=>35, 'wrap'=>'word', - 'highlightthickness'=>0, 'borderwidth'=>0 ){|t| - TkScrollbar.new(f) {|s| - command proc{|*args| t.yview(*args)} - t.yscrollcommand proc{|first,last| s.set first,last} - }.pack('side'=>'right', 'fill'=>'y') - }.pack('expand'=>'yes', 'fill'=>'both') -}.pack('expand'=>'yes', 'fill'=>'both') - -# ¥¿¥°À¸À® -$tag_center = TkTextTag.new($twind_text, - 'justify' =>'center', - 'spacing1'=>'5m', - 'spacing3'=>'5m' ) -$tag_buttons = TkTextTag.new($twind_text, - 'lmargin1'=>'1c', - 'lmargin2'=>'1c', - 'rmargin' =>'1c', - 'spacing1'=>'3m', - 'spacing2'=>0, - 'spacing3'=>0 ) - -# ¥Æ¥¥¹¥È¤ÎÀ¸À® -$twind_text.insert('end', - '¥Æ¥¥¹¥Èwidget¾å¤Ë¾¤Îwidget¤òÁȤ߹þ¤à¤³¤È¤¬¤Ç¤¤Þ¤¹¡£') -$twind_text.insert('end', - 'ÁȤ߹þ¤ß¥¦¥£¥ó¥É¥¦¤È¸Æ¤Ð¤ì¡¢Ç¤°Õ¤Îwidget¤¬²Äǽ¤Ç¤¹¡£') -$twind_text.insert('end', - 'Î㤨¤Ð¡¢¤³¤³¤Ë2¤Ä¤Î¥Ü¥¿¥ówidget¤¬ÁȤ߹þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£') -$twind_text.insert('end', 'ºÇ½é¤Î¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤È¿åÊ¿Êý¸þ¤Î¥¹¥¯¥í¡¼¥ë¤ò') -TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - #text 'ON' - text '¥ª¥ó' - command proc{textWindOn $twind_text,$twind_buttons} - cursor 'top_left_arrow' - }) -$twind_text.insert('end', '¤Ë¤·¤Þ¤¹¡£¤Þ¤¿2¤Ä¤á¤Î¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È') -$twind_text.insert('end', '¿åÊ¿Êý¸þ¤Î¥¹¥¯¥í¡¼¥ë¤ò') -TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - #text 'OFF' - text '¥ª¥Õ' - command proc{textWindOff $twind_text} - cursor 'top_left_arrow' - }) -$twind_text.insert('end', '¤Ë¤·¤Þ¤¹¡£') - -$twind_text.insert('end', '¤â¤¦¤Ò¤È¤Ä¤ÎÎã¤Ç¤¹¡£') -TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - text '¤³¤³¤ò¥¯¥ê¥Ã¥¯' - command proc{textWindPlot $twind_text} - cursor 'top_left_arrow' - }) -$twind_text.insert('end', '¤¹¤ë¤È¡¢x-y¥×¥í¥Ã¥È¤¬¤³¤³¤Ë¸½¤ì¤Þ¤¹¡£') -$mark_plot = TkTextMark.new($twind_text, 'insert') -$mark_plot.gravity='left' -$twind_text.insert('end', '¥Þ¥¦¥¹¤Ç¥Ç¡¼¥¿¤òÉÁ²è¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£') -TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - text '¾Ãµî' - command proc{textWindDel $twind_text} - cursor 'top_left_arrow' - }) -$twind_text.insert('end', '¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¸µ¤ËÌá¤ê¤Þ¤¹¡£ - -') - -$twind_text.insert('end', 'ÁȤ߹þ¤ß¥¦¥£¥ó¥É¥¦¤À¤±¤ò¥Æ¥¥¹¥Èwidget¾å¤Ë¡¢¼ÂºÝ¤Î') -$twind_text.insert('end', '¥Æ¥¥¹¥È¤Ï¤Ê¤·¤ÇÁȤ߹þ¤à¤³¤È¤ÏÊØÍø¤Ç¤¹¡£') -$twind_text.insert('end', '¤³¤Î¾ì¹ç¤Ï¡¢¥Æ¥¥¹¥Èwidget¤Ï¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¤Î') -$twind_text.insert('end', '¤è¤¦¤Ëưºî¤·¤Þ¤¹¡£Î㤨¤Ð¡¢¤³¤³¤Ë¤Ï¥Æ¥¥¹¥Èwidget¤Ë') -$twind_text.insert('end', '¤è¤Ã¤Æ¥Ü¥¿¥ó¤¬¤¤ì¤¤¤Ëʤ٤é¤ì¤Æ¤¤¤Þ¤¹¡£') -$twind_text.insert('end', '¤³¤ì¤é¤Î¥Ü¥¿¥ó¤ÇÇØ·Ê¿§¤òÊѤ¨¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹') -$twind_text.insert('end', '("Default"¤Ç¸µ¤Î¿§¤ËÌ᤹¤³¤È¤¬¤Ç¤¤Þ¤¹)¡£') -$twind_text.insert('end', '"Short"¤È¤¤¤¦¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤Èʸ»úÎó¤ÎŤµ¤¬') -$twind_text.insert('end', 'ÊѤï¤ê¤Þ¤¹¡£¤¹¤ë¤È¼«Æ°Åª¤Ë¥Æ¥¥¹¥Èwidget¤¬') -$twind_text.insert('end', '¥ì¥¤¥¢¥¦¥È¤òÀ°¤¨¤Æ¤¯¤ì¤Þ¤¹¡£') -$twind_text.insert('end', '¤â¤¦°ìÅÙÆ±¤¸¥Ü¥¿¥ó¤ò²¡¤¹¤È¸µ¤ËÌá¤ê¤Þ¤¹¡£ - -') - -TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) {|b| - text '¥Ç¥Õ¥©¥ë¥È' - command proc{embDefBg $twind_text} - cursor 'top_left_arrow' - $tag_buttons.add('end') - }, - 'padx'=>3 ) -embToggle = TkVariable.new('Short') -TkTextWindow.new($twind_text, 'end', - 'window'=>TkCheckButton.new($twind_text) { - textvariable embToggle - indicatoron 0 - variable embToggle - onvalue 'A much longer string' - offvalue 'Short' - cursor 'top_left_arrow' - pady 5 - padx 2 - }, - 'padx'=>3, - 'pady'=>2 ) - -[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4', - 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1', - 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1', - 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4' -].each{|twind_color| - TkTextWindow.new($twind_text, 'end', - 'window'=>TkButton.new($twind_text) { - text twind_color - cursor 'top_left_arrow' - command proc{$twind_text.bg twind_color} - }, - 'padx'=>3, - 'pady'=>2 ) -} - -# ¥á¥½¥Ã¥ÉÄêµÁ -def textWindOn (w,f) - if defined? $twind_scroll - begin - $twind_scroll.destroy - rescue - end - $twind_scroll = nil - end - - base = TkWinfo.parent( TkWinfo.parent(w) ) - $twind_scroll = TkScrollbar.new(base) {|s| - orient 'horizontal' - command proc{|*args| w.xview(*args)} - w.xscrollcommand proc{|first,last| s.set first,last} - w.wrap 'none' - pack('after'=>f, 'side'=>'bottom', 'fill'=>'x') - } - - return nil -end - -def textWindOff (w) - if defined? $twind_scroll - begin - $twind_scroll.destroy - rescue - end - $twind_scroll = nil - end - w.xscrollcommand '' - w.wrap 'word' -end - -def textWindPlot (t) - if (defined? $twind_plot) && (TkWinfo.exist?($twind_plot)) - return - end - - $twind_plot = TkCanvas.new(t) { - relief 'sunken' - width 450 - height 300 - cursor 'top_left_arrow' - } - - font = '-Adobe-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*' - - TkcLine.new($twind_plot, 100, 250, 400, 250, 'width'=>2) - TkcLine.new($twind_plot, 100, 250, 100, 50, 'width'=>2) - TkcText.new($twind_plot, 225, 20, - 'text'=>"A Simple Plot", 'font'=>font, 'fill'=>'brown') - - (0..10).each {|i| - x = 100 + (i * 30) - TkcLine.new($twind_plot, x, 250, x, 245, 'width'=>2) - TkcText.new($twind_plot, x, 254, - 'text'=>10*i, 'font'=>font, 'anchor'=>'n') - } - (0..5).each {|i| - y = 250 - (i * 40) - TkcLine.new($twind_plot, 100, y, 105, y, 'width'=>2) - TkcText.new($twind_plot, 96, y, - 'text'=>"#{i*50}.0", 'font'=>font, 'anchor'=>'e') - } - - for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]] - x = 100 + (3*xx) - y = 250 - (4*yy)/5 - item = TkcOval.new($twind_plot, x-6, y-6, x+6, y+6, - 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') - item.addtag 'point' - end - - $twind_plot.itembind('point', 'Any-Enter', - proc{$twind_plot.itemconfigure 'current', 'fill', 'red'}) - $twind_plot.itembind('point', 'Any-Leave', - proc{$twind_plot.itemconfigure 'current', 'fill', 'SkyBlue2'}) - $twind_plot.itembind('point', '1', - proc{|x,y| embPlotDown $twind_plot,x,y}, "%x %y") - $twind_plot.itembind('point', 'ButtonRelease-1', - proc{$twind_plot.dtag 'selected'}) - $twind_plot.bind('B1-Motion', - proc{|x,y| embPlotMove $twind_plot,x,y}, "%x %y") - while ($twind_text.get($mark_plot) =~ /[ \t\n]/) - $twind_text.delete $mark_plot - end - $twind_text.insert $mark_plot,"\n" - TkTextWindow.new($twind_text, $mark_plot, 'window'=>$twind_plot) - $tag_center.add $mark_plot - $twind_text.insert $mark_plot,"\n" -end - -$embPlot = {'lastX'=>0, 'lastY'=>0} - -def embPlotDown (w, x, y) - w.dtag 'selected' - w.addtag_withtag 'selected', 'current' - w.raise 'current' - $embPlot['lastX'] = x - $embPlot['lastY'] = y -end - -def embPlotMove (w, x, y) - w.move 'selected', x - $embPlot['lastX'], y - $embPlot['lastY'] - $embPlot['lastX'] = x - $embPlot['lastY'] = y -end - -def textWindDel (w) - if (defined? $twind_text) && TkWinfo.exist?($twind_plot) - $twind_text.delete $twind_plot - $twind_plot = nil - while ($twind_text.get($mark_plot) =~ /[ \t\n]/) - $twind_text.delete $mark_plot - end - $twind_text.insert $mark_plot," " - end -end - -def embDefBg (w) - w['background'] = w.configinfo('background')[3] -end diff --git a/ext/tk/sample/demos-jp/unicodeout.rb b/ext/tk/sample/demos-jp/unicodeout.rb deleted file mode 100644 index d408a36aae..0000000000 --- a/ext/tk/sample/demos-jp/unicodeout.rb +++ /dev/null @@ -1,115 +0,0 @@ -# unicodeout.rb -- -# -# This demonstration script shows how you can produce output (in label -# widgets) using many different alphabets. -# -# based on Tcl/Tk8.4.4 widget demos - -if defined?($unicodeout_demo) && $unicodeout_demo - $unicodeout_demo.destroy - $unicodeout_demo = nil -end - -$unicodeout_demo = TkToplevel.new {|w| - title("Unicode Label Demonstration") - iconname("unicodeout") - positionWindow(w) -} - -TkLabel.new($unicodeout_demo, - :font=>$font, :wraplength=>'5.4i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) -¤³¤ì¤Ï¡¤Tk¤Ë¤ª¤±¤ëÈó²¤ÊÆÊ¸»ú½¸¹ç¤òÍѤ¤¤ë¸À¸ì¤ËÂФ¹¤ë¥µ¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¤Î\ -¥µ¥ó¥×¥ë¤Ç¤¹¡¥¤¿¤À¤·¡¤²¼¤Îɽ¼¨¤Ë¤ª¤¤¤Æ¤¢¤Ê¤¿¤¬¼ÂºÝ¤Ë¤É¤Î¤è¤¦¤Êɽ¼¨¤ò\ -Ìܤˤ¹¤ë¤«¤Ï¡¤¤¢¤Ê¤¿¤Î´Ä¶¤Ë¤É¤Î¤è¤¦¤Êʸ»ú½¸¹ç¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¤«¤Ë\ -Â礤¯°Í¸¤·¤Þ¤¹¡¥¤Þ¤¿¡¤ÂоݤȤʤëʸ»ú½¸¹ç¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë\ -¤É¤Î¤è¤¦¤Êɽ¼¨¤¬¤Ê¤µ¤ì¤ë¤«¤â¤¢¤Ê¤¿¤Î´Ä¶¼¡Âè¤Ç¤¹¡¥\ -¡Ö¥³¡¼¥É»²¾È¡×¥Ü¥¿¥ó¤ò²¡¤·¤Æ¥½¡¼¥¹¤òɽ¼¨¤·¡¤\ -Unicodeout_SampleFrame¥¯¥é¥¹¤Î@@font¤ÎÄêµÁ¤ò½ñ¤´¹¤¨¤Æ\ -(¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤ÏÊѹ¹¤µ¤ì¤Þ¤»¤ó)\ -¡ÖºÆ¼Â¹Ô¡×¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ò»î¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡¥ -¥¹¥¯¥ê¥×¥È¤¬²ÄÈÂÀ¤ò»ý¤Ä¤è¤¦¤Ë¡¤Ê¸»úÎó¤Ï\\uXXXX¤È¤¤¤¦\ -Tcl¤Î¥¨¥¹¥±¡¼¥×ɽ¸½¤òÍѤ¤¤¿UNICODEʸ»úÎó¤Ç½ñ¤«¤ì¤Æ¤¤¤Þ¤¹¡¥\ -ʸ»úÎó¤Ï¡¤Tk::UTF8_String¥á¥½¥Ã¥É¤Ë¤è¤Ã¤Æ¡¤\ -¡ÖUTF8·Á¼°¤Îʸ»úÎó¤Ç¤¢¤ë¡×¤È¤¤¤¦\ -¥¨¥ó¥³¡¼¥É¾ðÊóÉÕ¤¤Îʸ»úÎ󥪥֥¸¥§¥¯¥È\ -(Tcl¤Î¥¨¥¹¥±¡¼¥×ɽ¸½¤ÎÊÑ´¹ºÑ¤ß)¤ËÊÑ´¹¤·¤Æ\ -¥é¥Ù¥ë¥¦¥£¥¸¥§¥Ã¥È¤ËÅϤ·¤Æ¤¤¤ëÅÀ¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡¥ -EOL -#' - -TkFrame.new($unicodeout_demo){|f| - pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - - TkButton.new(f, :text=>'λ²ò', :width=>15, :command=>proc{ - $unicodeout_demo.destroy - $unicodeout_demo = nil - }).pack(:side=>:left, :expand=>true) - - TkButton.new(f, :text=>'¥³¡¼¥É»²¾È', :width=>15, :command=>proc{ - showCode 'unicodeout' - }).pack(:side=>:left, :expand=>true) -} - -wait_msg = TkLabel.new($unicodeout_demo, - :text=>"¥Õ¥©¥ó¥ÈÆÉ¤ß¹þ¤ß¤Î´°Î»¤Þ¤Ç" + - "¤·¤Ð¤é¤¯¤ªÂÔ¤Á²¼¤µ¤¤¡¥¡¥¡¥", - :font=>"Helvetica 12 italic").pack - -class Unicodeout_SampleFrame < TkFrame - @@font = $font - # @@font = 'Helvetica 14' - # @@font = 'Courier 12' - # @@font = 'clearlyu 16' - # @@font = 'fixed 12' - # @@font = 'Times 12' - # @@font = 'Newspaper 12' - # @@font = '{New century schoolbook} 12' - - def initialize() - super($unicodeout_demo) - grid_columnconfig(1, :weight=>1) - end - - def add_sample(lang, *args) - sample_txt = Tk::UTF8_String(args.join('')) - l = TkLabel.new(self, :font=>@@font, :text=>lang+':', - :anchor=>:nw, :pady=>0) - #s = TkLabel.new(self, :font=>@@font, :text=>sample_txt, - s = TkLabel.new(self, :font=>TkFont.new(@@font), :text=>sample_txt, - :anchor=>:nw, :width=>30, :pady=>0) - Tk.grid(l, s, :sticky=>:ew, :pady=>0) - l.grid_config(:padx, '1m') - end -end -f = Unicodeout_SampleFrame.new -f.pack(:expand=>true, :fill=>:both, :padx=>'2m', :pady=>'1m') - -# Processing when some characters are missing might take a while, so make -# sure we're displaying something in the meantime... - -oldCursor = $unicodeout_demo.cursor -$unicodeout_demo.cursor('watch') -Tk.update - -f.add_sample('Arabic', - '\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D\uFE94', - '\uFEE4\uFEE0\uFEDC\uFEDF\uFE8D') -f.add_sample('Trad. Chinese', '\u4E2D\u570B\u7684\u6F22\u5B57') -f.add_sample('Simpl. Chinese', '\u6C49\u8BED') -f.add_sample('Greek', - '\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE ', - '\u03B3\u03BB\u03CE\u03C3\u03C3\u03B1') -f.add_sample('Hebrew', - '\u05DD\u05D9\u05DC\u05E9\u05D5\u05E8\u05D9 ', - '\u05DC\u05D9\u05D0\u05E8\u05E9\u05D9') -f.add_sample('Japanese', - '\u65E5\u672C\u8A9E\u306E\u3072\u3089\u304C\u306A, ', - '\u6F22\u5B57\u3068\u30AB\u30BF\u30AB\u30CA') -f.add_sample('Korean', '\uB300\uD55C\uBBFC\uAD6D\uC758 \uD55C\uAE00') -f.add_sample('Russian', - '\u0420\u0443\u0441\u0441\u043A\u0438\u0439 ', - '\u044F\u0437\u044B\u043A') - -wait_msg.destroy -$unicodeout_demo.cursor(oldCursor) diff --git a/ext/tk/sample/demos-jp/vscale.rb b/ext/tk/sample/demos-jp/vscale.rb deleted file mode 100644 index 4cb8e0f6b7..0000000000 --- a/ext/tk/sample/demos-jp/vscale.rb +++ /dev/null @@ -1,77 +0,0 @@ -require "tkcanvas" - -if defined?($vscale_demo) && $vscale_demo - $vscale_demo.destroy - $vscale_demo = nil -end - -$vscale_demo = TkToplevel.new {|w| - title("Vertical Scale Demonstration") - iconname("vscale") -} -positionWindow($vscale_demo) - -msg = TkLabel.new($vscale_demo) { - font $font - wraplength '3.5i' - justify 'left' -# text "²¼¤Ë¤ÏÌð°õ¤¬1¤Ä¤È¾èľ¤Ê¥¹¥±¡¼¥ë¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\ -#¥¹¥±¡¼¥ë¾å¤Ç¥Þ¥¦¥¹¥Ü¥¿¥ó1¤ò¥¯¥ê¥Ã¥¯¡¢¤Þ¤¿¤Ï¥É¥é¥Ã¥°¤¹¤ë¤È\ -#Ìð°õ¤ÎŤµ¤òÊѤ¨¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£" - text "¤Ë¤Ï¥Ð¡¼¤È½Ä·¿¤Î¥¹¥±¡¼¥ë¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¥¹¥±¡¼¥ë¤Ç¥Þ¥¦¥¹¤Î¥Ü¥¿¥ó1 ¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤«¥É¥é¥Ã¥°¤·¤Æ¥Ð¡¼¤Î¹â¤µ¤òÊѤ¨¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£½ª¤Ã¤¿¤é¡Öλ²ò¡×¥Ü¥¿¥ó¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£" -} -msg.pack('side'=>'top', 'padx'=>'.5c') - -TkFrame.new($vscale_demo) {|frame| - TkButton.new(frame) { - text 'λ²ò' - command proc { - tmppath = $vscale_demo - $vscale_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text '¥³¡¼¥É»²¾È' - command proc { showCode 'vscale' } - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -TkFrame.new($vscale_demo) {|frame| - borderwidth 10 - canvas = TkCanvas.new(frame) {|c| - width 50 - height 50 - bd 0 - highlightthickness 0 - TkcPolygon.new(c, 0, 0, 1, 1, 2, 2) { - fill 'SeaGreen3' - tags 'poly' - } - TkcLine.new(c, 0, 0, 1, 1, 2, 2, 0, 0) { - fill 'black' - tags 'line' - } - }.pack('side'=>'left', 'anchor'=>'nw', 'fill'=>'y') - scale = TkScale.new(frame) { - orient 'vertical' - length 284 - from 0 - to 250 - command proc{|value| setHeight(canvas, value)} - tickinterval 50 - }.pack('side'=>'left', 'anchor'=>'ne') - scale.set 75 -}.pack - - -def setHeight(w, height) - height = height + 21 - y2 = height - 30 - if y2 < 21 - y2 = 21 - end - w.coords 'poly',15,20,35,20,35,y2,45,y2,25,height,5,y2,15,y2,15,20 - w.coords 'line',15,20,35,20,35,y2,45,y2,25,height,5,y2,15,y2,15,20 -end diff --git a/ext/tk/sample/demos-jp/widget b/ext/tk/sample/demos-jp/widget deleted file mode 100644 index 696a9073cc..0000000000 --- a/ext/tk/sample/demos-jp/widget +++ /dev/null @@ -1,542 +0,0 @@ -#!/usr/bin/env ruby - -# tk ´Ø·¸¥é¥¤¥Ö¥é¥ê¤ÎÆÉ¤ß¹þ¤ß -require 'tk' -require 'tkafter' - -# widget demo directory °ÌÃÖ¤Î³ÍÆÀ -$demo_dir = File.dirname($0) - -# root ¤ÎÀ¸À® -$root = TkRoot.new{title "Widget Demonstration"} - -# tk ¥Ð¡¼¥¸¥ç¥ó¤Î¼èÆÀ -$tk_version = Tk::TK_VERSION - -# tcl_platform ¾ðÊó¤Ø¤Î¥¢¥¯¥»¥¹¥ª¥Ö¥¸¥§¥¯¥È -$tk_platform = TkVarAccess.new('tcl_platform') - -# ¥Õ¥©¥ó¥ÈÀßÄê -$font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', nil) -knjfont = '-*-r-*--16-*-jisx0208.1983-0' -$kanji_font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', - knjfont) -TkOption.add('*kanjiFont', knjfont, 'startupFile') -$msg_kanji_font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', - '-*-r-*--24-*-jisx0208.1983-0') -####### -#case($tk_version) -#when /^4.*/ -# $font = '-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*' -# $kanji_font = '-*--16-*-jisx0208.1983-0' -# $msg_kanji_font = '-*--24-*-jisx0208.1983-0' -# $knjfont_opt = 'kanjifont' -# TkOption.add('*kanjiFont', $kanji_font, 'startupFile') -# -#when /^8.*/ -# Tk.tk_call('font', 'create', '@ascii', -# '-copy', '-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*') -# Tk.tk_call('font', 'create', '@kanji', -# '-copy', '-*--16-*-jisx0208.1983-0') -# Tk.tk_call('font', 'create', '@msg_knj', -# '-copy', '-*--24-*-jisx0208.1983-0') -# Tk.tk_call('font', 'create', '@cFont', '-compound', '@ascii @kanji') -# Tk.tk_call('font', 'create', '@cMsgFont', '-compound', '@ascii @msg_knj') -# $font = '-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*' -# $kanji_font = '@cFont' -# $msg_kanji_font = '@cMsgFont' -# $knjfont_opt = 'font' -#end -####### - -# ¥á¥Ë¥å¡¼ÀßÄê -TkMenubar.new($root, - [[['File', 0], - ['About ... ', proc{aboutBox}, 0, '<F1>'], - '---', - ['Quit', proc{exit}, 0, 'Meta-Q'] - ]]).pack('side'=>'top', 'fill'=>'x') -$root.bind('F1', proc{aboutBox}) - -=begin -TkFrame.new($root){|frame| - TkMenubutton.new(frame){|button| - m = TkMenu.new(button) { - add 'command', 'label'=>'Quit', 'command'=>proc{exit}, 'underline'=>0 - } - menu m - text 'File' - underline 0 - }.pack('side'=>'left') -}.pack('side'=>'top', 'fill'=>'x') -=end - -# ¥Æ¥¥¹¥È¥Ü¥Ã¥¯¥¹¤ÎÀ¸À® -if $tk_version =~ /^4\.[01]/ - scr = TkScrollbar.new($root, 'orient'=>'vertical') - txt = TkText.new($root) { - #wrap 'word' - wrap 'char' - width 60 - height 30 - font $font - setgrid 'yes' - yscrollcommand proc{|first,last| scr.set first,last} - } - scr.command(proc{|*args| txt.yview(*args)}) - scr.pack('side'=>'right', 'fill'=>'y') - txt.pack('expand'=>'yes', 'fill'=>'both') -else - textFrame = TkFrame.new($root) - scr = TkScrollbar.new($root, 'orient'=>'vertical', - 'highlightthickness'=>0, 'takefocus'=>1) { - pack('in'=>textFrame, 'side'=>'right', 'fill'=>'y', 'padx'=>1) - } - txt = TkText.new($root) { - #wrap 'word' - wrap 'char' - width 60 - height 30 - font $font - setgrid 'yes' - highlightthickness 0 - padx 4 - pady 2 - takefocus 0 - yscrollcommand proc{|first,last| scr.set first,last} - } - scr.command(proc{|*args| txt.yview(*args)}) -# txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both', 'padx'=>1) - txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both') -# textFrame.pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>2) - textFrame.pack('expand'=>'yes', 'fill'=>'both') - - statusBar = TkFrame.new($root) {|f| - $statusBarLabel = \ - TkLabel.new(f, 'text'=>" ", 'relief'=>'sunken', 'bd'=>1, 'anchor'=>'w', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*') \ - .pack('side'=>'left', 'padx'=>2, 'expand'=>'yes', 'fill'=>'both') - TkLabel.new(f, 'width'=>8, 'relief'=>'sunken', 'bd'=>1, 'anchor'=>'w', - 'font'=>'-*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*') \ - .pack('side'=>'left', 'padx'=>2) - }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2) -end - -# ¥Æ¥¥¹¥È¥¿¥°ÀßÄê -tag_title = TkTextTag.new(txt, 'font'=>'-*-Helvetica-Bold-R-Normal--*-180-*-*-*-*-*-*') -tag_kanji_title = TkTextTag.new(txt, 'kanjifont'=>$msg_kanji_font) -tag_middle = TkTextTag.new(txt, 'kanjifont'=>$kanji_font) -tag_demospace = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c') - -if TkWinfo.depth($root) == '1' - tag_demo = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c', - 'underline'=>1) - $tag_visited = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c', - 'underline'=>1) - tag_hot = TkTextTag.new(txt, 'background'=>'black', 'foreground'=>'white') -else - tag_demo = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c', - 'foreground'=>'blue', 'underline'=>1) - $tag_visited = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c', - 'foreground'=>'#303080', 'underline'=>1) -# tag_hot = TkTextTag.new(txt, 'relief'=>'raised', 'borderwidth'=>1, -# 'background'=>'SeaGreen3') - tag_hot = TkTextTag.new(txt, 'borderwidth'=>1, 'foreground'=>'red') -end - -#tag_demo.bind('Button-1', proc{invoke txt, txt.index('current')}) -tag_demo.bind('ButtonRelease-1', - proc{|x,y|invoke txt, txt.index("@#{x},#{y}")}, '%x %y') - -lastLine = TkVariable.new("") -newLine = TkVariable.new("") -tag_demo.bind('Enter', proc{|x,y| - lastLine.value = txt.index("@#{x},#{y} linestart") - tag_hot.add(lastLine.value, "#{lastLine.value} lineend") - showStatus txt, txt.index("@#{x},#{y}") - }, - '%x %y') -tag_demo.bind('Leave', - proc{ - tag_hot.remove('1.0','end') - txt.configure('cursor','xterm') - $statusBarLabel.configure('text'=>"") - }) -tag_demo.bind('Motion', proc{|x, y| - newLine.value = txt.index("@#{x},#{y} linestart") - if newLine.value != lastLine.value - tag_hot.remove('1.0','end') - lastLine.value = newLine.value - if ( txt.tag_names("@#{x},#{y}").find{|t| - t.kind_of?(String) && t =~ /^demo-/ - } ) - tag_hot.add(lastLine.value, - "#{lastLine.value} lineend -1 chars") - end - end - showStatus txt, txt.index("@#{x},#{y}") - }, - '%x %y') - -# ¥Æ¥¥¹¥ÈÀ¸À® -txt.insert('end', 'Ruby/Tk : Widget', tag_title) -#txt.insert('end', " ¥Ç¥â¥ó¥¹¥È¥ì¡¼¥·¥ç¥ó\n", tag_middle) -txt.insert('end', " ¥Ç¥â¥ó¥¹¥È¥ì¡¼¥·¥ç¥ó\n", tag_kanji_title) -txt.insert('end', <<"EOT") - -¤³¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢Tk Widget ¤òÍѤ¤¤Æ¤É¤Î¤è¤¦¤Ê¤³¤È¤¬¤Ç¤¤ë¤«\ -¤ò¼¨¤¹¤¿¤á¤Î¡¢¤¤¤¯¤Ä¤«¤Î¾®¤µ¤Ê¥¹¥¯¥ê¥×¥È¤ËÂФ¹¤ë¥Õ¥í¥ó¥È¥¨¥ó¥É¤òÄó\ -¶¡¤·¤Æ¤¤¤Þ¤¹¡£°Ê²¼¤Ë½çÈ֤˵󤲤é¤ì¤Æ¤¤¤ë¥Ç¥â¥ó¥¹¥È¥ì¡¼¥·¥ç¥ó¤ò¼Â¹Ô\ -¤¹¤ë¤Ë¤Ï¥Þ¥¦¥¹¤Ç¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£¥Ç¥â¥ó¥¹¥È¥ì¡¼¥·¥ç¥ó¤Î¥¦¥£¥ó\ -¥É¥¦¤¬¸½¤ì¤ë¤È¡¢¥Ç¥â¥ó¥¹¥È¥ì¡¼¥·¥ç¥ó¤òÀ¸À®¤·¤¿ Ruby/Tk ¤Î¥³¡¼¥É¤ò¸«\ -¤ë¤¿¤á¤Ë¡¢"¥³¡¼¥É»²¾È"¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£¤¢¤Ê¤¿¤¬\ -˾¤à¤Ê¤é¡¢¤½¤Î¥³¡¼¥É¤ò½¤Àµ¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£½¤Àµ¤·¤¿¥³¡¼¥É¤Ç¥Ç¥â\ -¥ó¥¹¥È¥ì¡¼¥·¥ç¥ó¤òºÆ¼Â¹Ô¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¥³¡¼¥É¤¬½ñ¤«¤ì¤¿¥¦¥£¥ó¥É¥¦¤Ë\ -¤¢¤ë"¥Ç¥âºÆ¼Â¹Ô" ¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£ - -°ìÉô¤Î¥Ç¥â¤Ç¤Ï¡¤Èæ³ÓŪºÇ¶á¤Î¥Ð¡¼¥¸¥ç¥ó¤Î Tk ¤Ç¤Ê¤±¤ì¤Ð¥µ¥Ý¡¼¥È¤·¤Æ\ -¤¤¤Ê¤¤µ¡Ç½¤ò»È¤Ã¤Æ¼ÂÁõ¤·¤Æ¤¤¤Þ¤¹(Î㤨¤Ð Tk8.4 °Ê¾å¤Ê¤É)¡¥¤½¤Î¤¿¤á¡¤\ -¤½¤¦¤·¤¿µ¡Ç½¤ò»ý¤¿¤Ê¤¤ Tk ¥é¥¤¥Ö¥é¥ê¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¤¤½¤¦¤·¤¿\ -¥Ç¥â¤ÏÀµ¤·¤¯Æ°¤¤Þ¤»¤ó¡¥¤½¤Î¤è¤¦¤Êµ¡Ç½¤¬É¬ÍפǤ¢¤ì¤Ð¡¤¤½¤ì¤ò¥µ¥Ý¡¼¥È\ -¤·¤Æ¤¤¤ë Tk ¥é¥¤¥Ö¥é¥ê¤ò»È¤¦¤è¤¦¤Ë¡¤tcltklib ¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤Ê¤ª¤·¤Æ\ -¤¯¤À¤µ¤¤¡¥ - - -EOT - -#txt.insert('end',"¥é¥Ù¥ë, ¥Ü¥¿¥ó, ¥Á¥§¥Ã¥¯¥Ü¥¿¥ó, ¥é¥¸¥ª¥Ü¥¿¥ó\n",tag_middle) -txt.insert('end', "¥é¥Ù¥ë, ¥Ü¥¿¥ó, ¥Á¥§¥Ã¥¯¥Ü¥¿¥ó, ¥é¥¸¥ª¥Ü¥¿¥ó\n", - tag_kanji_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. ¥é¥Ù¥ë (¥Æ¥¥¹¥È, ¥Ó¥Ã¥È¥Þ¥Ã¥×)\n", - tag_demo, "demo-label") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. ¥é¥Ù¥ë¤ÈUNICODE¥Æ¥¥¹¥È (µ¡Ç½¤ËÂбþ¤·¤¿¥Ð¡¼¥¸¥ç¥ó¤ÎTk¤¬É¬Í×)\n", tag_demo, "demo-unicodeout") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. ¥Ü¥¿¥ó \n", tag_demo, "demo-button") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. ¥Á¥§¥Ã¥¯¥Ü¥¿¥ó (Ê£¿ô¤òÁªÂò²Äǽ)\n", - tag_demo, "demo-check") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "5. ¥é¥¸¥ª¥Ü¥¿¥ó (Ǥ°Õ¤Î°ì¤Ä¤òÁªÂò²Äǽ)\n", - tag_demo, "demo-radio") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "6. ¥é¥¸¥ª¥Ü¥¿¥ó (µ¡Ç½¤ËÂбþ¤·¤¿¥Ð¡¼¥¸¥ç¥ó¤ÎTk¤¬É¬Í×)\n", - tag_demo, "demo-radio2") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "7. ¥Ü¥¿¥ó¤Çºî¤é¤ì¤¿15-¥Ñ¥º¥ë¥²¡¼¥à\n", - tag_demo, "demo-puzzle") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "8. ¥Ó¥Ã¥È¥Þ¥Ã¥×¤ò»ÈÍѤ·¤¿¥¢¥¤¥³¥ó¥Ü¥¿¥ó\n", - tag_demo, "demo-icon") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "9. ²èÁü¤òɽ¼¨¤¹¤ëÆó¤Ä¤Î¥é¥Ù¥ë\n", - tag_demo, "demo-image1") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "10. ²èÁü¤ò¸«¤ë¤¿¤á¤Î´Êñ¤Ê¥æ¡¼¥¶¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹\n", - tag_demo, "demo-image2") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "11. ²èÁü¤ò¸«¤ë¤¿¤á¤Î´Êñ¤Ê¥æ¡¼¥¶¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ (µ¡Ç½¤ËÂбþ¤·¤¿¥Ð¡¼¥¸¥ç¥ó¤ÎTk¤¬É¬Í×)\n", - tag_demo, "demo-image3") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "12. ¥é¥Ù¥ëÉÕ¤¥Õ¥ì¡¼¥à (µ¡Ç½¤ËÂбþ¤·¤¿¥Ð¡¼¥¸¥ç¥ó¤ÎTk¤¬É¬Í×)\n", - tag_demo, "demo-labelframe") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -#txt.insert('end', "¥ê¥¹¥È¥Ü¥Ã¥¯¥¹\n", tag_middle) -txt.insert('end', "¥ê¥¹¥È¥Ü¥Ã¥¯¥¹\n", tag_kanji_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. ÅÔÆ»Éܸ©.\n", tag_demo, "demo-states") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. ¿§: ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¤¿¤á¤ÎÇÛ¿§¤òÊѤ¨¤ë\n", - "#{tag_demo.id} demo-colors") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. ³Ê¸À½¸\n", tag_demo, "demo-sayings") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -#txt.insert('end', "¥¨¥ó¥È¥ê¤È¥¹¥Ô¥ó¥Ü¥Ã¥¯¥¹\n", tag_middle) -txt.insert('end', "¥¨¥ó¥È¥ê\n", tag_kanji_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. ¥¹¥¯¥í¡¼¥ë¥Ð¡¼¤Ê¤·\n", tag_demo, "demo-entry1") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. ¥¹¥¯¥í¡¼¥ë¥Ð¡¼¤¢¤ê\n", tag_demo, "demo-entry2") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. ǧ¾Ú½èÍýÉÕ¤¤Î¥¨¥ó¥È¥ê¥Ü¥Ã¥¯¥¹¤È¥Ñ¥¹¥ï¡¼¥É¥Õ¥£¡¼¥ë¥É (µ¡Ç½¤ËÂбþ¤·¤¿¥Ð¡¼¥¸¥ç¥ó¤ÎTk¤¬É¬Í×)\n", - tag_demo, "demo-entry3") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. ¥¹¥Ô¥ó¥Ü¥Ã¥¯¥¹ (µ¡Ç½¤ËÂбþ¤·¤¿¥Ð¡¼¥¸¥ç¥ó¤ÎTk¤¬É¬Í×)\n", - tag_demo, "demo-spin") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "5. ´Êñ¤Ê¥Õ¥©¡¼¥à\n", tag_demo, "demo-form") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -#txt.insert('end', "¥Æ¥¥¹¥È\n", tag_middle) -txt.insert('end', "¥Æ¥¥¹¥È\n", tag_kanji_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. ´ðËÜŪ¤Ê¥Æ¥¥¹¥È\n", tag_demo, "demo-text") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. ɽ¼¨¥¹¥¿¥¤¥ë.\n", tag_demo, "demo-style") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. ¥Ï¥¤¥Ñ¡¼¥Æ¥¥¹¥È(¥¿¥°¥Ð¥¤¥ó¥É).\n", - tag_demo, "demo-bind") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. ¥¦¥£¥ó¥É¥¦¤òËä¤á¹þ¤ó¤À¥Æ¥¥¹¥È\n", - tag_demo, "demo-twind") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "5. ¸¡º÷\n", tag_demo, "demo-search") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -#txt.insert('end', "¥¥ã¥ó¥Ð¥¹\n", tag_middle) -txt.insert('end', "¥¥ã¥ó¥Ð¥¹\n", tag_kanji_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. ¥¢¥¤¥Æ¥à¤Î·¿\n", tag_demo, "demo-items") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. 2 ¼¡¸µ¤Î¥×¥í¥Ã¥È\n", tag_demo, "demo-plot") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. ¥Æ¥¥¹¥È\n", tag_demo, "demo-ctext") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. Ìð°õ¤Î·Á\n", tag_demo, "demo-arrow") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "5. ¥ë¡¼¥é¡¼\n", tag_demo, "demo-ruler") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "6. ¥Õ¥í¥¢¥×¥é¥ó\n", tag_demo, "demo-floor") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "7. ¥¹¥¯¥í¡¼¥ë²Äǽ¤Ê¥¥ã¥ó¥Ð¥¹\n", - tag_demo, "demo-cscroll") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -#txt.insert('end', "¥¹¥±¡¼¥ë\n", tag_middle) -txt.insert('end', "¥¹¥±¡¼¥ë\n", tag_kanji_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. ¿âľ\n", tag_demo.id, "demo-vscale") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. ¿åÊ¿\n", tag_demo.id, "demo-hscale") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -txt.insert('end', "¥Ú¥¤¥ó¥É¥¦¥£¥ó¥É¥¦\n", tag_kanji_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. ¿åÊ¿Êý¸þ (µ¡Ç½¤ËÂбþ¤·¤¿¥Ð¡¼¥¸¥ç¥ó¤ÎTk¤¬É¬Í×)\n", - tag_demo.id, "demo-paned1") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. ¿âľÊý¸þ (µ¡Ç½¤ËÂбþ¤·¤¿¥Ð¡¼¥¸¥ç¥ó¤ÎTk¤¬É¬Í×)\n", - tag_demo.id, "demo-paned2") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -#txt.insert('end', "¥á¥Ë¥å¡¼\n", tag_middle) -txt.insert('end', "¥á¥Ë¥å¡¼\n", tag_kanji_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. ¥á¥Ë¥å¡¼¤È¥«¥¹¥±¡¼¥É¤ò´Þ¤ó¤À¥¦¥£¥ó¥É¥¦\n", - tag_demo, "demo-menu") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. ¥á¥Ë¥å¡¼¤È¥«¥¹¥±¡¼¥É¤ò´Þ¤ó¤À¥¦¥£¥ó¥É¥¦ (Tk8.x ÀìÍÑ)\n", - tag_demo, "demo-menu8x") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. ¡· (µ¡Ç½¤ËÂбþ¤·¤¿¥Ð¡¼¥¸¥ç¥ó¤ÎTk¤¬É¬Í×)\n", - tag_demo, "demo-menu84") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. ¥á¥Ë¥å¡¼¥Ü¥¿¥ó (Tk8.x ÀìÍÑ)\n", - tag_demo, "demo-menubu") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -#txt.insert('end', "¥À¥¤¥¢¥í¥°¥¦¥£¥ó¥É¥¦\n", tag_middle) -txt.insert('end', "¥À¥¤¥¢¥í¥°¥¦¥£¥ó¥É¥¦\n", tag_kanji_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. ¥á¥Ã¥»¡¼¥¸¥Ü¥Ã¥¯¥¹\n", tag_demo, "demo-msgbox") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. ¥Õ¥¡¥¤¥ëÁªÂò¥À¥¤¥¢¥í¥°\n", tag_demo, "demo-filebox") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. ¿§ÁªÂò¥À¥¤¥¢¥í¥°\n", tag_demo, "demo-clrpick") -txt.insert('end', " \n ", tag_demospace) - -txt.insert('end', "\n") -#txt.insert('end', "¤½¤Î¾\n", tag_middle) -txt.insert('end', "¤½¤Î¾\n", tag_kanji_title) -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. ÁȤ߹þ¤ß¤Î¥Ó¥Ã¥È¥Þ¥Ã¥×\n", tag_demo, "demo-bitmap") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. ¥â¡¼¥À¥ë¥À¥¤¥¢¥í¥°(¥í¡¼¥«¥ë¥°¥é¥Ö)\n", - tag_demo, "demo-dialog1") -txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. ¥â¡¼¥À¥ë¥À¥¤¥¢¥í¥°(¥°¥í¡¼¥Ð¥ë¥°¥é¥Ö)\n", - tag_demo, "demo-dialog2") -txt.insert('end', " \n ", tag_demospace) - -txt.state('disabled') -scr.focus - -################################ -# method ÄêµÁ -################################ -def positionWindow(w) - w.geometry('+300+300') -end - -# ¿Æ¥¦¥£¥¸¥§¥Ã¥È¤È¡¤ÊÑ¿ô̾¤È TkVariable ¤È¤ÎÁÈ(ÇÛÎó)¤ÎʤӤòÅϤ¹ -$showVarsWin = {} -def showVars (parent, *args) - if $showVarsWin[parent.path] - begin - $showVarsWin[parent.path].destroy - rescue - end - end - w = TkToplevel.new(parent) {|w| - title "Variable values" - TkLabel.new(w) { - text "ÊÑ¿ôÃÍ:" - width 20 - anchor 'center' - font '-Adobe-helvetica-medium-r-normal--*-180-*-*-*-*-*-*' - }.pack('side'=>'top', 'fill'=>'x') - len = 1 - args.each{|vnam,vbody| - len = vnam.to_s.length if vnam.to_s.length > len - } - args.each{|vnam,vbody| - TkFrame.new(w){|f| - #TkLabel.new(f, 'text'=>"#{vnam}: ").pack('side'=>'left') - TkLabel.new(f, 'text'=>"#{vnam}: ",'width'=>len+2).pack('side'=>'left') - TkLabel.new(f, 'textvariable'=>vbody, 'anchor'=>'w')\ - .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x') - }.pack('side'=>'top', 'anchor'=>'w', 'fill'=>'x') - } - TkButton.new(w) { - text "λ²ò" - command proc{w.destroy} - }.pack('side'=>'bottom', 'pady'=>2) - } - $showVarsWin[parent.path] = w -end - -# ¥Æ¥¥¹¥È¾å¤Ç¤Î click ¤ËÂФ¹¤ëưºî -def invoke (txt, index) - tag = txt.tag_names(index).find{|t| t.kind_of?(String) && t =~ /^demo-/} - return unless tag - cursor = txt.cget('cursor') - txt.cursor('watch') - Tk.update -# eval `cat #{tag[5..-1]}.rb` - eval `cat #{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb` - Tk.update -# txt.cursor('xterm') - txt.cursor(cursor) - - $tag_visited.add("#{index} linestart +1 chars", "#{index} lineend +1 chars") -end - -# ¾õÂÖɽ¼¨ -def showStatus (txt, index) - tag = txt.tag_names(index).find{|t| t.kind_of?(String) && t =~ /^demo-/} - cursor = txt.cget('cursor') - unless tag - $statusBarLabel.configure('text', " ") - newcursor = 'xterm' - else - demoname = tag[5..-1] - $statusBarLabel.configure('text', - "¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à \"#{demoname}\" ¤Î¼Â¹Ô ") - newcursor = 'hand2' - end - txt.configure('cursor'=>newcursor) if cursor != newcursor -end - -# ¥½¡¼¥¹¥³¡¼¥É¤Îɽ¼¨ -def showCode (demo) - file = "#{demo}.rb" - $code_window = nil unless defined? $code_window - if $code_window == nil || TkWinfo.exist?($code_window) == '0' - $code_window = TkToplevel.new(nil) - f = TkFrame.new($code_window) - TkButton.new(f) { - text "λ²ò" - command proc{ - $code_window.destroy - $code_window = nil - } - }.pack('side'=>'left', 'expand'=>'yes', 'pady'=>2) - TkButton.new(f) { - text "ºÆ¼Â¹Ô" - command proc{eval($code_text.get('1.0','end'))} - }.pack('side'=>'left', 'expand'=>'yes', 'pady'=>2) -# f.pack('side'=>'bottom', 'expand'=>'yes', 'fill'=>'x') - f.pack('side'=>'bottom', 'fill'=>'x') - - if $tk_version =~ /^4\.[01]/ - s = TkScrollbar.new($code_window, 'orient'=>'vertical') - $code_text = TkText.new($code_window) { - height 40 - setgrid 'yes' - yscrollcommand proc{|first,last| s.set first,last} - } - s.command(proc{|*args| $code_text.yview(*args)}) - s.pack('side'=>'right', 'fill'=>'y') - $code_text.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'both') - else - TkFrame.new($code_window) {|f| - pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1) - - hs = TkScrollbar.new($code_window, 'highlightthickness'=>0, - 'orient'=>'horizontal') - vs = TkScrollbar.new($code_window, 'highlightthickness'=>0, - 'orient'=>'vertical') - $code_text = TkText.new($code_window) {|t| - height 40 - #wrap 'word' - wrap 'char' - xscrollcommand proc{|first,last| hs.set first,last} - yscrollcommand proc{|first,last| vs.set first,last} - setgrid 'yes' - highlightthickness 0 - pady 2 - padx 3 - hs.command(proc{|*args| $code_text.xview(*args)}) - vs.command(proc{|*args| $code_text.yview(*args)}) - } - - $code_text.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - vs.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, - 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') -# xs.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, -# 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0) - TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0) - } - end - else - $code_window.deiconify - $code_window.raise - end - $code_window.title("Demo code: #{file}") - $code_window.iconname(file) -# fid = open(file, 'r') - fid = open([$demo_dir, file].join(File::Separator), 'r') - $code_text.delete('1.0', 'end') - #$code_text.insert('1.0', `cat #{file}`) - $code_text.insert('1.0', fid.read) - #$code_mark = TkTextMark.new($code_text, '1.0') - #$code_text.set_insert('1.0') - TkTextMarkInsert.new($code_text,'1.0') - fid.close -end - -# aboutBox -# -# Pops up a message box with an "about" message -# -def aboutBox - Tk.messageBox('icon'=>'info', 'type'=>'ok', 'title'=>'About Widget Demo', - 'message'=>"Ruby/Tk ¥¦¥£¥¸¥§¥Ã¥È¥Ç¥â Ver.1.3.2-jp\n\n( based on Tk ¥¦¥£¥¸¥§¥Ã¥È¥Ç¥â :: Copyright (c) 1996-1997 Sun Microsystems, Inc. )\n\nRunning Version :: Ruby#{VERSION}/Tk#{$tk_version}#{(Tk::JAPANIZED_TK)? 'jp': ''}") -end - -################################ -# ¥¤¥Ù¥ó¥ÈÂÔ¤Á¤ËÆþ¤ë -Tk.mainloop diff --git a/ext/tk/sample/resource.en b/ext/tk/sample/resource.en deleted file mode 100644 index 39b4013971..0000000000 --- a/ext/tk/sample/resource.en +++ /dev/null @@ -1,13 +0,0 @@ -! -! see Tcl/Tk's "options" manual for "Database Name" and "Database Class" -! -*BtnFrame.borderWidth: 5 -*BtnFrame.relief: ridge -*BtnFrame.Button.background: wheat -*BtnFrame.Button.foreground: red -*hello.text: HELLO -*quit.text: QUIT -*BTN_CMD.show_msg: {|arg| print "($SAFE=#{$SAFE}) ";\ - print "Hello!! This is a sample of #{arg}.";\ - print "(<<< $SAFE=#{$SAFE})\n"} -*BTN_CMD.bye_msg: {print "($SAFE=#{$SAFE} >>>) Good-bye¡¥(<<< $SAFE=#{$SAFE})\n"} diff --git a/ext/tk/sample/resource.ja b/ext/tk/sample/resource.ja deleted file mode 100644 index a61390f95d..0000000000 --- a/ext/tk/sample/resource.ja +++ /dev/null @@ -1,13 +0,0 @@ -! -! see Tcl/Tk's "options" manual for "Database Name" and "Database Class" -! -*BtnFrame.borderWidth: 5 -*BtnFrame.relief: ridge -*BtnFrame.Button.background: wheat -*BtnFrame.Button.foreground: red -*hello.text: ¤³¤ó¤Ë¤Á¤Ï -*quit.text: ½ªÎ» -*BTN_CMD.show_msg: {|arg| print "($SAFE=#{$SAFE} >>>) ";\ - print "¤³¤ó¤Ë¤Á¤Ï¡ª¡ª #{arg} ¤Î¥µ¥ó¥×¥ë¤Ç¤¹¡¥";\ - print "(<<< $SAFE=#{$SAFE})\n"} -*BTN_CMD.bye_msg: {print "($SAFE=#{$SAFE} >>>) ¤µ¤è¤¦¤Ê¤é¡¥(<<< $SAFE=#{$SAFE})\n"} diff --git a/ext/tk/sample/safe-tk.rb b/ext/tk/sample/safe-tk.rb deleted file mode 100644 index 0a25c804f0..0000000000 --- a/ext/tk/sample/safe-tk.rb +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env ruby -# This script is a sample of MultiTkIp class - -require "multi-tk" - -# create slave interpreters -trusted_slave = MultiTkIp.new_slave -safe_slave1 = MultiTkIp.new_safeTk -safe_slave2 = MultiTkIp.new_safeTk('fill'=>:none, 'expand'=>false) -#safe_slave2 = MultiTkIp.new_safeTk('fill'=>:none) -#safe_slave2 = MultiTkIp.new_safeTk('expand'=>false) - - -cmd = Proc.new{|txt| - ##################### - ## from TkTimer2.rb - - if TkCore::INTERP.safe? - # safeTk doesn't have permission to call 'wm' command - else - root = TkRoot.new(:title=>'timer sample') - end - - label = TkLabel.new(:parent=>root, :relief=>:raised, :width=>10) \ - .pack(:side=>:bottom, :fill=>:both) - - tick = proc{|aobj| - cnt = aobj.return_value + 5 - label.text format("%d.%02d", *(cnt.divmod(100))) - cnt - } - - timer = TkTimer.new(50, -1, tick).start(0, proc{ label.text('0.00'); 0 }) - -=begin - TkButton.new(:text=>'Start') { - command proc{ timer.continue unless timer.running? } - pack(:side=>:left, :fill=>:both, :expand=>true) - } - TkButton.new(:text=>'Restart') { - command proc{ timer.restart(0, proc{ label.text('0.00'); 0 }) } - pack('side'=>'right','fill'=>'both','expand'=>'yes') - } - TkButton.new(:text=>'Stop') { - command proc{ timer.stop if timer.running? } - pack('side'=>'right','fill'=>'both','expand'=>'yes') - } -=end - b_start = TkButton.new(:text=>'Start', :state=>:disabled) { - pack(:side=>:left, :fill=>:both, :expand=>true) - } - b_stop = TkButton.new(:text=>'Stop', :state=>:normal) { - pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes') - } - - b_start.command { - timer.continue - b_stop.state(:normal) - b_start.state(:disabled) - } - - b_stop.command { - timer.stop - b_start.state(:normal) - b_stop.state(:disabled) - } - - TkButton.new(:text=>'Reset', :state=>:normal) { - command { timer.reset } - pack('side'=>'right', 'fill'=>'both', 'expand'=>'yes') - } - - ev_quit = TkVirtualEvent.new('Control-c', 'Control-q') - Tk.root.bind(ev_quit, proc{Tk.exit}).focus -} - -# call on the default master interpreter -trusted_slave.eval_proc(cmd, 'trusted') # label -> .w00012 -safe_slave1.eval_proc(cmd, 'safe1') # label -> .w00016 -safe_slave2.eval_proc(cmd, 'safe2') # label -> .w00020 -cmd.call('master') # label -> .w00024 - -#second_master = MultiTkIp.new(&cmd) - -TkTimer.new(2000, -1, proc{p ['safe1', safe_slave1.deleted?]}).start -TkTimer.new(2000, -1, proc{p ['safe2', safe_slave2.deleted?]}).start -TkTimer.new(2000, -1, proc{p ['trusted', trusted_slave.deleted?]}).start - -TkTimer.new(7000, 1, - proc{ - safe_slave1.eval_proc{Tk.root.destroy} - safe_slave1.delete - print "*** The safe_slave1 is deleted by the timer.\n" - }).start - -TkTimer.new(10000, 1, - proc{ - trusted_slave.eval_proc{Tk.root.destroy} - trusted_slave.delete - print "*** The trusted_slave is deleted by the timer.\n" - }).start - -Tk.mainloop diff --git a/ext/tk/sample/tkalignbox.rb b/ext/tk/sample/tkalignbox.rb deleted file mode 100644 index b56c9cc11e..0000000000 --- a/ext/tk/sample/tkalignbox.rb +++ /dev/null @@ -1,225 +0,0 @@ -# -# tkalignbox.rb : align widgets with same width/height -# -# by Hidetoshi NAGAI -# -# The box size depends on 'reqheight' and 'reqwidth' of contained widgets. -# If you want to give the box size when those requested sizes are 0, -# please set box.propagate = false (See the test routine at the tail of -# this file). - -require 'tk' - -class TkAlignBox < TkFrame - def initialize(*args) - if self.class == TkAlignBox - fail RuntimeError, "TkAlignBox is an abstract class" - end - @padx = 0 - @pady = 0 - if args[-1].kind_of? Hash - keys = _symbolkey2str(args.pop) - @padx = keys.delete('padx') || 0 - @pady = keys.delete('pady') || 0 - args.push(keys) - end - super(*args) - @max_width = 0 - @max_height = 0 - @propagate = true - @widgets = [] - end - - def _set_framesize - fail RuntimeError, "TkAlignBox is an abstract class" - end - private :_set_framesize - - def _place_config(widget, idx, cnt) - fail RuntimeError, "TkAlignBox is an abstract class" - end - private :_place_config - - def align - widgets = [] - @widgets.each{|w| widgets << w if w.winfo_exist?} - @widgets = widgets - cnt = @widgets.size.to_f - @widgets.each_with_index{|w, idx| _place_config(w, idx, cnt)} - @widgets = widgets - _set_framesize if @propagate - self - end - - def add(*widgets) - widgets.each{|w| - unless w.kind_of? TkWindow - fail RuntimeError, "#{w.inspect} is not a widget instance." - end - @widgets.delete(w) - @widgets << w - sz = w.winfo_reqwidth - @max_width = sz if @max_width < sz - sz = w.winfo_reqheight - @max_height = sz if @max_height < sz - } - align - end - - def <<(widget) - add(widget) - end - - def insert(idx, widget) - unless widget.kind_of? TkWindow - fail RuntimeError, "#{widget.inspect} is not a widget instance." - end - @widgets.delete(widget) - @widgets[idx,0] = widget - sz = widget.winfo_reqwidth - @max_width = sz if @max_width < sz - sz = widget.winfo_reqheight - @max_height = sz if @max_height < sz - align - end - - def delete(idx) - ret = @widgets.delete_at(idx) - @req_size = 0 - @widget.each{|w| - sz = w.winfo_reqwidth - @max_width = sz if @max_width < sz - sz = w.winfo_reqheight - @max_height = sz if @max_height < sz - } - align - ret - end - - def padx(size = nil) - if size - @padx = size - align - else - @padx - end - end - - def pady(size = nil) - if size - @pady = size - align - else - @pady - end - end - - attr_accessor :propagate -end - -class TkHBox < TkAlignBox - def _set_framesize - bd = self.borderwidth - self.width((@max_width + 2*@padx) * @widgets.size + 2*bd) - self.height(@max_height + 2*@pady + 2*bd) - end - private :_set_framesize - - def _place_config(widget, idx, cnt) - widget.place_in(self, - 'relx'=>idx/cnt, 'x'=>@padx, - 'rely'=>0, 'y'=>@pady, - 'relwidth'=>1.0/cnt, 'width'=>-2*@padx, - 'relheight'=>1.0, 'height'=>-2*@pady) - end - private :_place_config -end -TkHLBox = TkHBox - -class TkHRBox < TkHBox - def _place_config(widget, idx, cnt) - widget.place_in(self, - 'relx'=>(cnt - idx - 1)/cnt, 'x'=>@padx, - 'rely'=>0, 'y'=>@pady, - 'relwidth'=>1.0/cnt, 'width'=>-2*@padx, - 'relheight'=>1.0, 'height'=>-2*@pady) - end - private :_place_config -end - -class TkVBox < TkAlignBox - def _set_framesize - bd = self.borderwidth - self.width(@max_width + 2*@padx + 2*bd) - self.height((@max_height + 2*@pady) * @widgets.size + 2*bd) - end - private :_set_framesize - - def _place_config(widget, idx, cnt) - widget.place_in(self, - 'relx'=>0, 'x'=>@padx, - 'rely'=>idx/cnt, 'y'=>@pady, - 'relwidth'=>1.0, 'width'=>-2*@padx, - 'relheight'=>1.0/cnt, 'height'=>-2*@pady) - end - private :_place_config -end -TkVTBox = TkVBox - -class TkVBBox < TkVBox - def _place_config(widget, idx, cnt) - widget.place_in(self, - 'relx'=>0, 'x'=>@padx, - 'rely'=>(cnt - idx - 1)/cnt, 'y'=>@pady, - 'relwidth'=>1.0, 'width'=>-2*@padx, - 'relheight'=>1.0/cnt, 'height'=>-2*@pady) - end - private :_place_config -end - -################################################ -# test -################################################ -if __FILE__ == $0 - f = TkHBox.new(:borderwidth=>3, :relief=>'ridge').pack - f.add(TkButton.new(f, :text=>'a'), - TkButton.new(f, :text=>'aa', :font=>'Helvetica 16'), - TkButton.new(f, :text=>'aaa'), - TkButton.new(f, :text=>'aaaa')) - - f = TkHBox.new(:borderwidth=>3, :relief=>'ridge', - :padx=>7, :pady=>3, :background=>'yellow').pack - f.add(TkButton.new(f, :text=>'a'), - TkButton.new(f, :text=>'aa', :font=>'Helvetica 16'), - TkButton.new(f, :text=>'aaa'), - TkButton.new(f, :text=>'aaaa')) - - f = TkVBox.new(:borderwidth=>5, :relief=>'groove').pack - f.add(TkButton.new(f, :text=>'a'), - TkButton.new(f, :text=>'aa', :font=>'Helvetica 30'), - TkButton.new(f, :text=>'aaa'), - TkButton.new(f, :text=>'aaaa')) - - f = TkHRBox.new(:borderwidth=>3, :relief=>'raised').pack(:fill=>:x) - f.add(TkButton.new(f, :text=>'a'), - TkButton.new(f, :text=>'aa'), - TkButton.new(f, :text=>'aaa')) - - f = TkVBBox.new(:borderwidth=>3, :relief=>'ridge').pack(:fill=>:x) - f.propagate = false - f.height 100 - f.add(TkFrame.new(f){|ff| - TkButton.new(ff, :text=>'a').pack(:pady=>4, :padx=>6, - :fill=>:both, :expand=>true) - }, - TkFrame.new(f){|ff| - TkButton.new(ff, :text=>'aa').pack(:pady=>4, :padx=>6, - :fill=>:both, :expand=>true) - }, - TkFrame.new(f){|ff| - TkButton.new(ff, :text=>'aaaa').pack(:pady=>4, :padx=>6, - :fill=>:both, :expand=>true) - }) - - Tk.mainloop -end diff --git a/ext/tk/sample/tkballoonhelp.rb b/ext/tk/sample/tkballoonhelp.rb deleted file mode 100644 index 312e376a07..0000000000 --- a/ext/tk/sample/tkballoonhelp.rb +++ /dev/null @@ -1,99 +0,0 @@ -# -# tkballoonhelp.rb : simple balloon help widget -# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) -# -# Add a balloon help to a widget. -# This widget has only poor featureas. If you need more useful features, -# please try to use the Tix extension of Tcl/Tk under Ruby/Tk. -# -# The interval time to display a balloon help is defined 'interval' option -# (default is 1000ms). -# -require 'tk' - -class TkBalloonHelp<TkLabel - def _balloon_binding(interval) - @timer = TkAfter.new(interval, 1, proc{show}) - def @timer.interval(val) - @sleep_time = val - end - @bindtag = TkBindTag.new - @bindtag.bind('Enter', proc{@timer.start}) - @bindtag.bind('Motion', proc{@timer.restart; erase}) - @bindtag.bind('Any-ButtonPress', proc{@timer.restart; erase}) - @bindtag.bind('Leave', proc{@timer.stop; erase}) - tags = @parent.bindtags - idx = tags.index(@parent) - tags[idx,0] = @bindtag - @parent.bindtags(tags) - end - private :_balloon_binding - - def initialize(parent=nil, keys={}) - @parent = parent - - @frame = TkToplevel.new(@parent) - @frame.withdraw - @frame.overrideredirect(true) - @frame.transient(TkWinfo.toplevel(@parent)) - @epath = @frame.path - - keys = {} unless keys - - @interval = keys.delete('interval'){1000} - _balloon_binding(@interval) - - @label = TkLabel.new(@frame, 'background'=>'bisque').pack - @label.configure(_symbolkey2str(keys)) unless keys.empty? - @path = @label - end - - def epath - @epath - end - - def interval(val) - if val - @timer.interval(val) - else - @interval - end - end - - def show - x = TkWinfo.pointerx(@parent) - y = TkWinfo.pointery(@parent) - @frame.geometry("+#{x+1}+#{y+1}") - @frame.deiconify - @frame.raise - - @org_cursor = @parent['cursor'] - @parent.cursor('crosshair') - end - - def erase - @parent.cursor(@org_cursor) - @frame.withdraw - end - - def destroy - @frame.destroy - end -end - -################################################ -# test -################################################ -if __FILE__ == $0 - TkButton.new('text'=>'This button has a balloon help') {|b| - pack('fill'=>'x') - TkBalloonHelp.new(b, 'text'=>' Message ') - } - TkButton.new('text'=>'This button has another balloon help') {|b| - pack('fill'=>'x') - TkBalloonHelp.new(b, 'text'=>'configured message', - 'interval'=>500, 'font'=>'courier', - 'background'=>'gray', 'foreground'=>'red') - } - Tk.mainloop -end diff --git a/ext/tk/sample/tkbiff.rb b/ext/tk/sample/tkbiff.rb deleted file mode 100644 index e89644bd9d..0000000000 --- a/ext/tk/sample/tkbiff.rb +++ /dev/null @@ -1,155 +0,0 @@ -#!/usr/bin/env ruby - -if ARGV[0] != '-d' - unless $DEBUG - exit if fork - end -else - ARGV.shift -end - -if ARGV.length == 0 - if ENV['MAIL'] - $spool = ENV['MAIL'] - else - $spool = '/var/spool/mail/' + ENV['USER'] - end -else - $spool = ARGV[0] -end - -require "parsedate" -require "base64" - -include ParseDate - -class Mail - def Mail.new(f) - if !f.kind_of?(IO) - f = open(f, "r") - me = super - f.close - else - me = super - end - return me - end - - def initialize(f) - @header = {} - @body = [] - while line = f.gets() - line.chop! - next if /^From / =~ line # skip From-line - break if /^$/ =~ line # end of header - if /^(\S+):\s*(.*)/ =~ line - @header[attr = $1.capitalize] = $2 - elsif attr - sub(/^\s*/, '') - @header[attr] += "\n" + $_ - end - end - - return unless $_ - - while line = f.gets() - break if /^From / =~ line - @body.push($_) - end - end - - def header - return @header - end - - def body - return @body - end - -end - -require "tkscrollbox" - -my_appname = Tk.appname('tkbiff') -$top = TkRoot.new -if ((TkWinfo.interps($top) - [my_appname]).find{|ip| ip =~ /^tkbiff/}) - STDERR.print("Probably other 'tkbiff's are running. Bye.\n") - exit -end - -$top.withdraw -$list = TkScrollbox.new($top) { - relief 'raised' - width 80 - height 8 - setgrid 'yes' - pack -} -TkButton.new($top) { - text 'Dismiss' - command proc {$top.withdraw} - pack('fill'=>'both','expand'=>'yes') -} -$top.bind "Control-c", proc{exit} -$top.bind "Control-q", proc{exit} -$top.bind "space", proc{exit} - -$spool_size = 0 -$check_time = Time.now - -def check - $check_time = Time.now - size = File.size($spool) - if size and size != $spool_size - $spool_size = size - pop_up if size > 0 - end - Tk.after 5000, proc{check} -end - -if defined? Thread - Thread.start do - loop do - sleep 600 - if Time.now - $check_time > 200 - Tk.after 5000, proc{check} - end - end - end -end - -def pop_up - outcount = 0; - $list.delete 0, 'end' - f = open($spool, "r") - while !f.eof? - mail = Mail.new(f) - date, from, subj = mail.header['Date'], mail.header['From'], mail.header['Subject'] - next if !date - y = m = d = 0 - y, m, d = parsedate(date) if date - from = "sombody@somewhere" if ! from - subj = "(nil)" if ! subj - from = decode_b(from) - subj = decode_b(subj) - $list.insert 'end', format('%-02d/%02d/%02d [%-28.28s] %s',y,m,d,from,subj) - outcount += 1 - end - f.close - if outcount == 0 - $list.insert 'end', "You have no mail." - else - $list.see 'end' - end - $top.deiconify - Tk.after 2000, proc{$top.iconify} -end - -$list.insert 'end', "You have no mail." -check -Tk.after 2000, proc{$top.iconify} -begin - Tk.mainloop -rescue - `echo #$! > /tmp/tkbiff` -end diff --git a/ext/tk/sample/tkbrowse.rb b/ext/tk/sample/tkbrowse.rb deleted file mode 100644 index 7395688e97..0000000000 --- a/ext/tk/sample/tkbrowse.rb +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env ruby -# -# This script generates a directory browser, which lists the working -# directory and allows you to open files or subdirectories by -# double-clicking. - -# Create a scrollbar on the right side of the main window and a listbox -# on the left side. - -require "tkscrollbox" - -# The procedure below is invoked to open a browser on a given file; if the -# file is a directory then another instance of this program is invoked; if -# the file is a regular file then the Mx editor is invoked to display -# the file. - -$dirlist = {} - -def browsedir (dir) - if $dirlist.key? dir - $dirlist[dir] - else - top = if $dirlist.size > 0 then TkToplevel.new else nil end - list = TkScrollbox.new(top) { - relief 'raised' - width 20 - height 20 - setgrid 'yes' - pack - } - list.insert 'end', *`ls #{dir}`.split - - # Set up bindings for the browser. - - list.focus - list.bind "Control-q", proc{exit} - list.bind "Control-c", proc{exit} - list.bind "Control-p", proc{ - print "selection <", TkSelection.get, ">\n" - } - - list.bind "Double-Button-1", proc{ - for i in TkSelection.get.split - print "clicked ", i, "\n" - browse dir, i - end - } - $dirlist[dir] = list - end -end - -def browse (dir, file) - file="#{dir}/#{file}" - if File.directory? file - browsedir(file) - else - if File.file? file - if ENV['EDITOR'] - system format("%s %s&", ENV['EDITOR'], file) - else - system "xedit #{file}&" - end - else - STDERR.print "\"#{file}\" isn't a directory or regular file" - end - end -end - -# Fill the listbox with a list of all the files in the directory (run -# the "ls" command to get that information). - -if ARGV.length>0 - dir = ARGV[0] -else - dir="." -end - -browsedir(dir) -Tk.mainloop diff --git a/ext/tk/sample/tkcombobox.rb b/ext/tk/sample/tkcombobox.rb deleted file mode 100644 index f0cbdac3ba..0000000000 --- a/ext/tk/sample/tkcombobox.rb +++ /dev/null @@ -1,419 +0,0 @@ -# -# tkcombobox.rb : TkAutoScrollbox & TkCombobox -# -# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) -# -require 'tk' - -class TkAutoScrollbox < TkListbox - include TkComposite - - @@up_bmp = TkBitmapImage.new(:data=><<EOD) -#define up_arrow_width 9 -#define up_arrow_height 9 -static unsigned char up_arrow_bits[] = { - 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x38, 0x00, 0x38, 0x00, 0x7c, 0x00, - 0x7c, 0x00, 0xfe, 0x00, 0x00, 0x00}; -EOD - - @@down_bmp = TkBitmapImage.new(:data=><<EOD) -#define up_arrow_width 9 -#define up_arrow_height 9 -static unsigned char down_arrow_bits[] = { - 0x00, 0x00, 0xfe, 0x00, 0x7c, 0x00, 0x7c, 0x00, 0x38, 0x00, 0x38, 0x00, - 0x10, 0x00, 0x10, 0x00, 0x00, 0x00}; -EOD - - ############################ - private - ############################ - def initialize_composite(keys={}) - keys = _symbolkey2str(keys) - - @initwait = keys.delete('startwait'){300} - @interval = keys.delete('interval'){150} - @initwait -= @interval - @initwait = 0 if @initwait < 0 - - @lbox = TkListbox.new(@frame, :borderwidth=>0) - @path = @lbox.path - TkPack.propagate(@lbox, false) - - @scr = TkScrollbar.new(@frame, :width=>10) - - @lbox.yscrollcommand(proc{|*args| @scr.set(*args); _config_proc}) - @scr.command(proc{|*args| @lbox.yview(*args); _config_proc}) - - @up_arrow = TkLabel.new(@lbox, :image=>@@up_bmp, - :relief=>:raised, :borderwidth=>1) - @down_arrow = TkLabel.new(@lbox, :image=>@@down_bmp, - :relief=>:raised, :borderwidth=>1) - - _init_binding - - @lbox.pack(:side=>:left, :fill=>:both, :expand=>:true) - - delegate('DEFAULT', @lbox) - delegate('background', @frame, @scr) - delegate('activebackground', @scr) - delegate('troughcolor', @scr) - delegate('repeatdelay', @scr) - delegate('repeatinterval', @scr) - delegate('relief', @frame) - delegate('borderwidth', @frame) - - scrollbar(keys.delete('scrollbar')){false} - - configure keys unless keys.empty? - end - - def _show_up_arrow - unless @up_arrow.winfo_mapped? - @up_arrow.pack(:side=>:top, :fill=>:x) - end - end - - def _show_down_arrow - unless @down_arrow.winfo_mapped? - @down_arrow.pack(:side=>:bottom, :fill=>:x) - end - end - - def _set_sel(idx) - @lbox.activate(idx) - @lbox.selection_clear(0, 'end') - @lbox.selection_set(idx) - end - - def _check_sel(cidx, tidx = nil, bidx = nil) - _set_sel(cidx) - unless tidx - tidx = @lbox.nearest(0) - tidx += 1 if tidx > 0 - end - unless bidx - bidx = @lbox.nearest(10000) - bidx -= 1 if bidx < @lbox.index('end') - 1 - end - if cidx > bidx - _set_sel(bidx) - end - if cidx < tidx - _set_sel(tidx) - end - end - - def _up_proc - cidx = @lbox.curselection[0] - idx = @lbox.nearest(0) - if idx >= 0 - @lbox.see(idx - 1) - _set_sel(idx) - @up_arrow.pack_forget if idx == 1 - @up_timer.stop if idx == 0 - _show_down_arrow if @lbox.bbox('end') == [] - end - if cidx && cidx > 0 && (idx == 0 || cidx == @lbox.nearest(10000)) - _set_sel(cidx - 1) - end - end - - def _down_proc - cidx = @lbox.curselection[0] - eidx = @lbox.index('end') - 1 - idx = @lbox.nearest(10000) - if idx <= eidx - @lbox.see(idx + 1) - _set_sel(cidx + 1) if cidx < eidx - @down_arrow.pack_forget if idx + 1 == eidx - @down_timer.stop if idx == eidx - _show_up_arrow if @lbox.bbox(0) == [] - end - if cidx && cidx < eidx && (eidx == idx || cidx == @lbox.nearest(0)) - _set_sel(cidx + 1) - end - end - - def _key_UP_proc - cidx = @lbox.curselection[0] - _set_sel(cidx = @lbox.index('activate')) unless cidx - cidx -= 1 - if cidx == 0 - @up_arrow.pack_forget - elsif cidx == @lbox.nearest(0) - @lbox.see(cidx - 1) - end - end - - def _key_DOWN_proc - cidx = @lbox.curselection[0] - _set_sel(cidx = @lbox.index('activate')) unless cidx - cidx += 1 - if cidx == @lbox.index('end') - 1 - @down_arrow.pack_forget - elsif cidx == @lbox.nearest(10000) - @lbox.see(cidx + 1) - end - end - - def _config_proc - if @lbox.size == 0 - @up_arrow.pack_forget - @down_arrow.pack_forget - return - end - tidx = @lbox.nearest(0) - bidx = @lbox.nearest(10000) - if tidx > 0 - _show_up_arrow - tidx += 1 - else - @up_arrow.pack_forget unless @up_timer.running? - end - if bidx < @lbox.index('end') - 1 - _show_down_arrow - bidx -= 1 - else - @down_arrow.pack_forget unless @down_timer.running? - end - cidx = @lbox.curselection[0] - _check_sel(cidx, tidx, bidx) if cidx - end - - def _init_binding - @up_timer = TkAfter.new(@interval, -1, proc{_up_proc}) - @down_timer = TkAfter.new(@interval, -1, proc{_down_proc}) - - @up_timer.set_start_proc(@initwait, proc{}) - @down_timer.set_start_proc(@initwait, proc{}) - - @up_arrow.bind('Enter', proc{@up_timer.start}) - @up_arrow.bind('Leave', proc{@up_timer.stop if @up_arrow.winfo_mapped?}) - @down_arrow.bind('Enter', proc{@down_timer.start}) - @down_arrow.bind('Leave', proc{@down_timer.stop if @down_arrow.winfo_mapped?}) - - @lbox.bind('Configure', proc{_config_proc}) - @lbox.bind('Enter', proc{|y| _set_sel(@lbox.nearest(y))}, '%y') - @lbox.bind('Motion', proc{|y| - @up_timer.stop if @up_timer.running? - @down_timer.stop if @down_timer.running? - _check_sel(@lbox.nearest(y)) - }, '%y') - - @lbox.bind('Up', proc{_key_UP_proc}) - @lbox.bind('Down', proc{_key_DOWN_proc}) - end - - ############################ - public - ############################ - def scrollbar(mode) - if mode - @scr.pack(:side=>:right, :fill=>:y) - else - @scr.pack_forget - end - end -end - -################################################ - -class TkCombobox < TkEntry - include TkComposite - - @@down_btn_bmp = TkBitmapImage.new(:data=><<EOD) -#define down_arrow_width 11 -#define down_arrow_height 11 -static unsigned char down_arrow_bits[] = { - 0x00, 0x00, 0xfe, 0x03, 0xfc, 0x01, 0xfc, 0x01, 0xf8, 0x00, 0xf8, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00}; -EOD - - @@up_btn_bmp = TkBitmapImage.new(:data=><<EOD) -#define up_arrow_width 11 -#define up_arrow_height 11 -static unsigned char up_arrow_bits[] = { - 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x70, 0x00, 0x70, 0x00, 0xf8, 0x00, - 0xf8, 0x00, 0xfc, 0x01, 0xfc, 0x01, 0xfe, 0x03, 0x00, 0x00}; -EOD - - def _button_proc(dir = true) - @btn.relief(:sunken) - x = @frame.winfo_rootx - y = @frame.winfo_rooty - if dir - @top.geometry("+#{x}+#{y + @frame.winfo_height}") - else - @btn.image(@@up_btn_bmp) - @top.geometry("+#{x}+#{y - @top.winfo_reqheight}") - end - @top.deiconify - @lst.focus - - if (idx = values.index(@ent.value)) - @lst.see(idx - 1) - @lst.activate(idx) - @lst.selection_set(idx) - elsif @lst.size > 0 - @lst.see(0) - @lst.activate(0) - @lst.selection_set(0) - end - @top.grab - - begin - @var.tkwait - if (idx = @var.to_i) >= 0 - @ent.value = @lst.get(idx) - end - @top.withdraw - @btn.relief(:raised) - @btn.image(@@down_btn_bmp) - rescue - ensure - begin - @top.grab(:release) - @ent.focus - rescue - end - end - end - private :_button_proc - - def _init_bindings - @btn.bind('1', proc{_button_proc(true)}) - @btn.bind('3', proc{_button_proc(false)}) - - @lst.bind('1', proc{|y| @var.value = @lst.nearest(y)}, '%y') - @lst.bind('Return', proc{@var.value = @lst.curselection[0]}) - - cancel = TkVirtualEvent.new('2', '3', 'Escape') - @lst.bind(cancel, proc{@var.value = -1}) - end - private :_init_bindings - - def initialize_composite(keys={}) - keys = _symbolkey2str(keys) - - @btn = TkLabel.new(@frame, :relief=>:raised, :borderwidth=>3, - :image=>@@down_btn_bmp).pack(:side=>:right, - :ipadx=>2, :fill=>:y) - @ent = TkEntry.new(@frame).pack(:side=>:left) - @path = @ent.path - - @top = TkToplevel.new(@btn, :borderwidth=>1, :relief=>:raised) { - withdraw - transient - overrideredirect(true) - } - - startwait = keys.delete('startwait'){300} - interval = keys.delete('interval'){150} - @lst = TkAutoScrollbox.new(@top, - :startwait=>startwait, - :interval=>interval).pack(:fill=>:both, - :expand=>true) - @ent_list = [] - - @var = TkVariable.new - - _init_bindings - - delegate('DEFAULT', @ent) - delegate('height', @lst) - delegate('relief', @frame) - delegate('borderwidth', @frame) - - if mode = keys.delete('scrollbar') - scrollbar(mode) - end - - configure keys unless keys.empty? - end - private :initialize_composite - - def scrollbar(mode) - @lst.scrollbar(mode) - end - - def _reset_width - len = @ent.width - @lst.get(0, 'end').each{|l| len = l.length if l.length > len} - @lst.width(len + 1) - end - private :_reset_width - - def add(ent) - ent = ent.to_s - unless @ent_list.index(ent) - @ent_list << ent - @lst.insert('end', ent) - end - _reset_width - self - end - - def remove(ent) - ent = ent.to_s - @ent_list.delete(ent) - if idx = @lst.get(0, 'end').index(ent) - @lst.delete(idx) - end - _reset_width - self - end - - def values(ary = nil) - if ary - @lst.delete(0, 'end') - @ent_list.clear - ary.each{|ent| add(ent)} - _reset_width - self - else - @lst.get(0, 'end') - end - end - - def see(idx) - @lst.see(@lst.index(idx) - 1) - end - - def list_index(idx) - @lst.index(idx) - end -end - - -################################################ -# test -################################################ -if __FILE__ == $0 - v = TkVariable.new - e = TkCombobox.new(:height=>7, :scrollbar=>true, :textvariable=>v, - :startwait=>400, :interval=>200).pack - e.values(%w(aa bb cc dd ee ff gg hh ii jj kk ll mm nn oo pp qq rr ss tt uu)) - #e.see(e.list_index('end') - 2) - e.value = 'cc' - TkFrame.new{|f| - fnt = TkFont.new('Helvetica 10') - TkLabel.new(f, :font=>fnt, :text=>'TkCombobox value :').pack(:side=>:left) - TkLabel.new(f, :font=>fnt, :textvariable=>v).pack(:side=>:left) - }.pack - - TkFrame.new(:relief=>:raised, :borderwidth=>2, - :height=>3).pack(:fill=>:x, :expand=>true, :padx=>5, :pady=>3) - - l = TkAutoScrollbox.new(nil, :relief=>:groove, :borderwidth=>4, - :width=>20).pack(:fill=>:both, :expand=>true) - (0..20).each{|i| l.insert('end', "line #{i}")} - - TkFrame.new(:relief=>:ridge, :borderwidth=>3){ - TkButton.new(self, :text=>'ON', - :command=>proc{l.scrollbar(true)}).pack(:side=>:left) - TkButton.new(self, :text=>'OFF', - :command=>proc{l.scrollbar(false)}).pack(:side=>:right) - pack(:fill=>:x) - } - Tk.mainloop -end diff --git a/ext/tk/sample/tkdialog.rb b/ext/tk/sample/tkdialog.rb deleted file mode 100644 index 00cc12ab11..0000000000 --- a/ext/tk/sample/tkdialog.rb +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env ruby -require "tk" - -root = TkFrame.new -top = TkFrame.new(root) { - relief 'raised' - border 1 -} -msg = TkMessage.new(top) { - text "File main.c hasn't been saved to disk since \ -it was last modified. What should I do?" - justify 'center' - aspect 200 - font '-Adobe-helvetica-medium-r-normal--*-240*' - pack('padx'=>5, 'pady'=>5, 'expand'=>'yes') -} -top.pack('fill'=>'both') -root.pack - -bot = TkFrame.new(root) { - relief 'raised' - border 1 -} - -TkFrame.new(bot) { |left| - relief 'sunken' - border 1 - pack('side'=>'left', 'expand'=>'yes', 'padx'=>10, 'pady'=> 10) - TkButton.new(left) { - text "Save File" - command "quit 'save'" - pack('expand'=>'yes','padx'=>6,'pady'=> 6) - top.bind "Enter", proc{state 'active'} - msg.bind "Enter", proc{state 'active'} - bot.bind "Enter", proc{state 'active'} - top.bind "Leave", proc{state 'normal'} - msg.bind "Leave", proc{state 'normal'} - bot.bind "Leave", proc{state 'normal'} - Tk.root.bind "ButtonRelease-1", proc{quit 'save'} - Tk.root.bind "Return", proc{quit 'save'} - } -} -TkButton.new(bot) { - text "Quit Anyway" - command "quit 'quit'" - pack('side'=>'left', 'expand'=>'yes', 'padx'=>10) -} -TkButton.new(bot) { - text "Return To Editor" - command "quit 'return'" - pack('side'=>'left', 'expand'=>'yes', 'padx'=>10) -} -bot.pack -root.pack('side'=>'top', 'fill'=>'both', 'expand'=>'yes') - -def quit(button) - print "You pressed the \"#{button}\" button; bye-bye!\n" - exit -end - -Tk.mainloop diff --git a/ext/tk/sample/tkfrom.rb b/ext/tk/sample/tkfrom.rb deleted file mode 100644 index 25f1d7c429..0000000000 --- a/ext/tk/sample/tkfrom.rb +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env ruby - -require "parsedate" -require "base64" - -include ParseDate - -class Mail - def Mail.new(f) - if !f.kind_of?(IO) - f = open(f, "r") - me = super(f) - f.close - else - me = super - end - return me - end - - def initialize(f) - @header = {} - @body = [] - while line = f.gets() - $_.chop! - next if /^From / =~ line # skip From-line - break if /^$/ =~ line # end of header - if /^(\S+):\s*(.*)/ =~ line - @header[attr = $1.capitalize] = $2 - elsif attr - sub(/^\s*/, '') - @header[attr] += "\n" + $_ - end - end - - return unless $_ - - while line = f.gets() - break if /^From / =~ line - @body.push($_) - end - end - - def header - return @header - end - - def body - return @body - end - -end - -if ARGV.length == 0 - if ENV['MAIL'] - ARGV[0] = ENV['MAIL'] - elsif ENV['USER'] - ARGV[0] = '/var/spool/mail/' + ENV['USER'] - elsif ENV['LOGNAME'] - ARGV[0] = '/var/spool/mail/' + ENV['LOGNAME'] - end -end - -require "tk" -list = scroll = nil -TkFrame.new{|f| - list = TkListbox.new(f) { - yscroll proc{|*idx| - scroll.set *idx - } - relief 'raised' -# geometry "80x5" - width 80 - height 5 - setgrid 'yes' - pack('side'=>'left','fill'=>'both','expand'=>'yes') - } - scroll = TkScrollbar.new(f) { - command proc{|idx| - list.yview *idx - } - pack('side'=>'right','fill'=>'y') - } - pack -} -root = Tk.root -TkButton.new(root) { - text 'Dismiss' - command proc {exit} - pack('fill'=>'both','expand'=>'yes') -} -root.bind "Control-c", proc{exit} -root.bind "Control-q", proc{exit} -root.bind "space", proc{exit} - -$outcount = 0; -for file in ARGV - next unless File.exist?(file) - atime = File.atime(file) - mtime = File.mtime(file) - f = open(file, "r") - begin - until f.eof - mail = Mail.new(f) - date = mail.header['Date'] - next unless date - from = mail.header['From'] - subj = mail.header['Subject'] - y = m = d = 0 - y, m, d = parsedate(date) if date - from = "sombody@somewhere" unless from - subj = "(nil)" unless subj - from = decode_b(from) - subj = decode_b(subj) - list.insert 'end', format('%-02d/%02d/%02d [%-28.28s] %s',y,m,d,from,subj) - $outcount += 1 - end - ensure - f.close - File.utime(atime, mtime, file) - list.see 'end' - end -end - -limit = 10000 -if $outcount == 0 - list.insert 'end', "You have no mail." - limit = 2000 -end -Tk.after limit, proc{ - exit -} -Tk.mainloop diff --git a/ext/tk/sample/tkhello.rb b/ext/tk/sample/tkhello.rb deleted file mode 100644 index ab236963e8..0000000000 --- a/ext/tk/sample/tkhello.rb +++ /dev/null @@ -1,10 +0,0 @@ -require "tk" - -TkButton.new(nil, - 'text' => 'hello', - 'command' => proc{print "hello\n"}).pack('fill'=>'x') -TkButton.new(nil, - 'text' => 'quit', - 'command' => proc{exit}).pack('fill'=>'x') - -Tk.mainloop diff --git a/ext/tk/sample/tkline.rb b/ext/tk/sample/tkline.rb deleted file mode 100644 index 2406b0749f..0000000000 --- a/ext/tk/sample/tkline.rb +++ /dev/null @@ -1,45 +0,0 @@ - -require "tkclass" - -$tkline_init = FALSE -def start_random - return if $tkline_init - $tkline_init = TRUE - if defined? Thread - Thread.start do - loop do - sleep 2 - Line.new($c, rand(400), rand(200), rand(400), rand(200)) - end - end - end -end - -$c = Canvas.new -$c.pack -$start_x = start_y = 0 - -def do_press(x, y) - $start_x = x - $start_y = y - $current_line = Line.new($c, x, y, x, y) - start_random -end -def do_motion(x, y) - if $current_line - $current_line.coords $start_x, $start_y, x, y - end -end - -def do_release(x, y) - if $current_line - $current_line.coords $start_x, $start_y, x, y - $current_line.fill 'black' - $current_line = nil - end -end - -$c.bind("1", proc{|e| do_press e.x, e.y}) -$c.bind("B1-Motion", proc{|x, y| do_motion x, y}, "%x %y") -$c.bind("ButtonRelease-1", proc{|x, y| do_release x, y}, "%x %y") -Tk.mainloop diff --git a/ext/tk/sample/tkmenubutton.rb b/ext/tk/sample/tkmenubutton.rb deleted file mode 100644 index 1c7f51000b..0000000000 --- a/ext/tk/sample/tkmenubutton.rb +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env ruby -# -# menubutton sample : based on sample menubuttons on the Tcl/Tk demo script -# -require 'tk' - -TkLabel.new(:text=>'Sample of TkMenubutton').pack(:side=>:top) - -TkFrame.new{|f| - pack(:side=>:top) - - - TkMenubutton.new(:parent=>f, :text=>'Right', :underline=>0, - :direction=>:right, :relief=>:raised){|mb| - menu TkMenu.new(:parent=>mb, :tearoff=>0){ - add(:command, :label=>'Right menu: first item', - :command=>proc{print 'You have selected the first item' + - " from the Right menu.\n"}) - add(:command, :label=>'Right menu: second item', - :command=>proc{print 'You have selected the second item' + - " from the Right menu.\n"}) - } - pack(:side=>:left, :padx=>25, :pady=>25) - } - - TkMenubutton.new(:parent=>f, :text=>'Below', :underline=>0, - :direction=>:below, :relief=>:raised){|mb| - menu(TkMenu.new(:parent=>mb, :tearoff=>0){ - add(:command, :label=>'Below menu: first item', - :command=>proc{print 'You have selected the first item' + - " from the Below menu.\n"}) - add(:command, :label=>'Below menu: second item', - :command=>proc{print 'You have selected the second item' + - " from the Below menu.\n"}) - }) - pack(:side=>:left, :padx=>25, :pady=>25) - } - - TkMenubutton.new(:parent=>f, :text=>'Above', :underline=>0, - :direction=>:above, :relief=>:raised){|mb| - menu TkMenu.new(:parent=>mb, :tearoff=>0){ - add(:command, :label=>'Above menu: first item', - :command=>proc{print 'You have selected the first item' + - " from the Above menu.\n"}) - add(:command, :label=>'Above menu: second item', - :command=>proc{print 'You have selected the second item' + - " from the Above menu.\n"}) - } - pack(:side=>:left, :padx=>25, :pady=>25) - } - - TkMenubutton.new(:parent=>f, :text=>'Left', :underline=>0, - :direction=>:left, :relief=>:raised){|mb| - menu(TkMenu.new(:parent=>mb, :tearoff=>0){ - add(:command, :label=>'Left menu: first item', - :command=>proc{print 'You have selected the first item' + - " from the Left menu.\n"}) - add(:command, :label=>'Left menu: second item', - :command=>proc{print 'You have selected the second item' + - " from the Left menu.\n"}) - }) - pack(:side=>:left, :padx=>25, :pady=>25) - } -} - -############################ -TkFrame.new(:borderwidth=>2, :relief=>:sunken, - :height=>5).pack(:side=>:top, :fill=>:x, :padx=>20) -############################ - -TkLabel.new(:text=>'Sample of TkOptionMenu').pack(:side=>:top) - -colors = %w(Black red4 DarkGreen NavyBlue gray75 Red Green Blue gray50 - Yellow Cyan Magenta White Brown DarkSeaGreen DarkViolet) - -TkFrame.new{|f| - pack(:side=>:top) - - b1 = TkOptionMenubutton . - new(:parent=>f, :values=>%w(one two three)) . - pack(:side=>:left, :padx=>25, :pady=>25) - - b2 = TkOptionMenubutton.new(:parent=>f, :values=>colors) {|optMB| - colors.each{|color| - no_sel = TkPhotoImage.new(:height=>16, :width=>16){ - put 'gray50', *[ 0, 0, 16, 1] - put 'gray50', *[ 0, 1, 1, 16] - put 'gray75', *[ 0, 15, 16, 16] - put 'gray75', *[15, 1, 16, 16] - put color, *[ 1, 1, 15, 15] - } - sel = TkPhotoImage.new(:height=>16, :width=>16){ - put 'Black', *[ 0, 0, 16, 2] - put 'Black', *[ 0, 2, 2, 16] - put 'Black', *[ 2, 14, 16, 16] - put 'Black', *[14, 2, 16, 14] - put color, *[ 2, 2, 14, 14] - } - optMB.entryconfigure(color, :hidemargin=>1, - :image=>no_sel, :selectimage=>sel) - } - optMB.menuconfigure(:tearoff, 1) - %w(Black gray75 gray50 White).each{|color| - optMB.entryconfigure(color, :columnbreak=>true) - } - pack(:side=>:left, :padx=>25, :pady=>25) - } - - TkButton.new(:parent=>f){ - text 'show values' - command proc{p [b1.value, b2.value]} - pack(:side=>:left, :padx=>25, :pady=>5, :anchor=>:s) - } -} - -############################ -TkFrame.new(:borderwidth=>2, :relief=>:sunken, - :height=>5).pack(:side=>:top, :fill=>:x, :padx=>20) -############################ - -root = TkRoot.new(:title=>'menubutton samples') - -TkButton.new(root, :text=>'exit', :command=>proc{exit}){ - pack(:side=>:top, :padx=>25, :pady=>5, :anchor=>:e) -} - -# VirtualEvent <<MenuSelect>> on Tcl/Tk ==> '<MenuSelect>' on Ruby/Tk -# ( remove the most external <, > for Ruby/Tk notation ) -TkMenu.bind('<MenuSelect>', proc{|widget| - p widget.entrycget('active', :label) - }, '%W') - -############################ - -Tk.mainloop diff --git a/ext/tk/sample/tkmultilistbox.rb b/ext/tk/sample/tkmultilistbox.rb deleted file mode 100644 index 1896c66dac..0000000000 --- a/ext/tk/sample/tkmultilistbox.rb +++ /dev/null @@ -1,651 +0,0 @@ -# -# tkmultilistbox.rb : multiple listbox widget -# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) -# -require 'tk' - -class TkMultiListbox < TkListbox - include TkComposite - - # lbox_height : height of listboxes (pixel) - # title_info : array [ [<title_string>,<init_width>], ... ] - # keys : hash {<option>=><value>, ... } - def initialize_composite(lbox_height, title_info, keys={}) - # argument check - if (! title_info.kind_of? Array) or (title_info.size < 2) - raise - end - - # decide total width - @width_total = 0 - title_info.each{|title, width| @width_total += width.to_f} - - # virtical scrollbar - @v_scroll = TkScrollbar.new(@frame, 'orient'=>'vertical') - - # init arrays - @base_list = [] - @rel_list = [] - @title_list = [] - @lbox_list = [] - @hscr_list = [] - - # rel-table of label=>index - @name_index = {} - - # create base flames - @f_title = TkFrame.new(@frame, 'width'=>@width_total) - @f_lbox = TkFrame.new(@frame, - 'width'=>@width_total, 'height'=>lbox_height) - @f_hscr = TkFrame.new(@frame, 'width'=>@width_total, - 'height'=>@v_scroll.cget('width') + - 2 * @v_scroll.cget('borderwidth')) - - # dummy label to keep the hight of title space - TkLabel.new(@f_title, 'text'=>' ').pack - - # create each listbox - sum = 0.0 - @rel_list << sum/@width_total - title_info.each_with_index{|(label, width), idx| - # set relation between label and index - if @name_index.include?(label) - @name_index[label] << idx - else - @name_index[label] = [idx] - end - - # calculate relative positioning - sum += width - @rel_list << sum/@width_total - - # title field - f = TkFrame.new(@f_title, 'width'=>width) - base = [f] - @title_list << TkLabel.new(f, 'text'=>label).pack('fill'=>'x') - f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>-6, - 'relwidth'=>@rel_list[idx+1] - @rel_list[idx]) - - # listbox field - f = TkFrame.new(@f_lbox, 'width'=>width) - base << f - @lbox_list << TkListbox.new(f).pack('fill'=>'both', 'expand'=>true) - f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>-4, - 'relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relheight'=>1.0) - - # scrollbar field - f = TkFrame.new(@f_hscr, 'width'=>width) - base << f - @hscr_list << TkScrollbar.new(f, 'orient'=>'horizontal') . - pack('fill'=>'x', 'anchor'=>'w') - f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>-4, - 'relwidth'=>@rel_list[idx+1] - @rel_list[idx]) - - @lbox_list[idx].xscrollcommand proc{|first, last| - @hscr_list[idx].set first, last - } - @hscr_list[idx].command proc{|*args| @lbox_list[idx].xview *args} - - # add new base - @base_list << base - } - - # create tab - @tab_list = [nil] - (1..(@rel_list.size - 2)).each{|idx| - tab = TkFrame.new(@f_title, 'cursor'=>'sb_h_double_arrow', - 'width'=>6, 'borderwidth'=>2, 'relief'=>'raised') - @tab_list << tab - tab.place('relx'=>@rel_list[idx], 'anchor'=>'ne', 'relheight'=>0.95) - tab.bind('Button-1', - proc{|x| @x = x; @frame_width = TkWinfo.width(@f_title).to_f}, - '%X') - tab.bind('B1-Motion', proc{|x, idx| resize(x, idx.to_i)}, "%X #{idx}") - } - - # set control procedure for virtical scroll - @lbox_list.each{|lbox| - lbox.yscrollcommand proc{|first, last| - @v_scroll.set first, last - idx = lbox.nearest(0) - @lbox_list.each{|l| l.yview(idx)} - } - } - @v_scroll.command proc{|*args| @lbox_list.each{|lbox| lbox.yview *args} } - - # binding for listboxes - @mode = {} - @mode['browse'] = browse_mode_bindtag - @mode['single'] = single_mode_bindtag - @mode['extended'] = extended_mode_bindtag - @mode['multiple'] = multiple_mode_bindtag - @current_mode = 'browse' - @lbox_list.each{|l| - l.bind('Shift-Key-Left', - proc{|w| focus_shift(w, -1); Tk.callback_break}, '%W') - l.bind('Shift-Key-Right', - proc{|w| focus_shift(w, 1); Tk.callback_break}, '%W') - - l.bind('Button-2', proc{|x, y| - @lbox_list.each{|lbox| lbox.scan_mark(x, y)} - }, '%x %y') - l.bind('B2-Motion', proc{|x, y| - @lbox_list.each{|lbox| lbox.scan_dragto(x, y)} - }, '%x %y') - - l.bindtags(l.bindtags.unshift(@mode[@current_mode])) - } - - # alignment - TkGrid.rowconfigure(@frame, 0, 'weight'=>0) - TkGrid.rowconfigure(@frame, 1, 'weight'=>1) - TkGrid.rowconfigure(@frame, 2, 'weight'=>0) - TkGrid.columnconfigure(@frame, 0, 'weight'=>1) - TkGrid.columnconfigure(@frame, 1, 'weight'=>0) - @v_scroll.grid('row'=>1, 'column'=>1, 'sticky'=>'ns') - @f_title.grid('row'=>0, 'column'=>0, 'sticky'=>'news') - @f_lbox.grid('row'=>1, 'column'=>0, 'sticky'=>'news') - @f_hscr.grid('row'=>2, 'column'=>0, 'sticky'=>'ew') - - # binding for 'Configure' event - @frame.bind('Configure', proc{reconstruct}) - - # set default receiver of method calls - @path = @lbox_list[0].path - - # configure options - keys = {} unless keys - keys = _symbolkey2str(keys) - - # 'mode' option of listboxes - sel_mode = keys.delete('mode') - mode(sel_mode) if sel_mode - - # 'scrollbarwidth' option == 'width' option of scrollbars - width = keys.delete('scrollbarwidth') - scrollbarwidth(width) if width - - # options for listbox titles - title_font = keys.delete('titlefont') - title_fg = keys.delete('titleforeground') - title_bg = keys.delete('titlebackground') - if title_font or title_fg or title_bg - titleconfig(title_font, title_fg, title_bg) - end - - # set receivers for configure methods - delegate('DELETE', *@lbox_list) - delegate('activebackground', @v_scroll, *@hscr_list) - delegate('troughcolor', @v_scroll, *@hscr_list) - delegate('repeatdelay', @v_scroll, *@hscr_list) - delegate('repeatinterval', @v_scroll, *@hscr_list) - delegate('borderwidth', @frame) - delegate('relief', @frame) - end - private :initialize_composite - - # set 'mode' option of listboxes - def mode(sel_mode) - @lbox_list.each{|l| - tags = l.bindtags - tags = tags - [ @mode[@current_mode] ] - l.bindtags(tags.unshift(@mode[sel_mode])) - @current_mode = sel_mode - } - end - - # set scrollbar width - def scrollbarwidth(width) - @v_scroll['width'] = width - @hscr_list.each{|hscr| hscr['width'] = width} - @f_hscr['height'] = width + 2 * @v_scroll.cget('borderwidth') - end - - # set options of titles - def titleconfig(font, fg, bg) - keys = {} - keys['font'] = font if font - keys['foreground'] = fg if fg - keys['background'] = bg if bg - @title_list.each{|label| label.configure(keys)} - end - - # get label widgets of listbox titles - def titlelabels(*indices) - @title_list[*indices] - end - - # get listbox widgets - def columns(*indices) - @lbox_list[*indices] - end - - def activate(idx) - @lbox_list.each{|lbox| lbox.activate(idx)} - end - - def bbox(idx) - @lbox_list.collect{|lbox| lbox.bbox(idx)} - end - - def delete(*idx) - @lbox_list.collect{|lbox| lbox.delete(*idx)} - end - - def get(*idx) - if idx.size == 1 - @lbox_list.collect{|lbox| lbox.get(*idx)} - else - list = @lbox_list.collect{|lbox| lbox.get(*idx)} - result = [] - list[0].each_with_index{|line, index| - result << list.collect{|lines| lines[index]} - } - result - end - end - - def _line_array_to_hash(line) - result = {} - @name_index.each_pair{|label, indices| - if indices.size == 1 - result[label] = line[indices[0]] - else - result[label] = indices.collect{|index| line[index]} - end - } - result - end - private :_line_array_to_hash - - def get_by_hash(*idx) - get_result = get(*idx) - if idx.size == 1 - _line_array_to_hash(get_result) - else - get_result.collect{|line| _line_array_to_hash(line)} - end - end - - def insert(idx, *lines) - lbox_ins = [] - (0..@lbox_list.size).each{lbox_ins << []} - - lines.each{|line| - if line.kind_of? Hash - array = [] - @name_index.each_pair{|label, indices| - if indices.size == 1 - array[indices[0]] = line[label] - else - if line[label].kind_of? Array - indices.each_with_index{|index, num| - array[index] = line[label][num] - } - else - array[indices[0]] = line[label] - end - end - } - line = array - end - - @name_index.each_pair{|label, indices| - if indices.size == 1 - lbox_ins[indices[0]] << line[indices[0]] - else - indices.each{|index| lbox_ins[index] << line[index]} - end - } - } - - @lbox_list.each_with_index{|lbox, index| - lbox.insert(idx, *lbox_ins[index]) if lbox_ins[index] - } - end - - def selection_anchor(index) - @lbox_list.each{|lbox| lbox.selection_anchor(index)} - end - - def selection_clear(first, last=None) - @lbox_list.each{|lbox| lbox.selection_clear(first, last=None)} - end - - def selection_set(first, last=None) - @lbox_list.each{|lbox| lbox.selection_set(first, last=None)} - end - - ########################################### - private - - def reconstruct - (0..(@rel_list.size - 2)).each{|idx| - title, lbox, hscr = @base_list[idx] - title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx]) - lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], - 'relheight'=>1.0) - hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx]) - - tab = @tab_list[idx] - tab.place('relx'=>@rel_list[idx]) if tab - } - end - - def resize(x, idx) - # adjustment of relative positioning - delta = (x - @x) / @frame_width - if delta < @rel_list[idx-1] - @rel_list[idx] + 0.02 - delta = @rel_list[idx-1] - @rel_list[idx] + 0.02 - elsif delta > @rel_list[idx+1] - @rel_list[idx] - 0.02 - delta = @rel_list[idx+1] - @rel_list[idx] - 0.02 - end - @rel_list[idx] += delta - - # adjustment of leftside widget of the tab - title, lbox, hscr = @base_list[idx - 1] - title.place('relwidth'=>@rel_list[idx] - @rel_list[idx-1]) - lbox.place('relwidth'=>@rel_list[idx] - @rel_list[idx-1], 'relheight'=>1.0) - hscr.place('relwidth'=>@rel_list[idx] - @rel_list[idx-1]) - - # adjustment of the tab position - @tab_list[idx].place('relx'=>@rel_list[idx]) - - # adjustment of rightside widget of the tab - title, lbox, hscr = @base_list[idx] - title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], - 'relx'=>@rel_list[idx]) - lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], - 'relx'=>@rel_list[idx], 'relheight'=>1.0) - hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], - 'relx'=>@rel_list[idx]) - - # update reference position - @x = x - end - - ################################# - def browse_mode_bindtag - t = TkBindTag.new - t.bind('Button-1', - proc{|w, y| w.focus; select_line(w, w.nearest(y))}, '%W %y') - t.bind('B1-Motion', proc{|w, y| select_line(w, w.nearest(y))}, '%W %y') - - t.bind('Shift-Button-1', - proc{|w, y| active_line(w, w.nearest(y))}, '%W %y') - - t.bind('Key-Up', proc{|w| select_shift(w, -1)}, '%W') - t.bind('Key-Down', proc{|w| select_shift(w, 1)}, '%W') - - t.bind('Control-Home', proc{|w| select_line(w, 0)}, '%W') - t.bind('Control-End', proc{|w| select_line(w, 'end')}, '%W') - - t.bind('space', proc{|w| select_line(w, w.index('active').to_i)}, '%W') - t.bind('Select', proc{|w| select_line(w, w.index('active').to_i)}, '%W') - t.bind('Control-slash', - proc{|w| select_line(w, w.index('active').to_i)}, '%W') - - t - end - - ######################## - def single_mode_bindtag - t = TkBindTag.new - t.bind('Button-1', - proc{|w, y| w.focus; select_only(w, w.nearest(y))}, '%W %y') - t.bind('ButtonRelease-1', - proc{|w, y| active_line(w, w.nearest(y))}, '%W %y') - - t.bind('Shift-Button-1', - proc{|w, y| active_line(w, w.nearest(y))}, '%W %y') - - t.bind('Key-Up', proc{|w| select_shift(w, -1)}, '%W') - t.bind('Key-Down', proc{|w| select_shift(w, 1)}, '%W') - - t.bind('Control-Home', proc{|w| select_line(w, 0)}, '%W') - t.bind('Control-End', proc{|w| select_line(w, 'end')}, '%W') - - t.bind('space', proc{|w| select_line(w, w.index('active').to_i)}, '%W') - t.bind('Select', proc{|w| select_line(w, w.index('active').to_i)}, '%W') - t.bind('Control-slash', - proc{|w| select_line(w, w.index('active').to_i)}, '%W') - t.bind('Control-backslash', - proc{@lbox_list.each{|l| l.selection_clear(0, 'end')}}) - - t - end - - ######################## - def extended_mode_bindtag - t = TkBindTag.new - t.bind('Button-1', - proc{|w, y| w.focus; select_only(w, w.nearest(y))}, '%W %y') - t.bind('B1-Motion', proc{|w, y| select_range(w, w.nearest(y))}, '%W %y') - - t.bind('ButtonRelease-1', - proc{|w, y| active_line(w, w.nearest(y))}, '%W %y') - - t.bind('Shift-Button-1', - proc{|w, y| select_range(w, w.nearest(y))}, '%W %y') - t.bind('Shift-B1-Motion', - proc{|w, y| select_range(w, w.nearest(y))}, '%W %y') - - t.bind('Control-Button-1', - proc{|w, y| select_toggle(w, w.nearest(y))}, '%W %y') - - t.bind('Control-B1-Motion', - proc{|w, y| select_drag(w, w.nearest(y))}, '%W %y') - - t.bind('Key-Up', proc{|w| active_shift(w, -1)}, '%W') - t.bind('Key-Down', proc{|w| active_shift(w, 1)}, '%W') - - t.bind('Shift-Up', proc{|w| select_expand(w, -1)}, '%W') - t.bind('Shift-Down', proc{|w| select_expand(w, 1)}, '%W') - - t.bind('Control-Home', proc{|w| select_line2(w, 0)}, '%W') - t.bind('Control-End', proc{|w| select_line2(w, 'end')}, '%W') - - t.bind('Control-Shift-Home', proc{|w| select_range(w, 0)}, '%W') - t.bind('Control-Shift-End', proc{|w| select_range(w, 'end')}, '%W') - - t.bind('space', proc{|w| select_active(w)}, '%W') - t.bind('Select', proc{|w| select_active(w)}, '%W') - t.bind('Control-slash', proc{|w| select_all}, '%W') - t.bind('Control-backslash', proc{|w| clear_all}, '%W') - - t - end - - ######################## - def multiple_mode_bindtag - t = TkBindTag.new - t.bind('Button-1', - proc{|w, y| w.focus; select_line3(w, w.nearest(y))}, '%W %y') - t.bind('ButtonRelease-1', - proc{|w, y| active_line(w, w.nearest(y))}, '%W %y') - - t.bind('Key-Up', proc{|w| active_shift(w, -1)}, '%W') - t.bind('Key-Down', proc{|w| active_shift(w, 1)}, '%W') - - t.bind('Control-Home', proc{|w| select_line2(w, 0)}, '%W') - t.bind('Control-End', proc{|w| select_line2(w, 'end')}, '%W') - - t.bind('Control-Shift-Home', proc{|w| active_line(w, 0)}, '%W') - t.bind('Control-Shift-End', proc{|w| active_line(w, 'end')}, '%W') - - t.bind('space', proc{|w| select_active(w)}, '%W') - t.bind('Select', proc{|w| select_active(w)}, '%W') - t.bind('Control-slash', proc{|w| select_all}, '%W') - t.bind('Control-backslash', proc{|w| clear_all}, '%W') - - t - end - - ######################## - def active_line(w, idx) - @lbox_list.each{|l| l.activate(idx)} - end - - def select_only(w, idx) - @lbox_list.each{|l| - l.selection_clear(0, 'end') - l.selection_anchor(idx) - l.selection_set('anchor') - } - end - - def select_range(w, idx) - @lbox_list.each{|l| - l.selection_clear(0, 'end') - l.selection_set('anchor', idx) - } - end - - def select_toggle(w, idx) - st = w.selection_includes(idx) - @lbox_list.each{|l| - l.selection_anchor(idx) - if st == 1 - l.selection_clear(idx) - else - l.selection_set(idx) - end - } - end - - def select_drag(w, idx) - st = w.selection_includes('anchor') - @lbox_list.each{|l| - if st == 1 - l.selection_set('anchor', idx) - else - l.selection_clear('anchor', idx) - end - } - end - - def select_line(w, idx) - @lbox_list.each{|l| - l.selection_clear(0, 'end') - l.activate(idx) - l.selection_anchor(idx) - l.selection_set('anchor') - } - w.selection_set('anchor') - end - - def select_line2(w, idx) - @lbox_list.each{|l| - l.activate(idx) - l.selection_anchor(idx) - l.selection_set('anchor') - } - end - - def select_line3(w, idx) - @lbox_list.each{|l| - l.selection_set(idx) - } - end - - def select_active(w) - idx = l.activate(idx) - @lbox_list.each{|l| - l.selection_set(idx) - } - end - - def select_expand(w, dir) - idx = w.index('active').to_i + dir - if idx < 0 - idx = 0 - elsif idx >= w.size - idx = w.size - 1 - end - @lbox_list.each{|l| - l.activate(idx) - l.selection_set(idx) - } - end - - def active_shift(w, dir) - idx = w.index('active').to_i + dir - if idx < 0 - idx = 0 - elsif idx >= w.size - idx = w.size - 1 - end - @lbox_list.each{|l| - l.activate(idx) - l.selection_anchor(idx) - } - end - - def select_shift(w, dir) - idx = w.index('anchor').to_i + dir - if idx < 0 - idx = 0 - elsif idx >= w.size - idx = w.size - 1 - end - @lbox_list.each{|l| - l.selection_clear(0, 'end') - l.activate(idx) - l.selection_anchor(idx) - l.selection_set('anchor') - } - end - - def select_all - @lbox_list.each{|l| - l.selection_set(0, 'end') - } - end - - def clear_all - @lbox_list.each{|l| - l.selection_clear(0, 'end') - } - end - - def focus_shift(w, dir) - idx = @lbox_list.index(w) + dir - return if idx < 0 - return if idx >= @lbox_list.size - @lbox_list[idx].focus - end - ######################## -end - -################################################ -# test -################################################ -if __FILE__ == $0 - f = TkFrame.new(nil, 'width'=>300, - 'height'=>200).pack('fill'=>'both', 'expand'=>'true') - #f = TkFrame.new.pack('fill'=>'both', 'expand'=>'true') - l = TkMultiListbox.new(f, 150, - [ ['L1', 100], - ['L2', 200], - ['L3', 50] ], - 'titlefont'=>'courier', - 'titleforeground'=>'yellow', - 'titlebackground'=>'navy' - ).pack('fill'=>'both', 'expand'=>true) - l.insert('end', [1,2,3]) - l.insert('end', [4,5,6]) - l.insert('end', [4,5,6], [4,5,6]) - l.insert('end', ['aaaaaaaaaaaaaaa','bbbbbbbbbbbbbb','ccccccccccccccccc']) - l.insert('end', [1,2,3]) - l.insert('end', [4,5,6], [4,5,6]) - l.insert('end', ['aaaaaaaaaaaaaaa','bbbbbbbbbbbbbb','ccccccccccccccccc']) - l.insert('end', [1,2,3]) - l.insert('end', [4,5,6], [4,5,6]) - l.insert('end', ['aaaaaaaaaaaaaaa','bbbbbbbbbbbbbb','ccccccccccccccccc']) - l.insert('end', [1,2,3]) - l.insert('end', [4,5,6], [4,5,6]) - p l.columns(1) - p l.columns(1..3) - p l.columns(1,2) - Tk.mainloop -end diff --git a/ext/tk/sample/tkoptdb-safeTk.rb b/ext/tk/sample/tkoptdb-safeTk.rb deleted file mode 100644 index a5e394b230..0000000000 --- a/ext/tk/sample/tkoptdb-safeTk.rb +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env ruby - -require 'multi-tk' - -TkMessage.new(:text => <<EOM).pack -This is a sample of the safe-Tk slave interpreter. \ -On the slave interpreter, 'tkoptdb.rb' demo is running. -( Attention:: a safe-Tk interpreter can't read options \ -from a file. Options are given by the master interpreter \ -in this script. ) -The window shown this message is a root widget of \ -the default master interpreter. The other window \ -is a toplevel widget of the master interpreter, and it \ -has a container frame of the safe-Tk slave interpreter. \ -You can delete the slave by the button on the toplevel widget. -EOM - -if ENV['LANG'] =~ /^ja/ - # read Japanese resource - ent = TkOptionDB.read_entries(File.expand_path('resource.ja', - File.dirname(__FILE__)), - 'euc-jp') -else - # read English resource - ent = TkOptionDB.read_entries(File.expand_path('resource.en', - File.dirname(__FILE__))) -end -file = File.expand_path('tkoptdb.rb', File.dirname(__FILE__)) -MultiTkIp.new_safeTk{ - ent.each{|pat, val| TkOptionDB.add(pat, val)} - load file -} -# Tk.mainloop is ignored on the slave-IP - -Tk.mainloop diff --git a/ext/tk/sample/tkoptdb.rb b/ext/tk/sample/tkoptdb.rb deleted file mode 100644 index 897701c222..0000000000 --- a/ext/tk/sample/tkoptdb.rb +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env ruby -# -# sample script of TkOptionDB -# -# If 'LANG' environment variable's value is started by 'ja', -# then read Japanese resource data and display Japanese button text. -# In other case, read English resource data and display English text. -# -require "tk" - -if __FILE__ == $0 || !TkCore::INTERP.safe? - if ENV['LANG'] =~ /^ja/ - # read Japanese resource - TkOptionDB.read_with_encoding(File.expand_path('resource.ja', - File.dirname(__FILE__)), - 'euc-jp') - else - # read English resource - TkOptionDB.readfile(File.expand_path('resource.en', - File.dirname(__FILE__))) - end -end - -# 'show_msg' and 'bye_msg' procedures can be defined on BTN_CMD resource. -# Those procedures are called under $SAFE==2 -cmd = TkOptionDB.new_proc_class(:BTN_CMD, [:show_msg, :bye_msg], 3) { - # If you want to check resource string (str), - # please define __check_proc_string__(str) like this. - class << self - def __check_proc_string__(str) - print "($SAFE=#{$SAFE} >>>) check!! str.tainted?::#{str.tainted?}" - str.untaint - print "==>#{str.tainted?} (<<< $SAFE=#{$SAFE}): " - str - end - private :__check_proc_string__ - end -} - -# following two frame widgets use same database entry -TkFrame.new(:class=>'BtnFrame'){|f| - pack(:padx=>5, :pady=>5) - TkButton.new(:parent=>f, :widgetname=>'hello'){ - command proc{ - print "($SAFE=#{$SAFE} >>>) : " - cmd.show_msg(TkOptionDB.inspect) - print "(<<< $SAFE=#{$SAFE})" - } - pack(:fill=>:x, :padx=>10, :pady=>10) - } - TkButton.new(:command=>proc{ - print "($SAFE=#{$SAFE} >>>) : " - cmd.bye_msg - print "(<<< $SAFE=#{$SAFE} ) : " - exit - }, - :parent=>f, :widgetname=>'quit'){ - pack(:fill=>:x, :padx=>10, :pady=>10) - } -} - -class BtnFrame < TkFrame; end -BtnFrame.new{|f| - pack(:padx=>5, :pady=>5) - TkButton.new(:parent=>f, :widgetname=>'hello'){ - command proc{ - print "($SAFE=#{$SAFE} >>>) : " - cmd.show_msg(TkOptionDB.inspect) - print "(<<< $SAFE=#{$SAFE})" - } - pack(:fill=>:x, :padx=>10, :pady=>10) - } - TkButton.new(:command=>proc{ - print "($SAFE=#{$SAFE} >>>) : " - cmd.bye_msg - print "(<<< $SAFE=#{$SAFE})" - exit - }, - :parent=>f, :widgetname=>'quit'){ - pack(:fill=>:x, :padx=>10, :pady=>10) - } -} - -# if unknown class, use default option values -TkFrame.new(:class=>'BtnFrame2'){|f| - pack(:padx=>5, :pady=>5) - TkButton.new(:parent=>f, :widgetname=>'hello'){ - command proc{ - print "($SAFE=#{$SAFE} >>>) : " - cmd.show_msg(TkOptionDB.inspect) - print "(<<< $SAFE=#{$SAFE})" - } - pack(:fill=>:x, :padx=>10, :pady=>10) - } - TkButton.new(:command=>proc{ - print "($SAFE=#{$SAFE} >>>) : " - cmd.bye_msg - print "(<<< $SAFE=#{$SAFE})" - exit - }, - :parent=>f, :widgetname=>'quit'){ - pack(:fill=>:x, :padx=>10, :pady=>10) - } -} - -Tk.mainloop diff --git a/ext/tk/sample/tktextframe.rb b/ext/tk/sample/tktextframe.rb deleted file mode 100644 index 78efdf0970..0000000000 --- a/ext/tk/sample/tktextframe.rb +++ /dev/null @@ -1,106 +0,0 @@ -# -# tktextframe.rb : a sample of TkComposite -# -# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) -# -require 'tk' - -class TkTextFrame < TkText - include TkComposite - - def initialize_composite(keys={}) - keys = _symbolkey2str(keys) - - # create scrollbars - @v_scroll = TkScrollbar.new(@frame, 'orient'=>'vertical') - @h_scroll = TkScrollbar.new(@frame, 'orient'=>'horizontal') - - # create a text widget - @text = TkText.new(@frame, 'wrap'=>'none') - - # set default receiver of method calls - @path = @text.path - - # assign scrollbars - @text.xscrollbar(@h_scroll) - @text.yscrollbar(@v_scroll) - - # allignment - TkGrid.rowconfigure(@frame, 0, 'weight'=>1, 'minsize'=>0) - TkGrid.columnconfigure(@frame, 0, 'weight'=>1, 'minsize'=>0) - @text.grid('row'=>0, 'column'=>0, 'sticky'=>'news') - - # scrollbars ON - vscroll(keys.delete('vscroll'){true}) - hscroll(keys.delete('hscroll'){true}) - - # set background of the text widget - color = keys.delete('textbackground') - textbackground(color) if color - - # set receiver widgets for configure methods - delegate('DEFAULT', @text) - delegate('background', @frame, @h_scroll, @v_scroll) - delegate('activebackground', @h_scroll, @v_scroll) - delegate('troughcolor', @h_scroll, @v_scroll) - delegate('repeatdelay', @h_scroll, @v_scroll) - delegate('repeatinterval', @h_scroll, @v_scroll) - delegate('borderwidth', @frame) - delegate('relief', @frame) - - # do configure - configure keys unless keys.empty? - end - private :initialize_composite - - # set background color of text widget - def textbackground(color = nil) - if color - @text.background(color) - else - @text.background - end - end - - # vertical scrollbar : ON/OFF - def vscroll(mode) - st = TkGrid.info(@v_scroll) - if mode && st == [] then - @v_scroll.grid('row'=>0, 'column'=>1, 'sticky'=>'ns') - elsif !mode && st != [] then - @v_scroll.ungrid - end - self - end - - # horizontal scrollbar : ON/OFF - def hscroll(mode, wrap_mode="char") - st = TkGrid.info(@h_scroll) - if mode && st == [] then - @h_scroll.grid('row'=>1, 'column'=>0, 'sticky'=>'ew') - wrap 'none' # => self.wrap('none') - elsif !mode && st != [] then - @h_scroll.ungrid - wrap wrap_mode # => self.wrap(wrap_mode) - end - self - end -end - - -################################################ -# test -################################################ -if __FILE__ == $0 - f = TkFrame.new.pack('fill'=>'x') - t = TkTextFrame.new.pack - TkButton.new(f, 'text'=>'vscr OFF', - 'command'=>proc{t.vscroll(false)}).pack('side'=>'right') - TkButton.new(f, 'text'=>'vscr ON', - 'command'=>proc{t.vscroll(true)}).pack('side'=>'right') - TkButton.new(f, 'text'=>'hscr ON', - 'command'=>proc{t.hscroll(true)}).pack('side'=>'left') - TkButton.new(f, 'text'=>'hscr OFF', - 'command'=>proc{t.hscroll(false)}).pack('side'=>'left') - Tk.mainloop -end diff --git a/ext/tk/sample/tktimer.rb b/ext/tk/sample/tktimer.rb deleted file mode 100644 index b1adb5b506..0000000000 --- a/ext/tk/sample/tktimer.rb +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env ruby -# This script generates a counter with start and stop buttons. - -require "tk" -$label = TkLabel.new { - text '0.00' - relief 'raised' - width 10 - pack('side'=>'bottom', 'fill'=>'both') -} - -TkButton.new { - text 'Start' - command proc { - if $stopped - $stopped = FALSE - tick - end - } - pack('side'=>'left','fill'=>'both','expand'=>'yes') -} -TkButton.new { - text 'Stop' - command proc{ - exit if $stopped - $stopped = TRUE - } - pack('side'=>'right','fill'=>'both','expand'=>'yes') -} - -$seconds=0 -$hundredths=0 -$stopped=TRUE - -def tick - if $stopped then return end - Tk.after 50, proc{tick} - $hundredths+=5 - if $hundredths >= 100 - $hundredths=0 - $seconds+=1 - end - $label.text format("%d.%02d", $seconds, $hundredths) -end - -root = Tk.root -root.bind "Control-c", proc{root.destroy} -root.bind "Control-q", proc{root.destroy} -Tk.root.focus -Tk.mainloop diff --git a/ext/tk/sample/tktimer2.rb b/ext/tk/sample/tktimer2.rb deleted file mode 100644 index dd31bb098e..0000000000 --- a/ext/tk/sample/tktimer2.rb +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env ruby -# This script is a re-implementation of tktimer.rb with TkTimer(TkAfter) class. - -require "tk" - -# new notation : -# * symbols are acceptable as keys or values of the option hash -# * the parent widget can be given by :parent key on the option hash -root = TkRoot.new(:title=>'timer sample') -label = TkLabel.new(:parent=>root, :relief=>:raised, :width=>10) \ - .pack(:side=>:bottom, :fill=>:both) - -# define the procedure repeated by the TkTimer object -tick = proc{|aobj| #<== TkTimer object - cnt = aobj.return_value + 5 # return_value keeps a result of the last proc - label.text format("%d.%02d", *(cnt.divmod(100))) - cnt #==> return value is kept by TkTimer object - # (so, can be send to the next repeat-proc) -} - -timer = TkTimer.new(50, -1, tick).start(0, proc{ label.text('0.00'); 0 }) - # ==> repeat-interval : (about) 50 ms, - # repeat : infinite (-1) times, - # repeat-procedure : tick (only one, in this case) - # - # ==> wait-before-call-init-proc : 0 ms, - # init_proc : proc{ label.text('0.00'); 0 } - # - # (0ms)-> init_proc ->(50ms)-> tick ->(50ms)-> tick ->.... - -TkButton.new(:text=>'Start') { - command proc{ timer.continue unless timer.running? } - pack(:side=>:left, :fill=>:both, :expand=>true) -} -TkButton.new(:text=>'Restart') { - command proc{ timer.restart(0, proc{ label.text('0.00'); 0 }) } - pack(:side=>:left, :fill=>:both, :expand=>true) -} -TkButton.new(:text=>'Stop') { - command proc{ timer.stop if timer.running? } - pack('side'=>'right','fill'=>'both','expand'=>'yes') -} - -ev_quit = TkVirtualEvent.new('Control-c', 'Control-q') -Tk.root.bind(ev_quit, proc{Tk.exit}).focus - -Tk.mainloop diff --git a/ext/tk/sample/tktimer3.rb b/ext/tk/sample/tktimer3.rb deleted file mode 100644 index e3bb4c3e4a..0000000000 --- a/ext/tk/sample/tktimer3.rb +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env ruby -# This script is a re-implementation of tktimer.rb with TkTimer(TkAfter) class. - -require "tk" - -# new notation : -# * symbols are acceptable as keys or values of the option hash -# * the parent widget can be given by :parent key on the option hash -root = TkRoot.new(:title=>'timer sample') -label = TkLabel.new(:parent=>root, :relief=>:raised, :width=>10) \ - .pack(:side=>:bottom, :fill=>:both) - -# define the procedure repeated by the TkTimer object -tick = proc{|aobj| #<== TkTimer object - cnt = aobj.return_value + 5 # return_value keeps a result of the last proc - label.text format("%d.%02d", *(cnt.divmod(100))) - cnt #==> return value is kept by TkTimer object - # (so, can be send to the next repeat-proc) -} - -timer = TkTimer.new(50, -1, tick).start(0, proc{ label.text('0.00'); 0 }) - # ==> repeat-interval : (about) 50 ms, - # repeat : infinite (-1) times, - # repeat-procedure : tick (only one, in this case) - # - # ==> wait-before-call-init-proc : 0 ms, - # init_proc : proc{ label.text('0.00'); 0 } - # - # (0ms)-> init_proc ->(50ms)-> tick ->(50ms)-> tick ->.... - -b_start = TkButton.new(:text=>'Start', :state=>:disabled) { - pack(:side=>:left, :fill=>:both, :expand=>true) -} - -b_stop = TkButton.new(:text=>'Stop', :state=>:normal) { - pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes') -} - -b_start.command { - timer.continue - b_stop.state(:normal) - b_start.state(:disabled) -} - -b_stop.command { - timer.stop - b_start.state(:normal) - b_stop.state(:disabled) -} - -TkButton.new(:text=>'Reset', :state=>:normal) { - command { timer.reset } - pack(:side=>:right, :fill=>:both, :expand=>:yes) -} - -ev_quit = TkVirtualEvent.new('Control-c', 'Control-q') -Tk.root.bind(ev_quit, proc{Tk.exit}).focus - -Tk.mainloop |
