From e2d4607eb59539fe401c5d02c8a8820ae59ef3d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Thu, 9 Apr 2015 09:03:23 +0000 Subject: [PATCH] TimerPool fixoutManipulator git-svn-id: svn://db.shs.com.ru/pip@83 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src/console/piscreentiles.cpp | 12 +++++++++++- src/console/piscreentiles.h | 3 ++- utils/system_daemon/daemon.cpp | 20 ++++++++++++++------ utils/system_daemon/daemon.h | 2 +- utils/system_daemon/shared.cpp | 2 ++ 5 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/console/piscreentiles.cpp b/src/console/piscreentiles.cpp index 7c1d18a9..6f60c333 100644 --- a/src/console/piscreentiles.cpp +++ b/src/console/piscreentiles.cpp @@ -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; diff --git a/src/console/piscreentiles.h b/src/console/piscreentiles.h index e338b905..d531bc7d 100644 --- a/src/console/piscreentiles.h +++ b/src/console/piscreentiles.h @@ -93,12 +93,13 @@ public: ButtonSelected }; typedef PIPair Button; + PIScreenTypes::Alignment alignment; PIVector