~ubuntu-branches/ubuntu/utopic/pgadmin3/utopic-proposed

« back to all changes in this revision

Viewing changes to pgadmin/debugger/ctlMessageWindow.cpp

  • Committer: Package Import Robot
  • Author(s): Christoph Berg
  • Date: 2013-09-10 16:16:38 UTC
  • mfrom: (1.3.4)
  • Revision ID: package-import@ubuntu.com-20130910161638-wwup1q553ylww7dr
Tags: 1.18.0-1
* New upstream release.
* Don't install /usr/bin/png2c anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
//
3
3
// pgAdmin III - PostgreSQL Tools
4
4
//
5
 
// Copyright (C) 2002 - 2012, The pgAdmin Development Team
 
5
// Copyright (C) 2002 - 2013, The pgAdmin Development Team
6
6
// This software is released under the PostgreSQL Licence
7
7
//
8
8
// ctlMessageWindow.cpp - debugger
17
17
// App headers
18
18
#include "debugger/ctlMessageWindow.h"
19
19
 
20
 
IMPLEMENT_CLASS( ctlMessageWindow, wxTextCtrl )
 
20
IMPLEMENT_CLASS(ctlMessageWindow, wxTextCtrl)
 
21
 
 
22
BEGIN_EVENT_TABLE(ctlMessageWindow, wxTextCtrl)
 
23
        EVT_TIMER(wxID_ANY,       ctlMessageWindow::OnTimer)
 
24
END_EVENT_TABLE()
21
25
 
22
26
////////////////////////////////////////////////////////////////////////////////
23
27
// ctlMessageWindow constructor
25
29
//  Initialize the grid control and clear it out....
26
30
//
27
31
 
28
 
ctlMessageWindow::ctlMessageWindow( wxWindow *parent, wxWindowID id )
29
 
        : wxTextCtrl( parent, wxID_ANY, wxT(""), wxPoint(0, 0), wxSize(0, 0),
30
 
                      wxTE_MULTILINE | wxTE_READONLY)
 
32
ctlMessageWindow::ctlMessageWindow(wxWindow *parent, wxWindowID id)
 
33
        : wxTextCtrl(parent, wxID_ANY, wxT(""), wxPoint(0, 0), wxSize(0, 0),
 
34
                     wxTE_MULTILINE | wxTE_READONLY)
31
35
{
32
36
        SetFont(settings->GetSQLFont());
 
37
        m_timer.SetOwner(this);
33
38
}
34
39
 
35
40
////////////////////////////////////////////////////////////////////////////////
36
 
// addMessage()
 
41
// AddMessage()
37
42
//
38
43
//    Adds the message in the 'DBMS Messages' window.
39
44
//
40
45
 
41
 
void ctlMessageWindow::addMessage( wxString message )
42
 
{
43
 
        AppendText(message + wxT("\n"));
 
46
void ctlMessageWindow::AddMessage(wxString message)
 
47
{
 
48
        m_mutex.Lock();
 
49
        m_currMsg += message + wxT("\n");
 
50
        m_mutex.Unlock();
 
51
 
 
52
        if (!m_timer.IsRunning())
 
53
                m_timer.Start(100, true);
 
54
}
 
55
 
 
56
void ctlMessageWindow::OnTimer(wxTimerEvent &ev)
 
57
{
 
58
        m_mutex.Lock();
 
59
        AppendText(m_currMsg);
 
60
        m_currMsg = wxEmptyString;
 
61
        m_mutex.Unlock();
44
62
}
45
63
 
46
64
////////////////////////////////////////////////////////////////////////////////
49
67
//    Removes the given message from the 'DBMS Messages' window.
50
68
//
51
69
 
52
 
void ctlMessageWindow::delMessage( const char *name )
 
70
void ctlMessageWindow::DelMessage(const char *name)
53
71
{
54
72
        SetValue(wxT(""));
55
73
}
56
74
 
57
75
 
58
 
wxString ctlMessageWindow::getMessage( int row )
 
76
wxString ctlMessageWindow::GetMessage(int row)
59
77
{
60
 
        return( GetValue());
 
78
        return(GetValue());
61
79
}