tmp PIScreen

git-svn-id: svn://db.shs.com.ru/pip@10 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-03-10 10:39:58 +00:00
parent 2aef6d8c86
commit 6855c84246
25 changed files with 4629 additions and 0 deletions

View File

@@ -0,0 +1,86 @@
/*! \file piscreentiles.h
* \brief Various tiles for PIScreen
*/
/*
PIP - Platform Independent Primitives
Various tiles for PIScreen
Copyright (C) 2015 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 <http://www.gnu.org/licenses/>.
*/
#ifndef PISCREENTILES_H
#define PISCREENTILES_H
#include "piscreentile.h"
class TileSimple: public PIScreenTile {
public:
TileSimple(const PIString & n = PIString());
typedef PIPair<PIString, PIScreenTypes::CellFormat> Row;
PIVector<Row> content;
PIScreenTypes::Alignment alignment;
protected:
void sizeHint(int & w, int & h) const;
void drawEvent(PIScreenDrawer * d);
};
class TileList: public PIScreenTile {
public:
TileList(const PIString & n = PIString());
enum SelectionMode {
NoSelection,
SingleSelection,
MultiSelection
};
enum EventType {
SelectionChanged,
RowPressed
};
typedef PIPair<PIString, PIScreenTypes::CellFormat> Row;
PIVector<Row> content;
PIScreenTypes::Alignment alignment;
SelectionMode selection_mode;
protected:
void sizeHint(int & w, int & h) const;
void drawEvent(PIScreenDrawer * d);
bool keyEvent(PIKbdListener::KeyEvent key);
int lhei, offset, cur;
PISet<int> selected;
};
class TileButtons: public PIScreenTile {
public:
TileButtons(const PIString & n = PIString());
enum EventType {
ButtonSelected
};
typedef PIPair<PIString, PIScreenTypes::CellFormat> Button;
PIVector<Button> content;
protected:
void sizeHint(int & w, int & h) const;
void drawEvent(PIScreenDrawer * d);
bool keyEvent(PIKbdListener::KeyEvent key);
int cur;
};
#endif // PISCREENTILES_H