Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/ResizableLib/ResizableState.cpp')
-rw-r--r--src/ui/ResizableLib/ResizableState.cpp116
1 files changed, 58 insertions, 58 deletions
diff --git a/src/ui/ResizableLib/ResizableState.cpp b/src/ui/ResizableLib/ResizableState.cpp
index 748038d1a..8ea464d03 100644
--- a/src/ui/ResizableLib/ResizableState.cpp
+++ b/src/ui/ResizableLib/ResizableState.cpp
@@ -6,7 +6,7 @@
// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
//
// The contents of this file are subject to the Artistic License (the "License").
-// You may not use this file except in compliance with the License.
+// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.opensource.org/licenses/artistic-license.html
//
@@ -41,65 +41,65 @@ CResizableState::~CResizableState()
BOOL CResizableState::SaveWindowRect(LPCTSTR pszSection, BOOL bRectOnly)
{
- CString data;
- WINDOWPLACEMENT wp;
-
- ZeroMemory(&wp, sizeof(WINDOWPLACEMENT));
- wp.length = sizeof(WINDOWPLACEMENT);
- if (!GetResizableWnd()->GetWindowPlacement(&wp))
- return FALSE;
-
- RECT& rc = wp.rcNormalPosition; // alias
-
- if (bRectOnly) // save size/pos only (normal state)
- {
- // use screen coordinates
- GetResizableWnd()->GetWindowRect(&rc);
-
- data.Format(PLACEMENT_FMT, rc.left, rc.top,
- rc.right, rc.bottom, SW_NORMAL, 0);
- }
- else // save also min/max state
- {
- // use workspace coordinates
- data.Format(PLACEMENT_FMT, rc.left, rc.top,
- rc.right, rc.bottom, wp.showCmd, wp.flags);
- }
-
- return AfxGetApp()->WriteProfileString(pszSection, PLACEMENT_ENT, data);
+ CString data;
+ WINDOWPLACEMENT wp;
+
+ ZeroMemory(&wp, sizeof(WINDOWPLACEMENT));
+ wp.length = sizeof(WINDOWPLACEMENT);
+ if(!GetResizableWnd()->GetWindowPlacement(&wp))
+ return FALSE;
+
+ RECT& rc = wp.rcNormalPosition; // alias
+
+ if(bRectOnly) // save size/pos only (normal state)
+ {
+ // use screen coordinates
+ GetResizableWnd()->GetWindowRect(&rc);
+
+ data.Format(PLACEMENT_FMT, rc.left, rc.top,
+ rc.right, rc.bottom, SW_NORMAL, 0);
+ }
+ else // save also min/max state
+ {
+ // use workspace coordinates
+ data.Format(PLACEMENT_FMT, rc.left, rc.top,
+ rc.right, rc.bottom, wp.showCmd, wp.flags);
+ }
+
+ return AfxGetApp()->WriteProfileString(pszSection, PLACEMENT_ENT, data);
}
BOOL CResizableState::LoadWindowRect(LPCTSTR pszSection, BOOL bRectOnly)
{
- CString data;
- WINDOWPLACEMENT wp;
-
- data = AfxGetApp()->GetProfileString(pszSection, PLACEMENT_ENT);
-
- if (data.IsEmpty()) // never saved before
- return FALSE;
-
- ZeroMemory(&wp, sizeof(WINDOWPLACEMENT));
- wp.length = sizeof(WINDOWPLACEMENT);
- if (!GetResizableWnd()->GetWindowPlacement(&wp))
- return FALSE;
-
- RECT& rc = wp.rcNormalPosition; // alias
-
- if (_stscanf(data, PLACEMENT_FMT, &rc.left, &rc.top,
- &rc.right, &rc.bottom, &wp.showCmd, &wp.flags) == 6)
- {
- if (bRectOnly) // restore size/pos only
- {
- CRect rect(rc);
- return GetResizableWnd()->SetWindowPos(NULL, rect.left, rect.top,
- rect.Width(), rect.Height(), SWP_NOACTIVATE | SWP_NOZORDER |
- SWP_NOREPOSITION);
- }
- else // restore also min/max state
- {
- return GetResizableWnd()->SetWindowPlacement(&wp);
- }
- }
- return FALSE;
+ CString data;
+ WINDOWPLACEMENT wp;
+
+ data = AfxGetApp()->GetProfileString(pszSection, PLACEMENT_ENT);
+
+ if(data.IsEmpty()) // never saved before
+ return FALSE;
+
+ ZeroMemory(&wp, sizeof(WINDOWPLACEMENT));
+ wp.length = sizeof(WINDOWPLACEMENT);
+ if(!GetResizableWnd()->GetWindowPlacement(&wp))
+ return FALSE;
+
+ RECT& rc = wp.rcNormalPosition; // alias
+
+ if(_stscanf(data, PLACEMENT_FMT, &rc.left, &rc.top,
+ &rc.right, &rc.bottom, &wp.showCmd, &wp.flags) == 6)
+ {
+ if(bRectOnly) // restore size/pos only
+ {
+ CRect rect(rc);
+ return GetResizableWnd()->SetWindowPos(NULL, rect.left, rect.top,
+ rect.Width(), rect.Height(), SWP_NOACTIVATE | SWP_NOZORDER |
+ SWP_NOREPOSITION);
+ }
+ else // restore also min/max state
+ {
+ return GetResizableWnd()->SetWindowPlacement(&wp);
+ }
+ }
+ return FALSE;
}