Fixed warnings.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20881 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2007-04-28 12:13:22 +00:00
parent 08a996b87a
commit d3a12648fc
3 changed files with 39 additions and 46 deletions

View File

@ -85,7 +85,7 @@ DiagramBox::draw(BRect updateRect)
region.Exclude(&clipping); region.Exclude(&clipping);
view()->ConstrainClippingRegion(&region); view()->ConstrainClippingRegion(&region);
drawBox(); drawBox();
for (int32 i = 0; i < countItems(); i++) { for (uint32 i = 0; i < countItems(); i++) {
DiagramItem *item = itemAt(i); DiagramItem *item = itemAt(i);
if (region.Intersects(item->frame())) if (region.Intersects(item->frame()))
item->draw(item->frame()); item->draw(item->frame());
@ -95,7 +95,7 @@ DiagramBox::draw(BRect updateRect)
region.Include(frame()); region.Include(frame());
if (view()->getClippingAbove(this, &clipping)) if (view()->getClippingAbove(this, &clipping))
region.Exclude(&clipping); region.Exclude(&clipping);
for (int32 i = 0; i < countItems(); i++) { for (uint32 i = 0; i < countItems(); i++) {
DiagramItem *item = itemAt(i); DiagramItem *item = itemAt(i);
BRect r; BRect r;
if (region.Intersects(r = item->frame())) { if (region.Intersects(r = item->frame())) {
@ -210,7 +210,7 @@ DiagramBox::moveBy(float x, float y, BRegion *wireRegion)
if (view()) { if (view()) {
view()->PushState(); view()->PushState();
{ {
for (int32 i = 0; i < countItems(); i++) { for (uint32 i = 0; i < countItems(); i++) {
DiagramEndPoint *endPoint = dynamic_cast<DiagramEndPoint *>(itemAt(i)); DiagramEndPoint *endPoint = dynamic_cast<DiagramEndPoint *>(itemAt(i));
if (endPoint) if (endPoint)
endPoint->moveBy(x, y, wireRegion); endPoint->moveBy(x, y, wireRegion);
@ -243,7 +243,7 @@ DiagramBox::_setOwner(DiagramView *owner)
{ {
D_METHOD(("DiagramBox::_setOwner()\n")); D_METHOD(("DiagramBox::_setOwner()\n"));
m_view = owner; m_view = owner;
for (int32 i = 0; i < countItems(DiagramItem::M_ENDPOINT); i++) { for (uint32 i = 0; i < countItems(DiagramItem::M_ENDPOINT); i++) {
DiagramItem *item = itemAt(i); DiagramItem *item = itemAt(i);
item->_setOwner(m_view); item->_setOwner(m_view);
if (m_view) if (m_view)

View File

@ -613,25 +613,26 @@ void DiagramView::setBackgroundColor(
m_useBackgroundBitmap = false; m_useBackgroundBitmap = false;
} }
void DiagramView::setBackgroundBitmap(
BBitmap *bitmap) void
DiagramView::setBackgroundBitmap(BBitmap* bitmap)
{ {
D_METHOD(("DiagramView::setBackgroundBitmap()\n")); D_METHOD(("DiagramView::setBackgroundBitmap()\n"));
if (m_backgroundBitmap) if (m_backgroundBitmap)
{
delete m_backgroundBitmap; delete m_backgroundBitmap;
}
m_backgroundBitmap = new BBitmap(bitmap); m_backgroundBitmap = new BBitmap(bitmap);
m_useBackgroundBitmap = true; m_useBackgroundBitmap = true;
} }
void DiagramView::updateDataRect()
void
DiagramView::updateDataRect()
{ {
D_METHOD(("DiagramView::updateDataRect()\n")); D_METHOD(("DiagramView::updateDataRect()\n"));
// calculate the area in which boxes display // calculate the area in which boxes display
m_boxRegion.MakeEmpty(); m_boxRegion.MakeEmpty();
for (int32 i = 0; i < countItems(DiagramItem::M_BOX); i++) for (uint32 i = 0; i < countItems(DiagramItem::M_BOX); i++) {
{
m_boxRegion.Include(itemAt(i, DiagramItem::M_BOX)->frame()); m_boxRegion.Include(itemAt(i, DiagramItem::M_BOX)->frame());
} }
// adapt the data rect to the new region of boxes // adapt the data rect to the new region of boxes
@ -642,12 +643,12 @@ void DiagramView::updateDataRect()
_updateScrollBars(); _updateScrollBars();
} }
// -------------------------------------------------------- //
// *** internal operations (private)
// -------------------------------------------------------- //
void DiagramView::_beginWireTracking( // #pragma mark - internal operations (private)
DiagramEndPoint *startPoint)
void
DiagramView::_beginWireTracking(DiagramEndPoint *startPoint)
{ {
D_METHOD(("DiagramView::beginWireTracking()\n")); D_METHOD(("DiagramView::beginWireTracking()\n"));
m_draggedWire = createWire(startPoint); m_draggedWire = createWire(startPoint);
@ -687,9 +688,9 @@ void DiagramView::_beginRectTracking(
BView::BeginRectTracking(BRect(origin, origin), B_TRACK_RECT_CORNER); BView::BeginRectTracking(BRect(origin, origin), B_TRACK_RECT_CORNER);
} }
void DiagramView::_trackRect(
BPoint origin, void
BPoint current) DiagramView::_trackRect(BPoint origin, BPoint current)
{ {
D_METHOD(("DiagramView::trackRect()\n")); D_METHOD(("DiagramView::trackRect()\n"));
bool changed = false; bool changed = false;
@ -698,29 +699,25 @@ void DiagramView::_trackRect(
rect.top = origin.y < current.y ? origin.y : current.y; rect.top = origin.y < current.y ? origin.y : current.y;
rect.right = origin.x < current.x ? current.x : origin.x; rect.right = origin.x < current.x ? current.x : origin.x;
rect.bottom = origin.y < current.y ? current.y : origin.y; rect.bottom = origin.y < current.y ? current.y : origin.y;
for (int32 i = 0; i < countItems(DiagramItem::M_BOX); i++) for (uint32 i = 0; i < countItems(DiagramItem::M_BOX); i++) {
{
DiagramBox *box = dynamic_cast<DiagramBox *>(itemAt(i, DiagramItem::M_BOX)); DiagramBox *box = dynamic_cast<DiagramBox *>(itemAt(i, DiagramItem::M_BOX));
if (box) if (box) {
{
if (rect.Intersects(box->frame())) if (rect.Intersects(box->frame()))
{
changed |= selectItem(box, false); changed |= selectItem(box, false);
}
else else
{
changed |= deselectItem(box); changed |= deselectItem(box);
}
} }
} }
if (changed)
{ if (changed) {
sortItems(DiagramItem::M_BOX, &compareSelectionTime); sortItems(DiagramItem::M_BOX, &compareSelectionTime);
selectionChanged(); selectionChanged();
} }
} }
void DiagramView::_updateScrollBars()
void
DiagramView::_updateScrollBars()
{ {
D_METHOD(("DiagramView::_updateScrollBars()\n")); D_METHOD(("DiagramView::_updateScrollBars()\n"));
// fetch the vertical ScrollBar // fetch the vertical ScrollBar

View File

@ -7,26 +7,22 @@
__USE_CORTEX_NAMESPACE __USE_CORTEX_NAMESPACE
// ---------------------------------------------------------------- //
// ctor/dtor
// ---------------------------------------------------------------- //
MouseTrackingSourceView::MouseTrackingSourceView( MouseTrackingSourceView::MouseTrackingSourceView(BRect frame, const char* name,
BRect frame, uint32 resizeMode, uint32 flags, uint32 trackingFlags)
const char* pName, : BView(frame, name, resizeMode, flags),
uint32 resizeMode, m_pDest(0),
uint32 flags,
uint32 trackingFlags) :
BView(frame, pName, resizeMode, flags),
m_trackingFlags(trackingFlags), m_trackingFlags(trackingFlags),
m_bTracking(false), m_bTracking(false)
m_pDest(0) { {
//FrameResized(frame.Width(), frame.Height());
// FrameResized(frame.Width(), frame.Height()); }
MouseTrackingSourceView::~MouseTrackingSourceView()
{
} }
MouseTrackingSourceView::~MouseTrackingSourceView() {}
// get mouse-down point in screen coordinates; returns // get mouse-down point in screen coordinates; returns
// B_OK on success, or B_ERROR if no longer tracking // B_OK on success, or B_ERROR if no longer tracking