* Drag messages can now also be started with a NULL bitmap pointer and an invalid
drag rectangle - this fixes bug #596, as Cortex obviously relies on this. * Added a comment on how dragging without a bitmap should be done (app_server should directly support this without needing to drag real bitmaps). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18964 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1265,7 +1265,7 @@ BView::EndRectTracking()
|
|||||||
void
|
void
|
||||||
BView::DragMessage(BMessage *message, BRect dragRect, BHandler *replyTo)
|
BView::DragMessage(BMessage *message, BRect dragRect, BHandler *replyTo)
|
||||||
{
|
{
|
||||||
if (!message || !dragRect.IsValid())
|
if (!message)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
do_owner_check_no_pick();
|
do_owner_check_no_pick();
|
||||||
@@ -1278,6 +1278,14 @@ BView::DragMessage(BMessage *message, BRect dragRect, BHandler *replyTo)
|
|||||||
GetMouse(&offset, &buttons, false);
|
GetMouse(&offset, &buttons, false);
|
||||||
offset -= dragRect.LeftTop();
|
offset -= dragRect.LeftTop();
|
||||||
|
|
||||||
|
if (!dragRect.IsValid()) {
|
||||||
|
DragMessage(message, NULL, B_OP_BLEND, offset, replyTo);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: that's not really what should happen - the app_server should take the chance
|
||||||
|
// *NOT* to need to drag a whole bitmap around but just a frame.
|
||||||
|
|
||||||
// create a drag bitmap for the rect
|
// create a drag bitmap for the rect
|
||||||
BBitmap *bitmap = new BBitmap(dragRect, B_RGBA32);
|
BBitmap *bitmap = new BBitmap(dragRect, B_RGBA32);
|
||||||
uint32 *bits = (uint32*)bitmap->Bits();
|
uint32 *bits = (uint32*)bitmap->Bits();
|
||||||
@@ -1320,8 +1328,13 @@ void
|
|||||||
BView::DragMessage(BMessage *message, BBitmap *image,
|
BView::DragMessage(BMessage *message, BBitmap *image,
|
||||||
drawing_mode dragMode, BPoint offset, BHandler *replyTo)
|
drawing_mode dragMode, BPoint offset, BHandler *replyTo)
|
||||||
{
|
{
|
||||||
// ToDo: is this correct? Isn't \a image allowed to be NULL?
|
if (message == NULL)
|
||||||
if (message == NULL || image == NULL)
|
return;
|
||||||
|
|
||||||
|
// TODO: workaround for drags without a bitmap - should not be necessary if
|
||||||
|
// we move the rectangle dragging into the app_server
|
||||||
|
image = new (nothrow) BBitmap(BRect(0, 0, 0, 0), B_RGBA32);
|
||||||
|
if (image == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (replyTo == NULL)
|
if (replyTo == NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user