SUMO - Simulation of Urban MObility
GNEAdditionalDialog.cpp
Go to the documentation of this file.
1 /****************************************************************************/
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software; you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation; either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #ifdef _MSC_VER
25 #include <windows_config.h>
26 #else
27 #include <config.h>
28 #endif
29 
30 #include <iostream>
34 
35 #include "GNEAdditionalDialog.h"
36 #include "GNEAdditional.h"
37 #include "GNEViewNet.h"
38 
39 #ifdef CHECK_MEMORY_LEAKS
40 #include <foreign/nvwa/debug_new.h>
41 #endif
42 
43 
44 // ===========================================================================
45 // FOX callback mapping
46 // ===========================================================================
47 
48 FXDEFMAP(GNEAdditionalDialog) GNEAdditionalDialogMap[] = {
52 };
53 
54 // Object abstract implementation
55 FXIMPLEMENT_ABSTRACT(GNEAdditionalDialog, FXDialogBox, GNEAdditionalDialogMap, ARRAYNUMBER(GNEAdditionalDialogMap))
56 
57 // ===========================================================================
58 // member method definitions
59 // ===========================================================================
60 
61 GNEAdditionalDialog::GNEAdditionalDialog(GNEAdditional* parent, int width, int height) :
62  FXDialogBox(parent->getViewNet(), ("Edit '" + parent->getID() + "' data").c_str(), GUIDesignDialogBoxExplicit, 0, 0, width, height, 0, 0, 0, 0) {
63  // check that parent isn't NULL
64  assert(parent != NULL);
65  // set icon
66  setIcon(parent->getIcon());
67  // create main frame
68  FXVerticalFrame* mainFrame = new FXVerticalFrame(this, GUIDesignAuxiliarFrame);
69  // Create frame for contents
70  myContentFrame = new FXVerticalFrame(mainFrame, GUIDesignContentsFrame);
71  // create buttons centered
72  FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(mainFrame, GUIDesignHorizontalFrameButton);
73  new FXHorizontalFrame(buttonsFrame, GUIDesignHorizontalFrameButton);
74  myAcceptButton = new FXButton(buttonsFrame, "accept\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), this, MID_GNE_MODE_ADDITIONALDIALOG_ACCEPT, GUIDesignButtonAccept);
75  myCancelButton = new FXButton(buttonsFrame, "cancel\t\tclose", GUIIconSubSys::getIcon(ICON_CANCEL), this, MID_GNE_MODE_ADDITIONALDIALOG_CANCEL, GUIDesignButtonCancel);
76  myResetButton = new FXButton(buttonsFrame, "reset\t\tclose", GUIIconSubSys::getIcon(ICON_RESET), this, MID_GNE_MODE_ADDITIONALDIALOG_RESET, GUIDesignButtonReset);
77  new FXHorizontalFrame(buttonsFrame, GUIDesignHorizontalFrameButton);
78 }
79 
80 
82 
83 
84 void
86  // change FXDialogBox title
87  setTitle(newHeader.c_str());
88 }
89 
90 /****************************************************************************/
virtual long onCmdReset(FXObject *, FXSelector, void *)=0
event after press cancel button
#define GUIDesignHorizontalFrameButton
Horizontal frame used in Button Frames.
Definition: GUIDesigns.h:192
~GNEAdditionalDialog()
destructor
#define GUIDesignContentsFrame
design for the main content frame of every frame/dialog
Definition: GUIDesigns.h:235
Dialog to edit sequences, parameters, etc.. of Additionals.
#define GUIDesignButtonCancel
Cancel Button.
Definition: GUIDesigns.h:107
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions ...
Definition: GUIDesigns.h:223
FXDEFMAP(GNEAdditionalDialog) GNEAdditionalDialogMap[]
#define GUIDesignDialogBoxExplicit
design for dialog box with specift width and height (for example, additional dialogs) ...
Definition: GUIDesigns.h:410
virtual long onCmdCancel(FXObject *sender, FXSelector sel, void *ptr)=0
event after press cancel button
#define GUIDesignButtonReset
Reset Button.
Definition: GUIDesigns.h:110
virtual long onCmdAccept(FXObject *sender, FXSelector sel, void *ptr)=0
#define GUIDesignButtonAccept
Accept Button.
Definition: GUIDesigns.h:104
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:62
void changeAdditionalDialogHeader(const std::string &newHeader)
change additional dialog header
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon