Removed unused member variable, fixed drawing of highlight box, made style changes
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9907 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -11,54 +11,53 @@
|
|||||||
#include "DataTranslationsView.h"
|
#include "DataTranslationsView.h"
|
||||||
|
|
||||||
|
|
||||||
DataTranslationsView::DataTranslationsView(BRect rect, const char *name, list_view_type type = B_SINGLE_SELECTION_LIST) :
|
DataTranslationsView::DataTranslationsView(BRect rect, const char *name,
|
||||||
BListView(rect, name, B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL_SIDES)
|
list_view_type type = B_SINGLE_SELECTION_LIST)
|
||||||
|
: BListView(rect, name, B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL_SIDES)
|
||||||
{
|
{
|
||||||
|
|
||||||
messagerunner = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataTranslationsView::MessageReceived(BMessage *message)
|
DataTranslationsView::~DataTranslationsView()
|
||||||
{
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
DataTranslationsView::MessageReceived(BMessage *message)
|
||||||
|
{
|
||||||
uint32 type;
|
uint32 type;
|
||||||
int32 count;
|
int32 count;
|
||||||
|
|
||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
case B_SIMPLE_DATA:
|
case B_SIMPLE_DATA:
|
||||||
|
// Tell the application object that a
|
||||||
|
// file has been dropped on this view
|
||||||
message->GetInfo("refs", &type, &count);
|
message->GetInfo("refs", &type, &count);
|
||||||
if ( count>0 && type == B_REF_TYPE )
|
if (count > 0 && type == B_REF_TYPE) {
|
||||||
{
|
|
||||||
message->what = B_REFS_RECEIVED;
|
message->what = B_REFS_RECEIVED;
|
||||||
be_app->PostMessage(message);
|
be_app->PostMessage(message);
|
||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BView::MessageReceived(message);
|
BView::MessageReceived(message);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataTranslationsView::MouseMoved(BPoint point, uint32 transit, const BMessage *msg)
|
void
|
||||||
|
DataTranslationsView::MouseMoved(BPoint point, uint32 transit, const BMessage *msg)
|
||||||
{
|
{
|
||||||
if ((transit == B_ENTERED_VIEW) && (msg != NULL))
|
if (msg && transit == B_ENTERED_VIEW) {
|
||||||
{
|
// Draw a red box around the inside of the view
|
||||||
BRect x( 0, 0, 110, 278);
|
// to tell the user that this view accepts drops
|
||||||
SetHighColor(220,0,0);
|
SetHighColor(220,0,0);
|
||||||
SetPenSize(4);
|
SetPenSize(4);
|
||||||
StrokeRect(x);
|
StrokeRect(Bounds());
|
||||||
SetHighColor(0,0,0);
|
SetHighColor(0,0,0);
|
||||||
}
|
|
||||||
if ((transit == B_EXITED_VIEW) && (msg != NULL))
|
} else if (msg && transit == B_EXITED_VIEW)
|
||||||
{
|
Invalidate();
|
||||||
Invalidate();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DataTranslationsView::~DataTranslationsView()
|
|
||||||
{
|
|
||||||
if (messagerunner != NULL) delete messagerunner;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -10,22 +10,17 @@
|
|||||||
|
|
||||||
#include <interface/View.h>
|
#include <interface/View.h>
|
||||||
#include <interface/ListView.h>
|
#include <interface/ListView.h>
|
||||||
#include <app/MessageRunner.h>
|
|
||||||
|
|
||||||
|
|
||||||
class DataTranslationsView : public BListView {
|
class DataTranslationsView : public BListView {
|
||||||
public:
|
public:
|
||||||
DataTranslationsView(BRect rect,
|
DataTranslationsView(BRect rect, const char *name,
|
||||||
const char *name, list_view_type type = B_SINGLE_SELECTION_LIST );
|
list_view_type type = B_SINGLE_SELECTION_LIST);
|
||||||
|
|
||||||
~DataTranslationsView();
|
~DataTranslationsView();
|
||||||
void MessageReceived(BMessage *message);
|
|
||||||
virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *msg);
|
|
||||||
|
|
||||||
private:
|
void MessageReceived(BMessage *message);
|
||||||
|
|
||||||
|
virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *msg);
|
||||||
BMessageRunner *messagerunner;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user