Fixed bug #1231. Update text rectangle when view is resized.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21182 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Pfeiffer 2007-05-20 19:48:33 +00:00
parent 05e39c4565
commit e4ee835fc2
2 changed files with 12 additions and 1 deletions

View File

@ -31,6 +31,7 @@ public:
AddPrinterView(BRect frame, PrinterData *printer_data, const PrinterCap *printer_cap);
~AddPrinterView();
virtual void AttachedToWindow();
void FrameResized(float w, float h);
void MessageReceived(BMessage *msg);
void Save();

View File

@ -106,7 +106,7 @@ ProtocolClassItem::getDescription()
AddPrinterView::AddPrinterView(BRect frame, PrinterData *printer_data, const PrinterCap *printer_cap)
: BView(frame, "", B_FOLLOW_ALL, B_WILL_DRAW), fPrinterData(printer_data), fPrinterCap(printer_cap)
: BView(frame, "", B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS), fPrinterData(printer_data), fPrinterCap(printer_cap)
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
}
@ -184,6 +184,16 @@ AddPrinterView::AttachedToWindow()
MessageReceived(&updateDescription);
}
void
AddPrinterView::FrameResized(float w, float h)
{
BView::FrameResized(w, h);
// update text rectangle
BRect rect(fDescription->TextRect());
rect.right = rect.left + fDescription->Frame().Width();
fDescription->SetTextRect(rect);
}
ProtocolClassItem *
AddPrinterView::CurrentSelection()
{