/*! \file piscreentiles.h * \brief Various tiles for PIScreen */ /* PIP - Platform Independent Primitives Various tiles for PIScreen Copyright (C) 2016 Ivan Pelipenko peri4ko@gmail.com This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef PISCREENTILES_H #define PISCREENTILES_H #include "piscreentile.h" class PIP_EXPORT TileSimple: public PIScreenTile { public: typedef PIPair Row; TileSimple(const PIString & n = PIString()); TileSimple(const Row & r); PIVector content; PIScreenTypes::Alignment alignment; protected: void sizeHint(int & w, int & h) const; void drawEvent(PIScreenDrawer * d); }; class PIP_EXPORT TileList: public PIScreenTile { public: TileList(const PIString & n = PIString()); enum SelectionMode { NoSelection, SingleSelection, MultiSelection }; enum EventType { SelectionChanged, RowPressed }; typedef PIPair Row; PIDeque content; PIScreenTypes::Alignment alignment; SelectionMode selection_mode; PISet selected; int cur, offset; protected: void sizeHint(int & w, int & h) const; void drawEvent(PIScreenDrawer * d); bool keyEvent(PIKbdListener::KeyEvent key); int lhei; PIChar vert_line; }; class PIP_EXPORT TileButton: public PIScreenTile { public: TileButton(const PIString & n = PIString()); enum EventType { ButtonClicked }; PIScreenTypes::CellFormat format; PIString text; protected: void sizeHint(int & w, int & h) const; void drawEvent(PIScreenDrawer * d); bool keyEvent(PIKbdListener::KeyEvent key); }; class PIP_EXPORT TileButtons: public PIScreenTile { public: TileButtons(const PIString & n = PIString()); enum EventType { ButtonSelected }; typedef PIPair Button; PIScreenTypes::Alignment alignment; PIVector