-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDatabaseExplorerView.h
77 lines (63 loc) · 2.32 KB
/
DatabaseExplorerView.h
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
// DatabaseExplorerView.h : interface of the CDatabaseExplorerView class
//
#pragma once
#include "ColorListView.h"
#include "DBRecord.h"
#include <vector>
class CDatabaseExplorerView : public CColorListView
{
protected: // create from serialization only
CDatabaseExplorerView() noexcept = default;
DECLARE_DYNCREATE(CDatabaseExplorerView)
// Attributes
public:
CDatabaseExplorerDoc* GetDocument() const;
BOOL GetPopulateMode() const { return m_bPopulateMode; }
// Operations
public:
// Overrides
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual void OnInitialUpdate(); // called first time after construct
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
// Implementation
public:
virtual ~CDatabaseExplorerView() = default;
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
void ExecuteSQL(CDatabaseExplorerDoc& doc, const CString& sSQL);
void ExecuteSelect(CDatabaseExplorerDoc& doc, const CString& sSQL);
void DeleteAllColumns();
private:
BOOL m_bPopulateMode{ FALSE };
std::vector<std::unique_ptr<CDBRecord>> m_arrRows{};
// Generated message map functions
protected:
afx_msg void OnTimer(UINT_PTR nIDEvent);
afx_msg void OnFilePrintPreview();
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
afx_msg void OnEditRefresh();
afx_msg void OnEditRun();
afx_msg LRESULT OnPostInit(WPARAM wParam, LPARAM lParam);
afx_msg void OnLvnGetdispinfo(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnLvnOdcachehint(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnFileSave();
afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI);
afx_msg LRESULT OnIsPopulateMode(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnRestoreQueries(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnDarkMode(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in DatabaseExplorerView.cpp
inline CDatabaseExplorerDoc* CDatabaseExplorerView::GetDocument() const
{ return reinterpret_cast<CDatabaseExplorerDoc*>(m_pDocument); }
#endif