Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEFixElementsDialog.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-2025 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// Dialog used to fix elements during saving
19/****************************************************************************/
20
23#include <netedit/GNENet.h>
26
28
29// ===========================================================================
30// FOX callback mapping
31// ===========================================================================
32
38
39// Object implementation
40FXIMPLEMENT_ABSTRACT(GNEFixElementsDialog, MFXDialogBox, GNEFixElementsDialogMap, ARRAYNUMBER(GNEFixElementsDialogMap))
41
42// ===========================================================================
43// member method definitions
44// ===========================================================================
45
46GNEFixElementsDialog::GNEFixElementsDialog(GNEViewNet* viewNet, const std::string title, GUIIcon icon, const int sizeX, const int sizeY) :
47 MFXDialogBox(viewNet->getApp(), title.c_str(), GUIDesignDialogBoxExplicitStretchable(sizeX, sizeY)),
48 myViewNet(viewNet) {
49 // set icon
50 setIcon(GUIIconSubSys::getIcon(icon));
51 // create main frame
52 myMainFrame = new FXVerticalFrame(this, GUIDesignAuxiliarFrame);
53}
54
55
57
58
59long
64
65
66long
68 if (success) {
69 // stop modal with TRUE (continue saving)
70 getApp()->stopModal(this, TRUE);
71 } else {
72 // stop modal with FALSE (abort saving)
73 getApp()->stopModal(this, FALSE);
74 }
75 hide();
76 return 1;
77}
78
79
80// ---------------------------------------------------------------------------
81// GNEFixElementsDialog::Buttons - methods
82// ---------------------------------------------------------------------------
83
85 FXHorizontalFrame(fixElementsDialog->myMainFrame, GUIDesignHorizontalFrame) {
86 new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
89 new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
90}
91
92/****************************************************************************/
FXDEFMAP(GNEFixElementsDialog) GNEFixElementsDialogMap[]
@ MID_GNE_BUTTON_CANCEL
cancel button
@ MID_CHOOSEN_OPERATION
set type of selection
Definition GUIAppEnum.h:597
@ MID_GNE_BUTTON_ACCEPT
accept button
#define GUIDesignButtonAccept
Accept Button.
Definition GUIDesigns.h:156
#define GUIDesignButtonCancel
Cancel Button.
Definition GUIDesigns.h:162
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:399
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
Definition GUIDesigns.h:390
#define GUIDesignHorizontalFrame
Horizontal frame extended over frame parent with padding and spacing.
Definition GUIDesigns.h:328
#define GUIDesignDialogBoxExplicitStretchable(width, height)
design for dialog box with specific width and height that can be stretched (But not shrunk)
Definition GUIDesigns.h:617
GUIIcon
An enumeration of icons used by the gui applications.
Definition GUIIcons.h:33
#define TL(string)
Definition MsgHandler.h:305
GNEInternalTest * getInternalTest() const
get netedit test system
Buttons(GNEFixElementsDialog *fixElementsDialog)
build Position Options
FXButton * myAcceptButton
accept button
FXButton * myCancelButton
cancel button
long openFixDialog()
open dialog
GNEViewNet * myViewNet
view net
long closeFixDialog(const bool success)
stop fix elements dialog accepting changes
virtual long onCmdCancel(FXObject *, FXSelector, void *)=0
event after press cancel button
virtual long onCmdAccept(FXObject *, FXSelector, void *)=0
event after press accept button
virtual long onCmdSelectOption(FXObject *obj, FXSelector, void *)=0
event when user select a option
GNEViewParent * getViewParent() const
get the net object
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXuint openModalDialog(InternalTest *internalTests, FXuint placement=PLACEMENT_CURSOR)
Run modal invocation of the dialog.
Definition json.hpp:4471