rwddemo 0.8 → 0.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. data/Readme.txt +46 -0
  2. data/code/{ag1core/aa0begin.rb → 01rwdcore/01rwdcore.rb} +2 -0
  3. data/code/01rwdcore/02helptexthashbegin.rb +4 -0
  4. data/code/01rwdcore/03helptexthash.rb +31 -0
  5. data/code/01rwdcore/04helptextend.rb +6 -0
  6. data/code/01rwdcore/openhelpwindow.rb +31 -0
  7. data/code/01rwdcore/returntomain.rb +10 -0
  8. data/code/{ag1core → 01rwdcore}/rwdtinkerversion.rb +0 -0
  9. data/code/01rwdcore/rwdwindowreturn.rb +11 -0
  10. data/code/{dd0shelleval → rwdcalc}/changescriptname.rb +0 -0
  11. data/code/rwdcalc/clearscriptscreendisplay.rb +9 -0
  12. data/code/rwdcalc/deletescriptrecord.rb +20 -0
  13. data/code/rwdcalc/helptexthashrwdcalc.rb +14 -0
  14. data/code/rwdcalc/listscripts.rb +13 -0
  15. data/code/rwdcalc/loadscriptrecord.rb +20 -0
  16. data/code/rwdcalc/mathcommands.rb +53 -0
  17. data/code/rwdcalc/openhelpwindowrwdcalc.rb +21 -0
  18. data/code/rwdcalc/playscript.rb +22 -0
  19. data/code/rwdcalc/renamecalcrecord.rb +14 -0
  20. data/code/rwdcalc/runrwdcalcwindow.rb +1 -0
  21. data/code/rwdcalc/savechangedscript.rb +19 -0
  22. data/code/rwdcalc/viewscript.rb +18 -0
  23. data/code/superant.com.rwdcalendar/gh9calendar.rb +40 -16
  24. data/code/superant.com.rwdshell/changescriptname.rb +16 -0
  25. data/code/{dd0shelleval → superant.com.rwdshell}/clearscriptscreendisplay.rb +0 -0
  26. data/code/{dd0shelleval → superant.com.rwdshell}/deletescriptrecord.rb +0 -0
  27. data/code/superant.com.rwdshell/helptexthashrubyslippers.rb +81 -0
  28. data/code/superant.com.rwdshell/listrubyscripts.rb +13 -0
  29. data/code/{dd0shelleval → superant.com.rwdshell}/listscripts.rb +0 -0
  30. data/code/superant.com.rwdshell/loadconfigurationrecord.rb +33 -0
  31. data/code/superant.com.rwdshell/loadconfigurationvariables.rb +13 -0
  32. data/code/{dd0shelleval → superant.com.rwdshell}/loadscriptrecord.rb +0 -0
  33. data/code/superant.com.rwdshell/openhelpwindowrubyslippers.rb +50 -0
  34. data/code/superant.com.rwdshell/playrubyscript.rb +22 -0
  35. data/code/{dd0shelleval → superant.com.rwdshell}/playscript.rb +0 -0
  36. data/code/superant.com.rwdshell/returntomain.rb +10 -0
  37. data/code/{dd0shelleval → superant.com.rwdshell}/rubyeval.rb +0 -0
  38. data/code/superant.com.rwdshell/runrwdshellbackwindow.rb +10 -0
  39. data/code/superant.com.rwdshell/runrwdshellmenu1.rb +57 -0
  40. data/code/{dd0shelleval → superant.com.rwdshell}/runrwdshellwindow.rb +0 -0
  41. data/code/{dd0shelleval → superant.com.rwdshell}/rwdshellversion.rb +0 -0
  42. data/code/{dd0shelleval → superant.com.rwdshell}/savechangedscript.rb +0 -0
  43. data/code/superant.com.rwdshell/saveconfigurationrecord.rb +18 -0
  44. data/code/{dd0shelleval → superant.com.rwdshell}/shelleval.rb +0 -0
  45. data/code/superant.com.rwdshell/viewrubyscript.rb +18 -0
  46. data/code/{dd0shelleval → superant.com.rwdshell}/viewscript.rb +0 -0
  47. data/code/superant.com.rwdtinkerbackwindow/controlclient.rb +99 -0
  48. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/diagnostictab.rb +0 -0
  49. data/code/superant.com.rwdtinkerbackwindow/helptexthashtinkerwin2.rb +58 -0
  50. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/installapplet.rb +9 -8
  51. data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +20 -0
  52. data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +19 -0
  53. data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +12 -0
  54. data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +54 -0
  55. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/listinstalledfiles.rb +0 -0
  56. data/code/superant.com.rwdtinkerbackwindow/listzips.rb +31 -0
  57. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/loadconfigurationrecord.rb +1 -1
  58. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/loadconfigurationvariables.rb +1 -1
  59. data/code/superant.com.rwdtinkerbackwindow/network.rb +87 -0
  60. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/openappletname.rb +0 -0
  61. data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +42 -0
  62. data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +24 -0
  63. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/removeapplet.rb +0 -0
  64. data/code/{xa5rwdtinkercallable/callable.rb → superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb} +2 -3
  65. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/rwdtinkerwin2version.rb +0 -0
  66. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/saveconfigurationrecord.rb +1 -1
  67. data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +21 -0
  68. data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +21 -0
  69. data/configuration/{rwdplayscripts.cnf → playscripts.cnf} +0 -2
  70. data/configuration/rwdapplicationidentity.cnf +3 -0
  71. data/configuration/rwdcalc.cnf +1 -0
  72. data/configuration/rwdcalendar.cnf +4 -27
  73. data/configuration/rwdcalendarversion.cnf +4 -0
  74. data/configuration/rwdshellversion.cnf +2 -0
  75. data/configuration/rwdtinker.cnf +6 -2
  76. data/configuration/rwdtinkerversion.cnf +1 -1
  77. data/configuration/tinkerwin2variables.cnf +7 -3
  78. data/configuration/tinkerwin2version.cnf +1 -1
  79. data/ev/rwd.rb +4 -3
  80. data/extras/cal.rb +158 -0
  81. data/gui/00coreguibegin/applicationguitop.rwd +1 -1
  82. data/gui/frontwindow0/superant.com.tinkercalendar/hl9calendar.rwd +27 -20
  83. data/gui/frontwindowselectionbegin/selectiontabbegin/selectiontabbegin.rwd +1 -1
  84. data/gui/frontwindowselections/superant.com.rwdshellselectiontab/rwdshellbackwindowselectiontab.rwd +12 -0
  85. data/gui/frontwindowtdocumentbegin/superant.com.documentsbegin/tt0documentbegin.rwd +1 -1
  86. data/gui/frontwindowtdocuments/{ub7rubyeval → superant.com.rubyeval}/rubyeval.rwd +0 -0
  87. data/gui/frontwindowtdocuments/{vv1docshellxp → superant.com.shelldocument}/vvdocshellxp.rwd +0 -0
  88. data/gui/frontwindowtdocuments/uu6rwdcalcdocument/uu5documents.rwd +6 -0
  89. data/gui/frontwindowtdocumentzend/superant.com.documentsend/ww0documentend.rwd +5 -0
  90. data/gui/helpaboutinstalled/{yl4rwdshellhelpabout → superant.com.shellhelpabout}/1appname.rwd +0 -0
  91. data/gui/helpaboutinstalled/{yl2rwddemohelpabout → superant.com.shellhelpabout}/3copyright.rwd +0 -0
  92. data/gui/helpaboutinstalled/{yl4rwdshellhelpabout → superant.com.shellhelpabout}/5version.rwd +0 -0
  93. data/gui/tinkerbackwindows/superant.com.rwdcalc/1appname.rwd +1 -1
  94. data/gui/tinkerbackwindows/superant.com.rwdcalc/{floatrwdcalc.rwd → 20floatrwdcalc.rwd} +0 -0
  95. data/gui/tinkerbackwindows/superant.com.rwdcalc/{intrwdcalc.rwd → 30intrwdcalc.rwd} +0 -0
  96. data/gui/tinkerbackwindows/superant.com.rwdcalc/35mathcommands.rwd +25 -0
  97. data/gui/tinkerbackwindows/superant.com.rwdcalc/44listplayscripts.rwd +19 -0
  98. data/gui/tinkerbackwindows/superant.com.rwdcalc/45listscripts.rwd +25 -0
  99. data/gui/tinkerbackwindows/superant.com.rwdcalc/46editscriptrecord.rwd +30 -0
  100. data/gui/tinkerbackwindows/superant.com.rwdcalc/4scriptutilities.rwd +25 -0
  101. data/gui/tinkerbackwindows/superant.com.rwdcalc/98returntab.rwd +11 -0
  102. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/1appname.rwd +5 -0
  103. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/44listplayscripts.rwd +19 -0
  104. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/45listscripts.rwd +25 -0
  105. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/46editscriptrecord.rwd +30 -0
  106. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/92viewconfiguration.rwd +38 -0
  107. data/gui/tinkerbackwindows/{superant.com.tinkerbackwindow/3arwddiagnostics.rwd → superant.com.rwdshellbackwindow/94rwddiagnostics.rwd} +0 -0
  108. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/v9returntab.rwd +11 -0
  109. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/zbackend.rwd +6 -0
  110. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/40rwdlistzips.rwd +42 -0
  111. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/45installremotezip.rwd +44 -0
  112. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/50rwdlistapplets.rwd +1 -1
  113. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/60editconfiguration.rwd +38 -0
  114. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/70rwddiagnostics.rwd +33 -0
  115. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/75rwdcontrol.rwd +33 -0
  116. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/80tab1.rwd +1 -1
  117. data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/1appname.rwd +31 -0
  118. data/gui/tinkerbackwindows/{superant.com.tinercallablewindow → superant.com.tinkerhelpwindow}/9end.rwd +0 -0
  119. data/init.rb +38 -2
  120. data/lang/en/rwdcalendar/calendar-en.rb +6 -0
  121. data/lang/es/rwdcalendar/calendar-nl.rb +6 -0
  122. data/lang/nl/rwdcalendar/calendar-nl.rb +6 -0
  123. data/lang/templangfile.rb +7 -1
  124. data/lang/xlocallangfile.rb +7 -1
  125. data/rwd_files/HowTo_RwdDemo.txt +20 -82
  126. data/rwd_files/HowTo_Shell.txt +15 -1
  127. data/rwd_files/HowTo_Tinker.txt +63 -6
  128. data/rwddemo-0.90.gem +0 -0
  129. data/scripts/test02.math +2 -0
  130. data/scripts/test02.rb +2 -0
  131. metadata +153 -89
  132. data/code/dd0shelleval/rwddemohelpabout.rb +0 -14
  133. data/code/xb1rwdtinkerbackwindow/listzips.rb +0 -16
  134. data/configuration/rwddemoversion.cnf +0 -2
  135. data/configuration/rwdplayscriptsversion.cnf +0 -2
  136. data/gui/frontwindowtdocuments/uk5rwddemodocuments/documents.rwd +0 -4
  137. data/gui/helpaboutinstalled/yl2rwddemohelpabout/1appname.rwd +0 -4
  138. data/gui/helpaboutinstalled/yl2rwddemohelpabout/5version.rwd +0 -9
  139. data/gui/helpaboutinstalled/yl4rwdshellhelpabout/3copyright.rwd +0 -3
  140. data/gui/tinkerbackwindows/superant.com.tinercallablewindow/1appname.rwd +0 -17
  141. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/40editconfiguration.rwd +0 -36
  142. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/50rwdlistzips.rwd +0 -35
  143. data/installed/rwdshell-0.92.inf +0 -14
  144. data/rwd_files/HowTo_RwdCalc.txt +0 -103
@@ -0,0 +1,42 @@
1
+ # this code is to call the help window
2
+ def runhelpwindowtinkerwin2
3
+
4
+ # $helptopicsarray = $helptopicsarray | [""]
5
+
6
+ $help_topic = "tinkerwin2_help"
7
+ if @rwd_tab == "rwdzipslister"
8
+ $help_topic = "tinkerwin2_help"
9
+ end
10
+
11
+ if @rwd_tab == "filelister"
12
+ $help_topic = "applet_viewing"
13
+
14
+ end
15
+ if @rwd_tab == "zipslister"
16
+ $help_topic = "applet_installation"
17
+
18
+ end
19
+ if @rwd_tab == "editconfigurationfile"
20
+ $help_topic = "applet_tinkerbackeditconfiguration"
21
+
22
+ end
23
+ if @rwd_tab == "rwdremotecontrol"
24
+ $help_topic = "remote_control"
25
+
26
+ end
27
+ if @rwd_tab == "superantcomremotezipsinstall"
28
+ $help_topic = "remotegemapplet_install"
29
+ end
30
+
31
+
32
+ if @rwd_window != "rwdtinkerhelpwindow"
33
+ $previouswindow = @rwd_window
34
+ $previoustab = @rwd_tab
35
+ else
36
+ $previouswindow = @rwd_window
37
+ $previoustab = @rwd_tab
38
+ end
39
+ runhelpwindow
40
+ end
41
+
42
+
@@ -0,0 +1,24 @@
1
+ # This tinker method is to retrieve the list of rwdzip applets available to install from the remote repository
2
+
3
+ def superantcomremotegemlist
4
+ gemcommandoption = "search --remote "
5
+ gemfilename = "rwdzip"
6
+ commandtext = "gem search --remote rwdzip"
7
+ commandtemp = $xpcommand + commandtext
8
+ begin # exception trapped block
9
+
10
+ tempremotegemappletsresult = `#{commandtemp} 2>&1`
11
+ @superantcomremotegemappletsfullresult = tempremotegemappletsresult
12
+ fileList = tempremotegemappletsresult.split(/\n/).delete_if { |x| ! (x =~ /\Arwdzip/) }
13
+
14
+ @superantcomremotegemappletsresult = fileList.rwd_method("superantcomremotegemappletdirsname")
15
+ rescue SystemCallError, StandardError
16
+ @superantcomremotegemappletsresult = "system call error: " + $!
17
+ end # exception rescue
18
+ end
19
+
20
+ def superantcomremotegemappletdirsname(inffile)
21
+ applet = inffile
22
+ @superantcominstallremoteappletinput = applet
23
+
24
+ end
@@ -4,10 +4,9 @@
4
4
  # For more information about RwdTinker see http://www.rubyforge.net/projects/rwdapplications
5
5
 
6
6
  # call the rwdtinker helpwindow
7
- def runrwdtinkerhelpwindow
8
- @rwd_window = "rwdtinkerhelpwindow"
9
- end
7
+
10
8
  def runrwdtinkerbackwindow
11
9
  @rwd_window = "tinkerbackwindow"
10
+ @rwd_tab = "rwdzipslister"
12
11
  end
13
12
 
@@ -1,4 +1,4 @@
1
- # this method adds a new address record
1
+ # this method saves the configuration record
2
2
  def saveconfigurationrecord
3
3
  require 'fileutils'
4
4
  if @a_configurationfilename
@@ -0,0 +1,21 @@
1
+ def viewappletcontents
2
+ require 'fileutils'
3
+ require 'extras/zip/zip'
4
+ nametext = "%s" % [@a_installapplet]
5
+
6
+ begin # exception trapped block
7
+ fullname = nametext + ".zip"
8
+ fileName = File.join($zipslocation,fullname)
9
+ tempfilecontents = " "
10
+ zf = Zip::ZipFile.new(fileName)
11
+ zf.sort.each {
12
+ |entry|
13
+ tempfilecontents = tempfilecontents + entry.to_s + "\n"
14
+ }
15
+ @appletcontentstext = tempfilecontents
16
+
17
+ rescue
18
+ @installapplettext = "unzip error - error opening applet"
19
+ end # exception rescue
20
+
21
+ end
@@ -0,0 +1,21 @@
1
+ def viewgemappletcontents
2
+ require 'fileutils'
3
+ require 'extras/zip/zip'
4
+ nametext = "%s" % [@a_installapplet]
5
+
6
+ begin # exception trapped block
7
+ fullname = nametext + ".zip"
8
+
9
+ tempfilecontents = " "
10
+ zf = Zip::ZipFile.new(fullname)
11
+ zf.sort.each {
12
+ |entry|
13
+ tempfilecontents = tempfilecontents + entry.to_s + "\n"
14
+ }
15
+ @appletcontentstext = tempfilecontents
16
+
17
+ rescue
18
+ @installapplettext = "unzip error - error opening applet"
19
+ end # exception rescue
20
+
21
+ end
@@ -1,4 +1,2 @@
1
1
 
2
- "
3
2
  $shellscript_directory = "scripts"
4
- RwdShellVersion = "0.92"
@@ -0,0 +1,3 @@
1
+
2
+ $rwdapplicationidentity = "rwdtinker main application"
3
+
@@ -1,3 +1,4 @@
1
1
 
2
2
  $frunningtotal = ""
3
3
  $runningtotal = ""
4
+ $calcscript_directory = "scripts"
@@ -1,27 +1,4 @@
1
-
2
- $extras_directory = "extras"
3
-
4
-
5
- class LanguageTextrwdcalendar
6
-
7
- def locale(languagecode,wordtotranslate)
8
-
9
- case languagecode
10
-
11
- when "en"
12
- case wordtotranslate
13
- when "year"
14
- return "year"
15
- when "month"
16
- return "month"
17
- end
18
- when "nl"
19
- case wordtotranslate
20
- when "year"
21
- return "jaar"
22
- when "month"
23
- return "maand"
24
- end
25
- end
26
- end
27
- end
1
+
2
+ $extras_directory = "extras"
3
+
4
+
@@ -0,0 +1,2 @@
1
+
2
+ RwdShellVersion = "0.95"
@@ -7,6 +7,10 @@ RWDFile = "rwdtinker.rwd"
7
7
  LangDir = "lang"
8
8
  TempLangHashFile = LangDir + "/" + "templangfile.rb"
9
9
  LocalLangHashFile = LangDir + "/" + "xlocallangfile.rb"
10
- CodeDir = "code"
11
- GuiDir = "gui"
10
+ CodeDir = "code"
11
+ GuiDir = "gui"
12
+ $help_topic = "general_help"
13
+ $helptopicsarray = [ "general_help","network_help"]
14
+ $prevouswindow ="main"
15
+ $rwdcontrolports =["13713","13714","13715","13716","13717","13718"]
12
16
  $port = 7705
@@ -1,2 +1,2 @@
1
1
 
2
- RwdTinkerVersion = "1.44"
2
+ RwdTinkerVersion = "1.54"
@@ -1,8 +1,12 @@
1
1
 
2
2
  TinkerWin2ConfigurationFileName = "tinkerwin2variables.cnf" # this file name - do not change
3
3
  $zipslocation = "zips" # location of applets to add
4
- $unzipprogram = "unzip -o "
5
-
6
-
4
+ $zipsarray = [""] ; $zipsarraylocal = [""]
5
+ $xpcommand = " " # Linux machines
6
+ # $xpcommand = "cmd /C " # XP machines with cmd shell
7
+ $gemdirectory_withgemfiles = "/usr/lib/ruby/gems/1.8/gems"
8
+ # $gemdirectory_withgemfiles = "c:\\ruby\\lib\\ruby\\gems\\1.8\\gems" # XP machine
9
+ # $geminstalled_directory = "/ruby/lib/ruby/gems/1.8/gems" # XP machine
10
+ $geminstalled_directory = "/usr/lib/ruby/gems/1.8/gems" # Debian Linux
7
11
 
8
12
 
@@ -1,3 +1,3 @@
1
1
 
2
- RwdTinkerWin2Version = "0.7"
2
+ RwdTinkerWin2Version = "0.8"
3
3
 
data/ev/rwd.rb CHANGED
@@ -267,7 +267,7 @@ class OpenTag
267
267
  template = $rwd_html_PDA_1 if pda
268
268
 
269
269
  res <<(template(template, args))
270
- when "p" then res << "<p #{align}>"
270
+ when "p" then res << "<p #{align} > "
271
271
  when "pre" then res << "<pre #{align}>"
272
272
  when "big" then res << "<p #{align}><big>"
273
273
  when "small" then res << "<p #{align}><small>"
@@ -308,9 +308,10 @@ class OpenTag
308
308
  when "hidden" then res << "<p #{align}><input name='#{@args["name"]}' value='#{value1}' type='hidden'>"
309
309
  when "text"
310
310
  maxlength = ""
311
- maxlength = "maxlength='%s'" % @args["maxlength"] if @args.include?("maxlength")
311
+ maxlength = "maxlength='%s'" % @args["maxlength"] if @args.include?("maxlength")
312
312
  size = ""
313
- size = "size='%s'" % 10 if pda
313
+ size = "size='%s'" % @args["size"] if @args.include?("size")
314
+ size = "size='%s'" % 10 if pda
314
315
  res << "<p #{align}><input name='#{@args["name"]}' value='#{value1}' type='text' #{maxlength} #{size}>"
315
316
  oneormorefields << "true"
316
317
  when "textarea"
data/extras/cal.rb ADDED
@@ -0,0 +1,158 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ # cal.rb: Written by Tadayoshi Funaba 1998-2004
4
+ # $Id: cal.rb,v 2.8 2004-09-25 12:50:10+09 tadf Exp $
5
+
6
+ require 'date'
7
+
8
+ class Cal
9
+
10
+ START =
11
+ {
12
+ 'cn' => true, # China
13
+ 'de' => 2342032, # Germany (protestant states)
14
+ 'dk' => 2342032, # Denmark
15
+ 'en' => 2361222, # English
16
+ 'es' => 2299161, # Spain
17
+ 'fi' => 2361390, # Finland
18
+ 'fr' => 2299227, # France
19
+ 'gb' => 2361222, # United Kingdom
20
+ 'gr' => 2423868, # Greece
21
+ 'hu' => 2301004, # Hungary
22
+ 'it' => 2299161, # Italy
23
+ 'jp' => true, # Japan
24
+ 'no' => 2342032, # Norway
25
+ 'nl' => 2361222,
26
+ 'pl' => 2299161, # Poland
27
+ 'pt' => 2299161, # Portugal
28
+ 'ru' => 2421639, # Russia
29
+ 'se' => 2361390, # Sweden
30
+ 'us' => 2361222, # United States
31
+ 'os' => false, # (old style)
32
+ 'ns' => true # (new style)
33
+ }
34
+
35
+ DEFAULT_START = 'gb'
36
+
37
+ def initialize
38
+ opt_j; opt_m; opt_t; opt_y; opt_c
39
+ end
40
+
41
+ def opt_j(flag=false) @opt_j = flag end
42
+ def opt_m(flag=false) @opt_m = flag end
43
+ def opt_t(flag=false) @opt_t = flag end
44
+ def opt_y(flag=false) @opt_y = flag end
45
+
46
+ def opt_c(arg=DEFAULT_START) @start = START[arg] end
47
+
48
+ def set_params
49
+ @dw = if @opt_j then 3 else 2 end
50
+ @mw = (@dw + 1) * 7 - 1
51
+ @mn = if @opt_j then 2 else 3 end
52
+ @tw = (@mw + 2) * @mn - 2
53
+ @k = if @opt_m then 1 else 0 end
54
+ @da = if @opt_j then :yday else :mday end
55
+ end
56
+
57
+
58
+
59
+ def nl_pict(y, m)
60
+ d = (1..31).detect{|d| Date.valid_date?(y, m, d, @start)}
61
+ fi = Date.new(y, m, d, @start)
62
+ fi -= (fi.jd - @k + 1) % 7
63
+
64
+ ve = (fi..fi + 6).collect{|cu|
65
+ %w(zo ma di wo do vr za)[cu.wday]
66
+ }
67
+ ve += (fi..fi + 41).collect{|cu|
68
+ if cu.mon == m then cu.send(@da) end.to_s
69
+ }
70
+
71
+ ve = ve.collect{|e| e.rjust(@dw)}
72
+
73
+ gr = group(ve, 7)
74
+ gr = trans(gr) if @opt_t
75
+ ta = gr.collect{|xs| xs.join(' ')}
76
+
77
+ ca = %w(januari februari maart april mei juni juli
78
+ augustus september oktober november december)[m - 1]
79
+ ca = ca + ' ' + y.to_s if not @opt_y
80
+ ca = ca.center(@mw)
81
+
82
+ ta.unshift(ca)
83
+ end
84
+
85
+
86
+ def en_pict(y, m)
87
+ d = (1..31).detect{|d| Date.valid_date?(y, m, d, @start)}
88
+ fi = Date.new(y, m, d, @start)
89
+ fi -= (fi.jd - @k + 1) % 7
90
+
91
+ ve = (fi..fi + 6).collect{|cu|
92
+ %w(Su Mo Tu We Th Fr Sa)[cu.wday]
93
+ }
94
+ ve += (fi..fi + 41).collect{|cu|
95
+ if cu.mon == m then cu.send(@da) end.to_s
96
+ }
97
+
98
+ ve = ve.collect{|e| e.rjust(@dw)}
99
+
100
+ gr = group(ve, 7)
101
+ gr = trans(gr) if @opt_t
102
+ ta = gr.collect{|xs| xs.join(' ')}
103
+
104
+ ca = %w(January February March April May June July
105
+ August September October November December)[m - 1]
106
+ ca = ca + ' ' + y.to_s if not @opt_y
107
+ ca = ca #.center(@mw)
108
+
109
+ ta.unshift(ca)
110
+ end
111
+
112
+ def group(xs, n)
113
+ (0..xs.size / n - 1).collect{|i| xs[i * n, n]}
114
+ end
115
+
116
+ def trans(xs)
117
+ (0..xs[0].size - 1).collect{|i| xs.collect{|x| x[i]}}
118
+ end
119
+
120
+ def stack(xs)
121
+ if xs.empty? then [] else xs[0] + stack(xs[1..-1]) end
122
+ end
123
+
124
+ def block(xs, n)
125
+ stack(group(xs, n).collect{|ys| trans(ys).collect{|zs| zs.join(' ')}})
126
+ end
127
+
128
+ def unlines(xs)
129
+ xs.collect{|x| x + "\n"}.join
130
+ end
131
+
132
+ def monthly(y, m)
133
+ if $lang == "nl"
134
+ return nl_pict(y,m)
135
+ end
136
+ return en_pict(y,m)
137
+ #unlines(pict(y, m))
138
+ end
139
+
140
+ def addmon(y, m, n)
141
+ y, m = (y * 12 + (m - 1) + n).divmod(12)
142
+ return y, m + 1
143
+ end
144
+
145
+ def yearly(y)
146
+ y.to_s.center(@tw) + "\n\n" +
147
+ unlines(block((0..11).collect{|n| pict(*addmon(y, 1, n))}, @mn)) + "\n"
148
+ end
149
+
150
+ def print(y, m)
151
+ set_params
152
+ if @opt_y then yearly(y) else monthly(y, m) end
153
+ end
154
+
155
+ end
156
+
157
+
158
+
@@ -1,4 +1,4 @@
1
1
  $rwdguivar=
2
2
  "<application>
3
- <window name=\"main\" title=\"Tinker - RubyWebDialogs\">
3
+ <window name=\"main\" title=\"rwddemo for Tinker - RubyWebDialogs\">
4
4
  <tabs>"
@@ -1,20 +1,27 @@
1
- $rwdguivar=
2
- "
3
- <tab name=\"calendar\" caption=\"Show Month\">
4
- <table>
5
- <row> <p align=\"right\">Year:</p> <text name=\"a_year\"/> </row>
6
- <row> <p align=\"right\">Month:</p> <text name=\"a_month\"/> </row>
7
- </table>
8
- <p>%showmonthresult%</p>
9
- <horizontal>
10
-
11
- <button caption=\"ShowMonth\" action=\"showmonth\"/>
12
-
13
- <button caption=\"Cancel\" action=\"main\"/>
14
-
15
-
16
- </horizontal>
17
-
18
-
19
- </tab>"
20
-
1
+ $rwdguivar=
2
+ "
3
+ <tab name=\"calendar\" caption=#{Message[:show_month]}>
4
+ <table>
5
+ <row> <p align=\"right\">#{Message[:year]}</p> <text name=\"a_year\"/> </row>
6
+ <row> <p align=\"right\">#{Message[:month]}</p> <text name=\"a_month\"/> </row>
7
+ </table>
8
+ <horizontal>
9
+ <button caption=#{Message[:show_month]} action=\"showmonth\"/>
10
+
11
+ <button caption=\"Help\" action=\"runhelpwindowrwdschedule\"/>
12
+
13
+ </horizontal>
14
+ <p> %showcalendartitle%</p>
15
+ <p>%showcalendarweektitles%</p>
16
+ <p>%%showmonthresult1%%</p>
17
+ <p>%%showmonthresult2%%</p>
18
+ <p>%%showmonthresult3%%</p>
19
+ <p>%%showmonthresult4%%</p>
20
+ <p>%%showmonthresult5%%</p>
21
+ <p>%%showmonthresult6%%</p>
22
+
23
+
24
+
25
+
26
+ </tab>"
27
+
@@ -8,7 +8,7 @@ $rwdguivar=
8
8
  </table>
9
9
  <horizontal>
10
10
 
11
- <button caption=#{Message[:rwdtinker_help_window]} action=\"runrwdtinkerhelpwindow\"/>
11
+ <button caption=#{Message[:rwdtinker_help_window]} action=\"runhelpwindow\"/>
12
12
 
13
13
 
14
14
  </horizontal>"
@@ -0,0 +1,12 @@
1
+ $rwdguivar=
2
+ "
3
+ <row> <p></row>
4
+
5
+ <horizontal>
6
+
7
+ <button caption=\"rwdshell Back Window\" action=\"runrwdshellbackwindow\"/>
8
+
9
+
10
+ </horizontal>"
11
+
12
+
@@ -1,6 +1,6 @@
1
1
  $rwdguivar=
2
2
  "
3
- <tab name=\"one\" caption=#{Message[:documents]}>
3
+ <tab name=\"documentsrwdtinkerone\" caption=#{Message[:documents]}>
4
4
  <horizontal>
5
5
  <table>"
6
6
 
@@ -0,0 +1,6 @@
1
+ $rwdguivar=
2
+ "
3
+ <row> <p align=\"left\">
4
+ <a href=HowTo_RwdCalc.txt>Howto_RwdCalc.txt</a></p></row>"
5
+
6
+
@@ -3,5 +3,10 @@ $rwdguivar=
3
3
  <row> <p align=\"left\"><a href=.>Spawn a clone Dialog window</a></p></row>
4
4
  </table>
5
5
  </horizontal>
6
+ <horizontal>
7
+
8
+ <button caption=\"Help\" action=\"runhelpwindow\"/>
9
+
10
+ </horizontal>
6
11
  </tab>"
7
12
 
@@ -1,4 +1,4 @@
1
1
  $rwdguivar=
2
2
  "
3
- <window name = \"rwdcalcwindow\" title=\"rwdcalc \">
3
+ <window name = \"rwdcalcwindow\" title=\"rwd Calc \">
4
4
  <tabs>"
@@ -0,0 +1,25 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=\"mathcommands\" caption=\"Math Tools\">
4
+ <horizontal>
5
+ <p>Input A: <text name=\"a_mathtoola\"/> </p>
6
+ <p>Input B: <text name=\"a_mathtoolb\"/> </p>
7
+ </horizontal>
8
+ <horizontal>
9
+ <button caption=\"Help\" action=\"runhelpwindowrwdcalc\"/>
10
+ </horizontal>
11
+ <p>%viewgemcommandresult%</p>
12
+ <horizontal>
13
+ <button caption=\"Show Math Command Choices\" action=\"showmathcommandoptions\"/>
14
+
15
+ </horizontal>
16
+ <table>
17
+ <select name=\"a_mathcommandinput\"> %%mathcommandoptions%% </select>
18
+
19
+ </table>
20
+ <horizontal>
21
+ <button caption=\"Run Command\" action=\"runmathcommand\"/>
22
+
23
+ </horizontal>
24
+ <p>%mathcommandresult%</p>
25
+ </tab>"
@@ -0,0 +1,19 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=\"calcscriptlister\" caption=\"List\\Run Scripts\">
4
+ <horizontal>
5
+ <text name=\"a_calcnumx\"/>
6
+ <text name=\"a_calcnumy\"/>
7
+ </horizontal>
8
+ <table>
9
+ <row> <p align=\"right\">Script Name:</p> <text name=\"a_calcscriptcmd\"/> </row>
10
+
11
+ </table>
12
+
13
+ <horizontal>
14
+ <button caption=\"Execute\" action=\"playcalcscript\"/>
15
+
16
+
17
+ </horizontal>
18
+ <p>%playcalcscript_display%</p>"
19
+
@@ -0,0 +1,25 @@
1
+ $rwdguivar=
2
+ "
3
+ <table>
4
+ <row> <p align=\"right\">ScriptName:</p> <text name=\"a_calcscriptfilename\"/> </row>
5
+
6
+ </table>
7
+
8
+ <horizontal>
9
+ <button caption=\"ViewScript\" action=\"viewcalcscript\"/>
10
+ <button caption=\"Help\" action=\"runhelpwindowrwdcalc\"/>
11
+
12
+ </horizontal>
13
+ <p>%displayscripttext%</p>
14
+
15
+ <horizontal>
16
+
17
+ <button caption=\"ListFiles\" action=\"listcalcscripts\"/>
18
+ <button caption=\"Cancel\" action=\"main\"/>
19
+
20
+ </horizontal>
21
+ <p>%%listcalcscriptresult%%</p>
22
+ </tab>"
23
+
24
+
25
+
@@ -0,0 +1,30 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=\"editeventrecordfile\" caption=\"Edit Script\">
4
+ <table>
5
+ <row> <p> </row>
6
+ <row> <p align=\"right\">You can create a new record here or edit one</row>
7
+ <row> <p> </row>
8
+ <horizontal>
9
+ <button caption=\"Fill Record\" action=\"loadcalcscriptrecord\"/>
10
+ <button caption=\"Save Changes\" action=\"savecalcrecord\"/>
11
+ <button caption=\"Clear\" action=\"clearcalcscreendisplay\"/>
12
+ <button caption=\"Help\" action=\"runhelpwindowrwdcalc\"/>
13
+ </horizontal>
14
+ <horizontal>
15
+ <row> <p align=\"right\">FileName:</p>
16
+ <text name=\"a_calcscriptfilename\"/>
17
+ </horizontal>
18
+ <table>
19
+ <textarea name=\"a_calcscriptrecord\"/> </row>
20
+
21
+
22
+ </table>
23
+
24
+ <p>
25
+ <p>%neweventresult%</p>
26
+
27
+
28
+
29
+ </tab>"
30
+