* The ProgressWindow now starts centered over the reference window on every
open. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22393 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
eb138dc9c4
commit
7746846941
@ -51,15 +51,7 @@ ProgressWindow::ProgressWindow(BWindow* referenceWindow,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ResizeTo(Bounds().Width(), height + 8);
|
ResizeTo(Bounds().Width(), height + 8);
|
||||||
BRect frame;
|
_Center(referenceWindow);
|
||||||
if (referenceWindow != NULL)
|
|
||||||
frame = referenceWindow->Frame();
|
|
||||||
else
|
|
||||||
frame = BScreen().Frame();
|
|
||||||
|
|
||||||
MoveTo(frame.left + (frame.Width() - Bounds().Width()) / 2,
|
|
||||||
frame.top + (frame.Height() - Bounds().Height()) / 2);
|
|
||||||
|
|
||||||
Run();
|
Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,9 +63,23 @@ ProgressWindow::~ProgressWindow()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ProgressWindow::Start()
|
ProgressWindow::_Center(BWindow* referenceWindow)
|
||||||
|
{
|
||||||
|
BRect frame;
|
||||||
|
if (referenceWindow != NULL)
|
||||||
|
frame = referenceWindow->Frame();
|
||||||
|
else
|
||||||
|
frame = BScreen().Frame();
|
||||||
|
|
||||||
|
MoveTo(frame.left + (frame.Width() - Bounds().Width()) / 2,
|
||||||
|
frame.top + (frame.Height() - Bounds().Height()) / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ProgressWindow::Start(BWindow* referenceWindow)
|
||||||
{
|
{
|
||||||
BAutolock _(this);
|
BAutolock _(this);
|
||||||
|
_Center(referenceWindow);
|
||||||
|
|
||||||
fRetrievedUpdate = false;
|
fRetrievedUpdate = false;
|
||||||
fRetrievedShow = false;
|
fRetrievedShow = false;
|
||||||
|
@ -19,10 +19,12 @@ class ProgressWindow : public BWindow {
|
|||||||
|
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
|
|
||||||
void Start();
|
void Start(BWindow* referenceWindow);
|
||||||
void Stop();
|
void Stop();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void _Center(BWindow* referenceWindow);
|
||||||
|
|
||||||
BStatusBar* fStatusBar;
|
BStatusBar* fStatusBar;
|
||||||
BMessageRunner* fRunner;
|
BMessageRunner* fRunner;
|
||||||
bool fRetrievedUpdate;
|
bool fRetrievedUpdate;
|
||||||
|
@ -343,7 +343,7 @@ SudokuWindow::_Generate(int32 level)
|
|||||||
delete fGenerator;
|
delete fGenerator;
|
||||||
|
|
||||||
fSudokuView->SetEditable(false);
|
fSudokuView->SetEditable(false);
|
||||||
fProgressWindow->Start();
|
fProgressWindow->Start(this);
|
||||||
fGenerator = new GenerateSudoku(*fSudokuView->Field(), level,
|
fGenerator = new GenerateSudoku(*fSudokuView->Field(), level,
|
||||||
fProgressWindow, this);
|
fProgressWindow, this);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user