* Style changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39196 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -30,7 +30,7 @@ class StatusWindow : public BWindow
|
||||
BStatusBar* fStatusBar;
|
||||
BButton* fCancelButton;
|
||||
BButton* fHideButton;
|
||||
bool fCancelBar;
|
||||
bool fCancelled;
|
||||
bool fDocumentCopy;
|
||||
uint32 fNops;
|
||||
uint32 fFirstPage;
|
||||
|
||||
@@ -19,13 +19,18 @@
|
||||
#define HIDE_MSG 'hidM'
|
||||
|
||||
|
||||
StatusWindow::StatusWindow(bool oddPages, bool evenPages, uint32 firstPage, uint32 numPages, uint32 numCopies, uint32 nup)
|
||||
: BWindow (BRect(200, 200, 650, 270), "Print Status", B_DOCUMENT_WINDOW, B_NOT_RESIZABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE)
|
||||
StatusWindow::StatusWindow(bool oddPages, bool evenPages, uint32 firstPage,
|
||||
uint32 numPages, uint32 numCopies, uint32 nup)
|
||||
:
|
||||
BWindow(BRect(200, 200, 650, 270),
|
||||
"Print Status",
|
||||
B_DOCUMENT_WINDOW, B_NOT_RESIZABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE)
|
||||
{
|
||||
// oddPages - if true, only print odd numbered pages
|
||||
// evenPages - if true, only print even numbered pages
|
||||
// firstPage - number of first page
|
||||
// numPages - total number of pages (must be recalculate if odd/even is used)
|
||||
// numPages - total number of pages (must be recalculate if odd/even is
|
||||
// used)
|
||||
// numCopies - total number of document copies
|
||||
|
||||
BRect frame = Frame();
|
||||
@@ -40,17 +45,19 @@ StatusWindow::StatusWindow(bool oddPages, bool evenPages, uint32 firstPage, uint
|
||||
fStatusView->AddChild(fStatusBar);
|
||||
|
||||
// the cancel button
|
||||
fHideButton = new BButton(BRect(260, 25, 330,50),"Hide Button","Hide Status", new BMessage(HIDE_MSG));
|
||||
fHideButton = new BButton(BRect(260, 25, 330, 50), "Hide Button",
|
||||
"Hide Status", new BMessage(HIDE_MSG));
|
||||
fHideButton->ResizeToPreferred();
|
||||
fStatusView->AddChild(fHideButton);
|
||||
|
||||
fCancelButton = new BButton(BRect(260, 25, 330,50),"Cancel Button","Cancel", new BMessage(CANCEL_MSG));
|
||||
fCancelButton = new BButton(BRect(260, 25, 330,50), "Cancel Button",
|
||||
"Cancel", new BMessage(CANCEL_MSG));
|
||||
fCancelButton->ResizeToPreferred();
|
||||
fCancelButton->MoveBy(90,0);
|
||||
|
||||
fStatusView->AddChild(fCancelButton);
|
||||
|
||||
fCancelBar = false;
|
||||
fCancelled = false;
|
||||
|
||||
// calculate the real number of pages
|
||||
fNops = numPages;
|
||||
@@ -140,11 +147,12 @@ StatusWindow::UpdateStatusBar(uint32 page, uint32 copy)
|
||||
string3.Append(string4);
|
||||
}
|
||||
|
||||
fStatusBar->Update(fStatusDelta*100.0/fNops, string1.String(), string3.String());
|
||||
if ( (fStatusBar->MaxValue()) == (fStatusBar->CurrentValue()) )
|
||||
fStatusBar->Update(fStatusDelta * 100.0 / fNops,
|
||||
string1.String(), string3.String());
|
||||
if (fStatusBar->MaxValue() == fStatusBar->CurrentValue())
|
||||
fCancelButton->SetEnabled(false);
|
||||
Unlock();
|
||||
return fCancelBar;
|
||||
return fCancelled;
|
||||
}
|
||||
|
||||
|
||||
@@ -164,17 +172,13 @@ StatusWindow::MessageReceived(BMessage *message)
|
||||
|
||||
switch(message->what) {
|
||||
case CANCEL_MSG: // 'CancelButton' is pressed...
|
||||
{
|
||||
fCancelBar = true;
|
||||
fCancelled = true;
|
||||
fCancelButton->SetEnabled(false);
|
||||
fCancelButton->SetLabel("Job cancelled");
|
||||
}
|
||||
break;
|
||||
|
||||
case HIDE_MSG: // 'HideButton' is pressed...
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user