38#define BLACK_COLOR MFXUtils::getFXColor(RGBColor::BLACK)
39#define BLUE_COLOR MFXUtils::getFXColor(RGBColor::BLUE)
40#define RED_COLOR MFXUtils::getFXColor(RGBColor::RED)
59 GNEDialog(distributionParent->getNet()->getViewNet()->getViewParent()->getGNEAppWindows(),
60 TLF(
"Add % reference", distributionParent->getTagStr()), distributionParent->getTagProperty()->getGUIIcon(),
63 auto tooltipMenu = distributionParent->getNet()->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
75 std::set<std::string> referenceIDs;
76 for (
const auto& reference : distributionParent->getHierarchicalElement()->getChildDemandElements()) {
77 if (reference->getTagProperty()->isDistributionReference()) {
78 referenceIDs.insert(reference->getParentDemandElements().at(1)->getID());
84 const auto& vTypes = distributionParent->getNet()->getAttributeCarriers()->getDemandElements().at(
SUMO_TAG_VTYPE);
86 for (
const auto& vType : vTypes) {
87 if (referenceIDs.count(vType.second->getID()) == 0) {
97 const auto& routes = distributionParent->getNet()->getAttributeCarriers()->getDemandElements().at(
SUMO_TAG_ROUTE);
99 for (
const auto& route : routes) {
100 if (referenceIDs.count(route.second->getID()) == 0) {
149 if (
myDistributionParent->getNet()->getViewNet()->getViewParent()->getGNEAppWindows()->isUndoRedoAllowed()) {
157 reference->
incRef(
"GNEDistributionRefDialog");
172 reference = candidate.second;
177 if (reference ==
nullptr) {
FXDEFMAP(GNEDistributionRefDialog) GNEDistributionRefDialogMap[]
@ MID_GNE_DISTRIBUTIONDIALOG_REFERENCE
change reference
@ MID_GNE_DISTRIBUTIONDIALOG_PROBABILITY
change probability
#define GUIDesignComboBox
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignComboBoxVisibleItems
#define GUIDesignTextFieldRestricted(type)
text field extended over Frame with thick frame (int)
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_ROUTE_DISTRIBUTION
distribution of a route
@ SUMO_TAG_ROUTE
description of a route
@ SUMO_TAG_VTYPE_DISTRIBUTION
distribution of a vehicle type
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const std::string getID() const override
get ID (all Attribute Carriers have one)
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
FXVerticalFrame * myContentFrame
content frame
void openDialog(FXWindow *focusableElement=nullptr)
open dialog
FXButton * myAcceptButton
accept button
long closeDialogAccepting()
close dialog accepting the changes
OpenType
Open dialog type.
GNEDialog(GNEApplicationWindow *applicationWindow, const std::string &name, GUIIcon titleIcon, DialogType type, Buttons buttons, OpenType openType, ResizeMode resizeMode)
basic constructor
long closeDialogCanceling()
close dialog declining the changes
long onCmdSetReference(FXObject *, FXSelector, void *)
event after choose a reference in the comboBox
long onCmdSetProbability(FXObject *, FXSelector, void *)
event after choose a reference in the probability
void runInternalTest(const InternalTestStep::DialogArgument *dialogArgument)
run internal test
MFXTextFieldIcon * myProbabilityTextField
textField probability
std::map< std::string, GNEDemandElement * > myCandidates
map with candidate IDs;
MFXComboBoxIcon * myReferencesComboBox
comboBox for references
GNEAttributeCarrier * myDistributionParent
FOX needs this.
GNEDistributionRefDialog(GNEAttributeCarrier *distributionParent)
constructor
~GNEDistributionRefDialog()
destructor
long onCmdAccept(FXObject *, FXSelector, void *)
event after press accept button
GNEDemandElement * myReferencedElement
current referenced element
void addChildElement(ChildType *element)
add child without updating parent (ONLY used if we're creating elements without undo-redo)
void incRef(const std::string &debugMsg="")
Increase reference.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
dialog arguments, used for certain modal dialogs that can not be edited using tab