* 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;
|
BStatusBar* fStatusBar;
|
||||||
BButton* fCancelButton;
|
BButton* fCancelButton;
|
||||||
BButton* fHideButton;
|
BButton* fHideButton;
|
||||||
bool fCancelBar;
|
bool fCancelled;
|
||||||
bool fDocumentCopy;
|
bool fDocumentCopy;
|
||||||
uint32 fNops;
|
uint32 fNops;
|
||||||
uint32 fFirstPage;
|
uint32 fFirstPage;
|
||||||
|
|||||||
@@ -19,13 +19,18 @@
|
|||||||
#define HIDE_MSG 'hidM'
|
#define HIDE_MSG 'hidM'
|
||||||
|
|
||||||
|
|
||||||
StatusWindow::StatusWindow(bool oddPages, bool evenPages, uint32 firstPage, uint32 numPages, uint32 numCopies, uint32 nup)
|
StatusWindow::StatusWindow(bool oddPages, bool evenPages, uint32 firstPage,
|
||||||
: BWindow (BRect(200, 200, 650, 270), "Print Status", B_DOCUMENT_WINDOW, B_NOT_RESIZABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE)
|
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
|
// oddPages - if true, only print odd numbered pages
|
||||||
// evenPages - if true, only print even numbered pages
|
// evenPages - if true, only print even numbered pages
|
||||||
// firstPage - number of first page
|
// 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
|
// numCopies - total number of document copies
|
||||||
|
|
||||||
BRect frame = Frame();
|
BRect frame = Frame();
|
||||||
@@ -40,17 +45,19 @@ StatusWindow::StatusWindow(bool oddPages, bool evenPages, uint32 firstPage, uint
|
|||||||
fStatusView->AddChild(fStatusBar);
|
fStatusView->AddChild(fStatusBar);
|
||||||
|
|
||||||
// the cancel button
|
// 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();
|
fHideButton->ResizeToPreferred();
|
||||||
fStatusView->AddChild(fHideButton);
|
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->ResizeToPreferred();
|
||||||
fCancelButton->MoveBy(90,0);
|
fCancelButton->MoveBy(90,0);
|
||||||
|
|
||||||
fStatusView->AddChild(fCancelButton);
|
fStatusView->AddChild(fCancelButton);
|
||||||
|
|
||||||
fCancelBar = false;
|
fCancelled = false;
|
||||||
|
|
||||||
// calculate the real number of pages
|
// calculate the real number of pages
|
||||||
fNops = numPages;
|
fNops = numPages;
|
||||||
@@ -140,11 +147,12 @@ StatusWindow::UpdateStatusBar(uint32 page, uint32 copy)
|
|||||||
string3.Append(string4);
|
string3.Append(string4);
|
||||||
}
|
}
|
||||||
|
|
||||||
fStatusBar->Update(fStatusDelta*100.0/fNops, string1.String(), string3.String());
|
fStatusBar->Update(fStatusDelta * 100.0 / fNops,
|
||||||
if ( (fStatusBar->MaxValue()) == (fStatusBar->CurrentValue()) )
|
string1.String(), string3.String());
|
||||||
|
if (fStatusBar->MaxValue() == fStatusBar->CurrentValue())
|
||||||
fCancelButton->SetEnabled(false);
|
fCancelButton->SetEnabled(false);
|
||||||
Unlock();
|
Unlock();
|
||||||
return fCancelBar;
|
return fCancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -164,17 +172,13 @@ StatusWindow::MessageReceived(BMessage *message)
|
|||||||
|
|
||||||
switch(message->what) {
|
switch(message->what) {
|
||||||
case CANCEL_MSG: // 'CancelButton' is pressed...
|
case CANCEL_MSG: // 'CancelButton' is pressed...
|
||||||
{
|
fCancelled = true;
|
||||||
fCancelBar = true;
|
|
||||||
fCancelButton->SetEnabled(false);
|
fCancelButton->SetEnabled(false);
|
||||||
fCancelButton->SetLabel("Job cancelled");
|
fCancelButton->SetLabel("Job cancelled");
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HIDE_MSG: // 'HideButton' is pressed...
|
case HIDE_MSG: // 'HideButton' is pressed...
|
||||||
{
|
|
||||||
Hide();
|
Hide();
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user