Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEDistributionFrame.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// The Widget for edit distribution elements
19/****************************************************************************/
20
21#include <netedit/GNENet.h>
22#include <netedit/GNEUndoList.h>
23#include <netedit/GNEViewNet.h>
30
32
33
34// ===========================================================================
35// FOX callback mapping
36// ===========================================================================
37
43
48
49
55
60
61// Object implementation
62FXIMPLEMENT(GNEDistributionFrame::DistributionEditor, MFXGroupBoxModule, DistributionEditorMap, ARRAYNUMBER(DistributionEditorMap))
63FXIMPLEMENT(GNEDistributionFrame::DistributionSelector, MFXGroupBoxModule, DistributionSelectorMap, ARRAYNUMBER(DistributionSelectorMap))
64FXIMPLEMENT(GNEDistributionFrame::DistributionRow, FXHorizontalFrame, DistributionRowMap, ARRAYNUMBER(DistributionRowMap))
65FXIMPLEMENT(GNEDistributionFrame::DistributionValuesEditor, MFXGroupBoxModule, DistributionValuesEditorMap, ARRAYNUMBER(DistributionValuesEditorMap))
66
67
68// ===========================================================================
69// method definitions
70// ===========================================================================
71
72// ---------------------------------------------------------------------------
73// GNEDistributionFrame::DistributionEditor - methods
74// ---------------------------------------------------------------------------
75
77 MFXGroupBoxModule(frameParent, TL("Distribution Editor")),
78 myFrameParent(frameParent),
79 myDistributionTag(distributionTag) {
80 // get staticTooltip menu
81 auto staticTooltipMenu = myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
82 // Create new distribution
83 myCreateDistributionButton = new MFXButtonTooltip(getCollapsableFrame(), staticTooltipMenu, TL("New"),
85 myCreateDistributionButton->setTipText(TLF("Create new %", toString(myDistributionTag)).c_str()),
86 // Delete distribution
87 myDeleteDistributionButton = new MFXButtonTooltip(getCollapsableFrame(), staticTooltipMenu, TL("Delete"),
89 myDeleteDistributionButton->setTipText(TLF("Delete current edited %", toString(myDistributionTag)).c_str()),
90 // show editor
91 show();
92}
93
94
96
97
100 return myDistributionTag;
101}
102
103
104long
106 auto undoList = myFrameParent->getViewNet()->getUndoList();
107 // obtain a new valid ID
108 const auto distributionID = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->generateDemandElementID(myDistributionTag);
109 // create new distribution
110 GNEDemandElement* distribution = nullptr;
111 if (myDistributionTag == SUMO_TAG_VTYPE_DISTRIBUTION) {
112 distribution = new GNEVTypeDistribution(myFrameParent->getViewNet()->getNet(), distributionID, -1);
113 } else if (myDistributionTag == SUMO_TAG_ROUTE_DISTRIBUTION) {
114 distribution = new GNERouteDistribution(myFrameParent->getViewNet()->getNet(), distributionID);
115 } else {
116 throw ProcessError("Invalid distribution");
117 }
118 // add it using undoList (to allow undo-redo)
119 undoList->begin(distribution->getTagProperty().getGUIIcon(), "create distribution");
120 undoList->add(new GNEChange_DemandElement(distribution, true), true);
121 undoList->end();
122 // refresh selector using created distribution
123 myDistributionSelector->setDistribution(distribution);
124 return 1;
125}
126
127
128long
130 auto undoList = myFrameParent->getViewNet()->getUndoList();
131 auto currentDistribution = myDistributionSelector->getCurrentDistribution();
132 if (currentDistribution) {
133 // begin undo list operation
134 undoList->begin(currentDistribution->getTagProperty().getGUIIcon(), "delete " + currentDistribution->getTagProperty().getTagStr() + " distribution");
135 // remove distribution
136 myFrameParent->getViewNet()->getNet()->deleteDemandElement(myDistributionSelector->getCurrentDistribution(), undoList);
137 // end undo list operation
138 undoList->end();
139 // refresh selector
140 myDistributionSelector->refreshDistributionSelector();
141 }
142 return 1;
143}
144
145
146long
148 // check if we have a selected distribution
149 if (myDistributionSelector->getCurrentDistribution()) {
150 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
151 } else {
152 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
153 }
154}
155
156// ---------------------------------------------------------------------------
157// GNETypeFrame::DistributionSelector - methods
158// ---------------------------------------------------------------------------
159
161 MFXGroupBoxModule(frameParent, TL("Distribution selector")),
162 myFrameParent(frameParent) {
163 // Create MFXComboBoxIcon
166 // DistributionSelector is always shown
167 show();
168}
169
170
172
173
174void
176 myCurrentDistribution = distribution;
177 refreshDistributionSelector();
178}
179
180
183 return myCurrentDistribution;
184
185}
186
187
188void
190 // fill distributions
191 fillDistributionComboBox();
192 // set current item
193 for (int i = 0; i < (int)myDistributionsComboBox->getNumItems(); i++) {
194 if (myDistributionsComboBox->getItemText(i) == myCurrentDistribution->getID()) {
195 myDistributionsComboBox->setCurrentItem(i);
196 }
197 }
198}
199
200
201void
203 // fill distributions
204 const auto distributions = fillDistributionComboBox();
205 // update current distribution (used if myCurrentDistribution was deleted during undo-redo)
206 myCurrentDistribution = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(myCurrentDistribution, false);
207 // update comboBox
208 if (myCurrentDistribution) {
209 for (int i = 0; i < (int)myDistributionsComboBox->getNumItems(); i++) {
210 if (myDistributionsComboBox->getItemText(i) == myCurrentDistribution->getID()) {
211 myDistributionsComboBox->setCurrentItem(i);
212 }
213 }
214 } else if (distributions.size() > 0) {
215 // set first distribution
216 myCurrentDistribution = distributions.begin()->second;
217 }
218 // continue depending of myCurrentDistribution
219 if (myCurrentDistribution) {
220 // show modules
221 myAttributesEditor->showAttributesEditor(myCurrentDistribution);
222 myDistributionValuesEditor->showDistributionValuesEditor();
223 } else {
224 // hide modules
225 myAttributesEditor->hideAttributesEditor();
226 myDistributionValuesEditor->hideDistributionValuesEditor();
227 }
228}
229
230
231long
233 const auto viewNet = myFrameParent->getViewNet();
234 const auto& distributions = viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(myDistributionEditor->getDistributionTag());
235 // Check if value of myTypeMatchBox correspond of an allowed additional tags
236 for (const auto& distribution : distributions) {
237 if (distribution.second->getID() == myDistributionsComboBox->getText().text()) {
238 // set pointer
239 myCurrentDistribution = distribution.second;
240 // set color of myTypeMatchBox to black (valid)
241 myDistributionsComboBox->setTextColor(FXRGB(0, 0, 0));
242 // show modules
243 myAttributesEditor->showAttributesEditor(distribution.second);
244 myDistributionValuesEditor->showDistributionValuesEditor();
245 // Write Warning in console if we're in testing mode
246 WRITE_DEBUG(("Selected item '" + myDistributionsComboBox->getText() + "' in DistributionSelector").text());
247 // update viewNet
248 viewNet->updateViewNet();
249 return 1;
250 }
251 }
252 // not found, then reset myCurrentDistribution
253 myCurrentDistribution = nullptr;
254 // hide modules
255 myAttributesEditor->hideAttributesEditor();
256 myDistributionValuesEditor->hideDistributionValuesEditor();
257 // set color of myTypeMatchBox to red (invalid)
258 myDistributionsComboBox->setTextColor(FXRGB(255, 0, 0));
259 // Write Warning in console if we're in testing mode
260 WRITE_DEBUG("Selected invalid item in DistributionSelector");
261 // update viewNet
262 viewNet->updateViewNet();
263 return 1;
264}
265
266
267long
269 const auto& demandElements = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements();
270 if (demandElements.at(myDistributionEditor->getDistributionTag()).size() > 0) {
271 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
272 } else {
273 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
274 }
275}
276
277
278std::map<std::string, GNEDemandElement*>
280 // get ACs
281 const auto& ACs = myFrameParent->getViewNet()->getNet()->getAttributeCarriers();
282 // clear items
283 myDistributionsComboBox->clearItems();
284 // fill with distributions sorted by ID
285 std::map<std::string, GNEDemandElement*> distributions;
286 for (const auto& distribution : ACs->getDemandElements().at(myDistributionEditor->getDistributionTag())) {
287 distributions[distribution.second->getID()] = distribution.second;
288 }
289 for (const auto& distribution : distributions) {
290 myDistributionsComboBox->appendIconItem(distribution.first.c_str(), distribution.second->getACIcon());
291 }
292 // return distributions sorted by ID
293 return distributions;
294}
295
296// ---------------------------------------------------------------------------
297// GNEDistributionFrame::DistributionRow - methods
298// ---------------------------------------------------------------------------
299
300GNEDistributionFrame::DistributionRow::DistributionRow(DistributionValuesEditor* attributeEditorParent, const GNEDemandElement* key, const double probability) :
301 FXHorizontalFrame(attributeEditorParent->getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame),
302 myDistributionValuesEditorParent(attributeEditorParent),
303 myKey(key),
304 myProbability(probability) {
305 // get staticTooltip menu
306 auto staticTooltipMenu = attributeEditorParent->getFrameParent()->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
307 // create label
308 myIconLabel = new FXLabel(this, "", key->getACIcon(), GUIDesignLabelIconThick);
309 // Create and hide MFXTextFieldTooltip for string attributes
312 // Create and hide MFXTextFieldTooltip for string attributes
313 myProbabilityTextField = new MFXTextFieldTooltip(this, staticTooltipMenu,
315 // create delete buton
316 myDeleteRowButton = new MFXButtonTooltip(this, staticTooltipMenu,
318 myDeleteRowButton->setTipText(TL("Delete distribution value"));
319 // only create if parent was created
320 if (getParent()->id() && attributeEditorParent->myDistributionSelector->getCurrentDistribution()) {
321 // create DistributionRow
322 FXHorizontalFrame::create();
323 // refresh row
324 refreshRow();
325 // Show DistributionRow
326 show();
327 }
328}
329
330
331void
333 // only destroy if parent was created
334 if (getParent()->id()) {
335 FXHorizontalFrame::destroy();
336 }
337}
338
339
340void
342 // get distribution selector
343 const auto currentDistribution = myDistributionValuesEditorParent->myDistributionSelector->getCurrentDistribution();
344 // get possible keys
345 const auto possibleKeys = currentDistribution->getPossibleDistributionKeys(myDistributionValuesEditorParent->myDistributionValueTag);
346 // refill combo Box with possible values
347 myComboBoxKeys->clearItems();
348 myComboBoxKeys->appendIconItem(myKey->getID().c_str());
349 for (const auto& possibleKey : possibleKeys) {
350 myComboBoxKeys->appendIconItem(possibleKey.first.c_str());
351 }
352 myComboBoxKeys->setCurrentItem(0);
353 // adjust combo Box
354 myComboBoxKeys->setTextColor(FXRGB(0, 0, 0));
355 myComboBoxKeys->killFocus();
356 // set probability
357 myProbabilityTextField->setText(toString(myProbability).c_str());
358 myProbabilityTextField->setTextColor(FXRGB(0, 0, 0));
359 myProbabilityTextField->killFocus();
360}
361
362
363double
365 return myProbability;
366}
367
368
369long
371 // get Undo list
372 GNEUndoList* undoList = myDistributionValuesEditorParent->getFrameParent()->getViewNet()->getUndoList();
373 // get current distribution
374 auto currentDistribution = myDistributionValuesEditorParent->myDistributionSelector->getCurrentDistribution();
375 // get ACs
376 const auto& ACs = myDistributionValuesEditorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers();
377 // continue if we have a distribution to edit
378 if (currentDistribution == nullptr) {
379 return 1;
380 }
381 // check if new key is valid
382 if (isValidNewKey()) {
383 myComboBoxKeys->setTextColor(FXRGB(0, 0, 0));
384 // get new key
385 const auto newKey = ACs->retrieveDemandElement(myDistributionValuesEditorParent->myDistributionValueTag, myComboBoxKeys->getText().text());
386 // only change if is different of current key
387 if (myKey != newKey) {
388 // begin undo list
389 undoList->begin(myKey, "edit distribution key");
390 // remove distribution key
391 currentDistribution->removeDistributionKey(myKey, undoList);
392 // sert key and icon
393 myKey = ACs->retrieveDemandElement(myDistributionValuesEditorParent->myDistributionValueTag, myComboBoxKeys->getText().text());
394 myIconLabel->setIcon(myKey->getACIcon());
395 // add distribution key (and probability)
396 currentDistribution->addDistributionKey(myKey, myProbability, undoList);
397 // end undo list
398 undoList->end();
399 // refresh all rows
400 myDistributionValuesEditorParent->refreshRows();
401 }
402 } else {
403 myComboBoxKeys->setTextColor(FXRGB(255, 0, 0));
404 myComboBoxKeys->killFocus();
405 }
406 return 1;
407}
408
409
410long
412 // get current distribution
413 auto currentDistribution = myDistributionValuesEditorParent->myDistributionSelector->getCurrentDistribution();
414 // continue if we have a distribution to edit
415 if (currentDistribution == nullptr) {
416 return 1;
417 }
418 // get probability
419 const std::string probabilityStr = myProbabilityTextField->getText().text();
420 const double probability = GNEAttributeCarrier::canParse<double>(probabilityStr) ? GNEAttributeCarrier::parse<double>(probabilityStr) : -1;
421 // Check if set new probability
422 if (probability >= 0) {
423 // set new probability
424 myProbability = probability;
425 // edit distribution value
426 currentDistribution->editDistributionValue(myKey, probability, myDistributionValuesEditorParent->getFrameParent()->getViewNet()->getUndoList());
427 // reset color
428 myProbabilityTextField->setTextColor(FXRGB(0, 0, 0));
429 // update sum label
430 myDistributionValuesEditorParent->updateSumLabel();
431 } else {
432 myProbabilityTextField->setTextColor(FXRGB(255, 0, 0));
433 myProbabilityTextField->killFocus();
434 }
435 return 1;
436}
437
438
439long
441 // get current distribution
442 auto currentDistribution = myDistributionValuesEditorParent->myDistributionSelector->getCurrentDistribution();
443 // continue if we have a distribution to edit
444 if (currentDistribution == nullptr) {
445 return 1;
446 }
447 // remove distribution key
448 currentDistribution->removeDistributionKey(myKey, myDistributionValuesEditorParent->getFrameParent()->getViewNet()->getUndoList());
449 // remake rows
450 myDistributionValuesEditorParent->remakeRows();
451 return 1;
452}
453
454
455bool
457 const auto ACs = myDistributionValuesEditorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers();
458 // get element associated with key
459 const auto element = ACs->retrieveDemandElement(myDistributionValuesEditorParent->myDistributionValueTag, myComboBoxKeys->getText().text(), false);
460 // first check if element exists
461 if (element) {
462 // avoid duplicated keys
463 return !myKey->keyExists(element);
464 } else {
465 return false;
466 }
467}
468
469// ---------------------------------------------------------------------------
470// GNEDistributionFrame::DistributionValuesEditor - methods
471// ---------------------------------------------------------------------------
472
474 DistributionSelector* distributionSelector, GNEAttributesEditor* attributesEditor, SumoXMLTag distributionValueTag) :
475 MFXGroupBoxModule(frameParent, TL("Distribution values")),
476 myFrameParent(frameParent),
477 myDistributionEditor(distributionEditor),
478 myDistributionSelector(distributionSelector),
479 myAttributesEditor(attributesEditor),
480 myDistributionValueTag(distributionValueTag) {
481 // set relations
486 // get staticTooltip menu
487 auto staticTooltipMenu = frameParent->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
488 // Create bot frame elements
490 auto addButton = new MFXButtonTooltip(myBotFrame, staticTooltipMenu, "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_BUTTON_ADD, GUIDesignButtonIcon);
491 addButton->setTipText(TL("Add new distribution value"));
492 new FXHorizontalFrame(myBotFrame, GUIDesignAuxiliarHorizontalFrame);
494 mySumLabel = new FXLabel(myBotFrame, "", nullptr, GUIDesignLabelThickedFixed(50));
496}
497
498
499void
501 // remake rows
502 remakeRows();
503 // show DistributionValuesEditor
504 show();
505}
506
507
508void
510 // hide also DistributionValuesEditor
511 hide();
512}
513
514
515void
517 // first remove all rows
518 for (auto& row : myDistributionRows) {
519 // destroy and delete all rows
520 if (row != nullptr) {
521 row->destroy();
522 delete row;
523 row = nullptr;
524 }
525 }
526 myDistributionRows.clear();
527 // continue if we have a distribution to edit
528 if (myDistributionSelector->getCurrentDistribution()) {
529 // Iterate over distribution key-values
530 for (const auto& keyValue : myDistributionSelector->getCurrentDistribution()->getDistributionKeyValues()) {
531 // create distribution row
532 auto distributionRow = new DistributionRow(this, keyValue.first, keyValue.second);
533 // add into distribution rows
534 myDistributionRows.push_back(distributionRow);
535 }
536 }
537 // reparent bot frame button (to place it at bottom)
538 myBotFrame->reparent(getCollapsableFrame());
539}
540
541
542void
544 // refresh rows
545 for (const auto& row : myDistributionRows) {
546 row->refreshRow();
547 }
548}
549
550
555
556
557void
559 // update probability
560 double sumProbability = 0;
561 for (const auto& row : myDistributionRows) {
562 sumProbability += row->getProbability();
563 }
564 mySumLabel->setText(toString(sumProbability).c_str());
565}
566
567
568long
570 if (myDistributionSelector->getCurrentDistribution() == nullptr) {
571 return 1;
572 }
573 // get next free key
574 const auto possibleKeys = myDistributionSelector->getCurrentDistribution()->getPossibleDistributionKeys(myDistributionValueTag);
575 if (possibleKeys.empty()) {
576 return 1;
577 }
578 // add first possible key
579 myDistributionSelector->getCurrentDistribution()->addDistributionKey(possibleKeys.begin()->second, 0.5, myFrameParent->getViewNet()->getUndoList());
580 // remake rows
581 remakeRows();
582 return 1;
583}
584
585
586long
588 if (myDistributionSelector->getCurrentDistribution() == nullptr) {
589 mySumLabel->setText("");
590 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
591 } else {
592 // update sum label
593 updateSumLabel();
594 // enable or disable add button depending of existents distributions
595 if (myDistributionSelector->getCurrentDistribution()->getPossibleDistributionKeys(myDistributionValueTag).size() > 0) {
596 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
597 } else {
598 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
599 }
600 }
601}
602
603/****************************************************************************/
FXDEFMAP(GNEDistributionFrame::DistributionEditor) DistributionEditorMap[]
@ MID_GNE_DELETE
delete element
Definition GUIAppEnum.h:943
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition GUIAppEnum.h:939
@ MID_GNE_BUTTON_REMOVE
remove button
@ MID_GNE_BUTTON_ADD
add button
@ MID_GNE_CREATE
create element
Definition GUIAppEnum.h:941
@ MID_GNE_SET_TYPE
used to select a type of element in a combo box
Definition GUIAppEnum.h:959
#define GUIDesignLabelFixed(width)
label, icon before text, text centered and custom width
Definition GUIDesigns.h:246
#define GUIDesignButtonIcon
button only with icon
Definition GUIDesigns.h:91
#define GUIDesignButton
Definition GUIDesigns.h:82
#define GUIDesignComboBox
Definition GUIDesigns.h:293
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition GUIDesigns.h:311
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:399
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:74
#define GUIDesignComboBoxVisibleItems
Definition GUIDesigns.h:49
#define GUIDesignTextFieldFixedRestricted(width, type)
text field with fixed width
Definition GUIDesigns.h:68
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
Definition GUIDesigns.h:252
#define GUIDesignLabelIconThick
label squared over frame with thick and with text justify to center
Definition GUIDesigns.h:255
GUIIcon
An enumeration of icons used by the gui applications.
Definition GUIIcons.h:33
#define WRITE_DEBUG(msg)
Definition MsgHandler.h:306
#define TL(string)
Definition MsgHandler.h:315
#define TLF(string,...)
Definition MsgHandler.h:317
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_ROUTE_DISTRIBUTION
distribution of a route
@ SUMO_TAG_VTYPE_DISTRIBUTION
distribution of a vehicle type
int GUIDesignHeight
the default size for GUI elements
Definition StdDefs.cpp:35
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
long onCmdDeleteDistribution(FXObject *, FXSelector, void *)
Called when "Delete distribution" button is clicked.
SumoXMLTag getDistributionTag() const
get distribution tag
long onUpdDeleteDistribution(FXObject *sender, FXSelector, void *)
Called when "Delete distribution" button is updated.
long onCmdCreateDistribution(FXObject *, FXSelector, void *)
Called when "create distribution" button is clicked.
DistributionSelector * myDistributionSelector
distribution selector
void destroy()
destroy DistributionRow (but don't delete)
long onCmdSetProbability(FXObject *, FXSelector, void *)
try to set new probability
MFXComboBoxIcon * myComboBoxKeys
comboBox with keys
long onCmdRemoveRow(FXObject *, FXSelector, void *)
remove row
long onCmdSetKey(FXObject *, FXSelector, void *)
try to set new key
DistributionRow(DistributionValuesEditor *attributeEditorParent, const GNEDemandElement *key, const double probability)
FOX-declaration.
double getProbability() const
get current probability
MFXTextFieldTooltip * myProbabilityTextField
textField to modify the probability attribute
MFXButtonTooltip * myDeleteRowButton
delete row button
GNEDemandElement * getCurrentDistribution() const
current distribution
DistributionValuesEditor * myDistributionValuesEditor
distribution values editor
std::map< std::string, GNEDemandElement * > fillDistributionComboBox()
FOX need this.
long onCmdSelectDistribution(FXObject *, FXSelector, void *)
Called when the user select distribution in ComboBox.
void refreshDistributionIDs()
refresh distribution IDs (only call when user change ID in internal attributes)
MFXComboBoxIcon * myDistributionsComboBox
comboBox with the list of distributions
DistributionEditor * myDistributionEditor
pointer to distribution editor
GNEAttributesEditor * myAttributesEditor
attributes editor
long onCmdUpdateDistribution(FXObject *sender, FXSelector, void *)
update distribution comboBox
void setDistribution(GNEDemandElement *distribution)
refresh modul
DistributionSelector(GNEFrame *frameParent)
constructor
long onUpdAddRow(FXObject *sender, FXSelector, void *)
Called when sum button button is updated.
GNEAttributesEditor * myAttributesEditor
attributes editor
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
DistributionEditor * myDistributionEditor
distribution editor
long onCmdAddRow(FXObject *, FXSelector, void *)
Called when user press the add button.
DistributionSelector * myDistributionSelector
distribution selector
DistributionValuesEditor(GNEFrame *frameParent, DistributionEditor *distributionEditor, DistributionSelector *distributionSelector, GNEAttributesEditor *attributesEditor, SumoXMLTag distributionValueTag)
constructor
void showDistributionValuesEditor()
show attributes of multiple ACs
GNEViewNet * getViewNet() const
get view net
Definition GNEFrame.cpp:150
GUIIcon getGUIIcon() const
get GUI icon associated to this Tag
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
GNEViewParent * getViewParent() const
get the net object
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXStaticToolTip * getStaticTooltipMenu() const
get static toolTip for menus
ComboBox with icon.
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)