/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2006-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 MFXGroupBoxModule.h14/// @author Pablo Alvarez Lopez15/// @date Dec 202116///17//18/****************************************************************************/1920#pragma once21#include <config.h>2223#include "fxheader.h"2425#include <string>2627/// @brief class declaration28class GNEFrame;29class MFXButtonTooltip;3031/// @brief MFXGroupBoxModule (based on FXGroupBox)32class MFXGroupBoxModule : protected FXVerticalFrame {33FXDECLARE(MFXGroupBoxModule)3435public:36/// @brief GroupBoxModule options37enum Options {38NOTHING = 1 << 0, // Basic GroupBox39COLLAPSIBLE = 1 << 1, // Collapsible groupBox40EXTENSIBLE = 1 << 2, // Extensible groupBox41SAVE = 1 << 3, // Save contents42LOAD = 1 << 4, // Load contents43};4445/// @brief constructor for frames46MFXGroupBoxModule(GNEFrame* frame, const std::string& text, const int options = Options::COLLAPSIBLE);4748/// @brief constructor for fix dialogs49MFXGroupBoxModule(FXVerticalFrame* contentFrame, const std::string& text, const int options = Options::NOTHING);5051/// @brief destructor52~MFXGroupBoxModule();5354/// @brief set text55void setText(const std::string& text);5657/// @brief get collapsable frame (used by all elements that will be collapsed if button is toggled)58FXVerticalFrame* getCollapsableFrame();5960/// @brief draw MFXGroupBoxModule61long onPaint(FXObject*, FXSelector, void*);6263/// @brief collapse GroupBoxModule64long onCmdCollapseButton(FXObject*, FXSelector, void*);6566/// @brief extends GroupBoxModule67long onCmdExtendButton(FXObject*, FXSelector, void*);6869/// @brief reset GroupBoxModule70long onCmdResetButton(FXObject*, FXSelector, void*);7172/// @brief update reset GroupBoxModule73long onUpdResetButton(FXObject*, FXSelector, void*);7475/// @brief save contents76long onCmdSaveButton(FXObject*, FXSelector, void*);7778/// @brief load contents79long onCmdLoadButton(FXObject*, FXSelector, void*);8081protected:82/// @brief FOX need this83MFXGroupBoxModule();8485/// @brief save contents (can be reimplemented in children)86virtual bool saveContents() const;8788/// @brief load contents (can be reimplemented in children)89virtual bool loadContents() const;9091/// @brief enable or disable save buttons92void toggleSaveButton(const bool value);9394private:95/// @brief GroupBoxModule options96const int myOptions;9798/// @brief GNEFrame in which this GroupBox is placed99GNEFrame* myFrameParent = nullptr;100101/// @brief vertical collapsable frame102FXVerticalFrame* myCollapsableFrame = nullptr;103104/// @brief label used in non collapsable MFXGroupBoxModule105FXLabel* myLabel = nullptr;106107/// @brief button for collapse elements108FXButton* myCollapseButton = nullptr;109110/// @brief button for extend elements111MFXButtonTooltip* myExtendButton = nullptr;112113/// @brief button for reset frame width114FXButton* myResetWidthButton = nullptr;115116/// @brief button for save elements117FXButton* mySaveButton = nullptr;118119/// @brief button for load elements120FXButton* myLoadButton = nullptr;121122/// @brief flag to check if this groupbox is collapsed123bool myCollapsed;124};125126127