Class: FXSVGMapExporterOptionsDialogBox
- Inherits:
-
FXDialogBox
- Object
- FXDialogBox
- FXSVGMapExporterOptionsDialogBox
- Defined in:
- lib/IFMapper/FXSVGMapExporterOptionsDialogBox.rb
Instance Method Summary collapse
-
#initialize(parent, title, map) ⇒ FXSVGMapExporterOptionsDialogBox
constructor
A new instance of FXSVGMapExporterOptionsDialogBox.
Constructor Details
#initialize(parent, title, map) ⇒ FXSVGMapExporterOptionsDialogBox
Returns a new instance of FXSVGMapExporterOptionsDialogBox.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/IFMapper/FXSVGMapExporterOptionsDialogBox.rb', line 3 def initialize(parent, title, map) decor = DECOR_TITLE|DECOR_BORDER|DECOR_CLOSE super( parent, title, decor, 40, 40, 0, 0 ) mainFrame = FXVerticalFrame.new(self, FRAME_SUNKEN|FRAME_THICK| LAYOUT_FILL_X|LAYOUT_FILL_Y) # Show location text (draw_roomnames): # ==================================== showlocationtext = FXCheckButton.new(mainFrame, BOX_SVG_SHOWLOCTEXT, nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP| LAYOUT_SIDE_RIGHT) showlocationtext.setCheck(true) showlocationtext.tipText = BOX_SVG_SHOWLOCTEXT_TOOLTIP map.['draw_roomnames'] = true showlocationtext.connect(SEL_COMMAND) { map.['draw_roomnames'] = (showlocationtext.check == true) } # Show location numbers (print_room_nums): # ======================================== showlocationnumbers = FXCheckButton.new(mainFrame, BOX_SVG_SHOWLOCNUMS, nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP| LAYOUT_SIDE_RIGHT) showlocationnumbers.setCheck(true) showlocationnumbers.tipText = BOX_SVG_SHOWLOCNUMS_TOOLTIP map.['print_room_nums'] = true showlocationnumbers.connect(SEL_COMMAND) { map.['print_room_nums'] = (showlocationnumbers.check == true) } # Show interactive location information: # ====================================== # Section title label showinteractivelabel = FXLabel.new(mainFrame, BOX_SVG_SHOWINTERTITLE, nil, 0, LAYOUT_FILL_X) showinteractivelabel.padTop = 10 # Objects checkbox (draw_objects): showinteractiveobjects = FXCheckButton.new(mainFrame, BOX_SVG_SHOWINTEROBJECTS, nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP| LAYOUT_SIDE_RIGHT) showinteractiveobjects.setCheck(true) showinteractiveobjects.padLeft = 20 showinteractiveobjects.tipText = BOX_SVG_SHOWINTEROBJECTS_TOOLTIP map.['draw_objects'] = true showinteractiveobjects.connect(SEL_COMMAND) { map.['draw_objects'] = (showinteractiveobjects.check == true) } # Tasks checkbox (draw_tasks): showinteractivetasks = FXCheckButton.new(mainFrame, BOX_SVG_SHOWINTERTASKS, nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP| LAYOUT_SIDE_RIGHT) showinteractivetasks.setCheck(true) showinteractivetasks.padLeft = 20 showinteractivetasks.tipText = BOX_SVG_SHOWINTERTASKS_TOOLTIP map.['draw_tasks'] = true showinteractivetasks.connect(SEL_COMMAND) { map.['draw_tasks'] = (showinteractivetasks.check == true) } # Comments checkbox (draw_comments): showinteractivecomments = FXCheckButton.new(mainFrame, BOX_SVG_SHOWINTERCOMMENTS, nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP| LAYOUT_SIDE_RIGHT) showinteractivecomments.setCheck(true) showinteractivecomments.padLeft = 20 showinteractivecomments.tipText = BOX_SVG_SHOWINTERCOMMENTS_TOOLTIP map.['draw_comments'] = true showinteractivecomments.connect(SEL_COMMAND) { map.['draw_comments'] = (showinteractivecomments.check == true) } # Description checkbox (draw_description): showinteractivedescription = FXCheckButton.new(mainFrame, BOX_SVG_SHOWINTERDESCRIPTION, nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP| LAYOUT_SIDE_RIGHT) showinteractivedescription.setCheck(true) showinteractivedescription.padLeft = 20 showinteractivedescription.tipText = BOX_SVG_SHOWINTERDESCRIPTION_TOOLTIP map.['draw_description'] = true showinteractivedescription.connect(SEL_COMMAND) { map.['draw_description'] = (showinteractivedescription.check == true) } # Show section comments (draw_sectioncomments): # ============================================= showsectioncomments = FXCheckButton.new(mainFrame, BOX_SVG_SHOWSECTCOMMENTS, nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP| LAYOUT_SIDE_RIGHT) showsectioncomments.setCheck(true) showsectioncomments.tipText = BOX_SVG_SHOWSECTCOMMENTS_TOOLTIP showsectioncomments.padTop = 10 showsectioncomments.padBottom = 10 map.['draw_sectioncomments'] = true showsectioncomments.connect(SEL_COMMAND) { map.['draw_sectioncomments'] = (showsectioncomments.check == true) } # Compass size (compass_size): # ============================================= # Horizontal frame to hold label and slider compasssizeframe = FXHorizontalFrame.new(mainFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X) # Compass size label compasssizelabel = FXLabel.new(compasssizeframe, BOX_SVG_COMPASSSIZE, nil, 0, LAYOUT_LEFT) compasssizelabel.tipText = BOX_SVG_COMPASSSIZE_TOOLTIP # Compass size slider = FXSlider.new(compasssizeframe, nil, 0, SLIDER_HORIZONTAL|LAYOUT_FIX_WIDTH| SLIDER_TICKS_TOP|LAYOUT_RIGHT, :width => 100) .range = (0..15) .value = 3 .tipText = BOX_SVG_COMPASSSIZE_TOOLTIP map.['compass_size'] = 3 .connect(SEL_COMMAND) { map.['compass_size'] = (.value) } # Location line thickness (room_line_width): # ============================================= # Horizontal frame to hold label and slider locationlinethicknessframe = FXHorizontalFrame.new(mainFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X) # Location line thickness label locationlinethicknesslabel = FXLabel.new(locationlinethicknessframe, BOX_SVG_LOCTHICKNESS, nil, 0, LAYOUT_LEFT) locationlinethicknesslabel.tipText = BOX_SVG_LOCTHICKNESS_TOOLTIP # Location line thickness slider = FXSlider.new(locationlinethicknessframe, nil, 0, SLIDER_HORIZONTAL|LAYOUT_FIX_WIDTH| SLIDER_TICKS_TOP|LAYOUT_RIGHT, :width => 100) .range = (0..5) .value = 2 .tipText = BOX_SVG_LOCTHICKNESS_TOOLTIP map.['room_line_width'] = 2 .connect(SEL_COMMAND) { if .value == 0 .value = 1 end map.['room_line_width'] = (.value) } # Connection line thickness (conn_line_width, door_line_width, draw_connections): # =============================================================================== # Horizontal frame to hold label and slider connectionlinethicknessframe = FXHorizontalFrame.new(mainFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X) # Connection line thickness label connectionlinethicknesslabel = FXLabel.new(connectionlinethicknessframe, BOX_SVG_CONNTHICKNESS, nil, 0, LAYOUT_LEFT) connectionlinethicknesslabel.tipText = BOX_SVG_CONNTHICKNESS_TOOLTIP # Connection line thickness slider = FXSlider.new(connectionlinethicknessframe, nil, 0, SLIDER_HORIZONTAL|LAYOUT_FIX_WIDTH| SLIDER_TICKS_TOP|LAYOUT_RIGHT, :width => 100) .range = (0..5) .value = 2 .tipText = BOX_SVG_CONNTHICKNESS_TOOLTIP map.['conn_line_width'] = 2 map.['door_line_width'] = 2 map.['draw_connections'] = true .connect(SEL_COMMAND) { map.['conn_line_width'] = (.value) map.['door_line_width'] = (.value) map.['draw_connections'] = (.value > 0) } # Colour scheme (objs_fill_colour, corner_fill_colour, num_fill_colour, door_line_colour): # ======================================================================================== # Horizontal frame to hold label and popup menu colourschemeframe = FXHorizontalFrame.new(mainFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X) # Colour scheme label colourschemelabel = FXLabel.new(colourschemeframe, BOX_SVG_COLOURSCHEME, nil, 0, LAYOUT_LEFT) colourschemelabel.tipText = BOX_SVG_COLOURSCHEME_TOOLTIP # Colour scheme popup colourschemepopup = FXPopup.new(self) BOX_SVG_COLOURSCHEME_OPTIONS.each { |colourschemeoption| FXOption.new(colourschemepopup, colourschemeoption, nil, nil, 0, JUSTIFY_HZ_APART|ICON_AFTER_TEXT) } # Colour scheme options menu = FXOptionMenu.new(colourschemeframe, colourschemepopup, FRAME_RAISED|FRAME_THICK| JUSTIFY_HZ_APART|ICON_AFTER_TEXT|LAYOUT_RIGHT|LAYOUT_FIX_WIDTH, :width => 100) .currentNo = 1 .tipText = BOX_SVG_COLOURSCHEME_TOOLTIP map.['objs_fill_colour'] = "lightgreen" map.['corner_fill_colour'] = "lightgreen" map.['num_fill_colour'] = "lightgreen" map.['door_line_colour'] = "forestgreen" .connect(SEL_COMMAND) { case .currentNo when 0 map.['objs_fill_colour'] = "lightpink" map.['corner_fill_colour'] = "lightpink" map.['num_fill_colour'] = "lightpink" map.['door_line_colour'] = "firebrick" when 1 map.['objs_fill_colour'] = "lightgreen" map.['corner_fill_colour'] = "lightgreen" map.['num_fill_colour'] = "lightgreen" map.['door_line_colour'] = "forestgreen" when 2 map.['objs_fill_colour'] = "yellow" map.['corner_fill_colour'] = "yellow" map.['num_fill_colour'] = "yellow" map.['door_line_colour'] = "goldenrod" when 3 map.['objs_fill_colour'] = "lightblue" map.['corner_fill_colour'] = "lightblue" map.['num_fill_colour'] = "lightblue" map.['door_line_colour'] = "darkslateblue" end } # Export options radio buttons (split_sections, current_section_only, selected_elements_only): # ============================================================================================ # Horiz line to separate this section FXHorizontalSeparator.new(mainFrame) # Vertical frame to hold the label and radio buttons = FXVerticalFrame.new(mainFrame, LAYOUT_FILL_X) # Data target - handles selection/deselection of radio buttons = FXDataTarget.new(0) # Export label FXLabel.new(, "Export:") # Export - All combined radio button = FXRadioButton.new(, BOX_SVG_EXPORTALLCOMBINED, , FXDataTarget::ID_OPTION) .tipText = BOX_SVG_EXPORTALLCOMBINED_TOOLTIP # Export - All individual files radio button = FXRadioButton.new(, BOX_SVG_EXPORTALLINDIV, , FXDataTarget::ID_OPTION+1) .tipText = BOX_SVG_EXPORTALLINDIV_TOOLTIP # Export - Current individual file radio button = FXRadioButton.new(, BOX_SVG_EXPORTCURRENTINDIV, , FXDataTarget::ID_OPTION+2) .tipText = BOX_SVG_EXPORTCURRENTINDIV_TOOLTIP map.['split_sections'] = false map.['current_section_only'] = false map.['selected_elements_only'] = false # Draw selected elements only checkbox = FXCheckButton.new(mainFrame, BOX_SVG_EXPORTSELONLY, nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP|JUSTIFY_LEFT| LAYOUT_SIDE_RIGHT) .setCheck(false) .disable .tipText = BOX_SVG_EXPORTSELONLY_TOOLTIP map.['selected_elements_only'] = false # Draw location text for selected only checkbox drawlocationforselectedonly = FXCheckButton.new(mainFrame, BOX_SVG_EXPORTALLLOCSSELTXT, nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP|JUSTIFY_LEFT|LAYOUT_SIDE_RIGHT) drawlocationforselectedonly.setCheck(false) drawlocationforselectedonly.disable drawlocationforselectedonly.tipText = BOX_SVG_EXPORTALLLOCSSELTXT_TOOLTIP map.['text_for_selected_only'] = false .connect(SEL_COMMAND) { case .value when 0 .disable # exportoptionsselectedonly.setCheck(false) drawlocationforselectedonly.disable # drawlocationforselectedonly.setCheck(false) map.['split_sections'] = false map.['current_section_only'] = false # map.options['selected_elements_only'] = false # map.options['location_text_for_selected_only'] = false showlocationtext.enable map.['draw_roomnames'] = showlocationtext.check when 1 .disable # exportoptionsselectedonly.setCheck(false) drawlocationforselectedonly.disable # drawlocationforselectedonly.setCheck(false) map.['split_sections'] = true map.['current_section_only'] = false # map.options['selected_elements_only'] = false # map.options['location_text_for_selected_only'] = false showlocationtext.enable map.['draw_roomnames'] = showlocationtext.check when 2 .enable drawlocationforselectedonly.enable map.['split_sections'] = true map.['current_section_only'] = true if drawlocationforselectedonly.check showlocationtext.disable map.['draw_roomnames'] = false end end } .connect(SEL_COMMAND) { map.['selected_elements_only'] = (.check == true) if .check drawlocationforselectedonly.disable drawlocationforselectedonly.setCheck(false) else drawlocationforselectedonly.enable end } drawlocationforselectedonly.connect(SEL_COMMAND) { map.['text_for_selected_only'] = (drawlocationforselectedonly.check == true) if drawlocationforselectedonly.check showlocationtext.disable map.['draw_roomnames'] = false .disable .setCheck(false) else showlocationtext.enable map.['draw_roomnames'] = showlocationtext.check .enable end } # Dialog button(s): # ================= # Horizontal frame to hold button = FXHorizontalFrame.new(mainFrame, LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X| PACK_UNIFORM_WIDTH) # OK button FXButton.new(, "&OK", nil, self, FXDialogBox::ID_ACCEPT, FRAME_RAISED|LAYOUT_FILL_X|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y) create end |