Check in for Dr.H.Reh. The preview margin is set correctly and usability of MarginView has been increased.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10387 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
ff6f3ceb3c
commit
3c39e6e0d5
@ -217,7 +217,7 @@ uint32 MarginView::GetUnits(void) {
|
||||
void MarginView::UpdateView(uint32 msg)
|
||||
{
|
||||
Window()->Lock();
|
||||
CalculateViewSize(msg);
|
||||
CalculateViewSize(msg); // nur Preview in Margins BBox!
|
||||
Invalidate();
|
||||
Window()->Unlock();
|
||||
}
|
||||
@ -371,55 +371,70 @@ void MarginView::ConstructGUI()
|
||||
Y_OFFSET, Frame().Width() - X_OFFSET, _WIDTH);
|
||||
|
||||
// top
|
||||
msg = new BMessage(TOP_MARGIN_CHANGED);
|
||||
str << fMargins.top/fUnitValue;
|
||||
fTop = new BTextControl( r, "top", "Top", str.String(), msg,
|
||||
fTop = new BTextControl( r, "top", "Top", str.String(), NULL,
|
||||
B_FOLLOW_RIGHT);
|
||||
|
||||
fTop->SetModificationMessage(new BMessage(TOP_MARGIN_CHANGED));
|
||||
fTop->SetDivider(be_plain_font->StringWidth("Top#"));
|
||||
fTop->SetTarget(this);
|
||||
AllowOnlyNumbers(fTop, NUM_COUNT);
|
||||
AddChild(fTop);
|
||||
|
||||
|
||||
|
||||
|
||||
//left
|
||||
r.OffsetBy(0, Y_OFFSET);
|
||||
r.left = Frame().Width() - be_plain_font->StringWidth("Left#") - _WIDTH;
|
||||
str = "";
|
||||
str << fMargins.left/fUnitValue;
|
||||
msg = new BMessage(LEFT_MARGIN_CHANGED);
|
||||
fLeft = new BTextControl( r, "left", "Left", str.String(), msg,
|
||||
fLeft = new BTextControl( r, "left", "Left", str.String(), NULL,
|
||||
B_FOLLOW_RIGHT);
|
||||
|
||||
fLeft->SetModificationMessage(new BMessage(LEFT_MARGIN_CHANGED));
|
||||
fLeft->SetDivider(be_plain_font->StringWidth("Left#"));
|
||||
fLeft->SetTarget(this);
|
||||
AllowOnlyNumbers(fLeft, NUM_COUNT);
|
||||
AddChild(fLeft);
|
||||
|
||||
|
||||
|
||||
|
||||
//bottom
|
||||
r.OffsetBy(0, Y_OFFSET);
|
||||
r.left = Frame().Width() - be_plain_font->StringWidth("Bottom#") - _WIDTH;
|
||||
str = "";
|
||||
str << fMargins.bottom/fUnitValue;
|
||||
msg = new BMessage(BOTTOM_MARGIN_CHANGED);
|
||||
fBottom = new BTextControl( r, "bottom", "Bottom", str.String(), msg,
|
||||
fBottom = new BTextControl( r, "bottom", "Bottom", str.String(), NULL,
|
||||
B_FOLLOW_RIGHT);
|
||||
|
||||
fBottom->SetModificationMessage(new BMessage(BOTTOM_MARGIN_CHANGED));
|
||||
fBottom->SetDivider(be_plain_font->StringWidth("Bottom#"));
|
||||
fBottom->SetTarget(this);
|
||||
|
||||
AllowOnlyNumbers(fBottom, NUM_COUNT);
|
||||
AddChild(fBottom);
|
||||
|
||||
|
||||
|
||||
|
||||
//right
|
||||
r.OffsetBy(0, Y_OFFSET);
|
||||
r.left = Frame().Width() - be_plain_font->StringWidth("Right#") - _WIDTH;
|
||||
str = "";
|
||||
str << fMargins.right/fUnitValue;
|
||||
msg = new BMessage(RIGHT_MARGIN_CHANGED);
|
||||
fRight = new BTextControl( r, "right", "Right", str.String(), msg,
|
||||
fRight = new BTextControl( r, "right", "Right", str.String(), NULL,
|
||||
B_FOLLOW_RIGHT);
|
||||
|
||||
fRight->SetModificationMessage(new BMessage(RIGHT_MARGIN_CHANGED));
|
||||
fRight->SetDivider(be_plain_font->StringWidth("Right#"));
|
||||
fRight->SetTarget(this);
|
||||
AllowOnlyNumbers(fRight, NUM_COUNT);
|
||||
AddChild(fRight);
|
||||
|
||||
|
||||
|
||||
// Create Units popup
|
||||
r.OffsetBy(-X_OFFSET,Y_OFFSET);
|
||||
r.right += Y_OFFSET;
|
||||
|
@ -58,9 +58,11 @@ status_t PreviewPage::InitCheck() const {
|
||||
return fStatus;
|
||||
}
|
||||
|
||||
void PreviewPage::Draw(BView* view) {
|
||||
void PreviewPage::Draw(BView* view)
|
||||
{
|
||||
ASSERT(fStatus == B_OK);
|
||||
for (int32 i = 0; i < fNumberOfPictures; i ++) {
|
||||
for (int32 i = 0; i < fNumberOfPictures; i ++)
|
||||
{
|
||||
view->DrawPicture(&fPictures[i], fPoints[i]);
|
||||
}
|
||||
}
|
||||
@ -159,7 +161,10 @@ void PreviewView::DrawPageFrame(BRect rect) {
|
||||
PopState();
|
||||
}
|
||||
|
||||
void PreviewView::DrawPage(BRect rect) {
|
||||
|
||||
|
||||
void PreviewView::DrawPage(BRect rect)
|
||||
{
|
||||
// constrain clipping region to paper dimensions
|
||||
BRect r(PageRect());
|
||||
r.OffsetBy(kPreviewLeftMargin, kPreviewTopMargin);
|
||||
@ -168,12 +173,17 @@ void PreviewView::DrawPage(BRect rect) {
|
||||
|
||||
// draw page contents
|
||||
PushState();
|
||||
SetOrigin(kPreviewLeftMargin, kPreviewTopMargin);
|
||||
|
||||
BRect printRect = fReader.PrintableRect();
|
||||
SetOrigin(kPreviewLeftMargin + printRect.left*ZoomFactor(),
|
||||
kPreviewTopMargin + printRect.top*ZoomFactor() );
|
||||
|
||||
SetScale(ZoomFactor());
|
||||
fCachedPage->Draw(this);
|
||||
PopState();
|
||||
}
|
||||
|
||||
|
||||
void PreviewView::Draw(BRect rect) {
|
||||
if (fReader.InitCheck() == B_OK) {
|
||||
if (!IsPageLoaded(fPage)) {
|
||||
@ -305,6 +315,8 @@ PreviewWindow::PreviewWindow(BFile* jobFile)
|
||||
// add preview view
|
||||
r.top = fButtonBarHeight;
|
||||
fPreview = new PreviewView(jobFile, r);
|
||||
|
||||
|
||||
fPreviewScroller = new BScrollView("PreviewScroller", fPreview, B_FOLLOW_ALL, 0, true, true, B_FANCY_BORDER);
|
||||
fPreviewScroller->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||
AddChild(fPreviewScroller);
|
||||
|
Loading…
Reference in New Issue
Block a user