Commit 235b3bcb authored by Eric Petit's avatar Eric Petit

beos/MessagesWindow*: fixed messages window

parent 8d3cfc4c
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
*****************************************************************************/ *****************************************************************************/
void MessagesView::Pulse() void MessagesView::Pulse()
{ {
#if 0
bool isScrolling = false; bool isScrolling = false;
if( fScrollBar->LockLooper() ) if( fScrollBar->LockLooper() )
{ {
...@@ -123,28 +122,28 @@ void MessagesView::Pulse() ...@@ -123,28 +122,28 @@ void MessagesView::Pulse()
} }
BTextView::Pulse(); BTextView::Pulse();
#endif
} }
/***************************************************************************** /*****************************************************************************
* MessagesWindow::MessagesWindow * MessagesWindow::MessagesWindow
*****************************************************************************/ *****************************************************************************/
MessagesWindow::MessagesWindow( intf_thread_t * p_intf, MessagesWindow::MessagesWindow( intf_thread_t * _p_intf,
BRect frame, const char * name ) BRect frame, const char * name )
: BWindow( frame, name, B_FLOATING_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, : BWindow( frame, name, B_FLOATING_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
B_NOT_ZOOMABLE ) B_NOT_ZOOMABLE ),
p_intf(_p_intf)
{ {
this->p_intf = p_intf;
SetSizeLimits( 400, 2000, 200, 2000 ); SetSizeLimits( 400, 2000, 200, 2000 );
p_sub = msg_Subscribe( p_intf );
BRect rect, textRect; BRect rect, textRect;
rect = Bounds(); rect = Bounds();
rect.right -= B_V_SCROLL_BAR_WIDTH; rect.right -= B_V_SCROLL_BAR_WIDTH;
textRect = rect; textRect = rect;
textRect.InsetBy( 5, 5 ); textRect.InsetBy( 5, 5 );
fMessagesView = new MessagesView( p_intf, fMessagesView = new MessagesView( p_sub,
rect, "messages", textRect, rect, "messages", textRect,
B_FOLLOW_ALL, B_WILL_DRAW ); B_FOLLOW_ALL, B_WILL_DRAW );
fMessagesView->MakeEditable( false ); fMessagesView->MakeEditable( false );
...@@ -164,6 +163,7 @@ MessagesWindow::MessagesWindow( intf_thread_t * p_intf, ...@@ -164,6 +163,7 @@ MessagesWindow::MessagesWindow( intf_thread_t * p_intf,
*****************************************************************************/ *****************************************************************************/
MessagesWindow::~MessagesWindow() MessagesWindow::~MessagesWindow()
{ {
msg_Unsubscribe( p_intf, p_sub );
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -29,17 +29,16 @@ ...@@ -29,17 +29,16 @@
class MessagesView : public BTextView class MessagesView : public BTextView
{ {
public: public:
MessagesView( intf_thread_t * _p_intf, MessagesView( msg_subscription_t * _p_sub,
BRect rect, char * name, BRect textRect, BRect rect, char * name, BRect textRect,
uint32 resizingMode, uint32 flags ) uint32 resizingMode, uint32 flags )
: BTextView( rect, name, textRect, : BTextView( rect, name, textRect,
resizingMode, flags ) resizingMode, flags ),
p_sub(_p_sub)
{ {
p_intf = _p_intf;
} }
virtual void Pulse(); virtual void Pulse();
intf_thread_t * p_intf;
msg_subscription_t * p_sub; msg_subscription_t * p_sub;
BScrollBar * fScrollBar; BScrollBar * fScrollBar;
}; };
...@@ -56,6 +55,7 @@ class MessagesWindow : public BWindow ...@@ -56,6 +55,7 @@ class MessagesWindow : public BWindow
void ReallyQuit(); void ReallyQuit();
intf_thread_t * p_intf; intf_thread_t * p_intf;
msg_subscription_t * p_sub;
BView * fBackgroundView; BView * fBackgroundView;
MessagesView * fMessagesView; MessagesView * fMessagesView;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment