* 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
+10 -4
View File
@@ -1,8 +1,9 @@
/* /*
* Copyright 2007, Axel Dörfler, [email protected]. All rights reserved. * Copyright 2007-2009, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#include "ProgressWindow.h" #include "ProgressWindow.h"
#include <stdio.h> #include <stdio.h>
@@ -18,7 +19,7 @@
static const uint32 kMsgShow = 'show'; static const uint32 kMsgShow = 'show';
ProgressWindow::ProgressWindow(BWindow* referenceWindow) ProgressWindow::ProgressWindow(BWindow* referenceWindow, bool center)
: :
BWindow(BRect(0, 0, 250, 100), "Progress Monitor", BWindow(BRect(0, 0, 250, 100), "Progress Monitor",
B_MODAL_WINDOW_LOOK, B_FLOATING_APP_WINDOW_FEEL, B_MODAL_WINDOW_LOOK, B_FLOATING_APP_WINDOW_FEEL,
@@ -40,8 +41,13 @@ ProgressWindow::ProgressWindow(BWindow* referenceWindow)
view->AddChild(fStatusBar); view->AddChild(fStatusBar);
BScreen screen(referenceWindow); BScreen screen(referenceWindow);
ResizeTo(Bounds().Width(), height + 9); if (!center) {
MoveTo(screen.Frame().left + 5, screen.Frame().bottom - Bounds().Height() - 5); ResizeTo(Bounds().Width(), height + 9);
// TODO: frame width!
MoveTo(screen.Frame().left + 5,
screen.Frame().bottom - Bounds().Height() - 5);
} else
CenterIn(screen.Frame());
Run(); Run();
} }
+12 -10
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2007, Axel Dörfler, [email protected]. All rights reserved. * Copyright 2007-2009, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef PROGRESS_WINDOW_H #ifndef PROGRESS_WINDOW_H
@@ -8,25 +8,27 @@
#include <Window.h> #include <Window.h>
class BMessageRunner; class BMessageRunner;
class BStatusBar; class BStatusBar;
class ProgressWindow : public BWindow { class ProgressWindow : public BWindow {
public: public:
ProgressWindow(BWindow* referenceWindow); ProgressWindow(BWindow* referenceWindow,
virtual ~ProgressWindow(); bool center = false);
virtual ~ProgressWindow();
virtual void MessageReceived(BMessage *message); virtual void MessageReceived(BMessage* message);
void Start(); void Start();
void Stop(); void Stop();
private: private:
BStatusBar* fStatusBar; BStatusBar* fStatusBar;
BMessageRunner* fRunner; BMessageRunner* fRunner;
bool fRetrievedUpdate; bool fRetrievedUpdate;
bool fRetrievedShow; bool fRetrievedShow;
}; };