Check in for Dr.H.Reh. The usability of MarginView has been increased.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10388 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
3c39e6e0d5
commit
c387247ebe
@ -217,7 +217,7 @@ uint32 MarginView::GetUnits(void) {
|
|||||||
void MarginView::UpdateView(uint32 msg)
|
void MarginView::UpdateView(uint32 msg)
|
||||||
{
|
{
|
||||||
Window()->Lock();
|
Window()->Lock();
|
||||||
CalculateViewSize(msg);
|
CalculateViewSize(msg); // nur Preview in Margins BBox!
|
||||||
Invalidate();
|
Invalidate();
|
||||||
Window()->Unlock();
|
Window()->Unlock();
|
||||||
}
|
}
|
||||||
@ -371,55 +371,70 @@ void MarginView::ConstructGUI()
|
|||||||
Y_OFFSET, Frame().Width() - X_OFFSET, _WIDTH);
|
Y_OFFSET, Frame().Width() - X_OFFSET, _WIDTH);
|
||||||
|
|
||||||
// top
|
// top
|
||||||
msg = new BMessage(TOP_MARGIN_CHANGED);
|
|
||||||
str << fMargins.top/fUnitValue;
|
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);
|
B_FOLLOW_RIGHT);
|
||||||
|
|
||||||
|
fTop->SetModificationMessage(new BMessage(TOP_MARGIN_CHANGED));
|
||||||
fTop->SetDivider(be_plain_font->StringWidth("Top#"));
|
fTop->SetDivider(be_plain_font->StringWidth("Top#"));
|
||||||
fTop->SetTarget(this);
|
fTop->SetTarget(this);
|
||||||
AllowOnlyNumbers(fTop, NUM_COUNT);
|
AllowOnlyNumbers(fTop, NUM_COUNT);
|
||||||
AddChild(fTop);
|
AddChild(fTop);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//left
|
//left
|
||||||
r.OffsetBy(0, Y_OFFSET);
|
r.OffsetBy(0, Y_OFFSET);
|
||||||
r.left = Frame().Width() - be_plain_font->StringWidth("Left#") - _WIDTH;
|
r.left = Frame().Width() - be_plain_font->StringWidth("Left#") - _WIDTH;
|
||||||
str = "";
|
str = "";
|
||||||
str << fMargins.left/fUnitValue;
|
str << fMargins.left/fUnitValue;
|
||||||
msg = new BMessage(LEFT_MARGIN_CHANGED);
|
fLeft = new BTextControl( r, "left", "Left", str.String(), NULL,
|
||||||
fLeft = new BTextControl( r, "left", "Left", str.String(), msg,
|
|
||||||
B_FOLLOW_RIGHT);
|
B_FOLLOW_RIGHT);
|
||||||
|
|
||||||
|
fLeft->SetModificationMessage(new BMessage(LEFT_MARGIN_CHANGED));
|
||||||
fLeft->SetDivider(be_plain_font->StringWidth("Left#"));
|
fLeft->SetDivider(be_plain_font->StringWidth("Left#"));
|
||||||
fLeft->SetTarget(this);
|
fLeft->SetTarget(this);
|
||||||
AllowOnlyNumbers(fLeft, NUM_COUNT);
|
AllowOnlyNumbers(fLeft, NUM_COUNT);
|
||||||
AddChild(fLeft);
|
AddChild(fLeft);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//bottom
|
//bottom
|
||||||
r.OffsetBy(0, Y_OFFSET);
|
r.OffsetBy(0, Y_OFFSET);
|
||||||
r.left = Frame().Width() - be_plain_font->StringWidth("Bottom#") - _WIDTH;
|
r.left = Frame().Width() - be_plain_font->StringWidth("Bottom#") - _WIDTH;
|
||||||
str = "";
|
str = "";
|
||||||
str << fMargins.bottom/fUnitValue;
|
str << fMargins.bottom/fUnitValue;
|
||||||
msg = new BMessage(BOTTOM_MARGIN_CHANGED);
|
fBottom = new BTextControl( r, "bottom", "Bottom", str.String(), NULL,
|
||||||
fBottom = new BTextControl( r, "bottom", "Bottom", str.String(), msg,
|
|
||||||
B_FOLLOW_RIGHT);
|
B_FOLLOW_RIGHT);
|
||||||
|
|
||||||
|
fBottom->SetModificationMessage(new BMessage(BOTTOM_MARGIN_CHANGED));
|
||||||
fBottom->SetDivider(be_plain_font->StringWidth("Bottom#"));
|
fBottom->SetDivider(be_plain_font->StringWidth("Bottom#"));
|
||||||
fBottom->SetTarget(this);
|
fBottom->SetTarget(this);
|
||||||
|
|
||||||
AllowOnlyNumbers(fBottom, NUM_COUNT);
|
AllowOnlyNumbers(fBottom, NUM_COUNT);
|
||||||
AddChild(fBottom);
|
AddChild(fBottom);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//right
|
//right
|
||||||
r.OffsetBy(0, Y_OFFSET);
|
r.OffsetBy(0, Y_OFFSET);
|
||||||
r.left = Frame().Width() - be_plain_font->StringWidth("Right#") - _WIDTH;
|
r.left = Frame().Width() - be_plain_font->StringWidth("Right#") - _WIDTH;
|
||||||
str = "";
|
str = "";
|
||||||
str << fMargins.right/fUnitValue;
|
str << fMargins.right/fUnitValue;
|
||||||
msg = new BMessage(RIGHT_MARGIN_CHANGED);
|
fRight = new BTextControl( r, "right", "Right", str.String(), NULL,
|
||||||
fRight = new BTextControl( r, "right", "Right", str.String(), msg,
|
|
||||||
B_FOLLOW_RIGHT);
|
B_FOLLOW_RIGHT);
|
||||||
|
|
||||||
|
fRight->SetModificationMessage(new BMessage(RIGHT_MARGIN_CHANGED));
|
||||||
fRight->SetDivider(be_plain_font->StringWidth("Right#"));
|
fRight->SetDivider(be_plain_font->StringWidth("Right#"));
|
||||||
fRight->SetTarget(this);
|
fRight->SetTarget(this);
|
||||||
AllowOnlyNumbers(fRight, NUM_COUNT);
|
AllowOnlyNumbers(fRight, NUM_COUNT);
|
||||||
AddChild(fRight);
|
AddChild(fRight);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Create Units popup
|
// Create Units popup
|
||||||
r.OffsetBy(-X_OFFSET,Y_OFFSET);
|
r.OffsetBy(-X_OFFSET,Y_OFFSET);
|
||||||
r.right += Y_OFFSET;
|
r.right += Y_OFFSET;
|
||||||
|
Loading…
Reference in New Issue
Block a user