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 
40 // ===========================================================================
41 // FOX callback mapping
42 // ===========================================================================
43 
44 FXDEFMAP(GNEAdditionalDialog) GNEAdditionalDialogMap[] = {
48 };
49 
50 // Object abstract implementation
51 FXIMPLEMENT_ABSTRACT(GNEAdditionalDialog, FXDialogBox, GNEAdditionalDialogMap, ARRAYNUMBER(GNEAdditionalDialogMap))
52 
53 // ===========================================================================
54 // member method definitions
55 // ===========================================================================
56 
57 GNEAdditionalDialog::GNEAdditionalDialog(GNEAdditional* parent, int width, int height) :
58  FXDialogBox(parent->getViewNet(), ("Edit '" + parent->getID() + "' data").c_str(), GUIDesignDialogBoxExplicit, 0, 0, width, height, 0, 0, 0, 0) {
59  // check that parent isn't NULL
60  assert(parent != NULL);
61  // set icon
62  setIcon(parent->getIcon());
63  // create main frame
64  FXVerticalFrame* mainFrame = new FXVerticalFrame(this, GUIDesignAuxiliarFrame);
65  // Create frame for contents
66  myContentFrame = new FXVerticalFrame(mainFrame, GUIDesignContentsFrame);
67  // create buttons centered
68  FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(mainFrame, GUIDesignHorizontalFrame);
69  new FXHorizontalFrame(buttonsFrame, GUIDesignAuxiliarHorizontalFrame);
70  myAcceptButton = new FXButton(buttonsFrame, "accept\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), this, MID_GNE_MODE_ADDITIONALDIALOG_ACCEPT, GUIDesignButtonAccept);
71  myCancelButton = new FXButton(buttonsFrame, "cancel\t\tclose", GUIIconSubSys::getIcon(ICON_CANCEL), this, MID_GNE_MODE_ADDITIONALDIALOG_CANCEL, GUIDesignButtonCancel);
72  myResetButton = new FXButton(buttonsFrame, "reset\t\tclose", GUIIconSubSys::getIcon(ICON_RESET), this, MID_GNE_MODE_ADDITIONALDIALOG_RESET, GUIDesignButtonReset);
73  new FXHorizontalFrame(buttonsFrame, GUIDesignAuxiliarHorizontalFrame);
74 }
75 
76 
78 
79 
80 void
82  // change FXDialogBox title
83  setTitle(newHeader.c_str());
84 }
85 
86 /****************************************************************************/
virtual long onCmdReset(FXObject *, FXSelector, void *)=0
event after press cancel button
#define GUIDesignHorizontalFrame
Definition: GUIDesigns.h:204
~GNEAdditionalDialog()
destructor
#define GUIDesignContentsFrame
design for the main content frame of every frame/dialog
Definition: GUIDesigns.h:253
Dialog to edit sequences, parameters, etc.. of Additionals.
#define GUIDesignButtonCancel
Cancel Button.
Definition: GUIDesigns.h:104
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions ...
Definition: GUIDesigns.h:241
FXDEFMAP(GNEAdditionalDialog) GNEAdditionalDialogMap[]
#define GUIDesignDialogBoxExplicit
design for dialog box with specift width and height (for example, additional dialogs) ...
Definition: GUIDesigns.h:396
virtual long onCmdCancel(FXObject *sender, FXSelector sel, void *ptr)=0
event after press cancel button
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
Definition: GUIDesigns.h:244
#define GUIDesignButtonReset
Reset Button.
Definition: GUIDesigns.h:107
virtual long onCmdAccept(FXObject *sender, FXSelector sel, void *ptr)=0
#define GUIDesignButtonAccept
Accept Button.
Definition: GUIDesigns.h:101
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