* Minor cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33583 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-10-14 12:12:52 +00:00
parent af7fec0304
commit 8e52aee982
2 changed files with 22 additions and 14 deletions

View File

@ -1,8 +1,9 @@
/*
* Copyright 2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Copyright 2007-2009, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
#include "ProgressWindow.h"
#include <stdio.h>
@ -18,7 +19,7 @@
static const uint32 kMsgShow = 'show';
ProgressWindow::ProgressWindow(BWindow* referenceWindow)
ProgressWindow::ProgressWindow(BWindow* referenceWindow, bool center)
:
BWindow(BRect(0, 0, 250, 100), "Progress Monitor",
B_MODAL_WINDOW_LOOK, B_FLOATING_APP_WINDOW_FEEL,
@ -40,8 +41,13 @@ ProgressWindow::ProgressWindow(BWindow* referenceWindow)
view->AddChild(fStatusBar);
BScreen screen(referenceWindow);
ResizeTo(Bounds().Width(), height + 9);
MoveTo(screen.Frame().left + 5, screen.Frame().bottom - Bounds().Height() - 5);
if (!center) {
ResizeTo(Bounds().Width(), height + 9);
// TODO: frame width!
MoveTo(screen.Frame().left + 5,
screen.Frame().bottom - Bounds().Height() - 5);
} else
CenterIn(screen.Frame());
Run();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Copyright 2007-2009, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
#ifndef PROGRESS_WINDOW_H
@ -8,25 +8,27 @@
#include <Window.h>
class BMessageRunner;
class BStatusBar;
class ProgressWindow : public BWindow {
public:
ProgressWindow(BWindow* referenceWindow);
virtual ~ProgressWindow();
ProgressWindow(BWindow* referenceWindow,
bool center = false);
virtual ~ProgressWindow();
virtual void MessageReceived(BMessage *message);
virtual void MessageReceived(BMessage* message);
void Start();
void Stop();
void Start();
void Stop();
private:
BStatusBar* fStatusBar;
BMessageRunner* fRunner;
bool fRetrievedUpdate;
bool fRetrievedShow;
BStatusBar* fStatusBar;
BMessageRunner* fRunner;
bool fRetrievedUpdate;
bool fRetrievedShow;
};