[91ef65]: CompareResultsDlg.h Maximize Restore History

Download this file

CompareResultsDlg.h    143 lines (123 with data), 4.4 kB

  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
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*
* Copyright (c) 2003-2007 Rony Shapiro <ronys@users.sourceforge.net>.
* All rights reserved. Use of the code is allowed under the
* Artistic License terms, as specified in the LICENSE file
* distributed with this code, or available from
* http://www.opensource.org/licenses/artistic-license.php
*/
#pragma once
/// CompareResultsDlg.h
//-----------------------------------------------------------------------------
#include "afxwin.h"
#include "corelib/ItemData.h"
#include "corelib/MyString.h"
// The following structure is needed for compare when record is in
// both databases (column = -1) but there are differences
// Subset used when record is in only one (column = 0 or 1)
// If entries made equal by copying, column set to -2.
struct st_CompareData {
POSITION pos0;
POSITION pos1;
CItemData::FieldBits bsDiffs;
CMyString group;
CMyString title;
CMyString user;
int column;
int listindex;
bool unknflds0;
bool unknflds1;
int id;
};
// Vector of entries passed from DboxMain::Compare to CompareResultsDlg
// Used for "Only in Original DB", "only in Comparison DB" and
// in "Both with Differences"
typedef std::vector<st_CompareData> CompareData;
// The following structure is needed for compare to send back data
// to allow copying, viewing and editing of entries
struct st_CompareInfo {
PWScore *pcore0;
PWScore *pcore1;
POSITION pos0;
POSITION pos1;
int column;
};
class CCompareResultsDlg : public CDialog
{
DECLARE_DYNAMIC(CCompareResultsDlg)
// Construction
public:
CCompareResultsDlg(CWnd* pParent,
CompareData &OnlyInCurrent,
CompareData &OnlyInComp,
CompareData &Conflicts,
CompareData &Identical,
CItemData::FieldBits &bsFields,
PWScore *pcore0, PWScore *pcore1);
// st_CompareInfo Functions
enum {EDIT = 0, VIEW, COPY_TO_ORIGINALDB, COPY_TO_COMPARISONDB};
// Column indices
enum {CURRENT = 0, COMPARE, GROUP, TITLE, USER, PASSWORD, NOTES, URL,
AUTOTYPE, PWHIST, CTIME, ATIME, LTIME, PMTIME, RMTIME,
LAST};
// Dialog Data
//{{AFX_DATA(CCompareResultsDlg)
enum { IDD = IDD_COMPARE_RESULTS };
CListCtrl m_LCResults;
int m_iSortedColumn;
bool m_bSortAscending;
CMyString m_cs_Filename1, m_cs_Filename2;
int m_ShowIdenticalEntries;
//}}AFX_DATA
bool m_bOriginalDBReadOnly, m_bComparisonDBReadOnly;
bool m_OriginalDBChanged, m_ComparisonDBChanged;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCompareResultsDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
private:
static int CALLBACK CRCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
// Implementation
protected:
UINT statustext[1];
CStatusBar m_statusBar;
bool CopyLeftOrRight(const bool bCopyLeft);
void UpdateStatusBar();
bool ProcessFunction(const int ifunction);
virtual BOOL OnInitDialog();
// Generated message map functions
//{{AFX_MSG(CCompareResultsDlg)
virtual void OnCancel();
virtual void OnOK();
afx_msg void OnHelp();
afx_msg void OnCopyToClipboard();
afx_msg void OnShowIdenticalEntries();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
afx_msg void OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnItemDoubleClick(NMHDR* pNotifyStruct, LRESULT* result);
afx_msg void OnItemRightClick(NMHDR* pNotifyStruct, LRESULT* result);
afx_msg void OnCompareViewEdit();
afx_msg void OnCompareCopyToOriginalDB();
afx_msg void OnCompareCopyToComparisonDB();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CompareData m_OnlyInCurrent;
CompareData m_OnlyInComp;
CompareData m_Conflicts;
CompareData m_Identical;
CItemData::FieldBits m_bsFields;
PWScore *m_pcore0, *m_pcore1;
int m_numOnlyInCurrent, m_numOnlyInComp, m_numConflicts, m_numIdentical;
int m_cxBSpace, m_cyBSpace, m_cySBar;
int m_DialogMinWidth, m_DialogMinHeight;
int m_DialogMaxWidth, m_DialogMaxHeight;
int m_row, m_column;
int m_nCols;
};
//-----------------------------------------------------------------------------
// Local variables:
// mode: c++
// End: