// Luanti // SPDX-License-Identifier: LGPL-2.1-or-later // Copyright (C) 2013 celeron55, Perttu Ahola #pragma once #include #include #include #include #include "guiScrollBar.h" class ISimpleTextureSource; /* A table GUI element for GUIFormSpecMenu. Sends a EGET_TABLE_CHANGED event to the parent when an item is selected or double-clicked. Call checkEvent() to get info. Credits: The interface and implementation of this class are (very) loosely based on the Irrlicht classes CGUITable and CGUIListBox. CGUITable and CGUIListBox are licensed under the Irrlicht license; they are Copyright (C) 2002-2012 Nikolaus Gebhardt */ class GUITable : public gui::IGUIElement { public: /* Stores dynamic data that should be preserved when updating a formspec */ struct DynamicData { s32 selected = 0; s32 scrollpos = 0; s32 keynav_time = 0; core::stringw keynav_buffer; std::set opened_trees; }; /* An option of the form = */ struct Option { std::string name; std::string value; Option(const std::string &name_, const std::string &value_) : name(name_), value(value_) {} }; /* A list of options that concern the entire table */ typedef std::vector