Removed weird code in TermWindow::WindowActivated. Added basic
Archive(), Instantiate(), and unarchiving constructor. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21724 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
|
||||
#include "CodeConv.h"
|
||||
#include "PrefHandler.h"
|
||||
#include "TermBuffer.h"
|
||||
#include "TermWindow.h"
|
||||
#include "TermConst.h"
|
||||
|
||||
|
||||
@@ -155,6 +155,13 @@ TermView::TermView(BRect frame, const char *command)
|
||||
}
|
||||
|
||||
|
||||
TermView::TermView(BMessage *archive)
|
||||
:
|
||||
BView(archive)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TermView::_InitObject(const char *command)
|
||||
{
|
||||
@@ -194,6 +201,23 @@ TermView::~TermView()
|
||||
}
|
||||
|
||||
|
||||
/* static */
|
||||
BArchivable *
|
||||
TermView::Instantiate(BMessage* data)
|
||||
{
|
||||
if (validate_instantiation(data, "TermView"))
|
||||
return new TermView(data);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
TermView::Archive(BMessage* data, bool deep) const
|
||||
{
|
||||
return BView::Archive(data, deep);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TermView::GetPreferredSize(float *width, float *height)
|
||||
{
|
||||
|
||||
@@ -51,8 +51,11 @@ class TermBuffer;
|
||||
class TermView : public BView {
|
||||
public:
|
||||
TermView(BRect frame, const char *command = NULL);
|
||||
TermView(BMessage *archive);
|
||||
~TermView();
|
||||
|
||||
static BArchivable* Instantiate(BMessage* data);
|
||||
virtual status_t Archive(BMessage* data, bool deep = true) const;
|
||||
virtual void GetPreferredSize(float *width, float *height);
|
||||
|
||||
status_t AttachShell(Shell *shell);
|
||||
|
||||
@@ -523,15 +523,9 @@ TermWindow::MessageReceived(BMessage *message)
|
||||
|
||||
|
||||
void
|
||||
TermWindow::WindowActivated(bool)
|
||||
TermWindow::WindowActivated(bool activated)
|
||||
{
|
||||
#ifndef HAIKU_TARGET_PLATFORM_LIBBE_TEST
|
||||
if (focus_follows_mouse()) {
|
||||
BPoint aMouseLoc = Frame().LeftTop();
|
||||
set_mouse_position(int32(aMouseLoc.x + 16), int32(aMouseLoc.y + 2));
|
||||
be_app->SetCursor(B_HAND_CURSOR);
|
||||
}
|
||||
#endif
|
||||
BWindow::WindowActivated(activated);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user