File: ctlStackWindow.h

package info (click to toggle)
pgadmin3 1.20.0~beta2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 73,704 kB
  • ctags: 18,591
  • sloc: cpp: 193,786; ansic: 18,736; sh: 5,154; pascal: 1,120; yacc: 927; makefile: 516; lex: 421; xml: 126; perl: 40
file content (84 lines) | stat: -rw-r--r-- 2,395 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//////////////////////////////////////////////////////////////////////////
//
// pgAdmin III - PostgreSQL Tools
//
// Copyright (C) 2002 - 2014, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
// ctlStackWindow.h - debugger
//
//////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
//	class ctlStackWindow
//
//	This class implements the window that displays the current call stack at
//  bottom of the debugger window.  When we create a ctlStackWindow, the parent
//	is a ctlTabWindow (the ctlStackWindow becomes a tab in a tab control).
//
//	It is a simple grid control - the grid contains two columns:
//		the RowLabel column displays the stack level
//		column 0 displays the function name, line number and argument list
//
////////////////////////////////////////////////////////////////////////////////

#ifndef CTLSTACKWINDOW_H
#define CTLSTACKWINDOW_H

#include <wx/grid.h>
#include <wx/laywin.h>
#include <wx/listbox.h>
#include <wx/clntdata.h>

class dbgStackFrame : public wxClientData
{
public:
	dbgStackFrame(const wxString &_level, const wxString &_pkg,
	              const wxString &_func, const wxString &_desc)
		: m_level(_level), m_func(_func), m_pkg(_pkg), m_desc(_desc) {}

	dbgStackFrame(const dbgStackFrame &s)
		: m_level(s.m_level), m_func(s.m_func), m_pkg(s.m_pkg), m_desc(s.m_pkg) {}

	const wxString &GetLevel() const
	{
		return m_level;
	}
	const wxString &GetFunction() const
	{
		return m_func;
	}
	const wxString &GetPackage() const
	{
		return m_pkg;
	}
	const wxString &GetDescription() const
	{
		return m_desc;
	}

private:
	wxString m_level, m_func, m_pkg, m_desc;
};

WX_DECLARE_LIST(dbgStackFrame, dbgStackFrameList);


class ctlStackWindow : public wxListBox
{
	DECLARE_CLASS( ctlVarWindow )

public:
	ctlStackWindow(wxWindow *parent, wxWindowID id,
	               const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
	               long style = wxCLIP_CHILDREN | wxSW_3D,
	               const wxString &name = wxT("stackWindow"));

	// Remove all frames from the stack trace
	void ClearStack();
	// Add an array of frames to the stack trace
	void SetStack(const dbgStackFrameList &stacks, int selected = -1);
	void SelectFrame(const wxString &pkg, const wxString &frm);
};

#endif