diff options
| author | Sam Hartman <hartmans@mit.edu> | 2011-09-28 21:02:14 +0000 |
|---|---|---|
| committer | Sam Hartman <hartmans@mit.edu> | 2011-09-28 21:02:14 +0000 |
| commit | caef99b21536d9e8c2f9c637fcf020b4e082db5d (patch) | |
| tree | b360ec8449876ea170691685cde758d9849fc8ef /src/windows/leash/LeashFrame.cpp | |
| parent | 8481c14298a1886f63bec0d7cdfd800a86b4c127 (diff) | |
| download | krb5-caef99b21536d9e8c2f9c637fcf020b4e082db5d.tar.gz krb5-caef99b21536d9e8c2f9c637fcf020b4e082db5d.tar.xz krb5-caef99b21536d9e8c2f9c637fcf020b4e082db5d.zip | |
Initial import of KFW 3.2.2 Leash32 code
Signed-off-by: Alexey Melnikov <aamelnikov@gmail.com>
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25278 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/windows/leash/LeashFrame.cpp')
| -rw-r--r-- | src/windows/leash/LeashFrame.cpp | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/src/windows/leash/LeashFrame.cpp b/src/windows/leash/LeashFrame.cpp new file mode 100644 index 000000000..f7e4b56e8 --- /dev/null +++ b/src/windows/leash/LeashFrame.cpp @@ -0,0 +1,119 @@ +// ************************************************************************************** +// File: LeashFrame.cpp +// By: Arthur David Leather +// Created: 12/02/98 +// Copyright @1998 Massachusetts Institute of Technology - All rights reserved. +// Description: CPP file for LeashFrame.h. Contains variables and functions +// for Leash +// +// History: +// +// MM/DD/YY Inits Description of Change +// 12/02/98 ADL Original +// ************************************************************************************** + + +#include "stdafx.h" +#include "LeashFrame.h" + +#ifdef _DEBUG +#undef THIS_FILE +static char BASED_CODE THIS_FILE[] = __FILE__; +#endif +/////////////////////////////////////////////////////////////// +// CLeashFrame + +const CRect CLeashFrame::s_rectDefault(0, 0, 740, 400); // static public (l,t,r,b) +const char CLeashFrame::s_profileHeading[] = "Window size"; +const char CLeashFrame::s_profileRect[] = "Rect"; +const char CLeashFrame::s_profileIcon[] = "icon"; +const char CLeashFrame::s_profileMax[] = "max"; +const char CLeashFrame::s_profileTool[] = "tool"; +const char CLeashFrame::s_profileStatus[] = "status"; + +IMPLEMENT_DYNAMIC(CLeashFrame, CFrameWnd) + +BEGIN_MESSAGE_MAP(CLeashFrame, CFrameWnd) + //{{AFX_MSG_MAP(CLeashFrame) + ON_WM_DESTROY() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +/////////////////////////////////////////////////////////////// +CLeashFrame::CLeashFrame() +{ + m_bFirstTime = TRUE; +} + +/////////////////////////////////////////////////////////////// +CLeashFrame::~CLeashFrame() +{ +} + +/////////////////////////////////////////////////////////////// +void CLeashFrame::OnDestroy() +{ + CString strText; + BOOL bIconic, bMaximized; + + WINDOWPLACEMENT wndpl; + wndpl.length = sizeof(WINDOWPLACEMENT); + // gets current window position and + // iconized/maximized status + BOOL bRet = GetWindowPlacement(&wndpl); + if (wndpl.showCmd == SW_SHOWNORMAL) + { + bIconic = FALSE; + bMaximized = FALSE; + } + else if (wndpl.showCmd == SW_SHOWMAXIMIZED) + { + bIconic = FALSE; + bMaximized = TRUE; + } + else if (wndpl.showCmd == SW_SHOWMINIMIZED) + { + bIconic = TRUE; + if (wndpl.flags) + { + bMaximized = TRUE; + } + else + { + bMaximized = FALSE; + } + } + + strText.Format("%04d %04d %04d %04d", + wndpl.rcNormalPosition.left, + wndpl.rcNormalPosition.top, + wndpl.rcNormalPosition.right, + wndpl.rcNormalPosition.bottom); + + AfxGetApp()->WriteProfileString(s_profileHeading, + s_profileRect, strText); + + AfxGetApp()->WriteProfileInt(s_profileHeading, + s_profileIcon, bIconic); + + AfxGetApp()->WriteProfileInt(s_profileHeading, + s_profileMax, bMaximized); + + SaveBarState(AfxGetApp()->m_pszProfileName); + + CFrameWnd::OnDestroy(); +} + +/////////////////////////////////////////////////////////////// +void CLeashFrame::ActivateFrame(int nCmdShow) +{ + + if (m_bFirstTime) + { + m_bFirstTime = FALSE; + + LoadBarState(AfxGetApp()->m_pszProfileName); + } + + CFrameWnd::ActivateFrame(nCmdShow); +} |
