Path: blob/main/src/utils/gui/div/GUIDialog_GLChosenEditor.h
169684 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file GUIDialog_GLChosenEditor.h14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @date Thu, 11.03.200417///18// Editor for the list of chosen objects19/****************************************************************************/20#pragma once21#include <config.h>2223#include <string>24#include <vector>25#include <utils/foxtools/fxheader.h>2627#include <utils/gui/div/GUISelectedStorage.h>28#include <utils/gui/div/GUIPersistentWindowPos.h>29#include <utils/gui/windows/GUIMainWindow.h>3031// ===========================================================================32// class declarations33// ===========================================================================34class GUIMainWindow;353637// ===========================================================================38// class definition39// ===========================================================================40/**41* @class GUIDialog_GLChosenEditor42* @brief Editor for the list of chosen objects43*44* @see GUIMainWindow45* @see GUISelectedStorage46*/47class GUIDialog_GLChosenEditor : public FXMainWindow, public GUISelectedStorage::UpdateTarget, GUIPersistentWindowPos {48// FOX-declarations49FXDECLARE(GUIDialog_GLChosenEditor)5051public:52/** @brief Constructor (Notifies both the parent and the storage about being initialised)53* @param[in] parent The parent window54* @param[in] str The storage of object selections to use55*/56GUIDialog_GLChosenEditor(GUIMainWindow* parent, GUISelectedStorage* str);5758/// @brief Destructor (Notifies both the parent and the storage about being destroyed)59~GUIDialog_GLChosenEditor();6061/// @brief Rebuilds the entire list62void rebuildList();6364// @brief called if the global selection changes65void selectionUpdated();6667/// @name FOX-callbacks68/// @{6970/// @brief keyboard functions71//@{72long onKeyPress(FXObject* o, FXSelector sel, void* data);73//@}7475/** @brief Called when the user presses the Load-button76*77* Opens a file dialog and forces the parent to load the list of selected78* objects when a file was chosen. Rebuilds the list, then, and redraws79* itself.80*81* @todo Recheck loading/saving of selections82*/83long onCmdLoad(FXObject*, FXSelector, void*);8485/** @brief Called when the user presses the Save-button86*87* Opens a file dialog and forces the selection container to save the list88* of selected objects when a file was chosen.89*90* If the saving failed, a message window is shown.91*92* @todo Recheck loading/saving of selections93*/94long onCmdSave(FXObject*, FXSelector, void*);9596/** @brief Called when the user presses the Deselect-button97*98* Determines which items were chosen and calls GUISelectedStorage::deselect99* for each.100*/101long onCmdDeselect(FXObject*, FXSelector, void*);102103/** @brief Called when the user presses the Clear-button104*105* Clear the internal list and calls GUISelectedStorage::clear.106* Repaints itself107*/108long onCmdClear(FXObject*, FXSelector, void*);109110/** @brief Called when the user presses the Close-button111*112* Closes itself.113*/114long onCmdClose(FXObject*, FXSelector, void*);115/// @}116117protected:118/// FOX needs this119GUIDialog_GLChosenEditor() {}120121private:122/// @brief The list that holds the ids123FXList* myList = nullptr;124125/// @brief The parent window126GUIMainWindow* myParent = nullptr;127128/// @brief The storage129GUISelectedStorage* myStorage = nullptr;130};131132133