code format
This commit is contained in:
@@ -5,22 +5,22 @@
|
||||
* \~russian Различные тайлы для PIScreen
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Various tiles for PIScreen
|
||||
Ivan Pelipenko peri4ko@yandex.ru
|
||||
PIP - Platform Independent Primitives
|
||||
Various tiles for PIScreen
|
||||
Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser 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 free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
||||
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 Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef PISCREENTILES_H
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
class PIP_CONSOLE_EXPORT TileSimple: public PIScreenTile {
|
||||
PIOBJECT_SUBCLASS(TileSimple, PIScreenTile);
|
||||
|
||||
public:
|
||||
typedef PIPair<PIString, PIScreenTypes::CellFormat> Row;
|
||||
TileSimple(const PIString & n = PIString());
|
||||
@@ -39,6 +40,7 @@ public:
|
||||
virtual ~TileSimple() {}
|
||||
PIVector<Row> content;
|
||||
PIScreenTypes::Alignment alignment;
|
||||
|
||||
protected:
|
||||
void sizeHint(int & w, int & h) const override;
|
||||
void drawEvent(PIScreenDrawer * d) override;
|
||||
@@ -50,16 +52,18 @@ class TileList;
|
||||
class PIP_CONSOLE_EXPORT TileScrollBar: public PIScreenTile {
|
||||
PIOBJECT_SUBCLASS(TileScrollBar, PIScreenTile);
|
||||
friend class TileList;
|
||||
|
||||
public:
|
||||
TileScrollBar(const PIString & n = PIString());
|
||||
virtual ~TileScrollBar() {}
|
||||
void setMinimum(int v);
|
||||
void setMaximum(int v);
|
||||
void setValue(int v);
|
||||
int minimum() const {return minimum_;}
|
||||
int maximum() const {return maximum_;}
|
||||
int value() const {return value_;}
|
||||
int minimum() const { return minimum_; }
|
||||
int maximum() const { return maximum_; }
|
||||
int value() const { return value_; }
|
||||
int thickness;
|
||||
|
||||
protected:
|
||||
void _check();
|
||||
void sizeHint(int & w, int & h) const override;
|
||||
@@ -72,6 +76,7 @@ protected:
|
||||
|
||||
class PIP_CONSOLE_EXPORT TileList: public PIScreenTile {
|
||||
PIOBJECT_SUBCLASS(TileList, PIScreenTile);
|
||||
|
||||
public:
|
||||
enum SelectionMode {
|
||||
NoSelection,
|
||||
@@ -92,6 +97,7 @@ public:
|
||||
SelectionMode selection_mode;
|
||||
PISet<int> selected;
|
||||
int lhei, cur, offset;
|
||||
|
||||
protected:
|
||||
void sizeHint(int & w, int & h) const override;
|
||||
void resizeEvent(int w, int h) override;
|
||||
@@ -106,6 +112,7 @@ protected:
|
||||
|
||||
class PIP_CONSOLE_EXPORT TileButton: public PIScreenTile {
|
||||
PIOBJECT_SUBCLASS(TileButton, PIScreenTile);
|
||||
|
||||
public:
|
||||
TileButton(const PIString & n = PIString());
|
||||
virtual ~TileButton() {}
|
||||
@@ -114,6 +121,7 @@ public:
|
||||
};
|
||||
PIScreenTypes::CellFormat format;
|
||||
PIString text;
|
||||
|
||||
protected:
|
||||
void sizeHint(int & w, int & h) const override;
|
||||
void drawEvent(PIScreenDrawer * d) override;
|
||||
@@ -122,10 +130,9 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class PIP_CONSOLE_EXPORT TileButtons: public PIScreenTile {
|
||||
PIOBJECT_SUBCLASS(TileButtons, PIScreenTile);
|
||||
|
||||
public:
|
||||
TileButtons(const PIString & n = PIString());
|
||||
virtual ~TileButtons() {}
|
||||
@@ -136,14 +143,15 @@ public:
|
||||
PIScreenTypes::Alignment alignment;
|
||||
PIVector<Button> content;
|
||||
int cur;
|
||||
|
||||
protected:
|
||||
void sizeHint(int & w, int & h) const override;
|
||||
void drawEvent(PIScreenDrawer * d) override;
|
||||
bool keyEvent(PIKbdListener::KeyEvent key) override;
|
||||
bool mouseEvent(PIKbdListener::MouseEvent me) override;
|
||||
struct Rect {
|
||||
Rect(int _x0 = 0, int _y0 = 0, int _x1 = 0, int _y1 = 0): x0(_x0),y0(_y0),x1(_x1),y1(_y1) {}
|
||||
int x0,y0,x1,y1;
|
||||
Rect(int _x0 = 0, int _y0 = 0, int _x1 = 0, int _y1 = 0): x0(_x0), y0(_y0), x1(_x1), y1(_y1) {}
|
||||
int x0, y0, x1, y1;
|
||||
};
|
||||
PIVector<Rect> btn_rects;
|
||||
};
|
||||
@@ -151,6 +159,7 @@ protected:
|
||||
|
||||
class PIP_CONSOLE_EXPORT TileCheck: public PIScreenTile {
|
||||
PIOBJECT_SUBCLASS(TileCheck, PIScreenTile);
|
||||
|
||||
public:
|
||||
TileCheck(const PIString & n = PIString());
|
||||
virtual ~TileCheck() {}
|
||||
@@ -160,6 +169,7 @@ public:
|
||||
PIScreenTypes::CellFormat format;
|
||||
PIString text;
|
||||
bool toggled;
|
||||
|
||||
protected:
|
||||
void sizeHint(int & w, int & h) const override;
|
||||
void drawEvent(PIScreenDrawer * d) override;
|
||||
@@ -170,6 +180,7 @@ protected:
|
||||
|
||||
class PIP_CONSOLE_EXPORT TileProgress: public PIScreenTile {
|
||||
PIOBJECT_SUBCLASS(TileProgress, PIScreenTile);
|
||||
|
||||
public:
|
||||
TileProgress(const PIString & n = PIString());
|
||||
virtual ~TileProgress() {}
|
||||
@@ -178,6 +189,7 @@ public:
|
||||
PIString suffix;
|
||||
double maximum;
|
||||
double value;
|
||||
|
||||
protected:
|
||||
void sizeHint(int & w, int & h) const override;
|
||||
void drawEvent(PIScreenDrawer * d) override;
|
||||
@@ -186,11 +198,13 @@ protected:
|
||||
|
||||
class PIP_CONSOLE_EXPORT TilePICout: public TileList {
|
||||
PIOBJECT_SUBCLASS(TilePICout, PIScreenTile);
|
||||
|
||||
public:
|
||||
TilePICout(const PIString & n = PIString());
|
||||
virtual ~TilePICout() {}
|
||||
PIScreenTypes::CellFormat format;
|
||||
int max_lines;
|
||||
|
||||
protected:
|
||||
void drawEvent(PIScreenDrawer * d) override;
|
||||
bool keyEvent(PIKbdListener::KeyEvent key) override;
|
||||
@@ -199,12 +213,14 @@ protected:
|
||||
|
||||
class PIP_CONSOLE_EXPORT TileInput: public PIScreenTile {
|
||||
PIOBJECT_SUBCLASS(TileInput, PIScreenTile);
|
||||
|
||||
public:
|
||||
TileInput(const PIString & n = PIString());
|
||||
virtual ~TileInput() {}
|
||||
PIScreenTypes::CellFormat format;
|
||||
PIString text;
|
||||
int max_length;
|
||||
|
||||
protected:
|
||||
void sizeHint(int & w, int & h) const override;
|
||||
void drawEvent(PIScreenDrawer * d) override;
|
||||
|
||||
Reference in New Issue
Block a user