Path: blob/main/src/utils/gui/div/GUIPersistentWindowPos.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 GUIPersistentWindowPos.h14/// @author Jakob Erdmann15/// @date Thu, 09.03.202316///17// Store persistent window position18/****************************************************************************/19#pragma once20#include <config.h>21#include <utils/foxtools/fxheader.h>22232425// ===========================================================================26// class definition27// ===========================================================================28/**29* @class GUIPersistentWindowPos30* @brief Persists window position in the registry31*/32class GUIPersistentWindowPos {3334public:35/** @brief Constructor (Notifies both the parent and the storage about being initialised)36* @param[in] parent The parent window37* @param[in] str The storage of object selections to use38*/39GUIPersistentWindowPos(FXWindow* parent, const std::string& name, bool storeSize,40int x = 150, int y = 150,41int width = 700, int height = 500,42int minSize = 400, int minTitlebarHeight = 20);4344/// @brief Destructor (Notifies both the parent and the storage about being destroyed)45~GUIPersistentWindowPos();4647void saveWindowPos();48void loadWindowPos();4950protected:51/// @brief The window for which the position is being stored52FXWindow* myParent;5354/// @brief Name for storing in the registry55std::string myWindowName;5657/// @brief whether window size shall be stored58bool myStoreSize;5960int myDefaultX;61int myDefaultY;6263int myDefaultWidth;64int myDefaultHeight;6566int myMinSize;67int myMinTitlebarHeight;6869GUIPersistentWindowPos();7071};727374