* Replaced direct Draw() calls with calls to Invalidate().

* Some more cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17712 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-06-03 15:57:35 +00:00
parent 43d3560b25
commit c0c04085ba

View File

@ -682,7 +682,7 @@ TWindow::InfoIsShowing()
void
TWindow::UpdateInfo()
{
fInfo->Draw(fInfo->Bounds());
fInfo->Invalidate();
}
@ -869,10 +869,12 @@ TInfoView::TInfoView(BRect frame)
fCH2Str[0] = 0;
}
TInfoView::~TInfoView()
{
}
void
TInfoView::AttachedToWindow()
{
@ -884,13 +886,11 @@ TInfoView::AttachedToWindow()
AddMenu();
}
void
TInfoView::Draw(BRect updateRect)
{
PushState();
char str[64];
SetLowColor(ViewColor());
BRect invalRect;
@ -900,6 +900,8 @@ TInfoView::Draw(BRect updateRect)
int32 pixelSize = dynamic_cast<TWindow*>(Window())->PixelSize();
MovePenTo(10, fFontHeight + 5);
char str[64];
sprintf(str, "%li x %li @ %li pixels/pixel", hPixelCount, vPixelCount,
pixelSize);
invalRect.Set(10, 5, 10 + StringWidth(fInfoStr), fFontHeight+7);
@ -1158,7 +1160,7 @@ TMagnify::KeyDown(const char *key, int32 numBytes)
fSelection = 0;
}
fNeedToUpdate = true;
Draw(Bounds());
Invalidate();
}
break;
@ -1269,7 +1271,7 @@ TMagnify::MouseDown(BPoint where)
// update the info region
fNeedToUpdate = true;
Draw(Bounds());
Invalidate();
}
}
@ -1291,7 +1293,7 @@ TMagnify::SetSelection(bool state)
fShowSelection = state;
fSelection = 0;
Draw(Bounds());
Invalidate();
}
@ -1326,7 +1328,7 @@ TMagnify::MoveSelection(int32 x, int32 y)
}
fNeedToUpdate = true;
Draw(Bounds());
Invalidate();
}
@ -1355,7 +1357,7 @@ TMagnify::MoveSelectionTo(int32 x, int32 y)
}
fNeedToUpdate = true;
Draw(Bounds());
Invalidate(); //Draw(Bounds());
}
@ -1488,9 +1490,9 @@ TMagnify::Update(bool force)
GetMouse(&loc, &button);
ConvertToScreen(&loc);
if (force || (fLastLoc != loc) || (counter++ % 35 == 0)) {
if (force || fLastLoc != loc || counter++ % 35 == 0) {
if (fImageView->CreateImage(loc, force))
Draw(Bounds());
Invalidate();
counter = 0;
if (force)
@ -1568,7 +1570,7 @@ TMagnify::AddCrossHair()
if (fCrossHair1.y >= h)
fCrossHair1.y = 0;
}
Draw(Bounds());
Invalidate();
}
@ -1585,7 +1587,7 @@ TMagnify::RemoveCrossHair()
fSelection = 0;
fShowCrossHair1 = false;
}
Draw(Bounds());
Invalidate();
}