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

« back to all changes in this revision

Viewing changes to pgadmin/debugger/ctlTabWindow.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
// ctlTabWindow.cpp - debugger
21
21
#include "debugger/dbgConst.h"
22
22
 
23
23
 
24
 
IMPLEMENT_CLASS( ctlTabWindow, wxWindow )
 
24
IMPLEMENT_CLASS(ctlTabWindow, wxWindow)
25
25
 
26
26
////////////////////////////////////////////////////////////////////////////////
27
27
// ctlTabWindow constructor
29
29
//    This constructor creates a new notebook (a tab control) and clears out the
30
30
//  rest of the data members.
31
31
//
32
 
 
33
 
ctlTabWindow::ctlTabWindow( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style, const wxString &name )
34
 
        : ctlAuiNotebook( parent, id, pos, size, style ),
35
 
          m_resultWindow( 0 ),
36
 
          m_varWindow( 0 ),
37
 
          m_pkgVarWindow( 0 ),
38
 
          m_stackWindow( 0 ),
39
 
          m_paramWindow( 0 ),
40
 
          m_messageWindow( 0 )
 
32
ctlTabWindow::ctlTabWindow(wxWindow *parent, wxWindowID id, const wxPoint &pos,
 
33
                           const wxSize &size, long style, const wxString &name)
 
34
        : ctlAuiNotebook(parent, id, pos, size, style),
 
35
          m_resultWindow(NULL),
 
36
          m_varWindow(NULL),
 
37
          m_pkgVarWindow(NULL),
 
38
          m_stackWindow(NULL),
 
39
          m_paramWindow(NULL),
 
40
          m_messageWindow(NULL)
41
41
{
42
42
        wxWindowBase::SetFont(settings->GetSystemFont());
43
43
        m_tabMap   = new wsTabHash();
44
44
}
45
45
 
46
 
void ctlTabWindow::selectTab( wxWindowID id )
 
46
void ctlTabWindow::SelectTab(wxWindowID id)
47
47
{
48
 
        wsTabHash::iterator result = m_tabMap->find( id );
 
48
        wsTabHash::iterator result = m_tabMap->find(id);
49
49
 
50
 
        if( result != m_tabMap->end())
 
50
        if (result != m_tabMap->end())
51
51
        {
52
 
                SetSelection( result->second );
 
52
                SetSelection(result->second);
53
53
        }
54
54
}
55
55
 
56
56
////////////////////////////////////////////////////////////////////////////////
57
 
// getResultWindow()
 
57
// GetResultWindow()
58
58
//
59
59
//    This function returns a pointer to our child result window (m_resultWindow)
60
60
//  and creates that window when we first need it.
61
61
//
62
 
 
63
 
ctlResultGrid *ctlTabWindow::getResultWindow( void )
 
62
ctlResultGrid *ctlTabWindow::GetResultWindow()
64
63
{
65
 
        if( m_resultWindow == 0 )
 
64
        if (m_resultWindow == 0)
66
65
        {
67
66
                // We don't have a result window yet - go ahead and create one
68
67
 
69
 
                m_resultWindow = new ctlResultGrid( this, -1 );
70
 
                AddPage( m_resultWindow, _( "Results" ), true );
 
68
                m_resultWindow = new ctlResultGrid(this, -1);
 
69
                AddPage(m_resultWindow, _("Results"), true);
71
70
        }
72
71
 
73
 
        return( m_resultWindow );
 
72
        return m_resultWindow;
74
73
}
75
74
 
76
75
////////////////////////////////////////////////////////////////////////////////
77
 
// getVarWindow()
 
76
// GetVarWindow()
78
77
//
79
78
//    This function returns a pointer to our child 'local-variables' window
80
79
//  (m_varWindow) and creates that window when we first need it.
81
80
//
82
 
 
83
 
ctlVarWindow *ctlTabWindow::getVarWindow( bool create )
 
81
ctlVarWindow *ctlTabWindow::GetVarWindow(bool _create)
84
82
{
85
 
        if(( m_varWindow == NULL ) && create )
 
83
        if ((m_varWindow == NULL) && _create)
86
84
        {
87
85
                // We don't have a variable window yet - go ahead and create one
88
86
 
89
87
                (*m_tabMap)[ID_VARGRID] = GetPageCount();
90
88
 
91
 
                m_varWindow = new ctlVarWindow( this, ID_VARGRID );
92
 
                AddPage( m_varWindow, _( "Local Variables" ), true );
 
89
                m_varWindow = new ctlVarWindow(this, ID_VARGRID);
 
90
                AddPage(m_varWindow, _("Local Variables"), true);
93
91
        }
94
92
 
95
 
        return( m_varWindow );
 
93
        return m_varWindow;
96
94
}
97
95
 
98
96
////////////////////////////////////////////////////////////////////////////////
99
 
// getPkgVarWindow()
 
97
// GetPkgVarWindow()
100
98
//
101
99
//  This function returns a pointer to our child 'package-variables' window
102
100
//  (m_varWindow) and creates that window when we first need it.
103
101
//
104
 
 
105
 
ctlVarWindow *ctlTabWindow::getPkgVarWindow( bool create )
 
102
ctlVarWindow *ctlTabWindow::GetPkgVarWindow(bool create)
106
103
{
107
 
        if(( m_pkgVarWindow == NULL ) && create )
 
104
        if ((m_pkgVarWindow == NULL) && create)
108
105
        {
109
106
                // We don't have a variable window yet - go ahead and create one
110
107
 
111
108
                (*m_tabMap)[ID_PKGVARGRID] = GetPageCount();
112
109
 
113
 
                m_pkgVarWindow = new ctlVarWindow( this, ID_PKGVARGRID );
114
 
                AddPage( m_pkgVarWindow, _( "Package Variables" ), true );
 
110
                m_pkgVarWindow = new ctlVarWindow(this, ID_PKGVARGRID);
 
111
                AddPage(m_pkgVarWindow, _("Package Variables"), true);
115
112
        }
116
113
 
117
 
        return( m_pkgVarWindow );
 
114
        return m_pkgVarWindow;
118
115
}
119
116
 
120
117
////////////////////////////////////////////////////////////////////////////////
121
 
// getParamWindow()
 
118
// GetParamWindow()
122
119
//
123
120
//    This function returns a pointer to our child 'parameters' window
124
121
//  (m_paramWindow) and creates that window when we first need it.
125
122
//
126
 
 
127
 
ctlVarWindow *ctlTabWindow::getParamWindow( bool create )
 
123
ctlVarWindow *ctlTabWindow::GetParamWindow(bool create)
128
124
{
129
 
        if(( m_paramWindow == NULL ) && create )
 
125
        if ((m_paramWindow == NULL) && create)
130
126
        {
131
127
                // We don't have a variable window yet - go ahead and create one
132
128
 
133
129
                (*m_tabMap)[ID_PARAMGRID] = GetPageCount();
134
130
 
135
 
                m_paramWindow = new ctlVarWindow( this, ID_PARAMGRID );
136
 
                AddPage( m_paramWindow, _( "Parameters" ), true );
 
131
                m_paramWindow = new ctlVarWindow(this, ID_PARAMGRID);
 
132
                AddPage(m_paramWindow, _("Parameters"), true);
137
133
        }
138
134
 
139
 
        return( m_paramWindow );
 
135
        return m_paramWindow;
140
136
}
141
137
 
142
138
////////////////////////////////////////////////////////////////////////////////
143
 
// getMessageWindow()
 
139
// GetMessageWindow()
144
140
//
145
141
//    This function returns a pointer to our child 'messages' window
146
142
//  (m_messageWindow) and creates that window when we first need it.
147
143
//
148
 
 
149
 
ctlMessageWindow *ctlTabWindow::getMessageWindow( void )
 
144
ctlMessageWindow *ctlTabWindow::GetMessageWindow()
150
145
{
151
 
        if( m_messageWindow == 0 )
 
146
        if (m_messageWindow == 0)
152
147
        {
153
148
                // We don't have a variable window yet - go ahead and create one
154
149
 
155
150
                (*m_tabMap)[ID_MSG_PAGE] = GetPageCount();
156
151
 
157
 
                m_messageWindow = new ctlMessageWindow( this, ID_MSG_PAGE );
158
 
                AddPage( m_messageWindow, _( "DBMS Messages" ), true );
 
152
                m_messageWindow = new ctlMessageWindow(this, ID_MSG_PAGE);
 
153
                AddPage(m_messageWindow, _("DBMS Messages"), true);
159
154
        }
160
 
        return( m_messageWindow );
 
155
        return m_messageWindow;
161
156
}
162
157
 
163
158
////////////////////////////////////////////////////////////////////////////////
164
 
// getStackWindow()
 
159
// GetStackWindow()
165
160
//
166
161
//    This function returns a pointer to our child stack-trace window
167
162
//  (m_stackWindow) and creates that window when we first need it.
168
163
//
169
 
 
170
 
ctlStackWindow *ctlTabWindow::getStackWindow( )
 
164
ctlStackWindow *ctlTabWindow::GetStackWindow()
171
165
{
172
 
        if( m_stackWindow == 0 )
 
166
        if (m_stackWindow == 0)
173
167
        {
174
168
                // We don't have a stack-trace window yet - go ahead and create one
175
 
                m_stackWindow = new ctlStackWindow( this, -1 );
176
 
                AddPage( m_stackWindow, _( "Stack" ), true );
 
169
                m_stackWindow = new ctlStackWindow(this, -1);
 
170
                AddPage(m_stackWindow, _("Stack"), true);
177
171
        }
178
172
 
179
 
        return( m_stackWindow );
 
173
        return m_stackWindow;
180
174
}
181
175