ifmapper 1.0.0 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. data/HISTORY.txt +648 -627
  2. data/IFMapper.gemspec +29 -28
  3. data/IFMapper.rbw +31 -31
  4. data/TODO.txt +8 -7
  5. data/bin/IFMapper +31 -31
  6. data/docs/en/index.html +0 -0
  7. data/docs/en/start.html +3 -2
  8. data/docs/en/start.html~ +516 -0
  9. data/docs/es/index.html +0 -0
  10. data/docs/es/start.html +13 -14
  11. data/docs/es/start.html~ +1280 -0
  12. data/docs/images/IFMapper_main.gif +0 -0
  13. data/docs/images/automap.gif +0 -0
  14. data/docs/images/complex_connection.gif +0 -0
  15. data/docs/images/connection.gif +0 -0
  16. data/docs/images/connection_menu.gif +0 -0
  17. data/docs/images/room_description.gif +0 -0
  18. data/docs/images/room_small.gif +0 -0
  19. data/icons/copy.png +0 -0
  20. data/icons/cut.png +0 -0
  21. data/icons/filenew.png +0 -0
  22. data/icons/fileopen.png +0 -0
  23. data/icons/filesave.png +0 -0
  24. data/icons/filesaveas.png +0 -0
  25. data/icons/help.png +0 -0
  26. data/icons/kill.png +0 -0
  27. data/icons/nextpage.png +0 -0
  28. data/icons/paste.png +0 -0
  29. data/icons/prevpage.png +0 -0
  30. data/icons/printicon.png +0 -0
  31. data/icons/redo.png +0 -0
  32. data/icons/room_e.gif +0 -0
  33. data/icons/room_e.xpm +0 -0
  34. data/icons/room_n.gif +0 -0
  35. data/icons/room_n.xpm +0 -0
  36. data/icons/room_ne.gif +0 -0
  37. data/icons/room_ne.xpm +0 -0
  38. data/icons/room_nw.gif +0 -0
  39. data/icons/room_nw.xpm +0 -0
  40. data/icons/room_s.gif +0 -0
  41. data/icons/room_s.xpm +0 -0
  42. data/icons/room_se.gif +0 -0
  43. data/icons/room_se.xpm +0 -0
  44. data/icons/room_sw.gif +0 -0
  45. data/icons/room_sw.xpm +0 -0
  46. data/icons/room_w.gif +0 -0
  47. data/icons/room_w.xpm +0 -0
  48. data/icons/saveas.png +0 -0
  49. data/icons/undo.png +0 -0
  50. data/icons/winapp.png +0 -0
  51. data/icons/zoom.png +0 -0
  52. data/lib/IFMapper/AStar.rb +250 -250
  53. data/lib/IFMapper/Connection.rb +202 -202
  54. data/lib/IFMapper/FXAboutDialogBox.rb +32 -32
  55. data/lib/IFMapper/FXConnection.rb +364 -364
  56. data/lib/IFMapper/FXConnectionDialogBox.rb +124 -124
  57. data/lib/IFMapper/FXDCPostscript.rb +404 -404
  58. data/lib/IFMapper/FXDCPrint.rb +15 -15
  59. data/lib/IFMapper/FXItemList.rb +108 -0
  60. data/lib/IFMapper/FXMap.rb +2147 -2116
  61. data/lib/IFMapper/FXMapColorBox.rb +88 -88
  62. data/lib/IFMapper/FXMapDialogBox.rb +127 -127
  63. data/lib/IFMapper/FXMapFileDialog.rb +34 -34
  64. data/lib/IFMapper/FXMapperSettings.rb +206 -205
  65. data/lib/IFMapper/FXMapperWindow.rb +1592 -1571
  66. data/lib/IFMapper/FXPDFMapExporterOptionsDialogBox.rb +46 -0
  67. data/lib/IFMapper/FXRoom.rb +263 -263
  68. data/lib/IFMapper/FXRoomDialogBox.rb +159 -159
  69. data/lib/IFMapper/FXRoomList.rb +95 -95
  70. data/lib/IFMapper/FXSearchDialogBox.rb +51 -51
  71. data/lib/IFMapper/FXSection.rb +33 -33
  72. data/lib/IFMapper/FXSectionDialogBox.rb +38 -38
  73. data/lib/IFMapper/FXSpline.rb +52 -52
  74. data/lib/IFMapper/FXWarningBox.rb +51 -50
  75. data/lib/IFMapper/GUEReader.rb +445 -445
  76. data/lib/IFMapper/IFMReader.rb +584 -584
  77. data/lib/IFMapper/IFMWriter.rb +245 -227
  78. data/lib/IFMapper/Inform7Writer.rb +579 -573
  79. data/lib/IFMapper/InformReader.rb +478 -478
  80. data/lib/IFMapper/InformWriter.rb +364 -359
  81. data/lib/IFMapper/Map.rb +202 -200
  82. data/lib/IFMapper/MapPrinting.rb +162 -162
  83. data/lib/IFMapper/MapReader.rb +900 -900
  84. data/lib/IFMapper/PDFMapExporter.rb +526 -483
  85. data/lib/IFMapper/Room.rb +153 -151
  86. data/lib/IFMapper/Section.rb +234 -234
  87. data/lib/IFMapper/TADSReader.rb +474 -471
  88. data/lib/IFMapper/TADSWriter.rb +375 -370
  89. data/lib/IFMapper/TranscriptDialogBox.rb +0 -0
  90. data/lib/IFMapper/TranscriptReader.rb +1361 -1359
  91. data/lib/IFMapper/locales/en/Messages.rb +446 -435
  92. data/lib/IFMapper/locales/es/Messages.rb +451 -440
  93. data/lib/IFMapper/locales/es/Messages_iso-8859-1.rb +455 -440
  94. data/lib/IFMapper/locales/es/runme.sh +3 -3
  95. data/maps/A New Life.map b/data/maps/A New → Life.map +0 -0
  96. data/maps/AMFV.map +0 -0
  97. data/maps/AllRoads.map +0 -0
  98. data/maps/Aotearoa.map +0 -0
  99. data/maps/Bronze.map +0 -0
  100. data/maps/Bureaucracy.ifm +0 -0
  101. data/maps/Bureaucracy.map +0 -0
  102. data/maps/CityOfSecrets.map +0 -0
  103. data/maps/DDIV.map +0 -0
  104. data/maps/Following_A_Star.map +0 -0
  105. data/maps/Heated.map +0 -0
  106. data/maps/Heroine.map +0 -0
  107. data/maps/History Repeating.map b/data/maps/History → Repeating.map +0 -0
  108. data/maps/Hollywood_Hijinx.ifm +0 -0
  109. data/maps/Janitor.map +0 -0
  110. data/maps/Jigsaw.ifm +0 -0
  111. data/maps/Jigsaw.map +0 -0
  112. data/maps/LGOP.ifm +0 -0
  113. data/maps/Mercy.ifm +0 -0
  114. data/maps/Ninjas_Fate.map +0 -0
  115. data/maps/Pen_and_Paint.map +0 -0
  116. data/maps/Planetfall.ifm +0 -0
  117. data/maps/Planetfall.map +0 -0
  118. data/maps/Plundered_Hearts.ifm +0 -0
  119. data/maps/QuietEvening.map +0 -0
  120. data/maps/Ralph.ifm +0 -0
  121. data/maps/Reliques_of_Tolti_Alph.map +0 -0
  122. data/maps/Revolution.map +0 -0
  123. data/maps/Robots_of_Dawn.ifm +0 -0
  124. data/maps/SavoirFare.map +0 -0
  125. data/maps/Seastalker.ifm +0 -0
  126. data/maps/Seastalker.map +0 -0
  127. data/maps/Sherlock.ifm +0 -0
  128. data/maps/SoFar.ifm +0 -0
  129. data/maps/Starcross.ifm +0 -0
  130. data/maps/Suspended.ifm +0 -0
  131. data/maps/Tangle.map +0 -0
  132. data/maps/The_Lost_Sheep.map +0 -0
  133. data/maps/Unforgotten.map +0 -0
  134. data/maps/Warbler's Nest.map +0 -0
  135. data/maps/Warbler's_Nest.map +0 -0
  136. data/maps/Westminster_Abbey.map +0 -0
  137. data/maps/WinterWonderland.map +0 -0
  138. data/maps/Wishbringer.ifm +0 -0
  139. data/maps/Wishbringer2.ifm +0 -0
  140. data/maps/Zork1.ifm +0 -0
  141. data/maps/Zork2.ifm +0 -0
  142. data/maps/Zork3.ifm +0 -0
  143. data/maps/Zork_Zero.ifm +0 -0
  144. data/maps/anchor.ifm +0 -0
  145. data/maps/anchor.map +0 -0
  146. data/maps/atrox.ifm +0 -0
  147. data/maps/awaken.ifm +0 -0
  148. data/maps/babel.ifm +0 -0
  149. data/maps/balances.map +0 -0
  150. data/maps/ballerina.map +0 -0
  151. data/maps/bear.map +0 -0
  152. data/maps/bluechairs.map +0 -0
  153. data/maps/break_in.map +0 -0
  154. data/maps/bse.ifm +0 -0
  155. data/maps/building.map +0 -0
  156. data/maps/change.ifm +0 -0
  157. data/maps/christminster.map +0 -0
  158. data/maps/curses.ifm +0 -0
  159. data/maps/curves.ifm +0 -0
  160. data/maps/deadline.map +0 -0
  161. data/maps/delusions.map +0 -0
  162. data/maps/devours.map +0 -0
  163. data/maps/distress.map +0 -0
  164. data/maps/djinni.map +0 -0
  165. data/maps/dreamhold.map +0 -0
  166. data/maps/drift3.map +0 -0
  167. data/maps/eas.map +0 -0
  168. data/maps/eas2.map +0 -0
  169. data/maps/eas3.map +0 -0
  170. data/maps/edifice.ifm +0 -0
  171. data/maps/fallacy.map +0 -0
  172. data/maps/frozen.ifm +0 -0
  173. data/maps/gamlet.map +0 -0
  174. data/maps/glow.ifm +0 -0
  175. data/maps/guilty_bastards.map +0 -0
  176. data/maps/heist.map +0 -0
  177. data/maps/heroes.map +0 -0
  178. data/maps/inhumane.map +0 -0
  179. data/maps/kaged.map +0 -0
  180. data/maps/library.ifm +0 -0
  181. data/maps/lurkinghorror.map +0 -0
  182. data/maps/metamorphoses.map +0 -0
  183. data/maps/mindelec.ifm +0 -0
  184. data/maps/minster.ifm +0 -0
  185. data/maps/mite.map +0 -0
  186. data/maps/moonmist.map +0 -0
  187. data/maps/muldoon_legacy.map +0 -0
  188. data/maps/muse.ifm +0 -0
  189. data/maps/paperchase.ifm +0 -0
  190. data/maps/party.map +0 -0
  191. data/maps/pawn.map +0 -0
  192. data/maps/photograph.map +0 -0
  193. data/maps/pkgirl.map +0 -0
  194. data/maps/pytho.map +0 -0
  195. data/maps/risorgimento.map +0 -0
  196. data/maps/sherbet.map +0 -0
  197. data/maps/simple.map +0 -0
  198. data/maps/slouch.map +0 -0
  199. data/maps/space_st.ifm +0 -0
  200. data/maps/splashdown.map +0 -0
  201. data/maps/spring.map +0 -0
  202. data/maps/squarecircle.map +0 -0
  203. data/maps/stationfall.ifm +0 -0
  204. data/maps/theatre.ifm +0 -0
  205. data/maps/toonesia.ifm +0 -0
  206. data/maps/tortoise.ifm +0 -0
  207. data/maps/trinity.map +0 -0
  208. data/maps/vespers.map +0 -0
  209. data/maps/vgame.ifm +0 -0
  210. data/maps/wasp.map +0 -0
  211. data/maps/weather.ifm +0 -0
  212. data/maps/windhall.ifm +0 -0
  213. data/maps/worlds.map +0 -0
  214. data/maps/xtcontest.map +0 -0
  215. data/maps/zdungeon.map +0 -0
  216. data/maps/zebulon.ifm +0 -0
  217. data/maps/zerosum.map +0 -0
  218. metadata +226 -183
@@ -1,88 +1,88 @@
1
-
2
-
3
- class FXMapColorBox < FXDialogBox
4
-
5
- def copy_from(map)
6
- @backwell.rgba = map.options['BG Color']
7
- @boxwell.rgba = map.options['Box BG Color']
8
- @boxdarknesswell.rgba = map.options['Box Darkness Color']
9
- @boxnumberwell.rgba = map.options['Box Number Color']
10
- @boxborderwell.rgba = map.options['Box Border Color']
11
- @arrowwell.rgba = map.options['Arrow Color']
12
- @map = map
13
- end
14
-
15
- def copy_to(sender, id, event)
16
- @map.options['BG Color'] = @backwell.rgba
17
- @map.options['Box BG Color'] = @boxwell.rgba
18
- @map.options['Box Darkness Color'] = @boxdarknesswell.rgba
19
- @map.options['Box Number Color'] = @boxnumberwell.rgba
20
- @map.options['Box Border Color'] = @boxborderwell.rgba
21
- @map.options['Arrow Color'] = @arrowwell.rgba
22
- @map.draw
23
- end
24
-
25
- def initialize(parent)
26
- decor = DECOR_TITLE|DECOR_BORDER|DECOR_CLOSE
27
- super(parent, BOX_COLOR, decor)
28
-
29
- # pane for the buttons
30
- contents = FXVerticalFrame.new(self, (FRAME_SUNKEN|LAYOUT_FILL_Y|
31
- LAYOUT_TOP|LAYOUT_LEFT), 0, 0, 0, 0, 10, 10, 10, 10)
32
-
33
- frame = FXHorizontalFrame.new(contents, (FRAME_SUNKEN|LAYOUT_FILL_X|
34
- LAYOUT_TOP|LAYOUT_LEFT), 0, 0, 0, 0, 10, 10, 10, 10)
35
-
36
- FXLabel.new(frame, BOX_BG_COLOR, nil, JUSTIFY_CENTER_X|LAYOUT_FILL_X)
37
- @backwell = FXColorWell.new(frame, FXColor::White,
38
- nil, 0, (LAYOUT_CENTER_X|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_SIDE_RIGHT|
39
- LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT), 0, 0, 100, 30)
40
- @backwell.connect(SEL_COMMAND, method(:copy_to))
41
-
42
- frame = FXHorizontalFrame.new(contents, (FRAME_SUNKEN|LAYOUT_FILL_X|
43
- LAYOUT_TOP|LAYOUT_LEFT), 0, 0, 0, 0, 10, 10, 10, 10)
44
- FXLabel.new(frame, BOX_ARROWS_COLOR, nil, JUSTIFY_CENTER_X|LAYOUT_FILL_X)
45
- @arrowwell = FXColorWell.new(frame, FXColor::White,
46
- nil, 0, (LAYOUT_CENTER_X|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_SIDE_RIGHT|
47
- LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT), 0, 0, 100, 30)
48
- @arrowwell.connect(SEL_COMMAND, method(:copy_to))
49
-
50
- frame = FXHorizontalFrame.new(contents, (FRAME_SUNKEN|LAYOUT_FILL_X|
51
- LAYOUT_TOP|LAYOUT_LEFT), 0, 0, 0, 0, 10, 10, 10, 10)
52
- FXLabel.new(frame, BOX_BOX_BG_COLOR, nil,JUSTIFY_CENTER_X|LAYOUT_FILL_X)
53
- @boxwell = FXColorWell.new(frame, FXColor::White,
54
- nil, 0, (LAYOUT_CENTER_X|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_SIDE_RIGHT|
55
- LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT), 0, 0, 100, 30)
56
- @boxwell.connect(SEL_COMMAND, method(:copy_to))
57
-
58
- frame = FXHorizontalFrame.new(contents, (FRAME_SUNKEN|LAYOUT_FILL_X|
59
- LAYOUT_TOP|LAYOUT_LEFT), 0, 0, 0, 0, 10, 10, 10, 10)
60
- FXLabel.new(frame, BOX_BOX_DARK_COLOR, nil,
61
- JUSTIFY_CENTER_X|LAYOUT_FILL_X)
62
- @boxdarknesswell = FXColorWell.new(frame, FXColor::White,
63
- nil, 0, (LAYOUT_CENTER_X|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_SIDE_RIGHT|
64
- LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT), 0, 0, 100, 30)
65
- @boxdarknesswell.connect(SEL_COMMAND, method(:copy_to))
66
-
67
- frame = FXHorizontalFrame.new(contents, (FRAME_SUNKEN|LAYOUT_FILL_X|
68
- LAYOUT_TOP|LAYOUT_LEFT), 0, 0, 0, 0, 10, 10, 10, 10)
69
- FXLabel.new(frame, BOX_BOX_BORDER_COLOR, nil,
70
- JUSTIFY_CENTER_X|LAYOUT_FILL_X)
71
- @boxborderwell = FXColorWell.new(frame, FXColor::White,
72
- nil, 0, (LAYOUT_CENTER_X|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_SIDE_RIGHT|
73
- LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT), 0, 0, 100, 30)
74
- @boxborderwell.connect(SEL_COMMAND, method(:copy_to))
75
-
76
- frame = FXHorizontalFrame.new(contents, (FRAME_SUNKEN|LAYOUT_FILL_X|
77
- LAYOUT_TOP|LAYOUT_LEFT), 0, 0, 0, 0, 10, 10, 10, 10)
78
- FXLabel.new(frame, BOX_BOX_NUMBER_COLOR, nil,
79
- JUSTIFY_CENTER_X|LAYOUT_FILL_X)
80
- @boxnumberwell = FXColorWell.new(frame, FXColor::White,
81
- nil, 0, (LAYOUT_CENTER_X|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_SIDE_RIGHT|
82
- LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT), 0, 0, 100, 30)
83
- @boxnumberwell.connect(SEL_COMMAND, method(:copy_to))
84
-
85
- create
86
- show
87
- end
88
- end
1
+
2
+
3
+ class FXMapColorBox < FXDialogBox
4
+
5
+ def copy_from(map)
6
+ @backwell.rgba = map.options['BG Color']
7
+ @boxwell.rgba = map.options['Box BG Color']
8
+ @boxdarknesswell.rgba = map.options['Box Darkness Color']
9
+ @boxnumberwell.rgba = map.options['Box Number Color']
10
+ @boxborderwell.rgba = map.options['Box Border Color']
11
+ @arrowwell.rgba = map.options['Arrow Color']
12
+ @map = map
13
+ end
14
+
15
+ def copy_to(sender, id, event)
16
+ @map.options['BG Color'] = @backwell.rgba
17
+ @map.options['Box BG Color'] = @boxwell.rgba
18
+ @map.options['Box Darkness Color'] = @boxdarknesswell.rgba
19
+ @map.options['Box Number Color'] = @boxnumberwell.rgba
20
+ @map.options['Box Border Color'] = @boxborderwell.rgba
21
+ @map.options['Arrow Color'] = @arrowwell.rgba
22
+ @map.draw
23
+ end
24
+
25
+ def initialize(parent)
26
+ decor = DECOR_TITLE|DECOR_BORDER|DECOR_CLOSE
27
+ super(parent, BOX_COLOR, decor)
28
+
29
+ # pane for the buttons
30
+ contents = FXVerticalFrame.new(self, (FRAME_SUNKEN|LAYOUT_FILL_Y|
31
+ LAYOUT_TOP|LAYOUT_LEFT), 0, 0, 0, 0, 10, 10, 10, 10)
32
+
33
+ frame = FXHorizontalFrame.new(contents, (FRAME_SUNKEN|LAYOUT_FILL_X|
34
+ LAYOUT_TOP|LAYOUT_LEFT), 0, 0, 0, 0, 10, 10, 10, 10)
35
+
36
+ FXLabel.new(frame, BOX_BG_COLOR, nil, JUSTIFY_CENTER_X|LAYOUT_FILL_X)
37
+ @backwell = FXColorWell.new(frame, FXColor::White,
38
+ nil, 0, (LAYOUT_CENTER_X|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_SIDE_RIGHT|
39
+ LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT), 0, 0, 100, 30)
40
+ @backwell.connect(SEL_COMMAND, method(:copy_to))
41
+
42
+ frame = FXHorizontalFrame.new(contents, (FRAME_SUNKEN|LAYOUT_FILL_X|
43
+ LAYOUT_TOP|LAYOUT_LEFT), 0, 0, 0, 0, 10, 10, 10, 10)
44
+ FXLabel.new(frame, BOX_ARROWS_COLOR, nil, JUSTIFY_CENTER_X|LAYOUT_FILL_X)
45
+ @arrowwell = FXColorWell.new(frame, FXColor::White,
46
+ nil, 0, (LAYOUT_CENTER_X|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_SIDE_RIGHT|
47
+ LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT), 0, 0, 100, 30)
48
+ @arrowwell.connect(SEL_COMMAND, method(:copy_to))
49
+
50
+ frame = FXHorizontalFrame.new(contents, (FRAME_SUNKEN|LAYOUT_FILL_X|
51
+ LAYOUT_TOP|LAYOUT_LEFT), 0, 0, 0, 0, 10, 10, 10, 10)
52
+ FXLabel.new(frame, BOX_BOX_BG_COLOR, nil,JUSTIFY_CENTER_X|LAYOUT_FILL_X)
53
+ @boxwell = FXColorWell.new(frame, FXColor::White,
54
+ nil, 0, (LAYOUT_CENTER_X|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_SIDE_RIGHT|
55
+ LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT), 0, 0, 100, 30)
56
+ @boxwell.connect(SEL_COMMAND, method(:copy_to))
57
+
58
+ frame = FXHorizontalFrame.new(contents, (FRAME_SUNKEN|LAYOUT_FILL_X|
59
+ LAYOUT_TOP|LAYOUT_LEFT), 0, 0, 0, 0, 10, 10, 10, 10)
60
+ FXLabel.new(frame, BOX_BOX_DARK_COLOR, nil,
61
+ JUSTIFY_CENTER_X|LAYOUT_FILL_X)
62
+ @boxdarknesswell = FXColorWell.new(frame, FXColor::White,
63
+ nil, 0, (LAYOUT_CENTER_X|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_SIDE_RIGHT|
64
+ LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT), 0, 0, 100, 30)
65
+ @boxdarknesswell.connect(SEL_COMMAND, method(:copy_to))
66
+
67
+ frame = FXHorizontalFrame.new(contents, (FRAME_SUNKEN|LAYOUT_FILL_X|
68
+ LAYOUT_TOP|LAYOUT_LEFT), 0, 0, 0, 0, 10, 10, 10, 10)
69
+ FXLabel.new(frame, BOX_BOX_BORDER_COLOR, nil,
70
+ JUSTIFY_CENTER_X|LAYOUT_FILL_X)
71
+ @boxborderwell = FXColorWell.new(frame, FXColor::White,
72
+ nil, 0, (LAYOUT_CENTER_X|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_SIDE_RIGHT|
73
+ LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT), 0, 0, 100, 30)
74
+ @boxborderwell.connect(SEL_COMMAND, method(:copy_to))
75
+
76
+ frame = FXHorizontalFrame.new(contents, (FRAME_SUNKEN|LAYOUT_FILL_X|
77
+ LAYOUT_TOP|LAYOUT_LEFT), 0, 0, 0, 0, 10, 10, 10, 10)
78
+ FXLabel.new(frame, BOX_BOX_NUMBER_COLOR, nil,
79
+ JUSTIFY_CENTER_X|LAYOUT_FILL_X)
80
+ @boxnumberwell = FXColorWell.new(frame, FXColor::White,
81
+ nil, 0, (LAYOUT_CENTER_X|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_SIDE_RIGHT|
82
+ LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT), 0, 0, 100, 30)
83
+ @boxnumberwell.connect(SEL_COMMAND, method(:copy_to))
84
+
85
+ create
86
+ show
87
+ end
88
+ end
@@ -1,127 +1,127 @@
1
-
2
-
3
- class FXMapDialogBox < FXDialogBox
4
-
5
- def copy_to()
6
- @map.name = @name.text
7
- @map.creator = @creator.text
8
- @map.navigation = (@read.checkState == 1)
9
-
10
- if @map.navigation
11
- @name.disable
12
- @creator.disable
13
- @width.disable
14
- @height.disable
15
- else
16
- @name.enable
17
- @creator.enable
18
- @width.enable
19
- @height.enable
20
- end
21
-
22
- w = @width.text.to_i
23
- h = @height.text.to_i
24
-
25
- @map.update_title
26
-
27
- if w != @map.width or h != @map.height
28
- if w < @map.width or h < @map.height
29
- rooms = []
30
- @map.sections.each { |s|
31
- s.rooms.each { |r|
32
- if r.x >= w or r.y >= h
33
- rooms << [s, r]
34
- end
35
- }
36
- }
37
- if not rooms.empty?
38
- d = FXWarningBox.new(@map.window, WARN_MAP_SMALL)
39
- if d.execute == 0
40
- copy_from(@map)
41
- return
42
- end
43
- rooms.each { |p|
44
- p[0].delete_room(p[1])
45
- }
46
- end
47
- end
48
- @map.width = w
49
- @map.height = h
50
- @map.zoom = @map.zoom
51
- @map.create_pathmap
52
- @map.draw
53
- end
54
-
55
- end
56
-
57
- def copy_from(map)
58
- @name.text = map.name
59
- @creator.text = map.creator
60
- @read.checkState = map.navigation
61
- @width.text = map.width.to_s
62
- @height.text = map.height.to_s
63
- if map.navigation
64
- @name.disable
65
- @creator.disable
66
- @width.disable
67
- @height.disable
68
- else
69
- @name.enable
70
- @creator.enable
71
- @width.enable
72
- @height.enable
73
- end
74
- @map = map
75
- end
76
-
77
- def initialize(parent)
78
- decor = DECOR_TITLE|DECOR_BORDER|DECOR_CLOSE
79
-
80
- super( parent, BOX_MAP_INFORMATION, decor, 40, 40, 0, 0 )
81
- mainFrame = FXVerticalFrame.new(self,
82
- FRAME_SUNKEN|FRAME_THICK|
83
- LAYOUT_FILL_X|LAYOUT_FILL_Y)
84
-
85
- @read = FXCheckButton.new(mainFrame, BOX_MAP_READ_ONLY, nil, 0,
86
- ICON_BEFORE_TEXT|LAYOUT_LEFT|LAYOUT_SIDE_TOP|
87
- LAYOUT_SIDE_RIGHT)
88
-
89
- frame = FXHorizontalFrame.new(mainFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
90
-
91
- FXLabel.new(frame, "#{BOX_NAME}:", nil, 0, LAYOUT_FILL_X)
92
- @name = FXTextField.new(frame, 42, nil, 0, LAYOUT_FILL_ROW)
93
-
94
- frame = FXHorizontalFrame.new(mainFrame,
95
- LAYOUT_FILL_X|LAYOUT_FILL_Y)
96
-
97
- FXLabel.new(frame, BOX_MAP_CREATOR, nil, 0, LAYOUT_FILL_X)
98
- @creator = FXTextField.new(frame, 40, nil, 0, LAYOUT_FILL_ROW)
99
-
100
- frame = FXHorizontalFrame.new(mainFrame,
101
- LAYOUT_SIDE_TOP|FRAME_SUNKEN|
102
- LAYOUT_FILL_X|LAYOUT_FILL_Y)
103
-
104
- frame2 = FXVerticalFrame.new(frame,
105
- LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y )
106
- FXLabel.new(frame2, BOX_MAP_WIDTH, nil, 0, LAYOUT_FILL_X)
107
- @width = FXTextField.new( frame2, 6, nil, 0,
108
- TEXTFIELD_INTEGER|LAYOUT_FILL_ROW)
109
-
110
- frame2 = FXVerticalFrame.new(frame,
111
- LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y )
112
- FXLabel.new(frame2, BOX_MAP_HEIGHT, nil, 0, LAYOUT_FILL_X)
113
- @height = FXTextField.new( frame2, 6, nil, 0,
114
- TEXTFIELD_INTEGER|LAYOUT_FILL_ROW)
115
-
116
- @name.connect(SEL_CHANGED) { copy_to() }
117
- @creator.connect(SEL_CHANGED) { copy_to() }
118
- @read.connect(SEL_COMMAND) { copy_to() }
119
- @width.connect(SEL_COMMAND) { copy_to() }
120
- @height.connect(SEL_COMMAND) { copy_to() }
121
-
122
- @parent = parent
123
-
124
- # We need to create the dialog box first, so we can use select text.
125
- create
126
- end
127
- end
1
+
2
+
3
+ class FXMapDialogBox < FXDialogBox
4
+
5
+ def copy_to()
6
+ @map.name = @name.text
7
+ @map.creator = @creator.text
8
+ @map.navigation = (@read.checkState == 1)
9
+
10
+ if @map.navigation
11
+ @name.disable
12
+ @creator.disable
13
+ @width.disable
14
+ @height.disable
15
+ else
16
+ @name.enable
17
+ @creator.enable
18
+ @width.enable
19
+ @height.enable
20
+ end
21
+
22
+ w = @width.text.to_i
23
+ h = @height.text.to_i
24
+
25
+ @map.update_title
26
+
27
+ if w != @map.width or h != @map.height
28
+ if w < @map.width or h < @map.height
29
+ rooms = []
30
+ @map.sections.each { |s|
31
+ s.rooms.each { |r|
32
+ if r.x >= w or r.y >= h
33
+ rooms << [s, r]
34
+ end
35
+ }
36
+ }
37
+ if not rooms.empty?
38
+ d = FXWarningBox.new(@map.window, WARN_MAP_SMALL)
39
+ if d.execute == 0
40
+ copy_from(@map)
41
+ return
42
+ end
43
+ rooms.each { |p|
44
+ p[0].delete_room(p[1])
45
+ }
46
+ end
47
+ end
48
+ @map.width = w
49
+ @map.height = h
50
+ @map.zoom = @map.zoom
51
+ @map.create_pathmap
52
+ @map.draw
53
+ end
54
+
55
+ end
56
+
57
+ def copy_from(map)
58
+ @name.text = map.name
59
+ @creator.text = map.creator
60
+ @read.checkState = map.navigation
61
+ @width.text = map.width.to_s
62
+ @height.text = map.height.to_s
63
+ if map.navigation
64
+ @name.disable
65
+ @creator.disable
66
+ @width.disable
67
+ @height.disable
68
+ else
69
+ @name.enable
70
+ @creator.enable
71
+ @width.enable
72
+ @height.enable
73
+ end
74
+ @map = map
75
+ end
76
+
77
+ def initialize(parent)
78
+ decor = DECOR_TITLE|DECOR_BORDER|DECOR_CLOSE
79
+
80
+ super( parent, BOX_MAP_INFORMATION, decor, 40, 40, 0, 0 )
81
+ mainFrame = FXVerticalFrame.new(self,
82
+ FRAME_SUNKEN|FRAME_THICK|
83
+ LAYOUT_FILL_X|LAYOUT_FILL_Y)
84
+
85
+ @read = FXCheckButton.new(mainFrame, BOX_MAP_READ_ONLY, nil, 0,
86
+ ICON_BEFORE_TEXT|LAYOUT_LEFT|LAYOUT_SIDE_TOP|
87
+ LAYOUT_SIDE_RIGHT)
88
+
89
+ frame = FXHorizontalFrame.new(mainFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
90
+
91
+ FXLabel.new(frame, "#{BOX_NAME}:", nil, 0, LAYOUT_FILL_X)
92
+ @name = FXTextField.new(frame, 42, nil, 0, LAYOUT_FILL_ROW)
93
+
94
+ frame = FXHorizontalFrame.new(mainFrame,
95
+ LAYOUT_FILL_X|LAYOUT_FILL_Y)
96
+
97
+ FXLabel.new(frame, BOX_MAP_CREATOR, nil, 0, LAYOUT_FILL_X)
98
+ @creator = FXTextField.new(frame, 40, nil, 0, LAYOUT_FILL_ROW)
99
+
100
+ frame = FXHorizontalFrame.new(mainFrame,
101
+ LAYOUT_SIDE_TOP|FRAME_SUNKEN|
102
+ LAYOUT_FILL_X|LAYOUT_FILL_Y)
103
+
104
+ frame2 = FXVerticalFrame.new(frame,
105
+ LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y )
106
+ FXLabel.new(frame2, BOX_MAP_WIDTH, nil, 0, LAYOUT_FILL_X)
107
+ @width = FXTextField.new( frame2, 6, nil, 0,
108
+ TEXTFIELD_INTEGER|LAYOUT_FILL_ROW)
109
+
110
+ frame2 = FXVerticalFrame.new(frame,
111
+ LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y )
112
+ FXLabel.new(frame2, BOX_MAP_HEIGHT, nil, 0, LAYOUT_FILL_X)
113
+ @height = FXTextField.new( frame2, 6, nil, 0,
114
+ TEXTFIELD_INTEGER|LAYOUT_FILL_ROW)
115
+
116
+ @name.connect(SEL_CHANGED) { copy_to() }
117
+ @creator.connect(SEL_CHANGED) { copy_to() }
118
+ @read.connect(SEL_COMMAND) { copy_to() }
119
+ @width.connect(SEL_COMMAND) { copy_to() }
120
+ @height.connect(SEL_COMMAND) { copy_to() }
121
+
122
+ @parent = parent
123
+
124
+ # We need to create the dialog box first, so we can use select text.
125
+ create
126
+ end
127
+ end
@@ -1,34 +1,34 @@
1
-
2
-
3
- #
4
- # A simple class to show a filerequester that remembers the
5
- # last directory visited.
6
- #
7
- class FXMapFileDialog < FXFileDialog
8
- @@last_path = nil
9
-
10
- KNOWN_LOAD_EXTENSIONS = [
11
- "#{EXT_MAP_FILES} (*.map,*.gmp,*.ifm,*.inf,*.t,*.t3m)",
12
- EXT_ALL_FILES,
13
- ]
14
-
15
- KNOWN_SAVE_EXTENSIONS = [
16
- "#{EXT_MAP_FILES} (*.map,*.gmp,*.ifm,*.inf,*.inform,*.t,*.t3m)",
17
- EXT_ALL_FILES,
18
- ]
19
-
20
-
21
- def initialize(parent, title, patterns = KNOWN_LOAD_EXTENSIONS)
22
- opts = 0
23
- if RUBY_PLATFORM =~ /mswin/
24
- opts |= FILEMATCH_NOESCAPE
25
- end
26
- super(parent, title, opts)
27
- setPatternList(patterns)
28
- self.directory = @@last_path if @@last_path
29
- if execute != 0
30
- @@last_path = filename.sub(/[\\\/][^\\\/]+$/, '')
31
- end
32
- end
33
- end
34
-
1
+
2
+
3
+ #
4
+ # A simple class to show a filerequester that remembers the
5
+ # last directory visited.
6
+ #
7
+ class FXMapFileDialog < FXFileDialog
8
+ @@last_path = nil
9
+
10
+ KNOWN_LOAD_EXTENSIONS = [
11
+ "#{EXT_MAP_FILES} (*.map,*.gmp,*.ifm,*.inf,*.t,*.t3m)",
12
+ EXT_ALL_FILES,
13
+ ]
14
+
15
+ KNOWN_SAVE_EXTENSIONS = [
16
+ "#{EXT_MAP_FILES} (*.map,*.gmp,*.ifm,*.inf,*.inform,*.t,*.t3m)",
17
+ EXT_ALL_FILES,
18
+ ]
19
+
20
+
21
+ def initialize(parent, title, patterns = KNOWN_LOAD_EXTENSIONS)
22
+ opts = 0
23
+ if RUBY_PLATFORM =~ /mswin/
24
+ opts |= FILEMATCH_NOESCAPE
25
+ end
26
+ super(parent, title, opts)
27
+ setPatternList(patterns)
28
+ self.directory = @@last_path if @@last_path
29
+ if execute != 0
30
+ @@last_path = filename.sub(/[\\\/][^\\\/]+$/, '')
31
+ end
32
+ end
33
+ end
34
+