TimerPool fixoutManipulator
git-svn-id: svn://db.shs.com.ru/pip@83 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -260,6 +260,7 @@ bool TileButton::keyEvent(PIKbdListener::KeyEvent key) {
|
||||
TileButtons::TileButtons(const PIString & n): PIScreenTile(n) {
|
||||
focus_flags = CanHasFocus | NextByTab;
|
||||
direction = Horizontal;
|
||||
alignment = PIScreenTypes::Center;
|
||||
cur = 0;
|
||||
}
|
||||
|
||||
@@ -281,7 +282,16 @@ void TileButtons::sizeHint(int & w, int & h) const {
|
||||
|
||||
|
||||
void TileButtons::drawEvent(PIScreenDrawer * d) {
|
||||
int cx = x, cy = y;
|
||||
int cx = x, cy = y, shw, shh;
|
||||
sizeHint(shw, shh);
|
||||
int dx = 0;
|
||||
switch (alignment) {
|
||||
case PIScreenTypes::Center: dx = (width - shw) / 2; break;
|
||||
case PIScreenTypes::Right: dx = width - shw; break;
|
||||
default: break;
|
||||
}
|
||||
if (direction == PIScreenTypes::Horizontal)
|
||||
cx += dx;
|
||||
for (int i = 0; i < content.size_s(); ++i) {
|
||||
Color cb = Cyan;
|
||||
Color ct = Black;
|
||||
|
||||
@@ -93,12 +93,13 @@ public:
|
||||
ButtonSelected
|
||||
};
|
||||
typedef PIPair<PIString, PIScreenTypes::CellFormat> Button;
|
||||
PIScreenTypes::Alignment alignment;
|
||||
PIVector<Button> content;
|
||||
int cur;
|
||||
protected:
|
||||
void sizeHint(int & w, int & h) const;
|
||||
void drawEvent(PIScreenDrawer * d);
|
||||
bool keyEvent(PIKbdListener::KeyEvent key);
|
||||
int cur;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user