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"
|
||||
|
||||
|
||||
DataTranslationsView::DataTranslationsView(BRect rect, const char *name, list_view_type type = B_SINGLE_SELECTION_LIST) :
|
||||
BListView(rect, name, B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL_SIDES)
|
||||
{
|
||||
|
||||
messagerunner = NULL;
|
||||
DataTranslationsView::DataTranslationsView(BRect rect, const char *name,
|
||||
list_view_type type = B_SINGLE_SELECTION_LIST)
|
||||
: BListView(rect, name, B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL_SIDES)
|
||||
{
|
||||
}
|
||||
|
||||
void DataTranslationsView::MessageReceived(BMessage *message)
|
||||
DataTranslationsView::~DataTranslationsView()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
DataTranslationsView::MessageReceived(BMessage *message)
|
||||
{
|
||||
uint32 type;
|
||||
int32 count;
|
||||
|
||||
switch (message->what) {
|
||||
case B_SIMPLE_DATA:
|
||||
// Tell the application object that a
|
||||
// file has been dropped on this view
|
||||
message->GetInfo("refs", &type, &count);
|
||||
if ( count>0 && type == B_REF_TYPE )
|
||||
{
|
||||
if (count > 0 && type == B_REF_TYPE) {
|
||||
message->what = B_REFS_RECEIVED;
|
||||
be_app->PostMessage(message);
|
||||
Invalidate();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
BView::MessageReceived(message);
|
||||
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))
|
||||
{
|
||||
BRect x( 0, 0, 110, 278);
|
||||
SetHighColor(220,0,0);
|
||||
if (msg && transit == B_ENTERED_VIEW) {
|
||||
// Draw a red box around the inside of the view
|
||||
// to tell the user that this view accepts drops
|
||||
SetHighColor(220,0,0);
|
||||
SetPenSize(4);
|
||||
StrokeRect(x);
|
||||
StrokeRect(Bounds());
|
||||
SetHighColor(0,0,0);
|
||||
}
|
||||
if ((transit == B_EXITED_VIEW) && (msg != NULL))
|
||||
{
|
||||
Invalidate();
|
||||
}
|
||||
return;
|
||||
|
||||
} else if (msg && transit == B_EXITED_VIEW)
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
|
||||
DataTranslationsView::~DataTranslationsView()
|
||||
{
|
||||
if (messagerunner != NULL) delete messagerunner;
|
||||
}
|
||||
|
||||
@@ -10,22 +10,17 @@
|
||||
|
||||
#include <interface/View.h>
|
||||
#include <interface/ListView.h>
|
||||
#include <app/MessageRunner.h>
|
||||
|
||||
|
||||
class DataTranslationsView : public BListView {
|
||||
public:
|
||||
DataTranslationsView(BRect rect,
|
||||
const char *name, list_view_type type = B_SINGLE_SELECTION_LIST );
|
||||
|
||||
~DataTranslationsView();
|
||||
void MessageReceived(BMessage *message);
|
||||
virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *msg);
|
||||
|
||||
private:
|
||||
public:
|
||||
DataTranslationsView(BRect rect, const char *name,
|
||||
list_view_type type = B_SINGLE_SELECTION_LIST);
|
||||
|
||||
~DataTranslationsView();
|
||||
|
||||
|
||||
BMessageRunner *messagerunner;
|
||||
void MessageReceived(BMessage *message);
|
||||
|
||||
virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *msg);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user