\file CMoveConstraint.cpp
\author Perry Rapp, Creator, 1998-2004
\date Created: 1998
- \date Edited: 2004/04/22 Perry Rapp
+ \date Edited: 2005-07-26 (Perry Rapp)
\brief Implementation of CMoveConstraint
CMoveConstraint::CMoveConstraint()
{
m_bSubclassed = false;
- m_sKey = _T("UnnamedWindow");
+ m_sRegistryValueName = _T("UnnamedWindow");
+ m_sRegistrySubkey = _T("LastWindowPos");
ClearMostData();
}
return false;
}
+/**
+ * Save size (& optionally position) in registry
+ */
+void
+CMoveConstraint::LoadPosition(LPCTSTR szKeyName, LPCTSTR szValueName, bool position)
+{
+ m_sRegistrySubkey = szKeyName;
+ LoadPosition(szValueName, position);
+}
+/**
+ * Save size (& optionally position) in registry
+ */
void
-CMoveConstraint::LoadPosition(LPCTSTR szName, bool position)
+CMoveConstraint::LoadPosition(LPCTSTR szValueName, bool position)
{
- m_sKey = szName;
+ m_sRegistryValueName = szValueName;
m_bPersistent=true;
Persist(false, position);
}
void
CMoveConstraint::Persist(bool saving, bool position)
{
- LPCTSTR szSection = _T("LastWindowPos");
+ LPCTSTR szSection = m_sRegistrySubkey;
WINDOWPLACEMENT wp;
wp.length=sizeof(wp);
if (saving)
GetWindowPlacement(m_hwndDlg, &wp);
RECT & rc = wp.rcNormalPosition;
str.Format(_T("%d,%d,%d,%d"), rc.left, rc.top, rc.right, rc.bottom);
- AfxGetApp()->WriteProfileString(szSection, m_sKey, str);
+ AfxGetApp()->WriteProfileString(szSection, m_sRegistryValueName, str);
}
else
{
- CString str = AfxGetApp()->GetProfileString(szSection, m_sKey);
+ CString str = AfxGetApp()->GetProfileString(szSection, m_sRegistryValueName);
GetWindowPlacement(m_hwndDlg, &wp);
CRect rc;
int ct=_stscanf(str, _T("%d,%d,%d,%d"), &rc.left, &rc.top, &rc.right, &rc.bottom);
\file CMoveConstraint.h
\author Perry Rapp, Creator, 1998-2004
\date Created: 1998
- \date Edited: 2004/04/22 PR
+ \date Edited: 2005-07-26 (Perry Rapp)
\brief Declaration of CMoveConstraint
bool UnSubclassWnd();
// call after all constraints established
- void LoadPosition(LPCTSTR szName, bool position); // always loads size, may also set position
+ // always loads size, may also set position
+ void LoadPosition(LPCTSTR szKeyName, LPCTSTR szValueName, bool position);
+ void LoadPosition(LPCTSTR szValueName, bool position);
// for use when children hadn't been created yet at initialization time
// so their constraints had to be buffered to be initialized later
ConstraintList m_ConstraintList;
bool m_bConstrainNonChildren;
bool m_bPersistent; // whether to save position to registry
- CString m_sKey;
+ CString m_sRegistrySubkey; // defaults to _T("LastWindowPos")
+ CString m_sRegistryValueName; // should be name of window
// tooltips
CMap<UINT, UINT, tip, tip&> m_tips;
};
m_constraint.ConstrainItem(IDCANCEL, 1, 0, 0, 0); // slides right
m_constraint.DisallowHeightGrowth();
m_constraint.SubclassWnd(); // install subclassing
- m_constraint.LoadPosition(_T("OpenDlg"), false); // persist size via registry
+ m_constraint.LoadPosition(_T("ResizeableDialogs"), _T("OpenDlg"), false); // persist size via registry
CenterToMainFrame();
m_constraint.ConstrainItem(IDCANCEL, 1, 0, 0, 0); // slides right
m_constraint.DisallowHeightGrowth();
m_constraint.SubclassWnd(); // install subclassing
- m_constraint.LoadPosition(_T("SaveClosingDlg"), false); // persist size via registry
+ m_constraint.LoadPosition(_T("ResizeableDialogs"), _T("SaveClosingDlg"), false); // persist size via registry
return FALSE; // return TRUE unless you set the focus to a control
PATCH: [ 1242008 ] Update status to binary if open fails because binary
Src: DiffItem.h DiffItemList.cpp DiffItemList.h DirDoc.h DirView.cpp
MainFrm.cpp MainFrm.h MergeDoc.cpp MergeDoc.h
+ PATCH: [ 1208208 ] Move resizeable dialogs position in registry
+ Src: OpenDlg.cpp SaveClosingDlg.cpp
+ Src/Common: CMoveConstraint.cpp CMoveConstraint.h
+
2005-07-26 Kimmo
PATCH: [ 1244804 ] Add hourglass for report creating