51 #ifdef CHECK_MEMORY_LEAKS
53 #endif // CHECK_MEMORY_LEAKS
93 :
FXDialogBox(parent, "View Settings", DECOR_TITLE | DECOR_BORDER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
94 myParent(parent), mySettings(settings),
95 myDecals(decals), myDecalsLock(decalsLock), myDecalsTable(0) {
96 myBackup = (*mySettings);
98 FXVerticalFrame* contentFrame =
99 new FXVerticalFrame(
this, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y,
100 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
104 new FXHorizontalFrame(contentFrame, FRAME_THICK, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
105 mySchemeName =
new FXComboBox(frame0, 20,
this,
MID_SIMPLE_VIEW_NAMECHANGE, COMBOBOX_INSERT_LAST | FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_CENTER_Y | COMBOBOX_STATIC);
107 for (std::vector<std::string>::const_iterator i = names.begin(); i != names.end(); ++i) {
108 size_t index = mySchemeName->appendItem((*i).c_str());
109 if ((*i) == mySettings->name) {
110 mySchemeName->setCurrentItem((FXint) index);
113 mySchemeName->setNumVisible(5);
115 new FXButton(frame0,
"\t\tSave the setting to registry",
117 ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
118 new FXButton(frame0,
"\t\tRemove the setting from registry",
120 ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
121 new FXButton(frame0,
"\t\tExport setting to file",
123 ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
124 new FXButton(frame0,
"\t\tLoad setting from file",
126 ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
131 new FXTabBook(contentFrame, 0, 0, TABBOOK_LEFTTABS | PACK_UNIFORM_WIDTH | PACK_UNIFORM_HEIGHT | LAYOUT_FILL_X | LAYOUT_FILL_Y | LAYOUT_RIGHT,
132 0, 0, 0, 0, 0, 0, 0, 0);
135 new FXTabItem(tabbook,
"Background", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
136 FXVerticalFrame* frame1 =
137 new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
140 new FXMatrix(frame1, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
141 0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
142 new FXLabel(m11,
"Color", 0, LAYOUT_CENTER_Y);
143 myBackgroundColor =
new FXColorWell(m11,
convert(settings->backgroundColor),
145 LAYOUT_FIX_WIDTH | LAYOUT_CENTER_Y | LAYOUT_SIDE_TOP | FRAME_SUNKEN | FRAME_THICK | ICON_AFTER_TEXT,
146 0, 0, 100, 0, 0, 0, 0, 0);
148 new FXHorizontalSeparator(frame1, SEPARATOR_GROOVE | LAYOUT_FILL_X);
150 FXVerticalFrame* frame11 =
151 new FXVerticalFrame(frame1, LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
152 new FXLabel(frame11,
"Decals:");
153 myDecalsFrame =
new FXVerticalFrame(frame11);
155 new FXButton(frame111,
"&Load Decals", NULL,
this,
MID_SIMPLE_VIEW_LOAD_DECALS, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 20, 20, 4, 4);
156 new FXButton(frame111,
"&Save Decals", NULL,
this,
MID_SIMPLE_VIEW_SAVE_DECALS, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 20, 20, 4, 4);
158 new FXHorizontalSeparator(frame1, SEPARATOR_GROOVE | LAYOUT_FILL_X);
161 new FXMatrix(frame1, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
162 0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
165 myShowGrid->setCheck(mySettings->showGrid);
168 new FXMatrix(m12, 2, LAYOUT_CENTER_Y | LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
169 0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
170 new FXLabel(m121,
"x-spacing", 0, LAYOUT_CENTER_Y);
173 LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
174 myGridXSizeDialer->setRange(1, 10000);
175 myGridXSizeDialer->setValue(mySettings->gridXSize);
177 new FXMatrix(m12, 2, LAYOUT_CENTER_Y | LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
178 0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
179 new FXLabel(m122,
"y-spacing", 0, LAYOUT_CENTER_Y);
182 LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
183 myGridYSizeDialer->setRange(1, 10000);
184 myGridYSizeDialer->setValue(mySettings->gridXSize);
188 new FXTabItem(tabbook,
"Streets", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
190 FXVerticalFrame* frame2 =
191 new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
193 new FXMatrix(frame2, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
194 0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
195 new FXLabel(m21,
"Color by", 0, LAYOUT_CENTER_Y);
196 myLaneEdgeColorMode =
new FXComboBox(m21, 30,
this,
MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
197 myLaneEdgeColorMode->setNumVisible(10);
198 myLaneColorInterpolation =
new FXCheckButton(m21,
"Interpolate",
this,
MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
199 FXScrollWindow* genScroll =
new FXScrollWindow(frame2, LAYOUT_FILL_X | LAYOUT_SIDE_TOP | FRAME_RAISED | FRAME_THICK | LAYOUT_FIX_HEIGHT, 0, 0, 0, 80);
200 myLaneColorSettingFrame =
201 new FXVerticalFrame(genScroll, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2);
204 if (GUIVisualizationSettings::UseMesoSim) {
205 mySettings->edgeColorer.fill(*myLaneEdgeColorMode);
208 mySettings->laneColorer.fill(*myLaneEdgeColorMode);
213 new FXHorizontalSeparator(frame2, SEPARATOR_GROOVE | LAYOUT_FILL_X);
215 new FXMatrix(frame2, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
216 0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
218 myShowLaneBorders->setCheck(mySettings->laneShowBorders);
219 new FXLabel(m22,
" ", 0, LAYOUT_CENTER_Y);
221 myShowLaneDecals->setCheck(mySettings->showLinkDecals);
222 new FXLabel(m22,
" ", 0, LAYOUT_CENTER_Y);
224 myShowRails->setCheck(mySettings->showRails);
225 new FXLabel(m22,
" ", 0, LAYOUT_CENTER_Y);
227 myHideMacroConnectors->setCheck(mySettings->hideConnectors);
228 new FXLabel(m22,
" ", 0, LAYOUT_CENTER_Y);
230 myEdgeNamePanel =
new NamePanel(m22,
this,
"Show edge name", mySettings->edgeName);
231 myStreetNamePanel =
new NamePanel(m22,
this,
"Show street name", mySettings->streetName);
232 myInternalEdgeNamePanel =
new NamePanel(m22,
this,
"Show internal edge name", mySettings->internalEdgeName);
235 new FXTabItem(tabbook,
"Vehicles", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
236 FXVerticalFrame* frame3 =
237 new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
240 new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
241 0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
242 new FXLabel(m31,
"Show As", 0, LAYOUT_CENTER_Y);
243 myVehicleShapeDetail =
new FXComboBox(m31, 20,
this,
MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
244 myVehicleShapeDetail->appendItem(
"'triangles'");
245 myVehicleShapeDetail->appendItem(
"'boxes'");
246 myVehicleShapeDetail->appendItem(
"'simple shapes'");
247 myVehicleShapeDetail->setNumVisible(3);
248 myVehicleShapeDetail->setCurrentItem(settings->vehicleQuality);
250 new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
253 new FXMatrix(frame3, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
254 0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
255 new FXLabel(m32,
"Color by", 0, LAYOUT_CENTER_Y);
256 myVehicleColorMode =
new FXComboBox(m32, 20,
this,
MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
257 mySettings->vehicleColorer.fill(*myVehicleColorMode);
258 myVehicleColorMode->setNumVisible(10);
259 myVehicleColorInterpolation =
new FXCheckButton(m32,
"Interpolate",
this,
MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
261 FXScrollWindow* genScroll =
new FXScrollWindow(frame3, LAYOUT_FILL_X | LAYOUT_SIDE_TOP | FRAME_RAISED | FRAME_THICK | LAYOUT_FIX_HEIGHT, 0, 0, 0, 80);
262 myVehicleColorSettingFrame =
263 new FXVerticalFrame(genScroll, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2);
265 new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
268 new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
269 0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
271 myShowBlinker->setCheck(mySettings->showBlinker);
272 new FXLabel(m33,
" ", 0, LAYOUT_CENTER_Y);
274 myShowMinGap->setCheck(mySettings->drawMinGap);
275 new FXLabel(m33,
" ", 0, LAYOUT_CENTER_Y);
281 myVehicleNamePanel =
new NamePanel(m33,
this,
"Show vehicle name", mySettings->vehicleName);
289 new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
292 new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
293 0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
295 new FXMatrix(m34, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
296 0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
297 new FXLabel(m341,
"Minimum size", 0, LAYOUT_CENTER_Y);
298 myVehicleMinSizeDialer =
300 LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
301 myVehicleMinSizeDialer->setValue(mySettings->minVehicleSize);
303 new FXMatrix(m34, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
304 0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
305 new FXLabel(m342,
"Exaggerate by", 0, LAYOUT_CENTER_Y);
306 myVehicleUpscaleDialer =
308 LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
309 myVehicleUpscaleDialer->setRange(1, 100);
310 myVehicleUpscaleDialer->setValue(mySettings->vehicleExaggeration);
312 new FXTabItem(tabbook,
"Nodes", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
313 FXVerticalFrame* frame4 =
314 new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
317 new FXMatrix(frame4, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
318 0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
320 myShowTLIndex->setCheck(mySettings->drawLinkTLIndex);
321 new FXLabel(m33,
" ", 0, LAYOUT_CENTER_Y);
323 myShowJunctionIndex->setCheck(mySettings->drawLinkJunctionIndex);
324 new FXLabel(m33,
" ", 0, LAYOUT_CENTER_Y);
326 myShowLane2Lane->setCheck(mySettings->showLane2Lane);
327 new FXLabel(m33,
" ", 0, LAYOUT_CENTER_Y);
328 myJunctionNamePanel =
new NamePanel(m33,
this,
"Show junction name", mySettings->junctionName);
329 myInternalJunctionNamePanel =
new NamePanel(m33,
this,
"Show internal junction name", mySettings->internalJunctionName);
331 new FXTabItem(tabbook,
"Detectors/Trigger", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
332 FXVerticalFrame* frame5 =
333 new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
336 new FXMatrix(frame5, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
337 0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
338 myAddNamePanel =
new NamePanel(m51,
this,
"Show detector name", mySettings->addName);
339 new FXHorizontalSeparator(frame5 , SEPARATOR_GROOVE | LAYOUT_FILL_X);
342 new FXMatrix(frame5, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
343 0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
345 new FXMatrix(m52, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
346 0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
347 new FXLabel(m521,
"Minimum size", 0, LAYOUT_CENTER_Y);
348 myDetectorMinSizeDialer =
350 LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
352 new FXMatrix(m52, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
353 0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
354 myDetectorMinSizeDialer->setValue(mySettings->minAddSize);
355 new FXLabel(m522,
"Exaggerate by", 0, LAYOUT_CENTER_Y);
356 myDetectorUpscaleDialer =
358 LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
359 myDetectorUpscaleDialer->setRange(1, 100);
360 myDetectorUpscaleDialer->setValue(mySettings->addExaggeration);
371 new FXTabItem(tabbook,
"POIs", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
372 FXVerticalFrame* frame6 =
373 new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
376 new FXMatrix(frame6, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
377 0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
378 myPoiNamePanel =
new NamePanel(m61,
this,
"Show poi name", mySettings->poiName);
379 new FXHorizontalSeparator(frame6 , SEPARATOR_GROOVE | LAYOUT_FILL_X);
382 new FXMatrix(frame6, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
383 0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
385 new FXMatrix(m62, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
386 0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
387 new FXLabel(m621,
"Minimum size to show", 0, LAYOUT_CENTER_Y);
390 LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
392 new FXMatrix(m62, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
393 0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
394 myPOIMinSizeDialer->setValue(mySettings->minPOISize);
395 new FXLabel(m622,
"Exaggerate by", 0, LAYOUT_CENTER_Y);
398 LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
399 myPOIUpscaleDialer->setRange(1, 1000);
400 myPOIUpscaleDialer->setValue(mySettings->addExaggeration);
404 new FXTabItem(tabbook,
"Legend", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
405 FXVerticalFrame* frame7 =
406 new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
409 new FXMatrix(frame7, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
410 0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
412 myShowSizeLegend->setCheck(mySettings->showSizeLegend);
415 new FXTabItem(tabbook,
"openGL", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
416 FXVerticalFrame* frame8 =
417 new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
420 new FXMatrix(frame8, 1, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
421 0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
423 myAntialiase->setCheck(mySettings->antialiase);
425 myDither->setCheck(mySettings->dither);
428 FXButton* initial =
new FXButton(f2,
"&Use", NULL,
this,
MID_SETTINGS_OK, BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
429 new FXButton(f2,
"&Discard", NULL,
this,
MID_SETTINGS_CANCEL, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
432 rebuildColorMatrices(
false);
476 FXString dataS = (
char*) data;
479 for (
int i = 0; i <
mySchemeName->getNumItems() - 1; ++i) {
542 bool doRebuildColorMatrices =
false;
551 if (GUIVisualizationSettings::UseMesoSim) {
598 std::vector<FXColorWell*>::const_iterator colIt =
myLaneColors.begin();
599 std::vector<FXRealSpinDial*>::const_iterator threshIt =
myLaneThresholds.begin();
600 std::vector<FXButton*>::const_iterator buttonIt =
myLaneButtons.begin();
605 if (sender == *colIt) {
609 if (sender == *threshIt) {
610 const SUMOReal val = (*threshIt)->getValue();
614 (*threshIt)->getRange(lo, hi);
615 (*threshIt)->setRange(lo, val);
620 (*threshIt)->getRange(lo, hi);
621 (*threshIt)->setRange(val, hi);
626 if (sender == *colIt) {
630 if (sender == *buttonIt) {
632 scheme.
addColor(
convert((*colIt)->getRGBA()), (*threshIt)->getValue());
636 doRebuildColorMatrices =
true;
647 doRebuildColorMatrices =
true;
650 doRebuildColorMatrices =
true;
654 std::vector<FXColorWell*>::const_iterator colIt =
myVehicleColors.begin();
661 if (sender == *colIt) {
665 if (sender == *threshIt) {
666 const SUMOReal val = (*threshIt)->getValue();
670 (*threshIt)->getRange(lo, hi);
671 (*threshIt)->setRange(lo, val);
676 (*threshIt)->getRange(lo, hi);
677 (*threshIt)->setRange(val, hi);
682 if (sender == *colIt) {
686 if (sender == *buttonIt) {
688 scheme.
addColor(
convert((*colIt)->getRGBA()), (*threshIt)->getValue());
692 doRebuildColorMatrices =
true;
703 doRebuildColorMatrices =
true;
706 doRebuildColorMatrices =
true;
713 if (tmpSettings.
name[0] !=
'*') {
714 tmpSettings.
name =
'*' + tmpSettings.
name;
732 if (doRebuildColorMatrices) {
736 getApp()->forceRefresh();
745 if (settingsName !=
"") {
746 FXint index =
mySchemeName->appendItem(settingsName.c_str());
758 std::vector<GUISUMOAbstractView::Decal>::iterator j;
761 dev <<
" <decal filename=\"" << d.
filename
762 <<
"\" centerX=\"" << d.
centerX
763 <<
"\" centerY=\"" << d.
centerY
764 <<
"\" width=\"" << d.
width
765 <<
"\" height=\"" << d.
height
766 <<
"\" rotation=\"" << d.
rot
769 dev <<
"</decals>\n";
772 FXMessageBox::error(
myParent, MBOX_OK,
"Storing failed!",
"%s", e.what());
798 FXDialogBox dialog(
this,
"Enter a name", DECOR_TITLE | DECOR_BORDER);
799 FXVerticalFrame* content =
new FXVerticalFrame(&dialog, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10);
800 new FXLabel(content,
"Please enter an alphanumeric name: ", NULL, LAYOUT_FILL_X | JUSTIFY_LEFT);
801 FXTextField* text =
new FXTextField(content, 40, &dialog, FXDialogBox::ID_ACCEPT, TEXTFIELD_ENTER_ONLY | FRAME_SUNKEN | FRAME_THICK | LAYOUT_FILL_X);
802 new FXHorizontalSeparator(content, SEPARATOR_GROOVE | LAYOUT_FILL_X);
804 new FXButton(buttons,
"&OK", NULL, &dialog, FXDialogBox::ID_ACCEPT, BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_RIGHT);
805 new FXButton(buttons,
"&Cancel", NULL, &dialog, FXDialogBox::ID_CANCEL, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_RIGHT, 0, 0, 0, 0, 20, 20);
808 if (dialog.execute()) {
809 std::string name = text->getText().text();
810 bool isAlphaNum =
true;
811 for (
size_t i = 0; i < name.length(); ++i) {
812 if (name[i] ==
'_' || (name[i] >=
'a' && name[i] <=
'z') || (name[i] >=
'A' && name[i] <=
'Z') || (name[i] >=
'0' && name[i] <=
'9')) {
817 isAlphaNum = isAlphaNum & (name.length() > 0);
821 tmpSettings.
name = name;
844 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
869 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
877 FXFileDialog opendialog(
this,
"Export view settings");
879 opendialog.setSelectMode(SELECTFILE_ANY);
880 opendialog.setPatternList(
"*.xml");
892 FXMessageBox::error(
this, MBOX_OK,
"Storing failed!",
"%s", e.what());
902 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
910 FXFileDialog opendialog(
this,
"Import view settings");
912 opendialog.setSelectMode(SELECTFILE_ANY);
913 opendialog.setPatternList(
"*.xml");
917 if (opendialog.execute()) {
927 FXFileDialog opendialog(
this,
"Load Decals");
929 opendialog.setSelectMode(SELECTFILE_ANY);
930 opendialog.setPatternList(
"*.xml");
934 if (opendialog.execute()) {
944 FXFileDialog opendialog(
this,
"Save Decals");
946 opendialog.setSelectMode(SELECTFILE_ANY);
947 opendialog.setPatternList(
"*.xml");
963 sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
979 return FXRGB(c.
red() * 255., c.
green() * 255., c.
blue() * 255.);
995 header->setHeight(getApp()->getNormalFont()->getFontHeight() + getApp()->getNormalFont()->getFontAscent());
997 for (k = 0; k < 6; k++) {
998 header->setItemJustify(k, JUSTIFY_CENTER_X | JUSTIFY_TOP);
999 header->setItemSize(k, 60);
1001 header->setItemSize(0, 150);
1004 std::vector<GUISUMOAbstractView::Decal>::iterator j;
1016 for (k = 0; k < 6; k++) {
1027 LAYOUT_FILL_Y | LAYOUT_FIX_WIDTH, 0, 0, 470, 0);
1033 for (
int i = 1; i < 5; ++i) {
1047 LAYOUT_FILL_X | MATRIX_BY_COLUMNS,
1048 0, 0, 0, 0, 10, 10, 0, 0, 5, 3);
1053 const bool fixed = scheme.
isFixed();
1054 const std::vector<RGBColor> &colors = scheme.
getColors();
1055 std::vector<RGBColor>::const_iterator colIt = colors.begin();
1056 std::vector<SUMOReal>::const_iterator threshIt = scheme.
getThresholds().begin();
1057 std::vector<std::string>::const_iterator nameIt = scheme.
getNames().begin();
1058 FX::FXString buttonText =
"Add";
1059 while (colIt != colors.end()) {
1062 LAYOUT_FIX_WIDTH | LAYOUT_CENTER_Y | FRAME_SUNKEN | FRAME_THICK | ICON_AFTER_TEXT,
1063 0, 0, 100, 0, 0, 0, 0, 0));
1065 new FXLabel(m, nameIt->c_str());
1070 threshDialer->setValue(*threshIt);
1072 myLaneButtons.push_back(
new FXButton(m, buttonText, NULL,
this,
MID_SIMPLE_VIEW_COLORCHANGE, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 20, 20, 4, 4));
1073 buttonText =
"Remove";
1083 if (colors.size() > 1) {
1104 LAYOUT_FILL_X | MATRIX_BY_COLUMNS,
1105 0, 0, 0, 0, 10, 10, 0, 0, 5, 3);
1111 std::vector<RGBColor>::const_iterator colIt = colors.begin();
1114 FX::FXString buttonText =
"Add";
1115 while (colIt != colors.end()) {
1118 LAYOUT_FIX_WIDTH | LAYOUT_CENTER_Y | FRAME_SUNKEN | FRAME_THICK | ICON_AFTER_TEXT,
1119 0, 0, 100, 0, 0, 0, 0, 0));
1121 new FXLabel(m, nameIt->c_str());
1124 FXRealSpinDial* threshDialer =
1126 LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK |
SPINDIAL_NOMAX);
1127 threshDialer->setValue(*threshIt);
1129 myVehicleButtons.push_back(
new FXButton(m, buttonText, NULL,
this,
MID_SIMPLE_VIEW_COLORCHANGE, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 20, 20, 4, 4));
1130 buttonText =
"Remove";
1140 if (colors.size() > 1) {
1165 std::string value = i->
item->getText().text();
1167 if (value.find_first_not_of(
" ") == std::string::npos) {
1173 if (row == static_cast<int>(
myDecals->size())) {
1184 }
else if (row > static_cast<int>(
myDecals->size())) {
1188 d = (*myDecals)[row];
1202 std::string msg =
"The value must be a float, is:" + value;
1203 FXMessageBox::error(
this, MBOX_OK,
"Number format error",
"%s", msg.c_str());
1210 std::string msg =
"The value must be a float, is:" + value;
1211 FXMessageBox::error(
this, MBOX_OK,
"Number format error",
"%s", msg.c_str());
1218 std::string msg =
"The value must be a float, is:" + value;
1219 FXMessageBox::error(
this, MBOX_OK,
"Number format error",
"%s", msg.c_str());
1226 std::string msg =
"The value must be a float, is:" + value;
1227 FXMessageBox::error(
this, MBOX_OK,
"Number format error",
"%s", msg.c_str());
1234 std::string msg =
"The value must be a float, is:" + value;
1235 FXMessageBox::error(
this, MBOX_OK,
"Number format error",
"%s", msg.c_str());
1241 (*myDecals)[row] = d;
1261 for (
int i = 0; i <
mySchemeName->getNumItems(); ++i) {
1273 const std::string& title,
1278 FXMatrix* m1 =
new FXMatrix(parent, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
1279 0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
1280 new FXLabel(m1,
"Size", 0, LAYOUT_CENTER_Y);
1281 mySizeDial =
new FXRealSpinDial(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE,
1282 LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
1285 FXMatrix* m2 =
new FXMatrix(parent, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
1286 0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
1287 FXLabel(m2,
"Color", 0, LAYOUT_CENTER_Y);
1289 target, MID_SIMPLE_VIEW_COLORCHANGE,
1290 LAYOUT_FIX_WIDTH | LAYOUT_CENTER_Y | LAYOUT_SIDE_TOP | FRAME_SUNKEN | FRAME_THICK | ICON_AFTER_TEXT,
1291 0, 0, 100, 0, 0, 0, 0, 0);
1297 mySizeDial->getValue(),
convert(myColorWell->getRGBA()));
1303 myCheck->setCheck(settings.
show);
1304 mySizeDial->setValue(settings.
size);