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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -75,7 +75,9 @@ void Daemon::TileFileProgress::sizeHint(int & w, int & h) const {
|
||||
void Daemon::TileFileProgress::drawEvent(PIScreenDrawer * d) {
|
||||
|
||||
if (ft) {
|
||||
label_file->content[0].first = ft->stateString() + ft->curFile();
|
||||
label_file->content[0].first = ft->stateString() + " " + ft->curFile();
|
||||
if (!label_file->content[0].first.isEmpty())
|
||||
label_file->content[0].first[0] = label_file->content[0].first[0].toUpper();
|
||||
PIString spd;
|
||||
if (ft->isReceiving()) spd = ft->diagnostic().receiveSpeed();
|
||||
else spd = ft->diagnostic().sendSpeed();
|
||||
@@ -94,14 +96,17 @@ void Daemon::TileFileProgress::show(PIFileTransfer * f) {
|
||||
if (ft) {
|
||||
conn_name = ft->name();
|
||||
::screen.setDialogTile(this);
|
||||
buttons->cur = 0;
|
||||
buttons->setFocus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Daemon::TileFileProgress::close() {
|
||||
void Daemon::TileFileProgress::close(bool ok) {
|
||||
ft = 0;
|
||||
::screen.setDialogTile(0);
|
||||
if (!ok)
|
||||
showInfo("Achtung! Alarm!! Error!!!");
|
||||
}
|
||||
|
||||
|
||||
@@ -386,8 +391,11 @@ void Daemon::peerDisconnected(const PIString & name) {
|
||||
}
|
||||
Remote * dt = remotes.value(name, 0);
|
||||
if (!dt) return;
|
||||
delete dt;
|
||||
if (tile_file_progress->ft == &(dt->ft)) {
|
||||
tile_file_progress->close(false);
|
||||
}
|
||||
remotes.remove(name);
|
||||
delete dt;
|
||||
}
|
||||
|
||||
|
||||
@@ -397,10 +405,10 @@ void Daemon::filesReceived(const PIString & name, bool ok) {
|
||||
|
||||
|
||||
void Daemon::closeFileDialog(const PIString & name, bool ok) {
|
||||
piCout << "CLOSE" << name << ok;
|
||||
piCout << "CLOSE" << tile_file_progress->conn_name << name << ok;
|
||||
if (tile_file_progress->conn_name != name) return;
|
||||
if (ok)
|
||||
tile_file_progress->close();
|
||||
tile_file_progress->close(ok);
|
||||
if (ok) requestChDir(".");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ private:
|
||||
public:
|
||||
TileFileProgress();
|
||||
void show(PIFileTransfer * f);
|
||||
void close();
|
||||
void close(bool ok = true);
|
||||
TileSimple * label_file, * label_speed;
|
||||
TileProgress * prog_file, * prog_all;
|
||||
TileButtons * buttons;
|
||||
|
||||
@@ -100,6 +100,8 @@ void showInfo(const PIString & t) {
|
||||
CONNECTU(&screen, keyPressed, &w, keyPressed)
|
||||
CONNECTU(&screen, tileEvent, &w, tileEvent)
|
||||
screen.setDialogTile(&dlg);
|
||||
btns->cur = 0;
|
||||
btns->setFocus();
|
||||
while (!w.close) {
|
||||
PIKbdListener::instance()->readKeyboard();
|
||||
piMSleep(10);
|
||||
|
||||
Reference in New Issue
Block a user